@tossplace/pos-plugin-sdk 0.0.26 → 0.0.28
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 +200 -42
- package/package.json +1 -1
- package/types/index.d.ts +180 -42
package/dist/sdk.d.ts
CHANGED
|
@@ -60,7 +60,7 @@ export declare type CashReceipt = {
|
|
|
60
60
|
orderId: string;
|
|
61
61
|
/** 현금영수증 발행 금액입니다 */
|
|
62
62
|
amount: number;
|
|
63
|
-
/** 현금영수증 발행 날짜입니다
|
|
63
|
+
/** 현금영수증 발행 날짜입니다 yyyy-MM-ddTHH:mm:ss */
|
|
64
64
|
issueDate: string;
|
|
65
65
|
/** 현금영수증 발행 번호입니다 */
|
|
66
66
|
issueNumber: string;
|
|
@@ -82,8 +82,19 @@ export declare interface Catalog {
|
|
|
82
82
|
getCatalog: (catalogId: number) => Promise<PluginCatalogItem>;
|
|
83
83
|
getCatalogs: () => Promise<PluginCatalogItem[]>;
|
|
84
84
|
on(event: 'update' | 'add' | 'delete', callback: CatalogEventCallback): void;
|
|
85
|
+
on(event: 'before-add', callback: CatalogBeforeAddCallback): void;
|
|
85
86
|
}
|
|
86
87
|
|
|
88
|
+
/**
|
|
89
|
+
* @publicApi
|
|
90
|
+
*/
|
|
91
|
+
export declare type CatalogBeforeAddCallback = (payload: {
|
|
92
|
+
payload: Partial<PluginCatalogItemDto>;
|
|
93
|
+
ui: Ui;
|
|
94
|
+
}) => Promise<{
|
|
95
|
+
initialValue?: PluginCatalogItemDto;
|
|
96
|
+
}>;
|
|
97
|
+
|
|
87
98
|
declare type CatalogEventCallback = (id: PluginCatalogItem['id']) => void;
|
|
88
99
|
|
|
89
100
|
/**
|
|
@@ -163,11 +174,34 @@ export declare interface DeliveryCatalogOption {
|
|
|
163
174
|
*/
|
|
164
175
|
export declare type DeliveryConnectionStatusErrorCode = 'BMPC_NOT_RUNNING' | 'NOT_RUNNING' | 'BMPC_NOT_LOGGED_IN' | 'NOT_LOGGED_IN' | 'BMPC_UNKNOWN' | 'UNKNOWN' | 'BAEMIN_NOT_SELECTED_PROGRAM' | string;
|
|
165
176
|
|
|
177
|
+
/**
|
|
178
|
+
* @publicApi
|
|
179
|
+
*/
|
|
180
|
+
export declare interface DeliveryDispatch {
|
|
181
|
+
on(event: 'update', callback: (payload: DispatchChangePayload) => void): void;
|
|
182
|
+
getDispatch(params: {
|
|
183
|
+
orderId: PluginOrder['id'];
|
|
184
|
+
}): Promise<Dispatch | null>;
|
|
185
|
+
}
|
|
186
|
+
|
|
166
187
|
/**
|
|
167
188
|
* @publicApi
|
|
168
189
|
*/
|
|
169
190
|
export declare type DeliveryItemStatus = 'sold-out' | 'hide' | 'active' | 'invisible';
|
|
170
191
|
|
|
192
|
+
/**
|
|
193
|
+
* @publicApi
|
|
194
|
+
* @internal
|
|
195
|
+
*/
|
|
196
|
+
export declare type DeliveryOperationStatus = {
|
|
197
|
+
state: 'open';
|
|
198
|
+
} | {
|
|
199
|
+
state: 'paused';
|
|
200
|
+
until: string;
|
|
201
|
+
} | {
|
|
202
|
+
state: 'closed';
|
|
203
|
+
};
|
|
204
|
+
|
|
171
205
|
declare type DeliveryOrder = Order_2 & {
|
|
172
206
|
type: 'DELIVERY';
|
|
173
207
|
/**
|
|
@@ -186,6 +220,17 @@ declare type DeliveryOrder = Order_2 & {
|
|
|
186
220
|
status: DeliveryStatus;
|
|
187
221
|
};
|
|
188
222
|
|
|
223
|
+
/**
|
|
224
|
+
* @publicApi
|
|
225
|
+
* @internal
|
|
226
|
+
*/
|
|
227
|
+
export declare type DeliveryPauseDuration = {
|
|
228
|
+
type: 'minutes';
|
|
229
|
+
minutes: number;
|
|
230
|
+
} | {
|
|
231
|
+
type: 'today';
|
|
232
|
+
};
|
|
233
|
+
|
|
189
234
|
/**
|
|
190
235
|
* @publicApi
|
|
191
236
|
*/
|
|
@@ -198,6 +243,41 @@ export declare interface Device {
|
|
|
198
243
|
getDeviceInfo(): Promise<DeviceInfo>;
|
|
199
244
|
}
|
|
200
245
|
|
|
246
|
+
/**
|
|
247
|
+
* @publicApi
|
|
248
|
+
*/
|
|
249
|
+
declare type DeviceBusinessType = {
|
|
250
|
+
business: {
|
|
251
|
+
type: 'CAFE' | 'RESTAURANT';
|
|
252
|
+
};
|
|
253
|
+
operation: {
|
|
254
|
+
payment: {
|
|
255
|
+
type: 'PAY_FIRST' | 'PAY_LATER';
|
|
256
|
+
};
|
|
257
|
+
table: {
|
|
258
|
+
enabled: boolean;
|
|
259
|
+
};
|
|
260
|
+
booking: {
|
|
261
|
+
enabled: boolean;
|
|
262
|
+
};
|
|
263
|
+
};
|
|
264
|
+
} | {
|
|
265
|
+
business: {
|
|
266
|
+
type: 'RETAIL' | 'SERVICE';
|
|
267
|
+
};
|
|
268
|
+
operation: {
|
|
269
|
+
payment: {
|
|
270
|
+
type: 'PAY_FIRST';
|
|
271
|
+
};
|
|
272
|
+
table: {
|
|
273
|
+
enabled: false;
|
|
274
|
+
};
|
|
275
|
+
booking: {
|
|
276
|
+
enabled: boolean;
|
|
277
|
+
};
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
|
|
201
281
|
/**
|
|
202
282
|
* @publicApi
|
|
203
283
|
*/
|
|
@@ -216,41 +296,50 @@ export declare type DeviceInfo = {
|
|
|
216
296
|
* Windows와 macos에서만 지원됩니다
|
|
217
297
|
*/
|
|
218
298
|
osVersion?: string;
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
operation: {
|
|
224
|
-
payment: {
|
|
225
|
-
type: 'PAY_FIRST' | 'PAY_LATER';
|
|
226
|
-
};
|
|
227
|
-
table: {
|
|
228
|
-
enabled: boolean;
|
|
229
|
-
};
|
|
230
|
-
booking: {
|
|
231
|
-
enabled: boolean;
|
|
232
|
-
};
|
|
233
|
-
};
|
|
234
|
-
} | {
|
|
235
|
-
business: {
|
|
236
|
-
type: 'RETAIL' | 'SERVICE';
|
|
237
|
-
};
|
|
238
|
-
operation: {
|
|
239
|
-
payment: {
|
|
240
|
-
type: 'PAY_FIRST';
|
|
241
|
-
};
|
|
242
|
-
table: {
|
|
243
|
-
enabled: false;
|
|
244
|
-
};
|
|
245
|
-
booking: {
|
|
246
|
-
enabled: boolean;
|
|
247
|
-
};
|
|
248
|
-
};
|
|
249
|
-
};
|
|
299
|
+
/**
|
|
300
|
+
* @deprecated device.setting.request의 DeviceSetting을 사용해주세요
|
|
301
|
+
*/
|
|
302
|
+
businessType: DeviceBusinessType;
|
|
250
303
|
};
|
|
251
304
|
|
|
252
305
|
declare type Digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';
|
|
253
306
|
|
|
307
|
+
/**
|
|
308
|
+
* @publicApi
|
|
309
|
+
*/
|
|
310
|
+
export declare interface Dispatch {
|
|
311
|
+
dispatchId: number;
|
|
312
|
+
orderId: string;
|
|
313
|
+
status: DispatchStatus;
|
|
314
|
+
riderStatus: DispatchDeliveryStatus;
|
|
315
|
+
provider: DispatchProvider;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* @publicApi
|
|
320
|
+
*/
|
|
321
|
+
export declare type DispatchChangePayload = Pick<Dispatch, 'orderId' | 'dispatchId'>;
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* @publicApi
|
|
325
|
+
*/
|
|
326
|
+
export declare type DispatchDeliveryStatus = 'NOT_ALLOCATION' | 'ASSIGNED' | 'PICKUP_COMPLETED' | 'DELIVERY_COMPLETED';
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* @publicApi
|
|
330
|
+
*/
|
|
331
|
+
export declare interface DispatchProvider {
|
|
332
|
+
type: 'SELF' | 'AGENCY';
|
|
333
|
+
id: number;
|
|
334
|
+
code: string;
|
|
335
|
+
name: string;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* @publicApi
|
|
340
|
+
*/
|
|
341
|
+
export declare type DispatchStatus = 'WAITING_ALLOCATION' | 'ALLOCATION_COMPLETED' | 'CANCEL_WAITING' | 'CANCEL_COMPLETED' | 'COMPLETED';
|
|
342
|
+
|
|
254
343
|
/**
|
|
255
344
|
* @publicApi
|
|
256
345
|
*/
|
|
@@ -445,12 +534,13 @@ declare type MovePayload = {
|
|
|
445
534
|
export declare interface Navigation {
|
|
446
535
|
navigate(page: 'plugin-tab', packageName?: string): void;
|
|
447
536
|
navigate(page: 'business-type-setting'): void;
|
|
537
|
+
navigate(page: 'delivery-connection'): void;
|
|
448
538
|
/**
|
|
449
539
|
* 포스에서 페이지를 이동합니다.
|
|
450
|
-
* @param page business-type-setting 업종유형 변경, plugin-tab 플러그인 탭 이동
|
|
540
|
+
* @param page business-type-setting 업종유형 변경, delivery-connection 설정 > 배달앱, plugin-tab 플러그인 탭 이동
|
|
451
541
|
* @param packageName 이동할 탭의 이름, 없는 경우 첫번째 플러그인 탭으로 이동합니다
|
|
452
542
|
*/
|
|
453
|
-
navigate(page: 'business-type-setting' | 'plugin-tab', packageName?: string): void;
|
|
543
|
+
navigate(page: 'business-type-setting' | 'delivery-connection' | 'plugin-tab', packageName?: string): void;
|
|
454
544
|
}
|
|
455
545
|
|
|
456
546
|
/**
|
|
@@ -459,6 +549,7 @@ export declare interface Navigation {
|
|
|
459
549
|
export declare class NavigationImpl implements Navigation {
|
|
460
550
|
navigate(page: 'plugin-tab', packageName?: string): void;
|
|
461
551
|
navigate(page: 'business-type-setting'): void;
|
|
552
|
+
navigate(page: 'delivery-connection'): void;
|
|
462
553
|
}
|
|
463
554
|
|
|
464
555
|
/**
|
|
@@ -586,6 +677,7 @@ declare type PayCallback = (order: PluginOrder, price: PluginPrice, ui: Ui) => P
|
|
|
586
677
|
export declare interface Payment {
|
|
587
678
|
on(event: 'cancel' | 'paid', callback: PaymentCallback): void;
|
|
588
679
|
on(event: 'before-cancel', callback: PaymentBeforeCancelCallback): void;
|
|
680
|
+
on(event: 'before-cancel-all', callback: PaymentBeforeCancelAllCallback): void;
|
|
589
681
|
cancel: (order: {
|
|
590
682
|
id: string;
|
|
591
683
|
}, payment: {
|
|
@@ -597,6 +689,14 @@ export declare interface Payment {
|
|
|
597
689
|
getPayment: (paymentId: PluginPayment['id']) => Promise<PluginPayment>;
|
|
598
690
|
}
|
|
599
691
|
|
|
692
|
+
/**
|
|
693
|
+
* @publicApi
|
|
694
|
+
*/
|
|
695
|
+
export declare type PaymentBeforeCancelAllCallback = (payload: {
|
|
696
|
+
order: PluginOrder;
|
|
697
|
+
payments: PluginPayment[];
|
|
698
|
+
}) => Promise<void>;
|
|
699
|
+
|
|
600
700
|
/**
|
|
601
701
|
* @publicApi
|
|
602
702
|
*/
|
|
@@ -931,6 +1031,7 @@ export declare interface PluginCatalogItemOption {
|
|
|
931
1031
|
export declare interface PluginCatalogItemOptionChoice {
|
|
932
1032
|
id: number;
|
|
933
1033
|
title: string;
|
|
1034
|
+
code?: string;
|
|
934
1035
|
titleI18n?: PluginLanguagePack;
|
|
935
1036
|
/** 옵션에 딸린 가격이 없는 경우 0 */
|
|
936
1037
|
priceValue: number;
|
|
@@ -1036,8 +1137,7 @@ export declare type PluginDeliveryOrderDtoV2 = Omit<PluginOrderDto, 'lineItems'
|
|
|
1036
1137
|
delivery: PluginDelivery<'DELIVERY' | 'PICKUP' | 'HERE'>;
|
|
1037
1138
|
discounts: Array<PluginDeliveryDiscount>;
|
|
1038
1139
|
lineItems: Array<Omit<PluginOrderItem, 'id' | 'orderId' | 'item' | 'optionChoices' | 'discounts' | 'chargePrice'> & {
|
|
1039
|
-
item: {
|
|
1040
|
-
title: string;
|
|
1140
|
+
item: Pick<PluginCatalogItem, 'title' | 'code'> & {
|
|
1041
1141
|
type: 'ITEM' | 'DELIVERY_FEE';
|
|
1042
1142
|
};
|
|
1043
1143
|
/**
|
|
@@ -1046,9 +1146,7 @@ export declare type PluginDeliveryOrderDtoV2 = Omit<PluginOrderDto, 'lineItems'
|
|
|
1046
1146
|
itemPrice: {
|
|
1047
1147
|
value: number;
|
|
1048
1148
|
};
|
|
1049
|
-
optionChoices: Array<{
|
|
1050
|
-
title: string;
|
|
1051
|
-
priceValue: number;
|
|
1149
|
+
optionChoices: Array<Pick<PluginCatalogItemOptionChoice, 'title' | 'code' | 'priceValue'> & {
|
|
1052
1150
|
quantity: number;
|
|
1053
1151
|
}>;
|
|
1054
1152
|
discounts?: Array<PluginDeliveryDiscount>;
|
|
@@ -1180,6 +1278,22 @@ declare interface PluginExternalDto extends PluginPaymentDtoBase {
|
|
|
1180
1278
|
sourceType: 'EXTERNAL';
|
|
1181
1279
|
}
|
|
1182
1280
|
|
|
1281
|
+
/**
|
|
1282
|
+
* @publicApi
|
|
1283
|
+
*/
|
|
1284
|
+
declare interface PluginExternalLoyaltyPointDetails {
|
|
1285
|
+
source: '제휴사포인트';
|
|
1286
|
+
sourceId: 'EXTERNAL_LOYALTY_POINT';
|
|
1287
|
+
/** 제휴사 구분자 */
|
|
1288
|
+
provider: 'OKCASHBAG' | 'LPOINT';
|
|
1289
|
+
/** 포인트 카드 번호 */
|
|
1290
|
+
code: string;
|
|
1291
|
+
approvalNo: string;
|
|
1292
|
+
amount: number;
|
|
1293
|
+
/** 포인트 잔액 */
|
|
1294
|
+
balance: number;
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1183
1297
|
/**
|
|
1184
1298
|
* @publicApi
|
|
1185
1299
|
*/
|
|
@@ -1331,6 +1445,26 @@ export declare interface PluginLanguagePack {
|
|
|
1331
1445
|
languages: Partial<Languages>;
|
|
1332
1446
|
}
|
|
1333
1447
|
|
|
1448
|
+
/**
|
|
1449
|
+
* @publicApi
|
|
1450
|
+
*/
|
|
1451
|
+
declare interface PluginMobileVoucherDetails {
|
|
1452
|
+
/** 상품권 소스 */
|
|
1453
|
+
source: '모바일 상품권' | string;
|
|
1454
|
+
/** 상품권 구분자 */
|
|
1455
|
+
sourceId: 'MOBILE_VOUCHER' | string;
|
|
1456
|
+
/** 상품권 번호 */
|
|
1457
|
+
code: string;
|
|
1458
|
+
/** 상품권 발행사 */
|
|
1459
|
+
provider?: 'COOP_MARKETING' | 'KPC' | 'UNKNOWN' | '페이코' | string;
|
|
1460
|
+
approvalNo?: string;
|
|
1461
|
+
amount?: number;
|
|
1462
|
+
/** 상품권 PIN (오프라인 상품권이나 PIN 입력이 강제되는 온라인 상품권의 경우에만 사용) */
|
|
1463
|
+
pin?: string;
|
|
1464
|
+
/** 상품권 잔액 */
|
|
1465
|
+
balance?: number;
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1334
1468
|
/**
|
|
1335
1469
|
* @publicApi
|
|
1336
1470
|
* @description pluginOrder orderDto를 서버에 저장 후 가공해서 내려 준 값
|
|
@@ -1540,7 +1674,7 @@ export declare type PluginOrderState = 'REQUESTED' | 'OPENED' | 'COMPLETED' | 'C
|
|
|
1540
1674
|
/**
|
|
1541
1675
|
* @publicApi
|
|
1542
1676
|
*/
|
|
1543
|
-
export declare type PluginPayment = (PluginCardPayment | PluginCashPayment | PluginExternalPayment | PluginAccountTransferPayment | PluginBarcodePayment) & {
|
|
1677
|
+
export declare type PluginPayment = (PluginCardPayment | PluginCashPayment | PluginExternalPayment | PluginAccountTransferPayment | PluginBarcodePayment | PluginPrepaidValuePayment) & {
|
|
1544
1678
|
paymentKey: string;
|
|
1545
1679
|
};
|
|
1546
1680
|
|
|
@@ -1638,14 +1772,29 @@ export declare type PluginPaymentOf<S extends PluginPaymentSourceType> = Extract
|
|
|
1638
1772
|
* CASH: 현금
|
|
1639
1773
|
* BARCODE: 바코드/QR을 사용하는 간편결제
|
|
1640
1774
|
* EXTERNAL: 기타결제(쿠폰, 외상 등)
|
|
1775
|
+
* PREPAID_VALUE: 상품권/제휴사포인트
|
|
1641
1776
|
*/
|
|
1642
|
-
export declare type PluginPaymentSourceType = 'CARD' | 'CASH' | 'EXTERNAL' | 'BARCODE' | 'ACCOUNT_TRANSFER';
|
|
1777
|
+
export declare type PluginPaymentSourceType = 'CARD' | 'CASH' | 'EXTERNAL' | 'BARCODE' | 'ACCOUNT_TRANSFER' | 'PREPAID_VALUE';
|
|
1643
1778
|
|
|
1644
1779
|
/**
|
|
1645
1780
|
* @publicApi
|
|
1646
1781
|
*/
|
|
1647
1782
|
export declare type PluginPaymentState = 'APPROVED' | 'COMPLETED' | 'CANCELLED';
|
|
1648
1783
|
|
|
1784
|
+
/**
|
|
1785
|
+
* @publicApi
|
|
1786
|
+
*/
|
|
1787
|
+
declare type PluginPrepaidValueDetails = PluginMobileVoucherDetails | PluginExternalLoyaltyPointDetails;
|
|
1788
|
+
|
|
1789
|
+
/**
|
|
1790
|
+
* @publicApi
|
|
1791
|
+
* 상품권/제휴사포인트 결제
|
|
1792
|
+
*/
|
|
1793
|
+
declare interface PluginPrepaidValuePayment extends PluginPaymentBase {
|
|
1794
|
+
sourceType: 'PREPAID_VALUE';
|
|
1795
|
+
prepaidValueDetails: PluginPrepaidValueDetails;
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1649
1798
|
/**
|
|
1650
1799
|
* @publicApi
|
|
1651
1800
|
*/
|
|
@@ -1769,6 +1918,9 @@ export declare type PosPluginSdk = {
|
|
|
1769
1918
|
kdsOrder: KdsOrder;
|
|
1770
1919
|
pluginUnicast: PluginUnicastTypes;
|
|
1771
1920
|
navigation: Navigation;
|
|
1921
|
+
delivery: {
|
|
1922
|
+
dispatch: DeliveryDispatch;
|
|
1923
|
+
};
|
|
1772
1924
|
};
|
|
1773
1925
|
|
|
1774
1926
|
/**
|
|
@@ -1800,14 +1952,20 @@ export declare const PosRateLimiter: () => MethodDecorator;
|
|
|
1800
1952
|
export declare type PowerSaverTypes = {
|
|
1801
1953
|
/**
|
|
1802
1954
|
* 절전모드 방지를 시작합니다.
|
|
1955
|
+
*
|
|
1956
|
+
* windows, macos에서만 지원되며, 그 외 플랫폼에서는 에러가 발생합니다.
|
|
1803
1957
|
*/
|
|
1804
1958
|
startBlocking(): Promise<void>;
|
|
1805
1959
|
/**
|
|
1806
1960
|
* 절전모드 방지를 해제합니다.
|
|
1961
|
+
*
|
|
1962
|
+
* windows, macos에서만 지원되며, 그 외 플랫폼에서는 에러가 발생합니다.
|
|
1807
1963
|
*/
|
|
1808
1964
|
stopBlocking(): Promise<void>;
|
|
1809
1965
|
/**
|
|
1810
1966
|
* 절전모드 방지가 활성화 상태인지 확인합니다.
|
|
1967
|
+
*
|
|
1968
|
+
* windows, macos에서만 지원되며, 그 외 플랫폼에서는 에러가 발생합니다.
|
|
1811
1969
|
*/
|
|
1812
1970
|
isBlocked(): Promise<boolean>;
|
|
1813
1971
|
};
|
|
@@ -2005,7 +2163,7 @@ declare type ValueOf<ObjectType, ValueType extends keyof ObjectType = keyof Obje
|
|
|
2005
2163
|
/**
|
|
2006
2164
|
* @publicApi
|
|
2007
2165
|
*/
|
|
2008
|
-
export declare type VanType = 'NICE' | 'KIS' | 'SMARTRO' | 'KOVAN';
|
|
2166
|
+
export declare type VanType = 'NICE' | 'KIS' | 'SMARTRO' | 'KOVAN' | 'DAOU' | 'KSNET' | 'SECTA9' | 'KPN' | 'KOCES';
|
|
2009
2167
|
|
|
2010
2168
|
/**
|
|
2011
2169
|
* @publicApi
|