@escapenavigator/services 1.4.25 → 1.4.26

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 (28) hide show
  1. package/dist/api/articles-api/query.d.ts +2 -1
  2. package/dist/api/emails-api/query.d.ts +2 -2
  3. package/dist/api/index.js +1 -0
  4. package/dist/api/profiles-api/create-profile-correction.d.ts +9 -0
  5. package/dist/api/profiles-api/create-profile-correction.js +12 -0
  6. package/dist/api/profiles-api/create-profile-payment.d.ts +9 -0
  7. package/dist/api/profiles-api/create-profile-payment.js +12 -0
  8. package/dist/api/profiles-api/get-all-commission-by-profile.d.ts +8 -0
  9. package/dist/api/profiles-api/get-all-commission-by-profile.js +9 -0
  10. package/dist/api/profiles-api/get-all-commission.d.ts +9 -0
  11. package/dist/api/profiles-api/get-all-commission.js +9 -0
  12. package/dist/api/profiles-api/index.d.ts +8 -0
  13. package/dist/api/profiles-api/index.js +8 -0
  14. package/dist/api/profiles-api/query.d.ts +2 -1
  15. package/dist/api/registration-requests-api/get-one.d.ts +1 -1
  16. package/dist/api/registration-requests-api/query.d.ts +2 -1
  17. package/dist/api/slots-api/conflicts.d.ts +6 -0
  18. package/dist/api/slots-api/conflicts.js +8 -0
  19. package/dist/api/slots-api/index.d.ts +2 -0
  20. package/dist/api/slots-api/index.js +2 -0
  21. package/dist/api/widgets-openapi/{find-reviews.d.ts → get-reviews.d.ts} +1 -1
  22. package/dist/api/widgets-openapi/{find-reviews.js → get-reviews.js} +3 -3
  23. package/dist/api/widgets-openapi/index.d.ts +2 -2
  24. package/dist/api/widgets-openapi/index.js +2 -2
  25. package/dist/utils/enum-to-options.d.ts +1 -1
  26. package/dist/utils/enum-to-options.js +1 -1
  27. package/dist/utils/validate-by-dto.js +1 -0
  28. package/package.json +8 -4
@@ -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
@@ -82,6 +82,7 @@ function initApi(apiDeclaration, baseURL) {
82
82
  if (e.code === 401) {
83
83
  document.cookie = 'user=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
84
84
  document.cookie = 'token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
85
+ document.location.reload();
85
86
  }
86
87
  throw error_1;
87
88
  case 4: return [2 /*return*/];
@@ -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,
@@ -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,
@@ -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.26",
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": "004690831da0834013bb9e1915df402a54ae0283",
16
16
  "dependencies": {
17
- "@escapenavigator/types": "^1.4.25",
17
+ "@escapenavigator/types": "^1.4.26",
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
  }