@escapenavigator/types 2.1.5 → 2.1.7

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 (130) hide show
  1. package/dist/admin/aggregator-order/aggregator-order.ro.d.ts +16 -0
  2. package/dist/admin/aggregator-order/aggregator-order.ro.js +16 -0
  3. package/dist/admin/aggregator-order/create-aggregator-order.dto.d.ts +6 -0
  4. package/dist/admin/aggregator-order/create-aggregator-order.dto.js +6 -0
  5. package/dist/agregator/agregator-find-questroom-by-title.ro.js +4 -1
  6. package/dist/agregator/agregator-questroom-card.ro.d.ts +16 -0
  7. package/dist/agregator/agregator-questroom-card.ro.js +30 -2
  8. package/dist/agregator/agregator-questroom.ro.d.ts +1 -0
  9. package/dist/agregator/agregator-questroom.ro.js +8 -1
  10. package/dist/client/update-client-billing-defaults.dto.d.ts +5 -0
  11. package/dist/client/update-client-billing-defaults.dto.js +35 -0
  12. package/dist/constants/navigator-certificate-nominal-bounds.d.ts +8 -0
  13. package/dist/constants/navigator-certificate-nominal-bounds.js +47 -0
  14. package/dist/integrations/admin-integration.ro.d.ts +122 -0
  15. package/dist/integrations/admin-integration.ro.js +2 -0
  16. package/dist/integrations/booking-mode.enum.d.ts +24 -0
  17. package/dist/integrations/booking-mode.enum.js +28 -0
  18. package/dist/integrations/connect-integration.dto.d.ts +44 -0
  19. package/dist/integrations/connect-integration.dto.js +101 -0
  20. package/dist/integrations/connection-status.enum.d.ts +30 -0
  21. package/dist/integrations/connection-status.enum.js +34 -0
  22. package/dist/integrations/connector-capabilities.d.ts +85 -0
  23. package/dist/integrations/connector-capabilities.js +2 -0
  24. package/dist/integrations/credential-field.d.ts +80 -0
  25. package/dist/integrations/credential-field.js +2 -0
  26. package/dist/integrations/crm-integration-status.ro.d.ts +70 -0
  27. package/dist/integrations/crm-integration-status.ro.js +43 -0
  28. package/dist/integrations/incident-status.enum.d.ts +31 -0
  29. package/dist/integrations/incident-status.enum.js +36 -0
  30. package/dist/integrations/incident-type.enum.d.ts +30 -0
  31. package/dist/integrations/incident-type.enum.js +34 -0
  32. package/dist/integrations/integration-request-status.enum.d.ts +22 -0
  33. package/dist/integrations/integration-request-status.enum.js +26 -0
  34. package/dist/integrations/normalized-slot.d.ts +79 -0
  35. package/dist/integrations/normalized-slot.js +2 -0
  36. package/dist/integrations/partner-wire.d.ts +124 -0
  37. package/dist/integrations/partner-wire.js +26 -0
  38. package/dist/integrations/partners-booking-v1-schedule.dto.d.ts +11 -0
  39. package/dist/integrations/partners-booking-v1-schedule.dto.js +43 -0
  40. package/dist/integrations/partners-booking-v1.d.ts +124 -0
  41. package/dist/integrations/partners-booking-v1.js +2 -0
  42. package/dist/integrations/pending-booking-request.ro.d.ts +32 -0
  43. package/dist/integrations/pending-booking-request.ro.js +2 -0
  44. package/dist/integrations/provider-code.enum.d.ts +37 -0
  45. package/dist/integrations/provider-code.enum.js +41 -0
  46. package/dist/integrations/resource-match-status.enum.d.ts +25 -0
  47. package/dist/integrations/resource-match-status.enum.js +29 -0
  48. package/dist/integrations/run-operation.enum.d.ts +22 -0
  49. package/dist/integrations/run-operation.enum.js +26 -0
  50. package/dist/integrations/run-outcome.enum.d.ts +23 -0
  51. package/dist/integrations/run-outcome.enum.js +27 -0
  52. package/dist/navigator-certificate/create-navigator-certificate-sale.dto.d.ts +2 -2
  53. package/dist/navigator-certificate/create-navigator-certificate-sale.dto.js +4 -2
  54. package/dist/navigator-certificate/create-navigator-certificate-template.dto.d.ts +3 -2
  55. package/dist/navigator-certificate/create-navigator-certificate-template.dto.js +10 -2
  56. package/dist/navigator-certificate/enum/navigator-certificate-tag-nav-mode.enum.d.ts +5 -0
  57. package/dist/navigator-certificate/enum/navigator-certificate-tag-nav-mode.enum.js +9 -0
  58. package/dist/navigator-certificate/enum/navigator-certificate-tag-slug.enum.d.ts +23 -0
  59. package/dist/navigator-certificate/enum/navigator-certificate-tag-slug.enum.js +27 -0
  60. package/dist/navigator-certificate/index.d.ts +6 -0
  61. package/dist/navigator-certificate/index.js +6 -0
  62. package/dist/navigator-certificate/navigator-certificate-tag-catalog.d.ts +8 -0
  63. package/dist/navigator-certificate/navigator-certificate-tag-catalog.js +27 -0
  64. package/dist/navigator-certificate/navigator-certificate-tag-season.d.ts +8 -0
  65. package/dist/navigator-certificate/navigator-certificate-tag-season.js +86 -0
  66. package/dist/navigator-certificate/navigator-certificate-tag.ro.d.ts +8 -0
  67. package/dist/navigator-certificate/navigator-certificate-tag.ro.js +31 -0
  68. package/dist/navigator-certificate/navigator-certificate-template.ro.d.ts +3 -2
  69. package/dist/navigator-certificate/navigator-certificate-template.ro.js +5 -1
  70. package/dist/navigator-certificate/navigator-certificate-templates.ro.d.ts +16 -0
  71. package/dist/navigator-certificate/navigator-certificate-templates.ro.js +54 -1
  72. package/dist/navigator-certificate/update-navigator-certificate-tag.dto.d.ts +5 -0
  73. package/dist/navigator-certificate/update-navigator-certificate-tag.dto.js +30 -0
  74. package/dist/navigator-certificate/update-navigator-certificate-template.dto.d.ts +3 -2
  75. package/dist/navigator-certificate/update-navigator-certificate-template.dto.js +9 -2
  76. package/dist/openapi/external-booking/openapi-external-quote.dto.d.ts +22 -0
  77. package/dist/openapi/external-booking/openapi-external-quote.dto.js +43 -0
  78. package/dist/openapi/external-booking/openapi-external-quote.ro.d.ts +65 -0
  79. package/dist/openapi/external-booking/openapi-external-quote.ro.js +83 -0
  80. package/dist/openapi/morty/morty-timeslot.ro.js +13 -0
  81. package/dist/openapi/shared/openapi-questroom.ro.d.ts +1 -0
  82. package/dist/openapi/shared/openapi-questroom.ro.js +4 -0
  83. package/dist/openapi/slots/openapi-slot-add-hold.dto.d.ts +9 -0
  84. package/dist/openapi/slots/openapi-slot-add-hold.dto.js +6 -0
  85. package/dist/openapi/slots/openapi-slot-hold.ro.d.ts +50 -0
  86. package/dist/openapi/slots/openapi-slot-hold.ro.js +37 -0
  87. package/dist/openapi/slots/openapi-widget-slot.ro.d.ts +16 -1
  88. package/dist/openapi/slots/openapi-widget-slot.ro.js +11 -0
  89. package/dist/openapi/widget/bookeo/openapi-widget-bookeo-get-prices.dto.d.ts +9 -0
  90. package/dist/openapi/widget/bookeo/openapi-widget-bookeo-get-prices.dto.js +6 -0
  91. package/dist/openapi/widget/bookeo/openapi-widget-create-bookeo-order.dto.d.ts +19 -0
  92. package/dist/openapi/widget/bookeo/openapi-widget-create-bookeo-order.dto.js +18 -0
  93. package/dist/order/update-order.dto.d.ts +4 -0
  94. package/dist/order/update-order.dto.js +24 -0
  95. package/dist/parse-results/booking-provider-signatures.d.ts +35 -0
  96. package/dist/parse-results/booking-provider-signatures.js +93 -0
  97. package/dist/player/player-leaderboard.ro.d.ts +20 -0
  98. package/dist/player/player-leaderboard.ro.js +81 -0
  99. package/dist/player/player.ro.d.ts +30 -1
  100. package/dist/player/player.ro.js +85 -1
  101. package/dist/profile/admin-profile.ro.d.ts +1 -0
  102. package/dist/profile/admin-profile.ro.js +4 -0
  103. package/dist/profile/create-profile.dto.d.ts +1 -0
  104. package/dist/profile/create-profile.dto.js +6 -0
  105. package/dist/profile/query-admin-profile.dto.d.ts +2 -0
  106. package/dist/profile/query-admin-profile.dto.js +4 -0
  107. package/dist/questroom/agregator-questroom.ro.d.ts +1 -0
  108. package/dist/questroom/create-questroom-admin.dto.d.ts +1 -0
  109. package/dist/questroom/create-questroom-admin.dto.js +6 -0
  110. package/dist/questroom/create-questroom.dto.d.ts +4 -0
  111. package/dist/questroom/create-questroom.dto.js +6 -0
  112. package/dist/questroom/enum/questroom-cancelation-type.enum.d.ts +1 -0
  113. package/dist/questroom/enum/questroom-cancelation-type.enum.js +1 -0
  114. package/dist/questroom/questroom.ro.d.ts +1 -0
  115. package/dist/questroom/questroom.ro.js +4 -0
  116. package/dist/questroom/questrooms-list-admin.ro.d.ts +2 -0
  117. package/dist/questroom/questrooms-list-admin.ro.js +8 -0
  118. package/dist/rating-badge/create-rating-badge.dto.d.ts +9 -0
  119. package/dist/{questroom/bind-bookeo.dto.js → rating-badge/create-rating-badge.dto.js} +8 -7
  120. package/dist/rating-badge/enum/rating-badge-status.enum.d.ts +6 -0
  121. package/dist/rating-badge/enum/rating-badge-status.enum.js +10 -0
  122. package/dist/rating-badge/ranking-overview.ro.d.ts +45 -0
  123. package/dist/rating-badge/ranking-overview.ro.js +172 -0
  124. package/dist/rating-badge/rating-badge-admin.ro.d.ts +7 -0
  125. package/dist/rating-badge/rating-badge-admin.ro.js +33 -0
  126. package/dist/rating-badge/rating-badge.ro.d.ts +12 -0
  127. package/dist/rating-badge/rating-badge.ro.js +50 -0
  128. package/dist/tsconfig.build.tsbuildinfo +1 -1
  129. package/package.json +2 -2
  130. package/dist/questroom/bind-bookeo.dto.d.ts +0 -4
@@ -27,5 +27,21 @@ export declare class AggregatorOrderRO extends RO {
27
27
  billingItems?: BalanceItemRO[];
28
28
  dispute?: boolean;
29
29
  booked?: boolean;
30
+ /** Сколько раз пытались отправить бронь в CRM квеста. */
31
+ bookingAttempts?: number;
32
+ lastBookingAttemptAt?: Date;
33
+ /**
34
+ * Причина последнего отказа CRM. Нужна в админке: по алерту дежурный
35
+ * открывает заказ и сразу видит, что отвечает система квеста, вместо того
36
+ * чтобы лезть в логи.
37
+ */
38
+ bookingError?: string;
39
+ /**
40
+ * До какого момента квест должен подтвердить заявку (режим `request`).
41
+ * Уходит и в виджет: игроку нельзя показывать «бронь подтверждена», когда
42
+ * подтверждения ещё нет — он приедет к закрытой двери. Пусто у обычной
43
+ * брони.
44
+ */
45
+ confirmationDeadline?: Date;
30
46
  }
31
47
  export {};
@@ -107,3 +107,19 @@ __decorate([
107
107
  (0, class_transformer_1.Expose)(),
108
108
  __metadata("design:type", Boolean)
109
109
  ], AggregatorOrderRO.prototype, "booked", void 0);
110
+ __decorate([
111
+ (0, class_transformer_1.Expose)(),
112
+ __metadata("design:type", Number)
113
+ ], AggregatorOrderRO.prototype, "bookingAttempts", void 0);
114
+ __decorate([
115
+ (0, class_transformer_1.Expose)(),
116
+ __metadata("design:type", Date)
117
+ ], AggregatorOrderRO.prototype, "lastBookingAttemptAt", void 0);
118
+ __decorate([
119
+ (0, class_transformer_1.Expose)(),
120
+ __metadata("design:type", String)
121
+ ], AggregatorOrderRO.prototype, "bookingError", void 0);
122
+ __decorate([
123
+ (0, class_transformer_1.Expose)(),
124
+ __metadata("design:type", Date)
125
+ ], AggregatorOrderRO.prototype, "confirmationDeadline", void 0);
@@ -13,6 +13,12 @@ export declare class CreateAggregatorOrderDto {
13
13
  price: number;
14
14
  /** Количество игроков — обязательно для Partner Booking API (Morty-стандарт). */
15
15
  players?: number;
16
+ /**
17
+ * Токен удержания у вендора, полученный на клике по слоту (`/openapi/slots/hold`).
18
+ * Есть только у систем, которые держат место на своей стороне (Bookeo); бронь
19
+ * подтверждает именно его, иначе место никто не держал.
20
+ */
21
+ holdToken?: string;
16
22
  questroomId?: number;
17
23
  profileId?: number;
18
24
  }
@@ -79,6 +79,12 @@ __decorate([
79
79
  (0, class_transformer_1.Expose)(),
80
80
  __metadata("design:type", Number)
81
81
  ], CreateAggregatorOrderDto.prototype, "players", void 0);
82
+ __decorate([
83
+ (0, class_validator_1.IsOptional)(),
84
+ (0, class_validator_1.IsString)(),
85
+ (0, class_transformer_1.Expose)(),
86
+ __metadata("design:type", String)
87
+ ], CreateAggregatorOrderDto.prototype, "holdToken", void 0);
82
88
  __decorate([
83
89
  (0, class_validator_1.IsOptional)(),
84
90
  (0, class_validator_1.IsNumber)(),
@@ -56,7 +56,10 @@ __decorate([
56
56
  (0, class_transformer_1.Expose)(),
57
57
  (0, class_transformer_1.Transform)(({ obj }) => {
58
58
  var _a;
59
- return (obj.templateId || obj.integrationId || obj.partnerAttractionId) &&
59
+ return (obj.templateId ||
60
+ obj.integrationId ||
61
+ obj.partnerAttractionId ||
62
+ obj.integrationResourceId) &&
60
63
  ((_a = obj.profile) === null || _a === void 0 ? void 0 : _a.partnerProgram) === partner_program_enum_1.PartnerProgramEnum.ACTIVE;
61
64
  }),
62
65
  __metadata("design:type", Boolean)
@@ -3,6 +3,12 @@ import { QuestroomTypeEnum } from '../questroom/enum/questroom-type.enum';
3
3
  import { Languages } from '../shared/enum/languages.enum';
4
4
  import { SubwayLineRO } from '../subway-station/subway-station.ro';
5
5
  import { AgregatorGooglePlaceRO } from './agregator-google-place.ro';
6
+ export declare const CARD_PREVIEW_PHOTOS_LIMIT = 3;
7
+ export declare const pickCardPreviewPhotos: (obj: {
8
+ photo?: string | null;
9
+ mainPhoto?: string | null;
10
+ photos?: string[] | null;
11
+ }) => string[] | undefined;
6
12
  export declare class AgregatorQuestroomLocation {
7
13
  id: number;
8
14
  coordinates: [number, number];
@@ -45,6 +51,16 @@ export declare class AgregatorQuestroomCardRO {
45
51
  rate: number;
46
52
  reviewsCount: number;
47
53
  photo: string;
54
+ /**
55
+ * Muted card teaser (already transcoded MP4). Absent when the quest
56
+ * has no hover video — clients fall back to `previewPhotos`.
57
+ */
58
+ previewVideo?: string;
59
+ /**
60
+ * Up to 3 extra gallery shots (cover is `photo`). Used for the Ken Burns
61
+ * hover cycle when `previewVideo` is missing.
62
+ */
63
+ previewPhotos?: string[];
48
64
  minAge: number;
49
65
  time: number;
50
66
  playersMin: number;
@@ -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.AgregatorQuestroomCardRO = exports.AgregatorQuestroomLocation = void 0;
12
+ exports.AgregatorQuestroomCardRO = exports.AgregatorQuestroomLocation = exports.pickCardPreviewPhotos = exports.CARD_PREVIEW_PHOTOS_LIMIT = void 0;
13
13
  /* eslint-disable max-classes-per-file */
14
14
  const class_transformer_1 = require("class-transformer");
15
15
  const currency_by_country_1 = require("../constants/currency-by-country");
@@ -20,6 +20,22 @@ const questroom_type_enum_1 = require("../questroom/enum/questroom-type.enum");
20
20
  const languages_enum_1 = require("../shared/enum/languages.enum");
21
21
  const agregator_google_place_ro_1 = require("./agregator-google-place.ro");
22
22
  const agregator_questroom_ro_1 = require("./agregator-questroom.ro");
23
+ exports.CARD_PREVIEW_PHOTOS_LIMIT = 3;
24
+ const pickCardPreviewPhotos = (obj) => {
25
+ const cover = obj.mainPhoto || obj.photo;
26
+ const seen = new Set(cover ? [cover] : []);
27
+ const extras = [];
28
+ for (const src of obj.photos || []) {
29
+ if (!src || seen.has(src))
30
+ continue;
31
+ seen.add(src);
32
+ extras.push(src);
33
+ if (extras.length >= exports.CARD_PREVIEW_PHOTOS_LIMIT)
34
+ break;
35
+ }
36
+ return extras.length ? extras : undefined;
37
+ };
38
+ exports.pickCardPreviewPhotos = pickCardPreviewPhotos;
23
39
  class AgregatorQuestroomLocation {
24
40
  }
25
41
  exports.AgregatorQuestroomLocation = AgregatorQuestroomLocation;
@@ -123,6 +139,15 @@ __decorate([
123
139
  (0, class_transformer_1.Transform)(({ obj }) => { var _a; return (_a = obj.mainPhoto) !== null && _a !== void 0 ? _a : obj.photo; }),
124
140
  __metadata("design:type", String)
125
141
  ], AgregatorQuestroomCardRO.prototype, "photo", void 0);
142
+ __decorate([
143
+ (0, class_transformer_1.Expose)(),
144
+ __metadata("design:type", String)
145
+ ], AgregatorQuestroomCardRO.prototype, "previewVideo", void 0);
146
+ __decorate([
147
+ (0, class_transformer_1.Expose)(),
148
+ (0, class_transformer_1.Transform)(({ obj }) => (0, exports.pickCardPreviewPhotos)(obj)),
149
+ __metadata("design:type", Array)
150
+ ], AgregatorQuestroomCardRO.prototype, "previewPhotos", void 0);
126
151
  __decorate([
127
152
  (0, class_transformer_1.Expose)(),
128
153
  __metadata("design:type", Number)
@@ -164,7 +189,10 @@ __decorate([
164
189
  (0, class_transformer_1.Expose)(),
165
190
  (0, class_transformer_1.Transform)(({ obj }) => {
166
191
  var _a;
167
- return (obj.templateId || obj.integrationId || obj.partnerAttractionId) &&
192
+ return (obj.templateId ||
193
+ obj.integrationId ||
194
+ obj.partnerAttractionId ||
195
+ obj.integrationResourceId) &&
168
196
  ((_a = obj.profile) === null || _a === void 0 ? void 0 : _a.partnerProgram) === partner_program_enum_1.PartnerProgramEnum.ACTIVE;
169
197
  }),
170
198
  __metadata("design:type", Boolean)
@@ -87,6 +87,7 @@ export declare class AgregatorQuestroomRO {
87
87
  photo: string;
88
88
  photos: string[];
89
89
  video?: string;
90
+ previewVideo?: string;
90
91
  rate: number;
91
92
  reviewsCount: number;
92
93
  modes: QuestroomMode[];
@@ -314,6 +314,10 @@ __decorate([
314
314
  (0, class_transformer_1.Expose)(),
315
315
  __metadata("design:type", String)
316
316
  ], AgregatorQuestroomRO.prototype, "video", void 0);
317
+ __decorate([
318
+ (0, class_transformer_1.Expose)(),
319
+ __metadata("design:type", String)
320
+ ], AgregatorQuestroomRO.prototype, "previewVideo", void 0);
317
321
  __decorate([
318
322
  (0, class_transformer_1.Expose)(),
319
323
  (0, class_transformer_1.Transform)(({ value }) => (value ? +(value / 100).toFixed(2) : 0)),
@@ -337,7 +341,10 @@ __decorate([
337
341
  (0, class_transformer_1.Expose)(),
338
342
  (0, class_transformer_1.Transform)(({ obj }) => {
339
343
  var _a;
340
- return (obj.templateId || obj.integrationId || obj.partnerAttractionId) &&
344
+ return (obj.templateId ||
345
+ obj.integrationId ||
346
+ obj.partnerAttractionId ||
347
+ obj.integrationResourceId) &&
341
348
  ((_a = obj.profile) === null || _a === void 0 ? void 0 : _a.partnerProgram) === partner_program_enum_1.PartnerProgramEnum.ACTIVE;
342
349
  }),
343
350
  __metadata("design:type", Boolean)
@@ -0,0 +1,5 @@
1
+ export declare class UpdateClientBillingDefaultsDto {
2
+ organizationName?: string | null;
3
+ organizationAddress?: string | null;
4
+ organizationTaxId?: string | null;
5
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.UpdateClientBillingDefaultsDto = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ class UpdateClientBillingDefaultsDto {
16
+ }
17
+ exports.UpdateClientBillingDefaultsDto = UpdateClientBillingDefaultsDto;
18
+ __decorate([
19
+ (0, class_validator_1.IsOptional)(),
20
+ (0, class_validator_1.IsString)(),
21
+ (0, class_transformer_1.Expose)(),
22
+ __metadata("design:type", String)
23
+ ], UpdateClientBillingDefaultsDto.prototype, "organizationName", void 0);
24
+ __decorate([
25
+ (0, class_validator_1.IsOptional)(),
26
+ (0, class_validator_1.IsString)(),
27
+ (0, class_transformer_1.Expose)(),
28
+ __metadata("design:type", String)
29
+ ], UpdateClientBillingDefaultsDto.prototype, "organizationAddress", void 0);
30
+ __decorate([
31
+ (0, class_validator_1.IsOptional)(),
32
+ (0, class_validator_1.IsString)(),
33
+ (0, class_transformer_1.Expose)(),
34
+ __metadata("design:type", String)
35
+ ], UpdateClientBillingDefaultsDto.prototype, "organizationTaxId", void 0);
@@ -0,0 +1,8 @@
1
+ import { CountriesEnum } from '../shared/enum/countries.enum';
2
+ export type NavigatorCertificateNominalBounds = {
3
+ minNominal: number;
4
+ maxNominal: number;
5
+ step: number;
6
+ };
7
+ export declare const getNavigatorCertificateNominalBounds: (country: CountriesEnum) => NavigatorCertificateNominalBounds | null;
8
+ export declare const isNavigatorCertificateNominalAllowed: (country: CountriesEnum, nominal: number) => boolean;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isNavigatorCertificateNominalAllowed = exports.getNavigatorCertificateNominalBounds = void 0;
4
+ const currency_by_country_1 = require("./currency-by-country");
5
+ const navigator_certificate_nominals_by_country_1 = require("./navigator-certificate-nominals-by-country");
6
+ const profile_currency_1 = require("../profile/enum/profile-currency");
7
+ const TEN_TO_FIVE_HUNDRED_CENTS = {
8
+ minNominal: 1000,
9
+ maxNominal: 50000,
10
+ step: 100,
11
+ };
12
+ const MAJOR_UNIT_CURRENCIES = [
13
+ profile_currency_1.ProfileCurrencyEnum.EUR,
14
+ profile_currency_1.ProfileCurrencyEnum.USD,
15
+ profile_currency_1.ProfileCurrencyEnum.CHF,
16
+ profile_currency_1.ProfileCurrencyEnum.GBP,
17
+ profile_currency_1.ProfileCurrencyEnum.CAD,
18
+ profile_currency_1.ProfileCurrencyEnum.AUD,
19
+ profile_currency_1.ProfileCurrencyEnum.NZD,
20
+ profile_currency_1.ProfileCurrencyEnum.SGD,
21
+ ];
22
+ const getNavigatorCertificateNominalBounds = (country) => {
23
+ const pricing = navigator_certificate_nominals_by_country_1.navigatorCertificatePricingByCountry[country];
24
+ if (!pricing)
25
+ return null;
26
+ const currency = currency_by_country_1.currencyByCountry[country];
27
+ if (MAJOR_UNIT_CURRENCIES.includes(currency)) {
28
+ return TEN_TO_FIVE_HUNDRED_CENTS;
29
+ }
30
+ const minChip = Math.min(...pricing.nominals);
31
+ const maxChip = Math.max(...pricing.nominals);
32
+ return {
33
+ minNominal: minChip,
34
+ maxNominal: maxChip * 5,
35
+ step: minChip,
36
+ };
37
+ };
38
+ exports.getNavigatorCertificateNominalBounds = getNavigatorCertificateNominalBounds;
39
+ const isNavigatorCertificateNominalAllowed = (country, nominal) => {
40
+ const bounds = (0, exports.getNavigatorCertificateNominalBounds)(country);
41
+ if (!bounds || !Number.isInteger(nominal))
42
+ return false;
43
+ return (nominal >= bounds.minNominal &&
44
+ nominal <= bounds.maxNominal &&
45
+ nominal % bounds.step === 0);
46
+ };
47
+ exports.isNavigatorCertificateNominalAllowed = isNavigatorCertificateNominalAllowed;
@@ -0,0 +1,122 @@
1
+ import { IntegrationBookingModeEnum } from './booking-mode.enum';
2
+ import { IntegrationConnectionStatusEnum } from './connection-status.enum';
3
+ import { IntegrationIncidentSeverityEnum } from './incident-status.enum';
4
+ import { IntegrationIncidentTypeEnum } from './incident-type.enum';
5
+ import { IntegrationProviderCodeEnum } from './provider-code.enum';
6
+ import { IntegrationRequestStatusEnum } from './integration-request-status.enum';
7
+ import { IntegrationRunOperationEnum } from './run-operation.enum';
8
+ import { IntegrationRunOutcomeEnum } from './run-outcome.enum';
9
+ /**
10
+ * Ответы админского API интеграций.
11
+ *
12
+ * Отдельный набор типов, а не сущности напрямую: в `integration_connections`
13
+ * лежат зашифрованные креденшелы, и отдавать сущность целиком нельзя даже
14
+ * админу — токен вендора не должен покидать сервер вообще никогда.
15
+ */
16
+ /** Строка списка подключений на дашборде. */
17
+ export type AdminIntegrationConnectionRow = {
18
+ id: number;
19
+ profileId: number;
20
+ profileTitle: string;
21
+ title: string;
22
+ providerCode: IntegrationProviderCodeEnum;
23
+ status: IntegrationConnectionStatusEnum;
24
+ bookingMode: IntegrationBookingModeEnum;
25
+ healthScore: number;
26
+ /** Сколько комнат подтверждено и сколько всего пришло от вендора. */
27
+ resources: {
28
+ confirmed: number;
29
+ total: number;
30
+ };
31
+ /** Открытых инцидентов — по ним сортируется список проблемных. */
32
+ openIncidents: number;
33
+ /** Часы с последнего успешного вызова. `null` — успешных не было. */
34
+ lastSuccessHoursAgo: number | null;
35
+ breakerOpen: boolean;
36
+ };
37
+ export type AdminIntegrationDashboard = {
38
+ byStatus: Record<IntegrationConnectionStatusEnum, number>;
39
+ /** Подключения, требующие внимания: сначала аварии, потом деградации. */
40
+ problems: AdminIntegrationConnectionRow[];
41
+ /** Броней, не доехавших за сутки. */
42
+ failedBookings24h: number;
43
+ /** Заявок на подключение, ждущих нашего ответа. */
44
+ waitingRequests: number;
45
+ /** Доступность и p95 по всем подключениям за сутки — фон для сравнения. */
46
+ totals: {
47
+ availability: number | null;
48
+ latencyP95: number | null;
49
+ calls: number;
50
+ };
51
+ };
52
+ /** Одна строка журнала вызовов для карточки подключения. */
53
+ export type AdminIntegrationRunRow = {
54
+ id: number;
55
+ createdAt: string;
56
+ operation: IntegrationRunOperationEnum;
57
+ outcome: IntegrationRunOutcomeEnum;
58
+ durationMs: number | null;
59
+ httpStatus: number | null;
60
+ errorCode: string | null;
61
+ /** Уже без персональных данных: маскирование делает сервер. */
62
+ errorMessage: string | null;
63
+ itemsCount: number | null;
64
+ };
65
+ export type AdminIntegrationIncidentRow = {
66
+ id: number;
67
+ type: IntegrationIncidentTypeEnum;
68
+ severity: IntegrationIncidentSeverityEnum;
69
+ summary: string;
70
+ firstSeenAt: string;
71
+ lastSeenAt: string | null;
72
+ resolvedAt: string | null;
73
+ occurrences: number;
74
+ };
75
+ export type AdminIntegrationResourceRow = {
76
+ id: number;
77
+ externalId: string;
78
+ externalTitle: string | null;
79
+ questroomId: number | null;
80
+ questroomTitle: string | null;
81
+ matchStatus: string;
82
+ matchConfidence: number | null;
83
+ lastSeenAt: string | null;
84
+ };
85
+ /** Карточка подключения: всё, что нужно для разговора с квестом. */
86
+ export type AdminIntegrationConnection = AdminIntegrationConnectionRow & {
87
+ /** Какие поля доступа заполнены. Значения не отдаются никогда. */
88
+ credentialsFilled: string[];
89
+ settings: Record<string, unknown>;
90
+ createdAt: string;
91
+ lastSuccessAt: string | null;
92
+ lastVerifiedAt: string | null;
93
+ breakerOpenUntil: string | null;
94
+ resourceRows: AdminIntegrationResourceRow[];
95
+ incidents: AdminIntegrationIncidentRow[];
96
+ runs: AdminIntegrationRunRow[];
97
+ /** Метрики за сутки — те же, по которым считается статус. */
98
+ metrics: {
99
+ availability: number | null;
100
+ latencyP95: number | null;
101
+ calls: number;
102
+ bookingOk: number;
103
+ bookingFailed: number;
104
+ freshnessHours: number | null;
105
+ };
106
+ };
107
+ export type AdminIntegrationRequestRow = {
108
+ id: number;
109
+ profileId: number;
110
+ profileTitle: string;
111
+ status: IntegrationRequestStatusEnum;
112
+ vendorName: string;
113
+ vendorUrl: string | null;
114
+ contactName: string | null;
115
+ contactEmail: string | null;
116
+ comment: string | null;
117
+ createdAt: string;
118
+ /** Часы без нашего ответа — по ним видно, кого мы держим в неведении. */
119
+ waitingHours: number;
120
+ assignedAdminId: number | null;
121
+ connectionId: number | null;
122
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Как именно бронь попадает во внешнюю систему. Это свойство **подключения**,
3
+ * а не провайдера: один и тот же Bookeo у одного квеста настроен на инстант, а
4
+ * у другого — только на заявку, потому что владелец не выдал write-доступ.
5
+ *
6
+ * Дип-линков в списке нет сознательно: игрок никогда не уходит с Escape
7
+ * Navigator, даже если у системы нет write-API. Для таких случаев есть
8
+ * `REQUEST` (см. `docs/integrations-v2/README.md` §2.1–2.2).
9
+ */
10
+ export declare enum IntegrationBookingModeEnum {
11
+ /** Бронь создаётся сразу и подтверждена в момент ответа внешней системы. */
12
+ INSTANT = "instant",
13
+ /**
14
+ * Двухфазная бронь: держим слот (hold), затем подтверждаем. Так работает
15
+ * Bookeo: цена и доступность фиксируются только внутри hold.
16
+ */
17
+ HOLD_THEN_CONFIRM = "hold_then_confirm",
18
+ /**
19
+ * Write-API нет. Слот показываем настоящий, заявку принимаем у себя, квест
20
+ * подтверждает её за отведённое время (`confirmationTimeoutMinutes`).
21
+ * Обязателен живой канал доставки заявки — иначе подключение не включаем.
22
+ */
23
+ REQUEST = "request"
24
+ }
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IntegrationBookingModeEnum = void 0;
4
+ /**
5
+ * Как именно бронь попадает во внешнюю систему. Это свойство **подключения**,
6
+ * а не провайдера: один и тот же Bookeo у одного квеста настроен на инстант, а
7
+ * у другого — только на заявку, потому что владелец не выдал write-доступ.
8
+ *
9
+ * Дип-линков в списке нет сознательно: игрок никогда не уходит с Escape
10
+ * Navigator, даже если у системы нет write-API. Для таких случаев есть
11
+ * `REQUEST` (см. `docs/integrations-v2/README.md` §2.1–2.2).
12
+ */
13
+ var IntegrationBookingModeEnum;
14
+ (function (IntegrationBookingModeEnum) {
15
+ /** Бронь создаётся сразу и подтверждена в момент ответа внешней системы. */
16
+ IntegrationBookingModeEnum["INSTANT"] = "instant";
17
+ /**
18
+ * Двухфазная бронь: держим слот (hold), затем подтверждаем. Так работает
19
+ * Bookeo: цена и доступность фиксируются только внутри hold.
20
+ */
21
+ IntegrationBookingModeEnum["HOLD_THEN_CONFIRM"] = "hold_then_confirm";
22
+ /**
23
+ * Write-API нет. Слот показываем настоящий, заявку принимаем у себя, квест
24
+ * подтверждает её за отведённое время (`confirmationTimeoutMinutes`).
25
+ * Обязателен живой канал доставки заявки — иначе подключение не включаем.
26
+ */
27
+ IntegrationBookingModeEnum["REQUEST"] = "request";
28
+ })(IntegrationBookingModeEnum || (exports.IntegrationBookingModeEnum = IntegrationBookingModeEnum = {}));
@@ -0,0 +1,44 @@
1
+ import { IntegrationProviderCodeEnum } from './provider-code.enum';
2
+ /** Самостоятельное подключение своей системы из кабинета квеста. */
3
+ export declare class ConnectIntegrationDto {
4
+ providerCode: IntegrationProviderCodeEnum;
5
+ title?: string;
6
+ /**
7
+ * Значения полей доступа: ключи соответствуют `credentialFields` коннектора.
8
+ * Свободный объект, а не фиксированный набор полей: у каждого вендора он
9
+ * свой, и держать в контракте объединение всех вариантов — гарантированный
10
+ * рассинхрон при добавлении следующего.
11
+ */
12
+ credentials: Record<string, string>;
13
+ /**
14
+ * К какому нашему квесту относится доступ. Обязателен для систем с
15
+ * `connectionScope: 'resource'` (MyERP-совместимые): там ссылка открывает
16
+ * ровно одну комнату, перечислить каталог вендора нельзя, и без явного
17
+ * указания второй адрес затёр бы уже настроенную комнату.
18
+ */
19
+ questroomId?: number;
20
+ }
21
+ /**
22
+ * Подтверждение соответствия комнаты. `questroomId: null` означает «такой
23
+ * комнаты у меня нет» — она перестаёт предлагаться и в каталог не идёт.
24
+ */
25
+ export declare class MatchIntegrationResourceDto {
26
+ questroomId?: number | null;
27
+ }
28
+ export declare class ToggleIntegrationDto {
29
+ enabled: boolean;
30
+ }
31
+ /** Заявка «подключите меня сами» для систем без готового коннектора. */
32
+ export declare class CreateIntegrationRequestDto {
33
+ systemName: string;
34
+ bookingPageUrl?: string;
35
+ contactName?: string;
36
+ contactEmail?: string;
37
+ contactPhone?: string;
38
+ comment?: string;
39
+ /**
40
+ * Доступы, если квест готов их передать сразу. Шифруются на сервере — по
41
+ * заявке ходит вся поддержка, и открытый ключ вендора в ней жить не должен.
42
+ */
43
+ credentials?: Record<string, string>;
44
+ }
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CreateIntegrationRequestDto = exports.ToggleIntegrationDto = exports.MatchIntegrationResourceDto = exports.ConnectIntegrationDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const provider_code_enum_1 = require("./provider-code.enum");
15
+ /** Самостоятельное подключение своей системы из кабинета квеста. */
16
+ class ConnectIntegrationDto {
17
+ }
18
+ exports.ConnectIntegrationDto = ConnectIntegrationDto;
19
+ __decorate([
20
+ (0, class_validator_1.IsEnum)(provider_code_enum_1.IntegrationProviderCodeEnum),
21
+ __metadata("design:type", String)
22
+ ], ConnectIntegrationDto.prototype, "providerCode", void 0);
23
+ __decorate([
24
+ (0, class_validator_1.IsOptional)(),
25
+ (0, class_validator_1.IsString)(),
26
+ (0, class_validator_1.MaxLength)(200),
27
+ __metadata("design:type", String)
28
+ ], ConnectIntegrationDto.prototype, "title", void 0);
29
+ __decorate([
30
+ (0, class_validator_1.IsObject)(),
31
+ __metadata("design:type", Object)
32
+ ], ConnectIntegrationDto.prototype, "credentials", void 0);
33
+ __decorate([
34
+ (0, class_validator_1.IsOptional)(),
35
+ (0, class_validator_1.IsInt)(),
36
+ (0, class_validator_1.Min)(1),
37
+ __metadata("design:type", Number)
38
+ ], ConnectIntegrationDto.prototype, "questroomId", void 0);
39
+ /**
40
+ * Подтверждение соответствия комнаты. `questroomId: null` означает «такой
41
+ * комнаты у меня нет» — она перестаёт предлагаться и в каталог не идёт.
42
+ */
43
+ class MatchIntegrationResourceDto {
44
+ }
45
+ exports.MatchIntegrationResourceDto = MatchIntegrationResourceDto;
46
+ __decorate([
47
+ (0, class_validator_1.IsOptional)(),
48
+ (0, class_validator_1.IsInt)(),
49
+ (0, class_validator_1.Min)(1),
50
+ __metadata("design:type", Number)
51
+ ], MatchIntegrationResourceDto.prototype, "questroomId", void 0);
52
+ class ToggleIntegrationDto {
53
+ }
54
+ exports.ToggleIntegrationDto = ToggleIntegrationDto;
55
+ __decorate([
56
+ (0, class_validator_1.IsBoolean)(),
57
+ __metadata("design:type", Boolean)
58
+ ], ToggleIntegrationDto.prototype, "enabled", void 0);
59
+ /** Заявка «подключите меня сами» для систем без готового коннектора. */
60
+ class CreateIntegrationRequestDto {
61
+ }
62
+ exports.CreateIntegrationRequestDto = CreateIntegrationRequestDto;
63
+ __decorate([
64
+ (0, class_validator_1.IsString)(),
65
+ (0, class_validator_1.MaxLength)(200),
66
+ __metadata("design:type", String)
67
+ ], CreateIntegrationRequestDto.prototype, "systemName", void 0);
68
+ __decorate([
69
+ (0, class_validator_1.IsOptional)(),
70
+ (0, class_validator_1.IsString)(),
71
+ (0, class_validator_1.MaxLength)(500),
72
+ __metadata("design:type", String)
73
+ ], CreateIntegrationRequestDto.prototype, "bookingPageUrl", void 0);
74
+ __decorate([
75
+ (0, class_validator_1.IsOptional)(),
76
+ (0, class_validator_1.IsString)(),
77
+ (0, class_validator_1.MaxLength)(200),
78
+ __metadata("design:type", String)
79
+ ], CreateIntegrationRequestDto.prototype, "contactName", void 0);
80
+ __decorate([
81
+ (0, class_validator_1.IsOptional)(),
82
+ (0, class_validator_1.IsEmail)(),
83
+ __metadata("design:type", String)
84
+ ], CreateIntegrationRequestDto.prototype, "contactEmail", void 0);
85
+ __decorate([
86
+ (0, class_validator_1.IsOptional)(),
87
+ (0, class_validator_1.IsString)(),
88
+ (0, class_validator_1.MaxLength)(64),
89
+ __metadata("design:type", String)
90
+ ], CreateIntegrationRequestDto.prototype, "contactPhone", void 0);
91
+ __decorate([
92
+ (0, class_validator_1.IsOptional)(),
93
+ (0, class_validator_1.IsString)(),
94
+ (0, class_validator_1.MaxLength)(2000),
95
+ __metadata("design:type", String)
96
+ ], CreateIntegrationRequestDto.prototype, "comment", void 0);
97
+ __decorate([
98
+ (0, class_validator_1.IsOptional)(),
99
+ (0, class_validator_1.IsObject)(),
100
+ __metadata("design:type", Object)
101
+ ], CreateIntegrationRequestDto.prototype, "credentials", void 0);