@tossplace/pos-plugin-sdk 0.0.19 → 0.0.20

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
@@ -361,6 +361,14 @@ declare type InputValue = {
361
361
 
362
362
  declare type Join<T extends string, U extends string> = `${T}${U}` | '0';
363
363
 
364
+ /**
365
+ * @publicApi
366
+ */
367
+ declare interface KdsOrder {
368
+ on(event: 'open' | 'complete' | 'cancel', callback: (id: PluginKdsOrderItem['id']) => void): void;
369
+ getKdsOrderItems(payload: PluginGetKdsOrderItemsPayload): Promise<PluginGetKdsOrderItemsResult>;
370
+ }
371
+
364
372
  declare type Languages = Record<PluginLanguageCode, string>;
365
373
 
366
374
  /**
@@ -1111,6 +1119,21 @@ export declare interface PluginExternalPayment extends PluginPaymentBase {
1111
1119
  };
1112
1120
  }
1113
1121
 
1122
+ declare interface PluginGetKdsOrderItemsPayload {
1123
+ states?: PluginKdsOrderItemState[];
1124
+ page: number;
1125
+ size: number;
1126
+ orderIds?: string[];
1127
+ categoryIds?: number[];
1128
+ itemIds?: number[];
1129
+ }
1130
+
1131
+ declare interface PluginGetKdsOrderItemsResult {
1132
+ contents: PluginKdsOrderItem[];
1133
+ last: boolean;
1134
+ totalElements: number;
1135
+ }
1136
+
1114
1137
  /**
1115
1138
  * @publicApi
1116
1139
  * 테이블이 놓여진 공간
@@ -1153,6 +1176,57 @@ declare class PluginImpl implements Plugin_2 {
1153
1176
  */
1154
1177
  export declare type PluginInputs = TextInput | PasswordInput | RadioInput | CheckBoxInput | ToggleInput | SliderInput | NumberInput;
1155
1178
 
1179
+ declare interface PluginKdsLineItem {
1180
+ title: string;
1181
+ diningOption: PluginOrderDiningOption;
1182
+ id: string;
1183
+ itemId: PluginOrderItem['id'];
1184
+ memo: string;
1185
+ optionChoices: PluginOrderItem['optionChoices'];
1186
+ orderPrice: PluginKdsLineItemOrderPrice;
1187
+ quantity: {
1188
+ previous: number;
1189
+ current: number;
1190
+ };
1191
+ appliedDiscounts: PluginDiscount[];
1192
+ item: {
1193
+ id: number;
1194
+ category: {
1195
+ id: number;
1196
+ order: number;
1197
+ };
1198
+ };
1199
+ createdAt: string;
1200
+ updatedAt: string;
1201
+ }
1202
+
1203
+ declare interface PluginKdsLineItemOrderPrice {
1204
+ orderDiscountValue: number;
1205
+ orderListPriceValue: number;
1206
+ orderPriceValue: number;
1207
+ }
1208
+
1209
+ declare interface PluginKdsOrder extends Omit<PluginOrder, 'lineItems'> {
1210
+ }
1211
+
1212
+ declare interface PluginKdsOrderItem {
1213
+ id: string;
1214
+ state: PluginKdsOrderItemState;
1215
+ order: PluginKdsOrder;
1216
+ lineItems: PluginKdsLineItem[];
1217
+ diningOption: PluginOrderDiningOption;
1218
+ totalQuantity: number;
1219
+ orderRequestType: PluginKdsOrderRequestType;
1220
+ cancelledAt: string;
1221
+ completedAt: string;
1222
+ createdAt: string;
1223
+ updatedAt: string;
1224
+ }
1225
+
1226
+ declare type PluginKdsOrderItemState = 'OPENED' | 'COMPLETED' | 'CANCELLED';
1227
+
1228
+ declare type PluginKdsOrderRequestType = 'ADDED' | 'NEW' | 'CHANGED' | 'CANCELLED' | 'MERGED';
1229
+
1156
1230
  declare type PluginLanguageCode = ValueOf<typeof AvailableLanguageCodes>;
1157
1231
 
1158
1232
  /**
@@ -1573,6 +1647,7 @@ export declare type PosPluginSdk = {
1573
1647
  error: ErrorImpl;
1574
1648
  powerSaver: PowerSaverTypes;
1575
1649
  sound: SoundTypes;
1650
+ kdsOrder: KdsOrder;
1576
1651
  };
1577
1652
 
1578
1653
  /**
@@ -1732,6 +1807,7 @@ declare type TextInput = BaseInput & {
1732
1807
  */
1733
1808
  export declare type ToastTypes = {
1734
1809
  open(message: string): void;
1810
+ on(event: 'click', callback: () => void): () => void;
1735
1811
  };
1736
1812
 
1737
1813
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tossplace/pos-plugin-sdk",
3
- "version": "0.0.19",
3
+ "version": "0.0.20",
4
4
  "description": "포스 플러그인 sdk",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
package/types/index.d.ts CHANGED
@@ -361,6 +361,14 @@ declare type InputValue = {
361
361
 
362
362
  declare type Join<T extends string, U extends string> = `${T}${U}` | '0';
363
363
 
364
+ /**
365
+ * @publicApi
366
+ */
367
+ declare interface KdsOrder {
368
+ on(event: 'open' | 'complete' | 'cancel', callback: (id: PluginKdsOrderItem['id']) => void): void;
369
+ getKdsOrderItems(payload: PluginGetKdsOrderItemsPayload): Promise<PluginGetKdsOrderItemsResult>;
370
+ }
371
+
364
372
  declare type Languages = Record<PluginLanguageCode, string>;
365
373
 
366
374
  /**
@@ -1111,6 +1119,21 @@ export declare interface PluginExternalPayment extends PluginPaymentBase {
1111
1119
  };
1112
1120
  }
1113
1121
 
1122
+ declare interface PluginGetKdsOrderItemsPayload {
1123
+ states?: PluginKdsOrderItemState[];
1124
+ page: number;
1125
+ size: number;
1126
+ orderIds?: string[];
1127
+ categoryIds?: number[];
1128
+ itemIds?: number[];
1129
+ }
1130
+
1131
+ declare interface PluginGetKdsOrderItemsResult {
1132
+ contents: PluginKdsOrderItem[];
1133
+ last: boolean;
1134
+ totalElements: number;
1135
+ }
1136
+
1114
1137
  /**
1115
1138
  * @publicApi
1116
1139
  * 테이블이 놓여진 공간
@@ -1153,6 +1176,57 @@ declare class PluginImpl implements Plugin_2 {
1153
1176
  */
1154
1177
  export declare type PluginInputs = TextInput | PasswordInput | RadioInput | CheckBoxInput | ToggleInput | SliderInput | NumberInput;
1155
1178
 
1179
+ declare interface PluginKdsLineItem {
1180
+ title: string;
1181
+ diningOption: PluginOrderDiningOption;
1182
+ id: string;
1183
+ itemId: PluginOrderItem['id'];
1184
+ memo: string;
1185
+ optionChoices: PluginOrderItem['optionChoices'];
1186
+ orderPrice: PluginKdsLineItemOrderPrice;
1187
+ quantity: {
1188
+ previous: number;
1189
+ current: number;
1190
+ };
1191
+ appliedDiscounts: PluginDiscount[];
1192
+ item: {
1193
+ id: number;
1194
+ category: {
1195
+ id: number;
1196
+ order: number;
1197
+ };
1198
+ };
1199
+ createdAt: string;
1200
+ updatedAt: string;
1201
+ }
1202
+
1203
+ declare interface PluginKdsLineItemOrderPrice {
1204
+ orderDiscountValue: number;
1205
+ orderListPriceValue: number;
1206
+ orderPriceValue: number;
1207
+ }
1208
+
1209
+ declare interface PluginKdsOrder extends Omit<PluginOrder, 'lineItems'> {
1210
+ }
1211
+
1212
+ declare interface PluginKdsOrderItem {
1213
+ id: string;
1214
+ state: PluginKdsOrderItemState;
1215
+ order: PluginKdsOrder;
1216
+ lineItems: PluginKdsLineItem[];
1217
+ diningOption: PluginOrderDiningOption;
1218
+ totalQuantity: number;
1219
+ orderRequestType: PluginKdsOrderRequestType;
1220
+ cancelledAt: string;
1221
+ completedAt: string;
1222
+ createdAt: string;
1223
+ updatedAt: string;
1224
+ }
1225
+
1226
+ declare type PluginKdsOrderItemState = 'OPENED' | 'COMPLETED' | 'CANCELLED';
1227
+
1228
+ declare type PluginKdsOrderRequestType = 'ADDED' | 'NEW' | 'CHANGED' | 'CANCELLED' | 'MERGED';
1229
+
1156
1230
  declare type PluginLanguageCode = ValueOf<typeof AvailableLanguageCodes>;
1157
1231
 
1158
1232
  /**
@@ -1566,6 +1640,7 @@ export declare type PosPluginSdk = {
1566
1640
  error: ErrorImpl;
1567
1641
  powerSaver: PowerSaverTypes;
1568
1642
  sound: SoundTypes;
1643
+ kdsOrder: KdsOrder;
1569
1644
  };
1570
1645
 
1571
1646
  /**
@@ -1725,6 +1800,7 @@ declare type TextInput = BaseInput & {
1725
1800
  */
1726
1801
  export declare type ToastTypes = {
1727
1802
  open(message: string): void;
1803
+ on(event: 'click', callback: () => void): () => void;
1728
1804
  };
1729
1805
 
1730
1806
  /**