@kiminix/tp-client 1.24.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.
- package/dist/business/apis.d.ts +2 -0
- package/dist/business/apis.js +19 -0
- package/dist/business/index.d.ts +5 -0
- package/dist/business/index.js +5 -0
- package/dist/business/types/get-all.d.ts +1 -5
- package/dist/business/types/get-carte-menus.d.ts +9 -0
- package/dist/business/types/get-carte-menus.js +1 -0
- package/dist/business/types/get-id.d.ts +1 -5
- package/dist/business/types/shared.d.ts +14 -0
- package/dist/business/types/shared.js +1 -0
- package/dist/iam/types/update-profile.d.ts +0 -1
- package/dist/iam/user-apis.d.ts +13 -1
- package/dist/iam/user-apis.js +33 -42
- package/dist/index.d.ts +1 -2
- package/dist/index.js +2 -2
- package/dist/reservations/admin/admin-apis.d.ts +2 -2
- package/dist/reservations/admin/admin-apis.js +3 -3
- package/dist/reservations/shared/reservation.d.ts +2 -2
- package/package.json +1 -1
package/dist/business/apis.d.ts
CHANGED
|
@@ -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
|
}
|
package/dist/business/apis.js
CHANGED
|
@@ -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 @@
|
|
|
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/iam/user-apis.d.ts
CHANGED
|
@@ -11,6 +11,18 @@ export declare class IamUserAPIs {
|
|
|
11
11
|
static signUpValidate({ phone, email, password }: SignUpValidateRequest): Promise<Either<Error, void>>;
|
|
12
12
|
static me(token?: string): Promise<MeResponse>;
|
|
13
13
|
static resetPassword({ code, email, password }: ResetPasswordRequest): Promise<Either<Error, void>>;
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @errors
|
|
17
|
+
* email_already_used
|
|
18
|
+
* phone_already_used
|
|
19
|
+
* invalid_email_format
|
|
20
|
+
* invalid_phone_format
|
|
21
|
+
* user_not_found
|
|
22
|
+
* invalid_actual_password
|
|
23
|
+
* weak_password
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
26
|
+
static updateProfile({ token, firstName, lastName, phone, email, birthday, gender, password }: UpdateProfileRequest): Promise<UpdateProfileResponse>;
|
|
15
27
|
static validatePhone(token: string | undefined, phone: string, code: string): Promise<Either<Error, void>>;
|
|
16
28
|
}
|
package/dist/iam/user-apis.js
CHANGED
|
@@ -37,6 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
import axios from "axios";
|
|
38
38
|
import { Left, Right } from "purify-ts";
|
|
39
39
|
import { base } from "../constants";
|
|
40
|
+
import { RequestUtils } from "../utils/request-utils";
|
|
40
41
|
// iam module APIs
|
|
41
42
|
var IamUserAPIs = /** @class */ (function () {
|
|
42
43
|
function IamUserAPIs() {
|
|
@@ -191,52 +192,42 @@ var IamUserAPIs = /** @class */ (function () {
|
|
|
191
192
|
});
|
|
192
193
|
});
|
|
193
194
|
};
|
|
195
|
+
/**
|
|
196
|
+
*
|
|
197
|
+
* @errors
|
|
198
|
+
* email_already_used
|
|
199
|
+
* phone_already_used
|
|
200
|
+
* invalid_email_format
|
|
201
|
+
* invalid_phone_format
|
|
202
|
+
* user_not_found
|
|
203
|
+
* invalid_actual_password
|
|
204
|
+
* weak_password
|
|
205
|
+
* @returns
|
|
206
|
+
*/
|
|
194
207
|
IamUserAPIs.updateProfile = function (_a) {
|
|
195
208
|
var token = _a.token, firstName = _a.firstName, lastName = _a.lastName, phone = _a.phone, email = _a.email, birthday = _a.birthday, gender = _a.gender, password = _a.password;
|
|
196
209
|
return __awaiter(this, void 0, void 0, function () {
|
|
197
210
|
return __generator(this, function (_b) {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
.catch(function (error) {
|
|
219
|
-
if (error.response.status == 400) {
|
|
220
|
-
//email_already_used
|
|
221
|
-
//phone_already_used
|
|
222
|
-
//invalid_email_format
|
|
223
|
-
//invalid_phone_format
|
|
224
|
-
//user_not_found
|
|
225
|
-
//invalid_actual_password
|
|
226
|
-
//weak_password
|
|
227
|
-
var response = error.response.data.code;
|
|
228
|
-
return Left(Error(response));
|
|
229
|
-
}
|
|
230
|
-
else {
|
|
231
|
-
console.error(error);
|
|
232
|
-
return Left(Error('internal_error'));
|
|
233
|
-
}
|
|
234
|
-
})];
|
|
235
|
-
case 1:
|
|
236
|
-
// Send the data to the server in JSON format.
|
|
237
|
-
return [2 /*return*/, _b.sent()];
|
|
238
|
-
case 2: return [2 /*return*/, Left(Error("unauthorized"))];
|
|
239
|
-
}
|
|
211
|
+
return [2 /*return*/, RequestUtils.send(function () {
|
|
212
|
+
// Send the data to the server in JSON format.
|
|
213
|
+
return axios.patch(base + "/iam/users/me", {
|
|
214
|
+
firstName: firstName,
|
|
215
|
+
lastName: lastName,
|
|
216
|
+
phone: phone,
|
|
217
|
+
email: email,
|
|
218
|
+
birthday: birthday,
|
|
219
|
+
gender: gender,
|
|
220
|
+
password: password
|
|
221
|
+
}, {
|
|
222
|
+
headers: {
|
|
223
|
+
'Authorization': "".concat(token),
|
|
224
|
+
'Content-Type': 'application/json'
|
|
225
|
+
}
|
|
226
|
+
})
|
|
227
|
+
.then(function (response) {
|
|
228
|
+
return response.data;
|
|
229
|
+
});
|
|
230
|
+
})];
|
|
240
231
|
});
|
|
241
232
|
});
|
|
242
233
|
};
|
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 {
|
|
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
|
|
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:
|
|
41
|
+
business: BusinessOfReservation;
|
|
42
42
|
user: User;
|
|
43
43
|
datetime: string;
|
|
44
44
|
status: ReservationStatus;
|