@kiminix/tp-client 2.9.6 → 2.9.8

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.
@@ -3,6 +3,8 @@ import { OrderStatus } from "../../enum";
3
3
  import { CallWaiter, CallWaiterStatus } from "./types/get-calls-response";
4
4
  import { Category } from "./types/get-menu-response";
5
5
  import { Product } from "./types/get-product-response";
6
+ import { UpdateProductRequest } from "./types/update-product-request";
7
+ import { Bill } from "./types/get-bills-response";
6
8
  export declare class MenuAdminAPIs {
7
9
  static updateOrders(props: {
8
10
  token?: string;
@@ -22,6 +24,13 @@ export declare class MenuAdminAPIs {
22
24
  size: number;
23
25
  sort: "asc" | "desc";
24
26
  }): Promise<Order[]>;
27
+ static getBills(props: {
28
+ token?: string;
29
+ timestamp: number;
30
+ page: number;
31
+ size: number;
32
+ sort: "asc" | "desc";
33
+ }): Promise<Bill[]>;
25
34
  static getCalls(props: {
26
35
  token?: string;
27
36
  status: CallWaiterStatus[];
@@ -42,4 +51,8 @@ export declare class MenuAdminAPIs {
42
51
  token?: string;
43
52
  id: string;
44
53
  }): Promise<Product>;
54
+ static updateProduct(props: {
55
+ token?: string;
56
+ request: UpdateProductRequest;
57
+ }): Promise<void>;
45
58
  }
@@ -98,6 +98,28 @@ var MenuAdminAPIs = /** @class */ (function () {
98
98
  });
99
99
  });
100
100
  };
101
+ MenuAdminAPIs.getBills = function (props) {
102
+ return __awaiter(this, void 0, void 0, function () {
103
+ return __generator(this, function (_a) {
104
+ return [2 /*return*/, RequestUtils.send(function () {
105
+ var queryParams = [
106
+ "timestamp=".concat(props.timestamp),
107
+ "page=".concat(props.page),
108
+ "size=".concat(props.size),
109
+ "sort=".concat(props.sort)
110
+ ]
111
+ .filter(function (value) { return value; })
112
+ .join("&");
113
+ return axios.get(base + "/menus/admin/bills?".concat(queryParams), {
114
+ headers: {
115
+ 'Authorization': "".concat(props.token)
116
+ }
117
+ })
118
+ .then(function (response) { return response.data; });
119
+ })];
120
+ });
121
+ });
122
+ };
101
123
  MenuAdminAPIs.getCalls = function (props) {
102
124
  return __awaiter(this, void 0, void 0, function () {
103
125
  return __generator(this, function (_a) {
@@ -166,6 +188,20 @@ var MenuAdminAPIs = /** @class */ (function () {
166
188
  });
167
189
  });
168
190
  };
191
+ MenuAdminAPIs.updateProduct = function (props) {
192
+ return __awaiter(this, void 0, void 0, function () {
193
+ return __generator(this, function (_a) {
194
+ return [2 /*return*/, RequestUtils.send(function () {
195
+ return axios.patch(base + "/menus/admin/products", props.request, {
196
+ headers: {
197
+ 'Authorization': "".concat(props.token)
198
+ }
199
+ })
200
+ .then(function (_) { return undefined; });
201
+ })];
202
+ });
203
+ });
204
+ };
169
205
  return MenuAdminAPIs;
170
206
  }());
171
207
  export { MenuAdminAPIs };
@@ -0,0 +1,10 @@
1
+ export interface Bill {
2
+ id: string;
3
+ businessId: string;
4
+ number: number;
5
+ total: number;
6
+ ordersRef: string[];
7
+ ordersCount: number;
8
+ createdAt: string;
9
+ updatedAt?: string | undefined;
10
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ export interface UpdateProductRequest {
2
+ id: string;
3
+ label?: string | undefined;
4
+ description?: string | undefined;
5
+ variant?: VariantUpdate | undefined;
6
+ }
7
+ export interface VariantUpdate {
8
+ id: string;
9
+ label?: string | undefined;
10
+ isAvailable?: boolean | undefined;
11
+ price?: number | undefined;
12
+ }
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiminix/tp-client",
3
- "version": "2.9.6",
3
+ "version": "2.9.8",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [