@kiminix/tp-client 2.9.3 → 2.9.5

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.
@@ -1,6 +1,7 @@
1
1
  import { Order } from "../shared/types";
2
2
  import { OrderStatus } from "../../enum";
3
3
  import { CallWaiter, CallWaiterStatus } from "./types/get-calls-response";
4
+ import { Category } from "./types/get-menu-response";
4
5
  export declare class MenuAdminAPIs {
5
6
  static updateOrders(props: {
6
7
  token?: string;
@@ -33,4 +34,7 @@ export declare class MenuAdminAPIs {
33
34
  deviceId: string;
34
35
  qrCodeId: string;
35
36
  }): Promise<undefined>;
37
+ static getMenu(props: {
38
+ token?: string;
39
+ }): Promise<Category[]>;
36
40
  }
@@ -125,7 +125,7 @@ var MenuAdminAPIs = /** @class */ (function () {
125
125
  return __awaiter(this, void 0, void 0, function () {
126
126
  return __generator(this, function (_a) {
127
127
  return [2 /*return*/, RequestUtils.send(function () {
128
- return axios.patch(base + "/menus/admin/unauthorized", {
128
+ return axios.post(base + "/menus/admin/unauthorized", {
129
129
  deviceId: props.deviceId,
130
130
  qrCodeId: props.qrCodeId
131
131
  }, {
@@ -138,6 +138,20 @@ var MenuAdminAPIs = /** @class */ (function () {
138
138
  });
139
139
  });
140
140
  };
141
+ MenuAdminAPIs.getMenu = function (props) {
142
+ return __awaiter(this, void 0, void 0, function () {
143
+ return __generator(this, function (_a) {
144
+ return [2 /*return*/, RequestUtils.send(function () {
145
+ return axios.get(base + "/menus/admin", {
146
+ headers: {
147
+ 'Authorization': "".concat(props.token)
148
+ }
149
+ })
150
+ .then(function (response) { return response.data; });
151
+ })];
152
+ });
153
+ });
154
+ };
141
155
  return MenuAdminAPIs;
142
156
  }());
143
157
  export { MenuAdminAPIs };
@@ -1,6 +1,7 @@
1
1
  export interface CallWaiter {
2
2
  id: string;
3
3
  qrCodeLabel: string;
4
+ qrCodeId: string;
4
5
  deviceId: string;
5
6
  status: CallWaiterStatus;
6
7
  createdAt: string;
@@ -0,0 +1,20 @@
1
+ export interface Category {
2
+ label: string;
3
+ isPublic: boolean;
4
+ products: Product[];
5
+ }
6
+ export declare class Product {
7
+ id: string;
8
+ label: string;
9
+ description?: string;
10
+ picture: string;
11
+ variants: Variant[];
12
+ }
13
+ export declare function isAvailable(product: Product): boolean;
14
+ export interface Variant {
15
+ id: string;
16
+ label?: string;
17
+ isAvailable: boolean;
18
+ price: number;
19
+ discount?: number;
20
+ }
@@ -0,0 +1,10 @@
1
+ var Product = /** @class */ (function () {
2
+ function Product() {
3
+ }
4
+ return Product;
5
+ }());
6
+ export { Product };
7
+ export function isAvailable(product) {
8
+ return product.variants.map(function (variant) { return variant.isAvailable; })
9
+ .reduce(function (a, b) { return a || b; }, false);
10
+ }
@@ -4,5 +4,7 @@ export * from "./user/types/post-order";
4
4
  export * from "./user/types/post-call-waiter-request";
5
5
  export { MenuGuestAPIs } from './user/guest-apis';
6
6
  export * from "./admin/types/get-calls-response";
7
+ import * as AdminMenuResponse from "./admin/types/get-menu-response";
8
+ export { AdminMenuResponse };
7
9
  export { MenuAdminAPIs } from './admin/admin-apis';
8
10
  export * from "./shared/types";
@@ -6,6 +6,8 @@ export * from "./user/types/post-call-waiter-request";
6
6
  export { MenuGuestAPIs } from './user/guest-apis';
7
7
  // admin module
8
8
  export * from "./admin/types/get-calls-response";
9
+ import * as AdminMenuResponse from "./admin/types/get-menu-response";
10
+ export { AdminMenuResponse };
9
11
  export { MenuAdminAPIs } from './admin/admin-apis';
10
12
  // shared module
11
13
  export * from "./shared/types";
@@ -2,6 +2,7 @@ import { OrderStatus } from "../../enum";
2
2
  export interface Order {
3
3
  id: string;
4
4
  qrCodeLabel: string;
5
+ qrCodeId: string;
5
6
  deviceId: string;
6
7
  status: OrderStatus;
7
8
  price: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiminix/tp-client",
3
- "version": "2.9.3",
3
+ "version": "2.9.5",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [