kwikid-forms 0.6.35 → 0.6.36
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/bundles/kwikid-forms.umd.js +10 -23
- package/bundles/kwikid-forms.umd.js.map +1 -1
- package/esm2015/lib/renderer/config-converter/config-converter.helper.js +11 -7
- package/esm2015/lib/renderer/form-view/form-view.api.service.js +1 -19
- package/fesm2015/kwikid-forms.js +10 -23
- package/fesm2015/kwikid-forms.js.map +1 -1
- package/package.json +2 -2
|
@@ -1318,21 +1318,26 @@
|
|
|
1318
1318
|
};
|
|
1319
1319
|
var getMinDate = function (field) {
|
|
1320
1320
|
if (kwikidToolkit.checkObjectKeyExists(field, "min")) {
|
|
1321
|
+
/**
|
|
1322
|
+
* This is to handler old version of config.
|
|
1323
|
+
* Please don't add "min" at field level, add it insider field.properties only.
|
|
1324
|
+
*/
|
|
1321
1325
|
return convertFormFieldTypeDateToKwikUIFormat(field["min"]);
|
|
1322
1326
|
}
|
|
1323
1327
|
else {
|
|
1324
|
-
return
|
|
1328
|
+
return {};
|
|
1325
1329
|
}
|
|
1326
1330
|
};
|
|
1327
1331
|
var getMaxDate = function (field) {
|
|
1328
1332
|
if (kwikidToolkit.checkObjectKeyExists(field, "max")) {
|
|
1333
|
+
/**
|
|
1334
|
+
* This is to handler old version of config.
|
|
1335
|
+
* Please don't add "max" at field level, add it insider field.properties only.
|
|
1336
|
+
*/
|
|
1329
1337
|
return convertFormFieldTypeDateToKwikUIFormat(field["max"]);
|
|
1330
1338
|
}
|
|
1331
1339
|
else {
|
|
1332
|
-
return
|
|
1333
|
-
new Date().getMonth(), // Month - 11 (0 Indexing)
|
|
1334
|
-
new Date().getDate() // Day - 31
|
|
1335
|
-
);
|
|
1340
|
+
return {};
|
|
1336
1341
|
}
|
|
1337
1342
|
};
|
|
1338
1343
|
var updateLanguage = function (object, language) {
|
|
@@ -3286,26 +3291,20 @@
|
|
|
3286
3291
|
// Function to verify the signature
|
|
3287
3292
|
KwikIDFormViewApiService.prototype.verifySignature = function (data, header, url, isVerifySignature) {
|
|
3288
3293
|
return new Promise(function (resolve, reject) {
|
|
3289
|
-
// Log the function call for verification
|
|
3290
|
-
console.log("Verify Signature: Function Called For", url, header);
|
|
3291
3294
|
// Check if the signature is disabled
|
|
3292
3295
|
if (!isVerifySignature) {
|
|
3293
|
-
console.log("Verify Signature: Authentication Disabled");
|
|
3294
3296
|
resolve(true);
|
|
3295
3297
|
}
|
|
3296
3298
|
// Check if data is invalid
|
|
3297
3299
|
else if (!data) {
|
|
3298
|
-
console.log("Verify Signature: Data Not Available");
|
|
3299
3300
|
resolve(true);
|
|
3300
3301
|
}
|
|
3301
3302
|
// Check if the signature is missing in headers when authentication is not skipped
|
|
3302
3303
|
else if (isVerifySignature && header && !(header === null || header === void 0 ? void 0 : header.sig)) {
|
|
3303
|
-
console.log("Verify Signature Failure: Signature Not Present in Headers");
|
|
3304
3304
|
reject(false);
|
|
3305
3305
|
}
|
|
3306
3306
|
// Verify the signature when public key and header with signature are present and authentication is not skipped
|
|
3307
3307
|
else if (isVerifySignature && header && (header === null || header === void 0 ? void 0 : header.sig)) {
|
|
3308
|
-
console.log("Verify Signature: Signature Present in Headers");
|
|
3309
3308
|
// Extract the signature and decode it
|
|
3310
3309
|
var signature = header.sig.split(".")[0];
|
|
3311
3310
|
var rawSignature = atob(signature);
|
|
@@ -3320,30 +3319,22 @@
|
|
|
3320
3319
|
var dateCheck = dateValue < parseInt(exp);
|
|
3321
3320
|
// Check if the signature matches the data
|
|
3322
3321
|
var res = signature === data;
|
|
3323
|
-
console.log("Verify Signature: Matching", signature, data);
|
|
3324
|
-
console.log("Verify Signature: Time", dateValue, parseInt(exp), parseInt(exp) - dateValue);
|
|
3325
|
-
console.log("Verify Signature: Date", new Date(dateValue), new Date(parseInt(exp)));
|
|
3326
|
-
console.log("Verify Signature: Signature Converted to Required Format");
|
|
3327
3322
|
// Resolve the promise if the signature is valid and the date check passes
|
|
3328
3323
|
if (res && dateCheck) {
|
|
3329
|
-
console.log("Verify Signature Success");
|
|
3330
3324
|
resolve(res);
|
|
3331
3325
|
}
|
|
3332
3326
|
else {
|
|
3333
3327
|
// Reject the promise if the signature is invalid or the date check fails
|
|
3334
|
-
console.log("Verify Signature Failure: Signature did not match");
|
|
3335
3328
|
reject(res);
|
|
3336
3329
|
}
|
|
3337
3330
|
}
|
|
3338
3331
|
else {
|
|
3339
3332
|
// Reject the promise if the signature is not in the required format
|
|
3340
|
-
console.log("Verify Signature Failure: Signature Not Converted to Required Format");
|
|
3341
3333
|
reject(false);
|
|
3342
3334
|
}
|
|
3343
3335
|
}
|
|
3344
3336
|
else {
|
|
3345
3337
|
// Resolve the promise if the signature is missing in headers
|
|
3346
|
-
console.log("Verify Signature Failure: Signature Not Present in Headers");
|
|
3347
3338
|
resolve(true);
|
|
3348
3339
|
}
|
|
3349
3340
|
});
|
|
@@ -3380,7 +3371,6 @@
|
|
|
3380
3371
|
case 1:
|
|
3381
3372
|
decryptedResponse = _c.sent();
|
|
3382
3373
|
data = JSON.parse(decryptedResponse);
|
|
3383
|
-
console.log("Decrypted Response", data);
|
|
3384
3374
|
res.data = data;
|
|
3385
3375
|
_c.label = 2;
|
|
3386
3376
|
case 2:
|
|
@@ -3408,7 +3398,6 @@
|
|
|
3408
3398
|
case 1:
|
|
3409
3399
|
decryptedResponse = _c.sent();
|
|
3410
3400
|
data = JSON.parse(decryptedResponse);
|
|
3411
|
-
console.log("Decrypted Response", data);
|
|
3412
3401
|
err.response.data = data;
|
|
3413
3402
|
_c.label = 2;
|
|
3414
3403
|
case 2:
|
|
@@ -3454,7 +3443,6 @@
|
|
|
3454
3443
|
case 1:
|
|
3455
3444
|
decryptedResponse = _c.sent();
|
|
3456
3445
|
data = JSON.parse(decryptedResponse);
|
|
3457
|
-
console.log("Decrypted Response", data);
|
|
3458
3446
|
res.data = data;
|
|
3459
3447
|
_c.label = 2;
|
|
3460
3448
|
case 2:
|
|
@@ -3482,7 +3470,6 @@
|
|
|
3482
3470
|
case 1:
|
|
3483
3471
|
decryptedResponse = _c.sent();
|
|
3484
3472
|
data = JSON.parse(decryptedResponse);
|
|
3485
|
-
console.log("Decrypted Response", data);
|
|
3486
3473
|
err.response.data = data;
|
|
3487
3474
|
_c.label = 2;
|
|
3488
3475
|
case 2:
|