@kiminix/tp-client 2.25.0 → 2.27.0

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,8 +1,9 @@
1
1
  import { Licence } from "../../types";
2
- import { OpeningHours, TelegramConfig } from "./shared";
2
+ import { OpeningHours, TelegramConfig, Template } from "./shared";
3
3
  export interface Business {
4
4
  id: string;
5
5
  identifier: string;
6
+ shortId: string;
6
7
  name: string;
7
8
  logo: string | undefined;
8
9
  coverPhoto: string | undefined;
@@ -19,9 +20,5 @@ export interface Business {
19
20
  openingHours: OpeningHours | undefined;
20
21
  specialities: string[] | undefined;
21
22
  telegram?: TelegramConfig | undefined;
22
- template?: Template | undefined;
23
- }
24
- export interface Template {
25
- id: string;
26
- theme?: string | undefined;
23
+ template: Template;
27
24
  }
@@ -24,3 +24,7 @@ export interface SocialLinks {
24
24
  youtube?: string | undefined;
25
25
  website?: string | undefined;
26
26
  }
27
+ export interface Template {
28
+ id: string;
29
+ theme?: string | undefined;
30
+ }
@@ -2,6 +2,7 @@ import { Patch } from "../../utils/patch-utils";
2
2
  import { OpeningHours, SocialLinks } from "./shared";
3
3
  export interface PatchBusinessRequest {
4
4
  name?: Patch<string> | undefined;
5
+ identifier?: Patch<string> | undefined;
5
6
  address?: Patch<string> | undefined;
6
7
  phones?: Patch<string[]> | undefined;
7
8
  openingHours?: Patch<OpeningHours> | undefined;
@@ -1,28 +1,27 @@
1
1
  export { MenuGuestAPIs } from './user/guest-apis';
2
2
  export * from "./user/types/get-menu-response";
3
- export * from './user/types/get-qrcode-response';
4
3
  export * from "./user/types/post-call-waiter-request";
5
4
  export * from "./user/types/post-order";
5
+ export * from "./admin/api/create-orders-api";
6
+ export * from "./admin/api/create-qrcodes-api";
7
+ export * from "./admin/api/delete-categories-api";
8
+ export * from "./admin/api/delete-products-api";
6
9
  export * from "./admin/api/get-menu-api";
10
+ export * from "./admin/api/get-order-by-id-api";
7
11
  export * from "./admin/api/get-product-api";
8
- export * from "./admin/api/patch-product-api";
9
- export * from "./admin/api/create-orders-api";
12
+ export * from "./admin/api/get-qrcodes-api";
13
+ export * from "./admin/api/patch-categories-indices-api";
10
14
  export * from "./admin/api/patch-order-api";
11
- export * from "./admin/api/update-order-api";
15
+ export * from "./admin/api/patch-product-api";
16
+ export * from "./admin/api/patch-product-indices-api";
17
+ export * from "./admin/api/patch-qrcodes-api";
12
18
  export * from "./admin/api/search-orders-api";
13
- export * from "./admin/api/get-qrcodes-api";
14
- export * from "./admin/api/update-template-api";
15
- export * from "./admin/api/get-order-by-id-api";
16
- export * from "./admin/api/statistic/products-recap-api";
17
19
  export * from "./admin/api/statistic/bills-recap-api";
18
- export * from "./admin/api/create-qrcodes-api";
19
- export * from "./admin/api/patch-qrcodes-api";
20
- export * from "./admin/api/patch-product-indices-api";
21
- export * from "./admin/api/patch-categories-indices-api";
20
+ export * from "./admin/api/statistic/products-recap-api";
21
+ export * from "./admin/api/update-order-api";
22
+ export * from "./admin/api/update-template-api";
22
23
  export * from "./admin/api/upsert-categories-api";
23
24
  export * from "./admin/api/upsert-product-api";
24
- export * from "./admin/api/delete-categories-api";
25
- export * from "./admin/api/delete-products-api";
26
25
  export * from "./admin/types/get-calls-response";
27
26
  export { MenuAdminAPIs } from './admin/admin-apis';
28
27
  export * from "./shared/types";
@@ -1,30 +1,29 @@
1
1
  // user module
2
2
  export { MenuGuestAPIs } from './user/guest-apis';
3
3
  export * from "./user/types/get-menu-response";
4
- export * from './user/types/get-qrcode-response';
5
4
  export * from "./user/types/post-call-waiter-request";
6
5
  export * from "./user/types/post-order";
7
6
  // admin module
7
+ export * from "./admin/api/create-orders-api";
8
+ export * from "./admin/api/create-qrcodes-api";
9
+ export * from "./admin/api/delete-categories-api";
10
+ export * from "./admin/api/delete-products-api";
8
11
  export * from "./admin/api/get-menu-api";
12
+ export * from "./admin/api/get-order-by-id-api";
9
13
  export * from "./admin/api/get-product-api";
10
- export * from "./admin/api/patch-product-api";
11
- export * from "./admin/api/create-orders-api";
14
+ export * from "./admin/api/get-qrcodes-api";
15
+ export * from "./admin/api/patch-categories-indices-api";
12
16
  export * from "./admin/api/patch-order-api";
13
- export * from "./admin/api/update-order-api";
17
+ export * from "./admin/api/patch-product-api";
18
+ export * from "./admin/api/patch-product-indices-api";
19
+ export * from "./admin/api/patch-qrcodes-api";
14
20
  export * from "./admin/api/search-orders-api";
15
- export * from "./admin/api/get-qrcodes-api";
16
- export * from "./admin/api/update-template-api";
17
- export * from "./admin/api/get-order-by-id-api";
18
- export * from "./admin/api/statistic/products-recap-api";
19
21
  export * from "./admin/api/statistic/bills-recap-api";
20
- export * from "./admin/api/create-qrcodes-api";
21
- export * from "./admin/api/patch-qrcodes-api";
22
- export * from "./admin/api/patch-product-indices-api";
23
- export * from "./admin/api/patch-categories-indices-api";
22
+ export * from "./admin/api/statistic/products-recap-api";
23
+ export * from "./admin/api/update-order-api";
24
+ export * from "./admin/api/update-template-api";
24
25
  export * from "./admin/api/upsert-categories-api";
25
26
  export * from "./admin/api/upsert-product-api";
26
- export * from "./admin/api/delete-categories-api";
27
- export * from "./admin/api/delete-products-api";
28
27
  export * from "./admin/types/get-calls-response";
29
28
  export { MenuAdminAPIs } from './admin/admin-apis';
30
29
  // shared module
@@ -1,8 +1,8 @@
1
- import { OrderRequest, OrderResponse } from "./types/post-order";
2
- import { QrCode } from "./types/get-qrcode-response";
3
- import { Menu } from "./types/get-menu-response";
4
1
  import { Order } from "../shared/types";
2
+ import { GetBusinessIdResponse } from "./types/get-business-response";
3
+ import { Menu } from "./types/get-menu-response";
5
4
  import { PostCallWaiter } from "./types/post-call-waiter-request";
5
+ import { OrderRequest, OrderResponse } from "./types/post-order";
6
6
  export declare class MenuGuestAPIs {
7
7
  static getOrders(businessId: string, deviceId: string, timestamp: number, page?: number, size?: number): Promise<Order[]>;
8
8
  /**
@@ -16,20 +16,22 @@ export declare class MenuGuestAPIs {
16
16
  /**
17
17
  *
18
18
  * @param props
19
- * @throws qrcode_not_found, qrcode_bad_config, internal_error
19
+ * @throws not_found, internal_error
20
20
  * @returns
21
21
  */
22
- static getQrCode(props: {
23
- id: string;
24
- }): Promise<QrCode>;
22
+ static getBusiness(props: {
23
+ table_id?: string | undefined;
24
+ business_short_id?: string | undefined;
25
+ }): Promise<GetBusinessIdResponse>;
25
26
  /**
26
27
  *
27
28
  * @param props
28
- * @throws qrcode_not_found, internal_error
29
+ * @throws business_not_found, table_not_found, internal_error
29
30
  * @returns
30
31
  */
31
32
  static getMenu(props: {
32
- id: string;
33
+ business_identifier: string;
34
+ table_id?: string | undefined;
33
35
  }): Promise<Menu>;
34
36
  /**
35
37
  *
@@ -88,14 +88,18 @@ var MenuGuestAPIs = /** @class */ (function () {
88
88
  /**
89
89
  *
90
90
  * @param props
91
- * @throws qrcode_not_found, qrcode_bad_config, internal_error
91
+ * @throws not_found, internal_error
92
92
  * @returns
93
93
  */
94
- MenuGuestAPIs.getQrCode = function (props) {
94
+ MenuGuestAPIs.getBusiness = function (props) {
95
95
  return __awaiter(this, void 0, void 0, function () {
96
96
  return __generator(this, function (_a) {
97
97
  return [2 /*return*/, RequestUtils.send(function () {
98
- return axios.get(base + "/menus/guest/qrcode/".concat(props.id), {
98
+ var params = [
99
+ props.table_id ? "table_id=".concat(props.table_id) : undefined,
100
+ props.business_short_id ? "business_short_id=".concat(props.business_short_id) : undefined
101
+ ].filter(function (value) { return value; }).join("&");
102
+ return axios.get(base + "/menus/guest/business?".concat(params), {
99
103
  headers: {
100
104
  'Content-Type': 'application/json'
101
105
  }
@@ -110,14 +114,18 @@ var MenuGuestAPIs = /** @class */ (function () {
110
114
  /**
111
115
  *
112
116
  * @param props
113
- * @throws qrcode_not_found, internal_error
117
+ * @throws business_not_found, table_not_found, internal_error
114
118
  * @returns
115
119
  */
116
120
  MenuGuestAPIs.getMenu = function (props) {
117
121
  return __awaiter(this, void 0, void 0, function () {
118
122
  return __generator(this, function (_a) {
119
123
  return [2 /*return*/, RequestUtils.send(function () {
120
- return axios.get(base + "/menus/guest/".concat(props.id), {
124
+ var params = [
125
+ props.business_identifier ? "business_identifier=".concat(props.business_identifier) : undefined,
126
+ props.table_id ? "table_id=".concat(props.table_id) : undefined
127
+ ].filter(function (value) { return value; }).join("&");
128
+ return axios.get(base + "/menus/guest?".concat(params), {
121
129
  headers: {
122
130
  'Content-Type': 'application/json'
123
131
  }
@@ -0,0 +1,5 @@
1
+ export interface GetBusinessIdResponse {
2
+ id: string;
3
+ identifier: string;
4
+ shortId: string;
5
+ }
@@ -1,12 +1,14 @@
1
- import { OpeningHours, SocialLinks } from "../../../business/types/shared";
1
+ import { OpeningHours, SocialLinks, Template } from "../../../business/types/shared";
2
2
  export interface Menu {
3
- qrCodeLabel: string;
4
3
  business: BusinessOfMenu;
5
4
  categories: Category[];
5
+ table?: Table | undefined;
6
6
  }
7
7
  export interface BusinessOfMenu {
8
8
  id: string;
9
9
  identifier: string;
10
+ shortId: string;
11
+ template: Template;
10
12
  name: string;
11
13
  coverPhoto?: string | undefined;
12
14
  logo?: string | undefined;
@@ -17,6 +19,10 @@ export interface BusinessOfMenu {
17
19
  googleMapsReviewLink?: string | undefined;
18
20
  socialLinks?: SocialLinks | undefined;
19
21
  }
22
+ export interface Table {
23
+ id: string;
24
+ label: string;
25
+ }
20
26
  export interface Category {
21
27
  label: string;
22
28
  isPublic: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiminix/tp-client",
3
- "version": "2.25.0",
3
+ "version": "2.27.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -1,6 +0,0 @@
1
- export interface QrCode {
2
- template: {
3
- id: string;
4
- theme?: string | undefined;
5
- };
6
- }