@experts_hub/shared 1.0.30 → 1.0.32

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.
@@ -1,2 +1,4 @@
1
1
  export * from './tcp/user.tcp.adapter';
2
+ export * from './tcp/job.tcp.adapter';
2
3
  export * from './rmq/user.rmq.adapter';
4
+ export * from './rmq/job.rmq.adapter';
@@ -0,0 +1,2 @@
1
+ import { MicroserviceOptions } from "@nestjs/microservices";
2
+ export declare const JobRMQAdapter: (mode?: string) => MicroserviceOptions;
@@ -0,0 +1,2 @@
1
+ import { MicroserviceOptions } from '@nestjs/microservices';
2
+ export declare const JobTCPAdapter: () => MicroserviceOptions;
package/dist/index.d.mts CHANGED
@@ -23,10 +23,112 @@ declare class LogoutDto {
23
23
  refreshToken: string;
24
24
  }
25
25
 
26
+ declare const SUBADMIN_PATTERN: {
27
+ fetchSubAdmins: string;
28
+ fetchDeletedSubAdmins: string;
29
+ fetchSubAdminDropdown: string;
30
+ findSubAdminById: string;
31
+ createSubAdmin: string;
32
+ toggleSubAdminStatus: string;
33
+ updateSubAdmin: string;
34
+ deleteSubAdmin: string;
35
+ };
36
+
37
+ declare class SubAdminDto {
38
+ firstName: string;
39
+ lastName: string;
40
+ email: string;
41
+ mobile: string;
42
+ isActive: boolean;
43
+ }
44
+
45
+ declare class ToggleSubAdminVisibilityDto {
46
+ isActive: boolean;
47
+ }
48
+
49
+ declare class UpdateSubAdminDto {
50
+ firstName: string;
51
+ lastName: string;
52
+ email: string;
53
+ mobile: string;
54
+ isActive: boolean;
55
+ }
56
+
57
+ interface IFetchSubAdminQuery {
58
+ page_size?: number;
59
+ page: number;
60
+ searchText?: string;
61
+ subadmin: string;
62
+ right: string;
63
+ sortColumn?: string;
64
+ sortBy?: string;
65
+ }
66
+ interface IFetchSubAdminResponse {
67
+ statusCode: number;
68
+ status: boolean;
69
+ message: string;
70
+ data: any;
71
+ }
72
+ interface IFetchSubAdminByIdQuery {
73
+ permission?: string;
74
+ }
75
+ interface IFetchSubAdminByIdResponse {
76
+ statusCode: number;
77
+ status: boolean;
78
+ message: string;
79
+ data: any;
80
+ }
81
+ interface ICreateSubAdminPayload {
82
+ firstName: string;
83
+ lastName: string;
84
+ email: string;
85
+ mobile: string;
86
+ isActive: boolean;
87
+ }
88
+ interface ICreateSubAdminResponse {
89
+ statusCode: number;
90
+ status: boolean;
91
+ message: string;
92
+ }
93
+ interface IUpdateSubAdminPayload {
94
+ firstName: string;
95
+ lastName: string;
96
+ email: string;
97
+ mobile: string;
98
+ isActive: boolean;
99
+ }
100
+ interface IUpdateSubAdminResponse {
101
+ statusCode: number;
102
+ status: boolean;
103
+ message: string;
104
+ }
105
+ interface IToggleSubAdminVisibilityPayload {
106
+ isActive: boolean;
107
+ }
108
+ interface IToggleSubAdminVisibilityResponse {
109
+ statusCode: number;
110
+ status: boolean;
111
+ message: string;
112
+ }
113
+ interface IDeleteSubAdminResponse {
114
+ statusCode: number;
115
+ status: boolean;
116
+ message: string;
117
+ }
118
+ interface IAttachPermissionsToSubAdminResponse {
119
+ statusCode: number;
120
+ status: boolean;
121
+ message: string;
122
+ }
123
+
26
124
  declare const UserTCPAdapter: () => MicroserviceOptions;
27
125
 
126
+ declare const JobTCPAdapter: () => MicroserviceOptions;
127
+
28
128
  declare const UserRMQAdapter: (mode?: string) => MicroserviceOptions;
29
129
 
130
+ declare const JobRMQAdapter: (mode?: string) => MicroserviceOptions;
131
+
30
132
  declare abstract class BaseEntity {
31
133
  id: number;
32
134
  uuid: string;
@@ -83,4 +185,4 @@ declare class User extends BaseEntity {
83
185
  refreshTokens: RefreshToken[];
84
186
  }
85
187
 
86
- export { AUTHENTICATION_PATTERN, AccountStatus, AccountType, BaseEntity, LoginDto, LogoutDto, RefreshDto, RefreshToken, User, UserRMQAdapter, UserTCPAdapter };
188
+ export { AUTHENTICATION_PATTERN, AccountStatus, AccountType, BaseEntity, type IAttachPermissionsToSubAdminResponse, type ICreateSubAdminPayload, type ICreateSubAdminResponse, type IDeleteSubAdminResponse, type IFetchSubAdminByIdQuery, type IFetchSubAdminByIdResponse, type IFetchSubAdminQuery, type IFetchSubAdminResponse, type IToggleSubAdminVisibilityPayload, type IToggleSubAdminVisibilityResponse, type IUpdateSubAdminPayload, type IUpdateSubAdminResponse, JobRMQAdapter, JobTCPAdapter, LoginDto, LogoutDto, RefreshDto, RefreshToken, SUBADMIN_PATTERN, SubAdminDto, ToggleSubAdminVisibilityDto, UpdateSubAdminDto, User, UserRMQAdapter, UserTCPAdapter };
package/dist/index.d.ts CHANGED
@@ -23,10 +23,112 @@ declare class LogoutDto {
23
23
  refreshToken: string;
24
24
  }
25
25
 
26
+ declare const SUBADMIN_PATTERN: {
27
+ fetchSubAdmins: string;
28
+ fetchDeletedSubAdmins: string;
29
+ fetchSubAdminDropdown: string;
30
+ findSubAdminById: string;
31
+ createSubAdmin: string;
32
+ toggleSubAdminStatus: string;
33
+ updateSubAdmin: string;
34
+ deleteSubAdmin: string;
35
+ };
36
+
37
+ declare class SubAdminDto {
38
+ firstName: string;
39
+ lastName: string;
40
+ email: string;
41
+ mobile: string;
42
+ isActive: boolean;
43
+ }
44
+
45
+ declare class ToggleSubAdminVisibilityDto {
46
+ isActive: boolean;
47
+ }
48
+
49
+ declare class UpdateSubAdminDto {
50
+ firstName: string;
51
+ lastName: string;
52
+ email: string;
53
+ mobile: string;
54
+ isActive: boolean;
55
+ }
56
+
57
+ interface IFetchSubAdminQuery {
58
+ page_size?: number;
59
+ page: number;
60
+ searchText?: string;
61
+ subadmin: string;
62
+ right: string;
63
+ sortColumn?: string;
64
+ sortBy?: string;
65
+ }
66
+ interface IFetchSubAdminResponse {
67
+ statusCode: number;
68
+ status: boolean;
69
+ message: string;
70
+ data: any;
71
+ }
72
+ interface IFetchSubAdminByIdQuery {
73
+ permission?: string;
74
+ }
75
+ interface IFetchSubAdminByIdResponse {
76
+ statusCode: number;
77
+ status: boolean;
78
+ message: string;
79
+ data: any;
80
+ }
81
+ interface ICreateSubAdminPayload {
82
+ firstName: string;
83
+ lastName: string;
84
+ email: string;
85
+ mobile: string;
86
+ isActive: boolean;
87
+ }
88
+ interface ICreateSubAdminResponse {
89
+ statusCode: number;
90
+ status: boolean;
91
+ message: string;
92
+ }
93
+ interface IUpdateSubAdminPayload {
94
+ firstName: string;
95
+ lastName: string;
96
+ email: string;
97
+ mobile: string;
98
+ isActive: boolean;
99
+ }
100
+ interface IUpdateSubAdminResponse {
101
+ statusCode: number;
102
+ status: boolean;
103
+ message: string;
104
+ }
105
+ interface IToggleSubAdminVisibilityPayload {
106
+ isActive: boolean;
107
+ }
108
+ interface IToggleSubAdminVisibilityResponse {
109
+ statusCode: number;
110
+ status: boolean;
111
+ message: string;
112
+ }
113
+ interface IDeleteSubAdminResponse {
114
+ statusCode: number;
115
+ status: boolean;
116
+ message: string;
117
+ }
118
+ interface IAttachPermissionsToSubAdminResponse {
119
+ statusCode: number;
120
+ status: boolean;
121
+ message: string;
122
+ }
123
+
26
124
  declare const UserTCPAdapter: () => MicroserviceOptions;
27
125
 
126
+ declare const JobTCPAdapter: () => MicroserviceOptions;
127
+
28
128
  declare const UserRMQAdapter: (mode?: string) => MicroserviceOptions;
29
129
 
130
+ declare const JobRMQAdapter: (mode?: string) => MicroserviceOptions;
131
+
30
132
  declare abstract class BaseEntity {
31
133
  id: number;
32
134
  uuid: string;
@@ -83,4 +185,4 @@ declare class User extends BaseEntity {
83
185
  refreshTokens: RefreshToken[];
84
186
  }
85
187
 
86
- export { AUTHENTICATION_PATTERN, AccountStatus, AccountType, BaseEntity, LoginDto, LogoutDto, RefreshDto, RefreshToken, User, UserRMQAdapter, UserTCPAdapter };
188
+ export { AUTHENTICATION_PATTERN, AccountStatus, AccountType, BaseEntity, type IAttachPermissionsToSubAdminResponse, type ICreateSubAdminPayload, type ICreateSubAdminResponse, type IDeleteSubAdminResponse, type IFetchSubAdminByIdQuery, type IFetchSubAdminByIdResponse, type IFetchSubAdminQuery, type IFetchSubAdminResponse, type IToggleSubAdminVisibilityPayload, type IToggleSubAdminVisibilityResponse, type IUpdateSubAdminPayload, type IUpdateSubAdminResponse, JobRMQAdapter, JobTCPAdapter, LoginDto, LogoutDto, RefreshDto, RefreshToken, SUBADMIN_PATTERN, SubAdminDto, ToggleSubAdminVisibilityDto, UpdateSubAdminDto, User, UserRMQAdapter, UserTCPAdapter };
package/dist/index.js CHANGED
@@ -31,10 +31,16 @@ __export(index_exports, {
31
31
  AccountStatus: () => AccountStatus,
32
32
  AccountType: () => AccountType,
33
33
  BaseEntity: () => BaseEntity,
34
+ JobRMQAdapter: () => JobRMQAdapter,
35
+ JobTCPAdapter: () => JobTCPAdapter,
34
36
  LoginDto: () => LoginDto,
35
37
  LogoutDto: () => LogoutDto,
36
38
  RefreshDto: () => RefreshDto,
37
39
  RefreshToken: () => RefreshToken,
40
+ SUBADMIN_PATTERN: () => SUBADMIN_PATTERN,
41
+ SubAdminDto: () => SubAdminDto,
42
+ ToggleSubAdminVisibilityDto: () => ToggleSubAdminVisibilityDto,
43
+ UpdateSubAdminDto: () => UpdateSubAdminDto,
38
44
  User: () => User,
39
45
  UserRMQAdapter: () => UserRMQAdapter,
40
46
  UserTCPAdapter: () => UserTCPAdapter
@@ -79,6 +85,68 @@ __decorateClass([
79
85
  (0, import_class_validator3.IsNotEmpty)({ message: "Please provide refresh token." })
80
86
  ], LogoutDto.prototype, "refreshToken", 2);
81
87
 
88
+ // src/modules/user/subadmin/pattern/pattern.ts
89
+ var SUBADMIN_PATTERN = {
90
+ fetchSubAdmins: "fetch.subadmins",
91
+ fetchDeletedSubAdmins: "fetch.deleted.subadmins",
92
+ fetchSubAdminDropdown: "fetch.subadmin.dropdown",
93
+ findSubAdminById: "fetch.subadmin.by.id",
94
+ createSubAdmin: "create.subadmin",
95
+ toggleSubAdminStatus: "toggle.subadmin.status",
96
+ updateSubAdmin: "update.subadmin",
97
+ deleteSubAdmin: "delete.subadmin"
98
+ };
99
+
100
+ // src/modules/user/subadmin/dto/create-subadmin.dto.ts
101
+ var import_class_validator4 = require("class-validator");
102
+ var SubAdminDto = class {
103
+ };
104
+ __decorateClass([
105
+ (0, import_class_validator4.IsNotEmpty)({ message: "Please enter first name." })
106
+ ], SubAdminDto.prototype, "firstName", 2);
107
+ __decorateClass([
108
+ (0, import_class_validator4.IsNotEmpty)({ message: "Please enter last name." })
109
+ ], SubAdminDto.prototype, "lastName", 2);
110
+ __decorateClass([
111
+ (0, import_class_validator4.IsNotEmpty)({ message: "Please enter email." })
112
+ ], SubAdminDto.prototype, "email", 2);
113
+ __decorateClass([
114
+ (0, import_class_validator4.IsNotEmpty)({ message: "Please enter mobile number." })
115
+ ], SubAdminDto.prototype, "mobile", 2);
116
+ __decorateClass([
117
+ (0, import_class_validator4.IsOptional)(),
118
+ (0, import_class_validator4.IsBoolean)({ message: "Is active must be a boolean value" })
119
+ ], SubAdminDto.prototype, "isActive", 2);
120
+
121
+ // src/modules/user/subadmin/dto/toggle-subadmin-visibility.dto.ts
122
+ var import_class_validator5 = require("class-validator");
123
+ var ToggleSubAdminVisibilityDto = class {
124
+ };
125
+ __decorateClass([
126
+ (0, import_class_validator5.IsBoolean)()
127
+ ], ToggleSubAdminVisibilityDto.prototype, "isActive", 2);
128
+
129
+ // src/modules/user/subadmin/dto/update-subadmin.dto.ts
130
+ var import_class_validator6 = require("class-validator");
131
+ var UpdateSubAdminDto = class {
132
+ };
133
+ __decorateClass([
134
+ (0, import_class_validator6.IsNotEmpty)({ message: "Please enter first name." })
135
+ ], UpdateSubAdminDto.prototype, "firstName", 2);
136
+ __decorateClass([
137
+ (0, import_class_validator6.IsNotEmpty)({ message: "Please enter last name." })
138
+ ], UpdateSubAdminDto.prototype, "lastName", 2);
139
+ __decorateClass([
140
+ (0, import_class_validator6.IsNotEmpty)({ message: "Please enter email." })
141
+ ], UpdateSubAdminDto.prototype, "email", 2);
142
+ __decorateClass([
143
+ (0, import_class_validator6.IsNotEmpty)({ message: "Please enter mobile number." })
144
+ ], UpdateSubAdminDto.prototype, "mobile", 2);
145
+ __decorateClass([
146
+ (0, import_class_validator6.IsOptional)(),
147
+ (0, import_class_validator6.IsBoolean)({ message: "Is active must be a boolean value" })
148
+ ], UpdateSubAdminDto.prototype, "isActive", 2);
149
+
82
150
  // src/adapters/tcp/user.tcp.adapter.ts
83
151
  var import_dotenv = require("dotenv");
84
152
  var import_microservices = require("@nestjs/microservices");
@@ -94,10 +162,25 @@ var UserTCPAdapter = () => {
94
162
  };
95
163
  };
96
164
 
97
- // src/adapters/rmq/user.rmq.adapter.ts
165
+ // src/adapters/tcp/job.tcp.adapter.ts
98
166
  var import_dotenv2 = require("dotenv");
99
167
  var import_microservices2 = require("@nestjs/microservices");
100
168
  (0, import_dotenv2.config)();
169
+ var JobTCPAdapter = () => {
170
+ return {
171
+ name: "JOB_MICROSERVICE",
172
+ transport: import_microservices2.Transport.TCP,
173
+ options: {
174
+ host: process.env.JOB_MICROSERVICE_TCP_HOST || "localhost",
175
+ port: parseInt(process.env.JOB_MICROSERVICE_TCP_PORT || "4002", 10)
176
+ }
177
+ };
178
+ };
179
+
180
+ // src/adapters/rmq/user.rmq.adapter.ts
181
+ var import_dotenv3 = require("dotenv");
182
+ var import_microservices3 = require("@nestjs/microservices");
183
+ (0, import_dotenv3.config)();
101
184
  var UserRMQAdapter = (mode = "microservice") => {
102
185
  const urls = process.env.USER_MICROSERVICE_RMQ_URL?.split(",") || [
103
186
  "amqp://localhost:5672"
@@ -114,9 +197,9 @@ var UserRMQAdapter = (mode = "microservice") => {
114
197
  const messageTtl = parseInt(
115
198
  process.env.USER_MICROSERVICE_RMQ_MESSAGE_TTL || "30000"
116
199
  );
117
- const config3 = {
200
+ const config5 = {
118
201
  name: "USER_MICROSERVICE",
119
- transport: import_microservices2.Transport.RMQ,
202
+ transport: import_microservices3.Transport.RMQ,
120
203
  options: {
121
204
  urls,
122
205
  queue,
@@ -136,7 +219,7 @@ var UserRMQAdapter = (mode = "microservice") => {
136
219
  retryAttempts: 5,
137
220
  retryDelay: 3e3,
138
221
  timeout: 1e4,
139
- poolSize: parseInt(process.env.MICROSERVICE_RMQ_POOL_SIZE || "5"),
222
+ poolSize: parseInt(process.env.USER_MICROSERVICE_RMQ_POOL_SIZE || "5"),
140
223
  ...process.env.USER_MICROSERVICE_RMQ_USE_SSL === "true" && {
141
224
  ssl: {
142
225
  rejectUnauthorized: false
@@ -146,9 +229,66 @@ var UserRMQAdapter = (mode = "microservice") => {
146
229
  }
147
230
  };
148
231
  if (mode === "microservice") {
149
- config3["options"]["noAck"] = false;
232
+ config5["options"]["noAck"] = false;
233
+ }
234
+ return config5;
235
+ };
236
+
237
+ // src/adapters/rmq/job.rmq.adapter.ts
238
+ var import_dotenv4 = require("dotenv");
239
+ var import_microservices4 = require("@nestjs/microservices");
240
+ (0, import_dotenv4.config)();
241
+ var JobRMQAdapter = (mode = "microservice") => {
242
+ const urls = process.env.JOB_MICROSERVICE_RMQ_URL?.split(",") || [
243
+ "amqp://localhost:5672"
244
+ ];
245
+ const queue = process.env.JOB_MICROSERVICE_RMQ_QUEUE || "job_queue";
246
+ const prefetchCount = parseInt(
247
+ process.env.JOB_MICROSERVICE_RMQ_PREFETCH_COUNT || "10"
248
+ );
249
+ const heartbeat = parseInt(
250
+ process.env.JOB_MICROSERVICE_RMQ_HEARTBEAT || "60"
251
+ );
252
+ const deadLetterExchange = process.env.JOB_MICROSERVICE_RMQ_DLX || "job_dlx";
253
+ const deadLetterQueue = process.env.JOB_MICROSERVICE_RMQ_DLQ || "job_dlq";
254
+ const messageTtl = parseInt(
255
+ process.env.JOB_MICROSERVICE_RMQ_MESSAGE_TTL || "30000"
256
+ );
257
+ const config5 = {
258
+ name: "JOB_MICROSERVICE",
259
+ transport: import_microservices4.Transport.RMQ,
260
+ options: {
261
+ urls,
262
+ queue,
263
+ prefetchCount,
264
+ heartbeat,
265
+ queueOptions: {
266
+ durable: true,
267
+ arguments: {
268
+ "x-dead-letter-exchange": deadLetterExchange,
269
+ "x-dead-letter-routing-key": deadLetterQueue,
270
+ "x-message-ttl": messageTtl
271
+ }
272
+ },
273
+ connectionOptions: {
274
+ heartbeat,
275
+ retry: true,
276
+ retryAttempts: 5,
277
+ retryDelay: 3e3,
278
+ timeout: 1e4,
279
+ poolSize: parseInt(process.env.JOB_MICROSERVICE_RMQ_POOL_SIZE || "5"),
280
+ ...process.env.JOB_MICROSERVICE_RMQ_USE_SSL === "true" && {
281
+ ssl: {
282
+ rejectUnauthorized: false
283
+ }
284
+ }
285
+ }
286
+ }
287
+ };
288
+ if (mode === "microservice") {
289
+ config5["options"]["noAck"] = false;
150
290
  }
151
- return config3;
291
+ return config5;
152
292
  };
153
293
 
154
294
  // src/entities/base.entity.ts
@@ -314,10 +454,16 @@ User = __decorateClass([
314
454
  AccountStatus,
315
455
  AccountType,
316
456
  BaseEntity,
457
+ JobRMQAdapter,
458
+ JobTCPAdapter,
317
459
  LoginDto,
318
460
  LogoutDto,
319
461
  RefreshDto,
320
462
  RefreshToken,
463
+ SUBADMIN_PATTERN,
464
+ SubAdminDto,
465
+ ToggleSubAdminVisibilityDto,
466
+ UpdateSubAdminDto,
321
467
  User,
322
468
  UserRMQAdapter,
323
469
  UserTCPAdapter
package/dist/index.mjs CHANGED
@@ -53,6 +53,72 @@ __decorateClass([
53
53
  IsNotEmpty3({ message: "Please provide refresh token." })
54
54
  ], LogoutDto.prototype, "refreshToken", 2);
55
55
 
56
+ // src/modules/user/subadmin/pattern/pattern.ts
57
+ var SUBADMIN_PATTERN = {
58
+ fetchSubAdmins: "fetch.subadmins",
59
+ fetchDeletedSubAdmins: "fetch.deleted.subadmins",
60
+ fetchSubAdminDropdown: "fetch.subadmin.dropdown",
61
+ findSubAdminById: "fetch.subadmin.by.id",
62
+ createSubAdmin: "create.subadmin",
63
+ toggleSubAdminStatus: "toggle.subadmin.status",
64
+ updateSubAdmin: "update.subadmin",
65
+ deleteSubAdmin: "delete.subadmin"
66
+ };
67
+
68
+ // src/modules/user/subadmin/dto/create-subadmin.dto.ts
69
+ import {
70
+ IsNotEmpty as IsNotEmpty4,
71
+ IsOptional,
72
+ IsBoolean
73
+ } from "class-validator";
74
+ var SubAdminDto = class {
75
+ };
76
+ __decorateClass([
77
+ IsNotEmpty4({ message: "Please enter first name." })
78
+ ], SubAdminDto.prototype, "firstName", 2);
79
+ __decorateClass([
80
+ IsNotEmpty4({ message: "Please enter last name." })
81
+ ], SubAdminDto.prototype, "lastName", 2);
82
+ __decorateClass([
83
+ IsNotEmpty4({ message: "Please enter email." })
84
+ ], SubAdminDto.prototype, "email", 2);
85
+ __decorateClass([
86
+ IsNotEmpty4({ message: "Please enter mobile number." })
87
+ ], SubAdminDto.prototype, "mobile", 2);
88
+ __decorateClass([
89
+ IsOptional(),
90
+ IsBoolean({ message: "Is active must be a boolean value" })
91
+ ], SubAdminDto.prototype, "isActive", 2);
92
+
93
+ // src/modules/user/subadmin/dto/toggle-subadmin-visibility.dto.ts
94
+ import { IsBoolean as IsBoolean2 } from "class-validator";
95
+ var ToggleSubAdminVisibilityDto = class {
96
+ };
97
+ __decorateClass([
98
+ IsBoolean2()
99
+ ], ToggleSubAdminVisibilityDto.prototype, "isActive", 2);
100
+
101
+ // src/modules/user/subadmin/dto/update-subadmin.dto.ts
102
+ import { IsBoolean as IsBoolean3, IsNotEmpty as IsNotEmpty5, IsOptional as IsOptional2 } from "class-validator";
103
+ var UpdateSubAdminDto = class {
104
+ };
105
+ __decorateClass([
106
+ IsNotEmpty5({ message: "Please enter first name." })
107
+ ], UpdateSubAdminDto.prototype, "firstName", 2);
108
+ __decorateClass([
109
+ IsNotEmpty5({ message: "Please enter last name." })
110
+ ], UpdateSubAdminDto.prototype, "lastName", 2);
111
+ __decorateClass([
112
+ IsNotEmpty5({ message: "Please enter email." })
113
+ ], UpdateSubAdminDto.prototype, "email", 2);
114
+ __decorateClass([
115
+ IsNotEmpty5({ message: "Please enter mobile number." })
116
+ ], UpdateSubAdminDto.prototype, "mobile", 2);
117
+ __decorateClass([
118
+ IsOptional2(),
119
+ IsBoolean3({ message: "Is active must be a boolean value" })
120
+ ], UpdateSubAdminDto.prototype, "isActive", 2);
121
+
56
122
  // src/adapters/tcp/user.tcp.adapter.ts
57
123
  import { config } from "dotenv";
58
124
  import { Transport } from "@nestjs/microservices";
@@ -68,10 +134,25 @@ var UserTCPAdapter = () => {
68
134
  };
69
135
  };
70
136
 
71
- // src/adapters/rmq/user.rmq.adapter.ts
137
+ // src/adapters/tcp/job.tcp.adapter.ts
72
138
  import { config as config2 } from "dotenv";
73
139
  import { Transport as Transport2 } from "@nestjs/microservices";
74
140
  config2();
141
+ var JobTCPAdapter = () => {
142
+ return {
143
+ name: "JOB_MICROSERVICE",
144
+ transport: Transport2.TCP,
145
+ options: {
146
+ host: process.env.JOB_MICROSERVICE_TCP_HOST || "localhost",
147
+ port: parseInt(process.env.JOB_MICROSERVICE_TCP_PORT || "4002", 10)
148
+ }
149
+ };
150
+ };
151
+
152
+ // src/adapters/rmq/user.rmq.adapter.ts
153
+ import { config as config3 } from "dotenv";
154
+ import { Transport as Transport3 } from "@nestjs/microservices";
155
+ config3();
75
156
  var UserRMQAdapter = (mode = "microservice") => {
76
157
  const urls = process.env.USER_MICROSERVICE_RMQ_URL?.split(",") || [
77
158
  "amqp://localhost:5672"
@@ -88,9 +169,9 @@ var UserRMQAdapter = (mode = "microservice") => {
88
169
  const messageTtl = parseInt(
89
170
  process.env.USER_MICROSERVICE_RMQ_MESSAGE_TTL || "30000"
90
171
  );
91
- const config3 = {
172
+ const config5 = {
92
173
  name: "USER_MICROSERVICE",
93
- transport: Transport2.RMQ,
174
+ transport: Transport3.RMQ,
94
175
  options: {
95
176
  urls,
96
177
  queue,
@@ -110,7 +191,7 @@ var UserRMQAdapter = (mode = "microservice") => {
110
191
  retryAttempts: 5,
111
192
  retryDelay: 3e3,
112
193
  timeout: 1e4,
113
- poolSize: parseInt(process.env.MICROSERVICE_RMQ_POOL_SIZE || "5"),
194
+ poolSize: parseInt(process.env.USER_MICROSERVICE_RMQ_POOL_SIZE || "5"),
114
195
  ...process.env.USER_MICROSERVICE_RMQ_USE_SSL === "true" && {
115
196
  ssl: {
116
197
  rejectUnauthorized: false
@@ -120,9 +201,66 @@ var UserRMQAdapter = (mode = "microservice") => {
120
201
  }
121
202
  };
122
203
  if (mode === "microservice") {
123
- config3["options"]["noAck"] = false;
204
+ config5["options"]["noAck"] = false;
205
+ }
206
+ return config5;
207
+ };
208
+
209
+ // src/adapters/rmq/job.rmq.adapter.ts
210
+ import { config as config4 } from "dotenv";
211
+ import { Transport as Transport4 } from "@nestjs/microservices";
212
+ config4();
213
+ var JobRMQAdapter = (mode = "microservice") => {
214
+ const urls = process.env.JOB_MICROSERVICE_RMQ_URL?.split(",") || [
215
+ "amqp://localhost:5672"
216
+ ];
217
+ const queue = process.env.JOB_MICROSERVICE_RMQ_QUEUE || "job_queue";
218
+ const prefetchCount = parseInt(
219
+ process.env.JOB_MICROSERVICE_RMQ_PREFETCH_COUNT || "10"
220
+ );
221
+ const heartbeat = parseInt(
222
+ process.env.JOB_MICROSERVICE_RMQ_HEARTBEAT || "60"
223
+ );
224
+ const deadLetterExchange = process.env.JOB_MICROSERVICE_RMQ_DLX || "job_dlx";
225
+ const deadLetterQueue = process.env.JOB_MICROSERVICE_RMQ_DLQ || "job_dlq";
226
+ const messageTtl = parseInt(
227
+ process.env.JOB_MICROSERVICE_RMQ_MESSAGE_TTL || "30000"
228
+ );
229
+ const config5 = {
230
+ name: "JOB_MICROSERVICE",
231
+ transport: Transport4.RMQ,
232
+ options: {
233
+ urls,
234
+ queue,
235
+ prefetchCount,
236
+ heartbeat,
237
+ queueOptions: {
238
+ durable: true,
239
+ arguments: {
240
+ "x-dead-letter-exchange": deadLetterExchange,
241
+ "x-dead-letter-routing-key": deadLetterQueue,
242
+ "x-message-ttl": messageTtl
243
+ }
244
+ },
245
+ connectionOptions: {
246
+ heartbeat,
247
+ retry: true,
248
+ retryAttempts: 5,
249
+ retryDelay: 3e3,
250
+ timeout: 1e4,
251
+ poolSize: parseInt(process.env.JOB_MICROSERVICE_RMQ_POOL_SIZE || "5"),
252
+ ...process.env.JOB_MICROSERVICE_RMQ_USE_SSL === "true" && {
253
+ ssl: {
254
+ rejectUnauthorized: false
255
+ }
256
+ }
257
+ }
258
+ }
259
+ };
260
+ if (mode === "microservice") {
261
+ config5["options"]["noAck"] = false;
124
262
  }
125
- return config3;
263
+ return config5;
126
264
  };
127
265
 
128
266
  // src/entities/base.entity.ts
@@ -302,10 +440,16 @@ export {
302
440
  AccountStatus,
303
441
  AccountType,
304
442
  BaseEntity,
443
+ JobRMQAdapter,
444
+ JobTCPAdapter,
305
445
  LoginDto,
306
446
  LogoutDto,
307
447
  RefreshDto,
308
448
  RefreshToken,
449
+ SUBADMIN_PATTERN,
450
+ SubAdminDto,
451
+ ToggleSubAdminVisibilityDto,
452
+ UpdateSubAdminDto,
309
453
  User,
310
454
  UserRMQAdapter,
311
455
  UserTCPAdapter
@@ -1 +1,2 @@
1
1
  export * from './authentication';
2
+ export * from './user/subadmin';
@@ -0,0 +1,7 @@
1
+ export declare class SubAdminDto {
2
+ firstName: string;
3
+ lastName: string;
4
+ email: string;
5
+ mobile: string;
6
+ isActive: boolean;
7
+ }
@@ -0,0 +1,3 @@
1
+ export * from '../dto/create-subadmin.dto';
2
+ export * from '../dto/toggle-subadmin-visibility.dto';
3
+ export * from '../dto/update-subadmin.dto';
@@ -0,0 +1,3 @@
1
+ export declare class ToggleSubAdminVisibilityDto {
2
+ isActive: boolean;
3
+ }
@@ -0,0 +1,7 @@
1
+ export declare class UpdateSubAdminDto {
2
+ firstName: string;
3
+ lastName: string;
4
+ email: string;
5
+ mobile: string;
6
+ isActive: boolean;
7
+ }
@@ -0,0 +1,3 @@
1
+ export * from './pattern/pattern';
2
+ export * from './dto';
3
+ export * from './subadmin.interface';
@@ -0,0 +1,10 @@
1
+ export declare const SUBADMIN_PATTERN: {
2
+ fetchSubAdmins: string;
3
+ fetchDeletedSubAdmins: string;
4
+ fetchSubAdminDropdown: string;
5
+ findSubAdminById: string;
6
+ createSubAdmin: string;
7
+ toggleSubAdminStatus: string;
8
+ updateSubAdmin: string;
9
+ deleteSubAdmin: string;
10
+ };
@@ -0,0 +1,66 @@
1
+ export interface IFetchSubAdminQuery {
2
+ page_size?: number;
3
+ page: number;
4
+ searchText?: string;
5
+ subadmin: string;
6
+ right: string;
7
+ sortColumn?: string;
8
+ sortBy?: string;
9
+ }
10
+ export interface IFetchSubAdminResponse {
11
+ statusCode: number;
12
+ status: boolean;
13
+ message: string;
14
+ data: any;
15
+ }
16
+ export interface IFetchSubAdminByIdQuery {
17
+ permission?: string;
18
+ }
19
+ export interface IFetchSubAdminByIdResponse {
20
+ statusCode: number;
21
+ status: boolean;
22
+ message: string;
23
+ data: any;
24
+ }
25
+ export interface ICreateSubAdminPayload {
26
+ firstName: string;
27
+ lastName: string;
28
+ email: string;
29
+ mobile: string;
30
+ isActive: boolean;
31
+ }
32
+ export interface ICreateSubAdminResponse {
33
+ statusCode: number;
34
+ status: boolean;
35
+ message: string;
36
+ }
37
+ export interface IUpdateSubAdminPayload {
38
+ firstName: string;
39
+ lastName: string;
40
+ email: string;
41
+ mobile: string;
42
+ isActive: boolean;
43
+ }
44
+ export interface IUpdateSubAdminResponse {
45
+ statusCode: number;
46
+ status: boolean;
47
+ message: string;
48
+ }
49
+ export interface IToggleSubAdminVisibilityPayload {
50
+ isActive: boolean;
51
+ }
52
+ export interface IToggleSubAdminVisibilityResponse {
53
+ statusCode: number;
54
+ status: boolean;
55
+ message: string;
56
+ }
57
+ export interface IDeleteSubAdminResponse {
58
+ statusCode: number;
59
+ status: boolean;
60
+ message: string;
61
+ }
62
+ export interface IAttachPermissionsToSubAdminResponse {
63
+ statusCode: number;
64
+ status: boolean;
65
+ message: string;
66
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@experts_hub/shared",
3
- "version": "1.0.30",
3
+ "version": "1.0.32",
4
4
  "description": "Shared DTOs, interfaces, and utilities for experts hub applications",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/",