@experts_hub/shared 1.0.31 → 1.0.33

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,6 +23,10 @@ declare class LogoutDto {
23
23
  refreshToken: string;
24
24
  }
25
25
 
26
+ declare const RESUME_PARSER_PATTERN: {
27
+ handleResumeParsing: string;
28
+ };
29
+
26
30
  declare const SUBADMIN_PATTERN: {
27
31
  fetchSubAdmins: string;
28
32
  fetchDeletedSubAdmins: string;
@@ -123,8 +127,12 @@ interface IAttachPermissionsToSubAdminResponse {
123
127
 
124
128
  declare const UserTCPAdapter: () => MicroserviceOptions;
125
129
 
130
+ declare const JobTCPAdapter: () => MicroserviceOptions;
131
+
126
132
  declare const UserRMQAdapter: (mode?: string) => MicroserviceOptions;
127
133
 
134
+ declare const JobRMQAdapter: (mode?: string) => MicroserviceOptions;
135
+
128
136
  declare abstract class BaseEntity {
129
137
  id: number;
130
138
  uuid: string;
@@ -181,4 +189,4 @@ declare class User extends BaseEntity {
181
189
  refreshTokens: RefreshToken[];
182
190
  }
183
191
 
184
- 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, LoginDto, LogoutDto, RefreshDto, RefreshToken, SUBADMIN_PATTERN, SubAdminDto, ToggleSubAdminVisibilityDto, UpdateSubAdminDto, User, UserRMQAdapter, UserTCPAdapter };
192
+ 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, RESUME_PARSER_PATTERN, RefreshDto, RefreshToken, SUBADMIN_PATTERN, SubAdminDto, ToggleSubAdminVisibilityDto, UpdateSubAdminDto, User, UserRMQAdapter, UserTCPAdapter };
package/dist/index.d.ts CHANGED
@@ -23,6 +23,10 @@ declare class LogoutDto {
23
23
  refreshToken: string;
24
24
  }
25
25
 
26
+ declare const RESUME_PARSER_PATTERN: {
27
+ handleResumeParsing: string;
28
+ };
29
+
26
30
  declare const SUBADMIN_PATTERN: {
27
31
  fetchSubAdmins: string;
28
32
  fetchDeletedSubAdmins: string;
@@ -123,8 +127,12 @@ interface IAttachPermissionsToSubAdminResponse {
123
127
 
124
128
  declare const UserTCPAdapter: () => MicroserviceOptions;
125
129
 
130
+ declare const JobTCPAdapter: () => MicroserviceOptions;
131
+
126
132
  declare const UserRMQAdapter: (mode?: string) => MicroserviceOptions;
127
133
 
134
+ declare const JobRMQAdapter: (mode?: string) => MicroserviceOptions;
135
+
128
136
  declare abstract class BaseEntity {
129
137
  id: number;
130
138
  uuid: string;
@@ -181,4 +189,4 @@ declare class User extends BaseEntity {
181
189
  refreshTokens: RefreshToken[];
182
190
  }
183
191
 
184
- 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, LoginDto, LogoutDto, RefreshDto, RefreshToken, SUBADMIN_PATTERN, SubAdminDto, ToggleSubAdminVisibilityDto, UpdateSubAdminDto, User, UserRMQAdapter, UserTCPAdapter };
192
+ 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, RESUME_PARSER_PATTERN, RefreshDto, RefreshToken, SUBADMIN_PATTERN, SubAdminDto, ToggleSubAdminVisibilityDto, UpdateSubAdminDto, User, UserRMQAdapter, UserTCPAdapter };
package/dist/index.js CHANGED
@@ -31,8 +31,11 @@ __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,
38
+ RESUME_PARSER_PATTERN: () => RESUME_PARSER_PATTERN,
36
39
  RefreshDto: () => RefreshDto,
37
40
  RefreshToken: () => RefreshToken,
38
41
  SUBADMIN_PATTERN: () => SUBADMIN_PATTERN,
@@ -83,6 +86,11 @@ __decorateClass([
83
86
  (0, import_class_validator3.IsNotEmpty)({ message: "Please provide refresh token." })
84
87
  ], LogoutDto.prototype, "refreshToken", 2);
85
88
 
89
+ // src/modules/resume-parser/pattern/pattern.ts
90
+ var RESUME_PARSER_PATTERN = {
91
+ handleResumeParsing: "handle.resume.parsing"
92
+ };
93
+
86
94
  // src/modules/user/subadmin/pattern/pattern.ts
87
95
  var SUBADMIN_PATTERN = {
88
96
  fetchSubAdmins: "fetch.subadmins",
@@ -160,10 +168,25 @@ var UserTCPAdapter = () => {
160
168
  };
161
169
  };
162
170
 
163
- // src/adapters/rmq/user.rmq.adapter.ts
171
+ // src/adapters/tcp/job.tcp.adapter.ts
164
172
  var import_dotenv2 = require("dotenv");
165
173
  var import_microservices2 = require("@nestjs/microservices");
166
174
  (0, import_dotenv2.config)();
175
+ var JobTCPAdapter = () => {
176
+ return {
177
+ name: "JOB_MICROSERVICE",
178
+ transport: import_microservices2.Transport.TCP,
179
+ options: {
180
+ host: process.env.JOB_MICROSERVICE_TCP_HOST || "localhost",
181
+ port: parseInt(process.env.JOB_MICROSERVICE_TCP_PORT || "4002", 10)
182
+ }
183
+ };
184
+ };
185
+
186
+ // src/adapters/rmq/user.rmq.adapter.ts
187
+ var import_dotenv3 = require("dotenv");
188
+ var import_microservices3 = require("@nestjs/microservices");
189
+ (0, import_dotenv3.config)();
167
190
  var UserRMQAdapter = (mode = "microservice") => {
168
191
  const urls = process.env.USER_MICROSERVICE_RMQ_URL?.split(",") || [
169
192
  "amqp://localhost:5672"
@@ -180,9 +203,9 @@ var UserRMQAdapter = (mode = "microservice") => {
180
203
  const messageTtl = parseInt(
181
204
  process.env.USER_MICROSERVICE_RMQ_MESSAGE_TTL || "30000"
182
205
  );
183
- const config3 = {
206
+ const config5 = {
184
207
  name: "USER_MICROSERVICE",
185
- transport: import_microservices2.Transport.RMQ,
208
+ transport: import_microservices3.Transport.RMQ,
186
209
  options: {
187
210
  urls,
188
211
  queue,
@@ -202,7 +225,7 @@ var UserRMQAdapter = (mode = "microservice") => {
202
225
  retryAttempts: 5,
203
226
  retryDelay: 3e3,
204
227
  timeout: 1e4,
205
- poolSize: parseInt(process.env.MICROSERVICE_RMQ_POOL_SIZE || "5"),
228
+ poolSize: parseInt(process.env.USER_MICROSERVICE_RMQ_POOL_SIZE || "5"),
206
229
  ...process.env.USER_MICROSERVICE_RMQ_USE_SSL === "true" && {
207
230
  ssl: {
208
231
  rejectUnauthorized: false
@@ -212,9 +235,66 @@ var UserRMQAdapter = (mode = "microservice") => {
212
235
  }
213
236
  };
214
237
  if (mode === "microservice") {
215
- config3["options"]["noAck"] = false;
238
+ config5["options"]["noAck"] = false;
239
+ }
240
+ return config5;
241
+ };
242
+
243
+ // src/adapters/rmq/job.rmq.adapter.ts
244
+ var import_dotenv4 = require("dotenv");
245
+ var import_microservices4 = require("@nestjs/microservices");
246
+ (0, import_dotenv4.config)();
247
+ var JobRMQAdapter = (mode = "microservice") => {
248
+ const urls = process.env.JOB_MICROSERVICE_RMQ_URL?.split(",") || [
249
+ "amqp://localhost:5672"
250
+ ];
251
+ const queue = process.env.JOB_MICROSERVICE_RMQ_QUEUE || "job_queue";
252
+ const prefetchCount = parseInt(
253
+ process.env.JOB_MICROSERVICE_RMQ_PREFETCH_COUNT || "10"
254
+ );
255
+ const heartbeat = parseInt(
256
+ process.env.JOB_MICROSERVICE_RMQ_HEARTBEAT || "60"
257
+ );
258
+ const deadLetterExchange = process.env.JOB_MICROSERVICE_RMQ_DLX || "job_dlx";
259
+ const deadLetterQueue = process.env.JOB_MICROSERVICE_RMQ_DLQ || "job_dlq";
260
+ const messageTtl = parseInt(
261
+ process.env.JOB_MICROSERVICE_RMQ_MESSAGE_TTL || "30000"
262
+ );
263
+ const config5 = {
264
+ name: "JOB_MICROSERVICE",
265
+ transport: import_microservices4.Transport.RMQ,
266
+ options: {
267
+ urls,
268
+ queue,
269
+ prefetchCount,
270
+ heartbeat,
271
+ queueOptions: {
272
+ durable: true,
273
+ arguments: {
274
+ "x-dead-letter-exchange": deadLetterExchange,
275
+ "x-dead-letter-routing-key": deadLetterQueue,
276
+ "x-message-ttl": messageTtl
277
+ }
278
+ },
279
+ connectionOptions: {
280
+ heartbeat,
281
+ retry: true,
282
+ retryAttempts: 5,
283
+ retryDelay: 3e3,
284
+ timeout: 1e4,
285
+ poolSize: parseInt(process.env.JOB_MICROSERVICE_RMQ_POOL_SIZE || "5"),
286
+ ...process.env.JOB_MICROSERVICE_RMQ_USE_SSL === "true" && {
287
+ ssl: {
288
+ rejectUnauthorized: false
289
+ }
290
+ }
291
+ }
292
+ }
293
+ };
294
+ if (mode === "microservice") {
295
+ config5["options"]["noAck"] = false;
216
296
  }
217
- return config3;
297
+ return config5;
218
298
  };
219
299
 
220
300
  // src/entities/base.entity.ts
@@ -380,8 +460,11 @@ User = __decorateClass([
380
460
  AccountStatus,
381
461
  AccountType,
382
462
  BaseEntity,
463
+ JobRMQAdapter,
464
+ JobTCPAdapter,
383
465
  LoginDto,
384
466
  LogoutDto,
467
+ RESUME_PARSER_PATTERN,
385
468
  RefreshDto,
386
469
  RefreshToken,
387
470
  SUBADMIN_PATTERN,
package/dist/index.mjs CHANGED
@@ -53,6 +53,11 @@ __decorateClass([
53
53
  IsNotEmpty3({ message: "Please provide refresh token." })
54
54
  ], LogoutDto.prototype, "refreshToken", 2);
55
55
 
56
+ // src/modules/resume-parser/pattern/pattern.ts
57
+ var RESUME_PARSER_PATTERN = {
58
+ handleResumeParsing: "handle.resume.parsing"
59
+ };
60
+
56
61
  // src/modules/user/subadmin/pattern/pattern.ts
57
62
  var SUBADMIN_PATTERN = {
58
63
  fetchSubAdmins: "fetch.subadmins",
@@ -134,10 +139,25 @@ var UserTCPAdapter = () => {
134
139
  };
135
140
  };
136
141
 
137
- // src/adapters/rmq/user.rmq.adapter.ts
142
+ // src/adapters/tcp/job.tcp.adapter.ts
138
143
  import { config as config2 } from "dotenv";
139
144
  import { Transport as Transport2 } from "@nestjs/microservices";
140
145
  config2();
146
+ var JobTCPAdapter = () => {
147
+ return {
148
+ name: "JOB_MICROSERVICE",
149
+ transport: Transport2.TCP,
150
+ options: {
151
+ host: process.env.JOB_MICROSERVICE_TCP_HOST || "localhost",
152
+ port: parseInt(process.env.JOB_MICROSERVICE_TCP_PORT || "4002", 10)
153
+ }
154
+ };
155
+ };
156
+
157
+ // src/adapters/rmq/user.rmq.adapter.ts
158
+ import { config as config3 } from "dotenv";
159
+ import { Transport as Transport3 } from "@nestjs/microservices";
160
+ config3();
141
161
  var UserRMQAdapter = (mode = "microservice") => {
142
162
  const urls = process.env.USER_MICROSERVICE_RMQ_URL?.split(",") || [
143
163
  "amqp://localhost:5672"
@@ -154,9 +174,9 @@ var UserRMQAdapter = (mode = "microservice") => {
154
174
  const messageTtl = parseInt(
155
175
  process.env.USER_MICROSERVICE_RMQ_MESSAGE_TTL || "30000"
156
176
  );
157
- const config3 = {
177
+ const config5 = {
158
178
  name: "USER_MICROSERVICE",
159
- transport: Transport2.RMQ,
179
+ transport: Transport3.RMQ,
160
180
  options: {
161
181
  urls,
162
182
  queue,
@@ -176,7 +196,7 @@ var UserRMQAdapter = (mode = "microservice") => {
176
196
  retryAttempts: 5,
177
197
  retryDelay: 3e3,
178
198
  timeout: 1e4,
179
- poolSize: parseInt(process.env.MICROSERVICE_RMQ_POOL_SIZE || "5"),
199
+ poolSize: parseInt(process.env.USER_MICROSERVICE_RMQ_POOL_SIZE || "5"),
180
200
  ...process.env.USER_MICROSERVICE_RMQ_USE_SSL === "true" && {
181
201
  ssl: {
182
202
  rejectUnauthorized: false
@@ -186,9 +206,66 @@ var UserRMQAdapter = (mode = "microservice") => {
186
206
  }
187
207
  };
188
208
  if (mode === "microservice") {
189
- config3["options"]["noAck"] = false;
209
+ config5["options"]["noAck"] = false;
210
+ }
211
+ return config5;
212
+ };
213
+
214
+ // src/adapters/rmq/job.rmq.adapter.ts
215
+ import { config as config4 } from "dotenv";
216
+ import { Transport as Transport4 } from "@nestjs/microservices";
217
+ config4();
218
+ var JobRMQAdapter = (mode = "microservice") => {
219
+ const urls = process.env.JOB_MICROSERVICE_RMQ_URL?.split(",") || [
220
+ "amqp://localhost:5672"
221
+ ];
222
+ const queue = process.env.JOB_MICROSERVICE_RMQ_QUEUE || "job_queue";
223
+ const prefetchCount = parseInt(
224
+ process.env.JOB_MICROSERVICE_RMQ_PREFETCH_COUNT || "10"
225
+ );
226
+ const heartbeat = parseInt(
227
+ process.env.JOB_MICROSERVICE_RMQ_HEARTBEAT || "60"
228
+ );
229
+ const deadLetterExchange = process.env.JOB_MICROSERVICE_RMQ_DLX || "job_dlx";
230
+ const deadLetterQueue = process.env.JOB_MICROSERVICE_RMQ_DLQ || "job_dlq";
231
+ const messageTtl = parseInt(
232
+ process.env.JOB_MICROSERVICE_RMQ_MESSAGE_TTL || "30000"
233
+ );
234
+ const config5 = {
235
+ name: "JOB_MICROSERVICE",
236
+ transport: Transport4.RMQ,
237
+ options: {
238
+ urls,
239
+ queue,
240
+ prefetchCount,
241
+ heartbeat,
242
+ queueOptions: {
243
+ durable: true,
244
+ arguments: {
245
+ "x-dead-letter-exchange": deadLetterExchange,
246
+ "x-dead-letter-routing-key": deadLetterQueue,
247
+ "x-message-ttl": messageTtl
248
+ }
249
+ },
250
+ connectionOptions: {
251
+ heartbeat,
252
+ retry: true,
253
+ retryAttempts: 5,
254
+ retryDelay: 3e3,
255
+ timeout: 1e4,
256
+ poolSize: parseInt(process.env.JOB_MICROSERVICE_RMQ_POOL_SIZE || "5"),
257
+ ...process.env.JOB_MICROSERVICE_RMQ_USE_SSL === "true" && {
258
+ ssl: {
259
+ rejectUnauthorized: false
260
+ }
261
+ }
262
+ }
263
+ }
264
+ };
265
+ if (mode === "microservice") {
266
+ config5["options"]["noAck"] = false;
190
267
  }
191
- return config3;
268
+ return config5;
192
269
  };
193
270
 
194
271
  // src/entities/base.entity.ts
@@ -368,8 +445,11 @@ export {
368
445
  AccountStatus,
369
446
  AccountType,
370
447
  BaseEntity,
448
+ JobRMQAdapter,
449
+ JobTCPAdapter,
371
450
  LoginDto,
372
451
  LogoutDto,
452
+ RESUME_PARSER_PATTERN,
373
453
  RefreshDto,
374
454
  RefreshToken,
375
455
  SUBADMIN_PATTERN,
@@ -1,2 +1,3 @@
1
1
  export * from './authentication';
2
+ export * from './resume-parser';
2
3
  export * from './user/subadmin';
@@ -0,0 +1 @@
1
+ export * from './pattern/pattern';
@@ -0,0 +1,3 @@
1
+ export declare const RESUME_PARSER_PATTERN: {
2
+ handleResumeParsing: string;
3
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@experts_hub/shared",
3
- "version": "1.0.31",
3
+ "version": "1.0.33",
4
4
  "description": "Shared DTOs, interfaces, and utilities for experts hub applications",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/",