@optimiser/common 1.0.360 → 1.0.362
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/lib/event.js +13 -8
- package/dist/lib/utility.js +2 -2
- package/package.json +1 -1
package/dist/lib/event.js
CHANGED
|
@@ -129,7 +129,7 @@ var Event = /** @class */ (function () {
|
|
|
129
129
|
return [3 /*break*/, 6];
|
|
130
130
|
case 6: return [3 /*break*/, 8];
|
|
131
131
|
case 7:
|
|
132
|
-
console.log('
|
|
132
|
+
console.log('Attention!!-- We are not sending mobile notifications due to lack of FIREBASE ADMIN APP configurations.\n Please provide firebaseSet-up.JSON file.');
|
|
133
133
|
_a.label = 8;
|
|
134
134
|
case 8:
|
|
135
135
|
// if (userId && data.SocketObj && !data.SocketObj.userId) {
|
|
@@ -228,14 +228,19 @@ var Event = /** @class */ (function () {
|
|
|
228
228
|
accessKeyId: eventConfig.SQS_ACCESSKEY_ID,
|
|
229
229
|
secretAccessKey: eventConfig.SQS_SECRET_KEY
|
|
230
230
|
});
|
|
231
|
-
this.FCMMobileServiceAccountKey = eventConfig.FCM_NOTIFICATION_SERVICE_ACCOUNT_KEY;
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
231
|
+
this.FCMMobileServiceAccountKey = eventConfig === null || eventConfig === void 0 ? void 0 : eventConfig.FCM_NOTIFICATION_SERVICE_ACCOUNT_KEY;
|
|
232
|
+
if (eventConfig === null || eventConfig === void 0 ? void 0 : eventConfig.FCM_NOTIFICATION_SERVICE_ACCOUNT_KEY) { // scope added by komal, to handle the firebase warning,
|
|
233
|
+
try {
|
|
234
|
+
admin.initializeApp({
|
|
235
|
+
credential: admin.credential.cert(this.FCMMobileServiceAccountKey)
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
catch (error) {
|
|
239
|
+
console.log('Error while INITIALIZING FIREBASE ADMIN APP\n Please check firebaseSet-up.JSON file.\n This will impact mobile app notifications -----', error);
|
|
240
|
+
}
|
|
236
241
|
}
|
|
237
|
-
|
|
238
|
-
console.log('
|
|
242
|
+
else {
|
|
243
|
+
console.log('We are not INITIALIZING mobile notifications due to lack of FIREBASE ADMIN APP configurations.\n Please provide firebaseSet-up.JSON file.');
|
|
239
244
|
}
|
|
240
245
|
}
|
|
241
246
|
return Event;
|
package/dist/lib/utility.js
CHANGED
|
@@ -4544,7 +4544,7 @@ function CapitalizeFirstLetter(str) {
|
|
|
4544
4544
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
4545
4545
|
}
|
|
4546
4546
|
function EmailValidation(elmValue) {
|
|
4547
|
-
var filter = /^([
|
|
4547
|
+
var filter = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@(([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,})$/;
|
|
4548
4548
|
if (filter.test(elmValue)) {
|
|
4549
4549
|
return true;
|
|
4550
4550
|
}
|
|
@@ -4854,7 +4854,7 @@ function ValidateUserInput(options) {
|
|
|
4854
4854
|
return [3 /*break*/, 54];
|
|
4855
4855
|
case 7:
|
|
4856
4856
|
{
|
|
4857
|
-
filter = /^([
|
|
4857
|
+
filter = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@(([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,})$/;
|
|
4858
4858
|
if (!filter.test(fieldData)) {
|
|
4859
4859
|
msg = fieldData + ' is invalid email for ' + field.DisplayName + '!';
|
|
4860
4860
|
}
|