@campxdev/server-shared 1.4.0-alpha.3 → 1.4.0-alpha.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.
Files changed (32) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +1 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/modules-handler/index.d.ts +3 -0
  6. package/dist/modules-handler/index.d.ts.map +1 -0
  7. package/dist/{modules → modules-handler}/index.js +2 -2
  8. package/dist/modules-handler/index.js.map +1 -0
  9. package/dist/modules-handler/modules-handler.module.d.ts +3 -0
  10. package/dist/modules-handler/modules-handler.module.d.ts.map +1 -0
  11. package/dist/modules-handler/modules-handler.module.js +93 -0
  12. package/dist/modules-handler/modules-handler.module.js.map +1 -0
  13. package/dist/modules-handler/modules-handler.service.d.ts +26 -0
  14. package/dist/modules-handler/modules-handler.service.d.ts.map +1 -0
  15. package/dist/modules-handler/modules-handler.service.js +125 -0
  16. package/dist/modules-handler/modules-handler.service.js.map +1 -0
  17. package/dist/utils/constants.d.ts +6 -0
  18. package/dist/utils/constants.d.ts.map +1 -1
  19. package/dist/utils/constants.js +7 -1
  20. package/dist/utils/constants.js.map +1 -1
  21. package/package.json +1 -1
  22. package/dist/modules/index.d.ts +0 -3
  23. package/dist/modules/index.d.ts.map +0 -1
  24. package/dist/modules/index.js.map +0 -1
  25. package/dist/modules/modules.handler.d.ts +0 -9
  26. package/dist/modules/modules.handler.d.ts.map +0 -1
  27. package/dist/modules/modules.handler.js +0 -61
  28. package/dist/modules/modules.handler.js.map +0 -1
  29. package/dist/modules/services.module.d.ts +0 -9
  30. package/dist/modules/services.module.d.ts.map +0 -1
  31. package/dist/modules/services.module.js +0 -46
  32. package/dist/modules/services.module.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export * from './common';
2
2
  export * from './domain';
3
3
  export * from './media';
4
- export * from './modules';
4
+ export * from './modules-handler';
5
5
  export * from './permissions';
6
6
  export * from './request-store';
7
7
  export * from './shared-module';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
package/dist/index.js CHANGED
@@ -17,7 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./common"), exports);
18
18
  __exportStar(require("./domain"), exports);
19
19
  __exportStar(require("./media"), exports);
20
- __exportStar(require("./modules"), exports);
20
+ __exportStar(require("./modules-handler"), exports);
21
21
  __exportStar(require("./permissions"), exports);
22
22
  __exportStar(require("./request-store"), exports);
23
23
  __exportStar(require("./shared-module"), exports);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,2CAAyB;AACzB,0CAAwB;AACxB,4CAA0B;AAC1B,gDAA8B;AAC9B,kDAAgC;AAChC,kDAAgC;AAChC,0CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,2CAAyB;AACzB,0CAAwB;AACxB,oDAAkC;AAClC,gDAA8B;AAC9B,kDAAgC;AAChC,kDAAgC;AAChC,0CAAwB"}
@@ -0,0 +1,3 @@
1
+ export * from './modules-handler.module';
2
+ export * from './modules-handler.service';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/modules-handler/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC"}
@@ -14,6 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./modules.handler"), exports);
18
- __exportStar(require("./services.module"), exports);
17
+ __exportStar(require("./modules-handler.module"), exports);
18
+ __exportStar(require("./modules-handler.service"), exports);
19
19
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/modules-handler/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,4DAA0C"}
@@ -0,0 +1,3 @@
1
+ export declare class ModulesHandlerModule {
2
+ }
3
+ //# sourceMappingURL=modules-handler.module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modules-handler.module.d.ts","sourceRoot":"","sources":["../../src/modules-handler/modules-handler.module.ts"],"names":[],"mappings":"AAYA,qBA0Ea,oBAAoB;CAAG"}
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.ModulesHandlerModule = void 0;
10
+ const common_1 = require("@nestjs/common");
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ const utils_1 = require("../utils");
13
+ const modules_handler_service_1 = require("./modules-handler.service");
14
+ let ModulesHandlerModule = class ModulesHandlerModule {
15
+ };
16
+ exports.ModulesHandlerModule = ModulesHandlerModule;
17
+ exports.ModulesHandlerModule = ModulesHandlerModule = __decorate([
18
+ (0, common_1.Module)({
19
+ imports: [
20
+ microservices_1.ClientsModule.register([
21
+ {
22
+ name: utils_1.ADMIN_SERVICE,
23
+ transport: microservices_1.Transport.RMQ,
24
+ options: {
25
+ urls: [process.env.RMQ_HOST],
26
+ queue: process.env.ADMIN_RMQ_QUEUE || 'admin_queue',
27
+ queueOptions: {
28
+ durable: false,
29
+ },
30
+ },
31
+ },
32
+ {
33
+ name: utils_1.HRMS_SERVICE,
34
+ transport: microservices_1.Transport.RMQ,
35
+ options: {
36
+ urls: [process.env.RMQ_HOST],
37
+ queue: process.env.HRMS_RMQ_QUEUE || 'hrms_queue',
38
+ queueOptions: {
39
+ durable: false,
40
+ },
41
+ },
42
+ },
43
+ {
44
+ name: utils_1.PAYMENTX_SERVICE,
45
+ transport: microservices_1.Transport.RMQ,
46
+ options: {
47
+ urls: [process.env.RMQ_HOST],
48
+ queue: process.env.PAYMENTX_RMQ_QUEUE || 'paymentx_queue',
49
+ queueOptions: {
50
+ durable: false,
51
+ },
52
+ },
53
+ },
54
+ {
55
+ name: utils_1.SQUARE_SERVICE,
56
+ transport: microservices_1.Transport.RMQ,
57
+ options: {
58
+ urls: [process.env.RMQ_HOST],
59
+ queue: process.env.SQUARE_RMQ_QUEUE || 'square_queue',
60
+ queueOptions: {
61
+ durable: false,
62
+ },
63
+ },
64
+ },
65
+ {
66
+ name: utils_1.EXAMS_SERVICE,
67
+ transport: microservices_1.Transport.RMQ,
68
+ options: {
69
+ urls: [process.env.RMQ_HOST],
70
+ queue: process.env.EXAMS_RMQ_QUEUE || 'exams_queue',
71
+ queueOptions: {
72
+ durable: false,
73
+ },
74
+ },
75
+ },
76
+ {
77
+ name: utils_1.NOTIFICATION_SERVICE,
78
+ transport: microservices_1.Transport.RMQ,
79
+ options: {
80
+ urls: [process.env.RMQ_HOST],
81
+ queue: process.env.NOTIFICATION_RMQ_QUEUE || 'notification_queue',
82
+ queueOptions: {
83
+ durable: false,
84
+ },
85
+ },
86
+ },
87
+ ]),
88
+ ],
89
+ providers: [modules_handler_service_1.ModulesHandlerService],
90
+ exports: [modules_handler_service_1.ModulesHandlerService],
91
+ })
92
+ ], ModulesHandlerModule);
93
+ //# sourceMappingURL=modules-handler.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modules-handler.module.js","sourceRoot":"","sources":["../../src/modules-handler/modules-handler.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,yDAAiE;AACjE,oCAOkB;AAClB,uEAAkE;AA4E3D,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAAG,CAAA;AAAvB,oDAAoB;+BAApB,oBAAoB;IA1EhC,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,6BAAa,CAAC,QAAQ,CAAC;gBACrB;oBACE,IAAI,EAAE,qBAAa;oBACnB,SAAS,EAAE,yBAAS,CAAC,GAAG;oBACxB,OAAO,EAAE;wBACP,IAAI,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;wBAC5B,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,aAAa;wBACnD,YAAY,EAAE;4BACZ,OAAO,EAAE,KAAK;yBACf;qBACF;iBACF;gBACD;oBACE,IAAI,EAAE,oBAAY;oBAClB,SAAS,EAAE,yBAAS,CAAC,GAAG;oBACxB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sBAAsB,IAAI,oBAAoB;wBACjE,YAAY,EAAE;4BACZ,OAAO,EAAE,KAAK;yBACf;qBACF;iBACF;aACF,CAAC;SACH;QACD,SAAS,EAAE,CAAC,+CAAqB,CAAC;QAClC,OAAO,EAAE,CAAC,+CAAqB,CAAC;KACjC,CAAC;GACW,oBAAoB,CAAG"}
@@ -0,0 +1,26 @@
1
+ import { ClientProxy } from '@nestjs/microservices';
2
+ import { IRequest } from '../common';
3
+ export declare class ModulesHandlerService {
4
+ private readonly adminClient;
5
+ private readonly hrmsClient;
6
+ private readonly paymentxClient;
7
+ private readonly squareClient;
8
+ private readonly examsClient;
9
+ private readonly notificationClient;
10
+ constructor(adminClient: ClientProxy, hrmsClient: ClientProxy, paymentxClient: ClientProxy, squareClient: ClientProxy, examsClient: ClientProxy, notificationClient: ClientProxy);
11
+ private sendRequest;
12
+ private emitRequest;
13
+ sendToAdmin(data: IRequest): Promise<any>;
14
+ emitToAdmin(data: IRequest): Promise<void>;
15
+ sendToHrms(data: IRequest): Promise<any>;
16
+ emitToHrms(data: IRequest): Promise<void>;
17
+ sendToPaymentx(data: IRequest): Promise<any>;
18
+ emitToPaymentx(data: IRequest): Promise<void>;
19
+ sendToSquare(data: IRequest): Promise<any>;
20
+ emitToSquare(data: IRequest): Promise<void>;
21
+ sendToExams(data: IRequest): Promise<any>;
22
+ emitToExams(data: IRequest): Promise<void>;
23
+ sendToNotification(data: IRequest): Promise<any>;
24
+ emitToNotification(data: IRequest): Promise<void>;
25
+ }
26
+ //# sourceMappingURL=modules-handler.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modules-handler.service.d.ts","sourceRoot":"","sources":["../../src/modules-handler/modules-handler.service.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EAAE,QAAQ,EAA+D,MAAM,WAAW,CAAC;AAUlG,qBACa,qBAAqB;IAEP,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC7B,OAAO,CAAC,QAAQ,CAAC,UAAU;IACvB,OAAO,CAAC,QAAQ,CAAC,cAAc;IACjC,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC9B,OAAO,CAAC,QAAQ,CAAC,WAAW;IACrB,OAAO,CAAC,QAAQ,CAAC,kBAAkB;gBALzB,WAAW,EAAE,WAAW,EACzB,UAAU,EAAE,WAAW,EACnB,cAAc,EAAE,WAAW,EAC7B,YAAY,EAAE,WAAW,EAC1B,WAAW,EAAE,WAAW,EACjB,kBAAkB,EAAE,WAAW;YAGlE,WAAW;IAqBzB,OAAO,CAAC,WAAW;IAQb,WAAW,CAAC,IAAI,EAAE,QAAQ;IAK1B,WAAW,CAAC,IAAI,EAAE,QAAQ;IAK1B,UAAU,CAAC,IAAI,EAAE,QAAQ;IAKzB,UAAU,CAAC,IAAI,EAAE,QAAQ;IAKzB,cAAc,CAAC,IAAI,EAAE,QAAQ;IAK7B,cAAc,CAAC,IAAI,EAAE,QAAQ;IAK7B,YAAY,CAAC,IAAI,EAAE,QAAQ;IAK3B,YAAY,CAAC,IAAI,EAAE,QAAQ;IAK3B,WAAW,CAAC,IAAI,EAAE,QAAQ;IAK1B,WAAW,CAAC,IAAI,EAAE,QAAQ;IAK1B,kBAAkB,CAAC,IAAI,EAAE,QAAQ;IAKjC,kBAAkB,CAAC,IAAI,EAAE,QAAQ;CAIxC"}
@@ -0,0 +1,125 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.ModulesHandlerService = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const microservices_1 = require("@nestjs/microservices");
18
+ const rxjs_1 = require("rxjs");
19
+ const common_2 = require("../common");
20
+ const utils_1 = require("../utils");
21
+ let ModulesHandlerService = class ModulesHandlerService {
22
+ constructor(adminClient, hrmsClient, paymentxClient, squareClient, examsClient, notificationClient) {
23
+ this.adminClient = adminClient;
24
+ this.hrmsClient = hrmsClient;
25
+ this.paymentxClient = paymentxClient;
26
+ this.squareClient = squareClient;
27
+ this.examsClient = examsClient;
28
+ this.notificationClient = notificationClient;
29
+ }
30
+ async sendRequest(data, client) {
31
+ if (!data.tenantDetails)
32
+ data.tenantDetails = (0, common_2.getTenantDetailsIfExists)();
33
+ if (!data.institution)
34
+ data.institution = (0, common_2.getInstitutionOrFail)();
35
+ if (!data.userData)
36
+ data.userData = (0, common_2.getUserData)();
37
+ return (0, rxjs_1.firstValueFrom)(client.send(data.cmd, data).pipe((0, rxjs_1.defaultIfEmpty)({}))).catch((err) => {
38
+ console.log(err);
39
+ if (err.code === 'ECONNREFUSED') {
40
+ throw new common_1.ServiceUnavailableException('Unable to connect to payments service');
41
+ }
42
+ const error = err.error;
43
+ if (error?.response && error?.statusCode) {
44
+ throw new common_1.HttpException(error.response, error.statusCode);
45
+ }
46
+ throw new common_1.InternalServerErrorException({
47
+ message: 'Something went wrong',
48
+ error: err.message,
49
+ });
50
+ });
51
+ }
52
+ emitRequest(data, client) {
53
+ try {
54
+ client.emit(data.cmd, data);
55
+ }
56
+ catch (err) {
57
+ console.log(err);
58
+ }
59
+ }
60
+ async sendToAdmin(data) {
61
+ data.cmd.service = 'admin';
62
+ return this.sendRequest(data, this.adminClient);
63
+ }
64
+ async emitToAdmin(data) {
65
+ data.cmd.service = 'admin';
66
+ return this.emitRequest(data, this.adminClient);
67
+ }
68
+ async sendToHrms(data) {
69
+ data.cmd.service = 'hrms';
70
+ return this.sendRequest(data, this.hrmsClient);
71
+ }
72
+ async emitToHrms(data) {
73
+ data.cmd.service = 'hrms';
74
+ return this.emitRequest(data, this.hrmsClient);
75
+ }
76
+ async sendToPaymentx(data) {
77
+ data.cmd.service = 'paymentx';
78
+ return this.sendRequest(data, this.paymentxClient);
79
+ }
80
+ async emitToPaymentx(data) {
81
+ data.cmd.service = 'paymentx';
82
+ return this.emitRequest(data, this.paymentxClient);
83
+ }
84
+ async sendToSquare(data) {
85
+ data.cmd.service = 'square';
86
+ return this.sendRequest(data, this.squareClient);
87
+ }
88
+ async emitToSquare(data) {
89
+ data.cmd.service = 'square';
90
+ return this.emitRequest(data, this.squareClient);
91
+ }
92
+ async sendToExams(data) {
93
+ data.cmd.service = 'exams';
94
+ return this.sendRequest(data, this.examsClient);
95
+ }
96
+ async emitToExams(data) {
97
+ data.cmd.service = 'exams';
98
+ return this.emitRequest(data, this.examsClient);
99
+ }
100
+ async sendToNotification(data) {
101
+ data.cmd.service = 'notification';
102
+ return this.sendRequest(data, this.notificationClient);
103
+ }
104
+ async emitToNotification(data) {
105
+ data.cmd.service = 'notification';
106
+ return this.emitRequest(data, this.notificationClient);
107
+ }
108
+ };
109
+ exports.ModulesHandlerService = ModulesHandlerService;
110
+ exports.ModulesHandlerService = ModulesHandlerService = __decorate([
111
+ (0, common_1.Injectable)(),
112
+ __param(0, (0, common_1.Inject)(utils_1.ADMIN_SERVICE)),
113
+ __param(1, (0, common_1.Inject)(utils_1.HRMS_SERVICE)),
114
+ __param(2, (0, common_1.Inject)(utils_1.PAYMENTX_SERVICE)),
115
+ __param(3, (0, common_1.Inject)(utils_1.SQUARE_SERVICE)),
116
+ __param(4, (0, common_1.Inject)(utils_1.EXAMS_SERVICE)),
117
+ __param(5, (0, common_1.Inject)(utils_1.NOTIFICATION_SERVICE)),
118
+ __metadata("design:paramtypes", [microservices_1.ClientProxy,
119
+ microservices_1.ClientProxy,
120
+ microservices_1.ClientProxy,
121
+ microservices_1.ClientProxy,
122
+ microservices_1.ClientProxy,
123
+ microservices_1.ClientProxy])
124
+ ], ModulesHandlerService);
125
+ //# sourceMappingURL=modules-handler.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modules-handler.service.js","sourceRoot":"","sources":["../../src/modules-handler/modules-handler.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAMwB;AACxB,yDAAoD;AACpD,+BAAsD;AACtD,sCAAkG;AAClG,oCAOkB;AAGX,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAChC,YAC0C,WAAwB,EACzB,UAAuB,EACnB,cAA2B,EAC7B,YAAyB,EAC1B,WAAwB,EACjB,kBAA+B;QALtC,gBAAW,GAAX,WAAW,CAAa;QACzB,eAAU,GAAV,UAAU,CAAa;QACnB,mBAAc,GAAd,cAAc,CAAa;QAC7B,iBAAY,GAAZ,YAAY,CAAa;QAC1B,gBAAW,GAAX,WAAW,CAAa;QACjB,uBAAkB,GAAlB,kBAAkB,CAAa;IAC7E,CAAC;IAEI,KAAK,CAAC,WAAW,CAAC,IAAc,EAAE,MAAmB;QAC3D,IAAI,CAAC,IAAI,CAAC,aAAa;YAAE,IAAI,CAAC,aAAa,GAAG,IAAA,iCAAwB,GAAE,CAAC;QACzE,IAAI,CAAC,IAAI,CAAC,WAAW;YAAE,IAAI,CAAC,WAAW,GAAG,IAAA,6BAAoB,GAAE,CAAC;QACjE,IAAI,CAAC,IAAI,CAAC,QAAQ;YAAE,IAAI,CAAC,QAAQ,GAAG,IAAA,oBAAW,GAAE,CAAC;QAElD,OAAO,IAAA,qBAAc,EAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,IAAA,qBAAc,EA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;IAClD,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,IAAc;QAC9B,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC;QAC3B,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAClD,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,IAAc;QACrC,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,cAAc,CAAC;QAClC,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,IAAc;QACrC,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,cAAc,CAAC;QAClC,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;IACzD,CAAC;CACF,CAAA;AAlGY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,eAAM,EAAC,qBAAa,CAAC,CAAA;IACrB,WAAA,IAAA,eAAM,EAAC,oBAAY,CAAC,CAAA;IACpB,WAAA,IAAA,eAAM,EAAC,wBAAgB,CAAC,CAAA;IACxB,WAAA,IAAA,eAAM,EAAC,sBAAc,CAAC,CAAA;IACtB,WAAA,IAAA,eAAM,EAAC,qBAAa,CAAC,CAAA;IACrB,WAAA,IAAA,eAAM,EAAC,4BAAoB,CAAC,CAAA;qCALwB,2BAAW;QACb,2BAAW;QACH,2BAAW;QACf,2BAAW;QACb,2BAAW;QACG,2BAAW;GAPrE,qBAAqB,CAkGjC"}
@@ -24,6 +24,12 @@
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
25
  import { ClientSession } from 'mongoose';
26
26
  export declare const TENANT_HEADER = "x-tenant-id";
27
+ export declare const ADMIN_SERVICE = "ADMIN_SERVICE";
28
+ export declare const HRMS_SERVICE = "HRMS_SERVICE";
29
+ export declare const PAYMENTX_SERVICE = "PAYMENTX_SERVICE";
30
+ export declare const SQUARE_SERVICE = "SQUARE_SERVICE";
31
+ export declare const EXAMS_SERVICE = "EXAMS_SERVICE";
32
+ export declare const NOTIFICATION_SERVICE = "NOTIFICATION_SERVICE";
27
33
  export declare const tenants: Readonly<{
28
34
  anurag: "aupulse";
29
35
  cmr: "cmr";
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,eAAO,MAAM,aAAa,gBAAgB,CAAC;AAE3C,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;EAgBlB,CAAC;AAEH,eAAO,MAAM,QAAQ;;;CAGpB,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;CAG5B,CAAC;AAEF,eAAO,MAAM,4BAA4B;;;CAGxC,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;CAQlC,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,eAAO,MAAM,aAAa,gBAAgB,CAAC;AAE3C,eAAO,MAAM,aAAa,kBAAkB,CAAC;AAC7C,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAC3C,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AACnD,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAC/C,eAAO,MAAM,aAAa,kBAAkB,CAAC;AAC7C,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAE3D,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;EAgBlB,CAAC;AAEH,eAAO,MAAM,QAAQ;;;CAGpB,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;CAG5B,CAAC;AAEF,eAAO,MAAM,4BAA4B;;;CAGxC,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;CAQlC,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB,CAAC"}
@@ -1,7 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ProfileApplicationType = exports.PunchLogsDatabaseConfigTypes = exports.InstitutionTypes = exports.userType = exports.tenants = exports.TENANT_HEADER = void 0;
3
+ exports.ProfileApplicationType = exports.PunchLogsDatabaseConfigTypes = exports.InstitutionTypes = exports.userType = exports.tenants = exports.NOTIFICATION_SERVICE = exports.EXAMS_SERVICE = exports.SQUARE_SERVICE = exports.PAYMENTX_SERVICE = exports.HRMS_SERVICE = exports.ADMIN_SERVICE = exports.TENANT_HEADER = void 0;
4
4
  exports.TENANT_HEADER = 'x-tenant-id';
5
+ exports.ADMIN_SERVICE = 'ADMIN_SERVICE';
6
+ exports.HRMS_SERVICE = 'HRMS_SERVICE';
7
+ exports.PAYMENTX_SERVICE = 'PAYMENTX_SERVICE';
8
+ exports.SQUARE_SERVICE = 'SQUARE_SERVICE';
9
+ exports.EXAMS_SERVICE = 'EXAMS_SERVICE';
10
+ exports.NOTIFICATION_SERVICE = 'NOTIFICATION_SERVICE';
5
11
  exports.tenants = Object.freeze({
6
12
  anurag: 'aupulse',
7
13
  cmr: 'cmr',
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,aAAa,GAAG,aAAa,CAAC;AAE9B,QAAA,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC;IACnC,MAAM,E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EAAE,SAAS;IACjB,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,QAAQ;IACd,SAAS,EAAE,WAAW;IACtB,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,OAAO;CACf,CAAC,CAAC;AAEU,QAAA,QAAQ,GAAG;IACtB,UAAU,EAAE,YAAY;IACxB,YAAY,EAAE,SAAS;CACxB,CAAC;AAEW,QAAA,gBAAgB,GAAG;IAC9B,UAAU,EAAE,YAAY;IACxB,YAAY,EAAE,cAAc;CAC7B,CAAC;AAEW,QAAA,4BAA4B,GAAG;IAC1C,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;CACnB,CAAC;AAEW,QAAA,sBAAsB,GAAG;IACpC,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,WAAW;CACvB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@campxdev/server-shared",
3
- "version": "1.4.0-alpha.3",
3
+ "version": "1.4.0-alpha.4",
4
4
  "description": "Campx server shared files",
5
5
  "main": "dist/index.js",
6
6
  "license": "MIT",
@@ -1,3 +0,0 @@
1
- export * from './modules.handler';
2
- export * from './services.module';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/modules/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/modules/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,oDAAkC"}
@@ -1,9 +0,0 @@
1
- import { ClientProxy } from '@nestjs/microservices';
2
- import { IRequest } from '../common';
3
- export declare class ModulesHandler {
4
- private readonly client;
5
- constructor(client: ClientProxy);
6
- private sendRequest;
7
- sendToHrms(data: IRequest): Promise<any>;
8
- }
9
- //# sourceMappingURL=modules.handler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"modules.handler.d.ts","sourceRoot":"","sources":["../../src/modules/modules.handler.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAGrC,qBACa,cAAc;IAC2B,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;YAE1E,WAAW;IA4BnB,UAAU,CAAC,IAAI,EAAE,QAAQ;CAShC"}
@@ -1,61 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.ModulesHandler = void 0;
16
- const common_1 = require("@nestjs/common");
17
- const microservices_1 = require("@nestjs/microservices");
18
- const services_module_1 = require("./services.module");
19
- let ModulesHandler = class ModulesHandler {
20
- constructor(client) {
21
- this.client = client;
22
- }
23
- async sendRequest(data) {
24
- try {
25
- // return await firstValueFrom(client.send(data.cmd, data).pipe(defaultIfEmpty({})));
26
- return {};
27
- }
28
- catch (err) {
29
- console.log(err);
30
- if (err.code === 'ECONNREFUSED') {
31
- throw new common_1.ServiceUnavailableException(`Unable to connect to ${data.cmd.service} service`);
32
- }
33
- const error = err?.error;
34
- if (error?.response && error?.statusCode) {
35
- throw new common_1.HttpException(error.response, error.statusCode);
36
- }
37
- throw new common_1.InternalServerErrorException({
38
- message: 'Something went wrong',
39
- error: err?.message,
40
- });
41
- }
42
- }
43
- // private emitRequest(client: ClientProxy, data: IRequest) {
44
- // try {
45
- // client.emit(data.cmd, data);
46
- // } catch (err: any) {
47
- // console.log(err);
48
- // }
49
- // }
50
- async sendToHrms(data) {
51
- data.cmd.service = 'hrms';
52
- return await this.sendRequest(data);
53
- }
54
- };
55
- exports.ModulesHandler = ModulesHandler;
56
- exports.ModulesHandler = ModulesHandler = __decorate([
57
- (0, common_1.Injectable)(),
58
- __param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => services_module_1.HRMS_SERVICE))),
59
- __metadata("design:paramtypes", [microservices_1.ClientProxy])
60
- ], ModulesHandler);
61
- //# sourceMappingURL=modules.handler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"modules.handler.js","sourceRoot":"","sources":["../../src/modules/modules.handler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAOwB;AACxB,yDAAoD;AAEpD,uDAAiD;AAG1C,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YAAqE,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAEpF,KAAK,CAAC,WAAW,CAAC,IAAc;QACtC,IAAI,CAAC;YACH,qFAAqF;YACrF,OAAO,EAAS,CAAC;QACnB,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACjB,IAAI,GAAG,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;gBAChC,MAAM,IAAI,oCAA2B,CAAC,wBAAwB,IAAI,CAAC,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC;YAC5F,CAAC;YACD,MAAM,KAAK,GAAG,GAAG,EAAE,KAAK,CAAC;YACzB,IAAI,KAAK,EAAE,QAAQ,IAAI,KAAK,EAAE,UAAU,EAAE,CAAC;gBACzC,MAAM,IAAI,sBAAa,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;YAC5D,CAAC;YACD,MAAM,IAAI,qCAA4B,CAAC;gBACrC,OAAO,EAAE,sBAAsB;gBAC/B,KAAK,EAAE,GAAG,EAAE,OAAO;aACpB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,6DAA6D;IAC7D,UAAU;IACV,mCAAmC;IACnC,yBAAyB;IACzB,wBAAwB;IACxB,MAAM;IACN,IAAI;IAEJ,KAAK,CAAC,UAAU,CAAC,IAAc;QAC7B,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC;QAC1B,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;CAMF,CAAA;AAxCY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;IAEE,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,8BAAY,CAAC,CAAC,CAAA;qCAA0B,2BAAW;GAD7E,cAAc,CAwC1B"}
@@ -1,9 +0,0 @@
1
- export declare const ADMIN_SERVICE = "ADMIN_SERVICE";
2
- export declare const HRMS_SERVICE = "HRMS_SERVICE";
3
- export declare const PAYMENTX_SERVICE = "PAYMENTX_SERVICE";
4
- export declare const SQUARE_SERVICE = "SQUARE_SERVICE";
5
- export declare const EXAMS_SERVICE = "EXAMS_SERVICE";
6
- export declare const NOTIFICATION_SERVICE = "NOTIFICATION_SERVICE";
7
- export declare class ServicesModule {
8
- }
9
- //# sourceMappingURL=services.module.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"services.module.d.ts","sourceRoot":"","sources":["../../src/modules/services.module.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,aAAa,kBAAkB,CAAC;AAC7C,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAC3C,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AACnD,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAC/C,eAAO,MAAM,aAAa,kBAAkB,CAAC;AAC7C,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAE3D,qBAqBa,cAAc;CAAG"}
@@ -1,46 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.ServicesModule = exports.NOTIFICATION_SERVICE = exports.EXAMS_SERVICE = exports.SQUARE_SERVICE = exports.PAYMENTX_SERVICE = exports.HRMS_SERVICE = exports.ADMIN_SERVICE = void 0;
10
- const common_1 = require("@nestjs/common");
11
- const config_1 = require("@nestjs/config");
12
- const microservices_1 = require("@nestjs/microservices");
13
- const modules_handler_1 = require("./modules.handler");
14
- exports.ADMIN_SERVICE = 'ADMIN_SERVICE';
15
- exports.HRMS_SERVICE = 'HRMS_SERVICE';
16
- exports.PAYMENTX_SERVICE = 'PAYMENTX_SERVICE';
17
- exports.SQUARE_SERVICE = 'SQUARE_SERVICE';
18
- exports.EXAMS_SERVICE = 'EXAMS_SERVICE';
19
- exports.NOTIFICATION_SERVICE = 'NOTIFICATION_SERVICE';
20
- let ServicesModule = class ServicesModule {
21
- };
22
- exports.ServicesModule = ServicesModule;
23
- exports.ServicesModule = ServicesModule = __decorate([
24
- (0, common_1.Module)({
25
- providers: [
26
- {
27
- provide: exports.HRMS_SERVICE,
28
- useFactory: (configService) => {
29
- return microservices_1.ClientProxyFactory.create({
30
- transport: microservices_1.Transport.RMQ,
31
- options: {
32
- urls: [configService.get('RMQ_HOST')],
33
- queue: configService.get('HRMS_RMQ_QUEUE') || 'hrms_queue',
34
- queueOptions: {
35
- durable: false,
36
- },
37
- },
38
- });
39
- },
40
- inject: [config_1.ConfigService],
41
- },
42
- modules_handler_1.ModulesHandler,
43
- ],
44
- })
45
- ], ServicesModule);
46
- //# sourceMappingURL=services.module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"services.module.js","sourceRoot":"","sources":["../../src/modules/services.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,2CAA+C;AAC/C,yDAAsE;AACtE,uDAAmD;AAEtC,QAAA,aAAa,GAAG,eAAe,CAAC;AAChC,QAAA,YAAY,GAAG,cAAc,CAAC;AAC9B,QAAA,gBAAgB,GAAG,kBAAkB,CAAC;AACtC,QAAA,cAAc,GAAG,gBAAgB,CAAC;AAClC,QAAA,aAAa,GAAG,eAAe,CAAC;AAChC,QAAA,oBAAoB,GAAG,sBAAsB,CAAC;AAuBpD,IAAM,cAAc,GAApB,MAAM,cAAc;CAAG,CAAA;AAAjB,wCAAc;yBAAd,cAAc;IArB1B,IAAA,eAAM,EAAC;QACN,SAAS,EAAE;YACT;gBACE,OAAO,EAAE,oBAAY;gBACrB,UAAU,EAAE,CAAC,aAA4B,EAAE,EAAE;oBAC3C,OAAO,kCAAkB,CAAC,MAAM,CAAC;wBAC/B,SAAS,EAAE,yBAAS,CAAC,GAAG;wBACxB,OAAO,EAAE;4BACP,IAAI,EAAE,CAAC,aAAa,CAAC,GAAG,CAAS,UAAU,CAAC,CAAC;4BAC7C,KAAK,EAAE,aAAa,CAAC,GAAG,CAAS,gBAAgB,CAAC,IAAI,YAAY;4BAClE,YAAY,EAAE;gCACZ,OAAO,EAAE,KAAK;6BACf;yBACF;qBACF,CAAC,CAAC;gBACL,CAAC;gBACD,MAAM,EAAE,CAAC,sBAAa,CAAC;aACxB;YACD,gCAAc;SACf;KACF,CAAC;GACW,cAAc,CAAG"}