@experts_hub/shared 1.0.31 → 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.
package/dist/adapters/index.d.ts
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -123,8 +123,12 @@ interface IAttachPermissionsToSubAdminResponse {
|
|
|
123
123
|
|
|
124
124
|
declare const UserTCPAdapter: () => MicroserviceOptions;
|
|
125
125
|
|
|
126
|
+
declare const JobTCPAdapter: () => MicroserviceOptions;
|
|
127
|
+
|
|
126
128
|
declare const UserRMQAdapter: (mode?: string) => MicroserviceOptions;
|
|
127
129
|
|
|
130
|
+
declare const JobRMQAdapter: (mode?: string) => MicroserviceOptions;
|
|
131
|
+
|
|
128
132
|
declare abstract class BaseEntity {
|
|
129
133
|
id: number;
|
|
130
134
|
uuid: string;
|
|
@@ -181,4 +185,4 @@ declare class User extends BaseEntity {
|
|
|
181
185
|
refreshTokens: RefreshToken[];
|
|
182
186
|
}
|
|
183
187
|
|
|
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 };
|
|
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
|
@@ -123,8 +123,12 @@ interface IAttachPermissionsToSubAdminResponse {
|
|
|
123
123
|
|
|
124
124
|
declare const UserTCPAdapter: () => MicroserviceOptions;
|
|
125
125
|
|
|
126
|
+
declare const JobTCPAdapter: () => MicroserviceOptions;
|
|
127
|
+
|
|
126
128
|
declare const UserRMQAdapter: (mode?: string) => MicroserviceOptions;
|
|
127
129
|
|
|
130
|
+
declare const JobRMQAdapter: (mode?: string) => MicroserviceOptions;
|
|
131
|
+
|
|
128
132
|
declare abstract class BaseEntity {
|
|
129
133
|
id: number;
|
|
130
134
|
uuid: string;
|
|
@@ -181,4 +185,4 @@ declare class User extends BaseEntity {
|
|
|
181
185
|
refreshTokens: RefreshToken[];
|
|
182
186
|
}
|
|
183
187
|
|
|
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 };
|
|
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,6 +31,8 @@ __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,
|
|
@@ -160,10 +162,25 @@ var UserTCPAdapter = () => {
|
|
|
160
162
|
};
|
|
161
163
|
};
|
|
162
164
|
|
|
163
|
-
// src/adapters/
|
|
165
|
+
// src/adapters/tcp/job.tcp.adapter.ts
|
|
164
166
|
var import_dotenv2 = require("dotenv");
|
|
165
167
|
var import_microservices2 = require("@nestjs/microservices");
|
|
166
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)();
|
|
167
184
|
var UserRMQAdapter = (mode = "microservice") => {
|
|
168
185
|
const urls = process.env.USER_MICROSERVICE_RMQ_URL?.split(",") || [
|
|
169
186
|
"amqp://localhost:5672"
|
|
@@ -180,9 +197,9 @@ var UserRMQAdapter = (mode = "microservice") => {
|
|
|
180
197
|
const messageTtl = parseInt(
|
|
181
198
|
process.env.USER_MICROSERVICE_RMQ_MESSAGE_TTL || "30000"
|
|
182
199
|
);
|
|
183
|
-
const
|
|
200
|
+
const config5 = {
|
|
184
201
|
name: "USER_MICROSERVICE",
|
|
185
|
-
transport:
|
|
202
|
+
transport: import_microservices3.Transport.RMQ,
|
|
186
203
|
options: {
|
|
187
204
|
urls,
|
|
188
205
|
queue,
|
|
@@ -202,7 +219,7 @@ var UserRMQAdapter = (mode = "microservice") => {
|
|
|
202
219
|
retryAttempts: 5,
|
|
203
220
|
retryDelay: 3e3,
|
|
204
221
|
timeout: 1e4,
|
|
205
|
-
poolSize: parseInt(process.env.
|
|
222
|
+
poolSize: parseInt(process.env.USER_MICROSERVICE_RMQ_POOL_SIZE || "5"),
|
|
206
223
|
...process.env.USER_MICROSERVICE_RMQ_USE_SSL === "true" && {
|
|
207
224
|
ssl: {
|
|
208
225
|
rejectUnauthorized: false
|
|
@@ -212,9 +229,66 @@ var UserRMQAdapter = (mode = "microservice") => {
|
|
|
212
229
|
}
|
|
213
230
|
};
|
|
214
231
|
if (mode === "microservice") {
|
|
215
|
-
|
|
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;
|
|
216
290
|
}
|
|
217
|
-
return
|
|
291
|
+
return config5;
|
|
218
292
|
};
|
|
219
293
|
|
|
220
294
|
// src/entities/base.entity.ts
|
|
@@ -380,6 +454,8 @@ User = __decorateClass([
|
|
|
380
454
|
AccountStatus,
|
|
381
455
|
AccountType,
|
|
382
456
|
BaseEntity,
|
|
457
|
+
JobRMQAdapter,
|
|
458
|
+
JobTCPAdapter,
|
|
383
459
|
LoginDto,
|
|
384
460
|
LogoutDto,
|
|
385
461
|
RefreshDto,
|
package/dist/index.mjs
CHANGED
|
@@ -134,10 +134,25 @@ var UserTCPAdapter = () => {
|
|
|
134
134
|
};
|
|
135
135
|
};
|
|
136
136
|
|
|
137
|
-
// src/adapters/
|
|
137
|
+
// src/adapters/tcp/job.tcp.adapter.ts
|
|
138
138
|
import { config as config2 } from "dotenv";
|
|
139
139
|
import { Transport as Transport2 } from "@nestjs/microservices";
|
|
140
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();
|
|
141
156
|
var UserRMQAdapter = (mode = "microservice") => {
|
|
142
157
|
const urls = process.env.USER_MICROSERVICE_RMQ_URL?.split(",") || [
|
|
143
158
|
"amqp://localhost:5672"
|
|
@@ -154,9 +169,9 @@ var UserRMQAdapter = (mode = "microservice") => {
|
|
|
154
169
|
const messageTtl = parseInt(
|
|
155
170
|
process.env.USER_MICROSERVICE_RMQ_MESSAGE_TTL || "30000"
|
|
156
171
|
);
|
|
157
|
-
const
|
|
172
|
+
const config5 = {
|
|
158
173
|
name: "USER_MICROSERVICE",
|
|
159
|
-
transport:
|
|
174
|
+
transport: Transport3.RMQ,
|
|
160
175
|
options: {
|
|
161
176
|
urls,
|
|
162
177
|
queue,
|
|
@@ -176,7 +191,7 @@ var UserRMQAdapter = (mode = "microservice") => {
|
|
|
176
191
|
retryAttempts: 5,
|
|
177
192
|
retryDelay: 3e3,
|
|
178
193
|
timeout: 1e4,
|
|
179
|
-
poolSize: parseInt(process.env.
|
|
194
|
+
poolSize: parseInt(process.env.USER_MICROSERVICE_RMQ_POOL_SIZE || "5"),
|
|
180
195
|
...process.env.USER_MICROSERVICE_RMQ_USE_SSL === "true" && {
|
|
181
196
|
ssl: {
|
|
182
197
|
rejectUnauthorized: false
|
|
@@ -186,9 +201,66 @@ var UserRMQAdapter = (mode = "microservice") => {
|
|
|
186
201
|
}
|
|
187
202
|
};
|
|
188
203
|
if (mode === "microservice") {
|
|
189
|
-
|
|
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;
|
|
190
262
|
}
|
|
191
|
-
return
|
|
263
|
+
return config5;
|
|
192
264
|
};
|
|
193
265
|
|
|
194
266
|
// src/entities/base.entity.ts
|
|
@@ -368,6 +440,8 @@ export {
|
|
|
368
440
|
AccountStatus,
|
|
369
441
|
AccountType,
|
|
370
442
|
BaseEntity,
|
|
443
|
+
JobRMQAdapter,
|
|
444
|
+
JobTCPAdapter,
|
|
371
445
|
LoginDto,
|
|
372
446
|
LogoutDto,
|
|
373
447
|
RefreshDto,
|