@tossplace/pos-plugin-sdk 0.0.16 → 0.0.17
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/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/sdk.d.ts +123 -194
- package/package.json +1 -1
- package/types/index.d.ts +123 -181
package/types/index.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { WebView } from '@tossplace-nexus/pos-webview';
|
|
2
|
-
|
|
3
1
|
declare type AllPaymentCreateDto = PluginCardDto | PluginCashDto | PluginExternalDto;
|
|
4
2
|
|
|
5
3
|
declare const AvailableLanguageCodes: {
|
|
@@ -75,14 +73,9 @@ export declare interface Catalog {
|
|
|
75
73
|
getCatalog: (catalogId: number) => Promise<PluginCatalogItem>;
|
|
76
74
|
getCatalogs: () => Promise<PluginCatalogItem[]>;
|
|
77
75
|
on(event: 'update' | 'add' | 'delete', callback: CatalogEventCallback): void;
|
|
78
|
-
/**
|
|
79
|
-
* @deprecated 다음 버전에서 제거 예정입니다
|
|
80
|
-
*/
|
|
81
|
-
on(event: 'sold-out' | 'on-sale', callback: CatalogEventCallback): void;
|
|
82
|
-
on(event: 'sold-out' | 'on-sale' | 'update' | 'add' | 'delete', callback: CatalogEventCallback): void;
|
|
83
76
|
}
|
|
84
77
|
|
|
85
|
-
declare type CatalogEventCallback = (
|
|
78
|
+
declare type CatalogEventCallback = (id: PluginCatalogItem['id']) => void;
|
|
86
79
|
|
|
87
80
|
/**
|
|
88
81
|
* @publicApi
|
|
@@ -95,7 +88,7 @@ export declare type CatalogItemOptionChoiceState = 'ON_SALE' | 'SOLD_OUT';
|
|
|
95
88
|
export declare interface CategoryTypes {
|
|
96
89
|
getCategories: () => Promise<PluginCatalogCategory[]>;
|
|
97
90
|
getCategory: (categoryId: number) => Promise<PluginCatalogCategory>;
|
|
98
|
-
on: (event: 'update' | 'add' | 'delete', callback: (category: PluginCatalogCategory) => void) => void;
|
|
91
|
+
on: (event: 'update' | 'add' | 'delete', callback: (category: PluginCatalogCategory['id']) => void) => void;
|
|
99
92
|
}
|
|
100
93
|
|
|
101
94
|
/**
|
|
@@ -112,6 +105,12 @@ declare type CheckBoxInput = Omit<BaseInput, 'placeholder'> & {
|
|
|
112
105
|
values: InputValue[];
|
|
113
106
|
};
|
|
114
107
|
|
|
108
|
+
/**
|
|
109
|
+
* @publicApi
|
|
110
|
+
* @param length
|
|
111
|
+
*/
|
|
112
|
+
export declare function createCallbackId(length?: number): string;
|
|
113
|
+
|
|
115
114
|
/**
|
|
116
115
|
* @publicApi
|
|
117
116
|
*/
|
|
@@ -151,7 +150,7 @@ export declare interface DeliveryCatalogOption {
|
|
|
151
150
|
/**
|
|
152
151
|
* @publicApi
|
|
153
152
|
*/
|
|
154
|
-
export declare type DeliveryConnectionStatusErrorCode = 'NOT_RUNNING' | 'NOT_LOGGED_IN' | 'UNKNOWN' | 'BAEMIN_NOT_SELECTED_PROGRAM';
|
|
153
|
+
export declare type DeliveryConnectionStatusErrorCode = 'NOT_RUNNING' | 'NOT_LOGGED_IN' | 'UNKNOWN' | 'BAEMIN_NOT_SELECTED_PROGRAM' | string;
|
|
155
154
|
|
|
156
155
|
/**
|
|
157
156
|
* @publicApi
|
|
@@ -245,6 +244,7 @@ declare type Digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';
|
|
|
245
244
|
* @publicApi
|
|
246
245
|
*/
|
|
247
246
|
export declare interface DraftOrder {
|
|
247
|
+
on(event: 'update', callback: (draftOrder: PluginDraftOrder) => void): void;
|
|
248
248
|
clear(): Promise<void>;
|
|
249
249
|
get(): Promise<PluginDraftOrder>;
|
|
250
250
|
addLineItem(lineItem: PluginDraftOrderItemDto): Promise<PluginDraftOrder>;
|
|
@@ -258,88 +258,33 @@ export declare interface DraftOrder {
|
|
|
258
258
|
startPayment(): Promise<void>;
|
|
259
259
|
}
|
|
260
260
|
|
|
261
|
-
declare type Element_2 = BarcodeElements | InputElements;
|
|
262
|
-
|
|
263
|
-
declare class ErrorImpl {
|
|
264
|
-
private readonly webview;
|
|
265
|
-
constructor(webview: WebView);
|
|
266
|
-
addErrorListener(handler: (error: Error) => void): void;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
261
|
/**
|
|
270
262
|
* @publicApi
|
|
271
263
|
*/
|
|
272
|
-
declare
|
|
264
|
+
export declare const draftOrder: DraftOrderImpl;
|
|
273
265
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
return: FFIFunctionReturn;
|
|
289
|
-
options?: FFIFunctionOptions;
|
|
290
|
-
returnData?: any;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* @publicApi
|
|
295
|
-
*/
|
|
296
|
-
declare interface FFIFunctionOptions {
|
|
297
|
-
/**
|
|
298
|
-
* Application Binary Interface
|
|
299
|
-
* - 응용 프로그램 바이너리 인터페이스: 컴파일된 프로그램 모듈들이 바이너리 수준에서 상호작용하는 방식을 정의하는 인터페이스
|
|
300
|
-
*/
|
|
301
|
-
abi?: FFIAbiType;
|
|
266
|
+
declare class DraftOrderImpl implements DraftOrder {
|
|
267
|
+
constructor();
|
|
268
|
+
on(event: 'update', callback: (draftOrder: PluginDraftOrder) => void): void;
|
|
269
|
+
deleteDiscount(indexOfDiscount: number): Promise<PluginDraftOrder>;
|
|
270
|
+
updateItemOptionChoice(itemKey: string, choices: PluginCatalogItemOptionChoice[]): Promise<PluginDraftOrder>;
|
|
271
|
+
updateItemMemo(itemKey: string, memo: string): Promise<PluginDraftOrder>;
|
|
272
|
+
updateIgnorePrint(ignorePrint: boolean): Promise<PluginDraftOrder>;
|
|
273
|
+
deleteItemDiscount(itemKey: string, indexOfDiscount: number): Promise<PluginDraftOrder>;
|
|
274
|
+
clear(): Promise<void>;
|
|
275
|
+
get(): Promise<PluginDraftOrder>;
|
|
276
|
+
addLineItem(lineItem: PluginDraftOrderItemDto): Promise<PluginDraftOrder>;
|
|
277
|
+
deleteLineItem(key: string): Promise<PluginDraftOrder>;
|
|
278
|
+
startPayment(): Promise<void>;
|
|
279
|
+
updateItemQuantity(itemKey: string, quantity: number): Promise<PluginDraftOrder>;
|
|
302
280
|
}
|
|
303
281
|
|
|
304
|
-
|
|
305
|
-
* @publicApi
|
|
306
|
-
*/
|
|
307
|
-
declare type FFIFunctionParam = {
|
|
308
|
-
type: 'str';
|
|
309
|
-
} | {
|
|
310
|
-
type: 'int';
|
|
311
|
-
} | {
|
|
312
|
-
type: 'bool';
|
|
313
|
-
} | {
|
|
314
|
-
type: 'wchar *';
|
|
315
|
-
} | {
|
|
316
|
-
type: 'callback';
|
|
317
|
-
};
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
* @publicApi
|
|
321
|
-
*/
|
|
322
|
-
declare type FFIFunctionReturn = 'void' | 'str' | 'int' | 'bool' | 'wchar *' | 'void *';
|
|
282
|
+
declare type Element_2 = BarcodeElements | InputElements;
|
|
323
283
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
*/
|
|
327
|
-
export declare interface FFITypes {
|
|
328
|
-
download: (downloadInfo: FFIDownloadInfo) => Promise<{
|
|
329
|
-
platform: keyof FFIDownloadInfo;
|
|
330
|
-
}>;
|
|
331
|
-
load: (filePath: string, apis: FFIApi[]) => Promise<void>;
|
|
332
|
-
unload: (filePath: string) => Promise<void>;
|
|
333
|
-
invoke: (filePath: string, apiName: string, params?: any[]) => Promise<any>;
|
|
334
|
-
registerCallback: (filePath: string, signature: FFIFunction, callback: (...args: any[]) => any) => Promise<{
|
|
335
|
-
ffiCallbackId: string;
|
|
336
|
-
}>;
|
|
337
|
-
unregisterCallback: (filePath: string, callbackId: string) => Promise<void>;
|
|
338
|
-
addCallbackErrorHandler: (filePath: string, handler: (error: Error) => void) => void;
|
|
284
|
+
declare class ErrorImpl {
|
|
285
|
+
addErrorListener(handler: (error: Error) => void): void;
|
|
339
286
|
}
|
|
340
287
|
|
|
341
|
-
declare function getValues<T extends Record<string, number | string | string[] | boolean | undefined>>(): Promise<T>;
|
|
342
|
-
|
|
343
288
|
declare type HereOrder = Order_2 & {
|
|
344
289
|
type: 'HERE';
|
|
345
290
|
memo: {
|
|
@@ -354,23 +299,28 @@ declare type HereOrder = Order_2 & {
|
|
|
354
299
|
*/
|
|
355
300
|
export declare type HttpMethod = 'GET' | 'POST' | 'DELETE' | 'HEAD' | 'OPTIONS' | 'PUT' | 'PATCH';
|
|
356
301
|
|
|
302
|
+
declare interface HttpOption {
|
|
303
|
+
timeoutMs?: number;
|
|
304
|
+
}
|
|
305
|
+
|
|
357
306
|
declare interface HttpRequest {
|
|
358
307
|
method: HttpMethod;
|
|
359
308
|
payload?: string;
|
|
360
309
|
headers: [string, string][];
|
|
310
|
+
timeoutMs?: number;
|
|
361
311
|
}
|
|
362
312
|
|
|
363
313
|
/**
|
|
364
314
|
* @publicApi
|
|
365
315
|
*/
|
|
366
316
|
export declare interface HttpTypes {
|
|
367
|
-
get: (url: string, headers?: [string, string][]) => Promise<PluginHttpResponse>;
|
|
368
|
-
post: (url: string, payload: any, headers?: [string, string][]) => Promise<PluginHttpResponse>;
|
|
369
|
-
delete: (url: string, headers?: [string, string][]) => Promise<PluginHttpResponse>;
|
|
370
|
-
head: (url: string, headers?: [string, string][]) => Promise<PluginHttpResponse>;
|
|
371
|
-
options: (url: string, headers?: [string, string][]) => Promise<PluginHttpResponse>;
|
|
372
|
-
put: (url: string, payload: any, headers?: [string, string][]) => Promise<PluginHttpResponse>;
|
|
373
|
-
patch: (url: string, payload: any, headers?: [string, string][]) => Promise<PluginHttpResponse>;
|
|
317
|
+
get: (url: string, headers?: [string, string][], options?: HttpOption) => Promise<PluginHttpResponse>;
|
|
318
|
+
post: (url: string, payload: any, headers?: [string, string][], options?: HttpOption) => Promise<PluginHttpResponse>;
|
|
319
|
+
delete: (url: string, headers?: [string, string][], options?: HttpOption) => Promise<PluginHttpResponse>;
|
|
320
|
+
head: (url: string, headers?: [string, string][], options?: HttpOption) => Promise<PluginHttpResponse>;
|
|
321
|
+
options: (url: string, headers?: [string, string][], options?: HttpOption) => Promise<PluginHttpResponse>;
|
|
322
|
+
put: (url: string, payload: any, headers?: [string, string][], options?: HttpOption) => Promise<PluginHttpResponse>;
|
|
323
|
+
patch: (url: string, payload: any, headers?: [string, string][], options?: HttpOption) => Promise<PluginHttpResponse>;
|
|
374
324
|
}
|
|
375
325
|
|
|
376
326
|
declare type InputElements = {
|
|
@@ -417,12 +367,7 @@ declare type Languages = Record<PluginLanguageCode, string>;
|
|
|
417
367
|
export declare interface MenuOption {
|
|
418
368
|
getOptions: () => Promise<PluginCatalogItemOption[]>;
|
|
419
369
|
getOption: (optionId: number) => Promise<PluginCatalogItemOption>;
|
|
420
|
-
|
|
421
|
-
* @deprecated 다음 버전에서 제거 예정입니다
|
|
422
|
-
*/
|
|
423
|
-
on(event: 'sold-out' | 'on-sale', callback: (option: PluginCatalogItemOption) => void): void;
|
|
424
|
-
on(event: 'update' | 'add' | 'delete', callback: (option: PluginCatalogItemOption) => void): void;
|
|
425
|
-
on(event: 'sold-out' | 'on-sale' | 'update' | 'add' | 'delete', callback: (option: PluginCatalogItemOption) => void): void;
|
|
370
|
+
on(event: 'update' | 'add' | 'delete', callback: (id: PluginCatalogItemOption['id']) => void): void;
|
|
426
371
|
}
|
|
427
372
|
|
|
428
373
|
/**
|
|
@@ -440,28 +385,6 @@ export declare interface Merchant {
|
|
|
440
385
|
getMerchant: () => Promise<TossMerchant>;
|
|
441
386
|
}
|
|
442
387
|
|
|
443
|
-
/**
|
|
444
|
-
* @publicApi
|
|
445
|
-
*/
|
|
446
|
-
export declare interface Navigation {
|
|
447
|
-
navigate(page: 'plugin-tab', packageName?: string): void;
|
|
448
|
-
navigate(page: 'business-type-setting'): void;
|
|
449
|
-
/**
|
|
450
|
-
* 포스에서 페이지를 이동합니다.
|
|
451
|
-
* @param page business-type-setting 업종유형 변경, plugin-tab 플러그인 탭 이동
|
|
452
|
-
* @param packageName 이동할 탭의 이름, 없는 경우 첫번째 플러그인 탭으로 이동합니다
|
|
453
|
-
*/
|
|
454
|
-
navigate(page: 'business-type-setting' | 'plugin-tab', packageName?: string): void;
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
/**
|
|
458
|
-
* @publicApi
|
|
459
|
-
*/
|
|
460
|
-
export declare class NavigationImpl implements Navigation {
|
|
461
|
-
navigate(page: 'plugin-tab', packageName?: string): void;
|
|
462
|
-
navigate(page: 'business-type-setting'): void;
|
|
463
|
-
}
|
|
464
|
-
|
|
465
388
|
/**
|
|
466
389
|
* @publicApi
|
|
467
390
|
* @return number
|
|
@@ -500,10 +423,7 @@ export declare interface Order {
|
|
|
500
423
|
size?: number;
|
|
501
424
|
orderStates?: PluginOrderState[];
|
|
502
425
|
}) => Promise<PluginOrder[]>;
|
|
503
|
-
|
|
504
|
-
* @deprecated
|
|
505
|
-
*/
|
|
506
|
-
on(event: 'cancel', callback: (order: PluginOrder) => void): void;
|
|
426
|
+
on(event: 'add' | 'accept' | 'decline' | 'expire' | 'complete' | 'update', callback: (order: PluginOrder['id']) => void): void;
|
|
507
427
|
cancel: (id: string) => Promise<void>;
|
|
508
428
|
add: (order: PluginOrderDto) => Promise<PluginOrder>;
|
|
509
429
|
/**
|
|
@@ -555,7 +475,7 @@ declare type Order_2 = {
|
|
|
555
475
|
customerChargedPrice: number;
|
|
556
476
|
};
|
|
557
477
|
|
|
558
|
-
declare type OrderItemType = 'ITEM' | 'DELIVERY_FEE' | 'PREPAID_CARD' | 'MULTI_USE_TICKET';
|
|
478
|
+
declare type OrderItemType = 'ITEM' | 'DELIVERY_FEE' | 'PREPAID_CARD' | 'MULTI_USE_TICKET' | 'COMBO' | 'GIFT_CARD';
|
|
559
479
|
|
|
560
480
|
/**
|
|
561
481
|
* @publicApi
|
|
@@ -585,7 +505,7 @@ export declare interface Payment {
|
|
|
585
505
|
getPayment: (paymentId: PluginPayment['id']) => Promise<PluginPayment>;
|
|
586
506
|
}
|
|
587
507
|
|
|
588
|
-
declare type PaymentCallback = (
|
|
508
|
+
declare type PaymentCallback = (paymentId: PluginPayment['id'], orderId: PluginOrder['id']) => void;
|
|
589
509
|
|
|
590
510
|
/**
|
|
591
511
|
* @publicApi
|
|
@@ -647,7 +567,6 @@ export declare const plugin: PluginImpl;
|
|
|
647
567
|
* @publicApi
|
|
648
568
|
*/
|
|
649
569
|
declare interface Plugin_2 {
|
|
650
|
-
on(event: 'close', callback: () => Promise<void>): void;
|
|
651
570
|
getPluginInfo(): Promise<{
|
|
652
571
|
name: string;
|
|
653
572
|
version: string;
|
|
@@ -888,10 +807,14 @@ export declare interface PluginCatalogItemOption {
|
|
|
888
807
|
title: string;
|
|
889
808
|
titleI18n?: PluginLanguagePack;
|
|
890
809
|
isRequired: boolean;
|
|
810
|
+
/**
|
|
811
|
+
* 토스 포스에서 최소 수량은 선택 불가능하며 필수선택 여부에 따라 0 또는 1로 내려옴
|
|
812
|
+
* 0 - 필수아님
|
|
813
|
+
* 1 - 필수
|
|
814
|
+
*/
|
|
891
815
|
minChoices: number;
|
|
892
816
|
/**
|
|
893
817
|
* 최대로 선택가능한 선택 수
|
|
894
|
-
* -1인 경우 무제한 선택이 가능합니다.
|
|
895
818
|
*/
|
|
896
819
|
maxChoices: number;
|
|
897
820
|
choices: PluginCatalogItemOptionChoice[];
|
|
@@ -1008,15 +931,21 @@ export declare interface PluginDeliveryDiscount extends PluginDiscount {
|
|
|
1008
931
|
* @publicApi
|
|
1009
932
|
* @description order를 만들기 위한 dto
|
|
1010
933
|
*/
|
|
1011
|
-
export declare type
|
|
934
|
+
export declare type PluginDeliveryOrderDtoV2 = Omit<PluginOrderDto, 'lineItems' | 'discounts'> & {
|
|
1012
935
|
cancelled: boolean;
|
|
1013
936
|
delivery: PluginDelivery<'DELIVERY' | 'PICKUP' | 'HERE'>;
|
|
1014
937
|
discounts: Array<PluginDeliveryDiscount>;
|
|
1015
|
-
lineItems: Array<Omit<PluginOrderItem, 'id' | 'orderId' | 'item' | 'optionChoices' | 'discounts'> & {
|
|
938
|
+
lineItems: Array<Omit<PluginOrderItem, 'id' | 'orderId' | 'item' | 'optionChoices' | 'discounts' | 'chargePrice'> & {
|
|
1016
939
|
item: {
|
|
1017
940
|
title: string;
|
|
1018
941
|
type: 'ITEM' | 'DELIVERY_FEE';
|
|
1019
942
|
};
|
|
943
|
+
/**
|
|
944
|
+
* @description 옵션,할인을 제외한 메뉴 1개의 단일 가격
|
|
945
|
+
*/
|
|
946
|
+
itemPrice: {
|
|
947
|
+
value: number;
|
|
948
|
+
};
|
|
1020
949
|
optionChoices: Array<{
|
|
1021
950
|
title: string;
|
|
1022
951
|
priceValue: number;
|
|
@@ -1024,6 +953,9 @@ export declare type PluginDeliveryOrderDto = Omit<PluginOrderDto, 'lineItems' |
|
|
|
1024
953
|
}>;
|
|
1025
954
|
discounts?: Array<PluginDeliveryDiscount>;
|
|
1026
955
|
}>;
|
|
956
|
+
metadata?: {
|
|
957
|
+
bmpc?: boolean;
|
|
958
|
+
};
|
|
1027
959
|
};
|
|
1028
960
|
|
|
1029
961
|
/**
|
|
@@ -1190,12 +1122,8 @@ export declare type PluginHttpResponse = {
|
|
|
1190
1122
|
};
|
|
1191
1123
|
|
|
1192
1124
|
declare class PluginImpl implements Plugin_2 {
|
|
1193
|
-
|
|
1194
|
-
private plugin;
|
|
1195
|
-
private pluginCallbacks;
|
|
1196
|
-
constructor(webview: WebView);
|
|
1125
|
+
constructor();
|
|
1197
1126
|
private initializePlugin;
|
|
1198
|
-
on(event: 'close', callback: () => Promise<void>): void;
|
|
1199
1127
|
getPluginInfo(): Promise<{
|
|
1200
1128
|
name: string;
|
|
1201
1129
|
version: string;
|
|
@@ -1218,26 +1146,6 @@ export declare interface PluginLanguagePack {
|
|
|
1218
1146
|
languages: Partial<Languages>;
|
|
1219
1147
|
}
|
|
1220
1148
|
|
|
1221
|
-
/**
|
|
1222
|
-
* @publicApi
|
|
1223
|
-
*/
|
|
1224
|
-
export declare interface PluginMessenger {
|
|
1225
|
-
broadcast<T = any>(message: T): void;
|
|
1226
|
-
on<T = any>(event: 'message', callback: (message: T) => void): void;
|
|
1227
|
-
}
|
|
1228
|
-
|
|
1229
|
-
/**
|
|
1230
|
-
* @publicApi
|
|
1231
|
-
*/
|
|
1232
|
-
export declare const pluginMessenger: PluginMessengerImpl;
|
|
1233
|
-
|
|
1234
|
-
declare class PluginMessengerImpl implements PluginMessenger {
|
|
1235
|
-
private readonly webview;
|
|
1236
|
-
constructor(webview: WebView);
|
|
1237
|
-
broadcast<T = any>(message: T): void;
|
|
1238
|
-
on<T = any>(event: 'message', callback: (message: T) => void): void;
|
|
1239
|
-
}
|
|
1240
|
-
|
|
1241
1149
|
/**
|
|
1242
1150
|
* @publicApi
|
|
1243
1151
|
* @description pluginOrder orderDto를 서버에 저장 후 가공해서 내려 준 값
|
|
@@ -1263,6 +1171,11 @@ export declare interface PluginOrder {
|
|
|
1263
1171
|
paymentPrice: PluginOrderPaymentPrice;
|
|
1264
1172
|
requestedInfo?: PluginOrderRequestInfo;
|
|
1265
1173
|
source: string;
|
|
1174
|
+
channel: {
|
|
1175
|
+
source: string;
|
|
1176
|
+
/** @memo 생성할 때 source를 넣고 groups를 따로 명시하지 않으면, groups는 source로부터 유도되어 채워집니다 */
|
|
1177
|
+
groups: PluginOrderGroup[];
|
|
1178
|
+
};
|
|
1266
1179
|
/** 해당 주문의 테이블 인원 수 */
|
|
1267
1180
|
numGuests?: number;
|
|
1268
1181
|
memo?: string;
|
|
@@ -1319,8 +1232,16 @@ export declare type PluginOrderDto = {
|
|
|
1319
1232
|
discounts: PluginDiscount[];
|
|
1320
1233
|
tableId?: number;
|
|
1321
1234
|
lineItems: PluginOrderItemDto[];
|
|
1235
|
+
channel?: {
|
|
1236
|
+
/**
|
|
1237
|
+
* 주문의 타입을 지정합니다 아무것도 지정되지 않을 경우 POS로 간주됩니다.
|
|
1238
|
+
*/
|
|
1239
|
+
groups: PluginOrderGroup[];
|
|
1240
|
+
};
|
|
1322
1241
|
};
|
|
1323
1242
|
|
|
1243
|
+
declare type PluginOrderGroup = 'POS' | 'KIOSK' | 'DELIVERY' | 'TABLE_ORDER' | 'MOBILE_ORDER';
|
|
1244
|
+
|
|
1324
1245
|
/**
|
|
1325
1246
|
* @publicApi
|
|
1326
1247
|
*/
|
|
@@ -1335,7 +1256,7 @@ export declare interface PluginOrderItem {
|
|
|
1335
1256
|
value: number;
|
|
1336
1257
|
};
|
|
1337
1258
|
/**
|
|
1338
|
-
* @description 실제 고객이 결제하는 금액에 대한 정보입니다. (할인 적용 금액)
|
|
1259
|
+
* @description 실제 고객이 결제하는 금액에 대한 정보입니다. (할인 적용 금액 + 옵션합산금액)
|
|
1339
1260
|
*/
|
|
1340
1261
|
chargePrice: {
|
|
1341
1262
|
value: number;
|
|
@@ -1376,6 +1297,7 @@ declare interface PluginOrderItemItemOptionChoiceDto {
|
|
|
1376
1297
|
}
|
|
1377
1298
|
|
|
1378
1299
|
/**
|
|
1300
|
+
* @publicApi
|
|
1379
1301
|
* 주문항목 옵션 선택
|
|
1380
1302
|
*/
|
|
1381
1303
|
declare interface PluginOrderItemOptionChoice extends PluginCatalogItemOptionChoice {
|
|
@@ -1610,6 +1532,7 @@ export declare type PosPluginSdk = {
|
|
|
1610
1532
|
catalog: Catalog;
|
|
1611
1533
|
option: MenuOption;
|
|
1612
1534
|
storage: StorageTypes;
|
|
1535
|
+
secureStore: SecureStore;
|
|
1613
1536
|
cashReceipt: CashReceiptTypes;
|
|
1614
1537
|
order: Order;
|
|
1615
1538
|
payment: Payment;
|
|
@@ -1619,14 +1542,12 @@ export declare type PosPluginSdk = {
|
|
|
1619
1542
|
merchant: Merchant;
|
|
1620
1543
|
paymentMethod: PaymentMethodType;
|
|
1621
1544
|
websocket: WebsocketTypes;
|
|
1622
|
-
ffi: FFITypes;
|
|
1623
1545
|
barcode: Barcode;
|
|
1624
1546
|
plugin: Plugin_2;
|
|
1625
|
-
pluginMessenger: PluginMessenger;
|
|
1626
1547
|
setting: SettingTypes;
|
|
1627
1548
|
draftOrder: DraftOrder;
|
|
1628
|
-
navigation: Navigation;
|
|
1629
1549
|
error: ErrorImpl;
|
|
1550
|
+
powerSaver: PowerSaverTypes;
|
|
1630
1551
|
};
|
|
1631
1552
|
|
|
1632
1553
|
/**
|
|
@@ -1650,6 +1571,24 @@ export declare class PosPluginSdkRateLimitError extends PosPluginSdkError {
|
|
|
1650
1571
|
static isPosPluginSdkRateLimitError(error: unknown): error is PosPluginSdkRateLimitError;
|
|
1651
1572
|
}
|
|
1652
1573
|
|
|
1574
|
+
/**
|
|
1575
|
+
* @publicApi
|
|
1576
|
+
*/
|
|
1577
|
+
export declare type PowerSaverTypes = {
|
|
1578
|
+
/**
|
|
1579
|
+
* 절전모드 방지를 시작합니다.
|
|
1580
|
+
*/
|
|
1581
|
+
startBlocking(): Promise<void>;
|
|
1582
|
+
/**
|
|
1583
|
+
* 절전모드 방지를 해제합니다.
|
|
1584
|
+
*/
|
|
1585
|
+
stopBlocking(): Promise<void>;
|
|
1586
|
+
/**
|
|
1587
|
+
* 절전모드 방지가 활성화 상태인지 확인합니다.
|
|
1588
|
+
*/
|
|
1589
|
+
isBlocked(): Promise<boolean>;
|
|
1590
|
+
};
|
|
1591
|
+
|
|
1653
1592
|
/**
|
|
1654
1593
|
* @publicApi
|
|
1655
1594
|
* @return string values.id
|
|
@@ -1665,17 +1604,22 @@ declare type RadioInput = Omit<BaseInput, 'placeholder'> & {
|
|
|
1665
1604
|
|
|
1666
1605
|
declare type Response_2 = BarcodeResponse | InputResponse;
|
|
1667
1606
|
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1607
|
+
/**
|
|
1608
|
+
* @publicApi
|
|
1609
|
+
*/
|
|
1610
|
+
export declare interface SecureStore {
|
|
1611
|
+
get: (key: string) => Promise<string | undefined>;
|
|
1612
|
+
set: (key: string, value: string) => Promise<void>;
|
|
1613
|
+
del: (key: string) => Promise<void>;
|
|
1614
|
+
}
|
|
1674
1615
|
|
|
1675
1616
|
/**
|
|
1676
1617
|
* @publicApi
|
|
1677
1618
|
*/
|
|
1678
|
-
export declare type SettingTypes =
|
|
1619
|
+
export declare type SettingTypes = {
|
|
1620
|
+
setInputs: (inputs: Array<PluginInputs>) => Promise<void>;
|
|
1621
|
+
getValues: <T extends Record<string, number | string | string[] | boolean | undefined>>() => Promise<T>;
|
|
1622
|
+
};
|
|
1679
1623
|
|
|
1680
1624
|
/**
|
|
1681
1625
|
* @publicApi
|
|
@@ -1711,14 +1655,12 @@ export declare type StoreStatus = 'NEW' | 'ACCEPTED' | 'REJECTED' | 'PARTIALLY_C
|
|
|
1711
1655
|
* @publicApi
|
|
1712
1656
|
*/
|
|
1713
1657
|
export declare interface Table {
|
|
1714
|
-
getTables: () => Promise<PluginTable
|
|
1658
|
+
getTables: () => Promise<(PluginTable & {
|
|
1659
|
+
order?: PluginOrder;
|
|
1660
|
+
})[]>;
|
|
1715
1661
|
getTable: (tableId: number) => Promise<PluginTable>;
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
*/
|
|
1719
|
-
on(event: 'order-update' | 'order-add', callback: (order: PluginOrder) => void): void;
|
|
1720
|
-
on(event: 'clear' | 'add' | 'delete' | 'update', callback: (table: PluginTable) => void): void;
|
|
1721
|
-
on(event: 'move', callback: (before: PluginTable, after: PluginTable) => void): void;
|
|
1662
|
+
on(event: 'clear' | 'add' | 'delete' | 'update', callback: (id: PluginTable['id']) => void): void;
|
|
1663
|
+
on(event: 'move', callback: (before: PluginTable['id'], after: PluginTable['id']) => void): void;
|
|
1722
1664
|
clearTable: ({ table, order }: {
|
|
1723
1665
|
table: PluginTable;
|
|
1724
1666
|
order?: PluginOrder;
|
|
@@ -1817,18 +1759,18 @@ export declare class Websocket {
|
|
|
1817
1759
|
followRedirects?: boolean | undefined;
|
|
1818
1760
|
timeout?: number | undefined;
|
|
1819
1761
|
} | undefined);
|
|
1820
|
-
connect()
|
|
1821
|
-
disconnect()
|
|
1822
|
-
send(data: {
|
|
1762
|
+
connect: () => Promise<void>;
|
|
1763
|
+
disconnect: () => Promise<void>;
|
|
1764
|
+
send: (data: {
|
|
1823
1765
|
data: string;
|
|
1824
1766
|
option?: {
|
|
1825
|
-
mask?: boolean;
|
|
1826
|
-
};
|
|
1827
|
-
})
|
|
1828
|
-
onMessage(callback: (message: string) => void)
|
|
1829
|
-
onError(callback: (errorName?: string, errorMessage?: string) => void)
|
|
1830
|
-
onClose(callback: (code: string) => void)
|
|
1831
|
-
onOpen(callback: () => void)
|
|
1767
|
+
mask?: boolean | undefined;
|
|
1768
|
+
} | undefined;
|
|
1769
|
+
}) => void;
|
|
1770
|
+
onMessage: (callback: (message: string) => void) => void;
|
|
1771
|
+
onError: (callback: (errorName?: string, errorMessage?: string) => void) => void;
|
|
1772
|
+
onClose: (callback: (code: string) => void) => void;
|
|
1773
|
+
onOpen: (callback: () => void) => void;
|
|
1832
1774
|
}
|
|
1833
1775
|
|
|
1834
1776
|
/**
|