{"version":3,"file":"b24-helper.mjs","sources":["../../../src/types/b24-helper.ts"],"sourcesContent":["import type { DateTime } from 'luxon'\nimport type { BoolString, GenderString } from './common'\n\nexport enum LoadDataType {\n  App = 'app',\n  Profile = 'profile',\n  Currency = 'currency',\n  AppOptions = 'appOptions',\n  UserOptions = 'userOptions'\n}\n\nexport type TypeUser = {\n  readonly isAdmin: boolean\n\n  readonly id: null | number\n  readonly lastName: null | string\n  readonly name: null | string\n\n  readonly gender: GenderString\n\n  readonly photo: null | string\n\n  readonly TimeZone: null | string\n  readonly TimeZoneOffset: null | number\n}\n\nexport const EnumAppStatus = {\n  // free ////\n  Free: 'F',\n\n  // demo version ////\n  Demo: 'D',\n\n  // trial version (limited time) ////\n  Trial: 'T',\n\n  // paid application ////\n  Paid: 'P',\n\n  // local application ////\n  Local: 'L',\n\n  // subscription application ////\n  Subscription: 'S'\n} as const\n\nexport const StatusDescriptions: Record<(typeof EnumAppStatus)[keyof typeof EnumAppStatus], string> = {\n  [EnumAppStatus.Free]: 'Free',\n  [EnumAppStatus.Demo]: 'Demo',\n  [EnumAppStatus.Trial]: 'Trial',\n  [EnumAppStatus.Paid]: 'Paid',\n  [EnumAppStatus.Local]: 'Local',\n  [EnumAppStatus.Subscription]: 'Subscription'\n}\n\nexport type TypeEnumAppStatus = keyof typeof EnumAppStatus\n\n/**\n * @link https://dev.1c-bitrix.ru/rest_help/general/app_info.php\n */\nexport type TypeApp = {\n  /**\n   * Local application identifier on the portal\n   */\n  readonly id: number\n\n  /**\n   * application code\n   */\n  readonly code: string\n\n  /**\n   * installed version of the application\n   */\n  readonly version: number\n\n  /**\n   * application status\n   */\n  readonly status: TypeEnumAppStatus\n\n  /**\n   * application installed flag\n   */\n  readonly isInstalled: boolean\n}\n\n/**\n * @link https://dev.1c-bitrix.ru/rest_help/general/app_info.php\n */\nexport type TypePayment = {\n  /**\n   * flag indicating whether the paid period or trial period has expired\n   */\n  readonly isExpired: boolean\n\n  /**\n   * number of days remaining until the end of the paid period or trial period\n   */\n  readonly days: number\n}\n\n/**\n * @link https://dev.1c-bitrix.ru/rest_help/general/app_info.php\n */\nexport type TypeLicense = {\n  /**\n   * language code designation\n   */\n  readonly languageId: null | string\n  /**\n   * tariff designation with indication of the region as a prefix\n   */\n  readonly license: null | string\n\n  /**\n   * internal tariff designation without indication of region\n   */\n  readonly licenseType: null | string\n\n  /**\n   * past meaning of license\n   */\n  readonly licensePrevious: null | string\n\n  /**\n   * Tariff designation without specifying the region.\n   */\n  readonly licenseFamily: null | string\n\n  /**\n   * flag indicating whether it is a box (true) or a cloud (false)\n   */\n  readonly isSelfHosted: boolean\n}\n\nexport const TypeSpecificUrl = {\n  MainSettings: 'MainSettings',\n  UfList: 'UfList',\n  UfPage: 'UfPage'\n} as const\n\nexport type TypeB24Form = {\n  readonly app_code: string\n  readonly app_status: string\n\n  readonly payment_expired: BoolString\n  readonly days: number\n\n  /**\n   * B24 tariff plan identifier (if cloud)\n   */\n  readonly b24_plan: string\n\n  readonly c_name: string\n  readonly c_last_name: string\n\n  readonly hostname: string\n}\n\nexport type CurrencyFormat = {\n  decimals: number\n  decPoint: string\n  formatString: string\n  fullName: string\n  isHideZero: boolean\n  thousandsSep?: string\n  thousandsVariant?: 'N' | 'D' | 'C' | 'S' | 'B' | 'OWN' | string\n}\n\nexport type Currency = {\n  amount: number\n  amountCnt: number\n  isBase: boolean\n  currencyCode: string\n  dateUpdate: DateTime\n  decimals: number\n  decPoint: string\n  formatString: string\n  fullName: string\n  lid: string\n  sort: number\n  thousandsSep?: string\n  lang: Record<string, CurrencyFormat>\n}\n\nexport enum TypeOption {\n  NotSet = 'notSet',\n  JsonArray = 'jsonArray',\n  JsonObject = 'jsonObject',\n  FloatVal = 'float',\n  IntegerVal = 'integer',\n  BoolYN = 'boolYN',\n  StringVal = 'string'\n}\n"],"names":["LoadDataType","TypeOption"],"mappings":";;;;;;;;AAGO,IAAK,YAAA,qBAAAA,aAAAA,KAAL;AACL,EAAAA,cAAA,KAAA,C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