@tossplace/pos-plugin-sdk 0.0.27 → 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/types/index.d.ts CHANGED
@@ -60,7 +60,7 @@ export declare type CashReceipt = {
60
60
  orderId: string;
61
61
  /** 현금영수증 발행 금액입니다 */
62
62
  amount: number;
63
- /** 현금영수증 발행 날짜입니다 yyyyMMddHHmmss */
63
+ /** 현금영수증 발행 날짜입니다 yyyy-MM-ddTHH:mm:ss */
64
64
  issueDate: string;
65
65
  /** 현금영수증 발행 번호입니다 */
66
66
  issueNumber: string;
@@ -174,11 +174,23 @@ export declare interface DeliveryCatalogOption {
174
174
  */
175
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;
176
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
+
177
187
  /**
178
188
  * @publicApi
179
189
  */
180
190
  export declare type DeliveryItemStatus = 'sold-out' | 'hide' | 'active' | 'invisible';
181
191
 
192
+ /* Excluded from this release type: DeliveryOperationStatus */
193
+
182
194
  declare type DeliveryOrder = Order_2 & {
183
195
  type: 'DELIVERY';
184
196
  /**
@@ -197,6 +209,8 @@ declare type DeliveryOrder = Order_2 & {
197
209
  status: DeliveryStatus;
198
210
  };
199
211
 
212
+ /* Excluded from this release type: DeliveryPauseDuration */
213
+
200
214
  /**
201
215
  * @publicApi
202
216
  */
@@ -209,6 +223,41 @@ export declare interface Device {
209
223
  getDeviceInfo(): Promise<DeviceInfo>;
210
224
  }
211
225
 
226
+ /**
227
+ * @publicApi
228
+ */
229
+ declare type DeviceBusinessType = {
230
+ business: {
231
+ type: 'CAFE' | 'RESTAURANT';
232
+ };
233
+ operation: {
234
+ payment: {
235
+ type: 'PAY_FIRST' | 'PAY_LATER';
236
+ };
237
+ table: {
238
+ enabled: boolean;
239
+ };
240
+ booking: {
241
+ enabled: boolean;
242
+ };
243
+ };
244
+ } | {
245
+ business: {
246
+ type: 'RETAIL' | 'SERVICE';
247
+ };
248
+ operation: {
249
+ payment: {
250
+ type: 'PAY_FIRST';
251
+ };
252
+ table: {
253
+ enabled: false;
254
+ };
255
+ booking: {
256
+ enabled: boolean;
257
+ };
258
+ };
259
+ };
260
+
212
261
  /**
213
262
  * @publicApi
214
263
  */
@@ -227,41 +276,50 @@ export declare type DeviceInfo = {
227
276
  * Windows와 macos에서만 지원됩니다
228
277
  */
229
278
  osVersion?: string;
230
- businessType: {
231
- business: {
232
- type: 'CAFE' | 'RESTAURANT';
233
- };
234
- operation: {
235
- payment: {
236
- type: 'PAY_FIRST' | 'PAY_LATER';
237
- };
238
- table: {
239
- enabled: boolean;
240
- };
241
- booking: {
242
- enabled: boolean;
243
- };
244
- };
245
- } | {
246
- business: {
247
- type: 'RETAIL' | 'SERVICE';
248
- };
249
- operation: {
250
- payment: {
251
- type: 'PAY_FIRST';
252
- };
253
- table: {
254
- enabled: false;
255
- };
256
- booking: {
257
- enabled: boolean;
258
- };
259
- };
260
- };
279
+ /**
280
+ * @deprecated device.setting.request의 DeviceSetting을 사용해주세요
281
+ */
282
+ businessType: DeviceBusinessType;
261
283
  };
262
284
 
263
285
  declare type Digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';
264
286
 
287
+ /**
288
+ * @publicApi
289
+ */
290
+ export declare interface Dispatch {
291
+ dispatchId: number;
292
+ orderId: string;
293
+ status: DispatchStatus;
294
+ riderStatus: DispatchDeliveryStatus;
295
+ provider: DispatchProvider;
296
+ }
297
+
298
+ /**
299
+ * @publicApi
300
+ */
301
+ export declare type DispatchChangePayload = Pick<Dispatch, 'orderId' | 'dispatchId'>;
302
+
303
+ /**
304
+ * @publicApi
305
+ */
306
+ export declare type DispatchDeliveryStatus = 'NOT_ALLOCATION' | 'ASSIGNED' | 'PICKUP_COMPLETED' | 'DELIVERY_COMPLETED';
307
+
308
+ /**
309
+ * @publicApi
310
+ */
311
+ export declare interface DispatchProvider {
312
+ type: 'SELF' | 'AGENCY';
313
+ id: number;
314
+ code: string;
315
+ name: string;
316
+ }
317
+
318
+ /**
319
+ * @publicApi
320
+ */
321
+ export declare type DispatchStatus = 'WAITING_ALLOCATION' | 'ALLOCATION_COMPLETED' | 'CANCEL_WAITING' | 'CANCEL_COMPLETED' | 'COMPLETED';
322
+
265
323
  /**
266
324
  * @publicApi
267
325
  */
@@ -456,12 +514,13 @@ declare type MovePayload = {
456
514
  export declare interface Navigation {
457
515
  navigate(page: 'plugin-tab', packageName?: string): void;
458
516
  navigate(page: 'business-type-setting'): void;
517
+ navigate(page: 'delivery-connection'): void;
459
518
  /**
460
519
  * 포스에서 페이지를 이동합니다.
461
- * @param page business-type-setting 업종유형 변경, plugin-tab 플러그인 탭 이동
520
+ * @param page business-type-setting 업종유형 변경, delivery-connection 설정 > 배달앱, plugin-tab 플러그인 탭 이동
462
521
  * @param packageName 이동할 탭의 이름, 없는 경우 첫번째 플러그인 탭으로 이동합니다
463
522
  */
464
- navigate(page: 'business-type-setting' | 'plugin-tab', packageName?: string): void;
523
+ navigate(page: 'business-type-setting' | 'delivery-connection' | 'plugin-tab', packageName?: string): void;
465
524
  }
466
525
 
467
526
  /**
@@ -470,6 +529,7 @@ export declare interface Navigation {
470
529
  export declare class NavigationImpl implements Navigation {
471
530
  navigate(page: 'plugin-tab', packageName?: string): void;
472
531
  navigate(page: 'business-type-setting'): void;
532
+ navigate(page: 'delivery-connection'): void;
473
533
  }
474
534
 
475
535
  /**
@@ -597,6 +657,7 @@ declare type PayCallback = (order: PluginOrder, price: PluginPrice, ui: Ui) => P
597
657
  export declare interface Payment {
598
658
  on(event: 'cancel' | 'paid', callback: PaymentCallback): void;
599
659
  on(event: 'before-cancel', callback: PaymentBeforeCancelCallback): void;
660
+ on(event: 'before-cancel-all', callback: PaymentBeforeCancelAllCallback): void;
600
661
  cancel: (order: {
601
662
  id: string;
602
663
  }, payment: {
@@ -608,6 +669,14 @@ export declare interface Payment {
608
669
  getPayment: (paymentId: PluginPayment['id']) => Promise<PluginPayment>;
609
670
  }
610
671
 
672
+ /**
673
+ * @publicApi
674
+ */
675
+ export declare type PaymentBeforeCancelAllCallback = (payload: {
676
+ order: PluginOrder;
677
+ payments: PluginPayment[];
678
+ }) => Promise<void>;
679
+
611
680
  /**
612
681
  * @publicApi
613
682
  */
@@ -942,6 +1011,7 @@ export declare interface PluginCatalogItemOption {
942
1011
  export declare interface PluginCatalogItemOptionChoice {
943
1012
  id: number;
944
1013
  title: string;
1014
+ code?: string;
945
1015
  titleI18n?: PluginLanguagePack;
946
1016
  /** 옵션에 딸린 가격이 없는 경우 0 */
947
1017
  priceValue: number;
@@ -1047,8 +1117,7 @@ export declare type PluginDeliveryOrderDtoV2 = Omit<PluginOrderDto, 'lineItems'
1047
1117
  delivery: PluginDelivery<'DELIVERY' | 'PICKUP' | 'HERE'>;
1048
1118
  discounts: Array<PluginDeliveryDiscount>;
1049
1119
  lineItems: Array<Omit<PluginOrderItem, 'id' | 'orderId' | 'item' | 'optionChoices' | 'discounts' | 'chargePrice'> & {
1050
- item: {
1051
- title: string;
1120
+ item: Pick<PluginCatalogItem, 'title' | 'code'> & {
1052
1121
  type: 'ITEM' | 'DELIVERY_FEE';
1053
1122
  };
1054
1123
  /**
@@ -1057,9 +1126,7 @@ export declare type PluginDeliveryOrderDtoV2 = Omit<PluginOrderDto, 'lineItems'
1057
1126
  itemPrice: {
1058
1127
  value: number;
1059
1128
  };
1060
- optionChoices: Array<{
1061
- title: string;
1062
- priceValue: number;
1129
+ optionChoices: Array<Pick<PluginCatalogItemOptionChoice, 'title' | 'code' | 'priceValue'> & {
1063
1130
  quantity: number;
1064
1131
  }>;
1065
1132
  discounts?: Array<PluginDeliveryDiscount>;
@@ -1191,6 +1258,22 @@ declare interface PluginExternalDto extends PluginPaymentDtoBase {
1191
1258
  sourceType: 'EXTERNAL';
1192
1259
  }
1193
1260
 
1261
+ /**
1262
+ * @publicApi
1263
+ */
1264
+ declare interface PluginExternalLoyaltyPointDetails {
1265
+ source: '제휴사포인트';
1266
+ sourceId: 'EXTERNAL_LOYALTY_POINT';
1267
+ /** 제휴사 구분자 */
1268
+ provider: 'OKCASHBAG' | 'LPOINT';
1269
+ /** 포인트 카드 번호 */
1270
+ code: string;
1271
+ approvalNo: string;
1272
+ amount: number;
1273
+ /** 포인트 잔액 */
1274
+ balance: number;
1275
+ }
1276
+
1194
1277
  /**
1195
1278
  * @publicApi
1196
1279
  */
@@ -1342,6 +1425,26 @@ export declare interface PluginLanguagePack {
1342
1425
  languages: Partial<Languages>;
1343
1426
  }
1344
1427
 
1428
+ /**
1429
+ * @publicApi
1430
+ */
1431
+ declare interface PluginMobileVoucherDetails {
1432
+ /** 상품권 소스 */
1433
+ source: '모바일 상품권' | string;
1434
+ /** 상품권 구분자 */
1435
+ sourceId: 'MOBILE_VOUCHER' | string;
1436
+ /** 상품권 번호 */
1437
+ code: string;
1438
+ /** 상품권 발행사 */
1439
+ provider?: 'COOP_MARKETING' | 'KPC' | 'UNKNOWN' | '페이코' | string;
1440
+ approvalNo?: string;
1441
+ amount?: number;
1442
+ /** 상품권 PIN (오프라인 상품권이나 PIN 입력이 강제되는 온라인 상품권의 경우에만 사용) */
1443
+ pin?: string;
1444
+ /** 상품권 잔액 */
1445
+ balance?: number;
1446
+ }
1447
+
1345
1448
  /**
1346
1449
  * @publicApi
1347
1450
  * @description pluginOrder orderDto를 서버에 저장 후 가공해서 내려 준 값
@@ -1551,7 +1654,7 @@ export declare type PluginOrderState = 'REQUESTED' | 'OPENED' | 'COMPLETED' | 'C
1551
1654
  /**
1552
1655
  * @publicApi
1553
1656
  */
1554
- export declare type PluginPayment = (PluginCardPayment | PluginCashPayment | PluginExternalPayment | PluginAccountTransferPayment | PluginBarcodePayment) & {
1657
+ export declare type PluginPayment = (PluginCardPayment | PluginCashPayment | PluginExternalPayment | PluginAccountTransferPayment | PluginBarcodePayment | PluginPrepaidValuePayment) & {
1555
1658
  paymentKey: string;
1556
1659
  };
1557
1660
 
@@ -1649,14 +1752,29 @@ export declare type PluginPaymentOf<S extends PluginPaymentSourceType> = Extract
1649
1752
  * CASH: 현금
1650
1753
  * BARCODE: 바코드/QR을 사용하는 간편결제
1651
1754
  * EXTERNAL: 기타결제(쿠폰, 외상 등)
1755
+ * PREPAID_VALUE: 상품권/제휴사포인트
1652
1756
  */
1653
- export declare type PluginPaymentSourceType = 'CARD' | 'CASH' | 'EXTERNAL' | 'BARCODE' | 'ACCOUNT_TRANSFER';
1757
+ export declare type PluginPaymentSourceType = 'CARD' | 'CASH' | 'EXTERNAL' | 'BARCODE' | 'ACCOUNT_TRANSFER' | 'PREPAID_VALUE';
1654
1758
 
1655
1759
  /**
1656
1760
  * @publicApi
1657
1761
  */
1658
1762
  export declare type PluginPaymentState = 'APPROVED' | 'COMPLETED' | 'CANCELLED';
1659
1763
 
1764
+ /**
1765
+ * @publicApi
1766
+ */
1767
+ declare type PluginPrepaidValueDetails = PluginMobileVoucherDetails | PluginExternalLoyaltyPointDetails;
1768
+
1769
+ /**
1770
+ * @publicApi
1771
+ * 상품권/제휴사포인트 결제
1772
+ */
1773
+ declare interface PluginPrepaidValuePayment extends PluginPaymentBase {
1774
+ sourceType: 'PREPAID_VALUE';
1775
+ prepaidValueDetails: PluginPrepaidValueDetails;
1776
+ }
1777
+
1660
1778
  /**
1661
1779
  * @publicApi
1662
1780
  */
@@ -1773,6 +1891,9 @@ export declare type PosPluginSdk = {
1773
1891
  kdsOrder: KdsOrder;
1774
1892
  pluginUnicast: PluginUnicastTypes;
1775
1893
  navigation: Navigation;
1894
+ delivery: {
1895
+ dispatch: DeliveryDispatch;
1896
+ };
1776
1897
  };
1777
1898
 
1778
1899
  /**
@@ -1804,14 +1925,20 @@ export declare const PosRateLimiter: () => MethodDecorator;
1804
1925
  export declare type PowerSaverTypes = {
1805
1926
  /**
1806
1927
  * 절전모드 방지를 시작합니다.
1928
+ *
1929
+ * windows, macos에서만 지원되며, 그 외 플랫폼에서는 에러가 발생합니다.
1807
1930
  */
1808
1931
  startBlocking(): Promise<void>;
1809
1932
  /**
1810
1933
  * 절전모드 방지를 해제합니다.
1934
+ *
1935
+ * windows, macos에서만 지원되며, 그 외 플랫폼에서는 에러가 발생합니다.
1811
1936
  */
1812
1937
  stopBlocking(): Promise<void>;
1813
1938
  /**
1814
1939
  * 절전모드 방지가 활성화 상태인지 확인합니다.
1940
+ *
1941
+ * windows, macos에서만 지원되며, 그 외 플랫폼에서는 에러가 발생합니다.
1815
1942
  */
1816
1943
  isBlocked(): Promise<boolean>;
1817
1944
  };
@@ -2009,7 +2136,7 @@ declare type ValueOf<ObjectType, ValueType extends keyof ObjectType = keyof Obje
2009
2136
  /**
2010
2137
  * @publicApi
2011
2138
  */
2012
- export declare type VanType = 'NICE' | 'KIS' | 'SMARTRO' | 'KOVAN';
2139
+ export declare type VanType = 'NICE' | 'KIS' | 'SMARTRO' | 'KOVAN' | 'DAOU' | 'KSNET' | 'SECTA9' | 'KPN' | 'KOCES';
2013
2140
 
2014
2141
  /**
2015
2142
  * @publicApi