@nimee/api-clients 0.0.3 → 0.0.4
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/index.d.ts +1 -0
- package/dist/src/index.js +3 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/userEvent.d.ts +6 -0
- package/dist/src/userEvent.js +31 -0
- package/dist/src/userEvent.js.map +1 -0
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/userEvent.ts +17 -0
package/dist/src/index.d.ts
CHANGED
package/dist/src/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TicketClient = exports.EventClient = exports.UserClient = void 0;
|
|
3
|
+
exports.UserEventClient = exports.TicketClient = exports.EventClient = exports.UserClient = void 0;
|
|
4
4
|
var user_1 = require("./user");
|
|
5
5
|
Object.defineProperty(exports, "UserClient", { enumerable: true, get: function () { return user_1.UserClient; } });
|
|
6
6
|
var event_1 = require("./event");
|
|
7
7
|
Object.defineProperty(exports, "EventClient", { enumerable: true, get: function () { return event_1.EventClient; } });
|
|
8
8
|
var ticket_1 = require("./ticket");
|
|
9
9
|
Object.defineProperty(exports, "TicketClient", { enumerable: true, get: function () { return ticket_1.TicketClient; } });
|
|
10
|
+
var userEvent_1 = require("./userEvent");
|
|
11
|
+
Object.defineProperty(exports, "UserEventClient", { enumerable: true, get: function () { return userEvent_1.UserEventClient; } });
|
|
10
12
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,+BAAoC;AAA3B,kGAAA,UAAU,OAAA;AACnB,iCAAsC;AAA7B,oGAAA,WAAW,OAAA;AACpB,mCAAwC;AAA/B,sGAAA,YAAY,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,+BAAoC;AAA3B,kGAAA,UAAU,OAAA;AACnB,iCAAsC;AAA7B,oGAAA,WAAW,OAAA;AACpB,mCAAwC;AAA/B,sGAAA,YAAY,OAAA;AACrB,yCAA8C;AAArC,4GAAA,eAAe,OAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.UserEventClient = void 0;
|
|
16
|
+
const axios_1 = __importDefault(require("axios"));
|
|
17
|
+
const port = process.env.USER_EVENT_PORT;
|
|
18
|
+
const userEventUrl = `http://localhost:${port}/user-event`;
|
|
19
|
+
class UserEventClient {
|
|
20
|
+
getUserEventByJWT(params) {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
const { customPaymentJWT, adminJWT } = params;
|
|
23
|
+
const response = yield axios_1.default.post(`${userEventUrl}/getByJWT`, { customPaymentJWT }, {
|
|
24
|
+
headers: { authorization: `${adminJWT}` },
|
|
25
|
+
});
|
|
26
|
+
return response === null || response === void 0 ? void 0 : response.data;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.UserEventClient = UserEventClient;
|
|
31
|
+
//# sourceMappingURL=userEvent.js.map
|
|
@@ -0,0 +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;AAE3D,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,aAAa,EAAE,GAAG,QAAQ,EAAE,EAAE;aAC1C,CACF,CAAC;YACF,OAAO,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,CAAC;QACxB,CAAC;KAAA;CACF;AAZD,0CAYC"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
package/src/userEvent.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
const port = process.env.USER_EVENT_PORT;
|
|
3
|
+
const userEventUrl = `http://localhost:${port}/user-event`;
|
|
4
|
+
|
|
5
|
+
export class UserEventClient {
|
|
6
|
+
async getUserEventByJWT(params: { customPaymentJWT: string; adminJWT: string }) {
|
|
7
|
+
const { customPaymentJWT, adminJWT } = params;
|
|
8
|
+
const response = await axios.post(
|
|
9
|
+
`${userEventUrl}/getByJWT`,
|
|
10
|
+
{ customPaymentJWT },
|
|
11
|
+
{
|
|
12
|
+
headers: { authorization: `${adminJWT}` },
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
return response?.data;
|
|
16
|
+
}
|
|
17
|
+
}
|