@kiminix/tp-client 1.27.0 → 1.29.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
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/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";
|
|
@@ -43,4 +43,11 @@ export declare class ReservationsAdminAPIs {
|
|
|
43
43
|
child?: number;
|
|
44
44
|
}[];
|
|
45
45
|
}): Promise<Either<Error, void>>;
|
|
46
|
+
static getPagePrivate(props: {
|
|
47
|
+
token?: string;
|
|
48
|
+
page: number;
|
|
49
|
+
size: number;
|
|
50
|
+
status?: ReservationStatus;
|
|
51
|
+
direction?: TimelineDirection;
|
|
52
|
+
}): Promise<Reservation[]>;
|
|
46
53
|
}
|
|
@@ -230,6 +230,35 @@ var ReservationsAdminAPIs = /** @class */ (function () {
|
|
|
230
230
|
});
|
|
231
231
|
});
|
|
232
232
|
};
|
|
233
|
+
// API for private admins
|
|
234
|
+
ReservationsAdminAPIs.getPagePrivate = function (props) {
|
|
235
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
236
|
+
return __generator(this, function (_a) {
|
|
237
|
+
return [2 /*return*/, RequestUtils.send(function () {
|
|
238
|
+
var queryParams = [
|
|
239
|
+
"page=".concat(props.page),
|
|
240
|
+
"size=".concat(props.size),
|
|
241
|
+
props.direction ? "direction=".concat(props.direction) : undefined,
|
|
242
|
+
props.status ? "status=".concat(props.status) : undefined
|
|
243
|
+
]
|
|
244
|
+
.filter(function (value) { return value; })
|
|
245
|
+
.join("&");
|
|
246
|
+
return axios.get(base + "/reservations/private?".concat(queryParams), {
|
|
247
|
+
headers: {
|
|
248
|
+
'Authorization': "".concat(props.token)
|
|
249
|
+
}
|
|
250
|
+
})
|
|
251
|
+
.then(function (response) {
|
|
252
|
+
var result = response.data;
|
|
253
|
+
for (var i = 0; i < result.length; i++) {
|
|
254
|
+
result[i].deal = result[i].deal ? parseReservationDeal(result[i].deal) : undefined;
|
|
255
|
+
}
|
|
256
|
+
return result;
|
|
257
|
+
});
|
|
258
|
+
})];
|
|
259
|
+
});
|
|
260
|
+
});
|
|
261
|
+
};
|
|
233
262
|
return ReservationsAdminAPIs;
|
|
234
263
|
}());
|
|
235
264
|
export { ReservationsAdminAPIs };
|
|
@@ -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;
|