@nimee/api-clients 0.0.5 → 0.0.6
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/src/ticket.d.ts +4 -0
- package/dist/src/ticket.js +9 -0
- package/dist/src/ticket.js.map +1 -1
- package/dist/src/userEvent.d.ts +8 -0
- package/dist/src/userEvent.js +19 -0
- package/dist/src/userEvent.js.map +1 -1
- package/package.json +1 -1
- package/src/ticket.ts +11 -0
- package/src/userEvent.ts +24 -0
package/dist/src/ticket.d.ts
CHANGED
package/dist/src/ticket.js
CHANGED
|
@@ -26,6 +26,15 @@ class TicketClient {
|
|
|
26
26
|
return response === null || response === void 0 ? void 0 : response.data;
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
+
getTotalPriceOfTicketByIds(params) {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
const { token, ticketIds } = params;
|
|
32
|
+
const response = yield axios_1.default.post(`${ticketUrl}/getTotalPriceOfTicketByIds`, { ticketIds }, {
|
|
33
|
+
headers: { jwt: `${token}` },
|
|
34
|
+
});
|
|
35
|
+
return response === null || response === void 0 ? void 0 : response.data;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
29
38
|
}
|
|
30
39
|
exports.TicketClient = TicketClient;
|
|
31
40
|
//# sourceMappingURL=ticket.js.map
|
package/dist/src/ticket.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ticket.js","sourceRoot":"","sources":["../../src/ticket.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;AACpC,MAAM,SAAS,GAAG,oBAAoB,IAAI,eAAe,CAAC;AAE1D,MAAa,YAAY;IACjB,aAAa,CAAC,MAA+E;;YACjG,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,MAAM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R,QAAQ,CAAE,IAAI,CAAC;QACxB,CAAC;KAAA;CACF;AAnBD,oCAmBC"}
|
package/dist/src/userEvent.d.ts
CHANGED
|
@@ -3,4 +3,12 @@ export declare class UserEventClient {
|
|
|
3
3
|
customPaymentJWT: string;
|
|
4
4
|
adminJWT: string;
|
|
5
5
|
}): Promise<any>;
|
|
6
|
+
getTotalPriceOfTicketsByIds(params: {
|
|
7
|
+
userEventsIds: string[];
|
|
8
|
+
adminJWT: string;
|
|
9
|
+
}): Promise<any>;
|
|
10
|
+
getEventOrderByJWT(params: {
|
|
11
|
+
customPaymentJWT: string;
|
|
12
|
+
adminJWT: string;
|
|
13
|
+
}): Promise<any>;
|
|
6
14
|
}
|
package/dist/src/userEvent.js
CHANGED
|
@@ -16,6 +16,7 @@ exports.UserEventClient = void 0;
|
|
|
16
16
|
const axios_1 = __importDefault(require("axios"));
|
|
17
17
|
const port = process.env.USER_EVENT_PORT;
|
|
18
18
|
const userEventUrl = `http://localhost:${port}/user-event`;
|
|
19
|
+
const userEventOrderUrl = `http://localhost:${port}/user-event/event-order`;
|
|
19
20
|
class UserEventClient {
|
|
20
21
|
getUserEventByJWT(params) {
|
|
21
22
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -26,6 +27,24 @@ class UserEventClient {
|
|
|
26
27
|
return response === null || response === void 0 ? void 0 : response.data;
|
|
27
28
|
});
|
|
28
29
|
}
|
|
30
|
+
getTotalPriceOfTicketsByIds(params) {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
const { userEventsIds, adminJWT } = params;
|
|
33
|
+
const response = yield axios_1.default.post(`${userEventUrl}/getTotalPriceOfTicketsByIds`, { userEventsIds }, {
|
|
34
|
+
headers: { jwt: `${adminJWT}` },
|
|
35
|
+
});
|
|
36
|
+
return response === null || response === void 0 ? void 0 : response.data;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
getEventOrderByJWT(params) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
const { customPaymentJWT, adminJWT } = params;
|
|
42
|
+
const response = yield axios_1.default.post(`${userEventOrderUrl}/getByJWT`, { customPaymentJWT }, {
|
|
43
|
+
headers: { jwt: `${adminJWT}` },
|
|
44
|
+
});
|
|
45
|
+
return response === null || response === void 0 ? void 0 : response.data;
|
|
46
|
+
});
|
|
47
|
+
}
|
|
29
48
|
}
|
|
30
49
|
exports.UserEventClient = UserEventClient;
|
|
31
50
|
//# sourceMappingURL=userEvent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userEvent.js","sourceRoot":"","sources":["../../src/userEvent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;AACzC,MAAM,YAAY,GAAG,oBAAoB,IAAI,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"userEvent.js","sourceRoot":"","sources":["../../src/userEvent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;AACzC,MAAM,YAAY,GAAG,oBAAoB,IAAI,aAAa,CAAC;AAC3D,MAAM,iBAAiB,GAAG,oBAAoB,IAAI,yBAAyB,CAAC;AAE5E,MAAa,eAAe;IACpB,iBAAiB,CAAC,MAAsD;;YAC5E,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;YAC9C,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,IAAI,CAC/B,GAAG,YAAY,WAAW,EAC1B,EAAE,gBAAgB,EAAE,EACpB;gBACE,OAAO,EAAE,EAAE,GAAG,EAAE,GAAG,QAAQ,EAAE,EAAE;aAChC,CACF,CAAC;YACF,OAAO,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,CAAC;QACxB,CAAC;KAAA;IACK,2BAA2B,CAAC,MAAqD;;YACrF,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;YAC3C,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,IAAI,CAC/B,GAAG,YAAY,8BAA8B,EAC7C,EAAE,aAAa,EAAE,EACjB;gBACE,OAAO,EAAE,EAAE,GAAG,EAAE,GAAG,QAAQ,EAAE,EAAE;aAChC,CACF,CAAC;YACF,OAAO,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,CAAC;QACxB,CAAC;KAAA;IAEK,kBAAkB,CAAC,MAAsD;;YAC7E,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;YAC9C,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,IAAI,CAC/B,GAAG,iBAAiB,WAAW,EAC/B,EAAE,gBAAgB,EAAE,EACpB;gBACE,OAAO,EAAE,EAAE,GAAG,EAAE,GAAG,QAAQ,EAAE,EAAE;aAChC,CACF,CAAC;YACF,OAAO,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,CAAC;QACxB,CAAC;KAAA;CACF;AAnCD,0CAmCC"}
|
package/package.json
CHANGED
package/src/ticket.ts
CHANGED
|
@@ -10,4 +10,15 @@ export class TicketClient {
|
|
|
10
10
|
});
|
|
11
11
|
return response?.data;
|
|
12
12
|
}
|
|
13
|
+
async getTotalPriceOfTicketByIds(params: { token: string; ticketIds: string[] }) {
|
|
14
|
+
const { token, ticketIds } = params;
|
|
15
|
+
const response = await axios.post(
|
|
16
|
+
`${ticketUrl}/getTotalPriceOfTicketByIds`,
|
|
17
|
+
{ ticketIds },
|
|
18
|
+
{
|
|
19
|
+
headers: { jwt: `${token}` },
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
return response?.data;
|
|
23
|
+
}
|
|
13
24
|
}
|
package/src/userEvent.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
2
|
const port = process.env.USER_EVENT_PORT;
|
|
3
3
|
const userEventUrl = `http://localhost:${port}/user-event`;
|
|
4
|
+
const userEventOrderUrl = `http://localhost:${port}/user-event/event-order`;
|
|
4
5
|
|
|
5
6
|
export class UserEventClient {
|
|
6
7
|
async getUserEventByJWT(params: { customPaymentJWT: string; adminJWT: string }) {
|
|
@@ -14,4 +15,27 @@ export class UserEventClient {
|
|
|
14
15
|
);
|
|
15
16
|
return response?.data;
|
|
16
17
|
}
|
|
18
|
+
async getTotalPriceOfTicketsByIds(params: { userEventsIds: string[]; adminJWT: string }) {
|
|
19
|
+
const { userEventsIds, adminJWT } = params;
|
|
20
|
+
const response = await axios.post(
|
|
21
|
+
`${userEventUrl}/getTotalPriceOfTicketsByIds`,
|
|
22
|
+
{ userEventsIds },
|
|
23
|
+
{
|
|
24
|
+
headers: { jwt: `${adminJWT}` },
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
return response?.data;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async getEventOrderByJWT(params: { customPaymentJWT: string; adminJWT: string }) {
|
|
31
|
+
const { customPaymentJWT, adminJWT } = params;
|
|
32
|
+
const response = await axios.post(
|
|
33
|
+
`${userEventOrderUrl}/getByJWT`,
|
|
34
|
+
{ customPaymentJWT },
|
|
35
|
+
{
|
|
36
|
+
headers: { jwt: `${adminJWT}` },
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
return response?.data;
|
|
40
|
+
}
|
|
17
41
|
}
|