@gus-eip/loggers 4.0.8 → 4.1.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.
package/README.md CHANGED
@@ -1,82 +1,82 @@
1
- # @gus-eip/loggers
2
-
3
- ## Overview
4
-
5
- `@gus-eip/loggers` is a package designed to provide logging functionality for your Node.js applications. It offers integration with various logging services, including CloudWatchLogger.
6
-
7
- ## Installation
8
-
9
- You can install the package via npm:
10
-
11
- ```bash
12
- npm install @gus-eip/loggers
13
- ```
14
-
15
- ## Usage
16
-
17
- To use the logger module in your application, follow these steps:
18
-
19
- 1. Import `LoggerModule` from `@gus-eip/loggers` inside your module.
20
-
21
- ```javascript
22
- import { LoggerModule } from '@gus-eip/loggers';
23
- ```
24
-
25
- 2. Configure `LoggerModule` in your module by calling the `forRoot` method.
26
-
27
- ```javascript
28
- LoggerModule.forRoot({
29
- region: process.env.REGION,
30
- logGroupName: process.env.LOGGER_LOG_GROUP_NAME,
31
- options: 'CloudWatchLogger',
32
- }),
33
- ```
34
-
35
- Ensure you provide the necessary environment variables (`REGION` and `LOGGER_LOG_GROUP_NAME`) for configuration.
36
-
37
- ## Configuration Options
38
-
39
- - `region`: The AWS region where your CloudWatch logs are located.
40
- - `logGroupName`: The name of the log group where logs will be sent.
41
- - `options`: The options for the logger. Currently, only `'CloudWatchLogger'` is supported.
42
-
43
- ## Example
44
-
45
- ```javascript
46
- import { Module } from '@nestjs/common';
47
- import { LoggerModule } from '@gus-eip/loggers';
48
-
49
- @Module({
50
- imports: [
51
- LoggerModule.forRoot({
52
- region: process.env.REGION,
53
- logGroupName: process.env.LOGGER_LOG_GROUP_NAME,
54
- options: 'CloudWatchLogger',
55
- }),
56
- ],
57
- })
58
- export class AppModule {}
59
- ```
60
-
61
- ```
62
- This repository requires AWS SSM Parameter Store access to retrieve the SQS URL dynamically. Ensure that the application has permission to read LOGGER_SQS_URL.
63
-
64
- ```
65
-
66
- ## License
67
-
68
- This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
69
-
70
- ---
71
-
72
- ## OAP-EIP LOGGER
73
-
74
- Whenever a new use case is added in the enum.ts file, make sure to also:
75
-
76
- 1. Add a user-friendly label for it in usecase-mapping.ts.
77
-
78
- 2. Add a new entry in source-destination-mapping.ts with the correct usecase, brand, source, and destination.
79
-
80
- 3. After publishing the updated package, update the dependency in the gus-eip-analytics repository to reflect the latest version.
81
-
1
+ # @gus-eip/loggers
2
+
3
+ ## Overview
4
+
5
+ `@gus-eip/loggers` is a package designed to provide logging functionality for your Node.js applications. It offers integration with various logging services, including CloudWatchLogger.
6
+
7
+ ## Installation
8
+
9
+ You can install the package via npm:
10
+
11
+ ```bash
12
+ npm install @gus-eip/loggers
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ To use the logger module in your application, follow these steps:
18
+
19
+ 1. Import `LoggerModule` from `@gus-eip/loggers` inside your module.
20
+
21
+ ```javascript
22
+ import { LoggerModule } from '@gus-eip/loggers';
23
+ ```
24
+
25
+ 2. Configure `LoggerModule` in your module by calling the `forRoot` method.
26
+
27
+ ```javascript
28
+ LoggerModule.forRoot({
29
+ region: process.env.REGION,
30
+ logGroupName: process.env.LOGGER_LOG_GROUP_NAME,
31
+ options: 'CloudWatchLogger',
32
+ }),
33
+ ```
34
+
35
+ Ensure you provide the necessary environment variables (`REGION` and `LOGGER_LOG_GROUP_NAME`) for configuration.
36
+
37
+ ## Configuration Options
38
+
39
+ - `region`: The AWS region where your CloudWatch logs are located.
40
+ - `logGroupName`: The name of the log group where logs will be sent.
41
+ - `options`: The options for the logger. Currently, only `'CloudWatchLogger'` is supported.
42
+
43
+ ## Example
44
+
45
+ ```javascript
46
+ import { Module } from '@nestjs/common';
47
+ import { LoggerModule } from '@gus-eip/loggers';
48
+
49
+ @Module({
50
+ imports: [
51
+ LoggerModule.forRoot({
52
+ region: process.env.REGION,
53
+ logGroupName: process.env.LOGGER_LOG_GROUP_NAME,
54
+ options: 'CloudWatchLogger',
55
+ }),
56
+ ],
57
+ })
58
+ export class AppModule {}
59
+ ```
60
+
61
+ ```
62
+ This repository requires AWS SSM Parameter Store access to retrieve the SQS URL dynamically. Ensure that the application has permission to read LOGGER_SQS_URL.
63
+
64
+ ```
65
+
66
+ ## License
67
+
68
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
69
+
70
+ ---
71
+
72
+ ## OAP-EIP LOGGER
73
+
74
+ Whenever a new use case is added in the enum.ts file, make sure to also:
75
+
76
+ 1. Add a user-friendly label for it in usecase-mapping.ts.
77
+
78
+ 2. Add a new entry in source-destination-mapping.ts with the correct usecase, brand, source, and destination.
79
+
80
+ 3. After publishing the updated package, update the dependency in the gus-eip-analytics repository to reflect the latest version.
81
+
82
82
  Feel free to customize this README according to your specific package features, usage guidelines, and licensing terms.
@@ -312,7 +312,7 @@ let CloudWatchLoggerService = class CloudWatchLoggerService {
312
312
  await sqs.sendMessage(params).promise();
313
313
  }
314
314
  catch (error) {
315
- console.error('Failed to send log event to SQS:', error);
315
+ return;
316
316
  }
317
317
  }
318
318
  async getSourceAndDestination(brand, usecase) {
package/dist/enum.d.ts CHANGED
@@ -391,6 +391,59 @@ export declare class LoggerEnum {
391
391
  SYNC_IN_UNFC_INITIATED: string;
392
392
  APPLICATION_PROCESSING_COMPLETED: string;
393
393
  DOCUMENT_UPLOAD_FAILED: string;
394
+ CHANGE_REQUEST_INITIATED: string;
395
+ GET_OAP_DETAILS_COMPLETED: string;
396
+ CHANGE_REQUEST_OBJECT_FORMED: string;
397
+ PDF_REQUEST_FORMED: string;
398
+ PDF_REQUEST_COMPLETED: string;
399
+ S3_UPLOAD_COMPLETED: string;
400
+ CHANGE_REQUEST_ERROR: string;
401
+ CHANGE_REQUEST_FAILED: string;
402
+ MISSING_OPPORTUNITY_ID: string;
403
+ SALESFORCE_DETAILS_NOT_FOUND: string;
404
+ GET_SF_OBJECT_ERROR: string;
405
+ NO_EXISTING_APPLICATION_ID: string;
406
+ RETRIEVING_EXISTING_APPLICATION: string;
407
+ EXISTING_APPLICATION_FOUND: string;
408
+ NO_EXISTING_APPLICATION_FOUND: string;
409
+ GET_EXISTING_APPLICATION_ERROR: string;
410
+ MISSING_BRAND_MODE: string;
411
+ NO_SECTIONS_FOUND: string;
412
+ OAP_SECTIONS_RETRIEVED: string;
413
+ NO_DOCUMENTS_TO_CLONE: string;
414
+ CLONING_DOCUMENTS_STARTED: string;
415
+ INVALID_DOCUMENT_DATA: string;
416
+ UPLOAD_STUDENT_DOCUMENT: string;
417
+ DOCUMENT_CLONE_ERROR: string;
418
+ CLONING_DOCUMENTS_COMPLETED: string;
419
+ MISC_DETAILS_PROCESSED: string;
420
+ NO_MISC_DETAILS: string;
421
+ NO_OPPORTUNITY_DATA: string;
422
+ CLONE_OBJECT_ERROR: string;
423
+ GET_OAP_SECTIONS_ERROR: string;
424
+ MISSING_PRODUCT_ID: string;
425
+ DEFERRAL_PROCESSING_INITIATED: string;
426
+ PROCESSING_RECORD_INITIATED: string;
427
+ SF_DATA_VALIDATION_FAILED: string;
428
+ MISSING_EMAIL: string;
429
+ SF_DATA_RETRIEVED: string;
430
+ DATA_RETRIEVAL_COMPLETE: string;
431
+ SECTION_PROCESSING_ERROR: string;
432
+ GET_PRODUCT_DETAILS_ERROR: string;
433
+ DATA_PROCESSING_COMPLETE: string;
434
+ SAVE_INPROGRESS_APPLICATION: string;
435
+ SAVE_SUBMITTED_APPLICATION: string;
436
+ RECORD_PROCESSED_SUCCESSFULLY: string;
437
+ RECORD_PROCESSING_ERROR: string;
438
+ DEFERRAL_PROCESSING_COMPLETED: string;
439
+ DEFERRAL_PROCESSING_FAILED: string;
440
+ MISSING_SF_DATA: string;
441
+ INVALID_PRODUCTS_RESPONSE: string;
442
+ PRODUCT_NOT_FOUND: string;
443
+ PRODUCT_DETAILS_RETRIEVED: string;
444
+ MESSAGE_PARSE_ERROR: string;
445
+ INVALID_PLATFORM_EVENT: string;
446
+ INVALID_EVENT_STRUCTURE: string;
394
447
  };
395
448
  UseCase: {
396
449
  PROGRAM_INFO: string;
@@ -493,6 +546,8 @@ export declare class LoggerEnum {
493
546
  ULAW_NEW_APPLICATION: string;
494
547
  CHATBOT_CHAT_CLOSED: string;
495
548
  UNFC_DATA_POLLING: string;
549
+ DEFERRAL_PROCESSING: string;
550
+ CHANGE_REQUEST_FORM: string;
496
551
  };
497
552
  Component: {
498
553
  OAP_FRONTEND: string;
package/dist/enum.js CHANGED
@@ -402,6 +402,59 @@ let LoggerEnum = class LoggerEnum {
402
402
  SYNC_IN_UNFC_INITIATED: 'SYNC_IN_UNFC_INITIATED',
403
403
  APPLICATION_PROCESSING_COMPLETED: 'APPLICATION_PROCESSING_COMPLETED',
404
404
  DOCUMENT_UPLOAD_FAILED: 'DOCUMENT_UPLOAD_FAILED',
405
+ CHANGE_REQUEST_INITIATED: 'CHANGE_REQUEST_INITIATED',
406
+ GET_OAP_DETAILS_COMPLETED: 'GET_OAP_DETAILS_COMPLETED',
407
+ CHANGE_REQUEST_OBJECT_FORMED: 'CHANGE_REQUEST_OBJECT_FORMED',
408
+ PDF_REQUEST_FORMED: 'PDF_REQUEST_FORMED',
409
+ PDF_REQUEST_COMPLETED: 'PDF_REQUEST_COMPLETED',
410
+ S3_UPLOAD_COMPLETED: 'S3_UPLOAD_COMPLETED',
411
+ CHANGE_REQUEST_ERROR: 'CHANGE_REQUEST_ERROR',
412
+ CHANGE_REQUEST_FAILED: 'CHANGE_REQUEST_FAILED',
413
+ MISSING_OPPORTUNITY_ID: 'MISSING_OPPORTUNITY_ID',
414
+ SALESFORCE_DETAILS_NOT_FOUND: 'SALESFORCE_DETAILS_NOT_FOUND',
415
+ GET_SF_OBJECT_ERROR: 'GET_SF_OBJECT_ERROR',
416
+ NO_EXISTING_APPLICATION_ID: 'NO_EXISTING_APPLICATION_ID',
417
+ RETRIEVING_EXISTING_APPLICATION: 'RETRIEVING_EXISTING_APPLICATION',
418
+ EXISTING_APPLICATION_FOUND: 'EXISTING_APPLICATION_FOUND',
419
+ NO_EXISTING_APPLICATION_FOUND: 'NO_EXISTING_APPLICATION_FOUND',
420
+ GET_EXISTING_APPLICATION_ERROR: 'GET_EXISTING_APPLICATION_ERROR',
421
+ MISSING_BRAND_MODE: 'MISSING_BRAND_MODE',
422
+ NO_SECTIONS_FOUND: 'NO_SECTIONS_FOUND',
423
+ OAP_SECTIONS_RETRIEVED: 'OAP_SECTIONS_RETRIEVED',
424
+ NO_DOCUMENTS_TO_CLONE: 'NO_DOCUMENTS_TO_CLONE',
425
+ CLONING_DOCUMENTS_STARTED: 'CLONING_DOCUMENTS_STARTED',
426
+ INVALID_DOCUMENT_DATA: 'INVALID_DOCUMENT_DATA',
427
+ UPLOAD_STUDENT_DOCUMENT: 'UPLOAD_STUDENT_DOCUMENT',
428
+ DOCUMENT_CLONE_ERROR: 'DOCUMENT_CLONE_ERROR',
429
+ CLONING_DOCUMENTS_COMPLETED: 'CLONING_DOCUMENTS_COMPLETED',
430
+ MISC_DETAILS_PROCESSED: 'MISC_DETAILS_PROCESSED',
431
+ NO_MISC_DETAILS: 'NO_MISC_DETAILS',
432
+ NO_OPPORTUNITY_DATA: 'NO_OPPORTUNITY_DATA',
433
+ CLONE_OBJECT_ERROR: 'CLONE_OBJECT_ERROR',
434
+ GET_OAP_SECTIONS_ERROR: 'GET_OAP_SECTIONS_ERROR',
435
+ MISSING_PRODUCT_ID: 'MISSING_PRODUCT_ID',
436
+ DEFERRAL_PROCESSING_INITIATED: 'DEFERRAL_PROCESSING_INITIATED',
437
+ PROCESSING_RECORD_INITIATED: 'PROCESSING_RECORD_INITIATED',
438
+ SF_DATA_VALIDATION_FAILED: 'SF_DATA_VALIDATION_FAILED',
439
+ MISSING_EMAIL: 'MISSING_EMAIL',
440
+ SF_DATA_RETRIEVED: 'SF_DATA_RETRIEVED',
441
+ DATA_RETRIEVAL_COMPLETE: 'DATA_RETRIEVAL_COMPLETE',
442
+ SECTION_PROCESSING_ERROR: 'SECTION_PROCESSING_ERROR',
443
+ GET_PRODUCT_DETAILS_ERROR: 'GET_PRODUCT_DETAILS_ERROR',
444
+ DATA_PROCESSING_COMPLETE: 'DATA_PROCESSING_COMPLETE',
445
+ SAVE_INPROGRESS_APPLICATION: 'SAVE_INPROGRESS_APPLICATION',
446
+ SAVE_SUBMITTED_APPLICATION: 'SAVE_SUBMITTED_APPLICATION',
447
+ RECORD_PROCESSED_SUCCESSFULLY: 'RECORD_PROCESSED_SUCCESSFULLY',
448
+ RECORD_PROCESSING_ERROR: 'RECORD_PROCESSING_ERROR',
449
+ DEFERRAL_PROCESSING_COMPLETED: 'DEFERRAL_PROCESSING_COMPLETED',
450
+ DEFERRAL_PROCESSING_FAILED: 'DEFERRAL_PROCESSING_FAILED',
451
+ MISSING_SF_DATA: 'MISSING_SF_DATA',
452
+ INVALID_PRODUCTS_RESPONSE: 'INVALID_PRODUCTS_RESPONSE',
453
+ PRODUCT_NOT_FOUND: 'PRODUCT_NOT_FOUND',
454
+ PRODUCT_DETAILS_RETRIEVED: 'PRODUCT_DETAILS_RETRIEVED',
455
+ MESSAGE_PARSE_ERROR: 'MESSAGE_PARSE_ERROR',
456
+ INVALID_PLATFORM_EVENT: 'INVALID_PLATFORM_EVENT',
457
+ INVALID_EVENT_STRUCTURE: 'INVALID_EVENT_STRUCTURE',
405
458
  };
406
459
  this.UseCase = {
407
460
  PROGRAM_INFO: 'SAVE_PROGRAMME_DETAILS',
@@ -504,6 +557,8 @@ let LoggerEnum = class LoggerEnum {
504
557
  ULAW_NEW_APPLICATION: 'ULAW_NEW_APPLICATION',
505
558
  CHATBOT_CHAT_CLOSED: 'CHATBOT_CHAT_CLOSED',
506
559
  UNFC_DATA_POLLING: 'UNFC_DATA_POLLING',
560
+ DEFERRAL_PROCESSING: 'DEFERRAL_PROCESSING',
561
+ CHANGE_REQUEST_FORM: 'CHANGE_REQUEST_FORM',
507
562
  };
508
563
  this.Component = {
509
564
  OAP_FRONTEND: 'OAP-FRONTEND',
@@ -78,5 +78,7 @@ export declare enum UsecaseMapping {
78
78
  ULAW_NEW_LEAD = "New Lead Created",
79
79
  ULAW_OFFER_STAGE = "Offer Issued",
80
80
  ULAW_PAYMENT_STAGE = "Payment Processed",
81
- ULAW_NEW_APPLICATION = "New Application Submitted"
81
+ ULAW_NEW_APPLICATION = "New Application Submitted",
82
+ DEFERRAL_PROCESSING = "Deferral Processing",
83
+ CHANGE_REQUEST_FORM = "Change Request Form"
82
84
  }
@@ -83,4 +83,6 @@ var UsecaseMapping;
83
83
  UsecaseMapping["ULAW_OFFER_STAGE"] = "Offer Issued";
84
84
  UsecaseMapping["ULAW_PAYMENT_STAGE"] = "Payment Processed";
85
85
  UsecaseMapping["ULAW_NEW_APPLICATION"] = "New Application Submitted";
86
+ UsecaseMapping["DEFERRAL_PROCESSING"] = "Deferral Processing";
87
+ UsecaseMapping["CHANGE_REQUEST_FORM"] = "Change Request Form";
86
88
  })(UsecaseMapping || (exports.UsecaseMapping = UsecaseMapping = {}));
package/package.json CHANGED
@@ -1,79 +1,79 @@
1
- {
2
- "name": "@gus-eip/loggers",
3
- "version": "4.0.8",
4
- "description": "@gus-eip/loggers is a package designed to provide logging functionality for your Node.js applications.",
5
- "author": "gus",
6
- "readmeFilename": "README.md",
7
- "main": "dist/index.js",
8
- "files": [
9
- "dist/**/*",
10
- "*.md"
11
- ],
12
- "scripts": {
13
- "start:dev": "tsc -w",
14
- "build": "tsc",
15
- "prepare": "npm run build",
16
- "format": "prettier --write \"src/**/*.ts\"",
17
- "lint": "tslint -p tsconfig.json -c tslint.json",
18
- "test": "node --experimental-vm-modules ./node_modules/.bin/jest",
19
- "test:watch": "jest --watch",
20
- "test:cov": "jest --coverage",
21
- "test:e2e": "jest --config ./test/jest-e2e.json"
22
- },
23
- "keywords": [
24
- "nestjs",
25
- "nodejs",
26
- "javascript",
27
- "typescript",
28
- "eip-loggers"
29
- ],
30
- "publishConfig": {
31
- "access": "public"
32
- },
33
- "dependencies": {
34
- "@aws-sdk/client-ssm": "^3.759.0",
35
- "aws-sdk": "^2.1590.0",
36
- "axios": "^1.7.4"
37
- },
38
- "devDependencies": {
39
- "@nestjs/common": "^10.0.2",
40
- "@nestjs/core": "^10.0.2",
41
- "@nestjs/platform-express": "^10.0.2",
42
- "@nestjs/testing": "10.0.2",
43
- "@types/express": "4.17.17",
44
- "@types/jest": "29.5.2",
45
- "@types/lodash": "^4.17.7",
46
- "@types/node": "20.3.1",
47
- "@types/supertest": "2.0.12",
48
- "@typescript-eslint/eslint-plugin": "^5.60.0",
49
- "@typescript-eslint/parser": "^5.60.0",
50
- "eslint": "^8.43.0",
51
- "eslint-config-prettier": "^8.8.0",
52
- "eslint-plugin-prettier": "^4.2.1",
53
- "jest": "29.5.0",
54
- "prettier": "2.8.8",
55
- "reflect-metadata": "^0.1.13",
56
- "rxjs": "^7.8.1",
57
- "supertest": "6.3.3",
58
- "ts-jest": "29.1.0",
59
- "ts-node": "10.9.1",
60
- "tsc-watch": "6.0.4",
61
- "tsconfig-paths": "4.2.0",
62
- "tslint": "5.20.1",
63
- "typescript": "^5.5.4"
64
- },
65
- "jest": {
66
- "moduleFileExtensions": [
67
- "js",
68
- "json",
69
- "ts"
70
- ],
71
- "rootDir": "src",
72
- "testRegex": ".spec.ts$",
73
- "transform": {
74
- "^.+\\.(t|j)s$": "ts-jest"
75
- },
76
- "coverageDirectory": "../coverage",
77
- "testEnvironment": "node"
78
- }
79
- }
1
+ {
2
+ "name": "@gus-eip/loggers",
3
+ "version": "4.1.0",
4
+ "description": "@gus-eip/loggers is a package designed to provide logging functionality for your Node.js applications.",
5
+ "author": "gus",
6
+ "readmeFilename": "README.md",
7
+ "main": "dist/index.js",
8
+ "files": [
9
+ "dist/**/*",
10
+ "*.md"
11
+ ],
12
+ "scripts": {
13
+ "start:dev": "tsc -w",
14
+ "build": "tsc",
15
+ "prepare": "npm run build",
16
+ "format": "prettier --write \"src/**/*.ts\"",
17
+ "lint": "tslint -p tsconfig.json -c tslint.json",
18
+ "test": "node --experimental-vm-modules ./node_modules/.bin/jest",
19
+ "test:watch": "jest --watch",
20
+ "test:cov": "jest --coverage",
21
+ "test:e2e": "jest --config ./test/jest-e2e.json"
22
+ },
23
+ "keywords": [
24
+ "nestjs",
25
+ "nodejs",
26
+ "javascript",
27
+ "typescript",
28
+ "eip-loggers"
29
+ ],
30
+ "publishConfig": {
31
+ "access": "public"
32
+ },
33
+ "dependencies": {
34
+ "@aws-sdk/client-ssm": "^3.759.0",
35
+ "aws-sdk": "^2.1590.0",
36
+ "axios": "^1.7.4"
37
+ },
38
+ "devDependencies": {
39
+ "@nestjs/common": "^10.0.2",
40
+ "@nestjs/core": "^10.0.2",
41
+ "@nestjs/platform-express": "^10.0.2",
42
+ "@nestjs/testing": "10.0.2",
43
+ "@types/express": "4.17.17",
44
+ "@types/jest": "29.5.2",
45
+ "@types/lodash": "^4.17.7",
46
+ "@types/node": "20.3.1",
47
+ "@types/supertest": "2.0.12",
48
+ "@typescript-eslint/eslint-plugin": "^5.60.0",
49
+ "@typescript-eslint/parser": "^5.60.0",
50
+ "eslint": "^8.43.0",
51
+ "eslint-config-prettier": "^8.8.0",
52
+ "eslint-plugin-prettier": "^4.2.1",
53
+ "jest": "29.5.0",
54
+ "prettier": "2.8.8",
55
+ "reflect-metadata": "^0.1.13",
56
+ "rxjs": "^7.8.1",
57
+ "supertest": "6.3.3",
58
+ "ts-jest": "29.1.0",
59
+ "ts-node": "10.9.1",
60
+ "tsc-watch": "6.0.4",
61
+ "tsconfig-paths": "4.2.0",
62
+ "tslint": "5.20.1",
63
+ "typescript": "^5.5.4"
64
+ },
65
+ "jest": {
66
+ "moduleFileExtensions": [
67
+ "js",
68
+ "json",
69
+ "ts"
70
+ ],
71
+ "rootDir": "src",
72
+ "testRegex": ".spec.ts$",
73
+ "transform": {
74
+ "^.+\\.(t|j)s$": "ts-jest"
75
+ },
76
+ "coverageDirectory": "../coverage",
77
+ "testEnvironment": "node"
78
+ }
79
+ }