@escapenavigator/services 1.10.150 → 1.10.151

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.
@@ -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 { MarketingAutomationDefaultTemplateDto } from '@escapenavigator/types/dist/profile/marketing-automation/marketing-automation-default-template.dto';
2
+ import { MarketingAutomationLocaleDto } from '@escapenavigator/types/dist/profile/marketing-automation/marketing-automation.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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@escapenavigator/services",
3
- "version": "1.10.150",
3
+ "version": "1.10.151",
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": "059625444023e0ba8978903b33ac18e9503f2f9d",
15
+ "gitHead": "022977230155bf802f8c3f349fb49a42ad7fd5a9",
16
16
  "dependencies": {
17
- "@escapenavigator/types": "^1.10.141",
18
- "@escapenavigator/utils": "^1.10.145",
17
+ "@escapenavigator/types": "^1.10.142",
18
+ "@escapenavigator/utils": "^1.10.146",
19
19
  "axios": "^0.21.4",
20
20
  "class-transformer": "^0.5.1",
21
21
  "class-validator": "^0.13.2",