@escapenavigator/services 1.10.150 → 1.10.152
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/api/init-client-api.d.ts +2 -0
- package/dist/api/init-client-api.js +2 -0
- package/dist/api/marketing-automation-api/find-or-create-marketing-automation.d.ts +14 -0
- package/dist/api/marketing-automation-api/find-or-create-marketing-automation.js +11 -0
- package/dist/api/marketing-automation-api/generate-default-template.d.ts +15 -0
- package/dist/api/marketing-automation-api/generate-default-template.js +23 -0
- package/dist/api/marketing-automation-api/get-marketing-automations.d.ts +10 -0
- package/dist/api/marketing-automation-api/get-marketing-automations.js +12 -0
- package/dist/api/marketing-automation-api/index.d.ts +12 -0
- package/dist/api/marketing-automation-api/index.js +13 -0
- package/dist/api/marketing-automation-api/update-marketing-automation.d.ts +13 -0
- package/dist/api/marketing-automation-api/update-marketing-automation.js +9 -0
- package/dist/api/profiles-api/index.d.ts +2 -0
- package/dist/api/profiles-api/index.js +2 -0
- package/dist/api/profiles-api/marketing-email-campaign/test-send-marketing-email-v2.d.ts +15 -0
- package/dist/api/profiles-api/marketing-email-campaign/test-send-marketing-email-v2.js +18 -0
- package/package.json +4 -4
|
@@ -29,6 +29,7 @@ import { landingReviewsApiDeclaration } from './landing-reviews-api';
|
|
|
29
29
|
import { locationsApiDeclaration } from './locations-api';
|
|
30
30
|
import { logsApiDeclaration } from './logs-api';
|
|
31
31
|
import { mailchimpApiDeclaration } from './mailchimp-api';
|
|
32
|
+
import { marketingAutomationApiDeclaration } from './marketing-automation-api';
|
|
32
33
|
import { marketingEmailVariablesApiDeclaration } from './marketing-email-variables-api';
|
|
33
34
|
import { marketingEmailsUnsubscribeApiDeclaration } from './marketing-emails-unsubscribe-api';
|
|
34
35
|
import { navigatorCertificateApiDeclaration } from './navigator-certificate-api';
|
|
@@ -110,6 +111,7 @@ export type InitApiDeclaration = {
|
|
|
110
111
|
subwayStations: Api<typeof subwayStationsApiDeclaration>;
|
|
111
112
|
nowEscape: Api<typeof nowEscapeApiDeclaration>;
|
|
112
113
|
logs: Api<typeof logsApiDeclaration>;
|
|
114
|
+
marketingAutomationApi: Api<typeof marketingAutomationApiDeclaration>;
|
|
113
115
|
marketingEmailVariables: Api<typeof marketingEmailVariablesApiDeclaration>;
|
|
114
116
|
marketingEmailsUnsubscribe: Api<typeof marketingEmailsUnsubscribeApiDeclaration>;
|
|
115
117
|
agregator: Api<typeof agregatorApiDeclaration>;
|
|
@@ -32,6 +32,7 @@ var landing_reviews_api_1 = require("./landing-reviews-api");
|
|
|
32
32
|
var locations_api_1 = require("./locations-api");
|
|
33
33
|
var logs_api_1 = require("./logs-api");
|
|
34
34
|
var mailchimp_api_1 = require("./mailchimp-api");
|
|
35
|
+
var marketing_automation_api_1 = require("./marketing-automation-api");
|
|
35
36
|
var marketing_email_variables_api_1 = require("./marketing-email-variables-api");
|
|
36
37
|
var marketing_emails_unsubscribe_api_1 = require("./marketing-emails-unsubscribe-api");
|
|
37
38
|
var navigator_certificate_api_1 = require("./navigator-certificate-api");
|
|
@@ -109,6 +110,7 @@ var initClientApi = function (url, clientOptions) { return ({
|
|
|
109
110
|
orderCertificates: (0, _1.initApi)(order_certificates_api_1.orderCertificatesApiDeclaration, url, clientOptions),
|
|
110
111
|
orderGroups: (0, _1.initApi)(order_groups_api_1.orderGroupsApiDeclaration, url, clientOptions),
|
|
111
112
|
logs: (0, _1.initApi)(logs_api_1.logsApiDeclaration, url, clientOptions),
|
|
113
|
+
marketingAutomationApi: (0, _1.initApi)(marketing_automation_api_1.marketingAutomationApiDeclaration, url, clientOptions),
|
|
112
114
|
marketingEmailVariables: (0, _1.initApi)(marketing_email_variables_api_1.marketingEmailVariablesApiDeclaration, url, clientOptions),
|
|
113
115
|
marketingEmailsUnsubscribe: (0, _1.initApi)(marketing_emails_unsubscribe_api_1.marketingEmailsUnsubscribeApiDeclaration, url, clientOptions),
|
|
114
116
|
agregator: (0, _1.initApi)(agregator_api_1.agregatorApiDeclaration, url, clientOptions),
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MarketingAutomationRO } from '@escapenavigator/types/dist/profile/marketing-automation/marketing-automation.ro';
|
|
2
|
+
import { MarketingAutomationTypeEnum } from '@escapenavigator/types/dist/profile/marketing-automation/marketing-automation-type.enum';
|
|
3
|
+
import { ApiMethodDeclaration } from '..';
|
|
4
|
+
/**
|
|
5
|
+
* `type` идёт в URL: бэкенд хранит по одной конфигурации на пару
|
|
6
|
+
* (профиль, тип). POST без тела — find-or-create: первое открытие
|
|
7
|
+
* карточки создаёт выключенный (`NONE`) черновик.
|
|
8
|
+
*/
|
|
9
|
+
type ParamsData = {
|
|
10
|
+
type: MarketingAutomationTypeEnum;
|
|
11
|
+
};
|
|
12
|
+
type ResponseData = MarketingAutomationRO;
|
|
13
|
+
export declare const findOrCreateMarketingAutomation: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.findOrCreateMarketingAutomation = void 0;
|
|
4
|
+
var findOrCreateMarketingAutomation = function (_a) {
|
|
5
|
+
var type = _a.type;
|
|
6
|
+
return ({
|
|
7
|
+
url: "/marketing-automation/".concat(type),
|
|
8
|
+
method: 'POST',
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
exports.findOrCreateMarketingAutomation = findOrCreateMarketingAutomation;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MarketingAutomationLocaleDto } from '@escapenavigator/types/dist/profile/marketing-automation/marketing-automation.dto';
|
|
2
|
+
import { MarketingAutomationDefaultTemplateDto } from '@escapenavigator/types/dist/profile/marketing-automation/marketing-automation-default-template.dto';
|
|
3
|
+
import { MarketingAutomationTypeEnum } from '@escapenavigator/types/dist/profile/marketing-automation/marketing-automation-type.enum';
|
|
4
|
+
import { ApiMethodDeclaration } from '..';
|
|
5
|
+
/**
|
|
6
|
+
* `type` идёт path-параметром, остальное (языки, название компании,
|
|
7
|
+
* логотип) — телом. Ответ — локали с готовым v2-`contentJson`, которые
|
|
8
|
+
* фронт кладёт в форму без сохранения (сохранение — отдельный PATCH).
|
|
9
|
+
*/
|
|
10
|
+
type ParamsData = MarketingAutomationDefaultTemplateDto & {
|
|
11
|
+
type: MarketingAutomationTypeEnum;
|
|
12
|
+
};
|
|
13
|
+
type ResponseData = MarketingAutomationLocaleDto[];
|
|
14
|
+
export declare const generateDefaultTemplate: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.generateDefaultTemplate = void 0;
|
|
15
|
+
var generateDefaultTemplate = function (_a) {
|
|
16
|
+
var type = _a.type, data = __rest(_a, ["type"]);
|
|
17
|
+
return ({
|
|
18
|
+
url: "/marketing-automation/".concat(type, "/default-template"),
|
|
19
|
+
method: 'POST',
|
|
20
|
+
data: data,
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
exports.generateDefaultTemplate = generateDefaultTemplate;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MarketingAutomationRO } from '@escapenavigator/types/dist/profile/marketing-automation/marketing-automation.ro';
|
|
2
|
+
import { ApiMethodDeclaration } from '..';
|
|
3
|
+
type ParamsData = undefined;
|
|
4
|
+
type ResponseData = MarketingAutomationRO[];
|
|
5
|
+
/**
|
|
6
|
+
* Все автоматизации профиля одним запросом — страница маркетинга
|
|
7
|
+
* рисует карточки из этого списка, без отдельного POST на каждый тип.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getMarketingAutomations: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMarketingAutomations = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Все автоматизации профиля одним запросом — страница маркетинга
|
|
6
|
+
* рисует карточки из этого списка, без отдельного POST на каждый тип.
|
|
7
|
+
*/
|
|
8
|
+
var getMarketingAutomations = function () { return ({
|
|
9
|
+
url: '/marketing-automation',
|
|
10
|
+
method: 'GET',
|
|
11
|
+
}); };
|
|
12
|
+
exports.getMarketingAutomations = getMarketingAutomations;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { findOrCreateMarketingAutomation } from './find-or-create-marketing-automation';
|
|
2
|
+
import { generateDefaultTemplate } from './generate-default-template';
|
|
3
|
+
import { getMarketingAutomations } from './get-marketing-automations';
|
|
4
|
+
import { updateMarketingAutomation } from './update-marketing-automation';
|
|
5
|
+
type ApiDeclaration = {
|
|
6
|
+
getMarketingAutomations: typeof getMarketingAutomations;
|
|
7
|
+
findOrCreateMarketingAutomation: typeof findOrCreateMarketingAutomation;
|
|
8
|
+
updateMarketingAutomation: typeof updateMarketingAutomation;
|
|
9
|
+
generateDefaultTemplate: typeof generateDefaultTemplate;
|
|
10
|
+
};
|
|
11
|
+
export declare const marketingAutomationApiDeclaration: ApiDeclaration;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.marketingAutomationApiDeclaration = void 0;
|
|
4
|
+
var find_or_create_marketing_automation_1 = require("./find-or-create-marketing-automation");
|
|
5
|
+
var generate_default_template_1 = require("./generate-default-template");
|
|
6
|
+
var get_marketing_automations_1 = require("./get-marketing-automations");
|
|
7
|
+
var update_marketing_automation_1 = require("./update-marketing-automation");
|
|
8
|
+
exports.marketingAutomationApiDeclaration = {
|
|
9
|
+
getMarketingAutomations: get_marketing_automations_1.getMarketingAutomations,
|
|
10
|
+
findOrCreateMarketingAutomation: find_or_create_marketing_automation_1.findOrCreateMarketingAutomation,
|
|
11
|
+
updateMarketingAutomation: update_marketing_automation_1.updateMarketingAutomation,
|
|
12
|
+
generateDefaultTemplate: generate_default_template_1.generateDefaultTemplate,
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MarketingAutomationDto } from '@escapenavigator/types/dist/profile/marketing-automation/marketing-automation.dto';
|
|
2
|
+
import { MarketingAutomationRO } from '@escapenavigator/types/dist/profile/marketing-automation/marketing-automation.ro';
|
|
3
|
+
import { ApiMethodDeclaration } from '..';
|
|
4
|
+
/**
|
|
5
|
+
* `type` берётся прямо из DTO и идёт в URL (path-параметр и тело
|
|
6
|
+
* синхронны — как `audience` у legacy birthday-marketing). Бэкенд
|
|
7
|
+
* нормализует `type` под path-параметр, поэтому рассинхрон фронта
|
|
8
|
+
* не повредит данные.
|
|
9
|
+
*/
|
|
10
|
+
type ParamsData = MarketingAutomationDto;
|
|
11
|
+
type ResponseData = MarketingAutomationRO;
|
|
12
|
+
export declare const updateMarketingAutomation: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateMarketingAutomation = void 0;
|
|
4
|
+
var updateMarketingAutomation = function (data) { return ({
|
|
5
|
+
url: "/marketing-automation/".concat(data.type),
|
|
6
|
+
method: 'PATCH',
|
|
7
|
+
data: data,
|
|
8
|
+
}); };
|
|
9
|
+
exports.updateMarketingAutomation = updateMarketingAutomation;
|
|
@@ -64,6 +64,7 @@ import { resumeMarketingEmailCampaign } from './marketing-email-campaign/resume-
|
|
|
64
64
|
import { scheduleMarketingEmailCampaign } from './marketing-email-campaign/schedule-marketing-email-campaign';
|
|
65
65
|
import { sendMarketingEmailCampaign } from './marketing-email-campaign/send-marketing-email-campaign';
|
|
66
66
|
import { sendTestMarketingEmailCampaign } from './marketing-email-campaign/send-test-marketing-email-campaign';
|
|
67
|
+
import { testSendMarketingEmailV2 } from './marketing-email-campaign/test-send-marketing-email-v2';
|
|
67
68
|
import { unscheduleMarketingEmailCampaign } from './marketing-email-campaign/unschedule-marketing-email-campaign';
|
|
68
69
|
import { updateMarketingEmailCampaign } from './marketing-email-campaign/update-marketing-email-campaign';
|
|
69
70
|
import { createMarketingEmailTemplate } from './marketing-email-template/create-marketing-email-template';
|
|
@@ -151,6 +152,7 @@ type ApiDeclaration = {
|
|
|
151
152
|
preflightMarketingEmailCampaign: typeof preflightMarketingEmailCampaign;
|
|
152
153
|
sendMarketingEmailCampaign: typeof sendMarketingEmailCampaign;
|
|
153
154
|
sendTestMarketingEmailCampaign: typeof sendTestMarketingEmailCampaign;
|
|
155
|
+
testSendMarketingEmailV2: typeof testSendMarketingEmailV2;
|
|
154
156
|
scheduleMarketingEmailCampaign: typeof scheduleMarketingEmailCampaign;
|
|
155
157
|
unscheduleMarketingEmailCampaign: typeof unscheduleMarketingEmailCampaign;
|
|
156
158
|
pauseMarketingEmailCampaign: typeof pauseMarketingEmailCampaign;
|
|
@@ -67,6 +67,7 @@ var resume_marketing_email_campaign_1 = require("./marketing-email-campaign/resu
|
|
|
67
67
|
var schedule_marketing_email_campaign_1 = require("./marketing-email-campaign/schedule-marketing-email-campaign");
|
|
68
68
|
var send_marketing_email_campaign_1 = require("./marketing-email-campaign/send-marketing-email-campaign");
|
|
69
69
|
var send_test_marketing_email_campaign_1 = require("./marketing-email-campaign/send-test-marketing-email-campaign");
|
|
70
|
+
var test_send_marketing_email_v2_1 = require("./marketing-email-campaign/test-send-marketing-email-v2");
|
|
70
71
|
var unschedule_marketing_email_campaign_1 = require("./marketing-email-campaign/unschedule-marketing-email-campaign");
|
|
71
72
|
var update_marketing_email_campaign_1 = require("./marketing-email-campaign/update-marketing-email-campaign");
|
|
72
73
|
var create_marketing_email_template_1 = require("./marketing-email-template/create-marketing-email-template");
|
|
@@ -184,6 +185,7 @@ exports.profilesApiDeclaration = {
|
|
|
184
185
|
preflightMarketingEmailCampaign: preflight_marketing_email_campaign_1.preflightMarketingEmailCampaign,
|
|
185
186
|
sendMarketingEmailCampaign: send_marketing_email_campaign_1.sendMarketingEmailCampaign,
|
|
186
187
|
sendTestMarketingEmailCampaign: send_test_marketing_email_campaign_1.sendTestMarketingEmailCampaign,
|
|
188
|
+
testSendMarketingEmailV2: test_send_marketing_email_v2_1.testSendMarketingEmailV2,
|
|
187
189
|
scheduleMarketingEmailCampaign: schedule_marketing_email_campaign_1.scheduleMarketingEmailCampaign,
|
|
188
190
|
unscheduleMarketingEmailCampaign: unschedule_marketing_email_campaign_1.unscheduleMarketingEmailCampaign,
|
|
189
191
|
pauseMarketingEmailCampaign: pause_marketing_email_campaign_1.pauseMarketingEmailCampaign,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TestSendMarketingEmailV2Dto } from '@escapenavigator/types/dist/profile/marketing-email/test-send-email-v2.dto';
|
|
2
|
+
import { SuccessRO } from '@escapenavigator/types/dist/shared/success.ro';
|
|
3
|
+
import { ApiMethodDeclaration } from '../..';
|
|
4
|
+
type ParamsData = {
|
|
5
|
+
data: TestSendMarketingEmailV2Dto;
|
|
6
|
+
};
|
|
7
|
+
type ResponseData = SuccessRO;
|
|
8
|
+
/**
|
|
9
|
+
* Sends a one-off TEST copy of the current v2 (maily.to) email body to
|
|
10
|
+
* the given address, resolving variables against real data (an order by
|
|
11
|
+
* booking code, or a client by number — both scoped to the profile).
|
|
12
|
+
* Used by the editor's Preview modal "Send test" action.
|
|
13
|
+
*/
|
|
14
|
+
export declare const testSendMarketingEmailV2: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.testSendMarketingEmailV2 = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Sends a one-off TEST copy of the current v2 (maily.to) email body to
|
|
6
|
+
* the given address, resolving variables against real data (an order by
|
|
7
|
+
* booking code, or a client by number — both scoped to the profile).
|
|
8
|
+
* Used by the editor's Preview modal "Send test" action.
|
|
9
|
+
*/
|
|
10
|
+
var testSendMarketingEmailV2 = function (_a) {
|
|
11
|
+
var data = _a.data;
|
|
12
|
+
return ({
|
|
13
|
+
url: '/profile-marketing-email-campaigns/test-send-v2',
|
|
14
|
+
method: 'POST',
|
|
15
|
+
data: data,
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
exports.testSendMarketingEmailV2 = testSendMarketingEmailV2;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@escapenavigator/services",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.152",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
"scripts": {
|
|
13
13
|
"build": "rm -rf dist && tsc --project tsconfig.json"
|
|
14
14
|
},
|
|
15
|
-
"gitHead": "
|
|
15
|
+
"gitHead": "be78ef00d894a58515a2aff2834f751c45eb27d7",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@escapenavigator/types": "^1.10.
|
|
18
|
-
"@escapenavigator/utils": "^1.10.
|
|
17
|
+
"@escapenavigator/types": "^1.10.143",
|
|
18
|
+
"@escapenavigator/utils": "^1.10.147",
|
|
19
19
|
"axios": "^0.21.4",
|
|
20
20
|
"class-transformer": "^0.5.1",
|
|
21
21
|
"class-validator": "^0.13.2",
|