@escapenavigator/services 1.4.77 → 1.4.78
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/slot-rules-api/create.d.ts +9 -0
- package/dist/api/slot-rules-api/create.js +12 -0
- package/dist/api/slot-rules-api/index.d.ts +12 -0
- package/dist/api/slot-rules-api/index.js +13 -0
- package/dist/api/slot-rules-api/query.d.ts +6 -0
- package/dist/api/slot-rules-api/query.js +9 -0
- package/dist/api/slot-rules-api/remove.d.ts +7 -0
- package/dist/api/slot-rules-api/remove.js +8 -0
- package/dist/api/slot-rules-api/update.d.ts +10 -0
- package/dist/api/slot-rules-api/update.js +12 -0
- package/dist/api/slot-templates-api/index.d.ts +0 -2
- package/dist/api/slot-templates-api/index.js +0 -2
- package/dist/api/slots-api/index.d.ts +2 -2
- package/dist/api/slots-api/index.js +2 -2
- package/dist/api/slots-api/update-min-hours.d.ts +9 -0
- package/dist/api/slots-api/{update-few.js → update-min-hours.js} +4 -4
- package/dist/api/tariffs-api/create.d.ts +2 -2
- package/dist/api/tariffs-api/get-one.d.ts +2 -2
- package/dist/api/tariffs-api/query.d.ts +2 -2
- package/dist/api/tariffs-api/remove.d.ts +2 -2
- package/dist/api/tariffs-api/update.d.ts +2 -2
- package/dist/utils/serialize-slot.js +12 -7
- package/package.json +3 -3
- package/dist/api/slot-templates-api/update-tariff.d.ts +0 -7
- package/dist/api/slot-templates-api/update-tariff.js +0 -9
- package/dist/api/slots-api/update-few.d.ts +0 -9
|
@@ -30,6 +30,7 @@ import { questroomsApiDeclaration } from './questrooms-api';
|
|
|
30
30
|
import { registrationRequestsApiDeclaration } from './registration-requests-api';
|
|
31
31
|
import { rolesApiDeclaration } from './roles-api';
|
|
32
32
|
import { searchApiDeclaration } from './search-api';
|
|
33
|
+
import { slotRulesApi } from './slot-rules-api';
|
|
33
34
|
import { slotTemplatesApiDeclaration } from './slot-templates-api';
|
|
34
35
|
import { slotsApiDeclaration } from './slots-api';
|
|
35
36
|
import { statisticsApiDeclaration } from './statistics-api';
|
|
@@ -47,6 +48,7 @@ import { widgetsOpenApiDeclaration } from './widgets-openapi';
|
|
|
47
48
|
import { widgetsOrdersDeclaration } from './widgets-orders';
|
|
48
49
|
import { Api } from '.';
|
|
49
50
|
export declare type InitApiDeclaration = {
|
|
51
|
+
slotRulesApi: Api<typeof slotRulesApi>;
|
|
50
52
|
translationsApi: Api<typeof translationsApiDeclaration>;
|
|
51
53
|
navigatorReviews: Api<typeof navigatorReviewsApiDeclaration>;
|
|
52
54
|
dashboard: Api<typeof dashboardApiDeclaration>;
|
|
@@ -33,6 +33,7 @@ var questrooms_api_1 = require("./questrooms-api");
|
|
|
33
33
|
var registration_requests_api_1 = require("./registration-requests-api");
|
|
34
34
|
var roles_api_1 = require("./roles-api");
|
|
35
35
|
var search_api_1 = require("./search-api");
|
|
36
|
+
var slot_rules_api_1 = require("./slot-rules-api");
|
|
36
37
|
var slot_templates_api_1 = require("./slot-templates-api");
|
|
37
38
|
var slots_api_1 = require("./slots-api");
|
|
38
39
|
var statistics_api_1 = require("./statistics-api");
|
|
@@ -50,6 +51,7 @@ var widgets_openapi_1 = require("./widgets-openapi");
|
|
|
50
51
|
var widgets_orders_1 = require("./widgets-orders");
|
|
51
52
|
var _1 = require(".");
|
|
52
53
|
var initClientApi = function (url) { return ({
|
|
54
|
+
slotRulesApi: (0, _1.initApi)(slot_rules_api_1.slotRulesApi, url),
|
|
53
55
|
translationsApi: (0, _1.initApi)(translations_api_1.translationsApiDeclaration, url),
|
|
54
56
|
dashboard: (0, _1.initApi)(dashboard_api_1.dashboardApiDeclaration, url),
|
|
55
57
|
navigatorReviews: (0, _1.initApi)(navigator_reviews_api_1.navigatorReviewsApiDeclaration, url),
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CreateRuleDto } from '@escapenavigator/types/dist/slot-rule/create-rule.dto';
|
|
2
|
+
import { RuleRO } from '@escapenavigator/types/dist/slot-rule/rule.ro';
|
|
3
|
+
import { ApiMethodDeclaration } from '..';
|
|
4
|
+
declare type ParamsData = {
|
|
5
|
+
data: CreateRuleDto;
|
|
6
|
+
};
|
|
7
|
+
declare type ResponseData = RuleRO;
|
|
8
|
+
export declare const create: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.create = void 0;
|
|
4
|
+
var create = function (_a) {
|
|
5
|
+
var data = _a.data;
|
|
6
|
+
return ({
|
|
7
|
+
url: '/rules',
|
|
8
|
+
method: 'POST',
|
|
9
|
+
data: data,
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
exports.create = create;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { create } from './create';
|
|
2
|
+
import { query } from './query';
|
|
3
|
+
import { remove } from './remove';
|
|
4
|
+
import { update } from './update';
|
|
5
|
+
declare type ApiDeclaration = {
|
|
6
|
+
create: typeof create;
|
|
7
|
+
remove: typeof remove;
|
|
8
|
+
update: typeof update;
|
|
9
|
+
query: typeof query;
|
|
10
|
+
};
|
|
11
|
+
export declare const slotRulesApi: ApiDeclaration;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.slotRulesApi = void 0;
|
|
4
|
+
var create_1 = require("./create");
|
|
5
|
+
var query_1 = require("./query");
|
|
6
|
+
var remove_1 = require("./remove");
|
|
7
|
+
var update_1 = require("./update");
|
|
8
|
+
exports.slotRulesApi = {
|
|
9
|
+
create: create_1.create,
|
|
10
|
+
remove: remove_1.remove,
|
|
11
|
+
update: update_1.update,
|
|
12
|
+
query: query_1.query,
|
|
13
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { RuleRO } from '@escapenavigator/types/dist/slot-rule/rule.ro';
|
|
2
|
+
import { ApiMethodDeclaration } from '..';
|
|
3
|
+
declare type ParamsData = undefined;
|
|
4
|
+
declare type ResponseData = RuleRO[];
|
|
5
|
+
export declare const query: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RuleRO } from '@escapenavigator/types/dist/slot-rule/rule.ro';
|
|
2
|
+
import { ApiMethodDeclaration } from '..';
|
|
3
|
+
/** ID тарифа */
|
|
4
|
+
declare type ParamsData = number;
|
|
5
|
+
declare type ResponseData = RuleRO;
|
|
6
|
+
export declare const remove: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CreateRuleDto } from '@escapenavigator/types/dist/slot-rule/create-rule.dto';
|
|
2
|
+
import { RuleRO } from '@escapenavigator/types/dist/slot-rule/rule.ro';
|
|
3
|
+
import { ApiMethodDeclaration } from '..';
|
|
4
|
+
declare type ParamsData = {
|
|
5
|
+
id: number;
|
|
6
|
+
data: CreateRuleDto;
|
|
7
|
+
};
|
|
8
|
+
declare type ResponseData = RuleRO;
|
|
9
|
+
export declare const update: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.update = void 0;
|
|
4
|
+
var update = function (_a) {
|
|
5
|
+
var id = _a.id, data = _a.data;
|
|
6
|
+
return ({
|
|
7
|
+
url: "/rules/".concat(id),
|
|
8
|
+
method: 'PATCH',
|
|
9
|
+
data: data,
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
exports.update = update;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { copy } from './copy';
|
|
2
2
|
import { get } from './get';
|
|
3
3
|
import { update } from './update';
|
|
4
|
-
import { updateTariff } from './update-tariff';
|
|
5
4
|
declare type ApiDeclaration = {
|
|
6
5
|
get: typeof get;
|
|
7
|
-
updateTariff: typeof updateTariff;
|
|
8
6
|
update: typeof update;
|
|
9
7
|
copy: typeof copy;
|
|
10
8
|
};
|
|
@@ -4,10 +4,8 @@ exports.slotTemplatesApiDeclaration = void 0;
|
|
|
4
4
|
var copy_1 = require("./copy");
|
|
5
5
|
var get_1 = require("./get");
|
|
6
6
|
var update_1 = require("./update");
|
|
7
|
-
var update_tariff_1 = require("./update-tariff");
|
|
8
7
|
exports.slotTemplatesApiDeclaration = {
|
|
9
8
|
get: get_1.get,
|
|
10
9
|
copy: copy_1.copy,
|
|
11
|
-
updateTariff: update_tariff_1.updateTariff,
|
|
12
10
|
update: update_1.update,
|
|
13
11
|
};
|
|
@@ -5,14 +5,14 @@ import { create } from './create';
|
|
|
5
5
|
import { daily } from './daily';
|
|
6
6
|
import { remove } from './remove';
|
|
7
7
|
import { updateBreaks } from './update-breaks';
|
|
8
|
-
import {
|
|
8
|
+
import { updateMinHours } from './update-min-hours';
|
|
9
9
|
import { weekly } from './weekly';
|
|
10
10
|
declare type ApiDeclaration = {
|
|
11
11
|
updateBreaks: typeof updateBreaks;
|
|
12
12
|
conflicts: typeof conflicts;
|
|
13
13
|
calendar: typeof calendar;
|
|
14
14
|
daily: typeof daily;
|
|
15
|
-
|
|
15
|
+
updateMinHours: typeof updateMinHours;
|
|
16
16
|
addOrRemoveBreak: typeof addOrRemoveBreak;
|
|
17
17
|
weekly: typeof weekly;
|
|
18
18
|
create: typeof create;
|
|
@@ -8,14 +8,14 @@ var create_1 = require("./create");
|
|
|
8
8
|
var daily_1 = require("./daily");
|
|
9
9
|
var remove_1 = require("./remove");
|
|
10
10
|
var update_breaks_1 = require("./update-breaks");
|
|
11
|
-
var
|
|
11
|
+
var update_min_hours_1 = require("./update-min-hours");
|
|
12
12
|
var weekly_1 = require("./weekly");
|
|
13
13
|
exports.slotsApiDeclaration = {
|
|
14
14
|
updateBreaks: update_breaks_1.updateBreaks,
|
|
15
15
|
conflicts: conflicts_1.conflicts,
|
|
16
16
|
calendar: calendar_1.calendar,
|
|
17
17
|
daily: daily_1.daily,
|
|
18
|
-
|
|
18
|
+
updateMinHours: update_min_hours_1.updateMinHours,
|
|
19
19
|
addOrRemoveBreak: add_or_remove_break_1.addOrRemoveBreak,
|
|
20
20
|
weekly: weekly_1.weekly,
|
|
21
21
|
create: create_1.create,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SuccessRO } from '@escapenavigator/types/dist/shared/success.ro';
|
|
2
|
+
import { UpdateMinHoursDto } from '@escapenavigator/types/dist/slot/update-min-hours.dto';
|
|
3
|
+
import { ApiMethodDeclaration } from '..';
|
|
4
|
+
declare type ParamsData = {
|
|
5
|
+
data: UpdateMinHoursDto;
|
|
6
|
+
};
|
|
7
|
+
declare type ResponseData = SuccessRO;
|
|
8
|
+
export declare const updateMinHours: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
9
|
+
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
var
|
|
3
|
+
exports.updateMinHours = void 0;
|
|
4
|
+
var updateMinHours = function (_a) {
|
|
5
5
|
var data = _a.data;
|
|
6
6
|
return ({
|
|
7
|
-
url: '/slots/update-
|
|
7
|
+
url: '/slots/update-min-hours',
|
|
8
8
|
method: 'PATCH',
|
|
9
9
|
data: data,
|
|
10
10
|
});
|
|
11
11
|
};
|
|
12
|
-
exports.
|
|
12
|
+
exports.updateMinHours = updateMinHours;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CreateTariffDto } from '@escapenavigator/types/dist/tariff/create-tariff.dto';
|
|
2
|
-
import {
|
|
2
|
+
import { TariffRO } from '@escapenavigator/types/dist/tariff/tariff.ro';
|
|
3
3
|
import { ApiMethodDeclaration } from '..';
|
|
4
4
|
declare type ParamsData = {
|
|
5
5
|
data: CreateTariffDto;
|
|
6
6
|
};
|
|
7
|
-
declare type ResponseData =
|
|
7
|
+
declare type ResponseData = TariffRO;
|
|
8
8
|
export declare const create: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
9
9
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TariffRO } from '@escapenavigator/types/dist/tariff/tariff.ro';
|
|
2
2
|
import { ApiMethodDeclaration } from '..';
|
|
3
3
|
/** ID тарифа */
|
|
4
4
|
declare type ParamsData = number;
|
|
5
|
-
declare type ResponseData =
|
|
5
|
+
declare type ResponseData = TariffRO;
|
|
6
6
|
export declare const getOne: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
7
7
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TariffRO } from '@escapenavigator/types/dist/tariff/tariff.ro';
|
|
2
2
|
import { ApiMethodDeclaration } from '..';
|
|
3
3
|
declare type ParamsData = undefined;
|
|
4
|
-
declare type ResponseData =
|
|
4
|
+
declare type ResponseData = TariffRO[];
|
|
5
5
|
export declare const query: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
6
6
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TariffRO } from '@escapenavigator/types/dist/tariff/tariff.ro';
|
|
2
2
|
import { ApiMethodDeclaration } from '..';
|
|
3
3
|
/** ID тарифа */
|
|
4
4
|
declare type ParamsData = number;
|
|
5
|
-
declare type ResponseData =
|
|
5
|
+
declare type ResponseData = TariffRO;
|
|
6
6
|
export declare const remove: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
7
7
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TariffRO } from '@escapenavigator/types/dist/tariff/tariff.ro';
|
|
2
2
|
import { UpdateTariffDto } from '@escapenavigator/types/dist/tariff/update-tariff.dto';
|
|
3
3
|
import { ApiMethodDeclaration } from '..';
|
|
4
4
|
declare type ParamsData = {
|
|
5
5
|
id: number;
|
|
6
6
|
data: UpdateTariffDto;
|
|
7
7
|
};
|
|
8
|
-
declare type ResponseData =
|
|
8
|
+
declare type ResponseData = TariffRO;
|
|
9
9
|
export declare const update: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
10
10
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.serializeSlot = exports.serializeSlotOrderData = void 0;
|
|
4
|
+
var defailt_rule_1 = require("@escapenavigator/types/dist/slot-rule/defailt-rule");
|
|
4
5
|
var serializeSlotOrderData = function (order) {
|
|
5
6
|
var _a, _b, _c, _d, _e;
|
|
6
7
|
return order && {
|
|
@@ -23,7 +24,8 @@ exports.serializeSlotOrderData = serializeSlotOrderData;
|
|
|
23
24
|
var serializeSlot = function (_a) {
|
|
24
25
|
var _b;
|
|
25
26
|
var slot = _a.slot, order = _a.order;
|
|
26
|
-
|
|
27
|
+
var rule = slot.rule || defailt_rule_1.defaultRule;
|
|
28
|
+
return {
|
|
27
29
|
id: slot.id,
|
|
28
30
|
questroomId: slot.questroomId,
|
|
29
31
|
date: slot.date,
|
|
@@ -31,12 +33,15 @@ var serializeSlot = function (_a) {
|
|
|
31
33
|
end: slot.end,
|
|
32
34
|
tariff: (_b = slot.tariff) === null || _b === void 0 ? void 0 : _b.price,
|
|
33
35
|
breakReason: slot.breakReason,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
customMinHours: slot.customMinHours,
|
|
37
|
+
rule: {
|
|
38
|
+
prepayment: rule.prepayment,
|
|
39
|
+
prepaymentType: rule.prepaymentType,
|
|
40
|
+
minHoursForBooking: rule.minHoursForBooking,
|
|
41
|
+
cancelationRule: rule.cancelationRule,
|
|
42
|
+
minHoursForFreeCanceling: rule.minHoursForFreeCanceling,
|
|
43
|
+
},
|
|
39
44
|
order: (0, exports.serializeSlotOrderData)(order),
|
|
40
|
-
}
|
|
45
|
+
};
|
|
41
46
|
};
|
|
42
47
|
exports.serializeSlot = serializeSlot;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@escapenavigator/services",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.78",
|
|
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": "e1c5007ba511d24483a44cf6a117edacda83c4ef",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@escapenavigator/types": "^1.4.
|
|
17
|
+
"@escapenavigator/types": "^1.4.77",
|
|
18
18
|
"@paypal/react-paypal-js": "^7.8.3",
|
|
19
19
|
"axios": "^0.21.4",
|
|
20
20
|
"class-transformer": "^0.5.1",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SuccessRO } from '@escapenavigator/types/dist/shared/success.ro';
|
|
2
|
-
import { UpdateTariffDto } from '@escapenavigator/types/dist/slot-template/update-tariff.dto';
|
|
3
|
-
import { ApiMethodDeclaration } from '..';
|
|
4
|
-
declare type ParamsData = UpdateTariffDto;
|
|
5
|
-
declare type ResponseData = SuccessRO;
|
|
6
|
-
export declare const updateTariff: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
7
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateTariff = void 0;
|
|
4
|
-
var updateTariff = function (data) { return ({
|
|
5
|
-
url: '/slot-templates/tariff/',
|
|
6
|
-
method: 'PATCH',
|
|
7
|
-
data: data,
|
|
8
|
-
}); };
|
|
9
|
-
exports.updateTariff = updateTariff;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { SuccessRO } from '@escapenavigator/types/dist/shared/success.ro';
|
|
2
|
-
import { UpdateFewDto } from '@escapenavigator/types/dist/slot/update-few.dto';
|
|
3
|
-
import { ApiMethodDeclaration } from '..';
|
|
4
|
-
declare type ParamsData = {
|
|
5
|
-
data: UpdateFewDto;
|
|
6
|
-
};
|
|
7
|
-
declare type ResponseData = SuccessRO;
|
|
8
|
-
export declare const updateFew: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
9
|
-
export {};
|