@escapenavigator/types 1.10.129 → 1.10.131
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.
- package/dist/certificate-v2/certificate-settings.ro.d.ts +2 -0
- package/dist/certificate-v2/certificate-settings.ro.js +8 -0
- package/dist/certificate-v2/update-certificate-settings.dto.d.ts +2 -0
- package/dist/certificate-v2/update-certificate-settings.dto.js +12 -0
- package/dist/email-builder/index.d.ts +18 -0
- package/dist/email-builder/index.js +48 -20
- package/dist/emails/index.d.ts +21 -0
- package/dist/openapi/certificates-v2/openapi-certificates-shop.ro.d.ts +2 -0
- package/dist/openapi/certificates-v2/openapi-certificates-shop.ro.js +8 -0
- package/dist/openapi/morty/morty-attraction.ro.d.ts +26 -0
- package/dist/openapi/morty/morty-attraction.ro.js +91 -0
- package/dist/openapi/morty/morty-attractions-query.dto.d.ts +8 -0
- package/dist/openapi/morty/morty-attractions-query.dto.js +29 -0
- package/dist/openapi/morty/morty-booking.ro.d.ts +13 -0
- package/dist/openapi/morty/morty-booking.ro.js +45 -0
- package/dist/openapi/morty/morty-create-booking.dto.d.ts +42 -0
- package/dist/openapi/morty/morty-create-booking.dto.js +122 -0
- package/dist/openapi/morty/morty-timeslot.ro.d.ts +49 -0
- package/dist/openapi/morty/morty-timeslot.ro.js +129 -0
- package/dist/openapi/morty/morty-timeslots-query.dto.d.ts +21 -0
- package/dist/openapi/morty/morty-timeslots-query.dto.js +48 -0
- package/dist/openapi/shared/openapi-questroom.ro.d.ts +2 -41
- package/dist/openapi/shared/openapi-questroom.ro.js +8 -4
- package/dist/openapi/widget/openapi-resolve-promocode.ro.d.ts +7 -0
- package/dist/openapi/widget/openapi-resolve-promocode.ro.js +5 -0
- package/dist/openapi/widget/openapi-widget-info.ro.js +5 -1
- package/dist/order/create-order.dto.d.ts +12 -0
- package/dist/order/create-order.dto.js +6 -0
- package/dist/profile/birthday-marketing/birthday-marketing.dto.d.ts +6 -0
- package/dist/profile/birthday-marketing/birthday-marketing.dto.js +6 -0
- package/dist/profile/cross-sale/cross-sale.dto.d.ts +8 -0
- package/dist/profile/cross-sale/cross-sale.dto.js +6 -0
- package/dist/profile/cross-sale/cross-sale.ro.d.ts +2 -0
- package/dist/profile/cross-sale/cross-sale.ro.js +4 -0
- package/dist/profile/custom-client-booking-email/custom-client-booking-email.dto.d.ts +11 -0
- package/dist/profile/custom-client-booking-email/custom-client-booking-email.dto.js +6 -0
- package/dist/profile/custom-client-booking-email/custom-client-booking-email.ro.d.ts +9 -0
- package/dist/profile/custom-client-booking-email/custom-client-booking-email.ro.js +4 -0
- package/dist/profile/marketing-email/preview-campaign-v2.dto.d.ts +37 -0
- package/dist/profile/marketing-email/preview-campaign-v2.dto.js +43 -1
- package/dist/promocode/create-promocode.dto.d.ts +7 -0
- package/dist/promocode/create-promocode.dto.js +8 -0
- package/dist/promocode/emun/promocode-certificate-mode.enum.d.ts +18 -0
- package/dist/promocode/emun/promocode-certificate-mode.enum.js +22 -0
- package/dist/promocode/promocode-nominal-rule.d.ts +14 -5
- package/dist/promocode/promocode.ro.d.ts +2 -0
- package/dist/promocode/promocode.ro.js +5 -0
- package/dist/questroom/create-questroom-admin.dto.d.ts +1 -0
- package/dist/questroom/create-questroom-admin.dto.js +12 -5
- package/dist/questroom/create-questroom.dto.js +10 -6
- package/dist/questroom/enum/questroom-type.enum.d.ts +2 -1
- package/dist/questroom/enum/questroom-type.enum.js +1 -0
- package/dist/questroom/lounge-questroom.d.ts +11 -0
- package/dist/questroom/lounge-questroom.js +36 -0
- package/dist/questroom/questrooms-list-admin.ro.d.ts +2 -0
- package/dist/questroom/questrooms-list-admin.ro.js +8 -0
- package/dist/questroom-scenario-email/create-questroom-scenario-email.dto.d.ts +13 -0
- package/dist/questroom-scenario-email/create-questroom-scenario-email.dto.js +6 -0
- package/dist/questroom-scenario-email/questroom-scenario-email.ro.d.ts +2 -0
- package/dist/questroom-scenario-email/questroom-scenario-email.ro.js +4 -0
- package/dist/shared/source.enum.d.ts +1 -0
- package/dist/shared/source.enum.js +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/widget-sessions/widget-session-attach-order.dto.d.ts +11 -0
- package/dist/widget-sessions/widget-session-attach-order.dto.js +42 -0
- package/dist/widget-sessions/widget-session-events.ro.d.ts +8 -0
- package/dist/widget-sessions/widget-session-events.ro.js +2 -0
- package/dist/widget-sessions/widget-session-query.dto.d.ts +15 -0
- package/dist/widget-sessions/widget-session-query.dto.js +63 -0
- package/dist/widget-sessions/widget-session-update.dto.d.ts +6 -0
- package/dist/widget-sessions/widget-session-update.dto.js +27 -0
- package/dist/widget-sessions/widget-session.ro.d.ts +50 -0
- package/dist/widget-sessions/widget-session.ro.js +2 -0
- package/package.json +2 -2
|
@@ -9,6 +9,8 @@ export declare class CertificateSettingsRO extends RO {
|
|
|
9
9
|
pickupAvailable: boolean;
|
|
10
10
|
pickupInfo: string;
|
|
11
11
|
deliveryInfo: string;
|
|
12
|
+
shopTitle: string;
|
|
13
|
+
shopSubtitle: string;
|
|
12
14
|
onlinePaymentsCashbox: number | null;
|
|
13
15
|
squareCashbox: number | null;
|
|
14
16
|
paypalCashbox: number | null;
|
|
@@ -51,6 +51,14 @@ __decorate([
|
|
|
51
51
|
(0, class_transformer_1.Expose)(),
|
|
52
52
|
__metadata("design:type", String)
|
|
53
53
|
], CertificateSettingsRO.prototype, "deliveryInfo", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, class_transformer_1.Expose)(),
|
|
56
|
+
__metadata("design:type", String)
|
|
57
|
+
], CertificateSettingsRO.prototype, "shopTitle", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, class_transformer_1.Expose)(),
|
|
60
|
+
__metadata("design:type", String)
|
|
61
|
+
], CertificateSettingsRO.prototype, "shopSubtitle", void 0);
|
|
54
62
|
__decorate([
|
|
55
63
|
(0, class_transformer_1.Expose)(),
|
|
56
64
|
__metadata("design:type", Number)
|
|
@@ -7,6 +7,8 @@ export declare class UpdateCertificateSettingsDto {
|
|
|
7
7
|
pickupAvailable?: boolean;
|
|
8
8
|
pickupInfo?: string;
|
|
9
9
|
deliveryInfo?: string;
|
|
10
|
+
shopTitle?: string;
|
|
11
|
+
shopSubtitle?: string;
|
|
10
12
|
onlinePaymentsCashbox?: number | null;
|
|
11
13
|
squareCashbox?: number | null;
|
|
12
14
|
paypalCashbox?: number | null;
|
|
@@ -75,6 +75,18 @@ __decorate([
|
|
|
75
75
|
(0, class_transformer_1.Expose)(),
|
|
76
76
|
__metadata("design:type", String)
|
|
77
77
|
], UpdateCertificateSettingsDto.prototype, "deliveryInfo", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, class_validator_1.IsOptional)(),
|
|
80
|
+
(0, class_validator_1.IsString)(),
|
|
81
|
+
(0, class_transformer_1.Expose)(),
|
|
82
|
+
__metadata("design:type", String)
|
|
83
|
+
], UpdateCertificateSettingsDto.prototype, "shopTitle", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, class_validator_1.IsOptional)(),
|
|
86
|
+
(0, class_validator_1.IsString)(),
|
|
87
|
+
(0, class_transformer_1.Expose)(),
|
|
88
|
+
__metadata("design:type", String)
|
|
89
|
+
], UpdateCertificateSettingsDto.prototype, "shopSubtitle", void 0);
|
|
78
90
|
__decorate([
|
|
79
91
|
(0, class_validator_1.IsOptional)(),
|
|
80
92
|
(0, class_transformer_1.Expose)(),
|
|
@@ -125,10 +125,28 @@ export type EmailContentJsonV2 = {
|
|
|
125
125
|
theme?: EmailThemeV2;
|
|
126
126
|
};
|
|
127
127
|
export declare const isEmailContentJsonV2: (raw: unknown) => raw is EmailContentJsonV2;
|
|
128
|
+
/**
|
|
129
|
+
* Дефолтная тема для seed'а пустого шаблона и для конверсии legacy
|
|
130
|
+
* HTML в v2. Экспортирована, чтобы конвертеры/миграции могли собирать
|
|
131
|
+
* `EmailContentJsonV2` с идентичной темой — иначе после миграции на
|
|
132
|
+
* v2 шаблоны визуально отличались бы от seed'а.
|
|
133
|
+
*/
|
|
134
|
+
export declare const DEFAULT_EMAIL_THEME: EmailThemeV2;
|
|
128
135
|
export declare const createEmptyEmailContent: () => EmailContentJsonV2;
|
|
129
136
|
export type CreateDefaultEmailContentOptions = {
|
|
130
137
|
logo?: string | null;
|
|
131
138
|
};
|
|
139
|
+
/**
|
|
140
|
+
* Image-нода с предустановленным логотипом. Используется и в seed'е
|
|
141
|
+
* чистого шаблона (`createDefaultEmailContent`), и при конверсии
|
|
142
|
+
* legacy HTML в v2 (`@escapenavigator/utils/dist/email-builder/from-html`):
|
|
143
|
+
* чтобы во всех v2-документах лого выглядел одинаково (выравнивание,
|
|
144
|
+
* размер, alt).
|
|
145
|
+
*
|
|
146
|
+
* Возвращает `null` если логотипа нет — caller сам решает, добавлять
|
|
147
|
+
* пустоту в `doc.content` или нет.
|
|
148
|
+
*/
|
|
149
|
+
export declare const createLogoNode: (logo?: string | null) => Record<string, unknown> | null;
|
|
132
150
|
export declare const createDefaultEmailContent: (options?: CreateDefaultEmailContentOptions) => EmailContentJsonV2;
|
|
133
151
|
export declare const normalizeEmailTheme: (raw: unknown) => EmailThemeV2 | undefined;
|
|
134
152
|
/**
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* for transactional emails that are NOT user-editable.
|
|
12
12
|
*/
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.EmailScope = exports.normalizeEmailTheme = exports.createDefaultEmailContent = exports.createEmptyEmailContent = exports.isEmailContentJsonV2 = exports.resolveEmailThemeColors = exports.deriveEmailTextColors = exports.EMAIL_CONTENT_VERSION_V2 = void 0;
|
|
14
|
+
exports.EmailScope = exports.normalizeEmailTheme = exports.createDefaultEmailContent = exports.createLogoNode = exports.createEmptyEmailContent = exports.DEFAULT_EMAIL_THEME = exports.isEmailContentJsonV2 = exports.resolveEmailThemeColors = exports.deriveEmailTextColors = exports.EMAIL_CONTENT_VERSION_V2 = void 0;
|
|
15
15
|
exports.EMAIL_CONTENT_VERSION_V2 = 'v2';
|
|
16
16
|
/**
|
|
17
17
|
* Compute the relative luminance of an opaque hex color in [0, 1].
|
|
@@ -104,7 +104,13 @@ const isEmailContentJsonV2 = (raw) => {
|
|
|
104
104
|
((_a = raw.doc) === null || _a === void 0 ? void 0 : _a.type) === 'doc';
|
|
105
105
|
};
|
|
106
106
|
exports.isEmailContentJsonV2 = isEmailContentJsonV2;
|
|
107
|
-
|
|
107
|
+
/**
|
|
108
|
+
* Дефолтная тема для seed'а пустого шаблона и для конверсии legacy
|
|
109
|
+
* HTML в v2. Экспортирована, чтобы конвертеры/миграции могли собирать
|
|
110
|
+
* `EmailContentJsonV2` с идентичной темой — иначе после миграции на
|
|
111
|
+
* v2 шаблоны визуально отличались бы от seed'а.
|
|
112
|
+
*/
|
|
113
|
+
exports.DEFAULT_EMAIL_THEME = {
|
|
108
114
|
body: {
|
|
109
115
|
backgroundColor: '#000000',
|
|
110
116
|
paddingTop: '0px',
|
|
@@ -147,28 +153,50 @@ const MUTED_TEXT_MARK = { type: 'textStyle', attrs: { color: '#9CA3AF' } };
|
|
|
147
153
|
const createEmptyEmailContent = () => ({
|
|
148
154
|
version: exports.EMAIL_CONTENT_VERSION_V2,
|
|
149
155
|
doc: { type: 'doc', content: [] },
|
|
150
|
-
theme: DEFAULT_EMAIL_THEME,
|
|
156
|
+
theme: exports.DEFAULT_EMAIL_THEME,
|
|
151
157
|
});
|
|
152
158
|
exports.createEmptyEmailContent = createEmptyEmailContent;
|
|
159
|
+
/**
|
|
160
|
+
* Бренд, используемый в `alt`/`title` для логотипа. Захардкожен — это
|
|
161
|
+
* не персонализированное имя профиля (которое подставляется через
|
|
162
|
+
* `{profile.title}` переменную), а fallback-надпись на случай, когда
|
|
163
|
+
* картинка не загрузилась.
|
|
164
|
+
*/
|
|
165
|
+
const BRAND = 'Escape Navigator';
|
|
166
|
+
/**
|
|
167
|
+
* Image-нода с предустановленным логотипом. Используется и в seed'е
|
|
168
|
+
* чистого шаблона (`createDefaultEmailContent`), и при конверсии
|
|
169
|
+
* legacy HTML в v2 (`@escapenavigator/utils/dist/email-builder/from-html`):
|
|
170
|
+
* чтобы во всех v2-документах лого выглядел одинаково (выравнивание,
|
|
171
|
+
* размер, alt).
|
|
172
|
+
*
|
|
173
|
+
* Возвращает `null` если логотипа нет — caller сам решает, добавлять
|
|
174
|
+
* пустоту в `doc.content` или нет.
|
|
175
|
+
*/
|
|
176
|
+
const createLogoNode = (logo) => {
|
|
177
|
+
if (!logo)
|
|
178
|
+
return null;
|
|
179
|
+
return {
|
|
180
|
+
type: 'image',
|
|
181
|
+
attrs: {
|
|
182
|
+
src: logo,
|
|
183
|
+
alt: BRAND,
|
|
184
|
+
title: BRAND,
|
|
185
|
+
width: 100,
|
|
186
|
+
height: 'auto',
|
|
187
|
+
alignment: 'left',
|
|
188
|
+
borderRadius: 0,
|
|
189
|
+
externalLink: '',
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
exports.createLogoNode = createLogoNode;
|
|
153
194
|
const createDefaultEmailContent = (options = {}) => {
|
|
154
195
|
const { logo } = options;
|
|
155
|
-
const brand = 'Escape Navigator';
|
|
156
196
|
const content = [];
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
attrs: {
|
|
161
|
-
src: logo,
|
|
162
|
-
alt: brand,
|
|
163
|
-
title: brand,
|
|
164
|
-
width: 100,
|
|
165
|
-
height: 'auto',
|
|
166
|
-
alignment: 'left',
|
|
167
|
-
borderRadius: 0,
|
|
168
|
-
externalLink: '',
|
|
169
|
-
},
|
|
170
|
-
});
|
|
171
|
-
}
|
|
197
|
+
const logoNode = (0, exports.createLogoNode)(logo);
|
|
198
|
+
if (logoNode)
|
|
199
|
+
content.push(logoNode);
|
|
172
200
|
content.push({
|
|
173
201
|
type: 'heading',
|
|
174
202
|
attrs: { level: 1, textAlign: 'left' },
|
|
@@ -256,7 +284,7 @@ const createDefaultEmailContent = (options = {}) => {
|
|
|
256
284
|
return {
|
|
257
285
|
version: exports.EMAIL_CONTENT_VERSION_V2,
|
|
258
286
|
doc: { type: 'doc', content },
|
|
259
|
-
theme: DEFAULT_EMAIL_THEME,
|
|
287
|
+
theme: exports.DEFAULT_EMAIL_THEME,
|
|
260
288
|
};
|
|
261
289
|
};
|
|
262
290
|
exports.createDefaultEmailContent = createDefaultEmailContent;
|
package/dist/emails/index.d.ts
CHANGED
|
@@ -98,6 +98,27 @@ export type EmailDataV2 = EmailContentJsonV2 & {
|
|
|
98
98
|
*/
|
|
99
99
|
extra?: Record<string, string>;
|
|
100
100
|
};
|
|
101
|
+
/**
|
|
102
|
+
* Block-level HTML payloads keyed by `variable.id` inside doc's
|
|
103
|
+
* `htmlCodeBlock` nodes (e.g. legacy `orderDetailsHtml`). Used for
|
|
104
|
+
* transactional templates where part of the body is a server-built
|
|
105
|
+
* table/grid that can't be expressed as TipTap structurally. The
|
|
106
|
+
* renderer splices the raw HTML in place of the entire
|
|
107
|
+
* `<p>{{marker}}</p>` produced for the block node, so block markup
|
|
108
|
+
* (`<table>`/`<div>`) sits at the top level of the body and not
|
|
109
|
+
* nested inside `<p>` (Outlook breaks that).
|
|
110
|
+
*
|
|
111
|
+
* Keys that are not present in the doc are silently ignored —
|
|
112
|
+
* the sender doesn't have to know which placeholders the user
|
|
113
|
+
* actually kept in their template.
|
|
114
|
+
*
|
|
115
|
+
* NB: `photos` is NO LONGER in this channel — it now flows as an
|
|
116
|
+
* editable `image`-node with `src=photos` (see `migratePhotosToImage`
|
|
117
|
+
* in `from-html.ts`). `servicesList` (the up-sale list) used to live
|
|
118
|
+
* here too, but the whole feature was removed; old templates that
|
|
119
|
+
* still contain `{servicesList}` are silently dropped by the converter.
|
|
120
|
+
*/
|
|
121
|
+
blockPayloads?: Record<string, string>;
|
|
101
122
|
};
|
|
102
123
|
export type SendEmailData = EmailDataV1 | EmailDataV2;
|
|
103
124
|
export type SendEmailRequestParams = {
|
|
@@ -9,6 +9,8 @@ export declare class OpenapiCertificateSettingsRO {
|
|
|
9
9
|
pickupAvailable: boolean;
|
|
10
10
|
pickupInfo: string;
|
|
11
11
|
deliveryInfo: string;
|
|
12
|
+
shopTitle: string;
|
|
13
|
+
shopSubtitle: string;
|
|
12
14
|
}
|
|
13
15
|
export declare class OpenapiCertificatesShopRO {
|
|
14
16
|
settings: OpenapiCertificateSettingsRO;
|
|
@@ -48,6 +48,14 @@ __decorate([
|
|
|
48
48
|
(0, class_transformer_1.Expose)(),
|
|
49
49
|
__metadata("design:type", String)
|
|
50
50
|
], OpenapiCertificateSettingsRO.prototype, "deliveryInfo", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, class_transformer_1.Expose)(),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], OpenapiCertificateSettingsRO.prototype, "shopTitle", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, class_transformer_1.Expose)(),
|
|
57
|
+
__metadata("design:type", String)
|
|
58
|
+
], OpenapiCertificateSettingsRO.prototype, "shopSubtitle", void 0);
|
|
51
59
|
class OpenapiCertificatesShopRO {
|
|
52
60
|
}
|
|
53
61
|
exports.OpenapiCertificatesShopRO = OpenapiCertificatesShopRO;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { QuestroomTypeEnum } from '../../questroom/enum/questroom-type.enum';
|
|
2
|
+
declare class MortyAttractionLocation {
|
|
3
|
+
address: string;
|
|
4
|
+
longitude: number | null;
|
|
5
|
+
latitude: number | null;
|
|
6
|
+
phone: string;
|
|
7
|
+
timeZone: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Описание аттракциона (квеста), которое отдаётся в Morty по запросу
|
|
11
|
+
* `GET /morty/attractions`. Содержит публично-разрешённые поля квеста
|
|
12
|
+
* + сводную информацию по локации/таймзоне.
|
|
13
|
+
*/
|
|
14
|
+
export declare class MortyAttractionRO {
|
|
15
|
+
id: number;
|
|
16
|
+
title: string;
|
|
17
|
+
slug: string;
|
|
18
|
+
photo: string;
|
|
19
|
+
type: QuestroomTypeEnum;
|
|
20
|
+
description?: string;
|
|
21
|
+
playersMin: number;
|
|
22
|
+
playersMax: number;
|
|
23
|
+
profile_id: number | null;
|
|
24
|
+
location: MortyAttractionLocation;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,91 @@
|
|
|
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.MortyAttractionRO = void 0;
|
|
13
|
+
/* eslint-disable max-classes-per-file */
|
|
14
|
+
const class_transformer_1 = require("class-transformer");
|
|
15
|
+
const questroom_type_enum_1 = require("../../questroom/enum/questroom-type.enum");
|
|
16
|
+
class MortyAttractionLocation {
|
|
17
|
+
}
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, class_transformer_1.Expose)(),
|
|
20
|
+
(0, class_transformer_1.Transform)(({ value }) => value ? value.split(',').slice(0, -1).join(',').trim() : ''),
|
|
21
|
+
__metadata("design:type", String)
|
|
22
|
+
], MortyAttractionLocation.prototype, "address", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_transformer_1.Expose)(),
|
|
25
|
+
(0, class_transformer_1.Transform)(({ obj }) => { var _a, _b, _c; return (_c = (_b = (_a = obj === null || obj === void 0 ? void 0 : obj.coordinates) === null || _a === void 0 ? void 0 : _a.coordinates) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : null; }),
|
|
26
|
+
__metadata("design:type", Number)
|
|
27
|
+
], MortyAttractionLocation.prototype, "longitude", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, class_transformer_1.Expose)(),
|
|
30
|
+
(0, class_transformer_1.Transform)(({ obj }) => { var _a, _b, _c; return (_c = (_b = (_a = obj === null || obj === void 0 ? void 0 : obj.coordinates) === null || _a === void 0 ? void 0 : _a.coordinates) === null || _b === void 0 ? void 0 : _b[1]) !== null && _c !== void 0 ? _c : null; }),
|
|
31
|
+
__metadata("design:type", Number)
|
|
32
|
+
], MortyAttractionLocation.prototype, "latitude", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_transformer_1.Expose)(),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], MortyAttractionLocation.prototype, "phone", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_transformer_1.Expose)(),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], MortyAttractionLocation.prototype, "timeZone", void 0);
|
|
41
|
+
/**
|
|
42
|
+
* Описание аттракциона (квеста), которое отдаётся в Morty по запросу
|
|
43
|
+
* `GET /morty/attractions`. Содержит публично-разрешённые поля квеста
|
|
44
|
+
* + сводную информацию по локации/таймзоне.
|
|
45
|
+
*/
|
|
46
|
+
class MortyAttractionRO {
|
|
47
|
+
}
|
|
48
|
+
exports.MortyAttractionRO = MortyAttractionRO;
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, class_transformer_1.Expose)(),
|
|
51
|
+
__metadata("design:type", Number)
|
|
52
|
+
], MortyAttractionRO.prototype, "id", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, class_transformer_1.Expose)(),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], MortyAttractionRO.prototype, "title", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, class_transformer_1.Expose)(),
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], MortyAttractionRO.prototype, "slug", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, class_transformer_1.Expose)(),
|
|
63
|
+
__metadata("design:type", String)
|
|
64
|
+
], MortyAttractionRO.prototype, "photo", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, class_transformer_1.Expose)(),
|
|
67
|
+
__metadata("design:type", String)
|
|
68
|
+
], MortyAttractionRO.prototype, "type", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, class_transformer_1.Expose)(),
|
|
71
|
+
(0, class_transformer_1.Transform)(({ value }) => value !== null && value !== void 0 ? value : null),
|
|
72
|
+
__metadata("design:type", String)
|
|
73
|
+
], MortyAttractionRO.prototype, "description", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, class_transformer_1.Expose)(),
|
|
76
|
+
__metadata("design:type", Number)
|
|
77
|
+
], MortyAttractionRO.prototype, "playersMin", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, class_transformer_1.Expose)(),
|
|
80
|
+
__metadata("design:type", Number)
|
|
81
|
+
], MortyAttractionRO.prototype, "playersMax", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
(0, class_transformer_1.Expose)(),
|
|
84
|
+
(0, class_transformer_1.Transform)(({ obj }) => { var _a; return (_a = obj === null || obj === void 0 ? void 0 : obj.profileId) !== null && _a !== void 0 ? _a : null; }),
|
|
85
|
+
__metadata("design:type", Number)
|
|
86
|
+
], MortyAttractionRO.prototype, "profile_id", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
(0, class_transformer_1.Expose)(),
|
|
89
|
+
(0, class_transformer_1.Type)(() => MortyAttractionLocation),
|
|
90
|
+
__metadata("design:type", MortyAttractionLocation)
|
|
91
|
+
], MortyAttractionRO.prototype, "location", void 0);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `GET /morty/attractions?profile_id=…` — опциональная фильтрация по
|
|
3
|
+
* профилю. Без параметра возвращаем все профили с включённым флагом
|
|
4
|
+
* `morty=true` и активной партнёрской программой.
|
|
5
|
+
*/
|
|
6
|
+
export declare class MortyAttractionsQueryDto {
|
|
7
|
+
profile_id?: number;
|
|
8
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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.MortyAttractionsQueryDto = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
/**
|
|
16
|
+
* `GET /morty/attractions?profile_id=…` — опциональная фильтрация по
|
|
17
|
+
* профилю. Без параметра возвращаем все профили с включённым флагом
|
|
18
|
+
* `morty=true` и активной партнёрской программой.
|
|
19
|
+
*/
|
|
20
|
+
class MortyAttractionsQueryDto {
|
|
21
|
+
}
|
|
22
|
+
exports.MortyAttractionsQueryDto = MortyAttractionsQueryDto;
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_transformer_1.Expose)(),
|
|
25
|
+
(0, class_validator_1.IsOptional)(),
|
|
26
|
+
(0, class_transformer_1.Transform)(({ value }) => (value === undefined || value === null ? value : Number(value))),
|
|
27
|
+
(0, class_validator_1.IsPositive)(),
|
|
28
|
+
__metadata("design:type", Number)
|
|
29
|
+
], MortyAttractionsQueryDto.prototype, "profile_id", void 0);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ответ на `POST /morty/bookings` / `DELETE /morty/bookings/:id`.
|
|
3
|
+
* `confirmation_code` — наш внутренний `order.code`, который клиент
|
|
4
|
+
* увидит в письме и сможет назвать на ресепшене.
|
|
5
|
+
*/
|
|
6
|
+
export declare class MortyBookingRO {
|
|
7
|
+
success: boolean;
|
|
8
|
+
booking_id: number;
|
|
9
|
+
external_booking_id: string;
|
|
10
|
+
confirmation_code: string;
|
|
11
|
+
status: 'confirmed' | 'cancelled' | 'failed';
|
|
12
|
+
message?: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
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.MortyBookingRO = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
/**
|
|
15
|
+
* Ответ на `POST /morty/bookings` / `DELETE /morty/bookings/:id`.
|
|
16
|
+
* `confirmation_code` — наш внутренний `order.code`, который клиент
|
|
17
|
+
* увидит в письме и сможет назвать на ресепшене.
|
|
18
|
+
*/
|
|
19
|
+
class MortyBookingRO {
|
|
20
|
+
}
|
|
21
|
+
exports.MortyBookingRO = MortyBookingRO;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_transformer_1.Expose)(),
|
|
24
|
+
__metadata("design:type", Boolean)
|
|
25
|
+
], MortyBookingRO.prototype, "success", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, class_transformer_1.Expose)(),
|
|
28
|
+
__metadata("design:type", Number)
|
|
29
|
+
], MortyBookingRO.prototype, "booking_id", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, class_transformer_1.Expose)(),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], MortyBookingRO.prototype, "external_booking_id", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, class_transformer_1.Expose)(),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], MortyBookingRO.prototype, "confirmation_code", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, class_transformer_1.Expose)(),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], MortyBookingRO.prototype, "status", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, class_transformer_1.Expose)(),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], MortyBookingRO.prototype, "message", void 0);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare class MortyCustomerDto {
|
|
2
|
+
first_name: string;
|
|
3
|
+
last_name: string;
|
|
4
|
+
email: string;
|
|
5
|
+
phone: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class MortyBookingPaymentDto {
|
|
8
|
+
/**
|
|
9
|
+
* Сумма оплаты на стороне Morty в основной валюте (не minor units).
|
|
10
|
+
*/
|
|
11
|
+
amount: number;
|
|
12
|
+
currency?: string;
|
|
13
|
+
transaction_id?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* `POST /morty/bookings` — Morty создаёт у нас бронь.
|
|
17
|
+
*
|
|
18
|
+
* Поле `timeslot_id` — это id из `MortyTimeslotRO.id` (наш внутренний
|
|
19
|
+
* slot.id). По нему мы достаём profileId, questroomId, тариф и т.д.
|
|
20
|
+
*
|
|
21
|
+
* `external_booking_id` — id брони на стороне Morty (используем как
|
|
22
|
+
* `order.otherId` для идемпотентности и для отмен по тому же id).
|
|
23
|
+
*
|
|
24
|
+
* `paid` — Morty оплатил бронь (т.е. деньги ушли клиенту через Morty,
|
|
25
|
+
* а не через наш кассовый/виджетный путь). Помечаем заказ как
|
|
26
|
+
* `otherPayment=true`, чтобы он не дёргал наши Stripe/CloudPayments.
|
|
27
|
+
*/
|
|
28
|
+
export declare class MortyCreateBookingDto {
|
|
29
|
+
timeslot_id: string;
|
|
30
|
+
external_booking_id: string;
|
|
31
|
+
players: number;
|
|
32
|
+
customer: MortyCustomerDto;
|
|
33
|
+
comment?: string;
|
|
34
|
+
paid?: boolean;
|
|
35
|
+
payment?: MortyBookingPaymentDto;
|
|
36
|
+
/**
|
|
37
|
+
* Произвольные доп. поля, которые Morty может прислать (промокоды,
|
|
38
|
+
* метаданные клиента и т.п.). Игнорируется на нашей стороне в
|
|
39
|
+
* текущей версии.
|
|
40
|
+
*/
|
|
41
|
+
extras?: unknown[];
|
|
42
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
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.MortyCreateBookingDto = exports.MortyBookingPaymentDto = exports.MortyCustomerDto = void 0;
|
|
13
|
+
/* eslint-disable max-classes-per-file */
|
|
14
|
+
const class_transformer_1 = require("class-transformer");
|
|
15
|
+
const class_validator_1 = require("class-validator");
|
|
16
|
+
const is_not_blank_1 = require("../../shared/is-not-blank");
|
|
17
|
+
class MortyCustomerDto {
|
|
18
|
+
}
|
|
19
|
+
exports.MortyCustomerDto = MortyCustomerDto;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, class_transformer_1.Expose)(),
|
|
22
|
+
(0, is_not_blank_1.IsNotBlank)(),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], MortyCustomerDto.prototype, "first_name", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_transformer_1.Expose)(),
|
|
27
|
+
(0, is_not_blank_1.IsNotBlank)(),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], MortyCustomerDto.prototype, "last_name", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, class_transformer_1.Expose)(),
|
|
32
|
+
(0, class_validator_1.IsEmail)(),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], MortyCustomerDto.prototype, "email", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, class_transformer_1.Expose)(),
|
|
37
|
+
(0, is_not_blank_1.IsNotBlank)(),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], MortyCustomerDto.prototype, "phone", void 0);
|
|
40
|
+
class MortyBookingPaymentDto {
|
|
41
|
+
}
|
|
42
|
+
exports.MortyBookingPaymentDto = MortyBookingPaymentDto;
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, class_transformer_1.Expose)(),
|
|
45
|
+
(0, class_validator_1.IsNumber)(),
|
|
46
|
+
(0, class_validator_1.IsPositive)(),
|
|
47
|
+
__metadata("design:type", Number)
|
|
48
|
+
], MortyBookingPaymentDto.prototype, "amount", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, class_transformer_1.Expose)(),
|
|
51
|
+
(0, class_validator_1.IsOptional)(),
|
|
52
|
+
(0, class_validator_1.IsString)(),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], MortyBookingPaymentDto.prototype, "currency", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, class_transformer_1.Expose)(),
|
|
57
|
+
(0, class_validator_1.IsOptional)(),
|
|
58
|
+
(0, class_validator_1.IsString)(),
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], MortyBookingPaymentDto.prototype, "transaction_id", void 0);
|
|
61
|
+
/**
|
|
62
|
+
* `POST /morty/bookings` — Morty создаёт у нас бронь.
|
|
63
|
+
*
|
|
64
|
+
* Поле `timeslot_id` — это id из `MortyTimeslotRO.id` (наш внутренний
|
|
65
|
+
* slot.id). По нему мы достаём profileId, questroomId, тариф и т.д.
|
|
66
|
+
*
|
|
67
|
+
* `external_booking_id` — id брони на стороне Morty (используем как
|
|
68
|
+
* `order.otherId` для идемпотентности и для отмен по тому же id).
|
|
69
|
+
*
|
|
70
|
+
* `paid` — Morty оплатил бронь (т.е. деньги ушли клиенту через Morty,
|
|
71
|
+
* а не через наш кассовый/виджетный путь). Помечаем заказ как
|
|
72
|
+
* `otherPayment=true`, чтобы он не дёргал наши Stripe/CloudPayments.
|
|
73
|
+
*/
|
|
74
|
+
class MortyCreateBookingDto {
|
|
75
|
+
}
|
|
76
|
+
exports.MortyCreateBookingDto = MortyCreateBookingDto;
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, class_transformer_1.Expose)(),
|
|
79
|
+
(0, is_not_blank_1.IsNotBlank)(),
|
|
80
|
+
__metadata("design:type", String)
|
|
81
|
+
], MortyCreateBookingDto.prototype, "timeslot_id", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
(0, class_transformer_1.Expose)(),
|
|
84
|
+
(0, is_not_blank_1.IsNotBlank)(),
|
|
85
|
+
__metadata("design:type", String)
|
|
86
|
+
], MortyCreateBookingDto.prototype, "external_booking_id", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
(0, class_transformer_1.Expose)(),
|
|
89
|
+
(0, class_validator_1.IsPositive)(),
|
|
90
|
+
__metadata("design:type", Number)
|
|
91
|
+
], MortyCreateBookingDto.prototype, "players", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, class_transformer_1.Expose)(),
|
|
94
|
+
(0, class_validator_1.ValidateNested)(),
|
|
95
|
+
(0, class_transformer_1.Type)(() => MortyCustomerDto),
|
|
96
|
+
__metadata("design:type", MortyCustomerDto)
|
|
97
|
+
], MortyCreateBookingDto.prototype, "customer", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, class_transformer_1.Expose)(),
|
|
100
|
+
(0, class_validator_1.IsOptional)(),
|
|
101
|
+
(0, class_validator_1.IsString)(),
|
|
102
|
+
__metadata("design:type", String)
|
|
103
|
+
], MortyCreateBookingDto.prototype, "comment", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, class_transformer_1.Expose)(),
|
|
106
|
+
(0, class_validator_1.IsOptional)(),
|
|
107
|
+
(0, class_validator_1.IsBoolean)(),
|
|
108
|
+
__metadata("design:type", Boolean)
|
|
109
|
+
], MortyCreateBookingDto.prototype, "paid", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
(0, class_transformer_1.Expose)(),
|
|
112
|
+
(0, class_validator_1.IsOptional)(),
|
|
113
|
+
(0, class_validator_1.ValidateNested)(),
|
|
114
|
+
(0, class_transformer_1.Type)(() => MortyBookingPaymentDto),
|
|
115
|
+
__metadata("design:type", MortyBookingPaymentDto)
|
|
116
|
+
], MortyCreateBookingDto.prototype, "payment", void 0);
|
|
117
|
+
__decorate([
|
|
118
|
+
(0, class_transformer_1.Expose)(),
|
|
119
|
+
(0, class_validator_1.IsOptional)(),
|
|
120
|
+
(0, class_validator_1.IsArray)(),
|
|
121
|
+
__metadata("design:type", Array)
|
|
122
|
+
], MortyCreateBookingDto.prototype, "extras", void 0);
|