kwikid-forms 0.6.22 → 0.6.23
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/fesm2015/kwikid-forms.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate, __awaiter } from 'tslib';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { EventEmitter, Component, Input, Output, ChangeDetectionStrategy, Pipe, Inject, ViewChild, HostListener, NgModule } from '@angular/core';
|
|
4
|
-
import { checkObjectKeyExists, setValueToObjectPath, isEmptyValue, getObjectDeepCopy, logMethod, isNotEmptyValue, isObject, mergeObjects, checkObjectPathExists, setMissingKeyValue, getObjectValueFromPath, getObjectFromLocalStorage, Source, Rule, Condition, Action, PATTERNS, hasWhitespacesOnly, Validation, mergeObjectsDeep, ESourceKey, replaceString, isUndefined, isNull, isEmptyString } from 'kwikid-toolkit';
|
|
4
|
+
import { checkObjectKeyExists, setValueToObjectPath, isEmptyValue, getObjectDeepCopy, logMethod, isNotEmptyValue, isObject, mergeObjects, checkObjectPathExists, setMissingKeyValue, getObjectValueFromPath, getObjectFromLocalStorage, Source, Rule, Condition, Action, PATTERNS, hasWhitespacesOnly, Validation, mergeObjectsDeep, encryptWithAES, decryptWithAES, ESourceKey, replaceString, isUndefined, isNull, isEmptyString } from 'kwikid-toolkit';
|
|
5
5
|
import * as i2 from 'kwikui';
|
|
6
6
|
import { KwikUIModule, KwikUIPipeModule, KwikUIInputEmailModule } from 'kwikui';
|
|
7
7
|
import * as i3 from '@angular/forms';
|
|
@@ -4270,7 +4270,7 @@ class KwikIDFormViewComponent {
|
|
|
4270
4270
|
});
|
|
4271
4271
|
}
|
|
4272
4272
|
executeApiCall(api, object) {
|
|
4273
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
4273
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
4274
4274
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4275
4275
|
const apis = new Apis(object, this.takeAction.bind(this));
|
|
4276
4276
|
api = yield apis.setUrl();
|
|
@@ -4294,7 +4294,6 @@ class KwikIDFormViewComponent {
|
|
|
4294
4294
|
const url = api.request.url.value;
|
|
4295
4295
|
const method = (_d = (_c = api.request) === null || _c === void 0 ? void 0 : _c.method) !== null && _d !== void 0 ? _d : "POST";
|
|
4296
4296
|
const headers = Object.assign({ "Content-Type": "application/json" }, (((_f = (_e = api.request) === null || _e === void 0 ? void 0 : _e.headers) === null || _f === void 0 ? void 0 : _f.value) || {}));
|
|
4297
|
-
const body = (_j = (_h = (_g = api.request) === null || _g === void 0 ? void 0 : _g.body) === null || _h === void 0 ? void 0 : _h.value) !== null && _j !== void 0 ? _j : null;
|
|
4298
4297
|
if (method === "GET") {
|
|
4299
4298
|
try {
|
|
4300
4299
|
const response = yield fetch(url, {
|
|
@@ -4309,13 +4308,26 @@ class KwikIDFormViewComponent {
|
|
|
4309
4308
|
}
|
|
4310
4309
|
}
|
|
4311
4310
|
else {
|
|
4311
|
+
let body = JSON.stringify((_j = (_h = (_g = api === null || api === void 0 ? void 0 : api.request) === null || _g === void 0 ? void 0 : _g.body) === null || _h === void 0 ? void 0 : _h.value) !== null && _j !== void 0 ? _j : {});
|
|
4312
|
+
const isSecure = (_l = (_k = api === null || api === void 0 ? void 0 : api.request) === null || _k === void 0 ? void 0 : _k.body) === null || _l === void 0 ? void 0 : _l.isSecure;
|
|
4313
|
+
if (isSecure) {
|
|
4314
|
+
body = encryptWithAES(body);
|
|
4315
|
+
}
|
|
4312
4316
|
try {
|
|
4313
4317
|
const response = yield fetch(url, {
|
|
4314
4318
|
method: method,
|
|
4315
4319
|
headers: Object.assign({}, headers),
|
|
4316
|
-
body:
|
|
4320
|
+
body: body
|
|
4317
4321
|
});
|
|
4318
|
-
|
|
4322
|
+
const isSecure = (_m = api === null || api === void 0 ? void 0 : api.response) === null || _m === void 0 ? void 0 : _m.isSecure;
|
|
4323
|
+
if (isSecure) {
|
|
4324
|
+
const encryptedResponse = yield response.text();
|
|
4325
|
+
const decryptedResponse = decryptWithAES(encryptedResponse);
|
|
4326
|
+
apiCallResponse = JSON.parse(decryptedResponse);
|
|
4327
|
+
}
|
|
4328
|
+
else {
|
|
4329
|
+
apiCallResponse = yield response.json();
|
|
4330
|
+
}
|
|
4319
4331
|
apiCallResponseStatusCode = response.status;
|
|
4320
4332
|
}
|
|
4321
4333
|
catch (err) {
|