@kiminix/tp-client 2.49.0 → 2.51.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,3 +1,4 @@
1
+ import { LicensePlan } from "../../../enum";
1
2
  /**
2
3
  * subscribe business
3
4
  *
@@ -12,6 +13,7 @@ export declare class SubscriptionBusinessAdminAPI {
12
13
  export declare namespace SubscriptionBusinessAdminAPI {
13
14
  interface Request {
14
15
  code: string;
16
+ plan: LicensePlan;
15
17
  name: string;
16
18
  address: string;
17
19
  phone: string;
@@ -1,4 +1,4 @@
1
- import { Licence } from "../../types";
1
+ import { License } from "../../types";
2
2
  import { CashbackSettings, OpeningHours, TelegramConfig, Template } from "./shared";
3
3
  export interface Business {
4
4
  id: string;
@@ -7,7 +7,7 @@ export interface Business {
7
7
  name: string;
8
8
  logo: string | undefined;
9
9
  coverPhoto: string | undefined;
10
- licence: Licence | undefined;
10
+ license: License | undefined;
11
11
  createdAt: Date;
12
12
  address: string;
13
13
  googleMapsUrl: string;
package/dist/enum.d.ts CHANGED
@@ -50,3 +50,9 @@ export declare enum CashbackTransactionType {
50
50
  Redeem = "redeem",
51
51
  Update = "update"
52
52
  }
53
+ export declare enum LicensePlan {
54
+ Free = "free",
55
+ Pro = "pro",
56
+ Premium = "premium",
57
+ Cashback = "cashback"
58
+ }
package/dist/enum.js CHANGED
@@ -59,3 +59,10 @@ export var CashbackTransactionType;
59
59
  CashbackTransactionType["Redeem"] = "redeem";
60
60
  CashbackTransactionType["Update"] = "update";
61
61
  })(CashbackTransactionType || (CashbackTransactionType = {}));
62
+ export var LicensePlan;
63
+ (function (LicensePlan) {
64
+ LicensePlan["Free"] = "free";
65
+ LicensePlan["Pro"] = "pro";
66
+ LicensePlan["Premium"] = "premium";
67
+ LicensePlan["Cashback"] = "cashback";
68
+ })(LicensePlan || (LicensePlan = {}));
@@ -20,6 +20,7 @@ export declare class MenuGuestAPIs {
20
20
  * @returns
21
21
  */
22
22
  static getMenu(props: {
23
+ deviceId: string;
23
24
  business_identifier: string;
24
25
  table_id?: string | undefined;
25
26
  }): Promise<Menu>;
@@ -101,8 +101,9 @@ var MenuGuestAPIs = /** @class */ (function () {
101
101
  return __generator(this, function (_a) {
102
102
  return [2 /*return*/, RequestUtils.send(function () {
103
103
  var params = [
104
+ props.deviceId ? "device_id=".concat(props.deviceId) : undefined,
104
105
  props.business_identifier ? "business_identifier=".concat(props.business_identifier) : undefined,
105
- props.table_id ? "table_id=".concat(props.table_id) : undefined
106
+ props.table_id ? "table_id=".concat(props.table_id) : undefined,
106
107
  ].filter(function (value) { return value; }).join("&");
107
108
  return axios.get(base + "/menus/guest?".concat(params), {
108
109
  headers: {
package/dist/types.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { LicensePlan } from "./enum";
1
2
  export type LocalDate = string;
2
3
  export type LocalTime = string;
3
4
  export interface ApiError {
@@ -5,8 +6,8 @@ export interface ApiError {
5
6
  code?: string;
6
7
  metadata?: any;
7
8
  }
8
- export interface Licence {
9
- type: string;
9
+ export interface License {
10
+ plan: LicensePlan;
10
11
  from: LocalDate;
11
12
  to: LocalDate;
12
13
  }
@@ -1,5 +1,5 @@
1
- import { Licence } from "../types";
1
+ import { License } from "../types";
2
2
  export declare class BusinessUtils {
3
- static isLicenceActive(licence?: Licence): boolean;
4
- static isLicenceActiveByDay(date: Date, licence?: Licence): boolean;
3
+ static isLicenseActive(license?: License): boolean;
4
+ static isLicenseActiveByDay(date: Date, license?: License): boolean;
5
5
  }
@@ -3,14 +3,14 @@ import { isDayBefore, isDayBetween } from "./date-utils";
3
3
  var BusinessUtils = /** @class */ (function () {
4
4
  function BusinessUtils() {
5
5
  }
6
- // licence is active if business has an available date that it is not expired
7
- BusinessUtils.isLicenceActive = function (licence) {
6
+ // license is active if business has an available date that it is not expired
7
+ BusinessUtils.isLicenseActive = function (license) {
8
8
  var today = new Date();
9
- return (licence === null || licence === void 0 ? void 0 : licence.to) ? isDayBefore(today, parseISO(licence.to), true) : false;
9
+ return (license === null || license === void 0 ? void 0 : license.to) ? isDayBefore(today, parseISO(license.to), true) : false;
10
10
  };
11
11
  // check if the business is active for a specific date
12
- BusinessUtils.isLicenceActiveByDay = function (date, licence) {
13
- return licence ? isDayBetween(date, parseISO(licence.from), parseISO(licence.to)) : false;
12
+ BusinessUtils.isLicenseActiveByDay = function (date, license) {
13
+ return license ? isDayBetween(date, parseISO(license.from), parseISO(license.to)) : false;
14
14
  };
15
15
  return BusinessUtils;
16
16
  }());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiminix/tp-client",
3
- "version": "2.49.0",
3
+ "version": "2.51.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [