@kiminix/tp-client 2.9.4 → 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.
- package/dist/menus/admin/admin-apis.d.ts +4 -0
- package/dist/menus/admin/admin-apis.js +14 -0
- package/dist/menus/admin/types/get-menu-response.d.ts +20 -0
- package/dist/menus/admin/types/get-menu-response.js +10 -0
- package/dist/menus/index.d.ts +2 -0
- package/dist/menus/index.js +2 -0
- package/package.json +1 -1
|
@@ -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
|
}
|
|
@@ -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 };
|
|
@@ -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
|
+
}
|
package/dist/menus/index.d.ts
CHANGED
|
@@ -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";
|
package/dist/menus/index.js
CHANGED
|
@@ -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";
|