@kiminix/tp-client 2.33.0 → 2.35.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,7 +1,7 @@
1
+ import { Table } from "../../shared/types";
1
2
  export interface CallWaiter {
2
3
  id: string;
3
- tableLabel: string;
4
- tableId: string;
4
+ table: Table;
5
5
  deviceId: string;
6
6
  status: CallWaiterStatus;
7
7
  createdAt: string;
@@ -1,7 +1,7 @@
1
1
  import { OrderStatus } from "../../enum";
2
2
  export interface Order {
3
3
  id: string;
4
- table?: Order.Table | undefined;
4
+ table?: Table | undefined;
5
5
  deviceId?: string | undefined;
6
6
  billId?: string | undefined;
7
7
  status: OrderStatus;
@@ -10,10 +10,6 @@ export interface Order {
10
10
  items: Order.Item[];
11
11
  }
12
12
  export declare namespace Order {
13
- interface Table {
14
- id: string;
15
- label: string;
16
- }
17
13
  interface Item {
18
14
  categoryId: string;
19
15
  categoryLabel: string;
@@ -26,3 +22,9 @@ export declare namespace Order {
26
22
  discount?: number;
27
23
  }
28
24
  }
25
+ export interface Table {
26
+ id: string;
27
+ label: string;
28
+ areaId?: string | undefined;
29
+ areaLabel?: string | undefined;
30
+ }
@@ -1,4 +1,5 @@
1
1
  import { OpeningHours, SocialLinks, Template } from "../../../business/types/shared";
2
+ import { Table } from "../../shared/types";
2
3
  export interface Menu {
3
4
  business: BusinessOfMenu;
4
5
  categories: Category[];
@@ -19,10 +20,6 @@ export interface BusinessOfMenu {
19
20
  googleMapsReviewLink?: string | undefined;
20
21
  socialLinks?: SocialLinks | undefined;
21
22
  }
22
- export interface Table {
23
- id: string;
24
- label: string;
25
- }
26
23
  export interface Category {
27
24
  label: string;
28
25
  isPublic: boolean;
@@ -0,0 +1,18 @@
1
+ export declare class CreateAreaAdminAPI {
2
+ /**
3
+ *
4
+ * @param props
5
+ * @throws unauthorized_action, internal_error
6
+ *
7
+ * @returns
8
+ */
9
+ static create(props: {
10
+ token?: string;
11
+ request: CreateAreaAdminAPI.Request;
12
+ }): Promise<void>;
13
+ }
14
+ export declare namespace CreateAreaAdminAPI {
15
+ interface Request {
16
+ label: string;
17
+ }
18
+ }
@@ -0,0 +1,66 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
12
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
37
+ import axios from "axios";
38
+ import { base } from "../../../constants";
39
+ import { RequestUtils } from "../../../utils/request-utils";
40
+ var CreateAreaAdminAPI = /** @class */ (function () {
41
+ function CreateAreaAdminAPI() {
42
+ }
43
+ /**
44
+ *
45
+ * @param props
46
+ * @throws unauthorized_action, internal_error
47
+ *
48
+ * @returns
49
+ */
50
+ CreateAreaAdminAPI.create = function (props) {
51
+ return __awaiter(this, void 0, void 0, function () {
52
+ return __generator(this, function (_a) {
53
+ return [2 /*return*/, RequestUtils.send(function () {
54
+ return axios.post(base + "/admin/tables/areas", props.request, {
55
+ headers: {
56
+ 'Authorization': "".concat(props.token)
57
+ }
58
+ })
59
+ .then(function (response) { return undefined; });
60
+ })];
61
+ });
62
+ });
63
+ };
64
+ return CreateAreaAdminAPI;
65
+ }());
66
+ export { CreateAreaAdminAPI };
@@ -8,11 +8,12 @@ export declare class CreateTableAdminAPI {
8
8
  */
9
9
  static create(props: {
10
10
  token?: string;
11
- request: CreateTableAdminAPI.Request;
11
+ request: CreateTableAdminAPI.Request[];
12
12
  }): Promise<void>;
13
13
  }
14
14
  export declare namespace CreateTableAdminAPI {
15
15
  interface Request {
16
16
  label: string;
17
+ areaId?: string | undefined;
17
18
  }
18
19
  }
@@ -0,0 +1,19 @@
1
+ export declare class MoveTableToAreaAdminAPI {
2
+ /**
3
+ *
4
+ * @param props
5
+ * @throws unauthorized_action, internal_error
6
+ *
7
+ * @returns
8
+ */
9
+ static move(props: {
10
+ token?: string;
11
+ request: MoveTableToAreaAdminAPI.Request;
12
+ }): Promise<void>;
13
+ }
14
+ export declare namespace MoveTableToAreaAdminAPI {
15
+ interface Request {
16
+ areaId?: string | undefined;
17
+ tablesIds: string[];
18
+ }
19
+ }
@@ -0,0 +1,66 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
12
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
37
+ import axios from "axios";
38
+ import { base } from "../../../constants";
39
+ import { RequestUtils } from "../../../utils/request-utils";
40
+ var MoveTableToAreaAdminAPI = /** @class */ (function () {
41
+ function MoveTableToAreaAdminAPI() {
42
+ }
43
+ /**
44
+ *
45
+ * @param props
46
+ * @throws unauthorized_action, internal_error
47
+ *
48
+ * @returns
49
+ */
50
+ MoveTableToAreaAdminAPI.move = function (props) {
51
+ return __awaiter(this, void 0, void 0, function () {
52
+ return __generator(this, function (_a) {
53
+ return [2 /*return*/, RequestUtils.send(function () {
54
+ return axios.patch(base + "/admin/tables/areas/_move", props.request, {
55
+ headers: {
56
+ 'Authorization': "".concat(props.token)
57
+ }
58
+ })
59
+ .then(function (response) { return undefined; });
60
+ })];
61
+ });
62
+ });
63
+ };
64
+ return MoveTableToAreaAdminAPI;
65
+ }());
66
+ export { MoveTableToAreaAdminAPI };
@@ -0,0 +1,19 @@
1
+ export declare class PatchAreaAdminAPI {
2
+ /**
3
+ *
4
+ * @param props
5
+ * @throws unauthorized_action, internal_error, area_not_found
6
+ *
7
+ * @returns
8
+ */
9
+ static patch(props: {
10
+ token?: string;
11
+ request: PatchAreaAdminAPI.Request;
12
+ }): Promise<void>;
13
+ }
14
+ export declare namespace PatchAreaAdminAPI {
15
+ interface Request {
16
+ id: string;
17
+ label: string;
18
+ }
19
+ }
@@ -0,0 +1,66 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
12
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
37
+ import axios from "axios";
38
+ import { base } from "../../../constants";
39
+ import { RequestUtils } from "../../../utils/request-utils";
40
+ var PatchAreaAdminAPI = /** @class */ (function () {
41
+ function PatchAreaAdminAPI() {
42
+ }
43
+ /**
44
+ *
45
+ * @param props
46
+ * @throws unauthorized_action, internal_error, area_not_found
47
+ *
48
+ * @returns
49
+ */
50
+ PatchAreaAdminAPI.patch = function (props) {
51
+ return __awaiter(this, void 0, void 0, function () {
52
+ return __generator(this, function (_a) {
53
+ return [2 /*return*/, RequestUtils.send(function () {
54
+ return axios.patch(base + "/admin/tables/areas", props.request, {
55
+ headers: {
56
+ 'Authorization': "".concat(props.token)
57
+ }
58
+ })
59
+ .then(function (response) { return undefined; });
60
+ })];
61
+ });
62
+ });
63
+ };
64
+ return PatchAreaAdminAPI;
65
+ }());
66
+ export { PatchAreaAdminAPI };
@@ -1,3 +1,7 @@
1
1
  export * from "./admin/api/create-tables-api";
2
2
  export * from "./admin/api/get-tables-api";
3
3
  export * from "./admin/api/patch-tables-api";
4
+ export * from "./admin/api/move-tables-to-area-api";
5
+ export * from "./admin/api/patch-areas-api";
6
+ export * from "./admin/api/create-areas-api";
7
+ export * from "./admin/api/patch-areas-api";
@@ -2,4 +2,8 @@
2
2
  export * from "./admin/api/create-tables-api";
3
3
  export * from "./admin/api/get-tables-api";
4
4
  export * from "./admin/api/patch-tables-api";
5
+ export * from "./admin/api/move-tables-to-area-api";
6
+ export * from "./admin/api/patch-areas-api";
7
+ export * from "./admin/api/create-areas-api";
8
+ export * from "./admin/api/patch-areas-api";
5
9
  // user module
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiminix/tp-client",
3
- "version": "2.33.0",
3
+ "version": "2.35.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [