@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.
- package/dist/business/admin/api/subscription-business-api.d.ts +2 -0
- package/dist/business/types/business.d.ts +2 -2
- package/dist/enum.d.ts +6 -0
- package/dist/enum.js +7 -0
- package/dist/menus/user/guest-apis.d.ts +1 -0
- package/dist/menus/user/guest-apis.js +2 -1
- package/dist/types.d.ts +3 -2
- package/dist/utils/business-utils.d.ts +3 -3
- package/dist/utils/business-utils.js +5 -5
- package/package.json +1 -1
|
@@ -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 {
|
|
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
|
-
|
|
10
|
+
license: License | undefined;
|
|
11
11
|
createdAt: Date;
|
|
12
12
|
address: string;
|
|
13
13
|
googleMapsUrl: string;
|
package/dist/enum.d.ts
CHANGED
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 = {}));
|
|
@@ -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
|
|
9
|
-
|
|
9
|
+
export interface License {
|
|
10
|
+
plan: LicensePlan;
|
|
10
11
|
from: LocalDate;
|
|
11
12
|
to: LocalDate;
|
|
12
13
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { License } from "../types";
|
|
2
2
|
export declare class BusinessUtils {
|
|
3
|
-
static
|
|
4
|
-
static
|
|
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
|
-
//
|
|
7
|
-
BusinessUtils.
|
|
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 (
|
|
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.
|
|
13
|
-
return
|
|
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
|
}());
|