@aldb2b/common 1.0.697 → 1.0.700
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/build/decorators/get-user-decorator.js +18 -2
- package/build/decorators/get-user-decorator.js.map +1 -1
- package/build/middlewares/event-profile.middleware.js +7 -3
- package/build/middlewares/event-profile.middleware.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -4,10 +4,26 @@ exports.GetUser = void 0;
|
|
|
4
4
|
const common_1 = require("@nestjs/common");
|
|
5
5
|
exports.GetUser = (0, common_1.createParamDecorator)((data, ctx) => {
|
|
6
6
|
const req = ctx.switchToHttp().getRequest();
|
|
7
|
-
const { id, email, role, type, company, contactId, language, meetingHubEvent, firstname, lastname, eventStatus, moduleType, typeId, eventId } = req.headers;
|
|
7
|
+
const { id, email, role, type, company, contactId, language, meetingHubEvent, firstname, lastname, eventStatus, moduleType, typeId, eventId, eventProfile, } = req.headers;
|
|
8
8
|
if (!id || !email || !role || !type) {
|
|
9
9
|
throw new common_1.BadRequestException('Invalid header');
|
|
10
10
|
}
|
|
11
|
-
return {
|
|
11
|
+
return {
|
|
12
|
+
id,
|
|
13
|
+
email,
|
|
14
|
+
role,
|
|
15
|
+
type,
|
|
16
|
+
company,
|
|
17
|
+
contactId,
|
|
18
|
+
language,
|
|
19
|
+
meetingHubEvent,
|
|
20
|
+
firstname,
|
|
21
|
+
lastname,
|
|
22
|
+
eventstatus: eventStatus,
|
|
23
|
+
moduleType,
|
|
24
|
+
typeId,
|
|
25
|
+
eventId,
|
|
26
|
+
eventProfile,
|
|
27
|
+
};
|
|
12
28
|
});
|
|
13
29
|
//# sourceMappingURL=get-user-decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-user-decorator.js","sourceRoot":"","sources":["../../src/decorators/get-user-decorator.ts"],"names":[],"mappings":";;;AAAA,2CAIuB;AAGV,QAAA,OAAO,GAAG,IAAA,6BAAoB,EACzC,CAAC,IAAI,EAAE,GAAqB,EAAc,EAAE;IAC1C,MAAM,GAAG,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAA;IAC3C,MAAM,
|
|
1
|
+
{"version":3,"file":"get-user-decorator.js","sourceRoot":"","sources":["../../src/decorators/get-user-decorator.ts"],"names":[],"mappings":";;;AAAA,2CAIuB;AAGV,QAAA,OAAO,GAAG,IAAA,6BAAoB,EACzC,CAAC,IAAI,EAAE,GAAqB,EAAc,EAAE;IAC1C,MAAM,GAAG,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAA;IAC3C,MAAM,EACJ,EAAE,EACF,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,SAAS,EACT,QAAQ,EACR,eAAe,EACf,SAAS,EACT,QAAQ,EACR,WAAW,EACX,UAAU,EACV,MAAM,EACN,OAAO,EACP,YAAY,GACb,GAAG,GAAG,CAAC,OAAO,CAAA;IACf,IAAI,CAAC,EAAE,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;QACpC,MAAM,IAAI,4BAAmB,CAAC,gBAAgB,CAAC,CAAA;IACjD,CAAC;IACD,OAAO;QACL,EAAE;QACF,KAAK;QACL,IAAI;QACJ,IAAI;QACJ,OAAO;QACP,SAAS;QACT,QAAQ;QACR,eAAe;QACf,SAAS;QACT,QAAQ;QACR,WAAW,EAAE,WAAW;QACxB,UAAU;QACV,MAAM;QACN,OAAO;QACP,YAAY;KACb,CAAA;AACH,CAAC,CACF,CAAA"}
|
|
@@ -28,10 +28,14 @@ let EventProfileMiddleware = class EventProfileMiddleware {
|
|
|
28
28
|
async use(request, response, next) {
|
|
29
29
|
const eventId = (0, getHeaderParam_1.getHeaderParam)(request.headers, 'event-id');
|
|
30
30
|
const eventProfileKey = events_1.Events.eventProfileKey(eventId);
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
const redisResponse = await this.cachManager.getData(eventProfileKey);
|
|
32
|
+
let eventProfile;
|
|
33
|
+
if (!redisResponse) {
|
|
33
34
|
eventProfile = await (0, rxjs_1.firstValueFrom)(this.client.send(subjects_1.Subjects.GetEventProfile, { eventId: eventId }));
|
|
34
|
-
await this.cachManager.setData(eventProfileKey, eventProfile);
|
|
35
|
+
await this.cachManager.setData(eventProfileKey, JSON.stringify(eventProfile));
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
eventProfile = JSON.parse(redisResponse);
|
|
35
39
|
}
|
|
36
40
|
request.headers.eventProfile = eventProfile;
|
|
37
41
|
next();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-profile.middleware.js","sourceRoot":"","sources":["../../src/middlewares/event-profile.middleware.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAmE;AACnE,yDAAmD;AAEnD,+BAAqC;AACrC,wDAAmD;AACnD,4DAAwD;AACxD,iDAA6C;AAC7C,4CAAwC;AAGjC,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAGjC,YAAoD,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;QACrE,IAAI,CAAC,WAAW,GAAG,IAAI,0BAAW,EAAE,CAAA;IACtC,CAAC;IAED,KAAK,CAAC,GAAG,CACP,OAAgB,EAChB,QAAkB,EAClB,IAAkB;QAElB,MAAM,OAAO,GAAQ,IAAA,+BAAc,EAAC,OAAO,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;QAChE,MAAM,eAAe,GAAG,eAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAA;QACvD,
|
|
1
|
+
{"version":3,"file":"event-profile.middleware.js","sourceRoot":"","sources":["../../src/middlewares/event-profile.middleware.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAmE;AACnE,yDAAmD;AAEnD,+BAAqC;AACrC,wDAAmD;AACnD,4DAAwD;AACxD,iDAA6C;AAC7C,4CAAwC;AAGjC,IAAM,s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