@kiminix/tp-client 1.25.0 → 1.26.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,6 +1,8 @@
1
1
  import { AllBusiness } from "./types/get-all";
2
2
  import { Business } from "./types/get-id";
3
+ import { MenuCategory } from "./types/get-carte-menus";
3
4
  export declare class BusinessAPIs {
4
5
  static getAll(timestamp: number, page?: number, size?: number): Promise<AllBusiness[]>;
5
6
  static get(identifier: string): Promise<Business | undefined>;
7
+ static getCarteMenus(identifier: string): Promise<MenuCategory[]>;
6
8
  }
@@ -37,6 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  import axios from "axios";
38
38
  import { base } from "../constants";
39
39
  import { parseISO } from "date-fns";
40
+ import { RequestUtils } from "../utils/request-utils";
40
41
  // business module APIs
41
42
  var BusinessAPIs = /** @class */ (function () {
42
43
  function BusinessAPIs() {
@@ -71,6 +72,24 @@ var BusinessAPIs = /** @class */ (function () {
71
72
  });
72
73
  });
73
74
  };
75
+ BusinessAPIs.getCarteMenus = function (identifier) {
76
+ return __awaiter(this, void 0, void 0, function () {
77
+ var _this = this;
78
+ return __generator(this, function (_a) {
79
+ return [2 /*return*/, RequestUtils.send(function () { return __awaiter(_this, void 0, void 0, function () {
80
+ return __generator(this, function (_a) {
81
+ switch (_a.label) {
82
+ case 0: return [4 /*yield*/, axios.get(base + "/business/".concat(identifier, "/carte-menus"))
83
+ .then(function (response) {
84
+ return response.data;
85
+ })];
86
+ case 1: return [2 /*return*/, _a.sent()];
87
+ }
88
+ });
89
+ }); })];
90
+ });
91
+ });
92
+ };
74
93
  return BusinessAPIs;
75
94
  }());
76
95
  export { BusinessAPIs };
@@ -0,0 +1,5 @@
1
+ export * from "./types/get-carte-menus";
2
+ export * from "./types/get-all";
3
+ export * from "./types/get-id";
4
+ export { BusinessAPIs } from './apis';
5
+ export { BusinessAdminAPIs } from './admin-apis';
@@ -0,0 +1,5 @@
1
+ export * from "./types/get-carte-menus";
2
+ export * from "./types/get-all";
3
+ export * from "./types/get-id";
4
+ export { BusinessAPIs } from './apis';
5
+ export { BusinessAdminAPIs } from './admin-apis';
@@ -1,8 +1,4 @@
1
- export interface Review {
2
- stars: number;
3
- count: number;
4
- link?: string;
5
- }
1
+ import { Review } from "./shared";
6
2
  export interface AllBusiness {
7
3
  id: string;
8
4
  identifier: string;
@@ -0,0 +1,9 @@
1
+ export interface MenuItem {
2
+ name: string;
3
+ description?: string;
4
+ price: number;
5
+ }
6
+ export interface MenuCategory {
7
+ name: string;
8
+ items: MenuItem[];
9
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,14 +1,10 @@
1
1
  import { Licence } from "../../types";
2
2
  import { CashbackSettings } from "./get-all";
3
+ import { Review } from "./shared";
3
4
  export interface GoogleMap {
4
5
  link: string;
5
6
  image: string;
6
7
  }
7
- export interface Review {
8
- stars: number;
9
- count: number;
10
- link?: string;
11
- }
12
8
  export interface SocialNetworks {
13
9
  facebook?: string;
14
10
  instagram?: string;
@@ -0,0 +1,14 @@
1
+ export interface GoogleMap {
2
+ link: string;
3
+ image: string;
4
+ }
5
+ export interface SocialNetworks {
6
+ facebook?: string;
7
+ instagram?: string;
8
+ twitter?: string;
9
+ }
10
+ export interface Review {
11
+ stars: number;
12
+ count: number;
13
+ link?: string;
14
+ }
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.d.ts CHANGED
@@ -1,10 +1,9 @@
1
- export { BusinessAPIs } from './business/apis';
2
- export { BusinessAdminAPIs } from './business/admin-apis';
3
1
  export { DealsAPIs } from './deals/apis';
4
2
  export { NotifyAPIs } from './notify/apis';
5
3
  export { SitemapAPIs } from './sitemap/apis';
6
4
  export { StatisticsAdminAPIs } from './statistics/admin-apis';
7
5
  export * from './iam/index';
6
+ export * from './business/index';
8
7
  export * from './menus/preset/index';
9
8
  export * from './reservations/index';
10
9
  export * from './cashback/index';
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
- export { BusinessAPIs } from './business/apis';
2
- export { BusinessAdminAPIs } from './business/admin-apis';
3
1
  export { DealsAPIs } from './deals/apis';
4
2
  export { NotifyAPIs } from './notify/apis';
5
3
  export { SitemapAPIs } from './sitemap/apis';
6
4
  export { StatisticsAdminAPIs } from './statistics/admin-apis';
7
5
  // iam module
8
6
  export * from './iam/index';
7
+ // business module
8
+ export * from './business/index';
9
9
  // menus module
10
10
  export * from './menus/preset/index';
11
11
  // reservations module
@@ -1,8 +1,8 @@
1
+ import { Either } from "purify-ts";
1
2
  import { CancellationReason, ReservationStatus, TimelineDirection } from "../../enum";
3
+ import { Reservation } from "../shared/reservation";
2
4
  import { GetTransitionsRequest } from "./types/get-available-transitions";
3
5
  import { GetByIdAdminRequest } from "./types/get-id";
4
- import { Reservation } from "../shared/reservation";
5
- import { Either } from "purify-ts";
6
6
  export declare class ReservationsAdminAPIs {
7
7
  static getPage(props: {
8
8
  token?: string;
@@ -35,12 +35,12 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
35
35
  }
36
36
  };
37
37
  import axios from "axios";
38
- import { base } from "../../constants";
39
- import { ErrorWithMetadata } from "../../types";
40
38
  import { format } from "date-fns";
41
39
  import { Left, Right } from "purify-ts";
42
- import { parseReservationDeal } from "../shared/reservation-deal";
40
+ import { base } from "../../constants";
41
+ import { ErrorWithMetadata } from "../../types";
43
42
  import { RequestUtils } from "../../utils/request-utils";
43
+ import { parseReservationDeal } from "../shared/reservation-deal";
44
44
  var ReservationsAdminAPIs = /** @class */ (function () {
45
45
  function ReservationsAdminAPIs() {
46
46
  }
@@ -1,6 +1,6 @@
1
1
  import { CancellationReason, ReservationEventKind, ReservationStatus } from "../../enum";
2
2
  import { ReservationDeal } from "./reservation-deal";
3
- export interface Business {
3
+ export interface BusinessOfReservation {
4
4
  id: string;
5
5
  identifier: string;
6
6
  name: string;
@@ -38,7 +38,7 @@ export interface Reservation {
38
38
  id: string;
39
39
  isSetByAdmin: boolean;
40
40
  createdAt: string;
41
- business: Business;
41
+ business: BusinessOfReservation;
42
42
  user: User;
43
43
  datetime: string;
44
44
  status: ReservationStatus;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiminix/tp-client",
3
- "version": "1.25.0",
3
+ "version": "1.26.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [