@escapenavigator/services 1.4.26 → 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.
- package/dist/api/agb-api/get-one-for-profile.d.ts +7 -0
- package/dist/api/agb-api/get-one-for-profile.js +8 -0
- package/dist/api/agb-api/index.d.ts +2 -0
- package/dist/api/agb-api/index.js +2 -0
- package/dist/api/index.js +13 -8
- package/dist/api/init-client-api.d.ts +2 -0
- package/dist/api/init-client-api.js +2 -0
- package/dist/api/logs-api/index.d.ts +6 -0
- package/dist/api/logs-api/index.js +7 -0
- package/dist/api/logs-api/query.d.ts +9 -0
- package/dist/api/logs-api/query.js +9 -0
- package/dist/api/orders-api/index.d.ts +3 -3
- package/dist/api/orders-api/index.js +2 -2
- package/dist/api/orders-api/paginate.d.ts +1 -2
- package/dist/api/orders-api/query.d.ts +1 -2
- package/dist/api/orders-api/{update-status.d.ts → toggle-cancel.d.ts} +4 -3
- package/dist/api/orders-api/{update-status.js → toggle-cancel.js} +4 -4
- package/dist/api/transactions-api/create-order-refund.js +1 -1
- package/dist/utils/convert-to-options.js +2 -2
- package/dist/utils/define-status.d.ts +1 -2
- package/package.json +3 -3
|
@@ -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 {};
|
|
@@ -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
|
};
|
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,25 +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
|
-
|
|
68
|
-
|
|
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
|
-
|
|
74
|
+
_b.label = 1;
|
|
73
75
|
case 1:
|
|
74
|
-
|
|
76
|
+
_b.trys.push([1, 3, , 4]);
|
|
75
77
|
return [4 /*yield*/, (0, axios_1.default)(axiosConfig)];
|
|
76
78
|
case 2:
|
|
77
|
-
result =
|
|
79
|
+
result = _b.sent();
|
|
78
80
|
return [2 /*return*/, result];
|
|
79
81
|
case 3:
|
|
80
|
-
error_1 =
|
|
82
|
+
error_1 = _b.sent();
|
|
81
83
|
e = error_1;
|
|
82
|
-
if (e.
|
|
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=/;';
|
|
85
|
-
|
|
87
|
+
if (!location.href.includes('auth')) {
|
|
88
|
+
location.reload();
|
|
89
|
+
return [2 /*return*/, null];
|
|
90
|
+
}
|
|
86
91
|
}
|
|
87
92
|
throw error_1;
|
|
88
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,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 {};
|
|
@@ -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
|
-
|
|
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 =
|
|
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 =
|
|
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:
|
|
4
|
+
data: {
|
|
5
|
+
canceled: boolean;
|
|
6
|
+
};
|
|
6
7
|
id: number;
|
|
7
8
|
};
|
|
8
9
|
declare type ResponseData = OrderResponseObject;
|
|
9
|
-
export declare const
|
|
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.
|
|
4
|
-
var
|
|
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/
|
|
7
|
+
url: "/orders/toggle-cancel/".concat(id),
|
|
8
8
|
method: 'PATCH',
|
|
9
9
|
data: data,
|
|
10
10
|
});
|
|
11
11
|
};
|
|
12
|
-
exports.
|
|
12
|
+
exports.toggleCancel = toggleCancel;
|
|
@@ -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<
|
|
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 {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@escapenavigator/services",
|
|
3
|
-
"version": "1.4.
|
|
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": "
|
|
15
|
+
"gitHead": "cd33fad1ec275b3232854d46c110a91e0deb9f4e",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@escapenavigator/types": "^1.4.
|
|
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",
|