@tossplace/pos-plugin-sdk 0.0.16 → 0.0.18
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 +145 -201
- package/package.json +1 -1
- package/types/index.d.ts +145 -188
package/dist/sdk.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 = 'BMPC_NOT_RUNNING' | 'NOT_RUNNING' | 'BMPC_NOT_LOGGED_IN' | 'NOT_LOGGED_IN' | 'BMPC_UNKNOWN' | '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,101 +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
|
-
/**
|
|
270
|
-
* @publicApi
|
|
271
|
-
*/
|
|
272
|
-
declare type FFIAbiType = '__stdcall';
|
|
273
|
-
|
|
274
|
-
/**
|
|
275
|
-
* @publicApi
|
|
276
|
-
*/
|
|
277
|
-
declare interface FFIApi extends FFIFunction {
|
|
278
|
-
name: string;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
/**
|
|
282
|
-
* @internal
|
|
283
|
-
* @publicApi
|
|
284
|
-
*/
|
|
285
|
-
declare interface FFIDownloadInfo {
|
|
286
|
-
win32: {
|
|
287
|
-
filePath: string;
|
|
288
|
-
downloadUrl: string;
|
|
289
|
-
};
|
|
290
|
-
win64: {
|
|
291
|
-
filePath: string;
|
|
292
|
-
downloadUrl: string;
|
|
293
|
-
};
|
|
294
|
-
}
|
|
295
|
-
|
|
296
261
|
/**
|
|
297
262
|
* @publicApi
|
|
298
263
|
*/
|
|
299
|
-
declare
|
|
300
|
-
params?: FFIFunctionParam[];
|
|
301
|
-
return: FFIFunctionReturn;
|
|
302
|
-
options?: FFIFunctionOptions;
|
|
303
|
-
returnData?: any;
|
|
304
|
-
}
|
|
264
|
+
export declare const draftOrder: DraftOrderImpl;
|
|
305
265
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
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>;
|
|
315
280
|
}
|
|
316
281
|
|
|
317
|
-
|
|
318
|
-
* @publicApi
|
|
319
|
-
*/
|
|
320
|
-
declare type FFIFunctionParam = {
|
|
321
|
-
type: 'str';
|
|
322
|
-
} | {
|
|
323
|
-
type: 'int';
|
|
324
|
-
} | {
|
|
325
|
-
type: 'bool';
|
|
326
|
-
} | {
|
|
327
|
-
type: 'wchar *';
|
|
328
|
-
} | {
|
|
329
|
-
type: 'callback';
|
|
330
|
-
};
|
|
331
|
-
|
|
332
|
-
/**
|
|
333
|
-
* @publicApi
|
|
334
|
-
*/
|
|
335
|
-
declare type FFIFunctionReturn = 'void' | 'str' | 'int' | 'bool' | 'wchar *' | 'void *';
|
|
282
|
+
declare type Element_2 = BarcodeElements | InputElements;
|
|
336
283
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
*/
|
|
340
|
-
export declare interface FFITypes {
|
|
341
|
-
download: (downloadInfo: FFIDownloadInfo) => Promise<{
|
|
342
|
-
platform: keyof FFIDownloadInfo;
|
|
343
|
-
}>;
|
|
344
|
-
load: (filePath: string, apis: FFIApi[]) => Promise<void>;
|
|
345
|
-
unload: (filePath: string) => Promise<void>;
|
|
346
|
-
invoke: (filePath: string, apiName: string, params?: any[]) => Promise<any>;
|
|
347
|
-
registerCallback: (filePath: string, signature: FFIFunction, callback: (...args: any[]) => any) => Promise<{
|
|
348
|
-
ffiCallbackId: string;
|
|
349
|
-
}>;
|
|
350
|
-
unregisterCallback: (filePath: string, callbackId: string) => Promise<void>;
|
|
351
|
-
addCallbackErrorHandler: (filePath: string, handler: (error: Error) => void) => void;
|
|
284
|
+
declare class ErrorImpl {
|
|
285
|
+
addErrorListener(handler: (error: Error) => void): void;
|
|
352
286
|
}
|
|
353
287
|
|
|
354
|
-
declare function getValues<T extends Record<string, number | string | string[] | boolean | undefined>>(): Promise<T>;
|
|
355
|
-
|
|
356
288
|
declare type HereOrder = Order_2 & {
|
|
357
289
|
type: 'HERE';
|
|
358
290
|
memo: {
|
|
@@ -367,23 +299,28 @@ declare type HereOrder = Order_2 & {
|
|
|
367
299
|
*/
|
|
368
300
|
export declare type HttpMethod = 'GET' | 'POST' | 'DELETE' | 'HEAD' | 'OPTIONS' | 'PUT' | 'PATCH';
|
|
369
301
|
|
|
302
|
+
declare interface HttpOption {
|
|
303
|
+
timeoutMs?: number;
|
|
304
|
+
}
|
|
305
|
+
|
|
370
306
|
declare interface HttpRequest {
|
|
371
307
|
method: HttpMethod;
|
|
372
308
|
payload?: string;
|
|
373
309
|
headers: [string, string][];
|
|
310
|
+
timeoutMs?: number;
|
|
374
311
|
}
|
|
375
312
|
|
|
376
313
|
/**
|
|
377
314
|
* @publicApi
|
|
378
315
|
*/
|
|
379
316
|
export declare interface HttpTypes {
|
|
380
|
-
get: (url: string, headers?: [string, string][]) => Promise<PluginHttpResponse>;
|
|
381
|
-
post: (url: string, payload: any, headers?: [string, string][]) => Promise<PluginHttpResponse>;
|
|
382
|
-
delete: (url: string, headers?: [string, string][]) => Promise<PluginHttpResponse>;
|
|
383
|
-
head: (url: string, headers?: [string, string][]) => Promise<PluginHttpResponse>;
|
|
384
|
-
options: (url: string, headers?: [string, string][]) => Promise<PluginHttpResponse>;
|
|
385
|
-
put: (url: string, payload: any, headers?: [string, string][]) => Promise<PluginHttpResponse>;
|
|
386
|
-
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>;
|
|
387
324
|
}
|
|
388
325
|
|
|
389
326
|
declare type InputElements = {
|
|
@@ -430,12 +367,7 @@ declare type Languages = Record<PluginLanguageCode, string>;
|
|
|
430
367
|
export declare interface MenuOption {
|
|
431
368
|
getOptions: () => Promise<PluginCatalogItemOption[]>;
|
|
432
369
|
getOption: (optionId: number) => Promise<PluginCatalogItemOption>;
|
|
433
|
-
|
|
434
|
-
* @deprecated 다음 버전에서 제거 예정입니다
|
|
435
|
-
*/
|
|
436
|
-
on(event: 'sold-out' | 'on-sale', callback: (option: PluginCatalogItemOption) => void): void;
|
|
437
|
-
on(event: 'update' | 'add' | 'delete', callback: (option: PluginCatalogItemOption) => void): void;
|
|
438
|
-
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;
|
|
439
371
|
}
|
|
440
372
|
|
|
441
373
|
/**
|
|
@@ -453,28 +385,6 @@ export declare interface Merchant {
|
|
|
453
385
|
getMerchant: () => Promise<TossMerchant>;
|
|
454
386
|
}
|
|
455
387
|
|
|
456
|
-
/**
|
|
457
|
-
* @publicApi
|
|
458
|
-
*/
|
|
459
|
-
export declare interface Navigation {
|
|
460
|
-
navigate(page: 'plugin-tab', packageName?: string): void;
|
|
461
|
-
navigate(page: 'business-type-setting'): void;
|
|
462
|
-
/**
|
|
463
|
-
* 포스에서 페이지를 이동합니다.
|
|
464
|
-
* @param page business-type-setting 업종유형 변경, plugin-tab 플러그인 탭 이동
|
|
465
|
-
* @param packageName 이동할 탭의 이름, 없는 경우 첫번째 플러그인 탭으로 이동합니다
|
|
466
|
-
*/
|
|
467
|
-
navigate(page: 'business-type-setting' | 'plugin-tab', packageName?: string): void;
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
/**
|
|
471
|
-
* @publicApi
|
|
472
|
-
*/
|
|
473
|
-
export declare class NavigationImpl implements Navigation {
|
|
474
|
-
navigate(page: 'plugin-tab', packageName?: string): void;
|
|
475
|
-
navigate(page: 'business-type-setting'): void;
|
|
476
|
-
}
|
|
477
|
-
|
|
478
388
|
/**
|
|
479
389
|
* @publicApi
|
|
480
390
|
* @return number
|
|
@@ -498,7 +408,22 @@ declare type NumberInput = BaseInput & {
|
|
|
498
408
|
* @publicApi
|
|
499
409
|
*/
|
|
500
410
|
export declare interface Order {
|
|
501
|
-
getOrder
|
|
411
|
+
getOrder(id: string): Promise<PluginOrder>;
|
|
412
|
+
/**
|
|
413
|
+
* @description tableId와 orderState로 주문을 조회합니다 search는 다른 도메인의 인자로 검색이 가능합니다
|
|
414
|
+
* @param tableId 테이블 id
|
|
415
|
+
* @param orderState 주문 상태
|
|
416
|
+
* @param start start 날짜의 00시부터 부터 주문을 검색합니다 (ISO 8601 포맷)
|
|
417
|
+
* @param end end 날짜 저녁 12시까지 주문을 검색합니다 (ISO 8601 포맷)
|
|
418
|
+
*/
|
|
419
|
+
search(params: {
|
|
420
|
+
start: string;
|
|
421
|
+
end: string;
|
|
422
|
+
page?: number;
|
|
423
|
+
size?: number;
|
|
424
|
+
tableId?: PluginTable['id'];
|
|
425
|
+
orderState?: PluginOrderState[];
|
|
426
|
+
}): Promise<PluginOrder[]>;
|
|
502
427
|
/**
|
|
503
428
|
* @param start ISO 8601 포맷
|
|
504
429
|
* @param end ISO 8601 포맷
|
|
@@ -506,24 +431,21 @@ export declare interface Order {
|
|
|
506
431
|
* @param size default 20
|
|
507
432
|
* @description createdAt 기준으로 주문을 조회합니다
|
|
508
433
|
*/
|
|
509
|
-
getOrders
|
|
434
|
+
getOrders(params: {
|
|
510
435
|
start: string;
|
|
511
436
|
end: string;
|
|
512
437
|
page?: number;
|
|
513
438
|
size?: number;
|
|
514
439
|
orderStates?: PluginOrderState[];
|
|
515
|
-
})
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
on(event: 'cancel', callback: (order: PluginOrder) => void): void;
|
|
520
|
-
cancel: (id: string) => Promise<void>;
|
|
521
|
-
add: (order: PluginOrderDto) => Promise<PluginOrder>;
|
|
440
|
+
}): Promise<PluginOrder[]>;
|
|
441
|
+
on(event: 'add' | 'accept' | 'decline' | 'expire' | 'complete' | 'update', callback: (order: PluginOrder['id']) => void): void;
|
|
442
|
+
cancel(id: string): Promise<void>;
|
|
443
|
+
add(order: PluginOrderDto): Promise<PluginOrder>;
|
|
522
444
|
/**
|
|
523
445
|
* 새로 추가 된 메뉴만 order에 넣으세요
|
|
524
446
|
*/
|
|
525
|
-
addMenu
|
|
526
|
-
complete
|
|
447
|
+
addMenu(orderId: string, order: PluginOrderDto): Promise<PluginOrder>;
|
|
448
|
+
complete(id: string): Promise<PluginOrder>;
|
|
527
449
|
}
|
|
528
450
|
|
|
529
451
|
declare type Order_2 = {
|
|
@@ -568,7 +490,7 @@ declare type Order_2 = {
|
|
|
568
490
|
customerChargedPrice: number;
|
|
569
491
|
};
|
|
570
492
|
|
|
571
|
-
declare type OrderItemType = 'ITEM' | 'DELIVERY_FEE' | 'PREPAID_CARD' | 'MULTI_USE_TICKET';
|
|
493
|
+
declare type OrderItemType = 'ITEM' | 'DELIVERY_FEE' | 'PREPAID_CARD' | 'MULTI_USE_TICKET' | 'COMBO' | 'GIFT_CARD';
|
|
572
494
|
|
|
573
495
|
/**
|
|
574
496
|
* @publicApi
|
|
@@ -598,7 +520,7 @@ export declare interface Payment {
|
|
|
598
520
|
getPayment: (paymentId: PluginPayment['id']) => Promise<PluginPayment>;
|
|
599
521
|
}
|
|
600
522
|
|
|
601
|
-
declare type PaymentCallback = (
|
|
523
|
+
declare type PaymentCallback = (paymentId: PluginPayment['id'], orderId: PluginOrder['id']) => void;
|
|
602
524
|
|
|
603
525
|
/**
|
|
604
526
|
* @publicApi
|
|
@@ -660,7 +582,6 @@ export declare const plugin: PluginImpl;
|
|
|
660
582
|
* @publicApi
|
|
661
583
|
*/
|
|
662
584
|
declare interface Plugin_2 {
|
|
663
|
-
on(event: 'close', callback: () => Promise<void>): void;
|
|
664
585
|
getPluginInfo(): Promise<{
|
|
665
586
|
name: string;
|
|
666
587
|
version: string;
|
|
@@ -901,10 +822,14 @@ export declare interface PluginCatalogItemOption {
|
|
|
901
822
|
title: string;
|
|
902
823
|
titleI18n?: PluginLanguagePack;
|
|
903
824
|
isRequired: boolean;
|
|
825
|
+
/**
|
|
826
|
+
* 토스 포스에서 최소 수량은 선택 불가능하며 필수선택 여부에 따라 0 또는 1로 내려옴
|
|
827
|
+
* 0 - 필수아님
|
|
828
|
+
* 1 - 필수
|
|
829
|
+
*/
|
|
904
830
|
minChoices: number;
|
|
905
831
|
/**
|
|
906
832
|
* 최대로 선택가능한 선택 수
|
|
907
|
-
* -1인 경우 무제한 선택이 가능합니다.
|
|
908
833
|
*/
|
|
909
834
|
maxChoices: number;
|
|
910
835
|
choices: PluginCatalogItemOptionChoice[];
|
|
@@ -1021,15 +946,21 @@ export declare interface PluginDeliveryDiscount extends PluginDiscount {
|
|
|
1021
946
|
* @publicApi
|
|
1022
947
|
* @description order를 만들기 위한 dto
|
|
1023
948
|
*/
|
|
1024
|
-
export declare type
|
|
949
|
+
export declare type PluginDeliveryOrderDtoV2 = Omit<PluginOrderDto, 'lineItems' | 'discounts'> & {
|
|
1025
950
|
cancelled: boolean;
|
|
1026
951
|
delivery: PluginDelivery<'DELIVERY' | 'PICKUP' | 'HERE'>;
|
|
1027
952
|
discounts: Array<PluginDeliveryDiscount>;
|
|
1028
|
-
lineItems: Array<Omit<PluginOrderItem, 'id' | 'orderId' | 'item' | 'optionChoices' | 'discounts'> & {
|
|
953
|
+
lineItems: Array<Omit<PluginOrderItem, 'id' | 'orderId' | 'item' | 'optionChoices' | 'discounts' | 'chargePrice'> & {
|
|
1029
954
|
item: {
|
|
1030
955
|
title: string;
|
|
1031
956
|
type: 'ITEM' | 'DELIVERY_FEE';
|
|
1032
957
|
};
|
|
958
|
+
/**
|
|
959
|
+
* @description 옵션,할인을 제외한 메뉴 1개의 단일 가격
|
|
960
|
+
*/
|
|
961
|
+
itemPrice: {
|
|
962
|
+
value: number;
|
|
963
|
+
};
|
|
1033
964
|
optionChoices: Array<{
|
|
1034
965
|
title: string;
|
|
1035
966
|
priceValue: number;
|
|
@@ -1037,6 +968,9 @@ export declare type PluginDeliveryOrderDto = Omit<PluginOrderDto, 'lineItems' |
|
|
|
1037
968
|
}>;
|
|
1038
969
|
discounts?: Array<PluginDeliveryDiscount>;
|
|
1039
970
|
}>;
|
|
971
|
+
metadata?: {
|
|
972
|
+
bmpc?: boolean;
|
|
973
|
+
};
|
|
1040
974
|
};
|
|
1041
975
|
|
|
1042
976
|
/**
|
|
@@ -1203,12 +1137,8 @@ export declare type PluginHttpResponse = {
|
|
|
1203
1137
|
};
|
|
1204
1138
|
|
|
1205
1139
|
declare class PluginImpl implements Plugin_2 {
|
|
1206
|
-
|
|
1207
|
-
private plugin;
|
|
1208
|
-
private pluginCallbacks;
|
|
1209
|
-
constructor(webview: WebView);
|
|
1140
|
+
constructor();
|
|
1210
1141
|
private initializePlugin;
|
|
1211
|
-
on(event: 'close', callback: () => Promise<void>): void;
|
|
1212
1142
|
getPluginInfo(): Promise<{
|
|
1213
1143
|
name: string;
|
|
1214
1144
|
version: string;
|
|
@@ -1231,26 +1161,6 @@ export declare interface PluginLanguagePack {
|
|
|
1231
1161
|
languages: Partial<Languages>;
|
|
1232
1162
|
}
|
|
1233
1163
|
|
|
1234
|
-
/**
|
|
1235
|
-
* @publicApi
|
|
1236
|
-
*/
|
|
1237
|
-
export declare interface PluginMessenger {
|
|
1238
|
-
broadcast<T = any>(message: T): void;
|
|
1239
|
-
on<T = any>(event: 'message', callback: (message: T) => void): void;
|
|
1240
|
-
}
|
|
1241
|
-
|
|
1242
|
-
/**
|
|
1243
|
-
* @publicApi
|
|
1244
|
-
*/
|
|
1245
|
-
export declare const pluginMessenger: PluginMessengerImpl;
|
|
1246
|
-
|
|
1247
|
-
declare class PluginMessengerImpl implements PluginMessenger {
|
|
1248
|
-
private readonly webview;
|
|
1249
|
-
constructor(webview: WebView);
|
|
1250
|
-
broadcast<T = any>(message: T): void;
|
|
1251
|
-
on<T = any>(event: 'message', callback: (message: T) => void): void;
|
|
1252
|
-
}
|
|
1253
|
-
|
|
1254
1164
|
/**
|
|
1255
1165
|
* @publicApi
|
|
1256
1166
|
* @description pluginOrder orderDto를 서버에 저장 후 가공해서 내려 준 값
|
|
@@ -1276,6 +1186,11 @@ export declare interface PluginOrder {
|
|
|
1276
1186
|
paymentPrice: PluginOrderPaymentPrice;
|
|
1277
1187
|
requestedInfo?: PluginOrderRequestInfo;
|
|
1278
1188
|
source: string;
|
|
1189
|
+
channel: {
|
|
1190
|
+
source: string;
|
|
1191
|
+
/** @memo 생성할 때 source를 넣고 groups를 따로 명시하지 않으면, groups는 source로부터 유도되어 채워집니다 */
|
|
1192
|
+
groups: PluginOrderGroup[];
|
|
1193
|
+
};
|
|
1279
1194
|
/** 해당 주문의 테이블 인원 수 */
|
|
1280
1195
|
numGuests?: number;
|
|
1281
1196
|
memo?: string;
|
|
@@ -1332,8 +1247,16 @@ export declare type PluginOrderDto = {
|
|
|
1332
1247
|
discounts: PluginDiscount[];
|
|
1333
1248
|
tableId?: number;
|
|
1334
1249
|
lineItems: PluginOrderItemDto[];
|
|
1250
|
+
channel?: {
|
|
1251
|
+
/**
|
|
1252
|
+
* 주문의 타입을 지정합니다 아무것도 지정되지 않을 경우 POS로 간주됩니다.
|
|
1253
|
+
*/
|
|
1254
|
+
groups: PluginOrderGroup[];
|
|
1255
|
+
};
|
|
1335
1256
|
};
|
|
1336
1257
|
|
|
1258
|
+
declare type PluginOrderGroup = 'POS' | 'KIOSK' | 'DELIVERY' | 'TABLE_ORDER' | 'MOBILE_ORDER';
|
|
1259
|
+
|
|
1337
1260
|
/**
|
|
1338
1261
|
* @publicApi
|
|
1339
1262
|
*/
|
|
@@ -1348,7 +1271,7 @@ export declare interface PluginOrderItem {
|
|
|
1348
1271
|
value: number;
|
|
1349
1272
|
};
|
|
1350
1273
|
/**
|
|
1351
|
-
* @description 실제 고객이 결제하는 금액에 대한 정보입니다. (할인 적용 금액)
|
|
1274
|
+
* @description 실제 고객이 결제하는 금액에 대한 정보입니다. (할인 적용 금액 + 옵션합산금액)
|
|
1352
1275
|
*/
|
|
1353
1276
|
chargePrice: {
|
|
1354
1277
|
value: number;
|
|
@@ -1389,6 +1312,7 @@ declare interface PluginOrderItemItemOptionChoiceDto {
|
|
|
1389
1312
|
}
|
|
1390
1313
|
|
|
1391
1314
|
/**
|
|
1315
|
+
* @publicApi
|
|
1392
1316
|
* 주문항목 옵션 선택
|
|
1393
1317
|
*/
|
|
1394
1318
|
declare interface PluginOrderItemOptionChoice extends PluginCatalogItemOptionChoice {
|
|
@@ -1630,6 +1554,7 @@ export declare type PosPluginSdk = {
|
|
|
1630
1554
|
catalog: Catalog;
|
|
1631
1555
|
option: MenuOption;
|
|
1632
1556
|
storage: StorageTypes;
|
|
1557
|
+
secureStore: SecureStore;
|
|
1633
1558
|
cashReceipt: CashReceiptTypes;
|
|
1634
1559
|
order: Order;
|
|
1635
1560
|
payment: Payment;
|
|
@@ -1639,14 +1564,12 @@ export declare type PosPluginSdk = {
|
|
|
1639
1564
|
merchant: Merchant;
|
|
1640
1565
|
paymentMethod: PaymentMethodType;
|
|
1641
1566
|
websocket: WebsocketTypes;
|
|
1642
|
-
ffi: FFITypes;
|
|
1643
1567
|
barcode: Barcode;
|
|
1644
1568
|
plugin: Plugin_2;
|
|
1645
|
-
pluginMessenger: PluginMessenger;
|
|
1646
1569
|
setting: SettingTypes;
|
|
1647
1570
|
draftOrder: DraftOrder;
|
|
1648
|
-
navigation: Navigation;
|
|
1649
1571
|
error: ErrorImpl;
|
|
1572
|
+
powerSaver: PowerSaverTypes;
|
|
1650
1573
|
};
|
|
1651
1574
|
|
|
1652
1575
|
/**
|
|
@@ -1670,6 +1593,24 @@ export declare class PosPluginSdkRateLimitError extends PosPluginSdkError {
|
|
|
1670
1593
|
static isPosPluginSdkRateLimitError(error: unknown): error is PosPluginSdkRateLimitError;
|
|
1671
1594
|
}
|
|
1672
1595
|
|
|
1596
|
+
/**
|
|
1597
|
+
* @publicApi
|
|
1598
|
+
*/
|
|
1599
|
+
export declare type PowerSaverTypes = {
|
|
1600
|
+
/**
|
|
1601
|
+
* 절전모드 방지를 시작합니다.
|
|
1602
|
+
*/
|
|
1603
|
+
startBlocking(): Promise<void>;
|
|
1604
|
+
/**
|
|
1605
|
+
* 절전모드 방지를 해제합니다.
|
|
1606
|
+
*/
|
|
1607
|
+
stopBlocking(): Promise<void>;
|
|
1608
|
+
/**
|
|
1609
|
+
* 절전모드 방지가 활성화 상태인지 확인합니다.
|
|
1610
|
+
*/
|
|
1611
|
+
isBlocked(): Promise<boolean>;
|
|
1612
|
+
};
|
|
1613
|
+
|
|
1673
1614
|
/**
|
|
1674
1615
|
* @publicApi
|
|
1675
1616
|
* @return string values.id
|
|
@@ -1685,17 +1626,22 @@ declare type RadioInput = Omit<BaseInput, 'placeholder'> & {
|
|
|
1685
1626
|
|
|
1686
1627
|
declare type Response_2 = BarcodeResponse | InputResponse;
|
|
1687
1628
|
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1629
|
+
/**
|
|
1630
|
+
* @publicApi
|
|
1631
|
+
*/
|
|
1632
|
+
export declare interface SecureStore {
|
|
1633
|
+
get: (key: string) => Promise<string | undefined>;
|
|
1634
|
+
set: (key: string, value: string) => Promise<void>;
|
|
1635
|
+
del: (key: string) => Promise<void>;
|
|
1636
|
+
}
|
|
1694
1637
|
|
|
1695
1638
|
/**
|
|
1696
1639
|
* @publicApi
|
|
1697
1640
|
*/
|
|
1698
|
-
export declare type SettingTypes =
|
|
1641
|
+
export declare type SettingTypes = {
|
|
1642
|
+
setInputs: (inputs: Array<PluginInputs>) => Promise<void>;
|
|
1643
|
+
getValues: <T extends Record<string, number | string | string[] | boolean | undefined>>() => Promise<T>;
|
|
1644
|
+
};
|
|
1699
1645
|
|
|
1700
1646
|
/**
|
|
1701
1647
|
* @publicApi
|
|
@@ -1731,14 +1677,12 @@ export declare type StoreStatus = 'NEW' | 'ACCEPTED' | 'REJECTED' | 'PARTIALLY_C
|
|
|
1731
1677
|
* @publicApi
|
|
1732
1678
|
*/
|
|
1733
1679
|
export declare interface Table {
|
|
1734
|
-
getTables: () => Promise<PluginTable
|
|
1680
|
+
getTables: () => Promise<(PluginTable & {
|
|
1681
|
+
order?: PluginOrder;
|
|
1682
|
+
})[]>;
|
|
1735
1683
|
getTable: (tableId: number) => Promise<PluginTable>;
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
*/
|
|
1739
|
-
on(event: 'order-update' | 'order-add', callback: (order: PluginOrder) => void): void;
|
|
1740
|
-
on(event: 'clear' | 'add' | 'delete' | 'update', callback: (table: PluginTable) => void): void;
|
|
1741
|
-
on(event: 'move', callback: (before: PluginTable, after: PluginTable) => void): void;
|
|
1684
|
+
on(event: 'clear' | 'add' | 'delete' | 'update', callback: (id: PluginTable['id']) => void): void;
|
|
1685
|
+
on(event: 'move', callback: (before: PluginTable['id'], after: PluginTable['id']) => void): void;
|
|
1742
1686
|
clearTable: ({ table, order }: {
|
|
1743
1687
|
table: PluginTable;
|
|
1744
1688
|
order?: PluginOrder;
|
|
@@ -1837,18 +1781,18 @@ export declare class Websocket {
|
|
|
1837
1781
|
followRedirects?: boolean | undefined;
|
|
1838
1782
|
timeout?: number | undefined;
|
|
1839
1783
|
} | undefined);
|
|
1840
|
-
connect()
|
|
1841
|
-
disconnect()
|
|
1842
|
-
send(data: {
|
|
1784
|
+
connect: () => Promise<void>;
|
|
1785
|
+
disconnect: () => Promise<void>;
|
|
1786
|
+
send: (data: {
|
|
1843
1787
|
data: string;
|
|
1844
1788
|
option?: {
|
|
1845
|
-
mask?: boolean;
|
|
1846
|
-
};
|
|
1847
|
-
})
|
|
1848
|
-
onMessage(callback: (message: string) => void)
|
|
1849
|
-
onError(callback: (errorName?: string, errorMessage?: string) => void)
|
|
1850
|
-
onClose(callback: (code: string) => void)
|
|
1851
|
-
onOpen(callback: () => void)
|
|
1789
|
+
mask?: boolean | undefined;
|
|
1790
|
+
} | undefined;
|
|
1791
|
+
}) => void;
|
|
1792
|
+
onMessage: (callback: (message: string) => void) => void;
|
|
1793
|
+
onError: (callback: (errorName?: string, errorMessage?: string) => void) => void;
|
|
1794
|
+
onClose: (callback: (code: string) => void) => void;
|
|
1795
|
+
onOpen: (callback: () => void) => void;
|
|
1852
1796
|
}
|
|
1853
1797
|
|
|
1854
1798
|
/**
|