@gus-eip/loggers 4.2.8 → 4.3.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.
|
@@ -152,7 +152,9 @@ let CloudWatchLoggerService = class CloudWatchLoggerService {
|
|
|
152
152
|
entityKey: fullLogObject.entityKey || '',
|
|
153
153
|
event: fullLogObject.event || '',
|
|
154
154
|
status,
|
|
155
|
-
message: type === 'error'
|
|
155
|
+
message: type === 'error'
|
|
156
|
+
? fullLogObject.errorMessage
|
|
157
|
+
: fullLogObject.logMessage,
|
|
156
158
|
logGroupName: this.logGroupName,
|
|
157
159
|
};
|
|
158
160
|
const sqsUrl = await ssm_utils_1.ssmUtils.getSqsUrl();
|
|
@@ -177,7 +179,7 @@ let CloudWatchLoggerService = class CloudWatchLoggerService {
|
|
|
177
179
|
}
|
|
178
180
|
}
|
|
179
181
|
async sendNotificationtoTeams(title, summary, handler, logStreamName, isFormattingRequired = true, type) {
|
|
180
|
-
console.log('Notification
|
|
182
|
+
console.log('Notification Summary : ', summary);
|
|
181
183
|
const webhookUrl = this.teamWebhookUrl;
|
|
182
184
|
const timestamp = new Date().toISOString();
|
|
183
185
|
let headers;
|
|
@@ -199,40 +201,115 @@ let CloudWatchLoggerService = class CloudWatchLoggerService {
|
|
|
199
201
|
: typeof summary === 'object'
|
|
200
202
|
? JSON.stringify(summary)
|
|
201
203
|
: summary;
|
|
202
|
-
const
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
204
|
+
const awsLogUrl = `https://eu-west-1.console.aws.amazon.com/cloudwatch/home?region=eu-west-1#logsV2:log-groups/log-group/${this.logGroupName}/log-events/${logStreamName}`;
|
|
205
|
+
const isPowerAutomate = webhookUrl.includes('powerautomate');
|
|
206
|
+
console.log('isPowerAutomate', isPowerAutomate);
|
|
207
|
+
const alertMessage = isPowerAutomate
|
|
208
|
+
? {
|
|
209
|
+
attachments: [
|
|
210
|
+
{
|
|
211
|
+
contentType: 'application/vnd.microsoft.card.adaptive',
|
|
212
|
+
content: {
|
|
213
|
+
type: 'AdaptiveCard',
|
|
214
|
+
version: '1.4',
|
|
215
|
+
body: [
|
|
216
|
+
{
|
|
217
|
+
type: 'TextBlock',
|
|
218
|
+
text: `🚨 ${title} 🚨`,
|
|
219
|
+
weight: 'Bolder',
|
|
220
|
+
size: 'Large',
|
|
221
|
+
color: type === 'Error'
|
|
222
|
+
? 'Attention'
|
|
223
|
+
: type === 'Warning'
|
|
224
|
+
? 'Warning'
|
|
225
|
+
: 'Good',
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
type: 'TextBlock',
|
|
229
|
+
text: `Handler: ${handler}`,
|
|
230
|
+
wrap: true,
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
type: 'TextBlock',
|
|
234
|
+
text: `Timestamp: ${timestamp}`,
|
|
235
|
+
wrap: true,
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
type: 'TextBlock',
|
|
239
|
+
text: `Type: ${type}`,
|
|
240
|
+
wrap: true,
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
type: 'Container',
|
|
244
|
+
items: summary.map((item) => ({
|
|
245
|
+
type: 'Container',
|
|
246
|
+
items: Object.entries(item).map(([key, value]) => ({
|
|
247
|
+
type: 'ColumnSet',
|
|
248
|
+
columns: [
|
|
249
|
+
{
|
|
250
|
+
type: 'Column',
|
|
251
|
+
width: 'auto',
|
|
252
|
+
items: [
|
|
253
|
+
{
|
|
254
|
+
type: 'TextBlock',
|
|
255
|
+
text: key,
|
|
256
|
+
weight: 'Bolder',
|
|
257
|
+
wrap: true,
|
|
258
|
+
},
|
|
259
|
+
],
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
type: 'Column',
|
|
263
|
+
width: 'stretch',
|
|
264
|
+
items: [
|
|
265
|
+
{
|
|
266
|
+
type: 'TextBlock',
|
|
267
|
+
text: typeof value === 'object'
|
|
268
|
+
? JSON.stringify(value, null, 2)
|
|
269
|
+
: String(value !== null && value !== void 0 ? value : ''),
|
|
270
|
+
wrap: true,
|
|
271
|
+
},
|
|
272
|
+
],
|
|
273
|
+
},
|
|
274
|
+
],
|
|
275
|
+
})),
|
|
276
|
+
separator: true,
|
|
277
|
+
})),
|
|
278
|
+
},
|
|
279
|
+
],
|
|
280
|
+
actions: [
|
|
281
|
+
{
|
|
282
|
+
type: 'Action.OpenUrl',
|
|
283
|
+
title: '🔍 View AWS Logs',
|
|
284
|
+
url: awsLogUrl,
|
|
285
|
+
},
|
|
286
|
+
],
|
|
230
287
|
},
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
288
|
+
},
|
|
289
|
+
],
|
|
290
|
+
}
|
|
291
|
+
: {
|
|
292
|
+
'@type': 'MessageCard',
|
|
293
|
+
'@context': 'http://schema.org/extensions',
|
|
294
|
+
summary: 'System Alert',
|
|
295
|
+
themeColor: 'FF0000',
|
|
296
|
+
title: `🚨 ${title} 🚨`,
|
|
297
|
+
sections: [
|
|
298
|
+
{
|
|
299
|
+
facts: [
|
|
300
|
+
{ name: 'summary:', value: summaryMsg },
|
|
301
|
+
{ name: 'component:', value: handler },
|
|
302
|
+
{ name: 'timestamp:', value: timestamp },
|
|
303
|
+
{ name: 'type:', value: type },
|
|
304
|
+
{
|
|
305
|
+
name: '',
|
|
306
|
+
value: `[Click here for more details](${awsLogUrl})`,
|
|
307
|
+
},
|
|
308
|
+
],
|
|
309
|
+
markdown: true,
|
|
310
|
+
},
|
|
311
|
+
],
|
|
312
|
+
};
|
|
236
313
|
try {
|
|
237
314
|
await axios_1.default.post(webhookUrl, alertMessage, {
|
|
238
315
|
headers: {
|
package/dist/enum.d.ts
CHANGED
|
@@ -625,6 +625,13 @@ export declare class LoggerEnum {
|
|
|
625
625
|
WEBINAR_RECORDING_COMPLETED: string;
|
|
626
626
|
ZOOM_WEBINAR_EVENT_RECEIVED: string;
|
|
627
627
|
ZOOM_WEBHOOK_URL_VALIDATION: string;
|
|
628
|
+
DISCIPLINARY_HISTORY: string;
|
|
629
|
+
FINANCIALS_DECLARATION: string;
|
|
630
|
+
LETTER_OF_RECOMMENDATION: string;
|
|
631
|
+
PROGRAM_SELECTION: string;
|
|
632
|
+
STATEMENT_OF_PURPOSE: string;
|
|
633
|
+
SUPPLEMENTAL_QUESTIONS: string;
|
|
634
|
+
TEST_SCORES: string;
|
|
628
635
|
};
|
|
629
636
|
Component: {
|
|
630
637
|
OAP_FRONTEND: string;
|
package/dist/enum.js
CHANGED
|
@@ -636,6 +636,13 @@ let LoggerEnum = class LoggerEnum {
|
|
|
636
636
|
WEBINAR_RECORDING_COMPLETED: 'WEBINAR_RECORDING_COMPLETED',
|
|
637
637
|
ZOOM_WEBINAR_EVENT_RECEIVED: 'ZOOM_WEBINAR_EVENT_RECEIVED',
|
|
638
638
|
ZOOM_WEBHOOK_URL_VALIDATION: 'ZOOM_WEBHOOK_URL_VALIDATION',
|
|
639
|
+
DISCIPLINARY_HISTORY: 'SAVE_DISCIPLINARY_HISTORY_DETAILS',
|
|
640
|
+
FINANCIALS_DECLARATION: 'SAVE_FINANCIALS_DECLARATION_DETAILS',
|
|
641
|
+
LETTER_OF_RECOMMENDATION: 'SAVE_LETTER_OF_RECOMMENDATION_DETAILS',
|
|
642
|
+
PROGRAM_SELECTION: 'SAVE_PROGRAM_SELECTION_DETAILS',
|
|
643
|
+
STATEMENT_OF_PURPOSE: 'SAVE_STATEMENT_OF_PURPOSE_DETAILS',
|
|
644
|
+
SUPPLEMENTAL_QUESTIONS: 'SAVE_SUPPLEMENTAL_QUESTIONS_DETAILS',
|
|
645
|
+
TEST_SCORES: 'SAVE_TEST_SCORES_DETAILS'
|
|
639
646
|
};
|
|
640
647
|
this.Component = {
|
|
641
648
|
OAP_FRONTEND: 'OAP-FRONTEND',
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.BRAND_USECASE_MAPPING = void 0;
|
|
4
4
|
exports.BRAND_USECASE_MAPPING = [
|
|
5
5
|
{
|
|
6
|
-
brands: ['LIM College', 'HZU', 'IBAT', 'LSBFMYR', 'UEG', 'UCW', 'UNFC', 'WUL', 'Arden University', 'ARD', 'PU'],
|
|
6
|
+
brands: ['LIM College', 'HZU', 'IBAT', 'LSBFMYR', 'UEG', 'UCW', 'UNFC', 'WUL', 'Arden University', 'ARD', 'PU', 'CUA'],
|
|
7
7
|
usecase: 'SAVE_BASIC_DETAILS',
|
|
8
8
|
source: 'OAP',
|
|
9
9
|
destination: 'GUS Salesforce',
|
|
@@ -51,7 +51,7 @@ exports.BRAND_USECASE_MAPPING = [
|
|
|
51
51
|
destination: 'GUS Salesforce',
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
|
-
brands: ['LIM College', 'HZU', 'IBAT', 'LSBFMYR', 'UNFC', 'UEG', 'UCW', 'WUL', 'Arden University', 'ARD', 'PU'],
|
|
54
|
+
brands: ['LIM College', 'HZU', 'IBAT', 'LSBFMYR', 'UNFC', 'UEG', 'UCW', 'WUL', 'Arden University', 'ARD', 'PU', 'CUA'],
|
|
55
55
|
usecase: 'SUBMIT_APPLICATION',
|
|
56
56
|
source: 'OAP',
|
|
57
57
|
destination: 'GUS Salesforce',
|
|
@@ -75,7 +75,7 @@ exports.BRAND_USECASE_MAPPING = [
|
|
|
75
75
|
destination: 'GUS Salesforce',
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
|
-
brands: ['UCW', 'UNFC', 'LSBFMYR', 'UEG'],
|
|
78
|
+
brands: ['UCW', 'UNFC', 'LSBFMYR', 'UEG', 'CUA'],
|
|
79
79
|
usecase: 'SAVE_EDUCATION_HISTORY_DETAILS',
|
|
80
80
|
source: 'OAP',
|
|
81
81
|
destination: 'GUS Salesforce',
|
|
@@ -87,7 +87,7 @@ exports.BRAND_USECASE_MAPPING = [
|
|
|
87
87
|
destination: 'GUS Salesforce',
|
|
88
88
|
},
|
|
89
89
|
{
|
|
90
|
-
brands: ['UCW', 'LIM College', 'UEG'],
|
|
90
|
+
brands: ['UCW', 'LIM College', 'UEG', 'CUA'],
|
|
91
91
|
usecase: 'SAVE_EMPLOYMENT_HISTORY_DETAILS',
|
|
92
92
|
source: 'OAP',
|
|
93
93
|
destination: 'GUS Salesforce',
|
|
@@ -194,6 +194,48 @@ exports.BRAND_USECASE_MAPPING = [
|
|
|
194
194
|
source: 'OAP',
|
|
195
195
|
destination: 'GUS Salesforce',
|
|
196
196
|
},
|
|
197
|
+
{
|
|
198
|
+
brands: ['CUA'],
|
|
199
|
+
usecase: 'SAVE_DISCIPLINARY_HISTORY_DETAILS',
|
|
200
|
+
source: 'OAP',
|
|
201
|
+
destination: 'GUS Salesforce',
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
brands: ['CUA'],
|
|
205
|
+
usecase: 'SAVE_FINANCIALS_DECLARATION_DETAILS',
|
|
206
|
+
source: 'OAP',
|
|
207
|
+
destination: 'GUS Salesforce',
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
brands: ['CUA'],
|
|
211
|
+
usecase: 'SAVE_LETTER_OF_RECOMMENDATION_DETAILS',
|
|
212
|
+
source: 'OAP',
|
|
213
|
+
destination: 'GUS Salesforce',
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
brands: ['CUA'],
|
|
217
|
+
usecase: 'SAVE_PROGRAM_SELECTION_DETAILS',
|
|
218
|
+
source: 'OAP',
|
|
219
|
+
destination: 'GUS Salesforce',
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
brands: ['CUA'],
|
|
223
|
+
usecase: 'SAVE_STATEMENT_OF_PURPOSE_DETAILS',
|
|
224
|
+
source: 'OAP',
|
|
225
|
+
destination: 'GUS Salesforce',
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
brands: ['CUA'],
|
|
229
|
+
usecase: 'SAVE_SUPPLEMENTAL_QUESTIONS_DETAILS',
|
|
230
|
+
source: 'OAP',
|
|
231
|
+
destination: 'GUS Salesforce',
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
brands: ['CUA'],
|
|
235
|
+
usecase: 'SAVE_TEST_SCORES_DETAILS',
|
|
236
|
+
source: 'OAP',
|
|
237
|
+
destination: 'GUS Salesforce',
|
|
238
|
+
},
|
|
197
239
|
{
|
|
198
240
|
brands: ['UCW'],
|
|
199
241
|
usecase: 'SAVE_AWARDS_DETAILS',
|
|
@@ -807,7 +849,7 @@ exports.BRAND_USECASE_MAPPING = [
|
|
|
807
849
|
destination: 'GUS Salesforce',
|
|
808
850
|
},
|
|
809
851
|
{
|
|
810
|
-
brands: ['WUL'],
|
|
852
|
+
brands: ['WUL', 'CUA'],
|
|
811
853
|
usecase: 'SAVE_PERSONAL_BACKGROUND',
|
|
812
854
|
source: 'OAP',
|
|
813
855
|
destination: 'GUS Salesforce',
|
|
@@ -101,6 +101,13 @@ export declare enum UsecaseMapping {
|
|
|
101
101
|
SAVE_RECOMMENDATIONS = "Save Recommendations",
|
|
102
102
|
SAVE_STUDENT_ACCESSIBILITY_AND_DECLARATIONS = "Save Student Accessibility and Declarations",
|
|
103
103
|
SAVE_EXPERIENCE = "Save Experience",
|
|
104
|
+
SAVE_DISCIPLINARY_HISTORY_DETAILS = "Save Disciplinary History Details",
|
|
105
|
+
SAVE_FINANCIALS_DECLARATION_DETAILS = "Save Financials Declaration Details",
|
|
106
|
+
SAVE_LETTER_OF_RECOMMENDATION_DETAILS = "Save Letter Of Recommendtaion Details",
|
|
107
|
+
SAVE_PROGRAM_SELECTION_DETAILS = "Save Program Selection Details",
|
|
108
|
+
SAVE_STATEMENT_OF_PURPOSE_DETAILS = "Save Statement Of Purpose Details",
|
|
109
|
+
SAVE_SUPPLEMENTAL_QUESTIONS_DETAILS = "Save Supplemental Questions Details",
|
|
110
|
+
SAVE_TEST_SCORES_DETAILS = "Save Test Scores Details",
|
|
104
111
|
ULAW_LEAD_CREATE = "Lead Creation",
|
|
105
112
|
ULAW_LEAD_UPDATE = "Lead Update",
|
|
106
113
|
ULAW_APPLICATION = "New Application",
|
|
@@ -105,6 +105,13 @@ var UsecaseMapping;
|
|
|
105
105
|
UsecaseMapping["SAVE_RECOMMENDATIONS"] = "Save Recommendations";
|
|
106
106
|
UsecaseMapping["SAVE_STUDENT_ACCESSIBILITY_AND_DECLARATIONS"] = "Save Student Accessibility and Declarations";
|
|
107
107
|
UsecaseMapping["SAVE_EXPERIENCE"] = "Save Experience";
|
|
108
|
+
UsecaseMapping["SAVE_DISCIPLINARY_HISTORY_DETAILS"] = "Save Disciplinary History Details";
|
|
109
|
+
UsecaseMapping["SAVE_FINANCIALS_DECLARATION_DETAILS"] = "Save Financials Declaration Details";
|
|
110
|
+
UsecaseMapping["SAVE_LETTER_OF_RECOMMENDATION_DETAILS"] = "Save Letter Of Recommendtaion Details";
|
|
111
|
+
UsecaseMapping["SAVE_PROGRAM_SELECTION_DETAILS"] = "Save Program Selection Details";
|
|
112
|
+
UsecaseMapping["SAVE_STATEMENT_OF_PURPOSE_DETAILS"] = "Save Statement Of Purpose Details";
|
|
113
|
+
UsecaseMapping["SAVE_SUPPLEMENTAL_QUESTIONS_DETAILS"] = "Save Supplemental Questions Details";
|
|
114
|
+
UsecaseMapping["SAVE_TEST_SCORES_DETAILS"] = "Save Test Scores Details";
|
|
108
115
|
UsecaseMapping["ULAW_LEAD_CREATE"] = "Lead Creation";
|
|
109
116
|
UsecaseMapping["ULAW_LEAD_UPDATE"] = "Lead Update";
|
|
110
117
|
UsecaseMapping["ULAW_APPLICATION"] = "New Application";
|
package/package.json
CHANGED