@kiminix/tp-client 2.8.7 → 2.8.9
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 +9 -0
- package/dist/menus/admin/admin-apis.js +23 -0
- package/dist/menus/admin/types/get-calls-response.d.ts +10 -0
- package/dist/menus/admin/types/get-calls-response.js +5 -0
- package/dist/menus/index.d.ts +2 -0
- package/dist/menus/index.js +2 -0
- package/dist/menus/shared/types.d.ts +12 -11
- package/dist/menus/user/guest-apis.d.ts +4 -3
- package/dist/menus/user/guest-apis.js +4 -4
- package/dist/menus/user/types/post-call-waiter-request.d.ts +4 -0
- package/dist/menus/user/types/post-call-waiter-request.js +1 -0
- package/dist/menus/user/types/post-order.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Order } from "../shared/types";
|
|
2
2
|
import { OrderStatus } from "../../enum";
|
|
3
|
+
import { CallWaiter, CallWaiterStatus } from "./types/get-calls-response";
|
|
3
4
|
export declare class MenuAdminAPIs {
|
|
4
5
|
static getOrders(props: {
|
|
5
6
|
token?: string;
|
|
@@ -9,4 +10,12 @@ export declare class MenuAdminAPIs {
|
|
|
9
10
|
size: number;
|
|
10
11
|
sort: "asc" | "desc";
|
|
11
12
|
}): Promise<Order[]>;
|
|
13
|
+
static getCalls(props: {
|
|
14
|
+
token?: string;
|
|
15
|
+
status: CallWaiterStatus[];
|
|
16
|
+
timestamp: number;
|
|
17
|
+
page: number;
|
|
18
|
+
size: number;
|
|
19
|
+
sort: "asc" | "desc";
|
|
20
|
+
}): Promise<CallWaiter[]>;
|
|
12
21
|
}
|
|
@@ -64,6 +64,29 @@ var MenuAdminAPIs = /** @class */ (function () {
|
|
|
64
64
|
});
|
|
65
65
|
});
|
|
66
66
|
};
|
|
67
|
+
MenuAdminAPIs.getCalls = function (props) {
|
|
68
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
69
|
+
return __generator(this, function (_a) {
|
|
70
|
+
return [2 /*return*/, RequestUtils.send(function () {
|
|
71
|
+
var queryParams = [
|
|
72
|
+
"timestamp=".concat(props.timestamp),
|
|
73
|
+
"page=".concat(props.page),
|
|
74
|
+
"size=".concat(props.size),
|
|
75
|
+
"sort=".concat(props.sort),
|
|
76
|
+
props.status.map(function (value) { return "status=".concat(value); }).join('&')
|
|
77
|
+
]
|
|
78
|
+
.filter(function (value) { return value; })
|
|
79
|
+
.join("&");
|
|
80
|
+
return axios.get(base + "/menus/admin/calls?".concat(queryParams), {
|
|
81
|
+
headers: {
|
|
82
|
+
'Authorization': "".concat(props.token)
|
|
83
|
+
}
|
|
84
|
+
})
|
|
85
|
+
.then(function (response) { return response.data; });
|
|
86
|
+
})];
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
};
|
|
67
90
|
return MenuAdminAPIs;
|
|
68
91
|
}());
|
|
69
92
|
export { MenuAdminAPIs };
|
package/dist/menus/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from "./user/types/get-menu-response";
|
|
2
2
|
export * from './user/types/get-qrcode-response';
|
|
3
3
|
export * from "./user/types/post-order";
|
|
4
|
+
export * from "./user/types/post-call-waiter-request";
|
|
4
5
|
export { MenuGuestAPIs } from './user/guest-apis';
|
|
6
|
+
export * from "./admin/types/get-calls-response";
|
|
5
7
|
export { MenuAdminAPIs } from './admin/admin-apis';
|
|
6
8
|
export * from "./shared/types";
|
package/dist/menus/index.js
CHANGED
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
export * from "./user/types/get-menu-response";
|
|
3
3
|
export * from './user/types/get-qrcode-response';
|
|
4
4
|
export * from "./user/types/post-order";
|
|
5
|
+
export * from "./user/types/post-call-waiter-request";
|
|
5
6
|
export { MenuGuestAPIs } from './user/guest-apis';
|
|
6
7
|
// admin module
|
|
8
|
+
export * from "./admin/types/get-calls-response";
|
|
7
9
|
export { MenuAdminAPIs } from './admin/admin-apis';
|
|
8
10
|
// shared module
|
|
9
11
|
export * from "./shared/types";
|
|
@@ -6,15 +6,16 @@ export interface Order {
|
|
|
6
6
|
status: OrderStatus;
|
|
7
7
|
price: number;
|
|
8
8
|
createdAt: string;
|
|
9
|
-
items:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
items: OrderItem[];
|
|
10
|
+
}
|
|
11
|
+
export interface OrderItem {
|
|
12
|
+
categoryId: string;
|
|
13
|
+
categoryLabel: string;
|
|
14
|
+
productId: string;
|
|
15
|
+
productLabel: string;
|
|
16
|
+
variantId: string;
|
|
17
|
+
variantLabel?: string;
|
|
18
|
+
quantity: number;
|
|
19
|
+
price: number;
|
|
20
|
+
discount?: number;
|
|
20
21
|
}
|
|
@@ -2,6 +2,7 @@ import { OrderRequest, OrderResponse } from "./types/post-order";
|
|
|
2
2
|
import { QrCode } from "./types/get-qrcode-response";
|
|
3
3
|
import { Menu } from "./types/get-menu-response";
|
|
4
4
|
import { Order } from "../shared/types";
|
|
5
|
+
import { callWaiter } from "./types/post-call-waiter-request";
|
|
5
6
|
export declare class MenuGuestAPIs {
|
|
6
7
|
static getOrders(businessId: string, deviceId: string, timestamp: number, page?: number, size?: number): Promise<Order[]>;
|
|
7
8
|
/**
|
|
@@ -32,9 +33,9 @@ export declare class MenuGuestAPIs {
|
|
|
32
33
|
}): Promise<Menu>;
|
|
33
34
|
/**
|
|
34
35
|
*
|
|
35
|
-
* @param
|
|
36
|
-
* @throws qrcode_not_found, internal_error
|
|
36
|
+
* @param data
|
|
37
|
+
* @throws call_limit_exceeded, qrcode_not_found, internal_error
|
|
37
38
|
* @returns
|
|
38
39
|
*/
|
|
39
|
-
static callWaiter(
|
|
40
|
+
static callWaiter(data: callWaiter): Promise<void>;
|
|
40
41
|
}
|
|
@@ -131,15 +131,15 @@ var MenuGuestAPIs = /** @class */ (function () {
|
|
|
131
131
|
};
|
|
132
132
|
/**
|
|
133
133
|
*
|
|
134
|
-
* @param
|
|
135
|
-
* @throws qrcode_not_found, internal_error
|
|
134
|
+
* @param data
|
|
135
|
+
* @throws call_limit_exceeded, qrcode_not_found, internal_error
|
|
136
136
|
* @returns
|
|
137
137
|
*/
|
|
138
|
-
MenuGuestAPIs.callWaiter = function (
|
|
138
|
+
MenuGuestAPIs.callWaiter = function (data) {
|
|
139
139
|
return __awaiter(this, void 0, void 0, function () {
|
|
140
140
|
return __generator(this, function (_a) {
|
|
141
141
|
return [2 /*return*/, RequestUtils.send(function () {
|
|
142
|
-
return axios.
|
|
142
|
+
return axios.post(base + "/menus/guest/call-waiter", data, {
|
|
143
143
|
headers: {
|
|
144
144
|
'Content-Type': 'application/json'
|
|
145
145
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,9 +2,9 @@ export interface OrderRequest {
|
|
|
2
2
|
qrCodeId: string;
|
|
3
3
|
deviceId: string;
|
|
4
4
|
name?: string | undefined;
|
|
5
|
-
items:
|
|
5
|
+
items: OrderRequestItem[];
|
|
6
6
|
}
|
|
7
|
-
export interface
|
|
7
|
+
export interface OrderRequestItem {
|
|
8
8
|
productId: string;
|
|
9
9
|
variantId: string;
|
|
10
10
|
quantity: number;
|