@kiminix/tp-client 1.26.0 → 1.28.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/README +13 -0
- package/dist/business/apis.js +24 -9
- package/dist/enum.d.ts +5 -0
- package/dist/enum.js +6 -0
- package/dist/reservations/shared/reservation-deal.d.ts +3 -3
- package/package.json +1 -1
package/README
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
## step of release:
|
|
2
|
+
- build the project: `npm run build`
|
|
3
|
+
- upgrade the version in `package.json`
|
|
4
|
+
- commit the changes
|
|
5
|
+
- create a tag: `git tag v0.0.0`
|
|
6
|
+
- push the changes: `git push origin master --tags`
|
|
7
|
+
- publish the package to npmjs: `npm publish --access public`
|
|
8
|
+
|
|
9
|
+
## local dev & test
|
|
10
|
+
- run `npm build`
|
|
11
|
+
- then in the project you want to use this package run `npm i /Users/kamoun/workspace/tayara.promo/webapps/tp-client`
|
|
12
|
+
|
|
13
|
+
|
package/dist/business/apis.js
CHANGED
|
@@ -59,16 +59,31 @@ var BusinessAPIs = /** @class */ (function () {
|
|
|
59
59
|
};
|
|
60
60
|
BusinessAPIs.get = function (identifier) {
|
|
61
61
|
return __awaiter(this, void 0, void 0, function () {
|
|
62
|
+
var _this = this;
|
|
62
63
|
return __generator(this, function (_a) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
64
|
+
return [2 /*return*/, RequestUtils.send(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
65
|
+
return __generator(this, function (_a) {
|
|
66
|
+
switch (_a.label) {
|
|
67
|
+
case 0: return [4 /*yield*/, axios.get(base + "/business/".concat(identifier))
|
|
68
|
+
.then(function (response) {
|
|
69
|
+
var data = response.data;
|
|
70
|
+
data.createdAt = parseISO("".concat(data.createdAt));
|
|
71
|
+
return data;
|
|
72
|
+
})
|
|
73
|
+
.catch(function (error) {
|
|
74
|
+
var _a;
|
|
75
|
+
var axiosError = error;
|
|
76
|
+
switch ((_a = axiosError === null || axiosError === void 0 ? void 0 : axiosError.response) === null || _a === void 0 ? void 0 : _a.status) {
|
|
77
|
+
case 404:
|
|
78
|
+
return undefined;
|
|
79
|
+
default:
|
|
80
|
+
throw error;
|
|
81
|
+
}
|
|
82
|
+
})];
|
|
83
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}); })];
|
|
72
87
|
});
|
|
73
88
|
});
|
|
74
89
|
};
|
package/dist/enum.d.ts
CHANGED
|
@@ -11,6 +11,11 @@ export declare enum ReservationDealKind {
|
|
|
11
11
|
CashbackEarn = "cashback_earn",
|
|
12
12
|
CashBackApply = "cashback_apply"
|
|
13
13
|
}
|
|
14
|
+
export declare enum CashbackStatus {
|
|
15
|
+
Completed = "completed",
|
|
16
|
+
InProgress = "in_progress",
|
|
17
|
+
Canceled = "canceled"
|
|
18
|
+
}
|
|
14
19
|
export declare enum Level {
|
|
15
20
|
Bronze = "bronze",
|
|
16
21
|
Silver = "silver",
|
package/dist/enum.js
CHANGED
|
@@ -13,6 +13,12 @@ export var ReservationDealKind;
|
|
|
13
13
|
ReservationDealKind["CashbackEarn"] = "cashback_earn";
|
|
14
14
|
ReservationDealKind["CashBackApply"] = "cashback_apply";
|
|
15
15
|
})(ReservationDealKind || (ReservationDealKind = {}));
|
|
16
|
+
export var CashbackStatus;
|
|
17
|
+
(function (CashbackStatus) {
|
|
18
|
+
CashbackStatus["Completed"] = "completed";
|
|
19
|
+
CashbackStatus["InProgress"] = "in_progress";
|
|
20
|
+
CashbackStatus["Canceled"] = "canceled";
|
|
21
|
+
})(CashbackStatus || (CashbackStatus = {}));
|
|
16
22
|
export var Level;
|
|
17
23
|
(function (Level) {
|
|
18
24
|
Level["Bronze"] = "bronze";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Level, ReservationDealKind } from "../../enum";
|
|
1
|
+
import { CashbackStatus, Level, ReservationDealKind } from "../../enum";
|
|
2
2
|
export interface Discount {
|
|
3
3
|
type: ReservationDealKind.Discount;
|
|
4
4
|
value: number;
|
|
@@ -8,12 +8,12 @@ export interface CashbackEarn {
|
|
|
8
8
|
value: number;
|
|
9
9
|
level: Level;
|
|
10
10
|
rate: number;
|
|
11
|
-
|
|
11
|
+
status: CashbackStatus;
|
|
12
12
|
}
|
|
13
13
|
export interface CashbackApply {
|
|
14
14
|
type: ReservationDealKind.CashBackApply;
|
|
15
15
|
value: number;
|
|
16
|
-
|
|
16
|
+
status: CashbackStatus;
|
|
17
17
|
}
|
|
18
18
|
export type ReservationDeal = Discount | CashbackEarn | CashbackApply;
|
|
19
19
|
export declare function parseReservationDeal(json: any): ReservationDeal;
|