@kiminix/tp-client 2.1.0 → 2.3.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.
@@ -10,10 +10,17 @@ export declare class BusinessAdminAPIs {
10
10
  static subscription(props: {
11
11
  name: string;
12
12
  address: string;
13
- addition: string;
14
13
  firstName: string;
15
14
  lastName: string;
16
15
  phone: string;
17
- socialNetwork?: string;
16
+ email: string;
17
+ discounts?: {
18
+ day: string;
19
+ discount: string;
20
+ }[] | undefined;
21
+ openingHours?: {
22
+ from: string;
23
+ to: string;
24
+ }[] | undefined;
18
25
  }): Promise<any>;
19
26
  }
@@ -74,11 +74,12 @@ var BusinessAdminAPIs = /** @class */ (function () {
74
74
  return axios.post(base + "/business/subscriptions", {
75
75
  name: props.name,
76
76
  address: props.address,
77
- addition: props.addition,
78
77
  firstName: props.firstName,
79
78
  lastName: props.lastName,
80
79
  phone: props.phone,
81
- socialNetwork: props.socialNetwork
80
+ email: props.email,
81
+ discounts: props.discounts,
82
+ openingHours: props.openingHours
82
83
  }, {})
83
84
  .then(function (response) { return response.data; });
84
85
  })];
package/dist/enum.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  export declare enum ReservationStatus {
2
- Pending = "pending",
3
2
  Confirmed = "confirmed",
4
3
  Validated = "validated",
5
4
  Missed = "missed",
package/dist/enum.js CHANGED
@@ -1,6 +1,5 @@
1
1
  export var ReservationStatus;
2
2
  (function (ReservationStatus) {
3
- ReservationStatus["Pending"] = "pending";
4
3
  ReservationStatus["Confirmed"] = "confirmed";
5
4
  ReservationStatus["Validated"] = "validated";
6
5
  ReservationStatus["Missed"] = "missed";
@@ -25,7 +25,8 @@ export declare class IamUserAPIs {
25
25
  * @returns
26
26
  */
27
27
  static updateProfile({ token, firstName, lastName, phone, email, birthday, gender, password }: UpdateProfileRequest): Promise<UpdateProfileResponse>;
28
- static validatePhone(token: string | undefined, phone: string, code: string): Promise<Either<Error, void>>;
28
+ static validatePhone(token: string | undefined, phone: string, code: string): Promise<void>;
29
+ static validateEmail(email: string, code: string): Promise<void>;
29
30
  /**
30
31
  *
31
32
  * @errors
@@ -234,9 +234,9 @@ var IamUserAPIs = /** @class */ (function () {
234
234
  IamUserAPIs.validatePhone = function (token, phone, code) {
235
235
  return __awaiter(this, void 0, void 0, function () {
236
236
  return __generator(this, function (_a) {
237
- if (token) {
238
- // Send the data to the server in JSON format.
239
- return [2 /*return*/, axios.post(base + "/iam/users/phone/validation", {
237
+ return [2 /*return*/, RequestUtils.send(function () {
238
+ // Send the data to the server in JSON format.
239
+ return axios.post(base + "/iam/validation/phone", {
240
240
  phone: phone,
241
241
  code: code
242
242
  }, {
@@ -246,22 +246,29 @@ var IamUserAPIs = /** @class */ (function () {
246
246
  }
247
247
  })
248
248
  .then(function (response) {
249
- return Right(undefined);
250
- })
251
- .catch(function (error) {
252
- if (error.response.status == 400) {
253
- //invalid_code
254
- var response = error.response.data;
255
- return (Left(Error(response.code)));
249
+ return undefined;
250
+ });
251
+ })];
252
+ });
253
+ });
254
+ };
255
+ IamUserAPIs.validateEmail = function (email, code) {
256
+ return __awaiter(this, void 0, void 0, function () {
257
+ return __generator(this, function (_a) {
258
+ return [2 /*return*/, RequestUtils.send(function () {
259
+ // Send the data to the server in JSON format.
260
+ return axios.post(base + "/iam/validation/email", {
261
+ email: email,
262
+ code: code
263
+ }, {
264
+ headers: {
265
+ 'Content-Type': 'application/json'
256
266
  }
257
- else
258
- throw new Error('internal_error', error);
259
- })];
260
- }
261
- else {
262
- throw new Error("unauthorized");
263
- }
264
- return [2 /*return*/];
267
+ })
268
+ .then(function (response) {
269
+ return undefined;
270
+ });
271
+ })];
265
272
  });
266
273
  });
267
274
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiminix/tp-client",
3
- "version": "2.1.0",
3
+ "version": "2.3.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [