@inno_user/inno_clouds_lib 9.1.11 → 9.2.0

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.
@@ -0,0 +1,3 @@
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ declare const _default: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, SVGSVGElement>;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ declare const _default: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, SVGSVGElement>;
3
+ export default _default;
@@ -0,0 +1,23 @@
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ type __VLS_Props = {
3
+ configPage: {
4
+ tableDataId: any;
5
+ kiosk_menu: boolean;
6
+ qr_menu: boolean;
7
+ is_tableservice: boolean;
8
+ userData?: unknown;
9
+ };
10
+ comment: string;
11
+ cartItems: any[];
12
+ isAuthorized: boolean;
13
+ hasRmsDiscount?: boolean;
14
+ hideDiscountsButton?: boolean;
15
+ orderId?: string | null;
16
+ signal?: AbortSignal;
17
+ };
18
+ declare const _default: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
19
+ selectPayment: (providerId: string) => any;
20
+ }, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
21
+ onSelectPayment?: ((providerId: string) => any) | undefined;
22
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
23
+ export default _default;
@@ -0,0 +1,12 @@
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ interface Props {
3
+ symbols?: string[];
4
+ max?: number;
5
+ interval?: number;
6
+ }
7
+ declare const _default: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {
8
+ max: number;
9
+ symbols: string[];
10
+ interval: number;
11
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
12
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default as FallingHearts } from './FallingHearts/FallingHearts.vue';
@@ -0,0 +1,18 @@
1
+ import { CreateOrderAndOpenSocketConfig } from '../payment/handlers/basePaymentHandler';
2
+ export interface CreateOrderConfigPage {
3
+ tableDataId: any;
4
+ kiosk_menu: boolean;
5
+ is_tableservice: boolean;
6
+ }
7
+ export interface CreateOrderParams {
8
+ paymentMethodId?: string;
9
+ items: any[];
10
+ tableDataId: any;
11
+ comment: string;
12
+ isAuthorized: boolean;
13
+ signal?: AbortSignal;
14
+ }
15
+ export declare function useCreateOrder(): {
16
+ getCreateOrderConfig: (configPage: CreateOrderConfigPage, paymentMethodId?: string) => CreateOrderAndOpenSocketConfig | null;
17
+ makeCreateOrderRequest: (configPage: CreateOrderConfigPage, params: CreateOrderParams) => Promise<any>;
18
+ };
package/dist/index.d.ts CHANGED
@@ -22,6 +22,7 @@ import { vMuted } from './directives/vMuted';
22
22
  import { useCachedMedia } from './hooks/useProductImage/useProductImage';
23
23
  import { updateIndexedDB } from './utils/updateIndexedDB';
24
24
  import { getCachedGroup, getCachedProduct, clearAllProductDB } from './utils/indexedDB';
25
+ import { FallingHearts } from './components/holidays';
25
26
  import { default as ButtonDefault } from './ui/buttons/default/ButtonDefault.vue';
26
27
  import { default as BasketButton } from './ui/buttons/basketButton/BasketButton.vue';
27
28
  import { BottomSheet } from './ui/bottomSheet';
@@ -45,5 +46,5 @@ useModal, useVirtuaLoop,
45
46
  /** Utils */
46
47
  preventZoom, getCachedGroup, getCachedProduct, clearAllProductDB, clearLocalStorage, PricePrerender,
47
48
  /** Components */
48
- VList, Virtualizer, };
49
+ VList, Virtualizer, FallingHearts, };
49
50
  export type { ICallStaffRequest, PreventZoomConfig };
@@ -0,0 +1,19 @@
1
+ import { PaymentContext, PaymentMethodConfig, PaymentHandler } from '../types/payment';
2
+ /**
3
+ * Регистр методов оплаты
4
+ * Централизованное место для регистрации и управления методами оплаты
5
+ */
6
+ export declare class PaymentMethodRegistry {
7
+ private static methods;
8
+ /**
9
+ * Инициализация регистра с методами оплаты по умолчанию
10
+ */
11
+ static initialize(): void;
12
+ static register(config: PaymentMethodConfig): void;
13
+ static getConfig(id: string): PaymentMethodConfig | null;
14
+ /** Получение доступных методов оплаты для контекста (возвращает id) */
15
+ static getAvailableMethods(context: PaymentContext): string[];
16
+ /** Проверка доступности метода для контекста */
17
+ static isMethodAvailable(id: string, context: PaymentContext): boolean;
18
+ static createHandler(id: string): PaymentHandler | null;
19
+ }
@@ -0,0 +1,48 @@
1
+ import { PaymentConfig, CreateOrderAndOpenSocketConfig } from '../../types/payment';
2
+ export type { CreateOrderAndOpenSocketConfig };
3
+ /**
4
+ * Инициализация WebSocket соединения для заказа
5
+ * Если ws уже передан в конфиге, использует его, иначе создает новый
6
+ */
7
+ export declare function initWebSocket(orderId: string, config: PaymentConfig, onOpen: () => void, onMessage: (data: any) => void, onError: (error: any) => void, signal?: AbortSignal): any;
8
+ export declare function closeWebSocket(ws: any | null): void;
9
+ /**
10
+ * Инициализация платежной ссылки
11
+ */
12
+ export declare function initPaymentLink(orderId: string, method: string): Promise<any>;
13
+ /**
14
+ * Обработчик сообщений WebSocket (базовая логика)
15
+ */
16
+ export declare function baseWebSocketMessage(data: any, config: PaymentConfig, handleStatus: (data: any, config: PaymentConfig) => void): void;
17
+ /**
18
+ * Обработка RMS скидок
19
+ */
20
+ export declare function handleRmsDiscounts(data: any, config: PaymentConfig): boolean;
21
+ /**
22
+ * Обработка смены экранов статусов
23
+ */
24
+ export declare const checkOrderStatus: (config: PaymentConfig, status: number | null) => void;
25
+ export declare const checkLoadCart: (config: PaymentConfig) => void;
26
+ export declare const checkResetBonuses: (config: PaymentConfig) => void;
27
+ export declare const checkCloseWebSocket: (config: PaymentConfig) => void;
28
+ /**
29
+ * Обработка table service
30
+ */
31
+ export declare const handleTableService: (config: PaymentConfig, ws: any | null) => void;
32
+ /**
33
+ * Обработка оплаты заказа
34
+ */
35
+ export declare const handleOrderPay: (data: any, config: PaymentConfig, ws: any, errorHandler: any) => void;
36
+ /**
37
+ * Обработка ошибок заказа
38
+ */
39
+ export declare const handleOrderError: (config: PaymentConfig, ws: any, errorHandler: any) => void;
40
+ /**
41
+ * Создание заказа и открытие WebSocket с полной обработкой ошибок и редиректов
42
+ * handler определяется динамически при получении сообщений
43
+ */
44
+ export declare function createOrderAndOpenSocket(items: any[], tableDataId: any, config: CreateOrderAndOpenSocketConfig, options: {
45
+ comment: string;
46
+ is_authorized: boolean;
47
+ signal?: AbortSignal;
48
+ }): Promise<any>;
@@ -0,0 +1,2 @@
1
+ import { PaymentHandler } from '../../types/payment';
2
+ export declare function createSBPHandler(): PaymentHandler;
@@ -0,0 +1,2 @@
1
+ import { PaymentHandler } from '../../types/payment';
2
+ export declare const createTerminalHandler: () => PaymentHandler;
@@ -0,0 +1,2 @@
1
+ import { PaymentHandler } from '../../types/payment';
2
+ export declare const createYoukassaHandler: () => PaymentHandler;
@@ -0,0 +1,3 @@
1
+ import { CartCleanupService, PaymentConfig } from '../../types/payment';
2
+ /** сервис очистки корзины */
3
+ export declare function createCartCleanupService(config: PaymentConfig): CartCleanupService;
@@ -0,0 +1,2 @@
1
+ import { PaymentErrorHandler } from '../../types/payment';
2
+ export declare function createPaymentErrorHandler(): PaymentErrorHandler;
@@ -0,0 +1,3 @@
1
+ import { PaymentConfig, PaymentNavigationService } from '../../types/payment';
2
+ /** сервис навигации */
3
+ export declare function createPaymentNavigationService(config: PaymentConfig): PaymentNavigationService;
@@ -60,7 +60,7 @@ declare class InitConnection {
60
60
  sendSmsCodeForAuth(code: number, phone: number): Promise<any>;
61
61
  callStaff(tableId: string, payload: ICallStaffRequest, options?: AxiosRequestConfig): Promise<string | undefined>;
62
62
  createOrder(clearCartProducts_lib: any, tableTitle: any, is_requestKiosk: boolean | undefined, comment: string, is_authorized?: boolean, is_tableservice?: boolean, signal?: AbortSignal): Promise<any>;
63
- initPaymentLink(order: string, is_requestKiosk?: boolean): Promise<any>;
63
+ initPaymentLink(order: string, paymentMethod: string): Promise<any>;
64
64
  orderPay(id: string): Promise< AxiosResponse<any, any, {}> | undefined>;
65
65
  getProfile(): Promise<any>;
66
66
  calculateDiscount(payload: any, is_requestKiosk?: boolean, is_authorized?: boolean, signal?: AbortSignal): Promise<any>;
@@ -0,0 +1,28 @@
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ type __VLS_Props = {
3
+ configPage: {
4
+ tableDataId: any;
5
+ kiosk_menu: boolean;
6
+ qr_menu: boolean;
7
+ is_tableservice: boolean;
8
+ userData?: unknown;
9
+ };
10
+ comment: string;
11
+ cartItems: any[];
12
+ isAuthorized: boolean;
13
+ hasRmsDiscount?: boolean;
14
+ hideDiscountsButton?: boolean;
15
+ orderId?: string | null;
16
+ signal?: AbortSignal;
17
+ provider: any;
18
+ };
19
+ declare const _default: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
20
+ select: (providerId: string) => any;
21
+ }, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
22
+ onSelect?: ((providerId: string) => any) | undefined;
23
+ }>, {
24
+ hasRmsDiscount: boolean;
25
+ hideDiscountsButton: boolean;
26
+ orderId: string | null;
27
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
28
+ export default _default;
@@ -1,7 +1,7 @@
1
+ import { PaymentContext, PaymentConfig } from '../types/payment';
1
2
  import { StoreDefinition } from 'pinia';
2
3
  import { Ref, ComputedRef } from 'vue';
3
4
  export declare const useCartStore: StoreDefinition<"cartLib", Pick<{
4
- statusWSCreate: Ref<null, null>;
5
5
  isButtonDisabled: Ref<boolean, boolean>;
6
6
  orderCompleted_lib: Ref<number | null, number | null>;
7
7
  extraDiscount: Ref<number, number>;
@@ -21,17 +21,27 @@ export declare const useCartStore: StoreDefinition<"cartLib", Pick<{
21
21
  isDrawerOpen: Ref<boolean, boolean>;
22
22
  currentState: Ref<"wait" | "success" | "not_found", "wait" | "success" | "not_found">;
23
23
  isAuthorized: ComputedRef<boolean>;
24
- orderSocket: (orderId: string, is_requestKiosk: boolean, is_tableservice?: boolean, signal?: AbortSignal) => void;
24
+ discountBtn: Ref<boolean, boolean>;
25
+ linkQR: Ref<string, string>;
26
+ providerTypes: Ref<any, any>;
27
+ is_paymentCart: Ref<boolean, boolean>;
28
+ selectedProvider: Ref<any, any>;
29
+ configPayment: Ref<PaymentConfig | undefined, PaymentConfig | undefined>;
30
+ paymentCostQR: Ref<number, number>;
25
31
  deleteCart: (path?: string | null, clearTokens?: boolean) => void;
26
- setGuestInfo: (info: any) => any;
32
+ setGuestInfo: (info: unknown) => void;
27
33
  setState: (state: "wait" | "success" | "not_found") => void;
28
34
  openDrawer: () => void;
29
35
  closeDrawer: () => void;
30
36
  clearCard: () => void;
31
- makeInitPaymentLinkRequest: (orderId: string, is_requestKiosk: boolean, is_tableservice?: boolean) => Promise<void>;
32
37
  showNotification: (message: string) => void;
33
- }, "error" | "count" | "is_notification_lib" | "notificationData_lib" | "statusWSCreate" | "isButtonDisabled" | "orderCompleted_lib" | "extraDiscount" | "orderNumber" | "textPaymentBtn_lib" | "guestInfo" | "isDrawerOpen" | "currentState">, Pick<{
34
- statusWSCreate: Ref<null, null>;
38
+ createPaymentHandler: (context: PaymentContext, is_requestKiosk: boolean, is_tableservice: boolean, paymentMethodId?: string) => {
39
+ handler: any;
40
+ config: PaymentConfig;
41
+ } | null;
42
+ getCurrentPaymentMethodId: () => string | null;
43
+ getAvailablePaymentMethods: (context: PaymentContext) => string[];
44
+ }, "error" | "count" | "is_notification_lib" | "notificationData_lib" | "isButtonDisabled" | "orderCompleted_lib" | "extraDiscount" | "orderNumber" | "textPaymentBtn_lib" | "guestInfo" | "isDrawerOpen" | "currentState" | "discountBtn" | "linkQR" | "providerTypes" | "is_paymentCart" | "selectedProvider" | "configPayment" | "paymentCostQR">, Pick<{
35
45
  isButtonDisabled: Ref<boolean, boolean>;
36
46
  orderCompleted_lib: Ref<number | null, number | null>;
37
47
  extraDiscount: Ref<number, number>;
@@ -51,17 +61,27 @@ export declare const useCartStore: StoreDefinition<"cartLib", Pick<{
51
61
  isDrawerOpen: Ref<boolean, boolean>;
52
62
  currentState: Ref<"wait" | "success" | "not_found", "wait" | "success" | "not_found">;
53
63
  isAuthorized: ComputedRef<boolean>;
54
- orderSocket: (orderId: string, is_requestKiosk: boolean, is_tableservice?: boolean, signal?: AbortSignal) => void;
64
+ discountBtn: Ref<boolean, boolean>;
65
+ linkQR: Ref<string, string>;
66
+ providerTypes: Ref<any, any>;
67
+ is_paymentCart: Ref<boolean, boolean>;
68
+ selectedProvider: Ref<any, any>;
69
+ configPayment: Ref<PaymentConfig | undefined, PaymentConfig | undefined>;
70
+ paymentCostQR: Ref<number, number>;
55
71
  deleteCart: (path?: string | null, clearTokens?: boolean) => void;
56
- setGuestInfo: (info: any) => any;
72
+ setGuestInfo: (info: unknown) => void;
57
73
  setState: (state: "wait" | "success" | "not_found") => void;
58
74
  openDrawer: () => void;
59
75
  closeDrawer: () => void;
60
76
  clearCard: () => void;
61
- makeInitPaymentLinkRequest: (orderId: string, is_requestKiosk: boolean, is_tableservice?: boolean) => Promise<void>;
62
77
  showNotification: (message: string) => void;
78
+ createPaymentHandler: (context: PaymentContext, is_requestKiosk: boolean, is_tableservice: boolean, paymentMethodId?: string) => {
79
+ handler: any;
80
+ config: PaymentConfig;
81
+ } | null;
82
+ getCurrentPaymentMethodId: () => string | null;
83
+ getAvailablePaymentMethods: (context: PaymentContext) => string[];
63
84
  }, "isAuthorized">, Pick<{
64
- statusWSCreate: Ref<null, null>;
65
85
  isButtonDisabled: Ref<boolean, boolean>;
66
86
  orderCompleted_lib: Ref<number | null, number | null>;
67
87
  extraDiscount: Ref<number, number>;
@@ -81,13 +101,24 @@ export declare const useCartStore: StoreDefinition<"cartLib", Pick<{
81
101
  isDrawerOpen: Ref<boolean, boolean>;
82
102
  currentState: Ref<"wait" | "success" | "not_found", "wait" | "success" | "not_found">;
83
103
  isAuthorized: ComputedRef<boolean>;
84
- orderSocket: (orderId: string, is_requestKiosk: boolean, is_tableservice?: boolean, signal?: AbortSignal) => void;
104
+ discountBtn: Ref<boolean, boolean>;
105
+ linkQR: Ref<string, string>;
106
+ providerTypes: Ref<any, any>;
107
+ is_paymentCart: Ref<boolean, boolean>;
108
+ selectedProvider: Ref<any, any>;
109
+ configPayment: Ref<PaymentConfig | undefined, PaymentConfig | undefined>;
110
+ paymentCostQR: Ref<number, number>;
85
111
  deleteCart: (path?: string | null, clearTokens?: boolean) => void;
86
- setGuestInfo: (info: any) => any;
112
+ setGuestInfo: (info: unknown) => void;
87
113
  setState: (state: "wait" | "success" | "not_found") => void;
88
114
  openDrawer: () => void;
89
115
  closeDrawer: () => void;
90
116
  clearCard: () => void;
91
- makeInitPaymentLinkRequest: (orderId: string, is_requestKiosk: boolean, is_tableservice?: boolean) => Promise<void>;
92
117
  showNotification: (message: string) => void;
93
- }, "orderSocket" | "deleteCart" | "setGuestInfo" | "setState" | "openDrawer" | "closeDrawer" | "clearCard" | "makeInitPaymentLinkRequest" | "showNotification">>;
118
+ createPaymentHandler: (context: PaymentContext, is_requestKiosk: boolean, is_tableservice: boolean, paymentMethodId?: string) => {
119
+ handler: any;
120
+ config: PaymentConfig;
121
+ } | null;
122
+ getCurrentPaymentMethodId: () => string | null;
123
+ getAvailablePaymentMethods: (context: PaymentContext) => string[];
124
+ }, "deleteCart" | "setGuestInfo" | "setState" | "openDrawer" | "closeDrawer" | "clearCard" | "showNotification" | "createPaymentHandler" | "getCurrentPaymentMethodId" | "getAvailablePaymentMethods">>;
@@ -19,6 +19,7 @@ export declare const useThemeStore: StoreDefinition<"themeLib", Pick<{
19
19
  splash_image_url: string | null;
20
20
  splash_video: string | null;
21
21
  splash_duration: 0;
22
+ kiosk_qr_payment_timeout: number | null;
22
23
  splash_type: string | null;
23
24
  fallback_image: string | null;
24
25
  adult_disclaimer_text: string | null;
@@ -67,6 +68,7 @@ export declare const useThemeStore: StoreDefinition<"themeLib", Pick<{
67
68
  splash_image_url: string | null;
68
69
  splash_video: string | null;
69
70
  splash_duration: 0;
71
+ kiosk_qr_payment_timeout: number | null;
70
72
  splash_type: string | null;
71
73
  fallback_image: string | null;
72
74
  adult_disclaimer_text: string | null;
@@ -116,6 +118,7 @@ export declare const useThemeStore: StoreDefinition<"themeLib", Pick<{
116
118
  splash_image_url: string | null;
117
119
  splash_video: string | null;
118
120
  splash_duration: 0;
121
+ kiosk_qr_payment_timeout: number | null;
119
122
  splash_type: string | null;
120
123
  fallback_image: string | null;
121
124
  adult_disclaimer_text: string | null;
@@ -166,6 +169,7 @@ export declare const useThemeStore: StoreDefinition<"themeLib", Pick<{
166
169
  splash_image_url: string | null;
167
170
  splash_video: string | null;
168
171
  splash_duration: 0;
172
+ kiosk_qr_payment_timeout: number | null;
169
173
  splash_type: string | null;
170
174
  fallback_image: string | null;
171
175
  adult_disclaimer_text: string | null;
@@ -214,6 +218,7 @@ export declare const useThemeStore: StoreDefinition<"themeLib", Pick<{
214
218
  splash_image_url: string | null;
215
219
  splash_video: string | null;
216
220
  splash_duration: 0;
221
+ kiosk_qr_payment_timeout: number | null;
217
222
  splash_type: string | null;
218
223
  fallback_image: string | null;
219
224
  adult_disclaimer_text: string | null;
@@ -263,6 +268,7 @@ export declare const useThemeStore: StoreDefinition<"themeLib", Pick<{
263
268
  splash_image_url: string | null;
264
269
  splash_video: string | null;
265
270
  splash_duration: 0;
271
+ kiosk_qr_payment_timeout: number | null;
266
272
  splash_type: string | null;
267
273
  fallback_image: string | null;
268
274
  adult_disclaimer_text: string | null;
@@ -313,6 +319,7 @@ export declare const useThemeStore: StoreDefinition<"themeLib", Pick<{
313
319
  splash_image_url: string | null;
314
320
  splash_video: string | null;
315
321
  splash_duration: 0;
322
+ kiosk_qr_payment_timeout: number | null;
316
323
  splash_type: string | null;
317
324
  fallback_image: string | null;
318
325
  adult_disclaimer_text: string | null;
@@ -361,6 +368,7 @@ export declare const useThemeStore: StoreDefinition<"themeLib", Pick<{
361
368
  splash_image_url: string | null;
362
369
  splash_video: string | null;
363
370
  splash_duration: 0;
371
+ kiosk_qr_payment_timeout: number | null;
364
372
  splash_type: string | null;
365
373
  fallback_image: string | null;
366
374
  adult_disclaimer_text: string | null;
@@ -410,6 +418,7 @@ export declare const useThemeStore: StoreDefinition<"themeLib", Pick<{
410
418
  splash_image_url: string | null;
411
419
  splash_video: string | null;
412
420
  splash_duration: 0;
421
+ kiosk_qr_payment_timeout: number | null;
413
422
  splash_type: string | null;
414
423
  fallback_image: string | null;
415
424
  adult_disclaimer_text: string | null;
@@ -15,6 +15,7 @@ export interface ITheme {
15
15
  splash_image_url: string | null;
16
16
  splash_video: string | null;
17
17
  splash_duration: 0;
18
+ kiosk_qr_payment_timeout: number | null;
18
19
  splash_type: string | null;
19
20
  fallback_image: string | null;
20
21
  adult_disclaimer_text: string | null;
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Типы методов оплаты
3
+ */
4
+ export type PaymentMethod = 'SBP' | 'YOOKASSA' | 'TERMINAL';
5
+ /**
6
+ * Типы контекстов (режимов работы)
7
+ */
8
+ export type PaymentContext = 'kiosk' | 'qr' | 'tableservice';
9
+ export interface PaymentHandler {
10
+ /**
11
+ * Обработка статусов WebSocket для конкретного метода оплаты
12
+ * @param data - Данные из WebSocket
13
+ * @param config - Конфигурация платежа
14
+ */
15
+ handleWebSocketStatus(data: any, config: PaymentConfig): void;
16
+ }
17
+ export interface PaymentMethodConfig {
18
+ id: string;
19
+ method: PaymentMethod;
20
+ availableContexts: PaymentContext[];
21
+ handlerFactory: () => PaymentHandler;
22
+ }
23
+ /** Интерфейс оплаты */
24
+ export interface PaymentConfig {
25
+ context: PaymentContext;
26
+ method: PaymentMethod;
27
+ is_requestKiosk: boolean;
28
+ is_tableservice: boolean;
29
+ showNotification: (message: string) => void;
30
+ deleteCart: (path: string | null, clearTokens: boolean) => void;
31
+ resetStores: () => void;
32
+ redirect?: (path: string) => void;
33
+ updateOrderStatus?: (status: number | null) => void;
34
+ setOrderNumber?: (number: number) => void;
35
+ loadCart?: () => void;
36
+ resetBonuses?: () => void;
37
+ ws?: any;
38
+ router?: any;
39
+ route?: any;
40
+ orderErrors?: string[];
41
+ errorHandler?: PaymentErrorHandler;
42
+ cartCleanup: CartCleanupService;
43
+ navigation?: PaymentNavigationService;
44
+ closeWebSocket?: () => void;
45
+ area?: string;
46
+ has_rms_discount?: boolean;
47
+ totalPrice?: any;
48
+ initialCartPrice?: any;
49
+ signal?: AbortSignal;
50
+ }
51
+ /**
52
+ * Конфигурация для создания заказа и открытия WebSocket.
53
+ * Заказ создаётся в basePaymentHandler, сокет открывается только внутри handler.processPayment.
54
+ */
55
+ export interface CreateOrderAndOpenSocketConfig extends PaymentConfig {
56
+ route: {
57
+ params: {
58
+ orgId: string;
59
+ };
60
+ };
61
+ handler: PaymentHandler;
62
+ setButtonDisabled: (value: boolean) => void;
63
+ /** Вызывается при 403 в режиме киоска (очистка apiKey, показ экрана ввода ключа) */
64
+ on403Kiosk?: () => void;
65
+ }
66
+ /** Интерфейс ошибки */
67
+ export interface PaymentErrorHandler {
68
+ /**
69
+ * Обработка ошибки платежа
70
+ * @param error - Ошибка
71
+ * @param config - Конфигурация платежа
72
+ */
73
+ handlePaymentError(error: any, config: PaymentConfig): void;
74
+ /**
75
+ * Обработка ошибки оплаты заказа
76
+ * @param error - Ошибка
77
+ * @param config - Конфигурация платежа
78
+ */
79
+ handleOrderPayError(error: any, config: PaymentConfig): void;
80
+ /**
81
+ * Обработка ошибки заказа
82
+ * @param status - Статус ошибки
83
+ * @param config - Конфигурация платежа
84
+ */
85
+ handleOrderError(config: PaymentConfig): void;
86
+ /**
87
+ * Обработка ошибки создания заказа: редиректы, уведомления, очистка корзины
88
+ * @param error - Ошибка
89
+ * @param config - Конфигурация создания заказа
90
+ */
91
+ handleCreateOrderError(error: any, config: CreateOrderAndOpenSocketConfig): void;
92
+ }
93
+ /**
94
+ * Интерфейс для сервиса очистки корзины
95
+ */
96
+ export interface CartCleanupService {
97
+ /**
98
+ * Очистка корзины и навигация
99
+ * @param path - Путь для навигации (null для отсутствия навигации)
100
+ * @param clearTokens - Очищать ли токены авторизации
101
+ */
102
+ cleanupAndNavigate(path: string | null, clearTokens: boolean): void;
103
+ /**
104
+ * Очистка корзины без навигации
105
+ * @param clearTokens - Очищать ли токены авторизации
106
+ */
107
+ cleanup(clearTokens: boolean): void;
108
+ /** Очистка токенов авторизации */
109
+ clearTokens(): void;
110
+ /** Сброс состояния сторов */
111
+ resetStores(): void;
112
+ }
113
+ /** Интерфейс для сервиса навигации */
114
+ export interface PaymentNavigationService {
115
+ redirectToError(): void;
116
+ /**
117
+ * Редирект на страницу успеха
118
+ * @param path - Дополнительный путь
119
+ */
120
+ redirectToSuccess(path?: string): void;
121
+ /**
122
+ * Редирект на указанный путь
123
+ * @param path - Путь для редиректа
124
+ */
125
+ redirect(path: string): void;
126
+ /**
127
+ * Получение пути для страницы ошибки
128
+ */
129
+ getErrorPath(): string;
130
+ /**
131
+ * Получение пути для страницы успеха
132
+ */
133
+ getSuccessPath(): string;
134
+ }
@@ -0,0 +1,3 @@
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ declare const _default: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
3
+ export default _default;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@inno_user/inno_clouds_lib",
3
3
  "private": false,
4
- "version": "9.1.11",
4
+ "version": "9.2.0",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"
@@ -60,6 +60,7 @@
60
60
  "jwt-decode": "^4.0.0",
61
61
  "p-limit": "^7.2.0",
62
62
  "pinia": "^3.0.3",
63
+ "qrcode.vue": "^3.6.0",
63
64
  "qrious": "^4.0.2",
64
65
  "tinycolor2": "^1.6.0",
65
66
  "virtua": "^0.48.2",