@gus-eip/loggers 3.7.4 → 3.7.6
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/cloudwatch.logger.d.ts +2 -2
- package/dist/cloudwatch.logger.js +9 -5
- package/dist/enum.d.ts +5 -0
- package/dist/enum.js +5 -0
- package/package.json +1 -1
@@ -11,8 +11,8 @@ export declare class CloudWatchLoggerService implements ILogger {
|
|
11
11
|
logToCloudWatch(type: string, logObject: any, logStreamName: string): Promise<void>;
|
12
12
|
logStreamExists(logStreamName: string): Promise<boolean>;
|
13
13
|
sendAlerttoTeams(errorMessage: any, errorStack: any, handler: any, input: any, logStreamName: any): Promise<any>;
|
14
|
-
sendNotificationtoTeams(title: any, summary: any, handler: any, logStreamName: any, isFormattingRequired
|
14
|
+
sendNotificationtoTeams(title: any, summary: any, handler: any, logStreamName: any, isFormattingRequired: boolean, type: any): Promise<any>;
|
15
15
|
log(correlationId: string, timestamp: string, component: string, source: string, destination: string, event: string, usecase: string, sourcePayload: any, destinationPayload: any, logMessage: any, brand: any, secondaryKey: string, logStreamName: string, entityKeyField: string, entityKey: string, destinationObjectType?: string, destinationObjectId?: string, sourceObjectType?: string, sourceObjectId?: string, destinationResponse?: any): Promise<any>;
|
16
16
|
error(correlationId: string, timestamp: string, component: string, source: string, destination: string, event: string, usecase: string, sourcePayload: any, destinationPayload: any, errorMessage: any, brand: any, secondaryKey: string, logStreamName: string, entityKeyField: string, entityKey: string, destinationObjectType?: string, destinationObjectId?: string, sourceObjectType?: string, sourceObjectId?: string, destinationResponse?: any): Promise<any>;
|
17
|
-
logAlert(correlationId: string, timestamp: string, component: string, source: string, destination: string, event: string, usecase: string, sourcePayload: any, destinationPayload: any, logMessage: any, brand: any, secondaryKey: string, logStreamName: string, isAlertFormattingRequired?: boolean, destinationObjectType?: string, destinationObjectId?: string, sourceObjectType?: string, sourceObjectId?: string, destinationResponse?: any): Promise<any>;
|
17
|
+
logAlert(correlationId: string, timestamp: string, component: string, source: string, destination: string, event: string, usecase: string, sourcePayload: any, destinationPayload: any, logMessage: any, brand: any, secondaryKey: string, logStreamName: string, isAlertFormattingRequired?: boolean, type?: 'INFO' | 'Error', destinationObjectType?: string, destinationObjectId?: string, sourceObjectType?: string, sourceObjectId?: string, destinationResponse?: any): Promise<any>;
|
18
18
|
}
|
@@ -136,7 +136,7 @@ let CloudWatchLoggerService = class CloudWatchLoggerService {
|
|
136
136
|
console.error('Error sending message:', error);
|
137
137
|
}
|
138
138
|
}
|
139
|
-
async sendNotificationtoTeams(title, summary, handler, logStreamName, isFormattingRequired = true) {
|
139
|
+
async sendNotificationtoTeams(title, summary, handler, logStreamName, isFormattingRequired = true, type) {
|
140
140
|
console.log('Notification summary', summary);
|
141
141
|
const webhookUrl = this.teamWebhookUrl;
|
142
142
|
const timestamp = new Date().toISOString();
|
@@ -180,6 +180,10 @@ let CloudWatchLoggerService = class CloudWatchLoggerService {
|
|
180
180
|
name: 'timestamp:',
|
181
181
|
value: timestamp,
|
182
182
|
},
|
183
|
+
{
|
184
|
+
name: 'type:',
|
185
|
+
value: type,
|
186
|
+
},
|
183
187
|
{
|
184
188
|
name: '',
|
185
189
|
value: `[Click here for more details](https://eu-west-1.console.aws.amazon.com/cloudwatch/home?region=eu-west-1#logsV2:log-groups/log-group/${this.logGroupName}/log-events/${logStreamName})`,
|
@@ -254,11 +258,11 @@ let CloudWatchLoggerService = class CloudWatchLoggerService {
|
|
254
258
|
await this.sendAlerttoTeams(errorMessage.message ? errorMessage.message : errorMessage, errorMessage.stack ? errorMessage.stack : errorMessage, component, logObject, encodeURIComponent(logStreamName));
|
255
259
|
}
|
256
260
|
}
|
257
|
-
async logAlert(correlationId, timestamp, component, source, destination, event, usecase, sourcePayload, destinationPayload, logMessage, brand, secondaryKey, logStreamName, isAlertFormattingRequired, destinationObjectType, destinationObjectId, sourceObjectType, sourceObjectId, destinationResponse) {
|
261
|
+
async logAlert(correlationId, timestamp, component, source, destination, event, usecase, sourcePayload, destinationPayload, logMessage, brand, secondaryKey, logStreamName, isAlertFormattingRequired, type, destinationObjectType, destinationObjectId, sourceObjectType, sourceObjectId, destinationResponse) {
|
258
262
|
const logObject = {
|
259
263
|
correlationId,
|
260
264
|
timestamp,
|
261
|
-
type: 'INFO',
|
265
|
+
type: type !== null && type !== void 0 ? type : 'INFO',
|
262
266
|
component,
|
263
267
|
source,
|
264
268
|
destination,
|
@@ -275,9 +279,9 @@ let CloudWatchLoggerService = class CloudWatchLoggerService {
|
|
275
279
|
sourceObjectId,
|
276
280
|
destinationResponse,
|
277
281
|
};
|
278
|
-
await this.logToCloudWatch('info', logObject, logStreamName);
|
282
|
+
await this.logToCloudWatch((type !== null && type !== void 0 ? type : 'info').toLowerCase(), logObject, logStreamName);
|
279
283
|
if (this.isAlertNeeded) {
|
280
|
-
await this.sendNotificationtoTeams(logMessage, destinationPayload, component, encodeURIComponent(logStreamName), isAlertFormattingRequired);
|
284
|
+
await this.sendNotificationtoTeams(logMessage, destinationPayload, component, encodeURIComponent(logStreamName), isAlertFormattingRequired, (type !== null && type !== void 0 ? type : 'info').toLowerCase());
|
281
285
|
}
|
282
286
|
}
|
283
287
|
};
|
package/dist/enum.d.ts
CHANGED
@@ -213,6 +213,8 @@ export declare class LoggerEnum {
|
|
213
213
|
GET_EN_TEST_CERT_VALIDATION: string;
|
214
214
|
FETCH_EN_TEST_CERT_VALIDATION_INITIATED: string;
|
215
215
|
CREATE_LOG_KYB_KYC_INTEGRATION_SERVICE_SUMMARY: string;
|
216
|
+
FETCH_PROFICIENCY_QUALIFICATION_TEST_PROVIDER_AUTH_CREDS: string;
|
217
|
+
UPDATE_PROFICIENCY_QUALIFICATION_TEST_PROVIDER_AUTH_CREDS: string;
|
216
218
|
};
|
217
219
|
UseCase: {
|
218
220
|
PROGRAM_INFO: string;
|
@@ -266,6 +268,8 @@ export declare class LoggerEnum {
|
|
266
268
|
NOTIFICATION_AGENT_TASK_CANCEL: string;
|
267
269
|
CERT_VALIDATION: string;
|
268
270
|
KYB_KYC_SUMMARY: string;
|
271
|
+
SAVE_AUTH_CREDS: string;
|
272
|
+
LIST_AUTH_CREDS: string;
|
269
273
|
};
|
270
274
|
Component: {
|
271
275
|
OAP_FRONTEND: string;
|
@@ -298,5 +302,6 @@ export declare class LoggerEnum {
|
|
298
302
|
GUS_KYB_KYC_ALERTING_JOB_SCHEDULER: string;
|
299
303
|
GUS_KYB_KYC_ALERTING_JOB_HANDLER: string;
|
300
304
|
CLOUDWATCH_LOGS: string;
|
305
|
+
OAP_ADMIN_PORTAL: string;
|
301
306
|
};
|
302
307
|
}
|
package/dist/enum.js
CHANGED
@@ -224,6 +224,8 @@ let LoggerEnum = class LoggerEnum {
|
|
224
224
|
GET_EN_TEST_CERT_VALIDATION: 'GET_EN_TEST_CERT_VALIDATION',
|
225
225
|
FETCH_EN_TEST_CERT_VALIDATION_INITIATED: 'FETCH_EN_TEST_CERT_VALIDATION_INITIATED',
|
226
226
|
CREATE_LOG_KYB_KYC_INTEGRATION_SERVICE_SUMMARY: 'CREATE_LOG_KYB_KYC_INTEGRATION_SERVICE_SUMMARY',
|
227
|
+
FETCH_PROFICIENCY_QUALIFICATION_TEST_PROVIDER_AUTH_CREDS: 'FETCH_PROFICIENCY_QUALIFICATION_TEST_PROVIDER_AUTH_CREDS',
|
228
|
+
UPDATE_PROFICIENCY_QUALIFICATION_TEST_PROVIDER_AUTH_CREDS: 'UPDATE_PROFICIENCY_QUALIFICATION_TEST_PROVIDER_AUTH_CREDS'
|
227
229
|
};
|
228
230
|
this.UseCase = {
|
229
231
|
PROGRAM_INFO: 'SAVE_PROGRAMME_DETAILS',
|
@@ -277,6 +279,8 @@ let LoggerEnum = class LoggerEnum {
|
|
277
279
|
NOTIFICATION_AGENT_TASK_CANCEL: 'NOTIFICATION_AGENT_TASK_CANCEL',
|
278
280
|
CERT_VALIDATION: 'CERT_VALIDATION',
|
279
281
|
KYB_KYC_SUMMARY: 'KYB_KYC_SUMMARY',
|
282
|
+
SAVE_AUTH_CREDS: 'SAVE_AUTH_CREDS',
|
283
|
+
LIST_AUTH_CREDS: 'LIST_AUTH_CREDS'
|
280
284
|
};
|
281
285
|
this.Component = {
|
282
286
|
OAP_FRONTEND: 'OAP-FRONTEND',
|
@@ -309,6 +313,7 @@ let LoggerEnum = class LoggerEnum {
|
|
309
313
|
GUS_KYB_KYC_ALERTING_JOB_SCHEDULER: 'GUS_KYB_KYC_ALERTING_JOB_SCHEDULER',
|
310
314
|
GUS_KYB_KYC_ALERTING_JOB_HANDLER: 'GUS_KYB_KYC_ALERTING_JOB_HANDLER',
|
311
315
|
CLOUDWATCH_LOGS: 'CLOUDWATCH_LOGS',
|
316
|
+
OAP_ADMIN_PORTAL: 'OAP_ADMIN_PORTAL'
|
312
317
|
};
|
313
318
|
}
|
314
319
|
};
|
package/package.json
CHANGED