@kiminix/tp-client 2.22.0 → 2.24.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/apis.d.ts +5 -2
- package/dist/business/apis.js +8 -6
- package/dist/business/index.d.ts +0 -1
- package/dist/business/index.js +0 -1
- package/dist/business/types/get-all.d.ts +0 -2
- package/dist/business/types/get-id.d.ts +4 -4
- package/dist/business/types/shared.d.ts +20 -2
- package/dist/business/types/update-business.d.ts +10 -0
- package/dist/deals/types.d.ts +0 -1
- package/dist/iam/api/signin-admin.d.ts +16 -0
- package/dist/iam/{admin-apis.js → api/signin-admin.js} +21 -5
- package/dist/iam/index.d.ts +1 -1
- package/dist/iam/index.js +1 -1
- package/dist/menus/admin/api/get-menu-api.d.ts +3 -3
- package/dist/menus/admin/api/get-menu-api.js +0 -6
- package/dist/menus/user/types/get-menu-response.d.ts +12 -15
- package/dist/menus/user/types/get-menu-response.js +0 -6
- package/package.json +1 -1
- package/dist/business/types/get-carte-menus.d.ts +0 -9
- package/dist/iam/admin-apis.d.ts +0 -4
- /package/dist/business/types/{get-carte-menus.js → update-business.js} +0 -0
package/dist/business/apis.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { AllBusiness } from "./types/get-all";
|
|
2
2
|
import { Business } from "./types/get-id";
|
|
3
|
-
import {
|
|
3
|
+
import { UpdateBusinessRequest } from "./types/update-business";
|
|
4
4
|
export declare class BusinessAPIs {
|
|
5
5
|
static getAll(timestamp: number, page?: number, size?: number): Promise<AllBusiness[]>;
|
|
6
6
|
static get(identifier: string): Promise<Business | undefined>;
|
|
7
|
-
static
|
|
7
|
+
static update(props: {
|
|
8
|
+
token: string;
|
|
9
|
+
request: UpdateBusinessRequest;
|
|
10
|
+
}): Promise<void>;
|
|
8
11
|
}
|
package/dist/business/apis.js
CHANGED
|
@@ -35,8 +35,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
import axios from "axios";
|
|
38
|
-
import { base } from "../constants";
|
|
39
38
|
import { parseISO } from "date-fns";
|
|
39
|
+
import { base } from "../constants";
|
|
40
40
|
import { RequestUtils } from "../utils/request-utils";
|
|
41
41
|
// business module APIs
|
|
42
42
|
var BusinessAPIs = /** @class */ (function () {
|
|
@@ -87,17 +87,19 @@ var BusinessAPIs = /** @class */ (function () {
|
|
|
87
87
|
});
|
|
88
88
|
});
|
|
89
89
|
};
|
|
90
|
-
BusinessAPIs.
|
|
90
|
+
BusinessAPIs.update = function (props) {
|
|
91
91
|
return __awaiter(this, void 0, void 0, function () {
|
|
92
92
|
var _this = this;
|
|
93
93
|
return __generator(this, function (_a) {
|
|
94
94
|
return [2 /*return*/, RequestUtils.send(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
95
95
|
return __generator(this, function (_a) {
|
|
96
96
|
switch (_a.label) {
|
|
97
|
-
case 0: return [4 /*yield*/, axios.
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
case 0: return [4 /*yield*/, axios.put(base + "/business", props.request, {
|
|
98
|
+
headers: {
|
|
99
|
+
'Authorization': "".concat(props.token)
|
|
100
|
+
}
|
|
101
|
+
})
|
|
102
|
+
.then(function (_) { return undefined; })];
|
|
101
103
|
case 1: return [2 /*return*/, _a.sent()];
|
|
102
104
|
}
|
|
103
105
|
});
|
package/dist/business/index.d.ts
CHANGED
package/dist/business/index.js
CHANGED
|
@@ -9,14 +9,14 @@ export interface Business {
|
|
|
9
9
|
licence: Licence | undefined;
|
|
10
10
|
createdAt: Date;
|
|
11
11
|
address: string;
|
|
12
|
-
|
|
12
|
+
googleMapsUrl: string;
|
|
13
|
+
googleMapsReviewLink: string;
|
|
14
|
+
socialLinks: [];
|
|
13
15
|
phones: string[];
|
|
14
|
-
images: string[];
|
|
15
16
|
email: string;
|
|
16
17
|
description: string | undefined;
|
|
17
18
|
maxCashbackApply: number;
|
|
18
|
-
openingHours: OpeningHours
|
|
19
|
-
averagePrice: number | undefined;
|
|
19
|
+
openingHours: OpeningHours | undefined;
|
|
20
20
|
specialities: string[] | undefined;
|
|
21
21
|
telegram?: TelegramConfig | undefined;
|
|
22
22
|
template?: Template | undefined;
|
|
@@ -1,8 +1,26 @@
|
|
|
1
|
+
import { LocalTime } from "../../types";
|
|
1
2
|
export interface OpeningHours {
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
sunday: TimeSlot[];
|
|
4
|
+
monday: TimeSlot[];
|
|
5
|
+
tuesday: TimeSlot[];
|
|
6
|
+
wednesday: TimeSlot[];
|
|
7
|
+
thursday: TimeSlot[];
|
|
8
|
+
friday: TimeSlot[];
|
|
9
|
+
saturday: TimeSlot[];
|
|
10
|
+
}
|
|
11
|
+
export interface TimeSlot {
|
|
12
|
+
openTime: LocalTime;
|
|
13
|
+
closeTime: LocalTime;
|
|
4
14
|
}
|
|
5
15
|
export interface TelegramConfig {
|
|
6
16
|
chatId: string | undefined;
|
|
7
17
|
inviteLink: string | undefined;
|
|
8
18
|
}
|
|
19
|
+
export interface SocialLinks {
|
|
20
|
+
facebook?: string | undefined;
|
|
21
|
+
instagram?: string | undefined;
|
|
22
|
+
twitter?: string | undefined;
|
|
23
|
+
tiktok?: string | undefined;
|
|
24
|
+
youtube?: string | undefined;
|
|
25
|
+
website?: string | undefined;
|
|
26
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { OpeningHours, SocialLinks } from "./shared";
|
|
2
|
+
export interface UpdateBusinessRequest {
|
|
3
|
+
name: string;
|
|
4
|
+
address: string;
|
|
5
|
+
phones: string[];
|
|
6
|
+
openingHours?: OpeningHours | undefined;
|
|
7
|
+
socialLinks?: SocialLinks | undefined;
|
|
8
|
+
googleMapsUrl?: string | undefined;
|
|
9
|
+
googleMapsReviewLink?: string | undefined;
|
|
10
|
+
}
|
package/dist/deals/types.d.ts
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Response } from "../types/business-signin";
|
|
2
|
+
export declare class IamAdminAPIs {
|
|
3
|
+
static myBusiness(props: {
|
|
4
|
+
token: string;
|
|
5
|
+
}): Promise<IamAdminAPIs.MyBusiness[]>;
|
|
6
|
+
static signIn(props: {
|
|
7
|
+
businessId: string;
|
|
8
|
+
token: string;
|
|
9
|
+
}): Promise<Response>;
|
|
10
|
+
}
|
|
11
|
+
export declare namespace IamAdminAPIs {
|
|
12
|
+
interface MyBusiness {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -35,19 +35,35 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
import axios from "axios";
|
|
38
|
-
import { base } from "
|
|
39
|
-
import { RequestUtils } from "
|
|
38
|
+
import { base } from "../../constants";
|
|
39
|
+
import { RequestUtils } from "../../utils/request-utils";
|
|
40
40
|
// iam module APIs
|
|
41
41
|
var IamAdminAPIs = /** @class */ (function () {
|
|
42
42
|
function IamAdminAPIs() {
|
|
43
43
|
}
|
|
44
|
-
IamAdminAPIs.
|
|
44
|
+
IamAdminAPIs.myBusiness = function (props) {
|
|
45
45
|
return __awaiter(this, void 0, void 0, function () {
|
|
46
46
|
return __generator(this, function (_a) {
|
|
47
47
|
return [2 /*return*/, RequestUtils.send(function () {
|
|
48
|
-
return axios.
|
|
48
|
+
return axios.get(base + "/iam/admin/my-business", {
|
|
49
49
|
headers: {
|
|
50
|
-
'Content-Type': 'application/json'
|
|
50
|
+
'Content-Type': 'application/json',
|
|
51
|
+
'Authorization': "".concat(props.token)
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
.then(function (response) { return response.data; });
|
|
55
|
+
})];
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
IamAdminAPIs.signIn = function (props) {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
61
|
+
return __generator(this, function (_a) {
|
|
62
|
+
return [2 /*return*/, RequestUtils.send(function () {
|
|
63
|
+
return axios.get(base + "/iam/admin/sign-in/".concat(props.businessId), {
|
|
64
|
+
headers: {
|
|
65
|
+
'Content-Type': 'application/json',
|
|
66
|
+
'Authorization': "".concat(props.token)
|
|
51
67
|
}
|
|
52
68
|
})
|
|
53
69
|
.then(function (response) { return response.data; });
|
package/dist/iam/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export * from './types/update-profile';
|
|
|
5
5
|
export * from './types/user-signin';
|
|
6
6
|
export * from './types/user-signup-validate';
|
|
7
7
|
export * from './types/user-signup';
|
|
8
|
-
export { IamAdminAPIs } from './admin
|
|
8
|
+
export { IamAdminAPIs } from './api/signin-admin';
|
|
9
9
|
export { IamUserAPIs } from './user-apis';
|
|
10
10
|
export { GetRolesAdminAPI } from './api/get-roles';
|
|
11
11
|
export { GetAdminsAPI } from './api/get-admins';
|
package/dist/iam/index.js
CHANGED
|
@@ -5,7 +5,7 @@ export * from './types/update-profile';
|
|
|
5
5
|
export * from './types/user-signin';
|
|
6
6
|
export * from './types/user-signup-validate';
|
|
7
7
|
export * from './types/user-signup';
|
|
8
|
-
export { IamAdminAPIs } from './admin
|
|
8
|
+
export { IamAdminAPIs } from './api/signin-admin';
|
|
9
9
|
export { IamUserAPIs } from './user-apis';
|
|
10
10
|
// api
|
|
11
11
|
export { GetRolesAdminAPI } from './api/get-roles';
|
|
@@ -10,17 +10,17 @@ export declare namespace GetMenuAdminAPI {
|
|
|
10
10
|
isPublic: boolean;
|
|
11
11
|
products: Product[];
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
interface Product {
|
|
14
14
|
id: string;
|
|
15
15
|
label: string;
|
|
16
|
-
description?: string;
|
|
16
|
+
description?: string | undefined;
|
|
17
17
|
picture?: string | undefined;
|
|
18
18
|
variants: Variant[];
|
|
19
19
|
}
|
|
20
20
|
function isAvailable(product: Product): boolean;
|
|
21
21
|
interface Variant {
|
|
22
22
|
id: string;
|
|
23
|
-
label?: string;
|
|
23
|
+
label?: string | undefined;
|
|
24
24
|
isAvailable: boolean;
|
|
25
25
|
price: number;
|
|
26
26
|
discount?: number;
|
|
@@ -58,12 +58,6 @@ var GetMenuAdminAPI = /** @class */ (function () {
|
|
|
58
58
|
}());
|
|
59
59
|
export { GetMenuAdminAPI };
|
|
60
60
|
(function (GetMenuAdminAPI) {
|
|
61
|
-
var Product = /** @class */ (function () {
|
|
62
|
-
function Product() {
|
|
63
|
-
}
|
|
64
|
-
return Product;
|
|
65
|
-
}());
|
|
66
|
-
GetMenuAdminAPI.Product = Product;
|
|
67
61
|
function isAvailable(product) {
|
|
68
62
|
return product.variants.map(function (variant) { return variant.isAvailable; })
|
|
69
63
|
.reduce(function (a, b) { return a || b; }, false);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { OpeningHours, SocialLinks } from "../../../business/types/shared";
|
|
1
2
|
export interface Menu {
|
|
2
3
|
qrCodeLabel: string;
|
|
3
4
|
business: BusinessOfMenu;
|
|
@@ -7,35 +8,31 @@ export interface BusinessOfMenu {
|
|
|
7
8
|
id: string;
|
|
8
9
|
identifier: string;
|
|
9
10
|
name: string;
|
|
10
|
-
coverPhoto
|
|
11
|
-
logo?: string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
tiktok?: string;
|
|
19
|
-
youtube?: string;
|
|
20
|
-
website?: string;
|
|
21
|
-
googleMapReview?: string;
|
|
11
|
+
coverPhoto?: string | undefined;
|
|
12
|
+
logo?: string | undefined;
|
|
13
|
+
phones: string[];
|
|
14
|
+
address: string;
|
|
15
|
+
openingHours?: OpeningHours | undefined;
|
|
16
|
+
googleMapsUrl?: string | undefined;
|
|
17
|
+
googleMapsReviewLink?: string | undefined;
|
|
18
|
+
socialLinks?: SocialLinks | undefined;
|
|
22
19
|
}
|
|
23
20
|
export interface Category {
|
|
24
21
|
label: string;
|
|
25
22
|
isPublic: boolean;
|
|
26
23
|
products: Product[];
|
|
27
24
|
}
|
|
28
|
-
export
|
|
25
|
+
export interface Product {
|
|
29
26
|
id: string;
|
|
30
27
|
label: string;
|
|
31
|
-
description?: string;
|
|
28
|
+
description?: string | undefined;
|
|
32
29
|
picture?: string | undefined;
|
|
33
30
|
variants: Variant[];
|
|
34
31
|
}
|
|
35
32
|
export declare function isAvailable(product: Product): boolean;
|
|
36
33
|
export interface Variant {
|
|
37
34
|
id: string;
|
|
38
|
-
label?: string;
|
|
35
|
+
label?: string | undefined;
|
|
39
36
|
isAvailable: boolean;
|
|
40
37
|
price: number;
|
|
41
38
|
discount?: number;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
var Product = /** @class */ (function () {
|
|
2
|
-
function Product() {
|
|
3
|
-
}
|
|
4
|
-
return Product;
|
|
5
|
-
}());
|
|
6
|
-
export { Product };
|
|
7
1
|
export function isAvailable(product) {
|
|
8
2
|
return product.variants.map(function (variant) { return variant.isAvailable; })
|
|
9
3
|
.reduce(function (a, b) { return a || b; }, false);
|
package/package.json
CHANGED
package/dist/iam/admin-apis.d.ts
DELETED
|
File without changes
|