@gus-eip/loggers 4.4.7 → 4.4.8
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 +92 -92
- package/dist/mappings/source-destination-mapping.js +49 -1
- package/package.json +79 -79
package/README.md
CHANGED
|
@@ -1,92 +1,92 @@
|
|
|
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 any EIP integration (for example: `oap-handlers`, `oap-backend`, `eip-integration-handlers`, `platform-events-listener`, or `gus-middleware-service`) introduces a new use case, event, or component, follow these steps to keep this package as the single source of truth for EIP logging:
|
|
75
|
-
|
|
76
|
-
1. Add the new use case, event and component identifiers to `enum.ts`.
|
|
77
|
-
|
|
78
|
-
2. Add a user-friendly message/label for the use case in `mappings/usecase-mapping.ts`.
|
|
79
|
-
|
|
80
|
-
3. Update `mappings/source-destination-mapping.ts` to include the use case and the corresponding brand(s) with their `source` and `destination` values. If the use case already exists and a newly onboarded brand uses it, add the brand under that existing use case entry.
|
|
81
|
-
|
|
82
|
-
Notes:
|
|
83
|
-
|
|
84
|
-
- The `mappings/source-destination-mapping.ts` file is the ultimate source of truth for EIP logger routing and should accurately reflect brand → use case → (source, destination) mappings.
|
|
85
|
-
- Keep `enum.ts` identifiers stable. Prefer adding new identifiers rather than renaming existing ones to avoid breaking downstream projects.
|
|
86
|
-
|
|
87
|
-
Publishing and downstream updates:
|
|
88
|
-
|
|
89
|
-
- After making changes, bump and publish this package.
|
|
90
|
-
- Then update the dependency version used by the `gus-eip-analytics` repository: set the new package version in the `dev` branch for development deployments and in the `prod` branch for production deployments so downstream services pick up the release.
|
|
91
|
-
|
|
92
|
-
---
|
|
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 any EIP integration (for example: `oap-handlers`, `oap-backend`, `eip-integration-handlers`, `platform-events-listener`, or `gus-middleware-service`) introduces a new use case, event, or component, follow these steps to keep this package as the single source of truth for EIP logging:
|
|
75
|
+
|
|
76
|
+
1. Add the new use case, event and component identifiers to `enum.ts`.
|
|
77
|
+
|
|
78
|
+
2. Add a user-friendly message/label for the use case in `mappings/usecase-mapping.ts`.
|
|
79
|
+
|
|
80
|
+
3. Update `mappings/source-destination-mapping.ts` to include the use case and the corresponding brand(s) with their `source` and `destination` values. If the use case already exists and a newly onboarded brand uses it, add the brand under that existing use case entry.
|
|
81
|
+
|
|
82
|
+
Notes:
|
|
83
|
+
|
|
84
|
+
- The `mappings/source-destination-mapping.ts` file is the ultimate source of truth for EIP logger routing and should accurately reflect brand → use case → (source, destination) mappings.
|
|
85
|
+
- Keep `enum.ts` identifiers stable. Prefer adding new identifiers rather than renaming existing ones to avoid breaking downstream projects.
|
|
86
|
+
|
|
87
|
+
Publishing and downstream updates:
|
|
88
|
+
|
|
89
|
+
- After making changes, bump and publish this package.
|
|
90
|
+
- Then update the dependency version used by the `gus-eip-analytics` repository: set the new package version in the `dev` branch for development deployments and in the `prod` branch for production deployments so downstream services pick up the release.
|
|
91
|
+
|
|
92
|
+
---
|
|
@@ -949,5 +949,53 @@ exports.BRAND_USECASE_MAPPING = [
|
|
|
949
949
|
usecase: 'SAVE_PLEDGE',
|
|
950
950
|
source: 'OAP',
|
|
951
951
|
destination: 'GUS Salesforce',
|
|
952
|
-
}
|
|
952
|
+
},
|
|
953
|
+
{
|
|
954
|
+
brands: ['SYRU'],
|
|
955
|
+
usecase: 'OFFER_STAGE',
|
|
956
|
+
source: 'SYRU SLATE',
|
|
957
|
+
destination: 'GUS Salesforce',
|
|
958
|
+
},
|
|
959
|
+
{
|
|
960
|
+
brands: ['SYRU'],
|
|
961
|
+
usecase: 'REJECT_DOCUMENT',
|
|
962
|
+
source: 'SYRU SLATE',
|
|
963
|
+
destination: 'GUS Salesforce',
|
|
964
|
+
},
|
|
965
|
+
{
|
|
966
|
+
brands: ['SYRU'],
|
|
967
|
+
usecase: 'PAYMENT_RECEIVED',
|
|
968
|
+
source: 'SYRU SLATE',
|
|
969
|
+
destination: 'GUS Salesforce',
|
|
970
|
+
},
|
|
971
|
+
{
|
|
972
|
+
brands: ['SYRU'],
|
|
973
|
+
usecase: 'VISA_STATUS_UPDATE',
|
|
974
|
+
source: 'SYRU SLATE',
|
|
975
|
+
destination: 'GUS Salesforce',
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
brands: ['SYRU'],
|
|
979
|
+
usecase: 'CLOSED_LOST_STAGE',
|
|
980
|
+
source: 'SYRU SLATE',
|
|
981
|
+
destination: 'GUS Salesforce',
|
|
982
|
+
},
|
|
983
|
+
{
|
|
984
|
+
brands: ['SYRU'],
|
|
985
|
+
usecase: 'APPLICATION_INTAKE_CHANGE',
|
|
986
|
+
source: 'SYRU SLATE',
|
|
987
|
+
destination: 'GUS Salesforce',
|
|
988
|
+
},
|
|
989
|
+
{
|
|
990
|
+
brands: ['SYRU'],
|
|
991
|
+
usecase: 'ADDITIONAL_INFORMATION_REQUIRED',
|
|
992
|
+
source: 'SYRU SLATE',
|
|
993
|
+
destination: 'GUS Salesforce',
|
|
994
|
+
},
|
|
995
|
+
{
|
|
996
|
+
brands: ['SYRU'],
|
|
997
|
+
usecase: 'ADDITIONAL_DOCUMENTS_REQUIRED',
|
|
998
|
+
source: 'SYRU SLATE',
|
|
999
|
+
destination: 'GUS Salesforce',
|
|
1000
|
+
},
|
|
953
1001
|
];
|
package/package.json
CHANGED
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@gus-eip/loggers",
|
|
3
|
-
"version": "4.4.
|
|
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.4.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
|
+
}
|