@campxdev/server-shared 1.4.0-alpha.3 → 1.4.0-alpha.5
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/domain/index.d.ts +1 -0
- package/dist/domain/index.d.ts.map +1 -1
- package/dist/domain/index.js +1 -0
- package/dist/domain/index.js.map +1 -1
- package/dist/domain/modules/shared-domain.module.d.ts.map +1 -1
- package/dist/domain/modules/shared-domain.module.js +3 -0
- package/dist/domain/modules/shared-domain.module.js.map +1 -1
- package/dist/domain/schemas/global-users.schema.d.ts +56 -0
- package/dist/domain/schemas/global-users.schema.d.ts.map +1 -0
- package/dist/domain/schemas/global-users.schema.js +112 -0
- package/dist/domain/schemas/global-users.schema.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/media/managers/media-records-manager.js +2 -2
- package/dist/media/managers/media-records-manager.js.map +1 -1
- package/dist/modules-handler/index.d.ts +3 -0
- package/dist/modules-handler/index.d.ts.map +1 -0
- package/dist/{modules → modules-handler}/index.js +2 -2
- package/dist/modules-handler/index.js.map +1 -0
- package/dist/modules-handler/modules-handler.module.d.ts +3 -0
- package/dist/modules-handler/modules-handler.module.d.ts.map +1 -0
- package/dist/modules-handler/modules-handler.module.js +93 -0
- package/dist/modules-handler/modules-handler.module.js.map +1 -0
- package/dist/modules-handler/modules-handler.service.d.ts +26 -0
- package/dist/modules-handler/modules-handler.service.d.ts.map +1 -0
- package/dist/modules-handler/modules-handler.service.js +125 -0
- package/dist/modules-handler/modules-handler.service.js.map +1 -0
- package/dist/utils/constants.d.ts +6 -0
- package/dist/utils/constants.d.ts.map +1 -1
- package/dist/utils/constants.js +7 -1
- package/dist/utils/constants.js.map +1 -1
- package/package.json +1 -1
- package/dist/modules/index.d.ts +0 -3
- package/dist/modules/index.d.ts.map +0 -1
- package/dist/modules/index.js.map +0 -1
- package/dist/modules/modules.handler.d.ts +0 -9
- package/dist/modules/modules.handler.d.ts.map +0 -1
- package/dist/modules/modules.handler.js +0 -61
- package/dist/modules/modules.handler.js.map +0 -1
- package/dist/modules/services.module.d.ts +0 -9
- package/dist/modules/services.module.d.ts.map +0 -1
- package/dist/modules/services.module.js +0 -46
- package/dist/modules/services.module.js.map +0 -1
package/dist/domain/index.d.ts
CHANGED
|
@@ -8,5 +8,6 @@ export * from './types/admin.type';
|
|
|
8
8
|
export * from './entities/profile-permission.entity';
|
|
9
9
|
export * from './entities/profile.entity';
|
|
10
10
|
export * from './entities/user.entity';
|
|
11
|
+
export * from './schemas/global-users.schema';
|
|
11
12
|
export * from './schemas/tenant.schema';
|
|
12
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/domain/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wDAAwD,CAAC;AACvE,cAAc,wCAAwC,CAAC;AACvD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oBAAoB,CAAC;AAGnC,cAAc,sCAAsC,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/domain/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wDAAwD,CAAC;AACvE,cAAc,wCAAwC,CAAC;AACvD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oBAAoB,CAAC;AAGnC,cAAc,sCAAsC,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC"}
|
package/dist/domain/index.js
CHANGED
|
@@ -25,5 +25,6 @@ __exportStar(require("./types/admin.type"), exports);
|
|
|
25
25
|
__exportStar(require("./entities/profile-permission.entity"), exports);
|
|
26
26
|
__exportStar(require("./entities/profile.entity"), exports);
|
|
27
27
|
__exportStar(require("./entities/user.entity"), exports);
|
|
28
|
+
__exportStar(require("./schemas/global-users.schema"), exports);
|
|
28
29
|
__exportStar(require("./schemas/tenant.schema"), exports);
|
|
29
30
|
//# sourceMappingURL=index.js.map
|
package/dist/domain/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/domain/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iEAA+C;AAC/C,iEAA+C;AAC/C,iEAA+C;AAC/C,yFAAuE;AACvE,yEAAuD;AACvD,gEAA8C;AAC9C,qDAAmC;AAEnC,gBAAgB;AAChB,uEAAqD;AACrD,4DAA0C;AAC1C,yDAAuC;AACvC,0DAAwC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/domain/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iEAA+C;AAC/C,iEAA+C;AAC/C,iEAA+C;AAC/C,yFAAuE;AACvE,yEAAuD;AACvD,gEAA8C;AAC9C,qDAAmC;AAEnC,gBAAgB;AAChB,uEAAqD;AACrD,4DAA0C;AAC1C,yDAAuC;AACvC,gEAA8C;AAC9C,0DAAwC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-domain.module.d.ts","sourceRoot":"","sources":["../../../src/domain/modules/shared-domain.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shared-domain.module.d.ts","sourceRoot":"","sources":["../../../src/domain/modules/shared-domain.module.ts"],"names":[],"mappings":"AAeA,qBAaa,kBAAkB;CAAG"}
|
|
@@ -11,6 +11,7 @@ const common_1 = require("@nestjs/common");
|
|
|
11
11
|
const mongoose_1 = require("@nestjs/mongoose");
|
|
12
12
|
const mongodb_media_record_repository_1 = require("../mongodb-repositories/mongodb-media-record.repository");
|
|
13
13
|
const media_record_repository_1 = require("../repositories/media-record.repository");
|
|
14
|
+
const global_users_schema_1 = require("../schemas/global-users.schema");
|
|
14
15
|
const media_record_schema_1 = require("../schemas/media-record.schema");
|
|
15
16
|
const tenant_schema_1 = require("../schemas/tenant.schema");
|
|
16
17
|
const repos = [
|
|
@@ -28,6 +29,8 @@ exports.SharedDomainModule = SharedDomainModule = __decorate([
|
|
|
28
29
|
mongoose_1.MongooseModule.forFeature([
|
|
29
30
|
{ name: tenant_schema_1.Tenant.name, schema: tenant_schema_1.TenantSchema },
|
|
30
31
|
{ name: media_record_schema_1.MediaRecord.name, schema: media_record_schema_1.MediaRecordSchema },
|
|
32
|
+
// Deprecated
|
|
33
|
+
{ name: global_users_schema_1.GlobalUser.name, schema: global_users_schema_1.GlobalUserSchema },
|
|
31
34
|
]),
|
|
32
35
|
],
|
|
33
36
|
providers: [...repos],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-domain.module.js","sourceRoot":"","sources":["../../../src/domain/modules/shared-domain.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAkD;AAClD,+CAAkD;AAClD,6GAAuG;AACvG,qFAAgF;AAChF,wEAAgF;AAChF,4DAAgE;AAEhE,MAAM,KAAK,GAAe;IACxB;QACE,OAAO,EAAE,+CAAqB;QAC9B,QAAQ,EAAE,8DAA4B;KACvC;CACF,CAAC;
|
|
1
|
+
{"version":3,"file":"shared-domain.module.js","sourceRoot":"","sources":["../../../src/domain/modules/shared-domain.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAkD;AAClD,+CAAkD;AAClD,6GAAuG;AACvG,qFAAgF;AAChF,wEAA8E;AAC9E,wEAAgF;AAChF,4DAAgE;AAEhE,MAAM,KAAK,GAAe;IACxB;QACE,OAAO,EAAE,+CAAqB;QAC9B,QAAQ,EAAE,8DAA4B;KACvC;CACF,CAAC;AAeK,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAAG,CAAA;AAArB,gDAAkB;6BAAlB,kBAAkB;IAb9B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,yBAAc,CAAC,UAAU,CAAC;gBACxB,EAAE,IAAI,EAAE,sBAAM,CAAC,IAAI,EAAE,MAAM,EAAE,4BAAY,EAAE;gBAC3C,EAAE,IAAI,EAAE,iCAAW,CAAC,IAAI,EAAE,MAAM,EAAE,uCAAiB,EAAE;gBAErD,aAAa;gBACb,EAAE,IAAI,EAAE,gCAAU,CAAC,IAAI,EAAE,MAAM,EAAE,sCAAgB,EAAE;aACpD,CAAC;SACH;QACD,SAAS,EAAE,CAAC,GAAG,KAAK,CAAC;QACrB,OAAO,EAAE,CAAC,yBAAc,EAAE,GAAG,KAAK,CAAC;KACpC,CAAC;GACW,kBAAkB,CAAG"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
import { Document, Schema as MongooseSchema } from 'mongoose';
|
|
26
|
+
export declare const GlobalUserCName = "global_users";
|
|
27
|
+
export declare class GlobalUser extends Document {
|
|
28
|
+
tenantId: string;
|
|
29
|
+
institutionIds: number[];
|
|
30
|
+
userId: number;
|
|
31
|
+
username: string;
|
|
32
|
+
email: string;
|
|
33
|
+
isCounsellor: boolean;
|
|
34
|
+
password: string;
|
|
35
|
+
fullName: string;
|
|
36
|
+
isActive: boolean;
|
|
37
|
+
isSuperUser: boolean;
|
|
38
|
+
isAdminUser: boolean;
|
|
39
|
+
type: string;
|
|
40
|
+
workPhoneNumber: string;
|
|
41
|
+
personalPhoneNumber: string;
|
|
42
|
+
personalEmail: string;
|
|
43
|
+
lastLoggedIn: Date;
|
|
44
|
+
designationId: string;
|
|
45
|
+
departmentIds: string[];
|
|
46
|
+
tours: string[];
|
|
47
|
+
isMentor: boolean;
|
|
48
|
+
createdBy: string;
|
|
49
|
+
updatedBy: string;
|
|
50
|
+
}
|
|
51
|
+
export declare const GlobalUserSchema: MongooseSchema<GlobalUser, import("mongoose").Model<GlobalUser, any, any, any, Document<unknown, any, GlobalUser> & GlobalUser & {
|
|
52
|
+
_id: import("mongoose").Types.ObjectId;
|
|
53
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, GlobalUser, Document<unknown, {}, import("mongoose").FlatRecord<GlobalUser>> & import("mongoose").FlatRecord<GlobalUser> & {
|
|
54
|
+
_id: import("mongoose").Types.ObjectId;
|
|
55
|
+
}>;
|
|
56
|
+
//# sourceMappingURL=global-users.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-users.schema.d.ts","sourceRoot":"","sources":["../../../src/domain/schemas/global-users.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,UAAU,CAAC;AAG9D,eAAO,MAAM,eAAe,iBAAiB,CAAC;AAE9C,qBACa,UAAW,SAAQ,QAAQ;IAEtC,QAAQ,EAAE,MAAM,CAAC;IAGjB,cAAc,EAAE,MAAM,EAAE,CAAC;IAGzB,MAAM,EAAE,MAAM,CAAC;IAGf,QAAQ,EAAE,MAAM,CAAC;IAGjB,KAAK,EAAE,MAAM,CAAC;IAGd,YAAY,EAAE,OAAO,CAAC;IAGtB,QAAQ,EAAE,MAAM,CAAC;IAGjB,QAAQ,EAAE,MAAM,CAAC;IAGjB,QAAQ,EAAE,OAAO,CAAC;IAGlB,WAAW,EAAE,OAAO,CAAC;IAGrB,WAAW,EAAE,OAAO,CAAC;IAGrB,IAAI,EAAE,MAAM,CAAC;IAGb,eAAe,EAAE,MAAM,CAAC;IAGxB,mBAAmB,EAAE,MAAM,CAAC;IAG5B,aAAa,EAAE,MAAM,CAAC;IAGtB,YAAY,EAAE,IAAI,CAAC;IAGnB,aAAa,EAAE,MAAM,CAAC;IAGtB,aAAa,EAAE,MAAM,EAAE,CAAC;IAGxB,KAAK,EAAE,MAAM,EAAE,CAAC;IAGhB,QAAQ,EAAE,OAAO,CAAC;IAGlB,SAAS,EAAE,MAAM,CAAC;IAGlB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,gBAAgB;;;;EAA2C,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.GlobalUserSchema = exports.GlobalUser = exports.GlobalUserCName = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const mongoose_2 = require("mongoose");
|
|
15
|
+
const utils_1 = require("../../utils");
|
|
16
|
+
exports.GlobalUserCName = 'global_users';
|
|
17
|
+
let GlobalUser = class GlobalUser extends mongoose_2.Document {
|
|
18
|
+
};
|
|
19
|
+
exports.GlobalUser = GlobalUser;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, index: true }),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], GlobalUser.prototype, "tenantId", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, mongoose_1.Prop)({ default: [] }),
|
|
26
|
+
__metadata("design:type", Array)
|
|
27
|
+
], GlobalUser.prototype, "institutionIds", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, mongoose_1.Prop)(),
|
|
30
|
+
__metadata("design:type", Number)
|
|
31
|
+
], GlobalUser.prototype, "userId", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, mongoose_1.Prop)({ required: true, unique: true }),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], GlobalUser.prototype, "username", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, mongoose_1.Prop)({ required: true, unique: true, lowercase: true }),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], GlobalUser.prototype, "email", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, mongoose_1.Prop)({ default: false }),
|
|
42
|
+
__metadata("design:type", Boolean)
|
|
43
|
+
], GlobalUser.prototype, "isCounsellor", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, mongoose_1.Prop)(),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], GlobalUser.prototype, "password", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], GlobalUser.prototype, "fullName", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, mongoose_1.Prop)({ default: true }),
|
|
54
|
+
__metadata("design:type", Boolean)
|
|
55
|
+
], GlobalUser.prototype, "isActive", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, mongoose_1.Prop)({ default: false }),
|
|
58
|
+
__metadata("design:type", Boolean)
|
|
59
|
+
], GlobalUser.prototype, "isSuperUser", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, mongoose_1.Prop)({ default: false }),
|
|
62
|
+
__metadata("design:type", Boolean)
|
|
63
|
+
], GlobalUser.prototype, "isAdminUser", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, mongoose_1.Prop)({ default: utils_1.userType.staff_user }),
|
|
66
|
+
__metadata("design:type", String)
|
|
67
|
+
], GlobalUser.prototype, "type", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, mongoose_1.Prop)(),
|
|
70
|
+
__metadata("design:type", String)
|
|
71
|
+
], GlobalUser.prototype, "workPhoneNumber", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, mongoose_1.Prop)(),
|
|
74
|
+
__metadata("design:type", String)
|
|
75
|
+
], GlobalUser.prototype, "personalPhoneNumber", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, mongoose_1.Prop)({ lowercase: true }),
|
|
78
|
+
__metadata("design:type", String)
|
|
79
|
+
], GlobalUser.prototype, "personalEmail", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, mongoose_1.Prop)({ required: false }),
|
|
82
|
+
__metadata("design:type", Date)
|
|
83
|
+
], GlobalUser.prototype, "lastLoggedIn", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId }),
|
|
86
|
+
__metadata("design:type", String)
|
|
87
|
+
], GlobalUser.prototype, "designationId", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, mongoose_1.Prop)({ type: [mongoose_2.Schema.Types.ObjectId], default: [] }),
|
|
90
|
+
__metadata("design:type", Array)
|
|
91
|
+
], GlobalUser.prototype, "departmentIds", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, mongoose_1.Prop)({ default: [] }),
|
|
94
|
+
__metadata("design:type", Array)
|
|
95
|
+
], GlobalUser.prototype, "tours", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
(0, mongoose_1.Prop)(),
|
|
98
|
+
__metadata("design:type", Boolean)
|
|
99
|
+
], GlobalUser.prototype, "isMentor", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId }),
|
|
102
|
+
__metadata("design:type", String)
|
|
103
|
+
], GlobalUser.prototype, "createdBy", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId }),
|
|
106
|
+
__metadata("design:type", String)
|
|
107
|
+
], GlobalUser.prototype, "updatedBy", void 0);
|
|
108
|
+
exports.GlobalUser = GlobalUser = __decorate([
|
|
109
|
+
(0, mongoose_1.Schema)({ timestamps: true, id: true, collection: exports.GlobalUserCName })
|
|
110
|
+
], GlobalUser);
|
|
111
|
+
exports.GlobalUserSchema = mongoose_1.SchemaFactory.createForClass(GlobalUser);
|
|
112
|
+
//# sourceMappingURL=global-users.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-users.schema.js","sourceRoot":"","sources":["../../../src/domain/schemas/global-users.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA+D;AAC/D,uCAA8D;AAC9D,uCAAuC;AAE1B,QAAA,eAAe,GAAG,cAAc,CAAC;AAGvC,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,mBAAQ;CAkEvC,CAAA;AAlEY,gCAAU;AAErB;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,iBAAc,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;;4CAC1C;AAGjB;IADC,IAAA,eAAI,EAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;kDACG;AAGzB;IADC,IAAA,eAAI,GAAE;;0CACQ;AAGf;IADC,IAAA,eAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;4CACtB;AAGjB;IADC,IAAA,eAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;yCAC1C;AAGd;IADC,IAAA,eAAI,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;gDACH;AAGtB;IADC,IAAA,eAAI,GAAE;;4CACU;AAGjB;IADC,IAAA,eAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACR;AAGjB;IADC,IAAA,eAAI,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;4CACN;AAGlB;IADC,IAAA,eAAI,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;+CACJ;AAGrB;IAD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|
|
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,
|
|
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,
|
|
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"}
|
|
@@ -21,12 +21,12 @@ let MediaRecordsManager = class MediaRecordsManager {
|
|
|
21
21
|
async deleteMany(resources) {
|
|
22
22
|
if (!resources.length)
|
|
23
23
|
return;
|
|
24
|
-
await this.mediaRecordRepo.deleteByIds(resources.map((r) => r.id));
|
|
25
24
|
await this.awsManager.deleteFiles(resources.map((r) => r.key));
|
|
25
|
+
await this.mediaRecordRepo.deleteByIds(resources.map((r) => r.id));
|
|
26
26
|
}
|
|
27
27
|
async deleteOne(resource) {
|
|
28
|
-
await this.mediaRecordRepo.deleteByIds([resource.id]);
|
|
29
28
|
await this.awsManager.deleteFiles([resource.key]);
|
|
29
|
+
await this.mediaRecordRepo.deleteByIds([resource.id]);
|
|
30
30
|
}
|
|
31
31
|
async uploadToS3bucket(props) {
|
|
32
32
|
const uploadRes = await this.awsManager.uploadFile({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-records-manager.js","sourceRoot":"","sources":["../../../src/media/managers/media-records-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,yCAKsB;AACtB,+CAA2C;AAWpC,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YACmB,UAAsB,EACtB,eAAsC;QADtC,eAAU,GAAV,UAAU,CAAY;QACtB,oBAAe,GAAf,eAAe,CAAuB;IACtD,CAAC;IAEJ,KAAK,CAAC,UAAU,CAAC,SAAwB;QACvC,IAAI,CAAC,SAAS,CAAC,MAAM;YAAE,OAAO;QAE9B,MAAM,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"media-records-manager.js","sourceRoot":"","sources":["../../../src/media/managers/media-records-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,yCAKsB;AACtB,+CAA2C;AAWpC,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YACmB,UAAsB,EACtB,eAAsC;QADtC,eAAU,GAAV,UAAU,CAAY;QACtB,oBAAe,GAAf,eAAe,CAAuB;IACtD,CAAC;IAEJ,KAAK,CAAC,UAAU,CAAC,SAAwB;QACvC,IAAI,CAAC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AH9C,mBAAmB,CA8D/B"}
|
|
@@ -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.
|
|
18
|
-
__exportStar(require("./
|
|
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 @@
|
|
|
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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Ac;wBACrD,YAAY,EAAE;4BACZ,OAAO,EAAE,KAAK;yBACf;qBACF;iBACF;gBACD;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,4BAAoB;oBAC1B,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,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,CAA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AAA,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"}
|
package/dist/utils/constants.js
CHANGED
|
@@ -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,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,QAA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AEW,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
package/dist/modules/index.d.ts
DELETED
|
@@ -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"}
|