@escapenavigator/types 2.2.6 → 2.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/dist/cashbox/cashbox-light.ro.d.ts +1 -0
  2. package/dist/cashbox/cashbox-light.ro.js +4 -0
  3. package/dist/cashbox/create-cashbox.dto.d.ts +1 -0
  4. package/dist/cashbox/create-cashbox.dto.js +19 -12
  5. package/dist/cashbox/create-online-cashbox.dto.d.ts +1 -0
  6. package/dist/cashbox/create-online-cashbox.dto.js +6 -0
  7. package/dist/cashbox/update-online-cashbox.dto.d.ts +1 -0
  8. package/dist/cashbox/update-online-cashbox.dto.js +6 -0
  9. package/dist/constants/all-languages-by-namespace.js +1 -0
  10. package/dist/constants/country-by-namespace.js +1 -0
  11. package/dist/constants/country-name-by-country.js +1 -0
  12. package/dist/constants/currency-by-country.js +1 -0
  13. package/dist/constants/emergency-phones.js +6 -0
  14. package/dist/constants/language-by-country.js +1 -0
  15. package/dist/constants/namespace-by-country.js +1 -0
  16. package/dist/constants/navigator-certificate-nominals-by-country.d.ts +2 -2
  17. package/dist/constants/navigator-certificate-nominals-by-country.js +1 -0
  18. package/dist/email-builder/index.d.ts +2 -1
  19. package/dist/email-builder/index.js +1 -0
  20. package/dist/kids-party-request/query-kids-party-requests.dto.d.ts +2 -0
  21. package/dist/kids-party-request/query-kids-party-requests.dto.js +6 -0
  22. package/dist/lead/lead-form-field.type.d.ts +1 -0
  23. package/dist/lead/lead-form-layout.d.ts +17 -0
  24. package/dist/lead/lead-form-layout.js +88 -0
  25. package/dist/lead/lead-form.ro.d.ts +6 -0
  26. package/dist/lead/lead-form.ro.js +14 -0
  27. package/dist/lead/public/public-lead-form.ro.d.ts +3 -0
  28. package/dist/lead/query-leads.dto.d.ts +4 -0
  29. package/dist/lead/query-leads.dto.js +12 -1
  30. package/dist/lead/update-lead-form.dto.d.ts +3 -0
  31. package/dist/lead/update-lead-form.dto.js +12 -0
  32. package/dist/openapi/order-groups/openapi-batch-create-preorder.dto.d.ts +1 -0
  33. package/dist/openapi/order-groups/openapi-batch-create-preorder.dto.js +1 -0
  34. package/dist/openapi/orders/openapi-order.ro.d.ts +3 -0
  35. package/dist/openapi/orders/openapi-order.ro.js +12 -0
  36. package/dist/openapi/ru-aggregators/aggregators-info.js +4 -0
  37. package/dist/openapi/ru-aggregators/aggregators.enum.d.ts +2 -1
  38. package/dist/openapi/ru-aggregators/aggregators.enum.js +1 -0
  39. package/dist/openapi/shared/openapi-questroom.ro.d.ts +5 -0
  40. package/dist/openapi/shared/openapi-questroom.ro.js +15 -0
  41. package/dist/order/order.ro.d.ts +5 -0
  42. package/dist/order/order.ro.js +20 -0
  43. package/dist/packages/create-package.dto.js +4 -2
  44. package/dist/packages/package-audience.enum.d.ts +1 -0
  45. package/dist/packages/package-audience.enum.js +1 -0
  46. package/dist/profile/company/profile-company.dto.d.ts +22 -0
  47. package/dist/profile/company/profile-company.dto.js +108 -0
  48. package/dist/profile/enum/profile-currency.d.ts +2 -1
  49. package/dist/profile/enum/profile-currency.js +1 -0
  50. package/dist/profile/marketing-automation/custom-email-rule.dto.d.ts +33 -0
  51. package/dist/profile/marketing-automation/custom-email-rule.dto.js +133 -0
  52. package/dist/profile/telephony/novofon.d.ts +44 -0
  53. package/dist/profile/telephony/novofon.js +80 -0
  54. package/dist/profile/waiver/profile-waiver.ro.d.ts +1 -0
  55. package/dist/profile/waiver/profile-waiver.ro.js +4 -0
  56. package/dist/profile/waiver/update-waiver.dto.d.ts +1 -0
  57. package/dist/profile/waiver/update-waiver.dto.js +18 -11
  58. package/dist/questroom/booking-completion-text.d.ts +8 -0
  59. package/dist/questroom/booking-completion-text.js +51 -0
  60. package/dist/questroom/create-questroom.dto.d.ts +7 -0
  61. package/dist/questroom/create-questroom.dto.js +32 -0
  62. package/dist/questroom/enum/questroom-mode-icon.enum.d.ts +53 -0
  63. package/dist/questroom/enum/questroom-mode-icon.enum.js +155 -0
  64. package/dist/questroom/questroom-light.ro.d.ts +6 -0
  65. package/dist/questroom/questroom-light.ro.js +19 -0
  66. package/dist/shared/enum/countries.enum.d.ts +2 -1
  67. package/dist/shared/enum/countries.enum.js +1 -0
  68. package/dist/shared/enum/namespaces.enum.d.ts +2 -1
  69. package/dist/shared/enum/namespaces.enum.js +1 -0
  70. package/dist/shared/source.enum.d.ts +2 -1
  71. package/dist/shared/source.enum.js +1 -0
  72. package/dist/shared/timezone.enum.d.ts +1 -0
  73. package/dist/shared/timezone.enum.js +1 -0
  74. package/dist/slot/slot.ro.d.ts +2 -0
  75. package/dist/slot-rule/create-rule.dto.d.ts +1 -0
  76. package/dist/slot-rule/create-rule.dto.js +7 -0
  77. package/dist/slot-rule/defailt-rule.d.ts +1 -0
  78. package/dist/slot-rule/defailt-rule.js +1 -0
  79. package/dist/slot-rule/rule.ro.d.ts +1 -0
  80. package/dist/slot-rule/rule.ro.js +4 -0
  81. package/dist/support/support-ticket.d.ts +2 -1
  82. package/dist/support/support-ticket.js +1 -0
  83. package/dist/transaction/transaction.ro.d.ts +1 -0
  84. package/dist/transaction/transaction.ro.js +4 -0
  85. package/dist/tsconfig.build.tsbuildinfo +1 -1
  86. package/dist/widget/create-widget.dto.d.ts +1 -0
  87. package/dist/widget/create-widget.dto.js +8 -0
  88. package/dist/widget/widget.ro.d.ts +2 -0
  89. package/dist/widget-chat/widget-chat-message.ro.d.ts +3 -1
  90. package/package.json +2 -2
@@ -13,6 +13,7 @@ import { CashboxTypeEnum } from './enum/cashbox-type.enum';
13
13
  * `CashboxModal`/`CashboxOnlineModal` через `useGetOne`.
14
14
  */
15
15
  export declare class CashboxLightRO extends RO {
16
+ companyId?: number | null;
16
17
  title: string;
17
18
  type: CashboxTypeEnum;
18
19
  identificator?: string;
@@ -28,6 +28,10 @@ const cashbox_type_enum_1 = require("./enum/cashbox-type.enum");
28
28
  class CashboxLightRO extends ro_class_1.RO {
29
29
  }
30
30
  exports.CashboxLightRO = CashboxLightRO;
31
+ __decorate([
32
+ (0, class_transformer_1.Expose)(),
33
+ __metadata("design:type", Number)
34
+ ], CashboxLightRO.prototype, "companyId", void 0);
31
35
  __decorate([
32
36
  (0, class_transformer_1.Expose)(),
33
37
  __metadata("design:type", String)
@@ -1,5 +1,6 @@
1
1
  import { CashboxTypeEnum } from './enum/cashbox-type.enum';
2
2
  export declare class CreateCashboxDto {
3
+ companyId?: number | null;
3
4
  title: string;
4
5
  type: CashboxTypeEnum;
5
6
  allLocations: boolean;
@@ -10,54 +10,61 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.CreateCashboxDto = void 0;
13
- const class_transformer_1 = require("class-transformer");
14
13
  const class_validator_1 = require("class-validator");
14
+ const class_transformer_1 = require("class-transformer");
15
+ const class_validator_2 = require("class-validator");
15
16
  const is_not_blank_1 = require("../shared/is-not-blank");
16
17
  const cashbox_type_enum_1 = require("./enum/cashbox-type.enum");
17
18
  class CreateCashboxDto {
18
19
  }
19
20
  exports.CreateCashboxDto = CreateCashboxDto;
21
+ __decorate([
22
+ (0, class_validator_2.IsOptional)(),
23
+ (0, class_validator_1.IsInt)(),
24
+ (0, class_transformer_1.Expose)(),
25
+ __metadata("design:type", Number)
26
+ ], CreateCashboxDto.prototype, "companyId", void 0);
20
27
  __decorate([
21
28
  (0, is_not_blank_1.IsNotBlank)(),
22
29
  (0, class_transformer_1.Expose)(),
23
30
  __metadata("design:type", String)
24
31
  ], CreateCashboxDto.prototype, "title", void 0);
25
32
  __decorate([
26
- (0, class_validator_1.IsEnum)(cashbox_type_enum_1.CashboxTypeEnum),
33
+ (0, class_validator_2.IsEnum)(cashbox_type_enum_1.CashboxTypeEnum),
27
34
  (0, class_transformer_1.Expose)(),
28
35
  __metadata("design:type", String)
29
36
  ], CreateCashboxDto.prototype, "type", void 0);
30
37
  __decorate([
31
38
  (0, class_transformer_1.Expose)(),
32
- (0, class_validator_1.IsBoolean)(),
39
+ (0, class_validator_2.IsBoolean)(),
33
40
  __metadata("design:type", Boolean)
34
41
  ], CreateCashboxDto.prototype, "allLocations", void 0);
35
42
  __decorate([
36
43
  (0, class_transformer_1.Expose)(),
37
- (0, class_validator_1.IsArray)(),
44
+ (0, class_validator_2.IsArray)(),
38
45
  __metadata("design:type", Array)
39
46
  ], CreateCashboxDto.prototype, "locationIds", void 0);
40
47
  __decorate([
41
48
  (0, class_transformer_1.Expose)(),
42
- (0, class_validator_1.IsOptional)(),
43
- (0, class_validator_1.IsString)(),
49
+ (0, class_validator_2.IsOptional)(),
50
+ (0, class_validator_2.IsString)(),
44
51
  __metadata("design:type", String)
45
52
  ], CreateCashboxDto.prototype, "bankName", void 0);
46
53
  __decorate([
47
54
  (0, class_transformer_1.Expose)(),
48
- (0, class_validator_1.IsOptional)(),
49
- (0, class_validator_1.IsString)(),
55
+ (0, class_validator_2.IsOptional)(),
56
+ (0, class_validator_2.IsString)(),
50
57
  __metadata("design:type", String)
51
58
  ], CreateCashboxDto.prototype, "bic", void 0);
52
59
  __decorate([
53
60
  (0, class_transformer_1.Expose)(),
54
- (0, class_validator_1.IsOptional)(),
55
- (0, class_validator_1.IsString)(),
61
+ (0, class_validator_2.IsOptional)(),
62
+ (0, class_validator_2.IsString)(),
56
63
  __metadata("design:type", String)
57
64
  ], CreateCashboxDto.prototype, "iban", void 0);
58
65
  __decorate([
59
66
  (0, class_transformer_1.Expose)(),
60
- (0, class_validator_1.IsOptional)(),
61
- (0, class_validator_1.IsString)(),
67
+ (0, class_validator_2.IsOptional)(),
68
+ (0, class_validator_2.IsString)(),
62
69
  __metadata("design:type", String)
63
70
  ], CreateCashboxDto.prototype, "accountHolder", void 0);
@@ -1,6 +1,7 @@
1
1
  import { PrepaymentTypeEnum } from '../slot/enum/prepayment-type.enum';
2
2
  import { CashboxTypeEnum } from './enum/cashbox-type.enum';
3
3
  export declare class CreateOnlineCashboxDto {
4
+ companyId?: number | null;
4
5
  title: string;
5
6
  type: CashboxTypeEnum.PAYPAL | CashboxTypeEnum.STRIPE | CashboxTypeEnum.BS | CashboxTypeEnum.CLOUD_PAYMENTS | CashboxTypeEnum.YOOKASSA | CashboxTypeEnum.TBANK;
6
7
  identificator?: string;
@@ -18,6 +18,12 @@ const cashbox_type_enum_1 = require("./enum/cashbox-type.enum");
18
18
  class CreateOnlineCashboxDto {
19
19
  }
20
20
  exports.CreateOnlineCashboxDto = CreateOnlineCashboxDto;
21
+ __decorate([
22
+ (0, class_validator_1.IsOptional)(),
23
+ (0, class_validator_1.IsNumber)(),
24
+ (0, class_transformer_1.Expose)(),
25
+ __metadata("design:type", Number)
26
+ ], CreateOnlineCashboxDto.prototype, "companyId", void 0);
21
27
  __decorate([
22
28
  (0, is_not_blank_1.IsNotBlank)(),
23
29
  (0, class_transformer_1.Expose)(),
@@ -1,5 +1,6 @@
1
1
  import { PrepaymentTypeEnum } from '../slot/enum/prepayment-type.enum';
2
2
  export declare class UpdateOnlineCashboxDto {
3
+ companyId?: number | null;
3
4
  title: string;
4
5
  identificator?: string;
5
6
  apiSecret?: string;
@@ -17,6 +17,12 @@ const prepayment_type_enum_1 = require("../slot/enum/prepayment-type.enum");
17
17
  class UpdateOnlineCashboxDto {
18
18
  }
19
19
  exports.UpdateOnlineCashboxDto = UpdateOnlineCashboxDto;
20
+ __decorate([
21
+ (0, class_validator_1.IsOptional)(),
22
+ (0, class_validator_1.IsNumber)(),
23
+ (0, class_transformer_1.Expose)(),
24
+ __metadata("design:type", Number)
25
+ ], UpdateOnlineCashboxDto.prototype, "companyId", void 0);
20
26
  __decorate([
21
27
  (0, is_not_blank_1.IsNotBlank)(),
22
28
  (0, class_transformer_1.Expose)(),
@@ -43,4 +43,5 @@ exports.allLanguagesByNamespace = {
43
43
  [namespaces_enum_1.NamespacesEnum.JAPAN]: [languages_enum_1.Languages.JA, languages_enum_1.Languages.EN],
44
44
  [namespaces_enum_1.NamespacesEnum.SERBIA]: [languages_enum_1.Languages.SR, languages_enum_1.Languages.EN],
45
45
  [namespaces_enum_1.NamespacesEnum.NORWAY]: [languages_enum_1.Languages.NO, languages_enum_1.Languages.EN],
46
+ [namespaces_enum_1.NamespacesEnum.UAE]: [languages_enum_1.Languages.EN],
46
47
  };
@@ -43,4 +43,5 @@ exports.countryByNamespace = {
43
43
  [namespaces_enum_1.NamespacesEnum.SERBIA]: countries_enum_1.CountriesEnum.SERBIA,
44
44
  [namespaces_enum_1.NamespacesEnum.SINGAPORE]: countries_enum_1.CountriesEnum.SINGAPORE,
45
45
  [namespaces_enum_1.NamespacesEnum.NORWAY]: countries_enum_1.CountriesEnum.NORWAY,
46
+ [namespaces_enum_1.NamespacesEnum.UAE]: countries_enum_1.CountriesEnum.UAE,
46
47
  };
@@ -42,4 +42,5 @@ exports.countryNameByCountry = {
42
42
  [countries_enum_1.CountriesEnum.SERBIA]: 'Srbija',
43
43
  [countries_enum_1.CountriesEnum.SINGAPORE]: 'Singapore',
44
44
  [countries_enum_1.CountriesEnum.NORWAY]: 'Norge',
45
+ [countries_enum_1.CountriesEnum.UAE]: 'United Arab Emirates (UAE)',
45
46
  };
@@ -43,4 +43,5 @@ exports.currencyByCountry = {
43
43
  [countries_enum_1.CountriesEnum.SERBIA]: profile_currency_1.ProfileCurrencyEnum.RSD,
44
44
  [countries_enum_1.CountriesEnum.SINGAPORE]: profile_currency_1.ProfileCurrencyEnum.SGD,
45
45
  [countries_enum_1.CountriesEnum.NORWAY]: profile_currency_1.ProfileCurrencyEnum.NOK,
46
+ [countries_enum_1.CountriesEnum.UAE]: profile_currency_1.ProfileCurrencyEnum.AED,
46
47
  };
@@ -123,4 +123,10 @@ exports.emergencyPhones = {
123
123
  [countries_enum_1.CountriesEnum.SERBIA]: { number: '112', services: ['Policija', 'Hitna pomoć', 'Vatrogasci'] },
124
124
  [countries_enum_1.CountriesEnum.SINGAPORE]: { number: '999', services: ['Police', 'Ambulance', 'Fire'] },
125
125
  [countries_enum_1.CountriesEnum.NORWAY]: { number: '112', services: ['Politi', 'Ambulance', 'Brann'] },
126
+ // https://u.ae/en/information-and-services/justice-safety-and-the-law/handling-emergencies
127
+ [countries_enum_1.CountriesEnum.UAE]: {
128
+ police: { number: '999', name: 'Police' },
129
+ ambulance: { number: '998', name: 'Ambulance' },
130
+ fire: { number: '997', name: 'Civil Defence' },
131
+ },
126
132
  };
@@ -43,4 +43,5 @@ exports.languageByCountry = {
43
43
  [countries_enum_1.CountriesEnum.JAPAN]: languages_enum_1.Languages.JA,
44
44
  [countries_enum_1.CountriesEnum.SERBIA]: languages_enum_1.Languages.SR,
45
45
  [countries_enum_1.CountriesEnum.NORWAY]: languages_enum_1.Languages.NO,
46
+ [countries_enum_1.CountriesEnum.UAE]: languages_enum_1.Languages.EN,
46
47
  };
@@ -43,4 +43,5 @@ exports.namespaceByCountry = {
43
43
  [countries_enum_1.CountriesEnum.SERBIA]: namespaces_enum_1.NamespacesEnum.SERBIA,
44
44
  [countries_enum_1.CountriesEnum.SINGAPORE]: namespaces_enum_1.NamespacesEnum.SINGAPORE,
45
45
  [countries_enum_1.CountriesEnum.NORWAY]: namespaces_enum_1.NamespacesEnum.NORWAY,
46
+ [countries_enum_1.CountriesEnum.UAE]: namespaces_enum_1.NamespacesEnum.UAE,
46
47
  };
@@ -3,5 +3,5 @@ export type NavigatorCertificateCountryPricing = {
3
3
  nominals: number[];
4
4
  deliveryPrice: number;
5
5
  };
6
- export declare const navigatorCertificatePricingByCountry: Record<CountriesEnum, NavigatorCertificateCountryPricing>;
7
- export declare const navigatorCertificateNominalsByCountry: Record<CountriesEnum, number[]>;
6
+ export declare const navigatorCertificatePricingByCountry: Partial<Record<CountriesEnum, NavigatorCertificateCountryPricing>>;
7
+ export declare const navigatorCertificateNominalsByCountry: Partial<Record<CountriesEnum, number[]>>;
@@ -99,6 +99,7 @@ const pricingNOK = {
99
99
  nominals: [50000, 75000, 100000, 150000],
100
100
  deliveryPrice: 9000,
101
101
  };
102
+ // Countries without approved certificate pricing are intentionally unavailable.
102
103
  exports.navigatorCertificatePricingByCountry = {
103
104
  [countries_enum_1.CountriesEnum.GERMANY]: pricingEUR,
104
105
  [countries_enum_1.CountriesEnum.AUSTRIA]: pricingEUR,
@@ -272,7 +272,8 @@ export declare enum EmailScope {
272
272
  MarketingCampaign = "marketing-campaign",
273
273
  BirthdayMarketing = "birthday-marketing",
274
274
  OrderPostGame = "order-post-game",
275
- CustomBookingTemplate = "custom-booking-template"
275
+ CustomBookingTemplate = "custom-booking-template",
276
+ CustomCertificate = "custom-certificate"
276
277
  }
277
278
  /**
278
279
  * Variable declaration returned by `GET /marketing-email-variables`.
@@ -412,4 +412,5 @@ var EmailScope;
412
412
  EmailScope["BirthdayMarketing"] = "birthday-marketing";
413
413
  EmailScope["OrderPostGame"] = "order-post-game";
414
414
  EmailScope["CustomBookingTemplate"] = "custom-booking-template";
415
+ EmailScope["CustomCertificate"] = "custom-certificate";
415
416
  })(EmailScope || (exports.EmailScope = EmailScope = {}));
@@ -3,6 +3,8 @@ export declare class QueryKidsPartyRequestsDto {
3
3
  page?: number;
4
4
  limit?: number;
5
5
  status?: KidsPartyStatusEnum;
6
+ /** Активные заявки и отмены, которые ещё требуют согласования. */
7
+ openOnly?: boolean;
6
8
  /** Только отмены, которые админ ещё не согласовал. */
7
9
  cancellationPending?: boolean;
8
10
  searchText?: string;
@@ -45,6 +45,12 @@ __decorate([
45
45
  (0, class_validator_1.IsEnum)(kids_party_request_enums_1.KidsPartyStatusEnum),
46
46
  __metadata("design:type", String)
47
47
  ], QueryKidsPartyRequestsDto.prototype, "status", void 0);
48
+ __decorate([
49
+ (0, class_validator_1.IsOptional)(),
50
+ (0, class_transformer_1.Transform)(optionalBoolean),
51
+ (0, class_validator_1.IsBoolean)(),
52
+ __metadata("design:type", Boolean)
53
+ ], QueryKidsPartyRequestsDto.prototype, "openOnly", void 0);
48
54
  __decorate([
49
55
  (0, class_validator_1.IsOptional)(),
50
56
  (0, class_transformer_1.Transform)(optionalBoolean),
@@ -33,6 +33,7 @@ export interface LeadFormField {
33
33
  /** Стабильный язык-независимый идентификатор поля. */
34
34
  id: string;
35
35
  type: LeadFieldTypeEnum;
36
+ presentation?: 'auto' | 'cards' | 'list';
36
37
  required: boolean;
37
38
  /** Оставшееся поле всегда в форме. Скрыть нельзя — только удалить. */
38
39
  enabled: boolean;
@@ -0,0 +1,17 @@
1
+ import { LocalizedString } from '../shared/localized-string.type';
2
+ import { LeadFormField } from './lead-form-field.type';
3
+ export interface LeadFormStep {
4
+ id: string;
5
+ title: LocalizedString;
6
+ fieldIds: string[];
7
+ }
8
+ /** null preserves the original automatic two-step form. */
9
+ export interface LeadFormLayout {
10
+ mode: 'single' | 'steps';
11
+ steps: LeadFormStep[];
12
+ }
13
+ /** Every field is retained exactly once, including fields added by older clients. */
14
+ export declare function normalizeLeadLayout(layout: LeadFormLayout | null | undefined, fields: LeadFormField[]): LeadFormLayout | null;
15
+ /** A hidden parent cannot make its descendants visible through stale answers. */
16
+ export declare function isLeadFieldVisible(field: LeadFormField, fields: LeadFormField[], value: (id: string) => unknown, seen?: Set<string>): boolean;
17
+ export declare function leadLayoutProblem(layout: LeadFormLayout | null | undefined, fields: LeadFormField[]): string | undefined;
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.normalizeLeadLayout = normalizeLeadLayout;
4
+ exports.isLeadFieldVisible = isLeadFieldVisible;
5
+ exports.leadLayoutProblem = leadLayoutProblem;
6
+ /** Every field is retained exactly once, including fields added by older clients. */
7
+ function normalizeLeadLayout(layout, fields) {
8
+ if (!layout || !['single', 'steps'].includes(layout.mode))
9
+ return null;
10
+ const available = new Set(fields.map((field) => field.id));
11
+ const used = new Set();
12
+ const stepIds = new Set();
13
+ const steps = (Array.isArray(layout.steps) ? layout.steps : [])
14
+ .filter((step) => step && typeof step === 'object')
15
+ .slice(0, 15)
16
+ .map((step, index) => {
17
+ let id = typeof step.id === 'string' && !stepIds.has(step.id) ? step.id : `step-${index}`;
18
+ while (stepIds.has(id))
19
+ id += '-next';
20
+ stepIds.add(id);
21
+ return {
22
+ id,
23
+ title: step.title && typeof step.title === 'object' ? step.title : {},
24
+ fieldIds: (Array.isArray(step.fieldIds) ? step.fieldIds : []).filter((id) => {
25
+ if (!available.has(id) || used.has(id))
26
+ return false;
27
+ used.add(id);
28
+ return true;
29
+ }),
30
+ };
31
+ });
32
+ if (!steps.length)
33
+ steps.push({ id: 'step-1', title: {}, fieldIds: [] });
34
+ steps[steps.length - 1].fieldIds.push(...fields.filter((field) => !used.has(field.id)).map((field) => field.id));
35
+ return { mode: layout.mode, steps };
36
+ }
37
+ /** A hidden parent cannot make its descendants visible through stale answers. */
38
+ function isLeadFieldVisible(field, fields, value, seen = new Set()) {
39
+ var _a;
40
+ if (seen.has(field.id))
41
+ return false;
42
+ const condition = field.conditional;
43
+ if (!(condition === null || condition === void 0 ? void 0 : condition.fieldId))
44
+ return true;
45
+ const parent = fields.find((item) => item.id === condition.fieldId);
46
+ if (!parent ||
47
+ parent.enabled === false ||
48
+ !isLeadFieldVisible(parent, fields, value, new Set([...seen, field.id])))
49
+ return false;
50
+ const answer = value(parent.id);
51
+ const ids = ((_a = condition.optionIds) === null || _a === void 0 ? void 0 : _a.length)
52
+ ? condition.optionIds
53
+ : condition.optionId
54
+ ? [condition.optionId]
55
+ : [];
56
+ if (!ids.length)
57
+ return Array.isArray(answer)
58
+ ? answer.length > 0
59
+ : answer !== undefined && answer !== null && answer !== '' && answer !== false;
60
+ return Array.isArray(answer)
61
+ ? answer.some((item) => ids.includes(item))
62
+ : typeof answer === 'string' && ids.includes(answer);
63
+ }
64
+ function leadLayoutProblem(layout, fields) {
65
+ for (const field of fields) {
66
+ const seen = new Set();
67
+ let current = field;
68
+ while (current === null || current === void 0 ? void 0 : current.conditional) {
69
+ if (seen.has(current.id))
70
+ return field.id;
71
+ seen.add(current.id);
72
+ current = fields.find((item) => item.id === current.conditional.fieldId);
73
+ }
74
+ }
75
+ if (!layout)
76
+ return undefined;
77
+ const normalized = normalizeLeadLayout(layout, fields);
78
+ const ordered = (normalized === null || normalized === void 0 ? void 0 : normalized.mode) === 'steps'
79
+ ? normalized.steps.flatMap((step) => step.fieldIds)
80
+ : fields.map((field) => field.id);
81
+ for (const field of fields) {
82
+ if (!field.conditional)
83
+ continue;
84
+ if (ordered.indexOf(field.conditional.fieldId) < 0 ||
85
+ ordered.indexOf(field.conditional.fieldId) >= ordered.indexOf(field.id))
86
+ return field.id;
87
+ }
88
+ }
@@ -1,7 +1,12 @@
1
1
  import { LocalizedString } from '../shared/localized-string.type';
2
2
  import { LeadFormField } from './lead-form-field.type';
3
+ import { LeadFormLayout } from './lead-form-layout';
4
+ import { UpdateLeadFormDto } from './update-lead-form.dto';
3
5
  export declare class LeadFormRO {
6
+ /** Lets the editor retain immediate-save behavior against older API deployments. */
7
+ supportsDrafts?: boolean;
4
8
  id: number;
9
+ draft?: UpdateLeadFormDto | null;
5
10
  /** Внутреннее название формы — видно только сотрудникам. */
6
11
  title: string;
7
12
  active: boolean;
@@ -13,6 +18,7 @@ export declare class LeadFormRO {
13
18
  successTitle: LocalizedString;
14
19
  successDescription: LocalizedString;
15
20
  fields: LeadFormField[];
21
+ layout?: LeadFormLayout | null;
16
22
  /** Ответственный по умолчанию для заявок с этой формы. */
17
23
  defaultAssigneeId: number | null;
18
24
  /** Слать ли клиенту письмо «заявка принята» (если он оставил email). */
@@ -11,13 +11,23 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.LeadFormRO = void 0;
13
13
  const class_transformer_1 = require("class-transformer");
14
+ const update_lead_form_dto_1 = require("./update-lead-form.dto");
14
15
  class LeadFormRO {
15
16
  }
16
17
  exports.LeadFormRO = LeadFormRO;
18
+ __decorate([
19
+ (0, class_transformer_1.Expose)(),
20
+ (0, class_transformer_1.Transform)(() => true),
21
+ __metadata("design:type", Boolean)
22
+ ], LeadFormRO.prototype, "supportsDrafts", void 0);
17
23
  __decorate([
18
24
  (0, class_transformer_1.Expose)(),
19
25
  __metadata("design:type", Number)
20
26
  ], LeadFormRO.prototype, "id", void 0);
27
+ __decorate([
28
+ (0, class_transformer_1.Expose)(),
29
+ __metadata("design:type", update_lead_form_dto_1.UpdateLeadFormDto)
30
+ ], LeadFormRO.prototype, "draft", void 0);
21
31
  __decorate([
22
32
  (0, class_transformer_1.Expose)(),
23
33
  __metadata("design:type", String)
@@ -50,6 +60,10 @@ __decorate([
50
60
  (0, class_transformer_1.Expose)(),
51
61
  __metadata("design:type", Array)
52
62
  ], LeadFormRO.prototype, "fields", void 0);
63
+ __decorate([
64
+ (0, class_transformer_1.Expose)(),
65
+ __metadata("design:type", Object)
66
+ ], LeadFormRO.prototype, "layout", void 0);
53
67
  __decorate([
54
68
  (0, class_transformer_1.Expose)(),
55
69
  __metadata("design:type", Number)
@@ -1,3 +1,4 @@
1
+ import { LeadFormLayout } from '../lead-form-layout';
1
2
  import { CountriesEnum } from '../../shared/enum/countries.enum';
2
3
  import { Languages } from '../../shared/enum/languages.enum';
3
4
  import { LocalizedString } from '../../shared/localized-string.type';
@@ -22,6 +23,7 @@ export declare class PublicLeadFormProfileRO {
22
23
  language: Languages;
23
24
  availableLanguages: Languages[];
24
25
  mainColor?: string;
26
+ bgColor?: string;
25
27
  phoneForCustomers?: string;
26
28
  }
27
29
  /**
@@ -39,6 +41,7 @@ export declare class PublicLeadFormRO {
39
41
  successDescription: LocalizedString;
40
42
  /** Только включённые поля, отсортированные по `order`. */
41
43
  fields: LeadFormField[];
44
+ layout?: LeadFormLayout | null;
42
45
  questrooms: PublicLeadFormReferenceRO[];
43
46
  locations: PublicLeadFormReferenceRO[];
44
47
  profile: PublicLeadFormProfileRO;
@@ -15,6 +15,10 @@ export declare class QueryLeadsDto {
15
15
  dateFrom?: string;
16
16
  dateTo?: string;
17
17
  }
18
+ /** Догрузка одной колонки: offset входит в тот же валидируемый query. */
19
+ export declare class QueryLeadBoardColumnDto extends QueryLeadsDto {
20
+ offset?: number;
21
+ }
18
22
  /** Axios шлёт `where` строкой; таблица и тесты — объектом. */
19
23
  export declare const parseQueryWhere: (value: unknown) => Record<string, unknown> | undefined;
20
24
  /** Постраничный список для табличного вида. */
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.QueryLeadsListDto = exports.parseQueryWhere = exports.QueryLeadsDto = void 0;
12
+ exports.QueryLeadsListDto = exports.parseQueryWhere = exports.QueryLeadBoardColumnDto = exports.QueryLeadsDto = void 0;
13
13
  const class_transformer_1 = require("class-transformer");
14
14
  const class_validator_1 = require("class-validator");
15
15
  const normalize_search_text_1 = require("../shared/normalize-search-text");
@@ -80,6 +80,17 @@ __decorate([
80
80
  (0, class_validator_1.IsString)(),
81
81
  __metadata("design:type", String)
82
82
  ], QueryLeadsDto.prototype, "dateTo", void 0);
83
+ /** Догрузка одной колонки: offset входит в тот же валидируемый query. */
84
+ class QueryLeadBoardColumnDto extends QueryLeadsDto {
85
+ }
86
+ exports.QueryLeadBoardColumnDto = QueryLeadBoardColumnDto;
87
+ __decorate([
88
+ (0, class_validator_1.IsOptional)(),
89
+ (0, class_transformer_1.Transform)(({ value }) => (value == null ? undefined : Number(value))),
90
+ (0, class_validator_1.IsInt)(),
91
+ (0, class_validator_1.Min)(0),
92
+ __metadata("design:type", Number)
93
+ ], QueryLeadBoardColumnDto.prototype, "offset", void 0);
83
94
  /** Axios шлёт `where` строкой; таблица и тесты — объектом. */
84
95
  const parseQueryWhere = (value) => {
85
96
  if (value == null || value === '')
@@ -1,5 +1,6 @@
1
1
  import { LocalizedString } from '../shared/localized-string.type';
2
2
  import { LeadFormField } from './lead-form-field.type';
3
+ import { LeadFormLayout } from './lead-form-layout';
3
4
  /**
4
5
  * Создание и обновление формы заявки. `fields` валидируется «легко» — так же,
5
6
  * как `questions` в шаблоне опроса: форма может лежать выключенным
@@ -20,6 +21,8 @@ export declare class UpdateLeadFormDto {
20
21
  * рекомендуемый набор полей.
21
22
  */
22
23
  fields?: LeadFormField[];
24
+ layout?: LeadFormLayout | null;
25
+ intent?: 'draft' | 'publish';
23
26
  defaultAssigneeId?: number | null;
24
27
  clientAutoreply?: boolean;
25
28
  }
@@ -70,6 +70,18 @@ __decorate([
70
70
  (0, class_transformer_1.Expose)(),
71
71
  __metadata("design:type", Array)
72
72
  ], UpdateLeadFormDto.prototype, "fields", void 0);
73
+ __decorate([
74
+ (0, class_validator_1.IsOptional)(),
75
+ (0, class_validator_1.IsObject)(),
76
+ (0, class_transformer_1.Expose)(),
77
+ __metadata("design:type", Object)
78
+ ], UpdateLeadFormDto.prototype, "layout", void 0);
79
+ __decorate([
80
+ (0, class_validator_1.IsOptional)(),
81
+ (0, class_validator_1.IsIn)(['draft', 'publish']),
82
+ (0, class_transformer_1.Expose)(),
83
+ __metadata("design:type", String)
84
+ ], UpdateLeadFormDto.prototype, "intent", void 0);
73
85
  __decorate([
74
86
  (0, class_validator_1.IsOptional)(),
75
87
  (0, class_validator_1.IsNumber)(),
@@ -16,6 +16,7 @@ import { OpenapiCreatePreorderDto } from '../orders/openapi-create-preorder.dto'
16
16
  * Ограничения:
17
17
  * • `items.length` в [2, ORDER_GROUP_SIZE_LIMIT] — одиночный preorder идёт через
18
18
  * POST /openapi/orders/preorder (там нет смысла создавать группу);
19
+ * Пакет с одной игрой также использует этот endpoint для пакетной цены;
19
20
  * верхний лимит — `OrderGroupService.ORDER_GROUP_SIZE_LIMIT`.
20
21
  * • Все items должны иметь идентичные client-fields (name/phone/email/...).
21
22
  * Бэкенд это проверяет и бросает 400 при mismatch, чтобы не создать
@@ -30,6 +30,7 @@ const openapi_create_preorder_dto_1 = require("../orders/openapi-create-preorder
30
30
  * Ограничения:
31
31
  * • `items.length` в [2, ORDER_GROUP_SIZE_LIMIT] — одиночный preorder идёт через
32
32
  * POST /openapi/orders/preorder (там нет смысла создавать группу);
33
+ * Пакет с одной игрой также использует этот endpoint для пакетной цены;
33
34
  * верхний лимит — `OrderGroupService.ORDER_GROUP_SIZE_LIMIT`.
34
35
  * • Все items должны иметь идентичные client-fields (name/phone/email/...).
35
36
  * Бэкенд это проверяет и бросает 400 при mismatch, чтобы не создать
@@ -29,6 +29,7 @@ declare class Rule {
29
29
  minHoursForFullFine: number;
30
30
  cancelationRule: QuestroomCancelationTypeEnum;
31
31
  cancelationAmount: number;
32
+ clientCanEdit: boolean;
32
33
  clientCanCancel: boolean;
33
34
  }
34
35
  declare class Slot {
@@ -96,6 +97,8 @@ export declare class OpenapiOrderRO extends QuestroomRow {
96
97
  flexPlayers: boolean;
97
98
  utcDate: string;
98
99
  mode: string;
100
+ modeIcon?: string | null;
101
+ modeDuration?: number | null;
99
102
  client: OpenapiClientRO;
100
103
  token: string;
101
104
  expiration: string;
@@ -83,6 +83,10 @@ __decorate([
83
83
  (0, class_transformer_1.Expose)(),
84
84
  __metadata("design:type", Number)
85
85
  ], Rule.prototype, "cancelationAmount", void 0);
86
+ __decorate([
87
+ (0, class_transformer_1.Expose)(),
88
+ __metadata("design:type", Boolean)
89
+ ], Rule.prototype, "clientCanEdit", void 0);
86
90
  __decorate([
87
91
  (0, class_transformer_1.Expose)(),
88
92
  __metadata("design:type", Boolean)
@@ -212,6 +216,14 @@ __decorate([
212
216
  (0, class_transformer_1.Expose)(),
213
217
  __metadata("design:type", String)
214
218
  ], OpenapiOrderRO.prototype, "mode", void 0);
219
+ __decorate([
220
+ (0, class_transformer_1.Expose)(),
221
+ __metadata("design:type", String)
222
+ ], OpenapiOrderRO.prototype, "modeIcon", void 0);
223
+ __decorate([
224
+ (0, class_transformer_1.Expose)(),
225
+ __metadata("design:type", Number)
226
+ ], OpenapiOrderRO.prototype, "modeDuration", void 0);
215
227
  __decorate([
216
228
  (0, class_transformer_1.Expose)(),
217
229
  (0, class_transformer_1.Type)(() => openapi_client_ro_1.OpenapiClientRO),
@@ -35,4 +35,8 @@ exports.aggregatorsInfo = {
35
35
  title: 'Квест батл',
36
36
  image: 'https://escapenavigator-images.s3.eu-central-1.amazonaws.com/inside/aggregators/QUEST_BATL.webp',
37
37
  },
38
+ [aggregators_enum_1.AggregatorsEnum.CLAUSTROPHOBIA]: {
39
+ title: 'Клаустрофобия',
40
+ image: '/aggregators/claustrophobia.png',
41
+ },
38
42
  };
@@ -6,5 +6,6 @@ export declare enum AggregatorsEnum {
6
6
  QUEST_HUNTER = "quest-hunter",
7
7
  QUEST_GUIDE = "quest-guide",
8
8
  QUEST_STARTS = "quest-starts",
9
- QUEST_BATL = "quest-batl"
9
+ QUEST_BATL = "quest-batl",
10
+ CLAUSTROPHOBIA = "claustrophobia"
10
11
  }
@@ -11,4 +11,5 @@ var AggregatorsEnum;
11
11
  AggregatorsEnum["QUEST_GUIDE"] = "quest-guide";
12
12
  AggregatorsEnum["QUEST_STARTS"] = "quest-starts";
13
13
  AggregatorsEnum["QUEST_BATL"] = "quest-batl";
14
+ AggregatorsEnum["CLAUSTROPHOBIA"] = "claustrophobia";
14
15
  })(AggregatorsEnum || (exports.AggregatorsEnum = AggregatorsEnum = {}));