@escapenavigator/services 1.4.25 → 1.4.27

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 (47) hide show
  1. package/dist/api/agb-api/get-one-for-profile.d.ts +7 -0
  2. package/dist/api/agb-api/get-one-for-profile.js +8 -0
  3. package/dist/api/agb-api/index.d.ts +2 -0
  4. package/dist/api/agb-api/index.js +2 -0
  5. package/dist/api/articles-api/query.d.ts +2 -1
  6. package/dist/api/emails-api/query.d.ts +2 -2
  7. package/dist/api/index.js +13 -7
  8. package/dist/api/init-client-api.d.ts +2 -0
  9. package/dist/api/init-client-api.js +2 -0
  10. package/dist/api/logs-api/index.d.ts +6 -0
  11. package/dist/api/logs-api/index.js +7 -0
  12. package/dist/api/logs-api/query.d.ts +9 -0
  13. package/dist/api/logs-api/query.js +9 -0
  14. package/dist/api/orders-api/index.d.ts +3 -3
  15. package/dist/api/orders-api/index.js +2 -2
  16. package/dist/api/orders-api/paginate.d.ts +1 -2
  17. package/dist/api/orders-api/query.d.ts +1 -2
  18. package/dist/api/orders-api/{update-status.d.ts → toggle-cancel.d.ts} +4 -3
  19. package/dist/api/orders-api/{update-status.js → toggle-cancel.js} +4 -4
  20. package/dist/api/profiles-api/create-profile-correction.d.ts +9 -0
  21. package/dist/api/profiles-api/create-profile-correction.js +12 -0
  22. package/dist/api/profiles-api/create-profile-payment.d.ts +9 -0
  23. package/dist/api/profiles-api/create-profile-payment.js +12 -0
  24. package/dist/api/profiles-api/get-all-commission-by-profile.d.ts +8 -0
  25. package/dist/api/profiles-api/get-all-commission-by-profile.js +9 -0
  26. package/dist/api/profiles-api/get-all-commission.d.ts +9 -0
  27. package/dist/api/profiles-api/get-all-commission.js +9 -0
  28. package/dist/api/profiles-api/index.d.ts +8 -0
  29. package/dist/api/profiles-api/index.js +8 -0
  30. package/dist/api/profiles-api/query.d.ts +2 -1
  31. package/dist/api/registration-requests-api/get-one.d.ts +1 -1
  32. package/dist/api/registration-requests-api/query.d.ts +2 -1
  33. package/dist/api/slots-api/conflicts.d.ts +6 -0
  34. package/dist/api/slots-api/conflicts.js +8 -0
  35. package/dist/api/slots-api/index.d.ts +2 -0
  36. package/dist/api/slots-api/index.js +2 -0
  37. package/dist/api/transactions-api/create-order-refund.js +1 -1
  38. package/dist/api/widgets-openapi/{find-reviews.d.ts → get-reviews.d.ts} +1 -1
  39. package/dist/api/widgets-openapi/{find-reviews.js → get-reviews.js} +3 -3
  40. package/dist/api/widgets-openapi/index.d.ts +2 -2
  41. package/dist/api/widgets-openapi/index.js +2 -2
  42. package/dist/utils/convert-to-options.js +2 -2
  43. package/dist/utils/define-status.d.ts +1 -2
  44. package/dist/utils/enum-to-options.d.ts +1 -1
  45. package/dist/utils/enum-to-options.js +1 -1
  46. package/dist/utils/validate-by-dto.js +1 -0
  47. package/package.json +8 -4
@@ -0,0 +1,7 @@
1
+ import { AgbResponseObject } from '@escapenavigator/types/dist/agb/agb.ro';
2
+ import { ApiMethodDeclaration } from '..';
3
+ /** ID профиля */
4
+ declare type ParamsData = undefined;
5
+ declare type ResponseData = AgbResponseObject;
6
+ export declare const getOneForProfile: ApiMethodDeclaration<ParamsData, ResponseData>;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getOneForProfile = void 0;
4
+ var getOneForProfile = function () { return ({
5
+ url: '/agbs',
6
+ method: 'GET',
7
+ }); };
8
+ exports.getOneForProfile = getOneForProfile;
@@ -1,8 +1,10 @@
1
1
  import { getOne } from './get-one';
2
+ import { getOneForProfile } from './get-one-for-profile';
2
3
  import { update } from './update';
3
4
  declare type ApiDeclaration = {
4
5
  getOne: typeof getOne;
5
6
  update: typeof update;
7
+ getOneForProfile: typeof getOneForProfile;
6
8
  };
7
9
  export declare const agbApiDeclaration: ApiDeclaration;
8
10
  export {};
@@ -2,8 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.agbApiDeclaration = void 0;
4
4
  var get_one_1 = require("./get-one");
5
+ var get_one_for_profile_1 = require("./get-one-for-profile");
5
6
  var update_1 = require("./update");
6
7
  exports.agbApiDeclaration = {
7
8
  getOne: get_one_1.getOne,
8
9
  update: update_1.update,
10
+ getOneForProfile: get_one_for_profile_1.getOneForProfile,
9
11
  };
@@ -1,8 +1,9 @@
1
1
  import { ArticleResponseObject } from '@escapenavigator/types/dist/article/article.ro';
2
2
  import { QueryDto } from '@escapenavigator/types/dist/shared/query.dto';
3
+ import { QueryRO } from '@escapenavigator/types/dist/shared/query.ro';
3
4
  import { ApiMethodDeclaration } from '..';
4
5
  /** SearchText - поиск по названию статьи */
5
6
  declare type ParamsData = QueryDto;
6
- declare type ResponseData = ArticleResponseObject[];
7
+ declare type ResponseData = QueryRO<ArticleResponseObject>;
7
8
  export declare const query: ApiMethodDeclaration<ParamsData, ResponseData>;
8
9
  export {};
@@ -1,7 +1,7 @@
1
- import { EmailResponseObject } from '@escapenavigator/types/dist/emails/email.ro';
1
+ import { EmailRO } from '@escapenavigator/types/dist/emails/email.ro';
2
2
  import { QueryDto } from '@escapenavigator/types/dist/shared/query.dto';
3
3
  import { ApiMethodDeclaration } from '..';
4
4
  declare type ParamsData = QueryDto;
5
- declare type ResponseData = EmailResponseObject[];
5
+ declare type ResponseData = EmailRO[];
6
6
  export declare const query: ApiMethodDeclaration<ParamsData, ResponseData>;
7
7
  export {};
package/dist/api/index.js CHANGED
@@ -51,6 +51,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
51
51
  };
52
52
  Object.defineProperty(exports, "__esModule", { value: true });
53
53
  exports.initApi = void 0;
54
+ /* eslint-disable no-restricted-globals */
54
55
  /* eslint-disable import/no-extraneous-dependencies */
55
56
  /* eslint-disable @typescript-eslint/no-unused-vars */
56
57
  /* eslint-disable @typescript-eslint/no-explicit-any */
@@ -64,24 +65,29 @@ function initApi(apiDeclaration, baseURL) {
64
65
  if (params === void 0) { params = undefined; }
65
66
  return __awaiter(_this, void 0, void 0, function () {
66
67
  var axiosConfig, result, error_1, e;
67
- return __generator(this, function (_a) {
68
- switch (_a.label) {
68
+ var _a;
69
+ return __generator(this, function (_b) {
70
+ switch (_b.label) {
69
71
  case 0:
70
72
  axiosConfig = apiDeclaration[key](params);
71
73
  axiosConfig = __assign(__assign({}, axiosConfig), { baseURL: baseURL, withCredentials: true });
72
- _a.label = 1;
74
+ _b.label = 1;
73
75
  case 1:
74
- _a.trys.push([1, 3, , 4]);
76
+ _b.trys.push([1, 3, , 4]);
75
77
  return [4 /*yield*/, (0, axios_1.default)(axiosConfig)];
76
78
  case 2:
77
- result = _a.sent();
79
+ result = _b.sent();
78
80
  return [2 /*return*/, result];
79
81
  case 3:
80
- error_1 = _a.sent();
82
+ error_1 = _b.sent();
81
83
  e = error_1;
82
- if (e.code === 401) {
84
+ if (((_a = e === null || e === void 0 ? void 0 : e.response) === null || _a === void 0 ? void 0 : _a.status) === 401) {
83
85
  document.cookie = 'user=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
84
86
  document.cookie = 'token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
87
+ if (!location.href.includes('auth')) {
88
+ location.reload();
89
+ return [2 /*return*/, null];
90
+ }
85
91
  }
86
92
  throw error_1;
87
93
  case 4: return [2 /*return*/];
@@ -11,6 +11,7 @@ import { emailsApiDeclaration } from './emails-api';
11
11
  import { financeItemsApiDeclaration } from './financeitems-api';
12
12
  import { imagesApiDeclaration } from './images-api';
13
13
  import { locationsApiDeclaration } from './locations-api';
14
+ import { logsApiDeclaration } from './logs-api';
14
15
  import { orderDiscountsApiDeclaration } from './order-discounts-api';
15
16
  import { orderPenaltiesApiDeclaration } from './order-penalties-api';
16
17
  import { orderUpsellngsApiDeclaration } from './order-upsellings-api';
@@ -35,6 +36,7 @@ import { widgetsOpenApiDeclaration } from './widgets-openapi';
35
36
  import { Api } from '.';
36
37
  export declare type InitApiDeclaration = {
37
38
  cities: Api<typeof citiesApiDeclaration>;
39
+ logs: Api<typeof logsApiDeclaration>;
38
40
  agregator: Api<typeof agregatorApiDeclaration>;
39
41
  admins: Api<typeof adminsApiDeclaration>;
40
42
  uploads: Api<typeof uploadsApiDeclaration>;
@@ -14,6 +14,7 @@ var emails_api_1 = require("./emails-api");
14
14
  var financeitems_api_1 = require("./financeitems-api");
15
15
  var images_api_1 = require("./images-api");
16
16
  var locations_api_1 = require("./locations-api");
17
+ var logs_api_1 = require("./logs-api");
17
18
  var order_discounts_api_1 = require("./order-discounts-api");
18
19
  var order_penalties_api_1 = require("./order-penalties-api");
19
20
  var order_upsellings_api_1 = require("./order-upsellings-api");
@@ -38,6 +39,7 @@ var widgets_openapi_1 = require("./widgets-openapi");
38
39
  var _1 = require(".");
39
40
  var initClientApi = function (url) { return ({
40
41
  cities: (0, _1.initApi)(cities_api_1.citiesApiDeclaration, url),
42
+ logs: (0, _1.initApi)(logs_api_1.logsApiDeclaration, url),
41
43
  agregator: (0, _1.initApi)(agregator_api_1.agregatorApiDeclaration, url),
42
44
  agbs: (0, _1.initApi)(agb_api_1.agbApiDeclaration, url),
43
45
  uploads: (0, _1.initApi)(uploads_api_1.uploadsApiDeclaration, url),
@@ -0,0 +1,6 @@
1
+ import { query } from './query';
2
+ declare type ApiDeclaration = {
3
+ query: typeof query;
4
+ };
5
+ export declare const logsApiDeclaration: ApiDeclaration;
6
+ export {};
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.logsApiDeclaration = void 0;
4
+ var query_1 = require("./query");
5
+ exports.logsApiDeclaration = {
6
+ query: query_1.query,
7
+ };
@@ -0,0 +1,9 @@
1
+ import { LogRO } from '@escapenavigator/types/dist/log/log.ro';
2
+ import { QueryDto } from '@escapenavigator/types/dist/shared/query.dto';
3
+ import { QueryRO } from '@escapenavigator/types/dist/shared/query.ro';
4
+ import { ApiMethodDeclaration } from '..';
5
+ /** Поиск по названию организации и контактному телефону */
6
+ declare type ParamsData = QueryDto;
7
+ declare type ResponseData = QueryRO<LogRO>;
8
+ export declare const query: ApiMethodDeclaration<ParamsData, ResponseData>;
9
+ export {};
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.query = void 0;
4
+ var query = function (params) { return ({
5
+ url: '/logs',
6
+ method: 'GET',
7
+ params: params,
8
+ }); };
9
+ exports.query = query;
@@ -6,18 +6,18 @@ import { paginate } from './paginate';
6
6
  import { query } from './query';
7
7
  import { remove } from './remove';
8
8
  import { removeCertificate } from './remove-certificate';
9
+ import { toggleCancel } from './toggle-cancel';
9
10
  import { update } from './update';
10
11
  import { updateSlot } from './update-slot';
11
- import { updateStatus } from './update-status';
12
12
  declare type ApiDeclaration = {
13
13
  create: typeof create;
14
14
  remove: typeof remove;
15
15
  getOne: typeof getOne;
16
- update: typeof update;
17
16
  query: typeof query;
18
17
  addCertificate: typeof addCertificate;
19
18
  updateSlot: typeof updateSlot;
20
- updateStatus: typeof updateStatus;
19
+ update: typeof update;
20
+ toggleCancel: typeof toggleCancel;
21
21
  createFromWidget: typeof createFromWidget;
22
22
  removeCertificate: typeof removeCertificate;
23
23
  paginate: typeof paginate;
@@ -9,18 +9,18 @@ var paginate_1 = require("./paginate");
9
9
  var query_1 = require("./query");
10
10
  var remove_1 = require("./remove");
11
11
  var remove_certificate_1 = require("./remove-certificate");
12
+ var toggle_cancel_1 = require("./toggle-cancel");
12
13
  var update_1 = require("./update");
13
14
  var update_slot_1 = require("./update-slot");
14
- var update_status_1 = require("./update-status");
15
15
  exports.ordersApiDeclaration = {
16
16
  create: create_1.create,
17
+ toggleCancel: toggle_cancel_1.toggleCancel,
17
18
  remove: remove_1.remove,
18
19
  update: update_1.update,
19
20
  query: query_1.query,
20
21
  getOne: get_one_1.getOne,
21
22
  addCertificate: add_certificate_1.addCertificate,
22
23
  updateSlot: update_slot_1.updateSlot,
23
- updateStatus: update_status_1.updateStatus,
24
24
  createFromWidget: create_from_widget_1.createFromWidget,
25
25
  removeCertificate: remove_certificate_1.removeCertificate,
26
26
  paginate: paginate_1.paginate,
@@ -1,7 +1,6 @@
1
- import { OrdersListResponseObject } from '@escapenavigator/types/dist/order/orders-list.ro';
2
1
  import { QueryDto } from '@escapenavigator/types/dist/shared/query.dto';
3
2
  import { ApiMethodDeclaration } from '..';
4
3
  declare type ParamsData = QueryDto;
5
- declare type ResponseData = OrdersListResponseObject;
4
+ declare type ResponseData = any;
6
5
  export declare const paginate: ApiMethodDeclaration<ParamsData, ResponseData>;
7
6
  export {};
@@ -1,7 +1,6 @@
1
- import { OrdersListResponseObject } from '@escapenavigator/types/dist/order/orders-list.ro';
2
1
  import { QueryDto } from '@escapenavigator/types/dist/shared/query.dto';
3
2
  import { ApiMethodDeclaration } from '..';
4
3
  declare type ParamsData = QueryDto;
5
- declare type ResponseData = OrdersListResponseObject;
4
+ declare type ResponseData = any;
6
5
  export declare const query: ApiMethodDeclaration<ParamsData, ResponseData>;
7
6
  export {};
@@ -1,10 +1,11 @@
1
1
  import { OrderResponseObject } from '@escapenavigator/types/dist/order/order.ro';
2
- import { UpdateOrderStatusDto } from '@escapenavigator/types/dist/order/update-order-status.dto';
3
2
  import { ApiMethodDeclaration } from '..';
4
3
  declare type ParamsData = {
5
- data: UpdateOrderStatusDto;
4
+ data: {
5
+ canceled: boolean;
6
+ };
6
7
  id: number;
7
8
  };
8
9
  declare type ResponseData = OrderResponseObject;
9
- export declare const updateStatus: ApiMethodDeclaration<ParamsData, ResponseData>;
10
+ export declare const toggleCancel: ApiMethodDeclaration<ParamsData, ResponseData>;
10
11
  export {};
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateStatus = void 0;
4
- var updateStatus = function (_a) {
3
+ exports.toggleCancel = void 0;
4
+ var toggleCancel = function (_a) {
5
5
  var id = _a.id, data = _a.data;
6
6
  return ({
7
- url: "/orders/update-status/".concat(id),
7
+ url: "/orders/toggle-cancel/".concat(id),
8
8
  method: 'PATCH',
9
9
  data: data,
10
10
  });
11
11
  };
12
- exports.updateStatus = updateStatus;
12
+ exports.toggleCancel = toggleCancel;
@@ -0,0 +1,9 @@
1
+ import { CommissionRO } from '@escapenavigator/types/dist/commission/commission.ro';
2
+ import { CreateProfileCorrectionDto } from '@escapenavigator/types/dist/commission/create-profile-correction.dto';
3
+ import { ApiMethodDeclaration } from '..';
4
+ declare type ParamsData = {
5
+ data: CreateProfileCorrectionDto;
6
+ };
7
+ declare type ResponseData = CommissionRO;
8
+ export declare const createProfileCorrection: ApiMethodDeclaration<ParamsData, ResponseData>;
9
+ export {};
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createProfileCorrection = void 0;
4
+ var createProfileCorrection = function (_a) {
5
+ var data = _a.data;
6
+ return ({
7
+ url: '/commissions/corrections',
8
+ method: 'POST',
9
+ data: data,
10
+ });
11
+ };
12
+ exports.createProfileCorrection = createProfileCorrection;
@@ -0,0 +1,9 @@
1
+ import { CommissionRO } from '@escapenavigator/types/dist/commission/commission.ro';
2
+ import { CreateProfilePaymentDto } from '@escapenavigator/types/dist/commission/create-profile-payment.dto';
3
+ import { ApiMethodDeclaration } from '..';
4
+ declare type ParamsData = {
5
+ data: CreateProfilePaymentDto;
6
+ };
7
+ declare type ResponseData = CommissionRO;
8
+ export declare const createProfilePayment: ApiMethodDeclaration<ParamsData, ResponseData>;
9
+ export {};
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createProfilePayment = void 0;
4
+ var createProfilePayment = function (_a) {
5
+ var data = _a.data;
6
+ return ({
7
+ url: '/commissions/payments',
8
+ method: 'POST',
9
+ data: data,
10
+ });
11
+ };
12
+ exports.createProfilePayment = createProfilePayment;
@@ -0,0 +1,8 @@
1
+ import { CommissionRO } from '@escapenavigator/types/dist/commission/commission.ro';
2
+ import { QueryDto } from '@escapenavigator/types/dist/shared/query.dto';
3
+ import { ApiMethodDeclaration } from '..';
4
+ /** Поиск */
5
+ declare type ParamsData = QueryDto;
6
+ declare type ResponseData = CommissionRO[];
7
+ export declare const getAllCommissionByProfile: ApiMethodDeclaration<ParamsData, ResponseData>;
8
+ export {};
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getAllCommissionByProfile = void 0;
4
+ var getAllCommissionByProfile = function (params) { return ({
5
+ url: '/commissions/profile',
6
+ method: 'GET',
7
+ params: params,
8
+ }); };
9
+ exports.getAllCommissionByProfile = getAllCommissionByProfile;
@@ -0,0 +1,9 @@
1
+ import { CommissionRO } from '@escapenavigator/types/dist/commission/commission.ro';
2
+ import { QueryDto } from '@escapenavigator/types/dist/shared/query.dto';
3
+ import { QueryRO } from '@escapenavigator/types/dist/shared/query.ro';
4
+ import { ApiMethodDeclaration } from '..';
5
+ /** Поиск */
6
+ declare type ParamsData = QueryDto;
7
+ declare type ResponseData = QueryRO<CommissionRO>;
8
+ export declare const getAllCommission: ApiMethodDeclaration<ParamsData, ResponseData>;
9
+ export {};
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getAllCommission = void 0;
4
+ var getAllCommission = function (params) { return ({
5
+ url: '/commissions',
6
+ method: 'GET',
7
+ params: params,
8
+ }); };
9
+ exports.getAllCommission = getAllCommission;
@@ -1,5 +1,9 @@
1
1
  import { create } from './create';
2
+ import { createProfileCorrection } from './create-profile-correction';
3
+ import { createProfilePayment } from './create-profile-payment';
2
4
  import { current } from './current';
5
+ import { getAllCommission } from './get-all-commission';
6
+ import { getAllCommissionByProfile } from './get-all-commission-by-profile';
3
7
  import { getBySlug } from './get-by-slug';
4
8
  import { getOne } from './get-one';
5
9
  import { query } from './query';
@@ -13,6 +17,10 @@ declare type ApiDeclaration = {
13
17
  getOne: typeof getOne;
14
18
  current: typeof current;
15
19
  getBySlug: typeof getBySlug;
20
+ getAllCommission: typeof getAllCommission;
21
+ getAllCommissionByProfile: typeof getAllCommissionByProfile;
22
+ createProfilePayment: typeof createProfilePayment;
23
+ createProfileCorrection: typeof createProfileCorrection;
16
24
  };
17
25
  export declare const profilesApiDeclaration: ApiDeclaration;
18
26
  export {};
@@ -2,7 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.profilesApiDeclaration = void 0;
4
4
  var create_1 = require("./create");
5
+ var create_profile_correction_1 = require("./create-profile-correction");
6
+ var create_profile_payment_1 = require("./create-profile-payment");
5
7
  var current_1 = require("./current");
8
+ var get_all_commission_1 = require("./get-all-commission");
9
+ var get_all_commission_by_profile_1 = require("./get-all-commission-by-profile");
6
10
  var get_by_slug_1 = require("./get-by-slug");
7
11
  var get_one_1 = require("./get-one");
8
12
  var query_1 = require("./query");
@@ -16,4 +20,8 @@ exports.profilesApiDeclaration = {
16
20
  getOne: get_one_1.getOne,
17
21
  current: current_1.current,
18
22
  getBySlug: get_by_slug_1.getBySlug,
23
+ getAllCommission: get_all_commission_1.getAllCommission,
24
+ getAllCommissionByProfile: get_all_commission_by_profile_1.getAllCommissionByProfile,
25
+ createProfilePayment: create_profile_payment_1.createProfilePayment,
26
+ createProfileCorrection: create_profile_correction_1.createProfileCorrection,
19
27
  };
@@ -1,8 +1,9 @@
1
1
  import { ProfileResponseObject } from '@escapenavigator/types/dist/profile/profile.ro';
2
2
  import { QueryDto } from '@escapenavigator/types/dist/shared/query.dto';
3
+ import { QueryRO } from '@escapenavigator/types/dist/shared/query.ro';
3
4
  import { ApiMethodDeclaration } from '..';
4
5
  /** Поиск по названию организации и контактному телефону */
5
6
  declare type ParamsData = QueryDto;
6
- declare type ResponseData = ProfileResponseObject[];
7
+ declare type ResponseData = QueryRO<ProfileResponseObject>;
7
8
  export declare const query: ApiMethodDeclaration<ParamsData, ResponseData>;
8
9
  export {};
@@ -2,6 +2,6 @@ import { RegistrationRequestResponseObject } from '@escapenavigator/types/dist/r
2
2
  import { ApiMethodDeclaration } from '..';
3
3
  /** ID заявки на регистрацию */
4
4
  declare type ParamsData = number;
5
- declare type ResponseData = RegistrationRequestResponseObject[];
5
+ declare type ResponseData = RegistrationRequestResponseObject;
6
6
  export declare const getOne: ApiMethodDeclaration<ParamsData, ResponseData>;
7
7
  export {};
@@ -1,8 +1,9 @@
1
1
  import { RegistrationRequestResponseObject } from '@escapenavigator/types/dist/registration-request/registration-request.ro';
2
2
  import { QueryDto } from '@escapenavigator/types/dist/shared/query.dto';
3
+ import { QueryRO } from '@escapenavigator/types/dist/shared/query.ro';
3
4
  import { ApiMethodDeclaration } from '..';
4
5
  /** SearchText - поиск по имени, email и телефону */
5
6
  declare type ParamsData = QueryDto;
6
- declare type ResponseData = RegistrationRequestResponseObject[];
7
+ declare type ResponseData = QueryRO<RegistrationRequestResponseObject>;
7
8
  export declare const query: ApiMethodDeclaration<ParamsData, ResponseData>;
8
9
  export {};
@@ -0,0 +1,6 @@
1
+ import { SlotResponseObject } from '@escapenavigator/types/dist/slot/slot.ro';
2
+ import { ApiMethodDeclaration } from '..';
3
+ declare type ParamsData = undefined;
4
+ declare type ResponseData = SlotResponseObject[];
5
+ export declare const conflicts: ApiMethodDeclaration<ParamsData, ResponseData>;
6
+ export {};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.conflicts = void 0;
4
+ var conflicts = function () { return ({
5
+ url: '/slots/conflicts',
6
+ method: 'GET',
7
+ }); };
8
+ exports.conflicts = conflicts;
@@ -1,12 +1,14 @@
1
1
  import { addBreaks } from './add-breaks';
2
2
  import { addOrRemoveBreak } from './add-or-remove-break';
3
3
  import { calendar } from './calendar';
4
+ import { conflicts } from './conflicts';
4
5
  import { create } from './create';
5
6
  import { daily } from './daily';
6
7
  import { remove } from './remove';
7
8
  import { removeBreaks } from './remove-breaks';
8
9
  import { weekly } from './weekly';
9
10
  declare type ApiDeclaration = {
11
+ conflicts: typeof conflicts;
10
12
  calendar: typeof calendar;
11
13
  daily: typeof daily;
12
14
  addBreaks: typeof addBreaks;
@@ -4,12 +4,14 @@ exports.slotsApiDeclaration = void 0;
4
4
  var add_breaks_1 = require("./add-breaks");
5
5
  var add_or_remove_break_1 = require("./add-or-remove-break");
6
6
  var calendar_1 = require("./calendar");
7
+ var conflicts_1 = require("./conflicts");
7
8
  var create_1 = require("./create");
8
9
  var daily_1 = require("./daily");
9
10
  var remove_1 = require("./remove");
10
11
  var remove_breaks_1 = require("./remove-breaks");
11
12
  var weekly_1 = require("./weekly");
12
13
  exports.slotsApiDeclaration = {
14
+ conflicts: conflicts_1.conflicts,
13
15
  calendar: calendar_1.calendar,
14
16
  daily: daily_1.daily,
15
17
  addBreaks: add_breaks_1.addBreaks,
@@ -4,7 +4,7 @@ exports.createOrderRefund = void 0;
4
4
  var createOrderRefund = function (_a) {
5
5
  var data = _a.data;
6
6
  return ({
7
- url: '/transactions/order-refund',
7
+ url: '/order-transactions/refund',
8
8
  method: 'POST',
9
9
  data: data,
10
10
  });
@@ -3,5 +3,5 @@ import { WigetOpenapiReviewRO } from '@escapenavigator/types/dist/widget-openapi
3
3
  import { ApiMethodDeclaration } from '..';
4
4
  declare type ParamsData = WidgetOpenapiFindReviewsDto;
5
5
  declare type ResponseData = WigetOpenapiReviewRO[];
6
- export declare const findReviews: ApiMethodDeclaration<ParamsData, ResponseData>;
6
+ export declare const getReviews: ApiMethodDeclaration<ParamsData, ResponseData>;
7
7
  export {};
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findReviews = void 0;
4
- var findReviews = function (params) { return ({
3
+ exports.getReviews = void 0;
4
+ var getReviews = function (params) { return ({
5
5
  url: '/widget/openapi/reviews',
6
6
  method: 'GET',
7
7
  params: params,
8
8
  }); };
9
- exports.findReviews = findReviews;
9
+ exports.getReviews = getReviews;
@@ -2,11 +2,11 @@ import { createCertificate } from './create-certificate';
2
2
  import { createOrder } from './create-order';
3
3
  import { createReview } from './create-review';
4
4
  import { findCertificate } from './find-certificate';
5
- import { findReviews } from './find-reviews';
6
5
  import { getCertificates } from './get-certificates';
7
6
  import { getCertificatesForAgregator } from './get-certificates-for-agregator';
8
7
  import { getQuestroom } from './get-questroom';
9
8
  import { getQuestrooms } from './get-questrooms';
9
+ import { getReviews } from './get-reviews';
10
10
  import { getWidgetInfo } from './get-widget-info';
11
11
  import { daily } from './widget-daily';
12
12
  import { weekly } from './widget-weekly';
@@ -16,7 +16,7 @@ declare type ApiDeclaration = {
16
16
  getQuestrooms: typeof getQuestrooms;
17
17
  getCertificatesForAgregator: typeof getCertificatesForAgregator;
18
18
  createReview: typeof createReview;
19
- findReviews: typeof findReviews;
19
+ getReviews: typeof getReviews;
20
20
  getWidgetInfo: typeof getWidgetInfo;
21
21
  daily: typeof daily;
22
22
  weekly: typeof weekly;
@@ -5,11 +5,11 @@ var create_certificate_1 = require("./create-certificate");
5
5
  var create_order_1 = require("./create-order");
6
6
  var create_review_1 = require("./create-review");
7
7
  var find_certificate_1 = require("./find-certificate");
8
- var find_reviews_1 = require("./find-reviews");
9
8
  var get_certificates_1 = require("./get-certificates");
10
9
  var get_certificates_for_agregator_1 = require("./get-certificates-for-agregator");
11
10
  var get_questroom_1 = require("./get-questroom");
12
11
  var get_questrooms_1 = require("./get-questrooms");
12
+ var get_reviews_1 = require("./get-reviews");
13
13
  var get_widget_info_1 = require("./get-widget-info");
14
14
  var widget_daily_1 = require("./widget-daily");
15
15
  var widget_weekly_1 = require("./widget-weekly");
@@ -19,7 +19,7 @@ exports.widgetsOpenApiDeclaration = {
19
19
  getQuestroom: get_questroom_1.getQuestroom,
20
20
  getCertificatesForAgregator: get_certificates_for_agregator_1.getCertificatesForAgregator,
21
21
  createReview: create_review_1.createReview,
22
- findReviews: find_reviews_1.findReviews,
22
+ getReviews: get_reviews_1.getReviews,
23
23
  getWidgetInfo: get_widget_info_1.getWidgetInfo,
24
24
  daily: widget_daily_1.daily,
25
25
  weekly: widget_weekly_1.weekly,
@@ -8,10 +8,10 @@ var getContentByItemField = function (item) {
8
8
  return item.name;
9
9
  return item.title;
10
10
  };
11
- var convertToOptions = function (data) {
11
+ var convertToOptions = function (data, field) {
12
12
  return data.map(function (item) { return ({
13
13
  key: item.id,
14
- content: getContentByItemField(item),
14
+ content: field ? item[field] : getContentByItemField(item),
15
15
  }); });
16
16
  };
17
17
  exports.convertToOptions = convertToOptions;
@@ -1,5 +1,4 @@
1
1
  import { CertificateSaleResponseObject } from '@escapenavigator/types/dist/certificate-sale/certificate-sale.ro';
2
- import { OrderResponseObject } from '@escapenavigator/types/dist/order/order.ro';
3
2
  declare type TFunction = (value: string, options?: {
4
3
  count?: number | null;
5
4
  }) => string;
@@ -8,7 +7,7 @@ declare type Status = {
8
7
  view: 'negative' | 'positive' | 'secondary' | 'accent' | 'attention';
9
8
  };
10
9
  declare type DefineCertificateFunction = (t: TFunction) => Record<CertificateSaleResponseObject['status'], Status>;
11
- declare type DefineOrderFunction = (t: TFunction) => Record<OrderResponseObject['status'], Status>;
10
+ declare type DefineOrderFunction = (t: TFunction) => Record<string, Status>;
12
11
  export declare const defineStatusForCertificate: DefineCertificateFunction;
13
12
  export declare const defineStatusForOrder: DefineOrderFunction;
14
13
  export {};
@@ -1,5 +1,5 @@
1
1
  import { TFunction } from 'i18next';
2
- export declare const enumToOptions: (options: Enumerator, t: TFunction, modelName: string) => {
2
+ export declare const enumToOptions: (options: Enumerator, t?: TFunction, modelName?: string) => {
3
3
  key: string;
4
4
  content: string;
5
5
  }[];
@@ -4,7 +4,7 @@ exports.enumToOptions = void 0;
4
4
  var enumToOptions = function (options, t, modelName) {
5
5
  return Object.values(options).map(function (option) { return ({
6
6
  key: option,
7
- content: t("options.".concat(modelName, ".").concat(option)),
7
+ content: t ? t("options.".concat(modelName, ".").concat(option)) : option.toString().toUpperCase(),
8
8
  }); });
9
9
  };
10
10
  exports.enumToOptions = enumToOptions;
@@ -5,6 +5,7 @@ var class_validator_1 = require("class-validator");
5
5
  function validateByDto(t) {
6
6
  var validate = function (data) {
7
7
  var errors = (0, class_validator_1.validateSync)(typeof data === 'object' ? data : {});
8
+ console.log({ formErrors: errors });
8
9
  return Object.fromEntries(errors.map(function (_a) {
9
10
  var property = _a.property, constraints = _a.constraints;
10
11
  var err = (constraints === null || constraints === void 0 ? void 0 : constraints.IsNotEmpty) || Object.values(constraints)[0];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@escapenavigator/services",
3
- "version": "1.4.25",
3
+ "version": "1.4.27",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -12,9 +12,9 @@
12
12
  "scripts": {
13
13
  "build": "rm -rf dist && tsc --project tsconfig.json"
14
14
  },
15
- "gitHead": "63ced87dd2dac8046d31d9c2877259afde647b75",
15
+ "gitHead": "cd33fad1ec275b3232854d46c110a91e0deb9f4e",
16
16
  "dependencies": {
17
- "@escapenavigator/types": "^1.4.25",
17
+ "@escapenavigator/types": "^1.4.27",
18
18
  "axios": "^0.21.4",
19
19
  "class-transformer": "^0.5.1",
20
20
  "class-validator": "^0.13.1",
@@ -48,6 +48,10 @@
48
48
  },
49
49
  "prettier": "./node_modules/alphakit-presets-lint/prettier.js",
50
50
  "eslintConfig": {
51
- "extends": "./node_modules/alphakit-presets-lint/eslint/index.js"
51
+ "extends": "./node_modules/alphakit-presets-lint/eslint/index.js",
52
+ "ignorePatterns": [
53
+ "dist",
54
+ "node_modules"
55
+ ]
52
56
  }
53
57
  }