@servicelabsco/nestjs-utility-services 1.2.169 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/app.controller.d.ts +77 -2
  2. package/dist/app.controller.js +359 -12
  3. package/dist/app.controller.js.map +1 -1
  4. package/dist/app.module.js +6 -7
  5. package/dist/app.module.js.map +1 -1
  6. package/dist/auth/middlewares/jwt.middleware.d.ts +1 -0
  7. package/dist/auth/middlewares/jwt.middleware.js +12 -2
  8. package/dist/auth/middlewares/jwt.middleware.js.map +1 -1
  9. package/dist/common/libraries/custom.crypt.d.ts +1 -0
  10. package/dist/common/libraries/custom.crypt.js +44 -9
  11. package/dist/common/libraries/custom.crypt.js.map +1 -1
  12. package/dist/common/libraries/hash.js +2 -2
  13. package/dist/common/libraries/hash.js.map +1 -1
  14. package/dist/common/libraries/platform.utility.js +5 -2
  15. package/dist/common/libraries/platform.utility.js.map +1 -1
  16. package/dist/config/jwt.config.js +5 -3
  17. package/dist/config/jwt.config.js.map +1 -1
  18. package/dist/health.check.controller.d.ts +11 -2
  19. package/dist/health.check.controller.js +268 -4
  20. package/dist/health.check.controller.js.map +1 -1
  21. package/dist/main.js +2 -2
  22. package/dist/main.js.map +1 -1
  23. package/dist/platformUtility/es6.classes.d.ts +2 -6
  24. package/dist/platformUtility/es6.classes.js +0 -4
  25. package/dist/platformUtility/es6.classes.js.map +1 -1
  26. package/dist/platformUtility/index.d.ts +0 -1
  27. package/dist/platformUtility/index.js +0 -1
  28. package/dist/platformUtility/index.js.map +1 -1
  29. package/dist/platformUtility/jobs/process.ses.delivery.webhook.job.js.map +1 -1
  30. package/dist/platformUtility/platform.utility.module.js +1 -4
  31. package/dist/platformUtility/platform.utility.module.js.map +1 -1
  32. package/dist/platformUtility/services/cache.service.d.ts +4 -3
  33. package/dist/platformUtility/services/cache.service.js +84 -21
  34. package/dist/platformUtility/services/cache.service.js.map +1 -1
  35. package/dist/platformUtility/services/redis.service.js +5 -2
  36. package/dist/platformUtility/services/redis.service.js.map +1 -1
  37. package/dist/system/es6.classes.d.ts +1 -1
  38. package/dist/system/libraries/generate.downloadable.report.file.js.map +1 -1
  39. package/package.json +60 -67
  40. package/dist/cli.d.ts +0 -1
  41. package/dist/cli.js +0 -22
  42. package/dist/cli.js.map +0 -1
  43. package/dist/config/cache.config.d.ts +0 -12
  44. package/dist/config/cache.config.js +0 -15
  45. package/dist/config/cache.config.js.map +0 -1
  46. package/dist/console.d.ts +0 -1
  47. package/dist/console.js +0 -20
  48. package/dist/console.js.map +0 -1
  49. package/dist/platformUtility/commands/index.d.ts +0 -3
  50. package/dist/platformUtility/commands/index.js +0 -20
  51. package/dist/platformUtility/commands/index.js.map +0 -1
  52. package/dist/platformUtility/commands/maintenance.command.d.ts +0 -8
  53. package/dist/platformUtility/commands/maintenance.command.js +0 -69
  54. package/dist/platformUtility/commands/maintenance.command.js.map +0 -1
  55. package/dist/platformUtility/commands/sqs.worker.command.d.ts +0 -16
  56. package/dist/platformUtility/commands/sqs.worker.command.js +0 -75
  57. package/dist/platformUtility/commands/sqs.worker.command.js.map +0 -1
  58. package/dist/platformUtility/commands/sync.class.command.d.ts +0 -6
  59. package/dist/platformUtility/commands/sync.class.command.js +0 -56
  60. package/dist/platformUtility/commands/sync.class.command.js.map +0 -1
@@ -1,6 +1,7 @@
1
1
  import { Request } from 'express';
2
2
  import { TestJob } from './platformUtility/jobs/test.job';
3
3
  import { AuditService } from './platformUtility/services/audit.service';
4
+ import { CacheService } from './platformUtility/services/cache.service';
4
5
  import { MailService } from './platformUtility/services/mail.service';
5
6
  import { QueueService } from './platformUtility/services/queue.service';
6
7
  import { RedisService } from './platformUtility/services/redis.service';
@@ -24,7 +25,8 @@ export declare class AppController {
24
25
  protected readonly redisService: RedisService;
25
26
  protected readonly uploadService: UploadService;
26
27
  protected readonly loggerService: LoggerService;
27
- constructor(queueService: QueueService, testJob: TestJob, setScheduledEventJob: SetScheduledEventJob, mailService: MailService, propertyService: PropertyService, sqlService: SqlService, executeCodeFixJob: ExecuteCodeFixJob, syncAllCodeJob: SyncAllCodeJob, auditService: AuditService, redisService: RedisService, uploadService: UploadService, loggerService: LoggerService);
28
+ protected readonly cacheService: CacheService;
29
+ constructor(queueService: QueueService, testJob: TestJob, setScheduledEventJob: SetScheduledEventJob, mailService: MailService, propertyService: PropertyService, sqlService: SqlService, executeCodeFixJob: ExecuteCodeFixJob, syncAllCodeJob: SyncAllCodeJob, auditService: AuditService, redisService: RedisService, uploadService: UploadService, loggerService: LoggerService, cacheService: CacheService);
28
30
  get(): Promise<{
29
31
  message: string;
30
32
  }>;
@@ -33,5 +35,78 @@ export declare class AppController {
33
35
  unset(query: any): Promise<any>;
34
36
  getQueueInstance(): Promise<any>;
35
37
  queue(id: string): Promise<any>;
36
- set(req: Request): Promise<string>;
38
+ set(req: Request): Promise<{
39
+ success: boolean;
40
+ key: string;
41
+ setValue: string;
42
+ retrievedValue: any;
43
+ match: boolean;
44
+ message: string;
45
+ }>;
46
+ cachePersistenceTest(): Promise<{
47
+ success: boolean;
48
+ persisted: boolean;
49
+ message: string;
50
+ originalValue: any;
51
+ currentTime: string;
52
+ instructions: string;
53
+ setValue?: undefined;
54
+ immediatelyRetrieved?: undefined;
55
+ immediateMatch?: undefined;
56
+ storeInfo?: undefined;
57
+ } | {
58
+ success: boolean;
59
+ persisted: boolean;
60
+ message: string;
61
+ setValue: {
62
+ timestamp: number;
63
+ message: string;
64
+ random: number;
65
+ };
66
+ immediatelyRetrieved: any;
67
+ immediateMatch: boolean;
68
+ storeInfo: {
69
+ hasStore: any;
70
+ storeType: any;
71
+ isRedis: any;
72
+ };
73
+ instructions: string;
74
+ originalValue?: undefined;
75
+ currentTime?: undefined;
76
+ }>;
77
+ cacheDebug(): Promise<{
78
+ storeInfo: any;
79
+ testOperation: {
80
+ set: {
81
+ timestamp: number;
82
+ test: boolean;
83
+ };
84
+ retrieved: any;
85
+ success: boolean;
86
+ };
87
+ redisVerification: any;
88
+ environment: {
89
+ REDIS_HOST: string;
90
+ REDIS_PORT: string;
91
+ REDIS_PASSWORD: string;
92
+ REDIS_USERNAME: string;
93
+ REDIS_SLUG: string;
94
+ };
95
+ conclusion: string;
96
+ recommendation: string;
97
+ status: string;
98
+ error?: undefined;
99
+ stack?: undefined;
100
+ } | {
101
+ error: any;
102
+ stack: any;
103
+ storeInfo?: undefined;
104
+ testOperation?: undefined;
105
+ redisVerification?: undefined;
106
+ environment?: undefined;
107
+ conclusion?: undefined;
108
+ recommendation?: undefined;
109
+ status?: undefined;
110
+ }>;
111
+ redisServiceTest(): Promise<any>;
37
112
  }
@@ -17,6 +17,7 @@ const common_1 = require("@nestjs/common");
17
17
  const auth_1 = require("./common/libraries/auth");
18
18
  const test_job_1 = require("./platformUtility/jobs/test.job");
19
19
  const audit_service_1 = require("./platformUtility/services/audit.service");
20
+ const cache_service_1 = require("./platformUtility/services/cache.service");
20
21
  const mail_service_1 = require("./platformUtility/services/mail.service");
21
22
  const queue_service_1 = require("./platformUtility/services/queue.service");
22
23
  const redis_service_1 = require("./platformUtility/services/redis.service");
@@ -27,12 +28,8 @@ const sync_all_code_job_1 = require("./system/jobs/sync.all.code.job");
27
28
  const logger_service_1 = require("./system/services/logger.service");
28
29
  const property_service_1 = require("./system/services/property.service");
29
30
  const upload_service_1 = require("./system/services/upload.service");
30
- const generate_downloadable_report_file_1 = require("./system/libraries/generate.downloadable.report.file");
31
- const report_entity_1 = require("./system/entities/report.entity");
32
- const date_util_1 = require("./common/libraries/date.util");
33
- const date_fns_1 = require("date-fns");
34
31
  let AppController = class AppController {
35
- constructor(queueService, testJob, setScheduledEventJob, mailService, propertyService, sqlService, executeCodeFixJob, syncAllCodeJob, auditService, redisService, uploadService, loggerService) {
32
+ constructor(queueService, testJob, setScheduledEventJob, mailService, propertyService, sqlService, executeCodeFixJob, syncAllCodeJob, auditService, redisService, uploadService, loggerService, cacheService) {
36
33
  this.queueService = queueService;
37
34
  this.testJob = testJob;
38
35
  this.setScheduledEventJob = setScheduledEventJob;
@@ -45,6 +42,7 @@ let AppController = class AppController {
45
42
  this.redisService = redisService;
46
43
  this.uploadService = uploadService;
47
44
  this.loggerService = loggerService;
45
+ this.cacheService = cacheService;
48
46
  }
49
47
  async get() {
50
48
  return { message: 'Hello World!' };
@@ -63,13 +61,343 @@ let AppController = class AppController {
63
61
  return this.queueService.getJobDetails(id);
64
62
  }
65
63
  async set(req) {
66
- const params = {
67
- start_time: date_util_1.DateUtil.getDateTimeInFormat((0, date_fns_1.startOfMonth)(new Date())),
68
- end_time: date_util_1.DateUtil.getDateTimeInFormat((0, date_fns_1.endOfMonth)(new Date())),
69
- business_id: 37,
64
+ const key = 'test-001';
65
+ const value = 'test-value';
66
+ await this.cacheService.delete(key);
67
+ const retrieved = await this.cacheService.get(key);
68
+ return {
69
+ success: true,
70
+ key,
71
+ setValue: value,
72
+ retrievedValue: retrieved,
73
+ match: value === retrieved,
74
+ message: retrieved === value
75
+ ? 'Cache is working! Value persisted correctly.'
76
+ : 'Cache retrieval failed. Check Redis connection and persistence.',
70
77
  };
71
- const r = await report_entity_1.ReportEntity.first(620);
72
- return new generate_downloadable_report_file_1.GenerateDownloadableReportFile(r, this.sqlService, this.uploadService, this.propertyService).generate(params);
78
+ }
79
+ async cachePersistenceTest() {
80
+ const key = 'persistence-test';
81
+ const testValue = {
82
+ timestamp: Date.now(),
83
+ message: 'This value should persist after restart',
84
+ random: Math.random(),
85
+ };
86
+ const existing = await this.cacheService.get(key);
87
+ if (existing) {
88
+ return {
89
+ success: true,
90
+ persisted: true,
91
+ message: '✅ Cache persistence is working! Value survived restart.',
92
+ originalValue: existing,
93
+ currentTime: new Date().toISOString(),
94
+ instructions: 'Restart the app and call this endpoint again. If you see this message, persistence is working.',
95
+ };
96
+ }
97
+ else {
98
+ await this.cacheService.set(key, testValue);
99
+ const immediatelyRetrieved = await this.cacheService.get(key);
100
+ const storeInfo = await this.cacheService.getStoreInfo();
101
+ return {
102
+ success: true,
103
+ persisted: false,
104
+ message: 'Value set. Restart the app and call this endpoint again to test persistence.',
105
+ setValue: testValue,
106
+ immediatelyRetrieved: immediatelyRetrieved,
107
+ immediateMatch: JSON.stringify(testValue) === JSON.stringify(immediatelyRetrieved),
108
+ storeInfo: {
109
+ hasStore: storeInfo.hasStore,
110
+ storeType: storeInfo.storeType,
111
+ isRedis: storeInfo.isRedis || storeInfo.keyvBackend === 'Redis',
112
+ },
113
+ instructions: '1. Restart your NestJS application\n2. Call GET /cache-persistence-test again\n3. If you see persisted: true, cache persistence is working!\n\n⚠️ If storeInfo.isRedis is false, cache may be using in-memory store.',
114
+ };
115
+ }
116
+ }
117
+ async cacheDebug() {
118
+ try {
119
+ const storeInfo = await this.cacheService.getStoreInfo();
120
+ const testKey = 'debug-test';
121
+ const testValue = { timestamp: Date.now(), test: true };
122
+ await this.cacheService.set(testKey, testValue);
123
+ const retrieved = await this.cacheService.get(testKey);
124
+ await this.cacheService.delete(testKey);
125
+ const envInfo = {
126
+ REDIS_HOST: process.env.REDIS_HOST || 'not set',
127
+ REDIS_PORT: process.env.REDIS_PORT || 'not set',
128
+ REDIS_PASSWORD: process.env.REDIS_PASSWORD ? '***set***' : 'not set',
129
+ REDIS_USERNAME: process.env.REDIS_USERNAME || 'not set',
130
+ REDIS_SLUG: process.env.REDIS_SLUG || 'not set',
131
+ };
132
+ let redisVerification = null;
133
+ try {
134
+ const redisTestKey = `__redis_verify_${Date.now()}`;
135
+ const redisTestValue = 'redis-verification-test';
136
+ await this.redisService.set(redisTestKey, redisTestValue);
137
+ const redisRetrieved = await this.redisService.get(redisTestKey);
138
+ await this.redisService.del(redisTestKey);
139
+ const cacheSlug = process.env.REDIS_SLUG || 'cache';
140
+ const cacheKey = `cache.${testKey}`;
141
+ let cacheKeyInRedis = false;
142
+ let cacheKeysWithPrefix = [];
143
+ try {
144
+ const retrieved = await this.redisService.get(cacheKey);
145
+ cacheKeyInRedis = !!retrieved;
146
+ const searchPattern = '*cache*';
147
+ const allKeys = await this.redisService.keys(searchPattern);
148
+ cacheKeysWithPrefix = allKeys || [];
149
+ }
150
+ catch (e) {
151
+ }
152
+ redisVerification = {
153
+ directRedisAccess: true,
154
+ redisServiceWorking: redisRetrieved === redisTestValue,
155
+ cacheKey: cacheKey,
156
+ cacheKeyInRedis: !!cacheKeyInRedis,
157
+ cacheSlug: cacheSlug,
158
+ cacheKeysFound: cacheKeysWithPrefix.length,
159
+ sampleCacheKeys: cacheKeysWithPrefix.slice(0, 5),
160
+ message: cacheKeyInRedis
161
+ ? '✅ Cache key found in Redis! Cache is using Redis store.'
162
+ : cacheKeysWithPrefix.length > 0
163
+ ? `⚠️ Cache key not found, but ${cacheKeysWithPrefix.length} other cache keys found in Redis. Cache is likely using Redis.`
164
+ : '⚠️ No cache keys found in Redis. Cache may be using in-memory store or keys expired.',
165
+ };
166
+ }
167
+ catch (e) {
168
+ redisVerification = {
169
+ directRedisAccess: false,
170
+ error: e.message,
171
+ };
172
+ }
173
+ const likelyUsingRedis = storeInfo.isRedis || (storeInfo.redisTest?.setSuccess && storeInfo.redisTest?.getSuccess) || redisVerification?.directRedisAccess;
174
+ return {
175
+ storeInfo,
176
+ testOperation: {
177
+ set: testValue,
178
+ retrieved,
179
+ success: JSON.stringify(testValue) === JSON.stringify(retrieved),
180
+ },
181
+ redisVerification,
182
+ environment: envInfo,
183
+ conclusion: likelyUsingRedis
184
+ ? '✅ Cache appears to be using Redis store. To verify persistence, restart the app and check if cached values remain.'
185
+ : '⚠️ Cannot confirm Redis store is being used. Cache is working but may be in-memory. Check Redis connection and cache configuration.',
186
+ recommendation: likelyUsingRedis
187
+ ? '✅ Redis store is likely configured. Ensure Redis persistence (RDB/AOF) is enabled for data to survive restarts. Test by restarting the app and checking if cached values persist.'
188
+ : '⚠️ Warning: Cache may be using in-memory store. Data will be lost on restart. Verify Redis connection and check application logs for connection errors.',
189
+ status: likelyUsingRedis ? 'OK' : 'WARNING',
190
+ };
191
+ }
192
+ catch (error) {
193
+ return {
194
+ error: error.message,
195
+ stack: error.stack,
196
+ };
197
+ }
198
+ }
199
+ async redisServiceTest() {
200
+ const testResults = {
201
+ timestamp: new Date().toISOString(),
202
+ tests: {},
203
+ summary: {
204
+ passed: 0,
205
+ failed: 0,
206
+ total: 0,
207
+ },
208
+ environment: {
209
+ REDIS_SLUG: process.env.REDIS_SLUG || 'not set',
210
+ REDIS_PREFIX: process.env.REDIS_PREFIX || 'not set',
211
+ REDIS_HOST: process.env.REDIS_HOST || 'not set',
212
+ REDIS_PORT: process.env.REDIS_PORT || 'not set',
213
+ activePrefix: process.env.REDIS_SLUG || process.env.REDIS_PREFIX || 'not set (this will cause issues)',
214
+ },
215
+ };
216
+ try {
217
+ if (!process.env.REDIS_SLUG && !process.env.REDIS_PREFIX) {
218
+ return {
219
+ success: false,
220
+ error: 'REDIS_SLUG or REDIS_PREFIX environment variable is not set',
221
+ message: '⚠️ REDIS_SLUG (or REDIS_PREFIX) must be set for RedisService to work correctly. The getIdentifier() method requires it.',
222
+ environment: testResults.environment,
223
+ recommendation: 'Set REDIS_SLUG in your .env file (e.g., REDIS_SLUG=devnu)',
224
+ };
225
+ }
226
+ const testKey = `redis-service-test-${Date.now()}`;
227
+ const testValue = `test-value-${Math.random()}`;
228
+ testResults.tests.set = {
229
+ key: testKey,
230
+ value: testValue,
231
+ result: null,
232
+ success: false,
233
+ error: null,
234
+ };
235
+ try {
236
+ const setResult = await this.redisService.set(testKey, testValue);
237
+ testResults.tests.set.result = setResult;
238
+ testResults.tests.set.success = setResult === 'OK' || setResult === 'ok';
239
+ }
240
+ catch (setError) {
241
+ testResults.tests.set.error = setError.message;
242
+ testResults.tests.set.success = false;
243
+ }
244
+ testResults.summary.total++;
245
+ if (testResults.tests.set.success)
246
+ testResults.summary.passed++;
247
+ else
248
+ testResults.summary.failed++;
249
+ testResults.tests.get = {
250
+ key: testKey,
251
+ expectedValue: testValue,
252
+ retrievedValue: null,
253
+ success: false,
254
+ error: null,
255
+ };
256
+ try {
257
+ const getResult = await this.redisService.get(testKey);
258
+ testResults.tests.get.retrievedValue = getResult;
259
+ testResults.tests.get.success = getResult === testValue;
260
+ }
261
+ catch (getError) {
262
+ testResults.tests.get.error = getError.message;
263
+ testResults.tests.get.success = false;
264
+ }
265
+ testResults.summary.total++;
266
+ if (testResults.tests.get.success)
267
+ testResults.summary.passed++;
268
+ else
269
+ testResults.summary.failed++;
270
+ testResults.tests.exists = {
271
+ key: testKey,
272
+ result: null,
273
+ success: false,
274
+ error: null,
275
+ };
276
+ try {
277
+ const existsResult = await this.redisService.exists(testKey);
278
+ testResults.tests.exists.result = existsResult;
279
+ testResults.tests.exists.success = existsResult === 1;
280
+ }
281
+ catch (existsError) {
282
+ testResults.tests.exists.error = existsError.message;
283
+ testResults.tests.exists.success = false;
284
+ }
285
+ testResults.summary.total++;
286
+ if (testResults.tests.exists.success)
287
+ testResults.summary.passed++;
288
+ else
289
+ testResults.summary.failed++;
290
+ testResults.tests.ttl = {
291
+ key: testKey,
292
+ result: null,
293
+ success: false,
294
+ error: null,
295
+ };
296
+ try {
297
+ const ttlResult = await this.redisService.ttl(testKey);
298
+ testResults.tests.ttl.result = ttlResult;
299
+ testResults.tests.ttl.success = ttlResult >= -1;
300
+ }
301
+ catch (ttlError) {
302
+ testResults.tests.ttl.error = ttlError.message;
303
+ testResults.tests.ttl.success = false;
304
+ }
305
+ testResults.summary.total++;
306
+ if (testResults.tests.ttl.success)
307
+ testResults.summary.passed++;
308
+ else
309
+ testResults.summary.failed++;
310
+ const keysPattern = `redis-service-test*`;
311
+ testResults.tests.keys = {
312
+ pattern: keysPattern,
313
+ result: null,
314
+ success: false,
315
+ error: null,
316
+ skipped: false,
317
+ };
318
+ try {
319
+ const redisPrefix = process.env.REDIS_SLUG || process.env.REDIS_PREFIX;
320
+ if (!redisPrefix) {
321
+ testResults.tests.keys.skipped = true;
322
+ testResults.tests.keys.error = 'REDIS_SLUG or REDIS_PREFIX not set - keys test skipped';
323
+ testResults.tests.keys.success = false;
324
+ testResults.summary.total++;
325
+ testResults.summary.failed++;
326
+ }
327
+ else {
328
+ const keysResult = await this.redisService.keys(keysPattern);
329
+ testResults.tests.keys.result = keysResult;
330
+ testResults.tests.keys.success = Array.isArray(keysResult);
331
+ testResults.summary.total++;
332
+ if (testResults.tests.keys.success)
333
+ testResults.summary.passed++;
334
+ else
335
+ testResults.summary.failed++;
336
+ }
337
+ }
338
+ catch (keysError) {
339
+ testResults.tests.keys.error = keysError.message;
340
+ testResults.tests.keys.success = false;
341
+ testResults.summary.total++;
342
+ testResults.summary.failed++;
343
+ }
344
+ testResults.tests.del = {
345
+ key: testKey,
346
+ result: null,
347
+ success: false,
348
+ };
349
+ const delResult = await this.redisService.del(testKey);
350
+ testResults.tests.del.result = delResult;
351
+ testResults.tests.del.success = delResult === 1;
352
+ testResults.summary.total++;
353
+ if (testResults.tests.del.success)
354
+ testResults.summary.passed++;
355
+ else
356
+ testResults.summary.failed++;
357
+ const existsAfterDel = await this.redisService.exists(testKey);
358
+ testResults.tests.del.existsAfterDelete = existsAfterDel;
359
+ testResults.tests.del.fullyDeleted = existsAfterDel === 0;
360
+ const incrKey = `redis-service-test-incr-${Date.now()}`;
361
+ testResults.tests.incr = {
362
+ key: incrKey,
363
+ results: [],
364
+ success: false,
365
+ };
366
+ const incr1 = await this.redisService.incr(incrKey);
367
+ const incr2 = await this.redisService.incr(incrKey);
368
+ const incr3 = await this.redisService.incr(incrKey);
369
+ testResults.tests.incr.results = [incr1, incr2, incr3];
370
+ testResults.tests.incr.success = incr1 === 1 && incr2 === 2 && incr3 === 3;
371
+ testResults.summary.total++;
372
+ if (testResults.tests.incr.success)
373
+ testResults.summary.passed++;
374
+ else
375
+ testResults.summary.failed++;
376
+ await this.redisService.del(incrKey);
377
+ testResults.environment = {
378
+ REDIS_SLUG: process.env.REDIS_SLUG || 'not set',
379
+ REDIS_PREFIX: process.env.REDIS_PREFIX || 'not set',
380
+ REDIS_HOST: process.env.REDIS_HOST || 'not set',
381
+ REDIS_PORT: process.env.REDIS_PORT || 'not set',
382
+ REDIS_PASSWORD: process.env.REDIS_PASSWORD ? 'set' : 'not set',
383
+ REDIS_USERNAME: process.env.REDIS_USERNAME || 'not set',
384
+ activePrefix: process.env.REDIS_SLUG || process.env.REDIS_PREFIX || 'not set',
385
+ };
386
+ testResults.status = testResults.summary.failed === 0 ? 'OK' : 'FAILED';
387
+ testResults.message =
388
+ testResults.summary.failed === 0
389
+ ? '✅ RedisService is working correctly! All tests passed.'
390
+ : `⚠️ RedisService has issues. ${testResults.summary.failed} test(s) failed.`;
391
+ return testResults;
392
+ }
393
+ catch (error) {
394
+ return {
395
+ success: false,
396
+ error: error.message,
397
+ stack: error.stack,
398
+ message: '❌ RedisService test failed with an error. Check Redis connection and configuration.',
399
+ };
400
+ }
73
401
  }
74
402
  };
75
403
  exports.AppController = AppController;
@@ -118,6 +446,24 @@ __decorate([
118
446
  __metadata("design:paramtypes", [Object]),
119
447
  __metadata("design:returntype", Promise)
120
448
  ], AppController.prototype, "set", null);
449
+ __decorate([
450
+ (0, common_1.Get)('cache-persistence-test'),
451
+ __metadata("design:type", Function),
452
+ __metadata("design:paramtypes", []),
453
+ __metadata("design:returntype", Promise)
454
+ ], AppController.prototype, "cachePersistenceTest", null);
455
+ __decorate([
456
+ (0, common_1.Get)('cache-debug'),
457
+ __metadata("design:type", Function),
458
+ __metadata("design:paramtypes", []),
459
+ __metadata("design:returntype", Promise)
460
+ ], AppController.prototype, "cacheDebug", null);
461
+ __decorate([
462
+ (0, common_1.Get)('redis-service-test'),
463
+ __metadata("design:type", Function),
464
+ __metadata("design:paramtypes", []),
465
+ __metadata("design:returntype", Promise)
466
+ ], AppController.prototype, "redisServiceTest", null);
121
467
  exports.AppController = AppController = __decorate([
122
468
  (0, common_1.Controller)(),
123
469
  __metadata("design:paramtypes", [queue_service_1.QueueService,
@@ -131,6 +477,7 @@ exports.AppController = AppController = __decorate([
131
477
  audit_service_1.AuditService,
132
478
  redis_service_1.RedisService,
133
479
  upload_service_1.UploadService,
134
- logger_service_1.LoggerService])
480
+ logger_service_1.LoggerService,
481
+ cache_service_1.CacheService])
135
482
  ], AppController);
136
483
  //# sourceMappingURL=app.controller.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"app.controller.js","sourceRoot":"","sources":["../src/app.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA0E;AAE1E,kDAA+C;AAC/C,8DAA0D;AAC1D,4EAAwE;AACxE,0EAAsE;AACtE,4EAAwE;AACxE,4EAAwE;AACxE,wEAAoE;AACpE,6EAAuE;AACvE,mFAA6E;AAC7E,uEAAiE;AACjE,qEAAiE;AACjE,yEAAqE;AACrE,qEAAiE;AAEjE,4GAAsG;AACtG,mEAA+D;AAC/D,4DAAwD;AACxD,uCAAoD;AAS7C,IAAM,aAAa,GAAnB,MAAM,aAAa;IAgBtB,YACqB,YAA0B,EACxB,OAAgB,EAChB,oBAA0C,EAC1C,WAAwB,EACxB,eAAgC,EAChC,UAAsB,EACtB,iBAAoC,EACpC,cAA8B,EAC9B,YAA0B,EAC1B,YAA0B,EAC1B,aAA4B,EAC5B,aAA4B;QAX9B,iBAAY,GAAZ,YAAY,CAAc;QACxB,YAAO,GAAP,OAAO,CAAS;QAChB,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,gBAAW,GAAX,WAAW,CAAa;QACxB,oBAAe,GAAf,eAAe,CAAiB;QAChC,eAAU,GAAV,UAAU,CAAY;QACtB,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,mBAAc,GAAd,cAAc,CAAgB;QAC9B,iBAAY,GAAZ,YAAY,CAAc;QAC1B,iBAAY,GAAZ,YAAY,CAAc;QAC1B,kBAAa,GAAb,aAAa,CAAe;QAC5B,kBAAa,GAAb,aAAa,CAAe;IAC/C,CAAC;IAOC,AAAN,KAAK,CAAC,GAAG;QACL,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC;IACvC,CAAC;IAOK,AAAN,KAAK,CAAC,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A;;;;0CAA6B;AAO3C;IADL,IAAA,YAAG,EAAC,OAAO,CAAC;;;;qDAGZ;AAQK;IADL,IAAA,YAAG,EAAC,WAAW,CAAC;IACJ,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;0CAEvB;AASK;IADL,IAAA,aAAI,EAAC,MAAM,CAAC;IACF,WAAA,IAAA,YAAG,GAAE,CAAA;;;;wCAuBf;AAQK;IADL,IAAA,YAAG,EAAC,wBAAwB,CAAC;;;;yDAgD7B;AAQK;IADL,IAAA,YAAG,EAAC,aAAa,CAAC;;;;+CA8GlB;AAQK;IADL,IAAA,YAAG,EAAC,oBAAoB,CAAC;;;;qDA6NzB;wBApgBQ,aAAa;IADzB,IAAA,mBAAU,GAAE;qCAkB0B,4BAAY;QACf,kBAAO;QACM,8CAAoB;QAC7B,0BAAW;QACP,kCAAe;QACpB,wBAAU;QACH,wCAAiB;QACpB,kCAAc;QAChB,4BAAY;QACZ,4BAAY;QACX,8BAAa;QACb,8BAAa;QACd,4BAAY;GA7BxC,aAAa,CAqgBzB"}
@@ -7,12 +7,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  };
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.AppModule = void 0;
10
+ const bullmq_1 = require("@nestjs/bullmq");
10
11
  const common_1 = require("@nestjs/common");
11
12
  const config_1 = require("@nestjs/config");
12
13
  const terminus_1 = require("@nestjs/terminus");
13
14
  const typeorm_1 = require("@nestjs/typeorm");
14
- const nestjs_command_1 = require("nestjs-command");
15
- const nestjs_console_1 = require("nestjs-console");
16
15
  const app_controller_1 = require("./app.controller");
17
16
  const app_service_1 = require("./app.service");
18
17
  const auth_module_1 = require("./auth/auth.module");
@@ -22,6 +21,7 @@ const internal_middleware_1 = require("./auth/middlewares/internal.middleware");
22
21
  const jwt_middleware_1 = require("./auth/middlewares/jwt.middleware");
23
22
  const restricted_middleware_1 = require("./auth/middlewares/restricted.middleware");
24
23
  const common_module_1 = require("./common/common.module");
24
+ const mongoOrmconfig = require("./config/mongo.config");
25
25
  const queueConfig = require("./config/queue.config");
26
26
  const readOrmconfig = require("./config/read.typeorm.config");
27
27
  const ormconfig = require("./config/typeorm.config");
@@ -33,8 +33,6 @@ const security_module_1 = require("./security/security.module");
33
33
  const menu_controller_1 = require("./system/controllers/menu.controller");
34
34
  const system_module_1 = require("./system/system.module");
35
35
  const worker_service_1 = require("./worker.service");
36
- const bullmq_1 = require("@nestjs/bullmq");
37
- const mongoOrmconfig = require("./config/mongo.config");
38
36
  let AppModule = class AppModule {
39
37
  configure(consumer) {
40
38
  consumer.apply(maintenance_middleware_1.MaintenanceMiddleware).forRoutes({ path: '*', method: common_1.RequestMethod.ALL });
@@ -58,9 +56,10 @@ exports.AppModule = AppModule = __decorate([
58
56
  system_module_1.SystemModule,
59
57
  security_module_1.SecurityModule,
60
58
  common_module_1.CommonModule,
61
- nestjs_console_1.ConsoleModule,
62
- nestjs_command_1.CommandModule,
63
- terminus_1.TerminusModule,
59
+ terminus_1.TerminusModule.forRoot({
60
+ errorLogStyle: 'pretty',
61
+ logger: true,
62
+ }),
64
63
  ],
65
64
  controllers: [app_controller_1.AppController, admin_auth_controller_1.AdminAuthController, menu_controller_1.MenuController, health_check_controller_1.HealthCheckController],
66
65
  providers: [app_service_1.AppService, worker_service_1.WorkerService, shutdown_service_1.ShutdownService],
@@ -1 +1 @@
1
- {"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA2E;AAC3E,2CAA8C;AAC9C,+CAAkD;AAClD,6CAAgD;AAChD,mDAA+C;AAC/C,mDAA+C;AAC/C,qDAAiD;AACjD,+CAA2C;AAC3C,oDAAgD;AAChD,oFAA+E;AAC/E,oFAA+E;AAC/E,gFAA4E;AAC5E,sEAAkE;AAClE,oFAAgF;AAChF,0DAAsD;AACtD,qDAAqD;AACrD,8DAA8D;AAC9D,qDAAqD;AACrD,uEAAkE;AAClE,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C,GAAG,EAAE,CAAC,CAAC;QACxF,QAAQ,CAAC,KAAK,CAAC,4CAAoB,CAAC,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,sBAAa,CAAC,GAAG,EAAE,CAAC,CAAC;QAC7F,QAAQ,CAAC,KAAK,CAAC,wCAAkB,CAAC,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,sBAAa,CAAC,GAAG,EAAE,CAAC,CAAC;IACpG,CAAC;CACJ,CAAA;AAVY,8BAAS;oBAAT,SAAS;IApBrB,IAAA,eAAM,EAAC;QACJ,OAAO,EAAE;YACL,uBAAa,CAAC,OAAO,CAAC,SAAS,CAAC;YAChC,uBAAa,CAAC,OAAO,CAAC,aAAa,CAAC;YACpC,uBAAa,CAAC,OAAO,CAAC,cAAc,CAAC;YACrC,mBAAU,CAAC,OAAO,CAAC,WAAW,CAAC;YAC/B,qBAAY,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;YACxC,+CAAqB;YACrB,wBAAU;YACV,4BAAY;YACZ,gCAAc;YACd,4BAAY;YACZ,yBAAc,CAAC,OAAO,CAAC;gBACnB,aAAa,EAAE,QAAQ;gBACvB,MAAM,EAAE,IAAI;aACf,CAAC;SACL;QACD,WAAW,EAAE,CAAC,8BAAa,EAAE,2CAAmB,EAAE,gCAAc,EAAE,+CAAqB,CAAC;QACxF,SAAS,EAAE,CAAC,wBAAU,EAAE,8BAAa,EAAE,kCAAe,CAAC;KAC1D,CAAC;GACW,SAAS,CAUrB"}
@@ -5,5 +5,6 @@ export declare class JwtMiddleware implements NestMiddleware {
5
5
  private readonly authService;
6
6
  constructor(authService: AuthService);
7
7
  use(req: Request, res: Response, next: Function): Promise<Function>;
8
+ private parseBearerToken;
8
9
  _getUserOutOfToken(token: string): Promise<any>;
9
10
  }
@@ -11,7 +11,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.JwtMiddleware = void 0;
13
13
  const common_1 = require("@nestjs/common");
14
- const parse_bearer_token_1 = require("parse-bearer-token");
15
14
  const operation_exception_1 = require("../../common/exceptions/operation.exception");
16
15
  const auth_1 = require("../../common/libraries/auth");
17
16
  const platform_utility_1 = require("../../common/libraries/platform.utility");
@@ -24,7 +23,7 @@ let JwtMiddleware = class JwtMiddleware {
24
23
  const ip = platform_utility_1.PlatformUtility.getIpFromRequest(req);
25
24
  if (auth_1.Auth.check())
26
25
  return next();
27
- const token = (0, parse_bearer_token_1.default)(req);
26
+ const token = this.parseBearerToken(req);
28
27
  if (!token)
29
28
  return next();
30
29
  const auth = await this._getUserOutOfToken(token);
@@ -39,6 +38,17 @@ let JwtMiddleware = class JwtMiddleware {
39
38
  auth_1.Auth.login({ ...accessObject, ...auth, req: { ip } });
40
39
  next();
41
40
  }
41
+ parseBearerToken(req) {
42
+ const authHeader = req.headers.authorization;
43
+ if (!authHeader || typeof authHeader !== 'string') {
44
+ return null;
45
+ }
46
+ const parts = authHeader.split(' ');
47
+ if (parts.length !== 2 || parts[0] !== 'Bearer') {
48
+ return null;
49
+ }
50
+ return parts[1] || null;
51
+ }
42
52
  async _getUserOutOfToken(token) {
43
53
  const payload = await this.authService.verifyJwtToken(token);
44
54
  if (!payload)
@@ -1 +1 @@
1
- {"version":3,"file":"jwt.middleware.js","sourceRoot":"","sources":["../../../src/auth/middlewares/jwt.middleware.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4D;AAE5D,2DAAkD;AAClD,qFAAiF;AACjF,sDAAmD;AACnD,8EAA0E;AAC1E,2DAAuD;AAShD,IAAM,aAAa,GAAnB,MAAM,aAAa;IAMtB,YAA6B,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;IAAG,CAAC;IAazD,KAAK,CAAC,GAAG,CAAC,GAAY,EAAE,GAAa,EAAE,IAAc;QACjD,MAAM,EAAE,GAAG,kCAAe,CAAC,gBA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