Files
vps-tracker/apps/api/src/services/billmanager/profiles/README.md
T
DenozordecandCursor b7a4a10333
Docker / build (push) Failing after 19s
feat(billmanager): профили ihor, cloudrix, servhost, landvps, datacheap
Гео из datacentername, specs через vds.order/vds.edit; парсер ДЦ/городов РФ.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-20 00:30:15 +07:00

3.1 KiB
Raw Blame History

BILLmanager hoster profiles

Унифицированные переопределители для исключений из стандартного ISPsystem API.

Как добавить профиль (5 минут)

  1. Создай profiles/<id>.ts с только расхождениями:
import type { BillmanagerProfileOverrides } from './types.js'

export const myHosterOverrides: BillmanagerProfileOverrides = {
  id: 'myhoster',
  match: {
    hostnames: ['myhoster.com'],
    keywords: ['myhoster'],
  },
  funcs: {
    listVds: 'vds.custom', // если отличается от 'vds'
  },
  // map: { enrichVds: (item, mapped) => ({ ...mapped, country: 'DE' }) },
  // requestParams: { listVds: { p_cnt: 1000 } },
}
  1. Зарегистрируй в registry.ts — массив PROFILE_OVERRIDES (порядок = приоритет матча).

  2. Добавь fixture + тест в profiles.test.ts.

  3. Новый hook (редко) — расширь BillmanagerProfile в types.ts и значение в default.ts.

Контракт

Поле Назначение
match.hostnames substring hostname
match.keywords substring всего URL
funcs.* func= для list / payment / dashboard / order
extract.* ключ для extractList
map.vds / map.payment полный маппер
map.enrichVds пост-обработка после default map
requestParams.* доп. query params

resolveBillmanagerProfile(apiBaseUrl)merge(DEFAULT, override) или DEFAULT.

Sync и operations не содержат if (hoster) — только профиль.

Готовые профили

id Match Что переопределяет
waicore waicore.com / keyword funcs.listVds = vds.vps; geo из datacentername ([DE] Город | … / Страна, Город)
firstbyte firstbyte.ru, firstbyte.club, 1byte.ru enrichVds: страна/город, daily из billdaily/Ежедневное списание, dailyRate=cost/30; enrichVdsBatch: общий баланс ÷ сумма daily → один paidUntil; specs из vds.order / vds.edit
ihor my-ihor.ru, ihor.ru / keyword enrichVds: geo из datacentername (Москва DC3 → Россия / Москва)
cloudrix cloudrix.ru / keyword enrichVds: geo (Россия, Москва) + ipv6_subnet; specs через vds.order / vds.edit (fetchVdsEditForSpecs)
servhost serv.host enrichVds: geo (Новосибирск Xeon → Россия / Новосибирск); specs через vds.order / vds.edit
landvps landvps.online / keyword enrichVds: geo (ДЦ Москва → Россия / Москва) + ipv6_subnet; specs через vds.order / vds.edit
datacheap datacheap.ru / keyword enrichVds: geo (Россия); specs через vds.order / vds.edit