@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/dist/sdk.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,34 @@ 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
+ /**
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
+
182
205
  declare type DeliveryOrder = Order_2 & {
183
206
  type: 'DELIVERY';
184
207
  /**
@@ -197,6 +220,17 @@ declare type DeliveryOrder = Order_2 & {
197
220
  status: DeliveryStatus;
198
221
  };
199
222
 
223
+ /**
224
+ * @publicApi
225
+ * @internal
226
+ */
227
+ export declare type DeliveryPauseDuration = {
228
+ type: 'minutes';
229
+ minutes: number;
230
+ } | {
231
+ type: 'today';
232
+ };
233
+
200
234
  /**
201
235
  * @publicApi
202
236
  */
@@ -209,6 +243,41 @@ export declare interface Device {
209
243
  getDeviceInfo(): Promise<DeviceInfo>;
210
244
  }
211
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
+
212
281
  /**
213
282
  * @publicApi
214
283
  */
@@ -227,41 +296,50 @@ export declare type DeviceInfo = {
227
296
  * Windows와 macos에서만 지원됩니다
228
297
  */
229
298
  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
- };
299
+ /**
300
+ * @deprecated device.setting.request의 DeviceSetting을 사용해주세요
301
+ */
302
+ businessType: DeviceBusinessType;
261
303
  };
262
304
 
263
305
  declare type Digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';
264
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
+
265
343
  /**
266
344
  * @publicApi
267
345
  */
@@ -456,12 +534,13 @@ declare type MovePayload = {
456
534
  export declare interface Navigation {
457
535
  navigate(page: 'plugin-tab', packageName?: string): void;
458
536
  navigate(page: 'business-type-setting'): void;
537
+ navigate(page: 'delivery-connection'): void;
459
538
  /**
460
539
  * 포스에서 페이지를 이동합니다.
461
- * @param page business-type-setting 업종유형 변경, plugin-tab 플러그인 탭 이동
540
+ * @param page business-type-setting 업종유형 변경, delivery-connection 설정 > 배달앱, plugin-tab 플러그인 탭 이동
462
541
  * @param packageName 이동할 탭의 이름, 없는 경우 첫번째 플러그인 탭으로 이동합니다
463
542
  */
464
- navigate(page: 'business-type-setting' | 'plugin-tab', packageName?: string): void;
543
+ navigate(page: 'business-type-setting' | 'delivery-connection' | 'plugin-tab', packageName?: string): void;
465
544
  }
466
545
 
467
546
  /**
@@ -470,6 +549,7 @@ export declare interface Navigation {
470
549
  export declare class NavigationImpl implements Navigation {
471
550
  navigate(page: 'plugin-tab', packageName?: string): void;
472
551
  navigate(page: 'business-type-setting'): void;
552
+ navigate(page: 'delivery-connection'): void;
473
553
  }
474
554
 
475
555
  /**
@@ -597,6 +677,7 @@ declare type PayCallback = (order: PluginOrder, price: PluginPrice, ui: Ui) => P
597
677
  export declare interface Payment {
598
678
  on(event: 'cancel' | 'paid', callback: PaymentCallback): void;
599
679
  on(event: 'before-cancel', callback: PaymentBeforeCancelCallback): void;
680
+ on(event: 'before-cancel-all', callback: PaymentBeforeCancelAllCallback): void;
600
681
  cancel: (order: {
601
682
  id: string;
602
683
  }, payment: {
@@ -608,6 +689,14 @@ export declare interface Payment {
608
689
  getPayment: (paymentId: PluginPayment['id']) => Promise<PluginPayment>;
609
690
  }
610
691
 
692
+ /**
693
+ * @publicApi
694
+ */
695
+ export declare type PaymentBeforeCancelAllCallback = (payload: {
696
+ order: PluginOrder;
697
+ payments: PluginPayment[];
698
+ }) => Promise<void>;
699
+
611
700
  /**
612
701
  * @publicApi
613
702
  */
@@ -942,6 +1031,7 @@ export declare interface PluginCatalogItemOption {
942
1031
  export declare interface PluginCatalogItemOptionChoice {
943
1032
  id: number;
944
1033
  title: string;
1034
+ code?: string;
945
1035
  titleI18n?: PluginLanguagePack;
946
1036
  /** 옵션에 딸린 가격이 없는 경우 0 */
947
1037
  priceValue: number;
@@ -1047,8 +1137,7 @@ export declare type PluginDeliveryOrderDtoV2 = Omit<PluginOrderDto, 'lineItems'
1047
1137
  delivery: PluginDelivery<'DELIVERY' | 'PICKUP' | 'HERE'>;
1048
1138
  discounts: Array<PluginDeliveryDiscount>;
1049
1139
  lineItems: Array<Omit<PluginOrderItem, 'id' | 'orderId' | 'item' | 'optionChoices' | 'discounts' | 'chargePrice'> & {
1050
- item: {
1051
- title: string;
1140
+ item: Pick<PluginCatalogItem, 'title' | 'code'> & {
1052
1141
  type: 'ITEM' | 'DELIVERY_FEE';
1053
1142
  };
1054
1143
  /**
@@ -1057,9 +1146,7 @@ export declare type PluginDeliveryOrderDtoV2 = Omit<PluginOrderDto, 'lineItems'
1057
1146
  itemPrice: {
1058
1147
  value: number;
1059
1148
  };
1060
- optionChoices: Array<{
1061
- title: string;
1062
- priceValue: number;
1149
+ optionChoices: Array<Pick<PluginCatalogItemOptionChoice, 'title' | 'code' | 'priceValue'> & {
1063
1150
  quantity: number;
1064
1151
  }>;
1065
1152
  discounts?: Array<PluginDeliveryDiscount>;
@@ -1191,6 +1278,22 @@ declare interface PluginExternalDto extends PluginPaymentDtoBase {
1191
1278
  sourceType: 'EXTERNAL';
1192
1279
  }
1193
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
+
1194
1297
  /**
1195
1298
  * @publicApi
1196
1299
  */
@@ -1342,6 +1445,26 @@ export declare interface PluginLanguagePack {
1342
1445
  languages: Partial<Languages>;
1343
1446
  }
1344
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
+
1345
1468
  /**
1346
1469
  * @publicApi
1347
1470
  * @description pluginOrder orderDto를 서버에 저장 후 가공해서 내려 준 값
@@ -1551,7 +1674,7 @@ export declare type PluginOrderState = 'REQUESTED' | 'OPENED' | 'COMPLETED' | 'C
1551
1674
  /**
1552
1675
  * @publicApi
1553
1676
  */
1554
- export declare type PluginPayment = (PluginCardPayment | PluginCashPayment | PluginExternalPayment | PluginAccountTransferPayment | PluginBarcodePayment) & {
1677
+ export declare type PluginPayment = (PluginCardPayment | PluginCashPayment | PluginExternalPayment | PluginAccountTransferPayment | PluginBarcodePayment | PluginPrepaidValuePayment) & {
1555
1678
  paymentKey: string;
1556
1679
  };
1557
1680
 
@@ -1649,14 +1772,29 @@ export declare type PluginPaymentOf<S extends PluginPaymentSourceType> = Extract
1649
1772
  * CASH: 현금
1650
1773
  * BARCODE: 바코드/QR을 사용하는 간편결제
1651
1774
  * EXTERNAL: 기타결제(쿠폰, 외상 등)
1775
+ * PREPAID_VALUE: 상품권/제휴사포인트
1652
1776
  */
1653
- export declare type PluginPaymentSourceType = 'CARD' | 'CASH' | 'EXTERNAL' | 'BARCODE' | 'ACCOUNT_TRANSFER';
1777
+ export declare type PluginPaymentSourceType = 'CARD' | 'CASH' | 'EXTERNAL' | 'BARCODE' | 'ACCOUNT_TRANSFER' | 'PREPAID_VALUE';
1654
1778
 
1655
1779
  /**
1656
1780
  * @publicApi
1657
1781
  */
1658
1782
  export declare type PluginPaymentState = 'APPROVED' | 'COMPLETED' | 'CANCELLED';
1659
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
+
1660
1798
  /**
1661
1799
  * @publicApi
1662
1800
  */
@@ -1780,6 +1918,9 @@ export declare type PosPluginSdk = {
1780
1918
  kdsOrder: KdsOrder;
1781
1919
  pluginUnicast: PluginUnicastTypes;
1782
1920
  navigation: Navigation;
1921
+ delivery: {
1922
+ dispatch: DeliveryDispatch;
1923
+ };
1783
1924
  };
1784
1925
 
1785
1926
  /**
@@ -1811,14 +1952,20 @@ export declare const PosRateLimiter: () => MethodDecorator;
1811
1952
  export declare type PowerSaverTypes = {
1812
1953
  /**
1813
1954
  * 절전모드 방지를 시작합니다.
1955
+ *
1956
+ * windows, macos에서만 지원되며, 그 외 플랫폼에서는 에러가 발생합니다.
1814
1957
  */
1815
1958
  startBlocking(): Promise<void>;
1816
1959
  /**
1817
1960
  * 절전모드 방지를 해제합니다.
1961
+ *
1962
+ * windows, macos에서만 지원되며, 그 외 플랫폼에서는 에러가 발생합니다.
1818
1963
  */
1819
1964
  stopBlocking(): Promise<void>;
1820
1965
  /**
1821
1966
  * 절전모드 방지가 활성화 상태인지 확인합니다.
1967
+ *
1968
+ * windows, macos에서만 지원되며, 그 외 플랫폼에서는 에러가 발생합니다.
1822
1969
  */
1823
1970
  isBlocked(): Promise<boolean>;
1824
1971
  };
@@ -2016,7 +2163,7 @@ declare type ValueOf<ObjectType, ValueType extends keyof ObjectType = keyof Obje
2016
2163
  /**
2017
2164
  * @publicApi
2018
2165
  */
2019
- export declare type VanType = 'NICE' | 'KIS' | 'SMARTRO' | 'KOVAN';
2166
+ export declare type VanType = 'NICE' | 'KIS' | 'SMARTRO' | 'KOVAN' | 'DAOU' | 'KSNET' | 'SECTA9' | 'KPN' | 'KOCES';
2020
2167
 
2021
2168
  /**
2022
2169
  * @publicApi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tossplace/pos-plugin-sdk",
3
- "version": "0.0.27",
3
+ "version": "0.0.28",
4
4
  "description": "포스 플러그인 sdk",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",