qcobjects 2.5.102-beta → 2.5.105-beta
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/VERSION +1 -1
- package/build/Class.js +1 -1
- package/build/InheritClass.js +1 -1
- package/build/MainProcess.js +1 -1
- package/build/QCObjects.js +4 -1
- package/build/index.d.ts +69 -66
- package/build/top.js +18 -5
- package/build-esbuild.js +6 -5
- package/package.json +6 -6
- package/public/browser/{index.js → QCObjects.js} +263 -260
- package/public/browser/QCObjects.js.map +7 -0
- package/public/{esm/index.mjs → cjs/QCObjects.cjs} +360 -265
- package/public/cjs/QCObjects.cjs.map +7 -0
- package/public/{cjs/index.cjs → esm/QCObjects.mjs} +2259 -2350
- package/public/esm/QCObjects.mjs.map +7 -0
- package/src/Class.ts +1 -1
- package/src/InheritClass.ts +1 -1
- package/src/MainProcess.ts +2 -2
- package/src/QCObjects.ts +1 -0
- package/src/top.ts +20 -7
- package/public/browser/index.js.map +0 -7
- package/public/cjs/index.cjs.map +0 -7
- package/public/esm/index.mjs.map +0 -7
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -5,16 +6,10 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
5
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
8
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
9
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
10
|
-
}) : x)(function(x) {
|
|
11
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
12
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
13
|
-
});
|
|
14
9
|
var __esm = (fn, res) => function __init() {
|
|
15
10
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
16
11
|
};
|
|
17
|
-
var __commonJS = (cb, mod) => function
|
|
12
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
18
13
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
19
14
|
};
|
|
20
15
|
var __export = (target, all) => {
|
|
@@ -37,6 +32,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
37
32
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
38
33
|
mod
|
|
39
34
|
));
|
|
35
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
40
36
|
|
|
41
37
|
// src/assign.ts
|
|
42
38
|
var require_assign = __commonJS({
|
|
@@ -97,7 +93,7 @@ var init_platform = __esm({
|
|
|
97
93
|
return isDeno ? deno_require(name) : ((name2) => {
|
|
98
94
|
let r;
|
|
99
95
|
try {
|
|
100
|
-
r =
|
|
96
|
+
r = require(name2);
|
|
101
97
|
} catch (e) {
|
|
102
98
|
logger.debug(`An error ocurred importing module. ${e}`);
|
|
103
99
|
r = { export: {} };
|
|
@@ -633,7 +629,7 @@ var init_InheritClass = __esm({
|
|
|
633
629
|
}
|
|
634
630
|
hierarchy() {
|
|
635
631
|
const __instance__ = this;
|
|
636
|
-
return this.
|
|
632
|
+
return this.constructor.hierarchy(__instance__);
|
|
637
633
|
}
|
|
638
634
|
append(_child) {
|
|
639
635
|
const child = _child || this.body;
|
|
@@ -951,7 +947,7 @@ var init_Class = __esm({
|
|
|
951
947
|
}
|
|
952
948
|
hierarchy() {
|
|
953
949
|
const __instance__ = this;
|
|
954
|
-
return this.getClass()
|
|
950
|
+
return this.getClass()?.hierarchy(__instance__);
|
|
955
951
|
}
|
|
956
952
|
append(_child) {
|
|
957
953
|
const child = _child || this.body;
|
|
@@ -3458,17 +3454,262 @@ var init_ComponentFactory = __esm({
|
|
|
3458
3454
|
}
|
|
3459
3455
|
});
|
|
3460
3456
|
|
|
3457
|
+
// src/Service.ts
|
|
3458
|
+
var Service, JSONService, ConfigService;
|
|
3459
|
+
var init_Service = __esm({
|
|
3460
|
+
"src/Service.ts"() {
|
|
3461
|
+
"use strict";
|
|
3462
|
+
init_basePath();
|
|
3463
|
+
init_Crypt();
|
|
3464
|
+
init_domain();
|
|
3465
|
+
init_InheritClass();
|
|
3466
|
+
init_Logger();
|
|
3467
|
+
init_Package();
|
|
3468
|
+
init_secretKey();
|
|
3469
|
+
init_CONFIG();
|
|
3470
|
+
Service = class extends InheritClass {
|
|
3471
|
+
static {
|
|
3472
|
+
__name(this, "Service");
|
|
3473
|
+
}
|
|
3474
|
+
options;
|
|
3475
|
+
withCredentials;
|
|
3476
|
+
useHTTP2;
|
|
3477
|
+
// eslint-disable-next-line no-unused-vars
|
|
3478
|
+
mockup({ request, service }) {
|
|
3479
|
+
throw new Error("Method not implemented.");
|
|
3480
|
+
}
|
|
3481
|
+
name;
|
|
3482
|
+
responseHeaders;
|
|
3483
|
+
// eslint-disable-next-line no-unused-vars
|
|
3484
|
+
local({ request, service }) {
|
|
3485
|
+
throw new Error("Method not implemented.");
|
|
3486
|
+
}
|
|
3487
|
+
kind = "rest";
|
|
3488
|
+
/* it can be rest, mockup, local */
|
|
3489
|
+
domain = _domain_;
|
|
3490
|
+
basePath = _basePath_;
|
|
3491
|
+
url = "";
|
|
3492
|
+
method = "GET";
|
|
3493
|
+
data = {};
|
|
3494
|
+
reload = false;
|
|
3495
|
+
cached = false;
|
|
3496
|
+
headers;
|
|
3497
|
+
template;
|
|
3498
|
+
// eslint-disable-next-line no-unused-vars
|
|
3499
|
+
done({ request, service }) {
|
|
3500
|
+
throw new Error("Method not implemented.");
|
|
3501
|
+
}
|
|
3502
|
+
// eslint-disable-next-line no-unused-vars
|
|
3503
|
+
fail(...args) {
|
|
3504
|
+
throw new Error("Method not implemented.");
|
|
3505
|
+
}
|
|
3506
|
+
set(name, value) {
|
|
3507
|
+
this[name] = value;
|
|
3508
|
+
}
|
|
3509
|
+
get(name, _default) {
|
|
3510
|
+
return this[name] || _default;
|
|
3511
|
+
}
|
|
3512
|
+
};
|
|
3513
|
+
JSONService = class extends Service {
|
|
3514
|
+
static {
|
|
3515
|
+
__name(this, "JSONService");
|
|
3516
|
+
}
|
|
3517
|
+
method = "GET";
|
|
3518
|
+
cached = false;
|
|
3519
|
+
headers = {
|
|
3520
|
+
"Content-Type": "application/json",
|
|
3521
|
+
"charset": "utf-8"
|
|
3522
|
+
};
|
|
3523
|
+
JSONresponse = void 0;
|
|
3524
|
+
done(result) {
|
|
3525
|
+
logger.debug("***** RECEIVED RESPONSE:");
|
|
3526
|
+
logger.debug(result.service.template);
|
|
3527
|
+
this.JSONresponse = JSON.parse(result.service.template);
|
|
3528
|
+
}
|
|
3529
|
+
};
|
|
3530
|
+
ConfigService = class extends JSONService {
|
|
3531
|
+
static {
|
|
3532
|
+
__name(this, "ConfigService");
|
|
3533
|
+
}
|
|
3534
|
+
method = "GET";
|
|
3535
|
+
cached = false;
|
|
3536
|
+
configFileName = "config.json";
|
|
3537
|
+
headers = {
|
|
3538
|
+
"Content-Type": "application/json",
|
|
3539
|
+
"charset": "utf-8"
|
|
3540
|
+
};
|
|
3541
|
+
configLoaded() {
|
|
3542
|
+
throw Error("Method not implemented.");
|
|
3543
|
+
}
|
|
3544
|
+
JSONresponse = void 0;
|
|
3545
|
+
done(result) {
|
|
3546
|
+
logger.debug("***** CONFIG LOADED:");
|
|
3547
|
+
logger.debug(result.service.template);
|
|
3548
|
+
this.JSONresponse = JSON.parse(result.service.template);
|
|
3549
|
+
if (Object.hasOwn(this.JSONresponse, "__encoded__")) {
|
|
3550
|
+
const decodedValue = _Crypt.decrypt(this.JSONresponse?.__encoded__, _secretKey);
|
|
3551
|
+
this.JSONresponse = JSON.parse(decodedValue);
|
|
3552
|
+
}
|
|
3553
|
+
const jsonResponse = this.JSONresponse;
|
|
3554
|
+
Object.keys(jsonResponse).map((k) => {
|
|
3555
|
+
CONFIG.set(k, jsonResponse[k]);
|
|
3556
|
+
return k;
|
|
3557
|
+
});
|
|
3558
|
+
this.configLoaded().catch((e) => {
|
|
3559
|
+
throw new Error(`An error ocurred: ${e}`);
|
|
3560
|
+
});
|
|
3561
|
+
}
|
|
3562
|
+
fail() {
|
|
3563
|
+
this.configLoaded().catch((e) => {
|
|
3564
|
+
throw new Error(`An error ocurred: ${e}`);
|
|
3565
|
+
});
|
|
3566
|
+
}
|
|
3567
|
+
constructor() {
|
|
3568
|
+
super();
|
|
3569
|
+
this.set("url", `${this.get("basePath")}${this.get("configFileName")}`);
|
|
3570
|
+
}
|
|
3571
|
+
};
|
|
3572
|
+
Package("com.qcobjects.api", [
|
|
3573
|
+
Service
|
|
3574
|
+
]);
|
|
3575
|
+
Package("com.qcobjects.api.services", [
|
|
3576
|
+
JSONService
|
|
3577
|
+
]);
|
|
3578
|
+
Package("com.qcobjects.api.config", [
|
|
3579
|
+
ConfigService
|
|
3580
|
+
]);
|
|
3581
|
+
}
|
|
3582
|
+
});
|
|
3583
|
+
|
|
3584
|
+
// src/globalSettings.ts
|
|
3585
|
+
var GlobalSettings;
|
|
3586
|
+
var init_globalSettings = __esm({
|
|
3587
|
+
"src/globalSettings.ts"() {
|
|
3588
|
+
"use strict";
|
|
3589
|
+
init_CONFIG();
|
|
3590
|
+
init_InheritClass();
|
|
3591
|
+
init_Logger();
|
|
3592
|
+
init_Package();
|
|
3593
|
+
init_platform();
|
|
3594
|
+
init_serviceLoader();
|
|
3595
|
+
init_top();
|
|
3596
|
+
init_Service();
|
|
3597
|
+
GlobalSettings = class _GlobalSettings extends InheritClass {
|
|
3598
|
+
static {
|
|
3599
|
+
__name(this, "GlobalSettings");
|
|
3600
|
+
}
|
|
3601
|
+
static __start__() {
|
|
3602
|
+
return _GlobalSettings.instance.__start__();
|
|
3603
|
+
}
|
|
3604
|
+
_GLOBAL = {};
|
|
3605
|
+
static _instance;
|
|
3606
|
+
static get instance() {
|
|
3607
|
+
if (typeof _GlobalSettings._instance === "undefined") {
|
|
3608
|
+
_GlobalSettings._instance = new _GlobalSettings();
|
|
3609
|
+
}
|
|
3610
|
+
return _GlobalSettings._instance;
|
|
3611
|
+
}
|
|
3612
|
+
set(name, value) {
|
|
3613
|
+
this._GLOBAL[name] = value;
|
|
3614
|
+
}
|
|
3615
|
+
get(name, _default) {
|
|
3616
|
+
let _value;
|
|
3617
|
+
if (typeof this._GLOBAL[name] !== "undefined") {
|
|
3618
|
+
_value = this._GLOBAL[name];
|
|
3619
|
+
} else if (typeof _default !== "undefined") {
|
|
3620
|
+
_value = _default;
|
|
3621
|
+
}
|
|
3622
|
+
return _value;
|
|
3623
|
+
}
|
|
3624
|
+
__start__() {
|
|
3625
|
+
const __load__serviceWorker = /* @__PURE__ */ __name(function() {
|
|
3626
|
+
let _promise;
|
|
3627
|
+
if (isBrowser) {
|
|
3628
|
+
_promise = new Promise(function(resolve, reject) {
|
|
3629
|
+
if ("serviceWorker" in navigator && typeof CONFIG.get("serviceWorkerURI") !== "undefined") {
|
|
3630
|
+
CONFIG.set("serviceWorkerScope", CONFIG.get("serviceWorkerScope") ? CONFIG.get("serviceWorkerScope") : "/");
|
|
3631
|
+
navigator.serviceWorker.register(CONFIG.get("serviceWorkerURI"), {
|
|
3632
|
+
scope: CONFIG.get("serviceWorkerScope")
|
|
3633
|
+
}).then(function(registration) {
|
|
3634
|
+
logger.debug("Service Worker Registered");
|
|
3635
|
+
resolve.call(_promise, registration);
|
|
3636
|
+
}, function(registration) {
|
|
3637
|
+
logger.debug("Error registering Service Worker");
|
|
3638
|
+
reject.call(_promise, registration);
|
|
3639
|
+
});
|
|
3640
|
+
navigator.serviceWorker.ready.then(function(registration) {
|
|
3641
|
+
logger.debug("Service Worker Ready");
|
|
3642
|
+
resolve.call(_promise, registration);
|
|
3643
|
+
}, function(registration) {
|
|
3644
|
+
logger.debug("Error loading Service Worker");
|
|
3645
|
+
reject.call(_promise, registration);
|
|
3646
|
+
});
|
|
3647
|
+
}
|
|
3648
|
+
});
|
|
3649
|
+
} else {
|
|
3650
|
+
_promise = Promise.resolve();
|
|
3651
|
+
}
|
|
3652
|
+
return _promise;
|
|
3653
|
+
}, "__load__serviceWorker");
|
|
3654
|
+
const _buildComponents = /* @__PURE__ */ __name(function() {
|
|
3655
|
+
return new Promise((resolve) => {
|
|
3656
|
+
if (isBrowser) {
|
|
3657
|
+
logger.debug("Starting to building components");
|
|
3658
|
+
try {
|
|
3659
|
+
buildComponentsStack();
|
|
3660
|
+
} catch (e) {
|
|
3661
|
+
throw Error(`Something went wrong trying to start components tree: ${e.message}`);
|
|
3662
|
+
}
|
|
3663
|
+
logger.debug("Initializing the service worker");
|
|
3664
|
+
__load__serviceWorker.call(_top).catch(function(e) {
|
|
3665
|
+
logger.debug(`error loading the service worker ${e}`);
|
|
3666
|
+
});
|
|
3667
|
+
}
|
|
3668
|
+
resolve();
|
|
3669
|
+
});
|
|
3670
|
+
}, "_buildComponents");
|
|
3671
|
+
return new Promise((resolve) => {
|
|
3672
|
+
logger.debug("Starting to load the config settings...");
|
|
3673
|
+
if (CONFIG.get("useConfigService", false)) {
|
|
3674
|
+
logger.debug("Loading settings using local configuration file...");
|
|
3675
|
+
setConfigService(new ConfigService());
|
|
3676
|
+
configService.configLoaded = _buildComponents;
|
|
3677
|
+
serviceLoader(configService)?.then((standardResponse) => {
|
|
3678
|
+
resolve(standardResponse);
|
|
3679
|
+
})?.catch((e) => {
|
|
3680
|
+
throw new Error(`An error ocurred while trying to load ${configService.url}: ${e}`);
|
|
3681
|
+
});
|
|
3682
|
+
} else {
|
|
3683
|
+
logger.debug("Starting to load the components...");
|
|
3684
|
+
_buildComponents.call(this).then(() => {
|
|
3685
|
+
resolve({});
|
|
3686
|
+
}).catch((e) => {
|
|
3687
|
+
throw new Error(`An error ocurred while trying to build the components stack. ${e}`);
|
|
3688
|
+
});
|
|
3689
|
+
}
|
|
3690
|
+
});
|
|
3691
|
+
}
|
|
3692
|
+
};
|
|
3693
|
+
Package("com.qcobjects", [
|
|
3694
|
+
GlobalSettings
|
|
3695
|
+
]);
|
|
3696
|
+
}
|
|
3697
|
+
});
|
|
3698
|
+
|
|
3461
3699
|
// src/top.ts
|
|
3462
|
-
var _top, componentsStack, resetTop, buildComponentsStack, configService, setConfigService;
|
|
3700
|
+
var _top, componentsStack, resetTop, buildComponentsStack, configService, setConfigService, set, get;
|
|
3463
3701
|
var init_top = __esm({
|
|
3464
3702
|
"src/top.ts"() {
|
|
3465
3703
|
"use strict";
|
|
3466
3704
|
init_ComponentFactory();
|
|
3467
|
-
|
|
3705
|
+
init_Cast();
|
|
3706
|
+
init_globalSettings();
|
|
3707
|
+
_top = typeof module !== "undefined" && typeof module.exports !== "undefined" && module.exports || typeof global !== "undefined" && global || typeof globalThis !== "undefined" && globalThis || typeof window !== "undefined" && window || typeof self !== "undefined" && self || void 0;
|
|
3468
3708
|
_top.lastCache = void 0;
|
|
3469
3709
|
componentsStack = [];
|
|
3470
|
-
resetTop = /* @__PURE__ */ __name((
|
|
3471
|
-
|
|
3710
|
+
resetTop = /* @__PURE__ */ __name(() => {
|
|
3711
|
+
const globalSettings = new GlobalSettings();
|
|
3712
|
+
_top = _CastProps(globalSettings, _top);
|
|
3472
3713
|
}, "resetTop");
|
|
3473
3714
|
buildComponentsStack = /* @__PURE__ */ __name(() => {
|
|
3474
3715
|
componentsStack = buildComponents(document);
|
|
@@ -3477,6 +3718,12 @@ var init_top = __esm({
|
|
|
3477
3718
|
_top.global.configService = _configService;
|
|
3478
3719
|
configService = _configService;
|
|
3479
3720
|
}, "setConfigService");
|
|
3721
|
+
set = /* @__PURE__ */ __name((name, value) => {
|
|
3722
|
+
_top.set(name, value);
|
|
3723
|
+
}, "set");
|
|
3724
|
+
get = /* @__PURE__ */ __name((name, _defaultValue) => {
|
|
3725
|
+
return _top.get(name, _defaultValue);
|
|
3726
|
+
}, "get");
|
|
3480
3727
|
}
|
|
3481
3728
|
});
|
|
3482
3729
|
|
|
@@ -4179,248 +4426,6 @@ var init_Import = __esm({
|
|
|
4179
4426
|
}
|
|
4180
4427
|
});
|
|
4181
4428
|
|
|
4182
|
-
// src/Service.ts
|
|
4183
|
-
var Service, JSONService, ConfigService;
|
|
4184
|
-
var init_Service = __esm({
|
|
4185
|
-
"src/Service.ts"() {
|
|
4186
|
-
"use strict";
|
|
4187
|
-
init_basePath();
|
|
4188
|
-
init_Crypt();
|
|
4189
|
-
init_domain();
|
|
4190
|
-
init_InheritClass();
|
|
4191
|
-
init_Logger();
|
|
4192
|
-
init_Package();
|
|
4193
|
-
init_secretKey();
|
|
4194
|
-
init_CONFIG();
|
|
4195
|
-
Service = class extends InheritClass {
|
|
4196
|
-
static {
|
|
4197
|
-
__name(this, "Service");
|
|
4198
|
-
}
|
|
4199
|
-
options;
|
|
4200
|
-
withCredentials;
|
|
4201
|
-
useHTTP2;
|
|
4202
|
-
// eslint-disable-next-line no-unused-vars
|
|
4203
|
-
mockup({ request, service }) {
|
|
4204
|
-
throw new Error("Method not implemented.");
|
|
4205
|
-
}
|
|
4206
|
-
name;
|
|
4207
|
-
responseHeaders;
|
|
4208
|
-
// eslint-disable-next-line no-unused-vars
|
|
4209
|
-
local({ request, service }) {
|
|
4210
|
-
throw new Error("Method not implemented.");
|
|
4211
|
-
}
|
|
4212
|
-
kind = "rest";
|
|
4213
|
-
/* it can be rest, mockup, local */
|
|
4214
|
-
domain = _domain_;
|
|
4215
|
-
basePath = _basePath_;
|
|
4216
|
-
url = "";
|
|
4217
|
-
method = "GET";
|
|
4218
|
-
data = {};
|
|
4219
|
-
reload = false;
|
|
4220
|
-
cached = false;
|
|
4221
|
-
headers;
|
|
4222
|
-
template;
|
|
4223
|
-
// eslint-disable-next-line no-unused-vars
|
|
4224
|
-
done({ request, service }) {
|
|
4225
|
-
throw new Error("Method not implemented.");
|
|
4226
|
-
}
|
|
4227
|
-
// eslint-disable-next-line no-unused-vars
|
|
4228
|
-
fail(...args) {
|
|
4229
|
-
throw new Error("Method not implemented.");
|
|
4230
|
-
}
|
|
4231
|
-
set(name, value) {
|
|
4232
|
-
this[name] = value;
|
|
4233
|
-
}
|
|
4234
|
-
get(name, _default) {
|
|
4235
|
-
return this[name] || _default;
|
|
4236
|
-
}
|
|
4237
|
-
};
|
|
4238
|
-
JSONService = class extends Service {
|
|
4239
|
-
static {
|
|
4240
|
-
__name(this, "JSONService");
|
|
4241
|
-
}
|
|
4242
|
-
method = "GET";
|
|
4243
|
-
cached = false;
|
|
4244
|
-
headers = {
|
|
4245
|
-
"Content-Type": "application/json",
|
|
4246
|
-
"charset": "utf-8"
|
|
4247
|
-
};
|
|
4248
|
-
JSONresponse = void 0;
|
|
4249
|
-
done(result) {
|
|
4250
|
-
logger.debug("***** RECEIVED RESPONSE:");
|
|
4251
|
-
logger.debug(result.service.template);
|
|
4252
|
-
this.JSONresponse = JSON.parse(result.service.template);
|
|
4253
|
-
}
|
|
4254
|
-
};
|
|
4255
|
-
ConfigService = class extends JSONService {
|
|
4256
|
-
static {
|
|
4257
|
-
__name(this, "ConfigService");
|
|
4258
|
-
}
|
|
4259
|
-
method = "GET";
|
|
4260
|
-
cached = false;
|
|
4261
|
-
configFileName = "config.json";
|
|
4262
|
-
headers = {
|
|
4263
|
-
"Content-Type": "application/json",
|
|
4264
|
-
"charset": "utf-8"
|
|
4265
|
-
};
|
|
4266
|
-
configLoaded() {
|
|
4267
|
-
throw Error("Method not implemented.");
|
|
4268
|
-
}
|
|
4269
|
-
JSONresponse = void 0;
|
|
4270
|
-
done(result) {
|
|
4271
|
-
logger.debug("***** CONFIG LOADED:");
|
|
4272
|
-
logger.debug(result.service.template);
|
|
4273
|
-
this.JSONresponse = JSON.parse(result.service.template);
|
|
4274
|
-
if (Object.hasOwn(this.JSONresponse, "__encoded__")) {
|
|
4275
|
-
const decodedValue = _Crypt.decrypt(this.JSONresponse?.__encoded__, _secretKey);
|
|
4276
|
-
this.JSONresponse = JSON.parse(decodedValue);
|
|
4277
|
-
}
|
|
4278
|
-
const jsonResponse = this.JSONresponse;
|
|
4279
|
-
Object.keys(jsonResponse).map((k) => {
|
|
4280
|
-
CONFIG.set(k, jsonResponse[k]);
|
|
4281
|
-
return k;
|
|
4282
|
-
});
|
|
4283
|
-
this.configLoaded().catch((e) => {
|
|
4284
|
-
throw new Error(`An error ocurred: ${e}`);
|
|
4285
|
-
});
|
|
4286
|
-
}
|
|
4287
|
-
fail() {
|
|
4288
|
-
this.configLoaded().catch((e) => {
|
|
4289
|
-
throw new Error(`An error ocurred: ${e}`);
|
|
4290
|
-
});
|
|
4291
|
-
}
|
|
4292
|
-
constructor() {
|
|
4293
|
-
super();
|
|
4294
|
-
this.set("url", `${this.get("basePath")}${this.get("configFileName")}`);
|
|
4295
|
-
}
|
|
4296
|
-
};
|
|
4297
|
-
Package("com.qcobjects.api", [
|
|
4298
|
-
Service
|
|
4299
|
-
]);
|
|
4300
|
-
Package("com.qcobjects.api.services", [
|
|
4301
|
-
JSONService
|
|
4302
|
-
]);
|
|
4303
|
-
Package("com.qcobjects.api.config", [
|
|
4304
|
-
ConfigService
|
|
4305
|
-
]);
|
|
4306
|
-
}
|
|
4307
|
-
});
|
|
4308
|
-
|
|
4309
|
-
// src/globalSettings.ts
|
|
4310
|
-
var GlobalSettings;
|
|
4311
|
-
var init_globalSettings = __esm({
|
|
4312
|
-
"src/globalSettings.ts"() {
|
|
4313
|
-
"use strict";
|
|
4314
|
-
init_CONFIG();
|
|
4315
|
-
init_InheritClass();
|
|
4316
|
-
init_Logger();
|
|
4317
|
-
init_Package();
|
|
4318
|
-
init_platform();
|
|
4319
|
-
init_serviceLoader();
|
|
4320
|
-
init_top();
|
|
4321
|
-
init_Service();
|
|
4322
|
-
GlobalSettings = class _GlobalSettings extends InheritClass {
|
|
4323
|
-
static {
|
|
4324
|
-
__name(this, "GlobalSettings");
|
|
4325
|
-
}
|
|
4326
|
-
static __start__() {
|
|
4327
|
-
return _GlobalSettings.instance.__start__();
|
|
4328
|
-
}
|
|
4329
|
-
_GLOBAL = {};
|
|
4330
|
-
static _instance;
|
|
4331
|
-
static get instance() {
|
|
4332
|
-
if (typeof _GlobalSettings._instance === "undefined") {
|
|
4333
|
-
_GlobalSettings._instance = new _GlobalSettings();
|
|
4334
|
-
}
|
|
4335
|
-
return _GlobalSettings._instance;
|
|
4336
|
-
}
|
|
4337
|
-
set(name, value) {
|
|
4338
|
-
this._GLOBAL[name] = value;
|
|
4339
|
-
}
|
|
4340
|
-
get(name, _default) {
|
|
4341
|
-
let _value;
|
|
4342
|
-
if (typeof this._GLOBAL[name] !== "undefined") {
|
|
4343
|
-
_value = this._GLOBAL[name];
|
|
4344
|
-
} else if (typeof _default !== "undefined") {
|
|
4345
|
-
_value = _default;
|
|
4346
|
-
}
|
|
4347
|
-
return _value;
|
|
4348
|
-
}
|
|
4349
|
-
__start__() {
|
|
4350
|
-
const __load__serviceWorker = /* @__PURE__ */ __name(function() {
|
|
4351
|
-
let _promise;
|
|
4352
|
-
if (isBrowser) {
|
|
4353
|
-
_promise = new Promise(function(resolve, reject) {
|
|
4354
|
-
if ("serviceWorker" in navigator && typeof CONFIG.get("serviceWorkerURI") !== "undefined") {
|
|
4355
|
-
CONFIG.set("serviceWorkerScope", CONFIG.get("serviceWorkerScope") ? CONFIG.get("serviceWorkerScope") : "/");
|
|
4356
|
-
navigator.serviceWorker.register(CONFIG.get("serviceWorkerURI"), {
|
|
4357
|
-
scope: CONFIG.get("serviceWorkerScope")
|
|
4358
|
-
}).then(function(registration) {
|
|
4359
|
-
logger.debug("Service Worker Registered");
|
|
4360
|
-
resolve.call(_promise, registration);
|
|
4361
|
-
}, function(registration) {
|
|
4362
|
-
logger.debug("Error registering Service Worker");
|
|
4363
|
-
reject.call(_promise, registration);
|
|
4364
|
-
});
|
|
4365
|
-
navigator.serviceWorker.ready.then(function(registration) {
|
|
4366
|
-
logger.debug("Service Worker Ready");
|
|
4367
|
-
resolve.call(_promise, registration);
|
|
4368
|
-
}, function(registration) {
|
|
4369
|
-
logger.debug("Error loading Service Worker");
|
|
4370
|
-
reject.call(_promise, registration);
|
|
4371
|
-
});
|
|
4372
|
-
}
|
|
4373
|
-
});
|
|
4374
|
-
} else {
|
|
4375
|
-
_promise = Promise.resolve();
|
|
4376
|
-
}
|
|
4377
|
-
return _promise;
|
|
4378
|
-
}, "__load__serviceWorker");
|
|
4379
|
-
const _buildComponents = /* @__PURE__ */ __name(function() {
|
|
4380
|
-
return new Promise((resolve) => {
|
|
4381
|
-
if (isBrowser) {
|
|
4382
|
-
logger.debug("Starting to building components");
|
|
4383
|
-
try {
|
|
4384
|
-
buildComponentsStack();
|
|
4385
|
-
} catch (e) {
|
|
4386
|
-
throw Error(`Something went wrong trying to start components tree: ${e.message}`);
|
|
4387
|
-
}
|
|
4388
|
-
logger.debug("Initializing the service worker");
|
|
4389
|
-
__load__serviceWorker.call(_top).catch(function(e) {
|
|
4390
|
-
logger.debug(`error loading the service worker ${e}`);
|
|
4391
|
-
});
|
|
4392
|
-
}
|
|
4393
|
-
resolve();
|
|
4394
|
-
});
|
|
4395
|
-
}, "_buildComponents");
|
|
4396
|
-
return new Promise((resolve) => {
|
|
4397
|
-
logger.debug("Starting to load the config settings...");
|
|
4398
|
-
if (CONFIG.get("useConfigService", false)) {
|
|
4399
|
-
logger.debug("Loading settings using local configuration file...");
|
|
4400
|
-
setConfigService(new ConfigService());
|
|
4401
|
-
configService.configLoaded = _buildComponents;
|
|
4402
|
-
serviceLoader(configService)?.then((standardResponse) => {
|
|
4403
|
-
resolve(standardResponse);
|
|
4404
|
-
})?.catch((e) => {
|
|
4405
|
-
throw new Error(`An error ocurred while trying to load ${configService.url}: ${e}`);
|
|
4406
|
-
});
|
|
4407
|
-
} else {
|
|
4408
|
-
logger.debug("Starting to load the components...");
|
|
4409
|
-
_buildComponents.call(this).then(() => {
|
|
4410
|
-
resolve({});
|
|
4411
|
-
}).catch((e) => {
|
|
4412
|
-
throw new Error(`An error ocurred while trying to build the components stack. ${e}`);
|
|
4413
|
-
});
|
|
4414
|
-
}
|
|
4415
|
-
});
|
|
4416
|
-
}
|
|
4417
|
-
};
|
|
4418
|
-
Package("com.qcobjects", [
|
|
4419
|
-
GlobalSettings
|
|
4420
|
-
]);
|
|
4421
|
-
}
|
|
4422
|
-
});
|
|
4423
|
-
|
|
4424
4429
|
// src/loadSDK.ts
|
|
4425
4430
|
function loadSDK() {
|
|
4426
4431
|
if (CONFIG.get("useSDK")) {
|
|
@@ -4446,7 +4451,7 @@ function loadSDK() {
|
|
|
4446
4451
|
}
|
|
4447
4452
|
if (tryImportingSDK) {
|
|
4448
4453
|
logger.info("Importing SDK... " + sdkName);
|
|
4449
|
-
if (isNodeCommonJS && typeof
|
|
4454
|
+
if (isNodeCommonJS && typeof require !== "undefined") {
|
|
4450
4455
|
const sdk = _require_("qcobjects-sdk");
|
|
4451
4456
|
if (sdk) {
|
|
4452
4457
|
logger.debug("QCObjects SDK was loaded OK.");
|
|
@@ -4794,7 +4799,7 @@ var require_MainProcess = __commonJS({
|
|
|
4794
4799
|
Export(isBrowser);
|
|
4795
4800
|
Export(_methods_);
|
|
4796
4801
|
Export(GlobalSettings);
|
|
4797
|
-
resetTop(
|
|
4802
|
+
resetTop();
|
|
4798
4803
|
(function(_top3) {
|
|
4799
4804
|
Object.defineProperty(_top3, "PackagesNameList", {
|
|
4800
4805
|
// eslint-disable-next-line no-unused-vars
|
|
@@ -5038,6 +5043,7 @@ __export(QCObjects_exports, {
|
|
|
5038
5043
|
captureFalseTouch: () => captureFalseTouch,
|
|
5039
5044
|
componentLoader: () => componentLoader,
|
|
5040
5045
|
findPackageNodePath: () => findPackageNodePath,
|
|
5046
|
+
get: () => get,
|
|
5041
5047
|
getDocumentLayout: () => getDocumentLayout,
|
|
5042
5048
|
global: () => _top,
|
|
5043
5049
|
isBrowser: () => isBrowser,
|
|
@@ -5051,11 +5057,13 @@ __export(QCObjects_exports, {
|
|
|
5051
5057
|
ready: () => ready,
|
|
5052
5058
|
resetTop: () => resetTop,
|
|
5053
5059
|
serviceLoader: () => serviceLoader,
|
|
5060
|
+
set: () => set,
|
|
5054
5061
|
setDefaultProcessors: () => setDefaultProcessors,
|
|
5055
5062
|
shortCode: () => shortCode,
|
|
5056
5063
|
subelements: () => subelements,
|
|
5057
5064
|
waitUntil: () => waitUntil
|
|
5058
5065
|
});
|
|
5066
|
+
module.exports = __toCommonJS(QCObjects_exports);
|
|
5059
5067
|
var AssignPolyfill = __toESM(require_assign());
|
|
5060
5068
|
init_top();
|
|
5061
5069
|
init_PrimaryCollections();
|
|
@@ -6484,11 +6492,98 @@ var getDocumentLayout = /* @__PURE__ */ __name(function() {
|
|
|
6484
6492
|
init_mathFunctions();
|
|
6485
6493
|
init_top();
|
|
6486
6494
|
init_make_global();
|
|
6495
|
+
init_top();
|
|
6487
6496
|
var QCObjects = __toESM(require_MainProcess());
|
|
6488
|
-
|
|
6489
|
-
|
|
6490
|
-
|
|
6491
|
-
|
|
6492
|
-
|
|
6493
|
-
|
|
6494
|
-
|
|
6497
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
6498
|
+
0 && (module.exports = {
|
|
6499
|
+
ArrayCollection,
|
|
6500
|
+
ArrayList,
|
|
6501
|
+
AssignPolyfill,
|
|
6502
|
+
BackendMicroservice,
|
|
6503
|
+
CONFIG,
|
|
6504
|
+
Class,
|
|
6505
|
+
ClassFactory,
|
|
6506
|
+
ComplexStorageCache,
|
|
6507
|
+
Component,
|
|
6508
|
+
ComponentURI,
|
|
6509
|
+
ConfigService,
|
|
6510
|
+
Controller,
|
|
6511
|
+
DDO,
|
|
6512
|
+
DefaultTemplateHandler,
|
|
6513
|
+
Effect,
|
|
6514
|
+
Export,
|
|
6515
|
+
GlobalSettings,
|
|
6516
|
+
Import,
|
|
6517
|
+
InheritClass,
|
|
6518
|
+
JSONService,
|
|
6519
|
+
Logger,
|
|
6520
|
+
NamespaceRef,
|
|
6521
|
+
New,
|
|
6522
|
+
ObjectName,
|
|
6523
|
+
Package,
|
|
6524
|
+
Processor,
|
|
6525
|
+
QCObjects,
|
|
6526
|
+
Ready,
|
|
6527
|
+
RegisterClass,
|
|
6528
|
+
RegisterWidget,
|
|
6529
|
+
RegisterWidgets,
|
|
6530
|
+
Service,
|
|
6531
|
+
SourceCSS,
|
|
6532
|
+
SourceJS,
|
|
6533
|
+
Tag,
|
|
6534
|
+
TagElements,
|
|
6535
|
+
Timer,
|
|
6536
|
+
Toggle,
|
|
6537
|
+
TransitionEffect,
|
|
6538
|
+
VO,
|
|
6539
|
+
View,
|
|
6540
|
+
_Cast,
|
|
6541
|
+
_CastProps,
|
|
6542
|
+
_ComponentWidget_,
|
|
6543
|
+
_Crypt,
|
|
6544
|
+
_DOMCreateElement,
|
|
6545
|
+
_DataStringify,
|
|
6546
|
+
_LegacyCopy,
|
|
6547
|
+
_QC_CLASSES,
|
|
6548
|
+
_QC_PACKAGES,
|
|
6549
|
+
_QC_PACKAGES_IMPORTED,
|
|
6550
|
+
_QC_READY_LISTENERS,
|
|
6551
|
+
_Ready,
|
|
6552
|
+
__getType__,
|
|
6553
|
+
__instanceID,
|
|
6554
|
+
__is_raw_class__,
|
|
6555
|
+
__make_global__,
|
|
6556
|
+
__to_number,
|
|
6557
|
+
_buildComponentsFromElements_,
|
|
6558
|
+
_fireAsyncLoad,
|
|
6559
|
+
_methods_,
|
|
6560
|
+
_protected_code_,
|
|
6561
|
+
_require_,
|
|
6562
|
+
_super_,
|
|
6563
|
+
_tag_filter_,
|
|
6564
|
+
_top,
|
|
6565
|
+
asyncLoad,
|
|
6566
|
+
captureFalseTouch,
|
|
6567
|
+
componentLoader,
|
|
6568
|
+
findPackageNodePath,
|
|
6569
|
+
get,
|
|
6570
|
+
getDocumentLayout,
|
|
6571
|
+
global,
|
|
6572
|
+
isBrowser,
|
|
6573
|
+
isNodeCommonJS,
|
|
6574
|
+
isQCObjects_Class,
|
|
6575
|
+
isQCObjects_Object,
|
|
6576
|
+
is_a,
|
|
6577
|
+
is_phonegap,
|
|
6578
|
+
logger,
|
|
6579
|
+
range,
|
|
6580
|
+
ready,
|
|
6581
|
+
resetTop,
|
|
6582
|
+
serviceLoader,
|
|
6583
|
+
set,
|
|
6584
|
+
setDefaultProcessors,
|
|
6585
|
+
shortCode,
|
|
6586
|
+
subelements,
|
|
6587
|
+
waitUntil
|
|
6588
|
+
});
|
|
6589
|
+
//# sourceMappingURL=QCObjects.cjs.map
|