@escapenavigator/services 1.4.81 → 1.4.83
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/create.d.ts +9 -0
- package/dist/api/agb-api/{create-inside-agb.js → create.js} +3 -3
- package/dist/api/agb-api/get-all.d.ts +7 -0
- package/dist/api/agb-api/get-all.js +8 -0
- package/dist/api/agb-api/get-for-order-service.d.ts +2 -2
- package/dist/api/agb-api/get-one.d.ts +7 -0
- package/dist/api/agb-api/{get-one-by-id.js → get-one.js} +3 -3
- package/dist/api/agb-api/index.d.ts +8 -12
- package/dist/api/agb-api/index.js +8 -12
- package/dist/api/agb-api/{update-inside-agb.d.ts → update.d.ts} +3 -3
- package/dist/api/agb-api/{update-inside-agb.js → update.js} +3 -3
- package/dist/api/init-client-api.d.ts +2 -0
- package/dist/api/init-client-api.js +2 -0
- package/dist/api/{transactions-api → order-transactions-api}/create-order-payment.d.ts +1 -1
- package/dist/api/{transactions-api → order-transactions-api}/create-order-refund.d.ts +2 -2
- package/dist/api/order-transactions-api/create-order-stripe-refund.d.ts +9 -0
- package/dist/api/order-transactions-api/create-order-stripe-refund.js +12 -0
- package/dist/api/order-transactions-api/index.d.ts +10 -0
- package/dist/api/order-transactions-api/index.js +11 -0
- package/dist/api/profiles-api/agb/get-profile-agb-for-order-service.d.ts +6 -0
- package/dist/api/profiles-api/agb/get-profile-agb-for-order-service.js +8 -0
- package/dist/api/profiles-api/agb/get-profile-agb.d.ts +6 -0
- package/dist/api/profiles-api/agb/get-profile-agb.js +8 -0
- package/dist/api/profiles-api/agb/update-profile-agb.d.ts +9 -0
- package/dist/api/{agb-api → profiles-api/agb}/update-profile-agb.js +1 -1
- package/dist/api/profiles-api/bookeo/get-bookeo-info.d.ts +6 -0
- package/dist/api/profiles-api/bookeo/get-bookeo-info.js +8 -0
- package/dist/api/profiles-api/bookeo/get-bookeo-integration-link.d.ts +5 -0
- package/dist/api/profiles-api/bookeo/get-bookeo-integration-link.js +8 -0
- package/dist/api/profiles-api/bookeo/get-bookeo-orders.d.ts +8 -0
- package/dist/api/profiles-api/bookeo/get-bookeo-orders.js +9 -0
- package/dist/api/profiles-api/bookeo/resync-bookeo.d.ts +6 -0
- package/dist/api/profiles-api/bookeo/resync-bookeo.js +8 -0
- package/dist/api/profiles-api/finalize-current.d.ts +9 -0
- package/dist/api/profiles-api/finalize-current.js +12 -0
- package/dist/api/profiles-api/get-customization.d.ts +7 -0
- package/dist/api/profiles-api/get-customization.js +8 -0
- package/dist/api/profiles-api/index.d.ts +30 -8
- package/dist/api/profiles-api/index.js +30 -8
- package/dist/api/profiles-api/initial-customization.d.ts +7 -0
- package/dist/api/profiles-api/initial-customization.js +9 -0
- package/dist/api/profiles-api/subscription/create-subscription-session.d.ts +8 -0
- package/dist/api/profiles-api/subscription/create-subscription-session.js +11 -0
- package/dist/api/profiles-api/{get-payment-settings.d.ts → subscription/get-payment-settings.d.ts} +1 -1
- package/dist/api/profiles-api/subscription/get-prices.d.ts +6 -0
- package/dist/api/profiles-api/subscription/get-prices.js +8 -0
- package/dist/api/profiles-api/{get-profile-invoices.d.ts → subscription/get-profile-invoices.d.ts} +1 -1
- package/dist/api/profiles-api/{get-stripe-session-link.d.ts → subscription/get-stripe-session-link.d.ts} +1 -1
- package/dist/api/profiles-api/{paginate-bills.d.ts → subscription/paginate-bills.d.ts} +1 -1
- package/dist/api/profiles-api/update-customization.d.ts +7 -0
- package/dist/api/profiles-api/update-customization.js +9 -0
- package/dist/api/questrooms-api/bind-bookeo.d.ts +7 -0
- package/dist/api/questrooms-api/bind-bookeo.js +9 -0
- package/dist/api/questrooms-api/close-many.d.ts +8 -0
- package/dist/api/questrooms-api/close-many.js +9 -0
- package/dist/api/questrooms-api/index.d.ts +4 -0
- package/dist/api/questrooms-api/index.js +4 -0
- package/dist/api/slot-templates-api/update.d.ts +2 -2
- package/dist/api/transactions-api/index.d.ts +0 -8
- package/dist/api/transactions-api/index.js +0 -8
- package/dist/api/users-api/check-token.d.ts +2 -2
- package/dist/api/users-api/complite-setup.d.ts +2 -2
- package/dist/api/users-api/create.d.ts +2 -2
- package/dist/api/users-api/current-update-notifications.d.ts +1 -1
- package/dist/api/users-api/current-update-password.d.ts +1 -1
- package/dist/api/users-api/current-update.d.ts +1 -1
- package/dist/api/users-api/get-one.d.ts +1 -1
- package/dist/api/users-api/index.d.ts +18 -20
- package/dist/api/users-api/index.js +18 -20
- package/dist/api/users-api/login.d.ts +1 -1
- package/dist/api/users-api/me-ping.d.ts +6 -0
- package/dist/api/users-api/me-ping.js +8 -0
- package/dist/api/users-api/me.d.ts +1 -1
- package/dist/api/users-api/query.d.ts +1 -1
- package/dist/api/users-api/recover.d.ts +1 -1
- package/dist/api/users-api/remove.d.ts +1 -1
- package/dist/api/users-api/send-invite.d.ts +1 -1
- package/dist/api/users-api/sessions/create-session.d.ts +9 -0
- package/dist/api/users-api/{create-report.js → sessions/create-session.js} +4 -4
- package/dist/api/users-api/sessions/export-sessions.d.ts +6 -0
- package/dist/api/users-api/sessions/export-sessions.js +10 -0
- package/dist/api/users-api/sessions/get-by-user-and-date.d.ts +7 -0
- package/dist/api/users-api/sessions/get-by-user-and-date.js +9 -0
- package/dist/api/users-api/sessions/get-calendar-sessions.d.ts +7 -0
- package/dist/api/users-api/sessions/get-calendar-sessions.js +9 -0
- package/dist/api/users-api/sessions/get-session.d.ts +6 -0
- package/dist/api/users-api/sessions/get-session.js +8 -0
- package/dist/api/users-api/sessions/query-sessions.d.ts +8 -0
- package/dist/api/users-api/sessions/query-sessions.js +9 -0
- package/dist/api/users-api/sessions/remove-session.d.ts +6 -0
- package/dist/api/users-api/sessions/remove-session.js +8 -0
- package/dist/api/users-api/sessions/update-session.d.ts +10 -0
- package/dist/api/users-api/{update-report.js → sessions/update-session.js} +4 -4
- package/dist/api/users-api/set-cookie.d.ts +1 -1
- package/dist/api/users-api/update-password.d.ts +1 -1
- package/dist/api/users-api/update.d.ts +2 -2
- package/dist/api/widgets-api/get-instruction-token.d.ts +6 -0
- package/dist/api/widgets-api/get-instruction-token.js +8 -0
- package/dist/api/widgets-api/get-instruction.d.ts +7 -0
- package/dist/api/widgets-api/get-instruction.js +9 -0
- package/dist/api/widgets-api/index.d.ts +6 -4
- package/dist/api/widgets-api/index.js +6 -4
- package/dist/api/widgets-api/init.d.ts +7 -0
- package/dist/api/widgets-api/init.js +9 -0
- package/dist/api/widgets-openapi/create-bookeo-order.d.ts +7 -0
- package/dist/api/widgets-openapi/create-bookeo-order.js +9 -0
- package/dist/api/widgets-openapi/create-certificate.d.ts +4 -4
- package/dist/api/widgets-openapi/create-hold.d.ts +7 -0
- package/dist/api/widgets-openapi/create-hold.js +9 -0
- package/dist/api/widgets-openapi/create-order.d.ts +4 -4
- package/dist/api/widgets-openapi/create-review.d.ts +3 -3
- package/dist/api/widgets-openapi/find-certificate.d.ts +4 -4
- package/dist/api/widgets-openapi/find-certificatesale.d.ts +2 -2
- package/dist/api/widgets-openapi/find-order.d.ts +2 -2
- package/dist/api/widgets-openapi/get-agreagator-info.d.ts +2 -2
- package/dist/api/widgets-openapi/get-bookeo-price.d.ts +7 -0
- package/dist/api/widgets-openapi/get-bookeo-price.js +9 -0
- package/dist/api/widgets-openapi/get-certificates-for-agregator.d.ts +2 -2
- package/dist/api/widgets-openapi/get-certificates.d.ts +2 -2
- package/dist/api/widgets-openapi/get-questroom.d.ts +2 -2
- package/dist/api/widgets-openapi/get-questrooms.d.ts +2 -2
- package/dist/api/widgets-openapi/get-reviews.d.ts +3 -3
- package/dist/api/widgets-openapi/get-widget-info.d.ts +4 -4
- package/dist/api/widgets-openapi/index.d.ts +8 -0
- package/dist/api/widgets-openapi/index.js +8 -0
- package/dist/api/widgets-openapi/remove-hold.d.ts +7 -0
- package/dist/api/widgets-openapi/remove-hold.js +9 -0
- package/dist/api/widgets-openapi/widget-daily.d.ts +4 -4
- package/dist/api/widgets-openapi/widget-weekly.d.ts +4 -4
- package/dist/api/widgets-orders/cancel-order.d.ts +2 -2
- package/dist/api/widgets-orders/find-order.d.ts +2 -2
- package/dist/hooks/use-api-method/actions/creators/api.d.ts +1 -1
- package/dist/hooks/use-api-method/index.d.ts +3 -4
- package/dist/hooks/use-api-method/index.js +12 -16
- package/dist/hooks/use-api-method/reducers/api.d.ts +1 -1
- package/package.json +4 -4
- package/dist/api/agb-api/create-inside-agb.d.ts +0 -9
- package/dist/api/agb-api/get-all-inside.d.ts +0 -7
- package/dist/api/agb-api/get-all-inside.js +0 -8
- package/dist/api/agb-api/get-one-by-id.d.ts +0 -7
- package/dist/api/agb-api/get-one-for-profile.d.ts +0 -7
- package/dist/api/agb-api/get-one-for-profile.js +0 -8
- package/dist/api/agb-api/update-profile-agb.d.ts +0 -9
- package/dist/api/profiles-api/_get-by-slug.d.ts +0 -7
- package/dist/api/profiles-api/_get-by-slug.js +0 -8
- package/dist/api/profiles-api/get-all-daily-reports.d.ts +0 -9
- package/dist/api/profiles-api/get-all-daily-reports.js +0 -8
- package/dist/api/profiles-api/update-payment-settings.d.ts +0 -6
- package/dist/api/profiles-api/update-payment-settings.js +0 -9
- package/dist/api/transactions-api/remove-order-payment.d.ts +0 -7
- package/dist/api/transactions-api/remove-order-payment.js +0 -8
- package/dist/api/transactions-api/remove-order-refund.d.ts +0 -7
- package/dist/api/transactions-api/remove-order-refund.js +0 -8
- package/dist/api/users-api/create-report.d.ts +0 -9
- package/dist/api/users-api/query-daily-reports.d.ts +0 -6
- package/dist/api/users-api/query-daily-reports.js +0 -8
- package/dist/api/users-api/query-month-reports.d.ts +0 -6
- package/dist/api/users-api/query-month-reports.js +0 -8
- package/dist/api/users-api/query-reports.d.ts +0 -8
- package/dist/api/users-api/query-reports.js +0 -9
- package/dist/api/users-api/remove-report.d.ts +0 -7
- package/dist/api/users-api/remove-report.js +0 -8
- package/dist/api/users-api/reports-count.d.ts +0 -6
- package/dist/api/users-api/reports-count.js +0 -9
- package/dist/api/users-api/reports-export.d.ts +0 -8
- package/dist/api/users-api/reports-export.js +0 -10
- package/dist/api/users-api/start-timer.d.ts +0 -6
- package/dist/api/users-api/start-timer.js +0 -8
- package/dist/api/users-api/stop-timer.d.ts +0 -6
- package/dist/api/users-api/stop-timer.js +0 -8
- package/dist/api/users-api/update-report.d.ts +0 -10
- package/dist/api/widgets-api/get-widget-customization.d.ts +0 -7
- package/dist/api/widgets-api/get-widget-customization.js +0 -8
- package/dist/api/widgets-api/update-widget-customization.d.ts +0 -7
- package/dist/api/widgets-api/update-widget-customization.js +0 -9
- package/dist/utils/convert-to-options.d.ts +0 -13
- package/dist/utils/convert-to-options.js +0 -17
- package/dist/utils/enum-to-options.d.ts +0 -5
- package/dist/utils/enum-to-options.js +0 -10
- package/dist/utils/get-documents-links.d.ts +0 -8
- package/dist/utils/get-documents-links.js +0 -14
- package/dist/utils/get-handled-error-message.d.ts +0 -1
- package/dist/utils/get-handled-error-message.js +0 -7
- package/dist/utils/get-many.d.ts +0 -1
- package/dist/utils/get-many.js +0 -13
- package/dist/utils/get-one.d.ts +0 -1
- package/dist/utils/get-one.js +0 -13
- package/dist/utils/get-service-error.d.ts +0 -18
- package/dist/utils/get-service-error.js +0 -67
- package/dist/utils/index.d.ts +0 -5
- package/dist/utils/index.js +0 -21
- package/dist/utils/is-axios-error.d.ts +0 -6
- package/dist/utils/is-axios-error.js +0 -11
- package/dist/utils/is-network-error.d.ts +0 -5
- package/dist/utils/is-network-error.js +0 -18
- package/dist/utils/redirect.d.ts +0 -1
- package/dist/utils/redirect.js +0 -7
- package/dist/utils/serialize-record.d.ts +0 -2
- package/dist/utils/serialize-record.js +0 -10
- package/dist/utils/serialize-slot.d.ts +0 -9
- package/dist/utils/serialize-slot.js +0 -48
- package/dist/utils/tz-date.d.ts +0 -19
- package/dist/utils/tz-date.js +0 -37
- package/dist/utils/validate-by-dto.d.ts +0 -1
- package/dist/utils/validate-by-dto.js +0 -18
- /package/dist/api/{transactions-api → order-transactions-api}/create-order-payment.js +0 -0
- /package/dist/api/{transactions-api → order-transactions-api}/create-order-refund.js +0 -0
- /package/dist/api/profiles-api/{get-payment-settings.js → subscription/get-payment-settings.js} +0 -0
- /package/dist/api/profiles-api/{get-profile-invoices.js → subscription/get-profile-invoices.js} +0 -0
- /package/dist/api/profiles-api/{get-stripe-session-link.js → subscription/get-stripe-session-link.js} +0 -0
- /package/dist/api/profiles-api/{paginate-bills.js → subscription/paginate-bills.js} +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DaySessionsRO } from '@escapenavigator/types/dist/user/sessions/day-sessions.ro';
|
|
2
|
+
import { UpdateDaySessionsDto } from '@escapenavigator/types/dist/user/sessions/update-day-sessions.dto';
|
|
3
|
+
import { ApiMethodDeclaration } from '../..';
|
|
4
|
+
declare type ParamsData = {
|
|
5
|
+
id: number;
|
|
6
|
+
data: UpdateDaySessionsDto;
|
|
7
|
+
};
|
|
8
|
+
declare type ResponseData = DaySessionsRO;
|
|
9
|
+
export declare const updateSession: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
10
|
+
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
var
|
|
3
|
+
exports.updateSession = void 0;
|
|
4
|
+
var updateSession = function (_a) {
|
|
5
5
|
var id = _a.id, data = _a.data;
|
|
6
6
|
return ({
|
|
7
|
-
url: "/user-
|
|
7
|
+
url: "/user-sessions/".concat(id),
|
|
8
8
|
method: 'PATCH',
|
|
9
9
|
data: data,
|
|
10
10
|
});
|
|
11
11
|
};
|
|
12
|
-
exports.
|
|
12
|
+
exports.updateSession = updateSession;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SuccessRO } from '@escapenavigator/types/dist/shared/success.ro';
|
|
2
|
-
import { CheckUserTokendDto } from '@escapenavigator/types/dist/user/check-user-token.dto';
|
|
2
|
+
import { CheckUserTokendDto } from '@escapenavigator/types/dist/user/outside/check-user-token.dto';
|
|
3
3
|
import { ApiMethodDeclaration } from '..';
|
|
4
4
|
declare type ParamsData = CheckUserTokendDto;
|
|
5
5
|
declare type ResponseData = SuccessRO;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SuccessRO } from '@escapenavigator/types/dist/shared/success.ro';
|
|
2
|
-
import { UpdateUserPasswordDto } from '@escapenavigator/types/dist/user/update-user-password.dto';
|
|
2
|
+
import { UpdateUserPasswordDto } from '@escapenavigator/types/dist/user/outside/update-user-password.dto';
|
|
3
3
|
import { ApiMethodDeclaration } from '..';
|
|
4
4
|
declare type ParamsData = {
|
|
5
5
|
token: string | string[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { UpdateUserDto } from '@escapenavigator/types/dist/user/update-user.dto';
|
|
2
|
-
import { UserRO } from '@escapenavigator/types/dist/user/user.ro';
|
|
1
|
+
import { UpdateUserDto } from '@escapenavigator/types/dist/user/crud/update-user.dto';
|
|
2
|
+
import { UserRO } from '@escapenavigator/types/dist/user/crud/user.ro';
|
|
3
3
|
import { ApiMethodDeclaration } from '..';
|
|
4
4
|
declare type ParamsData = {
|
|
5
5
|
id: number;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { InstructionTokenRO } from '@escapenavigator/types/dist/widget/instruction-token.ro';
|
|
2
|
+
import { ApiMethodDeclaration } from '..';
|
|
3
|
+
declare type ParamsData = undefined;
|
|
4
|
+
declare type ResponseData = InstructionTokenRO;
|
|
5
|
+
export declare const getInstructionToken: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getInstructionToken = void 0;
|
|
4
|
+
var getInstructionToken = function () { return ({
|
|
5
|
+
url: '/widgets/instruction-token',
|
|
6
|
+
method: 'GET',
|
|
7
|
+
}); };
|
|
8
|
+
exports.getInstructionToken = getInstructionToken;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { InstructionDto } from '@escapenavigator/types/dist/widget/instruction.dto';
|
|
2
|
+
import { WidgetRO } from '@escapenavigator/types/dist/widget/widget.ro';
|
|
3
|
+
import { ApiMethodDeclaration } from '..';
|
|
4
|
+
declare type ParamsData = InstructionDto;
|
|
5
|
+
declare type ResponseData = WidgetRO[];
|
|
6
|
+
export declare const getInstruction: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getInstruction = void 0;
|
|
4
|
+
var getInstruction = function (params) { return ({
|
|
5
|
+
url: '/widgets/instruction',
|
|
6
|
+
method: 'GET',
|
|
7
|
+
params: params,
|
|
8
|
+
}); };
|
|
9
|
+
exports.getInstruction = getInstruction;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { create } from './create';
|
|
2
|
+
import { getInstruction } from './get-instruction';
|
|
3
|
+
import { getInstructionToken } from './get-instruction-token';
|
|
2
4
|
import { getOne } from './get-one';
|
|
3
|
-
import {
|
|
5
|
+
import { init } from './init';
|
|
4
6
|
import { query } from './query';
|
|
5
7
|
import { remove } from './remove';
|
|
6
8
|
import { update } from './update';
|
|
7
|
-
import { updateWidgetCustomization } from './update-widget-customization';
|
|
8
9
|
declare type ApiDeclaration = {
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
init: typeof init;
|
|
11
|
+
getInstructionToken: typeof getInstructionToken;
|
|
12
|
+
getInstruction: typeof getInstruction;
|
|
11
13
|
create: typeof create;
|
|
12
14
|
remove: typeof remove;
|
|
13
15
|
update: typeof update;
|
|
@@ -2,16 +2,18 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.widgetsApiDeclaration = void 0;
|
|
4
4
|
var create_1 = require("./create");
|
|
5
|
+
var get_instruction_1 = require("./get-instruction");
|
|
6
|
+
var get_instruction_token_1 = require("./get-instruction-token");
|
|
5
7
|
var get_one_1 = require("./get-one");
|
|
6
|
-
var
|
|
8
|
+
var init_1 = require("./init");
|
|
7
9
|
var query_1 = require("./query");
|
|
8
10
|
var remove_1 = require("./remove");
|
|
9
11
|
var update_1 = require("./update");
|
|
10
|
-
var update_widget_customization_1 = require("./update-widget-customization");
|
|
11
12
|
exports.widgetsApiDeclaration = {
|
|
12
|
-
|
|
13
|
-
updateWidgetCustomization: update_widget_customization_1.updateWidgetCustomization,
|
|
13
|
+
init: init_1.init,
|
|
14
14
|
create: create_1.create,
|
|
15
|
+
getInstruction: get_instruction_1.getInstruction,
|
|
16
|
+
getInstructionToken: get_instruction_token_1.getInstructionToken,
|
|
15
17
|
remove: remove_1.remove,
|
|
16
18
|
update: update_1.update,
|
|
17
19
|
query: query_1.query,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { InitWidgetsDto } from '@escapenavigator/types/dist/widget/init-widgets.dto';
|
|
2
|
+
import { WidgetRO } from '@escapenavigator/types/dist/widget/widget.ro';
|
|
3
|
+
import { ApiMethodDeclaration } from '..';
|
|
4
|
+
declare type ParamsData = InitWidgetsDto;
|
|
5
|
+
declare type ResponseData = WidgetRO[];
|
|
6
|
+
export declare const init: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { OpenapiBookeoOrderRO } from '@escapenavigator/types/dist/widget-openapi/openapi-bookeo-order.ro';
|
|
2
|
+
import { OpenapiCreateBookeoOrderDto } from '@escapenavigator/types/dist/widget-openapi/openapi-create-bookeo-order.dto';
|
|
3
|
+
import { ApiMethodDeclaration } from '..';
|
|
4
|
+
declare type ParamsData = OpenapiCreateBookeoOrderDto;
|
|
5
|
+
declare type ResponseData = OpenapiBookeoOrderRO;
|
|
6
|
+
export declare const createBookeoOrder: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createBookeoOrder = void 0;
|
|
4
|
+
var createBookeoOrder = function (data) { return ({
|
|
5
|
+
url: '/widget/openapi/bookeo/order',
|
|
6
|
+
method: 'POST',
|
|
7
|
+
data: data,
|
|
8
|
+
}); };
|
|
9
|
+
exports.createBookeoOrder = createBookeoOrder;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { OpenapiCertificateRO } from '@escapenavigator/types/dist/widget-openapi/openapi-certificate.ro';
|
|
2
|
+
import { OpenapiCreateCertificateDto } from '@escapenavigator/types/dist/widget-openapi/openapi-create-certificate.dto';
|
|
3
3
|
import { ApiMethodDeclaration } from '..';
|
|
4
4
|
declare type ParamsData = {
|
|
5
|
-
data:
|
|
5
|
+
data: OpenapiCreateCertificateDto;
|
|
6
6
|
};
|
|
7
|
-
declare type ResponseData =
|
|
7
|
+
declare type ResponseData = OpenapiCertificateRO;
|
|
8
8
|
export declare const createCertificate: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
9
9
|
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { OpenapiSlotAddHoldDto } from '@escapenavigator/types/dist/widget-openapi/openapi-slot-add-hold.dto';
|
|
2
|
+
import { OpenapiSlotAddHoldRO } from '@escapenavigator/types/dist/widget-openapi/openapi-slot-add-hold.ro';
|
|
3
|
+
import { ApiMethodDeclaration } from '..';
|
|
4
|
+
declare type ParamsData = OpenapiSlotAddHoldDto;
|
|
5
|
+
declare type ResponseData = OpenapiSlotAddHoldRO;
|
|
6
|
+
export declare const createHold: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
7
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { OpenapiCreateOrderDto } from '@escapenavigator/types/dist/widget-openapi/openapi-create-order.dto';
|
|
2
|
+
import { OpenapiOrderRO } from '@escapenavigator/types/dist/widget-openapi/openapi-order.ro';
|
|
3
3
|
import { ApiMethodDeclaration } from '..';
|
|
4
4
|
declare type ParamsData = {
|
|
5
|
-
data:
|
|
5
|
+
data: OpenapiCreateOrderDto;
|
|
6
6
|
};
|
|
7
|
-
declare type ResponseData =
|
|
7
|
+
declare type ResponseData = OpenapiOrderRO;
|
|
8
8
|
export declare const createOrder: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
9
9
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { WigetOpenapiReviewRO } from '@escapenavigator/types/dist/widget-openapi/
|
|
1
|
+
import { OpenapiCreateReviewDto } from '@escapenavigator/types/dist/widget-openapi/openapi-create-review.dto';
|
|
2
|
+
import { WigetOpenapiReviewRO } from '@escapenavigator/types/dist/widget-openapi/openapi-review.ro';
|
|
3
3
|
import { ApiMethodDeclaration } from '..';
|
|
4
4
|
declare type ParamsData = {
|
|
5
|
-
data:
|
|
5
|
+
data: OpenapiCreateReviewDto;
|
|
6
6
|
};
|
|
7
7
|
declare type ResponseData = WigetOpenapiReviewRO;
|
|
8
8
|
export declare const createReview: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { OpenapiFindDiscountByCodeDto } from '@escapenavigator/types/dist/widget-openapi/openapi-find-discount-by-code.dto';
|
|
2
|
+
import { OpenapiFindedCertificateRO } from '@escapenavigator/types/dist/widget-openapi/openapi-finded-certificate.ro';
|
|
3
3
|
import { ApiMethodDeclaration } from '..';
|
|
4
|
-
declare type ParamsData =
|
|
5
|
-
declare type ResponseData =
|
|
4
|
+
declare type ParamsData = OpenapiFindDiscountByCodeDto;
|
|
5
|
+
declare type ResponseData = OpenapiFindedCertificateRO;
|
|
6
6
|
export declare const findCertificate: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
7
7
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OpenapiCertificateRO } from '@escapenavigator/types/dist/widget-openapi/openapi-certificate.ro';
|
|
2
2
|
import { ApiMethodDeclaration } from '..';
|
|
3
3
|
declare type ParamsData = string;
|
|
4
|
-
declare type ResponseData =
|
|
4
|
+
declare type ResponseData = OpenapiCertificateRO;
|
|
5
5
|
export declare const findCertificatesale: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
6
6
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OpenapiOrderRO } from '@escapenavigator/types/dist/widget-openapi/openapi-order.ro';
|
|
2
2
|
import { ApiMethodDeclaration } from '..';
|
|
3
3
|
declare type ParamsData = string;
|
|
4
|
-
declare type ResponseData =
|
|
4
|
+
declare type ResponseData = OpenapiOrderRO;
|
|
5
5
|
export declare const findOrder: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
6
6
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OpenapiWidgetRO } from '@escapenavigator/types/dist/widget-openapi/openapi-widget.ro';
|
|
2
2
|
import { ApiMethodDeclaration } from '..';
|
|
3
3
|
/** Questroom ID виджета */
|
|
4
4
|
declare type ParamsData = string;
|
|
5
|
-
declare type ResponseData =
|
|
5
|
+
declare type ResponseData = OpenapiWidgetRO;
|
|
6
6
|
export declare const getAgregatorInfo: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
7
7
|
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { OpenapiSlotGetBookeoPriceDto } from '@escapenavigator/types/dist/widget-openapi/openapi-slot-get-bookeo-price.dto';
|
|
2
|
+
import { OpenapiSlotGetBookeoPriceRO } from '@escapenavigator/types/dist/widget-openapi/openapi-slot-get-bookeo-price.ro';
|
|
3
|
+
import { ApiMethodDeclaration } from '..';
|
|
4
|
+
declare type ParamsData = OpenapiSlotGetBookeoPriceDto;
|
|
5
|
+
declare type ResponseData = OpenapiSlotGetBookeoPriceRO;
|
|
6
|
+
export declare const getBookeoPrice: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBookeoPrice = void 0;
|
|
4
|
+
var getBookeoPrice = function (data) { return ({
|
|
5
|
+
url: '/widget/openapi/bookeo/price',
|
|
6
|
+
method: 'PATCH',
|
|
7
|
+
data: data,
|
|
8
|
+
}); };
|
|
9
|
+
exports.getBookeoPrice = getBookeoPrice;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OpenapiCertificateCardRO } from '@escapenavigator/types/dist/widget-openapi/openapi-certificate-card.ro';
|
|
2
2
|
import { ApiMethodDeclaration } from '..';
|
|
3
3
|
/** id квеста */
|
|
4
4
|
declare type ParamsData = string;
|
|
5
|
-
declare type ResponseData =
|
|
5
|
+
declare type ResponseData = OpenapiCertificateCardRO[];
|
|
6
6
|
export declare const getCertificatesForAgregator: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
7
7
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OpenapiCertificateCardRO } from '@escapenavigator/types/dist/widget-openapi/openapi-certificate-card.ro';
|
|
2
2
|
import { ApiMethodDeclaration } from '..';
|
|
3
3
|
/** widget uid */
|
|
4
4
|
declare type ParamsData = string;
|
|
5
|
-
declare type ResponseData =
|
|
5
|
+
declare type ResponseData = OpenapiCertificateCardRO[];
|
|
6
6
|
export declare const getCertificates: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
7
7
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OpenapiQuestroomRO } from '@escapenavigator/types/dist/widget-openapi/openapi-questroom.ro';
|
|
2
2
|
import { ApiMethodDeclaration } from '..';
|
|
3
3
|
/** questroom id */
|
|
4
4
|
declare type ParamsData = string;
|
|
5
|
-
declare type ResponseData =
|
|
5
|
+
declare type ResponseData = OpenapiQuestroomRO;
|
|
6
6
|
export declare const getQuestroom: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
7
7
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OpenapiQuestroomRO } from '@escapenavigator/types/dist/widget-openapi/openapi-questroom.ro';
|
|
2
2
|
import { ApiMethodDeclaration } from '..';
|
|
3
3
|
/** widget slug */
|
|
4
4
|
declare type ParamsData = string;
|
|
5
|
-
declare type ResponseData =
|
|
5
|
+
declare type ResponseData = OpenapiQuestroomRO[];
|
|
6
6
|
export declare const getQuestrooms: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
7
7
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { WigetOpenapiReviewRO } from '@escapenavigator/types/dist/widget-openapi/
|
|
1
|
+
import { OpenapiFindReviewsDto } from '@escapenavigator/types/dist/widget-openapi/openapi-find-reviews.dto';
|
|
2
|
+
import { WigetOpenapiReviewRO } from '@escapenavigator/types/dist/widget-openapi/openapi-review.ro';
|
|
3
3
|
import { ApiMethodDeclaration } from '..';
|
|
4
|
-
declare type ParamsData =
|
|
4
|
+
declare type ParamsData = OpenapiFindReviewsDto;
|
|
5
5
|
declare type ResponseData = WigetOpenapiReviewRO[];
|
|
6
6
|
export declare const getReviews: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
7
7
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { OpenapiGetWidgetInfoDto } from '@escapenavigator/types/dist/widget-openapi/openapi-get-widgget-info.dto';
|
|
2
|
+
import { OpenapiWidgetRO } from '@escapenavigator/types/dist/widget-openapi/openapi-widget.ro';
|
|
3
3
|
import { ApiMethodDeclaration } from '..';
|
|
4
4
|
/** UID виджета */
|
|
5
|
-
declare type ParamsData =
|
|
6
|
-
declare type ResponseData =
|
|
5
|
+
declare type ParamsData = OpenapiGetWidgetInfoDto;
|
|
6
|
+
declare type ResponseData = OpenapiWidgetRO;
|
|
7
7
|
export declare const getWidgetInfo: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
8
8
|
export {};
|
|
@@ -1,19 +1,27 @@
|
|
|
1
|
+
import { createBookeoOrder } from './create-bookeo-order';
|
|
1
2
|
import { createCertificate } from './create-certificate';
|
|
3
|
+
import { createHold } from './create-hold';
|
|
2
4
|
import { createOrder } from './create-order';
|
|
3
5
|
import { createReview } from './create-review';
|
|
4
6
|
import { findCertificate } from './find-certificate';
|
|
5
7
|
import { findCertificatesale } from './find-certificatesale';
|
|
6
8
|
import { findOrder } from './find-order';
|
|
7
9
|
import { getAgregatorInfo } from './get-agreagator-info';
|
|
10
|
+
import { getBookeoPrice } from './get-bookeo-price';
|
|
8
11
|
import { getCertificates } from './get-certificates';
|
|
9
12
|
import { getCertificatesForAgregator } from './get-certificates-for-agregator';
|
|
10
13
|
import { getQuestroom } from './get-questroom';
|
|
11
14
|
import { getQuestrooms } from './get-questrooms';
|
|
12
15
|
import { getReviews } from './get-reviews';
|
|
13
16
|
import { getWidgetInfo } from './get-widget-info';
|
|
17
|
+
import { removeHold } from './remove-hold';
|
|
14
18
|
import { daily } from './widget-daily';
|
|
15
19
|
import { weekly } from './widget-weekly';
|
|
16
20
|
declare type ApiDeclaration = {
|
|
21
|
+
removeHold: typeof removeHold;
|
|
22
|
+
getBookeoPrice: typeof getBookeoPrice;
|
|
23
|
+
createHold: typeof createHold;
|
|
24
|
+
createBookeoOrder: typeof createBookeoOrder;
|
|
17
25
|
getAgregatorInfo: typeof getAgregatorInfo;
|
|
18
26
|
findCertificatesale: typeof findCertificatesale;
|
|
19
27
|
findOrder: typeof findOrder;
|
|
@@ -1,22 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.widgetsOpenApiDeclaration = void 0;
|
|
4
|
+
var create_bookeo_order_1 = require("./create-bookeo-order");
|
|
4
5
|
var create_certificate_1 = require("./create-certificate");
|
|
6
|
+
var create_hold_1 = require("./create-hold");
|
|
5
7
|
var create_order_1 = require("./create-order");
|
|
6
8
|
var create_review_1 = require("./create-review");
|
|
7
9
|
var find_certificate_1 = require("./find-certificate");
|
|
8
10
|
var find_certificatesale_1 = require("./find-certificatesale");
|
|
9
11
|
var find_order_1 = require("./find-order");
|
|
10
12
|
var get_agreagator_info_1 = require("./get-agreagator-info");
|
|
13
|
+
var get_bookeo_price_1 = require("./get-bookeo-price");
|
|
11
14
|
var get_certificates_1 = require("./get-certificates");
|
|
12
15
|
var get_certificates_for_agregator_1 = require("./get-certificates-for-agregator");
|
|
13
16
|
var get_questroom_1 = require("./get-questroom");
|
|
14
17
|
var get_questrooms_1 = require("./get-questrooms");
|
|
15
18
|
var get_reviews_1 = require("./get-reviews");
|
|
16
19
|
var get_widget_info_1 = require("./get-widget-info");
|
|
20
|
+
var remove_hold_1 = require("./remove-hold");
|
|
17
21
|
var widget_daily_1 = require("./widget-daily");
|
|
18
22
|
var widget_weekly_1 = require("./widget-weekly");
|
|
19
23
|
exports.widgetsOpenApiDeclaration = {
|
|
24
|
+
removeHold: remove_hold_1.removeHold,
|
|
25
|
+
createHold: create_hold_1.createHold,
|
|
26
|
+
getBookeoPrice: get_bookeo_price_1.getBookeoPrice,
|
|
27
|
+
createBookeoOrder: create_bookeo_order_1.createBookeoOrder,
|
|
20
28
|
getQuestrooms: get_questrooms_1.getQuestrooms,
|
|
21
29
|
getAgregatorInfo: get_agreagator_info_1.getAgregatorInfo,
|
|
22
30
|
findCertificatesale: find_certificatesale_1.findCertificatesale,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SuccessRO } from '@escapenavigator/types/dist/shared/success.ro';
|
|
2
|
+
import { OpenapiSlotRemoveHoldDto } from '@escapenavigator/types/dist/widget-openapi/openapi-slot-remove-hold.dto';
|
|
3
|
+
import { ApiMethodDeclaration } from '..';
|
|
4
|
+
declare type ParamsData = OpenapiSlotRemoveHoldDto;
|
|
5
|
+
declare type ResponseData = SuccessRO;
|
|
6
|
+
export declare const removeHold: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.removeHold = void 0;
|
|
4
|
+
var removeHold = function (params) { return ({
|
|
5
|
+
url: '/widget/openapi/hold',
|
|
6
|
+
method: 'DELETE',
|
|
7
|
+
params: params,
|
|
8
|
+
}); };
|
|
9
|
+
exports.removeHold = removeHold;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { OpenapiDayScheduleDto } from '@escapenavigator/types/dist/widget-openapi/openapi-day-schedule.dto';
|
|
2
|
+
import { OpenapiSlotRO } from '@escapenavigator/types/dist/widget-openapi/openapi-slots.ro';
|
|
3
3
|
import { ApiMethodDeclaration } from '..';
|
|
4
|
-
declare type ParamsData =
|
|
5
|
-
declare type ResponseData =
|
|
4
|
+
declare type ParamsData = OpenapiDayScheduleDto;
|
|
5
|
+
declare type ResponseData = OpenapiSlotRO[];
|
|
6
6
|
export declare const daily: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
7
7
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { OpenapiSlotRO } from '@escapenavigator/types/dist/widget-openapi/openapi-slots.ro';
|
|
2
|
+
import { OpenapiWeekScheduleDto } from '@escapenavigator/types/dist/widget-openapi/openapi-week-schedule.dto';
|
|
3
3
|
import { ApiMethodDeclaration } from '..';
|
|
4
|
-
declare type ParamsData =
|
|
5
|
-
declare type ResponseData =
|
|
4
|
+
declare type ParamsData = OpenapiWeekScheduleDto;
|
|
5
|
+
declare type ResponseData = OpenapiSlotRO[];
|
|
6
6
|
export declare const weekly: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
7
7
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WidgetOrderRO } from '@escapenavigator/types/dist/widget-orders/widget-order.ro';
|
|
2
2
|
import { ApiMethodDeclaration } from '..';
|
|
3
3
|
declare type ParamsData = string;
|
|
4
|
-
declare type ResponseData =
|
|
4
|
+
declare type ResponseData = WidgetOrderRO;
|
|
5
5
|
export declare const cancelOrder: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
6
6
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WidgetOrderRO } from '@escapenavigator/types/dist/widget-orders/widget-order.ro';
|
|
2
2
|
import { ApiMethodDeclaration } from '..';
|
|
3
3
|
declare type ParamsData = string;
|
|
4
|
-
declare type ResponseData =
|
|
4
|
+
declare type ResponseData = WidgetOrderRO;
|
|
5
5
|
export declare const findOrder: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
6
6
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { ServiceError } from '@escapenavigator/utils/dist/get-service-error';
|
|
1
2
|
import { AxiosResponse } from 'axios';
|
|
2
|
-
import { ServiceError } from '../../../../utils/get-service-error';
|
|
3
3
|
import { ActionTypes } from '../types/api';
|
|
4
4
|
export declare const fetchStart: () => {
|
|
5
5
|
type: ActionTypes.FETCH_START;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { ServiceError } from '@escapenavigator/utils/dist/get-service-error';
|
|
1
2
|
import { AxiosPromise, AxiosResponse } from 'axios';
|
|
2
|
-
import { ServiceError } from '../../utils/get-service-error';
|
|
3
3
|
declare type ApiMethod<P, T, R, DisplayName> = {
|
|
4
4
|
(params: P, transportConfig?: T): AxiosPromise<R>;
|
|
5
5
|
displayName: DisplayName;
|
|
@@ -16,9 +16,8 @@ declare type Result<P, T, R, DisplayName extends string> = {
|
|
|
16
16
|
};
|
|
17
17
|
declare type Props<P, T, R, DisplayName extends string> = {
|
|
18
18
|
api: ApiMethod<P, T, R, DisplayName>;
|
|
19
|
-
successCallback?: (data: AxiosResponse<R
|
|
19
|
+
successCallback?: (data: AxiosResponse<R>, params: P) => void;
|
|
20
20
|
errorCallback?: (error: ServiceError) => void;
|
|
21
|
-
delay?: number;
|
|
22
21
|
};
|
|
23
|
-
export declare const useApiMethod: <P, T, R, DisplayName extends string>({ api, successCallback, errorCallback,
|
|
22
|
+
export declare const useApiMethod: <P, T, R, DisplayName extends string>({ api, successCallback, errorCallback, }: Props<P, T, R, DisplayName>) => Result<P, T, R, DisplayName>;
|
|
24
23
|
export {};
|
|
@@ -41,51 +41,47 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
42
|
exports.useApiMethod = void 0;
|
|
43
43
|
var react_1 = require("react");
|
|
44
|
+
var get_service_error_1 = require("@escapenavigator/utils/dist/get-service-error");
|
|
44
45
|
var axios_1 = __importDefault(require("axios"));
|
|
45
|
-
var get_service_error_1 = require("../../utils/get-service-error");
|
|
46
46
|
var api_1 = require("./actions/creators/api");
|
|
47
47
|
var api_2 = require("./reducers/api");
|
|
48
48
|
var useApiMethod = function (_a) {
|
|
49
49
|
var _b;
|
|
50
|
-
var api = _a.api, successCallback = _a.successCallback, errorCallback = _a.errorCallback
|
|
50
|
+
var api = _a.api, successCallback = _a.successCallback, errorCallback = _a.errorCallback;
|
|
51
51
|
var mounted = (0, react_1.useRef)(false);
|
|
52
52
|
var source = (0, react_1.useRef)(null);
|
|
53
53
|
var _c = (0, react_1.useReducer)(api_2.apiReducer, api_2.initialState), state = _c[0], dispatch = _c[1];
|
|
54
54
|
var fetch = (0, react_1.useCallback)(function (params) { return __awaiter(void 0, void 0, void 0, function () {
|
|
55
|
-
var
|
|
55
|
+
var response, error_1, err;
|
|
56
56
|
return __generator(this, function (_a) {
|
|
57
57
|
switch (_a.label) {
|
|
58
58
|
case 0:
|
|
59
59
|
source.current = axios_1.default.CancelToken.source();
|
|
60
|
-
startTime = Date.now();
|
|
61
60
|
_a.label = 1;
|
|
62
61
|
case 1:
|
|
63
62
|
_a.trys.push([1, 3, , 4]);
|
|
64
63
|
dispatch((0, api_1.fetchStart)());
|
|
65
64
|
return [4 /*yield*/, api(params)];
|
|
66
65
|
case 2:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
successCallback(response_1);
|
|
73
|
-
dispatch((0, api_1.fetchSuccess)(response_1));
|
|
74
|
-
}, delta);
|
|
75
|
-
return [3 /*break*/, 4];
|
|
66
|
+
response = _a.sent();
|
|
67
|
+
if (successCallback)
|
|
68
|
+
successCallback(response, params);
|
|
69
|
+
dispatch((0, api_1.fetchSuccess)(response));
|
|
70
|
+
return [2 /*return*/, response];
|
|
76
71
|
case 3:
|
|
77
72
|
error_1 = _a.sent();
|
|
78
73
|
if (!mounted.current)
|
|
79
|
-
return [2 /*return
|
|
74
|
+
return [2 /*return*/, null];
|
|
80
75
|
err = (0, get_service_error_1.getServiceError)(error_1);
|
|
81
76
|
if (errorCallback)
|
|
82
77
|
errorCallback(err);
|
|
83
78
|
dispatch((0, api_1.fetchFailure)(err));
|
|
84
|
-
throw
|
|
79
|
+
// eslint-disable-next-line @typescript-eslint/no-throw-literal
|
|
80
|
+
throw err;
|
|
85
81
|
case 4: return [2 /*return*/];
|
|
86
82
|
}
|
|
87
83
|
});
|
|
88
|
-
}); }, [api, successCallback, errorCallback
|
|
84
|
+
}); }, [api, successCallback, errorCallback]);
|
|
89
85
|
(0, react_1.useEffect)(function () {
|
|
90
86
|
mounted.current = true;
|
|
91
87
|
return function () {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Reducer } from 'react';
|
|
2
|
+
import { ServiceError } from '@escapenavigator/utils/dist/get-service-error';
|
|
2
3
|
import { AxiosResponse } from 'axios';
|
|
3
|
-
import { ServiceError } from '../../../utils/get-service-error';
|
|
4
4
|
import * as actions from '../actions/creators/api';
|
|
5
5
|
import { GenericActionCreator } from '../actions/types';
|
|
6
6
|
declare type Action = GenericActionCreator<typeof actions>;
|