@futdevpro/fsm-dynamo 1.10.37 → 1.10.39
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/.github/workflows/main.yml +11 -51
- package/build/_collections/constants/error-defaults.const.d.ts +8 -0
- package/build/_collections/constants/error-defaults.const.d.ts.map +1 -1
- package/build/_collections/constants/error-defaults.const.js +8 -0
- package/build/_collections/constants/error-defaults.const.js.map +1 -1
- package/build/_collections/constants/global-settings.const.d.ts +8 -0
- package/build/_collections/constants/global-settings.const.d.ts.map +1 -1
- package/build/_collections/constants/global-settings.const.js +9 -0
- package/build/_collections/constants/global-settings.const.js.map +1 -1
- package/build/_collections/constants/numbers.const.d.ts +32 -0
- package/build/_collections/constants/numbers.const.d.ts.map +1 -1
- package/build/_collections/constants/numbers.const.js +32 -0
- package/build/_collections/constants/numbers.const.js.map +1 -1
- package/build/_collections/constants/times.const.d.ts +31 -0
- package/build/_collections/constants/times.const.d.ts.map +1 -1
- package/build/_collections/constants/times.const.js +31 -0
- package/build/_collections/constants/times.const.js.map +1 -1
- package/build/_collections/utils/array.util.d.ts +136 -7
- package/build/_collections/utils/array.util.d.ts.map +1 -1
- package/build/_collections/utils/array.util.js +132 -2
- package/build/_collections/utils/array.util.js.map +1 -1
- package/build/_collections/utils/array.util.spec.js.map +1 -1
- package/build/_collections/utils/log.util.d.ts +123 -0
- package/build/_collections/utils/log.util.d.ts.map +1 -1
- package/build/_collections/utils/log.util.js +123 -0
- package/build/_collections/utils/log.util.js.map +1 -1
- package/build/_collections/utils/math/box-bounds.spec.js +2 -5
- package/build/_collections/utils/math/box-bounds.spec.js.map +1 -1
- package/build/_collections/utils/math/box-bounds.util.d.ts +52 -6
- package/build/_collections/utils/math/box-bounds.util.d.ts.map +1 -1
- package/build/_collections/utils/math/box-bounds.util.js +57 -5
- package/build/_collections/utils/math/box-bounds.util.js.map +1 -1
- package/build/_collections/utils/math/box-bounds.util.spec.js +1 -1
- package/build/_collections/utils/math/box-bounds.util.spec.js.map +1 -1
- package/build/_collections/utils/math/math.util.d.ts +30 -0
- package/build/_collections/utils/math/math.util.d.ts.map +1 -1
- package/build/_collections/utils/math/math.util.js +30 -0
- package/build/_collections/utils/math/math.util.js.map +1 -1
- package/build/_collections/utils/math/random.util.d.ts +19 -2
- package/build/_collections/utils/math/random.util.d.ts.map +1 -1
- package/build/_collections/utils/math/random.util.js +22 -0
- package/build/_collections/utils/math/random.util.js.map +1 -1
- package/build/_collections/utils/math/random.util.spec.js.map +1 -1
- package/build/_collections/utils/math/vector2.util.d.ts +142 -20
- package/build/_collections/utils/math/vector2.util.d.ts.map +1 -1
- package/build/_collections/utils/math/vector2.util.js +126 -0
- package/build/_collections/utils/math/vector2.util.js.map +1 -1
- package/build/_collections/utils/round-list.util.d.ts +36 -1
- package/build/_collections/utils/round-list.util.d.ts.map +1 -1
- package/build/_collections/utils/round-list.util.js +35 -0
- package/build/_collections/utils/round-list.util.js.map +1 -1
- package/build/_collections/utils/shared.util.js.map +1 -1
- package/build/_collections/utils/stack.util.js +3 -3
- package/build/_collections/utils/stack.util.js.map +1 -1
- package/build/_collections/utils/string.util.d.ts +8 -1
- package/build/_collections/utils/string.util.d.ts.map +1 -1
- package/build/_collections/utils/string.util.js +8 -1
- package/build/_collections/utils/string.util.js.map +1 -1
- package/build/_collections/utils/time.util.d.ts +29 -0
- package/build/_collections/utils/time.util.d.ts.map +1 -1
- package/build/_collections/utils/time.util.js +29 -0
- package/build/_collections/utils/time.util.js.map +1 -1
- package/build/_collections/utils/type-cloning-facility.util.d.ts +29 -3
- package/build/_collections/utils/type-cloning-facility.util.d.ts.map +1 -1
- package/build/_collections/utils/type-cloning-facility.util.js +53 -3
- package/build/_collections/utils/type-cloning-facility.util.js.map +1 -1
- package/build/_collections/utils/utilities.util.d.ts +49 -2
- package/build/_collections/utils/utilities.util.d.ts.map +1 -1
- package/build/_collections/utils/utilities.util.js +53 -1
- package/build/_collections/utils/utilities.util.js.map +1 -1
- package/build/_collections/utils/utilities.util.spec.js.map +1 -1
- package/build/_collections/utils/uuid.util.d.ts +5 -0
- package/build/_collections/utils/uuid.util.d.ts.map +1 -1
- package/build/_collections/utils/uuid.util.js +5 -0
- package/build/_collections/utils/uuid.util.js.map +1 -1
- package/build/_enums/basic-property-type.enum.d.ts +8 -0
- package/build/_enums/basic-property-type.enum.d.ts.map +1 -1
- package/build/_enums/basic-property-type.enum.js +8 -0
- package/build/_enums/basic-property-type.enum.js.map +1 -1
- package/build/_enums/data-model-type.enum.d.ts +8 -4
- package/build/_enums/data-model-type.enum.d.ts.map +1 -1
- package/build/_enums/data-model-type.enum.js +8 -4
- package/build/_enums/data-model-type.enum.js.map +1 -1
- package/build/_enums/environment-flag.enum.d.ts +18 -0
- package/build/_enums/environment-flag.enum.d.ts.map +1 -1
- package/build/_enums/environment-flag.enum.js +18 -0
- package/build/_enums/environment-flag.enum.js.map +1 -1
- package/build/_enums/error-level.enum.d.ts +10 -0
- package/build/_enums/error-level.enum.d.ts.map +1 -1
- package/build/_enums/error-level.enum.js +10 -0
- package/build/_enums/error-level.enum.js.map +1 -1
- package/build/_enums/http-call-type.enum.d.ts +6 -2
- package/build/_enums/http-call-type.enum.d.ts.map +1 -1
- package/build/_enums/http-call-type.enum.js +6 -2
- package/build/_enums/http-call-type.enum.js.map +1 -1
- package/build/_enums/http-response-type.enum.d.ts +8 -0
- package/build/_enums/http-response-type.enum.d.ts.map +1 -1
- package/build/_enums/http-response-type.enum.js +8 -0
- package/build/_enums/http-response-type.enum.js.map +1 -1
- package/build/_enums/log-style.enum.d.ts +8 -0
- package/build/_enums/log-style.enum.d.ts.map +1 -1
- package/build/_enums/log-style.enum.js +8 -0
- package/build/_enums/log-style.enum.js.map +1 -1
- package/build/_enums/time/day-of-week.enum.d.ts +13 -1
- package/build/_enums/time/day-of-week.enum.d.ts.map +1 -1
- package/build/_enums/time/day-of-week.enum.js +13 -1
- package/build/_enums/time/day-of-week.enum.js.map +1 -1
- package/build/_enums/time/month.enum.d.ts +8 -0
- package/build/_enums/time/month.enum.d.ts.map +1 -1
- package/build/_enums/time/month.enum.js +8 -0
- package/build/_enums/time/month.enum.js.map +1 -1
- package/build/_enums/time/relative-date.enum.d.ts +10 -0
- package/build/_enums/time/relative-date.enum.d.ts.map +1 -1
- package/build/_enums/time/relative-date.enum.js +10 -0
- package/build/_enums/time/relative-date.enum.js.map +1 -1
- package/build/_models/control-models/data-model-params.control-model.d.ts +4 -4
- package/build/_models/control-models/data-model-params.control-model.d.ts.map +1 -1
- package/build/_models/control-models/data-model-params.control-model.js.map +1 -1
- package/build/_models/control-models/data-property-params.control-model.d.ts.map +1 -1
- package/build/_models/control-models/data-property-params.control-model.js.map +1 -1
- package/build/_models/control-models/error.control-model.spec.js.map +1 -1
- package/build/_models/interfaces/box-bounds.interface.d.ts +8 -0
- package/build/_models/interfaces/box-bounds.interface.d.ts.map +1 -0
- package/build/_models/interfaces/box-bounds.interface.js +3 -0
- package/build/_models/interfaces/box-bounds.interface.js.map +1 -0
- package/build/_models/interfaces/environment/global-settings.interface.d.ts +1 -0
- package/build/_models/interfaces/environment/global-settings.interface.d.ts.map +1 -1
- package/build/_models/interfaces/route-settings.interface.d.ts +6 -1
- package/build/_models/interfaces/route-settings.interface.d.ts.map +1 -1
- package/build/_modules/crypto/_collections/crypto.util.d.ts +11 -17
- package/build/_modules/crypto/_collections/crypto.util.d.ts.map +1 -1
- package/build/_modules/crypto/_collections/crypto.util.js +74 -58
- package/build/_modules/crypto/_collections/crypto.util.js.map +1 -1
- package/build/_modules/crypto/_collections/crypto.util.spec.js +390 -0
- package/build/_modules/crypto/_collections/crypto.util.spec.js.map +1 -1
- package/build/_modules/custom-data/_collections/cud-module-settings.const.d.ts +6 -0
- package/build/_modules/custom-data/_collections/cud-module-settings.const.d.ts.map +1 -1
- package/build/_modules/custom-data/_collections/cud-module-settings.const.js +6 -0
- package/build/_modules/custom-data/_collections/cud-module-settings.const.js.map +1 -1
- package/build/_modules/custom-data/_models/cud.data-model.d.ts +3 -0
- package/build/_modules/custom-data/_models/cud.data-model.d.ts.map +1 -1
- package/build/_modules/custom-data/_models/cud.data-model.js +3 -0
- package/build/_modules/custom-data/_models/cud.data-model.js.map +1 -1
- package/build/_modules/location/_collections/loc-country-divisions.const.d.ts +1 -0
- package/build/_modules/location/_collections/loc-country-divisions.const.d.ts.map +1 -1
- package/build/_modules/location/_collections/loc-country-divisions.const.js +1 -0
- package/build/_modules/location/_collections/loc-country-divisions.const.js.map +1 -1
- package/build/_modules/location/_collections/loc-regions.util.d.ts +4 -0
- package/build/_modules/location/_collections/loc-regions.util.d.ts.map +1 -1
- package/build/_modules/location/_collections/loc-regions.util.js +4 -0
- package/build/_modules/location/_collections/loc-regions.util.js.map +1 -1
- package/build/_modules/location/_collections/loc.util.d.ts +9 -0
- package/build/_modules/location/_collections/loc.util.d.ts.map +1 -1
- package/build/_modules/location/_collections/loc.util.js +9 -0
- package/build/_modules/location/_collections/loc.util.js.map +1 -1
- package/build/_modules/location/_enums/loc-region.enum.d.ts +3 -0
- package/build/_modules/location/_enums/loc-region.enum.d.ts.map +1 -1
- package/build/_modules/location/_enums/loc-region.enum.js +3 -0
- package/build/_modules/location/_enums/loc-region.enum.js.map +1 -1
- package/build/_modules/location/_enums/loc-sub-region.enum.d.ts +3 -0
- package/build/_modules/location/_enums/loc-sub-region.enum.d.ts.map +1 -1
- package/build/_modules/location/_enums/loc-sub-region.enum.js +3 -0
- package/build/_modules/location/_enums/loc-sub-region.enum.js.map +1 -1
- package/build/_modules/location/_enums/loc-subdivision-region-type.enum.d.ts +37 -34
- package/build/_modules/location/_enums/loc-subdivision-region-type.enum.d.ts.map +1 -1
- package/build/_modules/location/_enums/loc-subdivision-region-type.enum.js +3 -0
- package/build/_modules/location/_enums/loc-subdivision-region-type.enum.js.map +1 -1
- package/build/_modules/location/_models/loc-coordinates.interface.d.ts +1 -0
- package/build/_modules/location/_models/loc-coordinates.interface.d.ts.map +1 -1
- package/build/_modules/open-ai/_enums/open-ai-model.enum.d.ts +10 -7
- package/build/_modules/open-ai/_enums/open-ai-model.enum.d.ts.map +1 -1
- package/build/_modules/open-ai/_enums/open-ai-model.enum.js +3 -0
- package/build/_modules/open-ai/_enums/open-ai-model.enum.js.map +1 -1
- package/build/_modules/pipe/_enums/pip-range-pipe-setting.enum.d.ts +3 -0
- package/build/_modules/pipe/_enums/pip-range-pipe-setting.enum.d.ts.map +1 -1
- package/build/_modules/pipe/_enums/pip-range-pipe-setting.enum.js +3 -0
- package/build/_modules/pipe/_enums/pip-range-pipe-setting.enum.js.map +1 -1
- package/build/_modules/pipe/_enums/pip.enum.d.ts +14 -0
- package/build/_modules/pipe/_enums/pip.enum.d.ts.map +1 -1
- package/build/_modules/pipe/_enums/pip.enum.js +11 -0
- package/build/_modules/pipe/_enums/pip.enum.js.map +1 -1
- package/build/_modules/socket/_enums/sck-event-key.enum.d.ts +3 -0
- package/build/_modules/socket/_enums/sck-event-key.enum.d.ts.map +1 -1
- package/build/_modules/socket/_enums/sck-event-key.enum.js +3 -0
- package/build/_modules/socket/_enums/sck-event-key.enum.js.map +1 -1
- package/build/_modules/socket/_models/sck-client-params.control-model.d.ts +12 -0
- package/build/_modules/socket/_models/sck-client-params.control-model.d.ts.map +1 -1
- package/build/_modules/socket/_models/sck-client-params.control-model.js +12 -0
- package/build/_modules/socket/_models/sck-client-params.control-model.js.map +1 -1
- package/build/_modules/socket/_models/sck-socket-event.control-model.d.ts +12 -1
- package/build/_modules/socket/_models/sck-socket-event.control-model.d.ts.map +1 -1
- package/build/_modules/socket/_models/sck-socket-event.control-model.js +12 -1
- package/build/_modules/socket/_models/sck-socket-event.control-model.js.map +1 -1
- package/build/_modules/socket/_services/sck-client.service-base.d.ts +4 -0
- package/build/_modules/socket/_services/sck-client.service-base.d.ts.map +1 -1
- package/build/_modules/socket/_services/sck-client.service-base.js +4 -0
- package/build/_modules/socket/_services/sck-client.service-base.js.map +1 -1
- package/build/_modules/test/_collections/tst-module-settings.const.d.ts +9 -0
- package/build/_modules/test/_collections/tst-module-settings.const.d.ts.map +1 -1
- package/build/_modules/test/_collections/tst-module-settings.const.js +9 -0
- package/build/_modules/test/_collections/tst-module-settings.const.js.map +1 -1
- package/build/_modules/usage/_models/usg-action.control-model.d.ts +13 -0
- package/build/_modules/usage/_models/usg-action.control-model.d.ts.map +1 -1
- package/build/_modules/usage/_models/usg-action.control-model.js +13 -0
- package/build/_modules/usage/_models/usg-action.control-model.js.map +1 -1
- package/build/_modules/usage/_models/usg-daily-usage-data.control-model.d.ts +14 -0
- package/build/_modules/usage/_models/usg-daily-usage-data.control-model.d.ts.map +1 -1
- package/build/_modules/usage/_models/usg-daily-usage-data.control-model.js +14 -0
- package/build/_modules/usage/_models/usg-daily-usage-data.control-model.js.map +1 -1
- package/build/_modules/usage/_models/usg-data.control-model.d.ts +16 -0
- package/build/_modules/usage/_models/usg-data.control-model.d.ts.map +1 -1
- package/build/_modules/usage/_models/usg-data.control-model.js +16 -0
- package/build/_modules/usage/_models/usg-data.control-model.js.map +1 -1
- package/build/_modules/usage/_models/usg-session.data-model.d.ts +17 -0
- package/build/_modules/usage/_models/usg-session.data-model.d.ts.map +1 -1
- package/build/_modules/usage/_models/usg-session.data-model.js +17 -0
- package/build/_modules/usage/_models/usg-session.data-model.js.map +1 -1
- package/build/_modules/usage/_models/usg-session.data-model.spec.js.map +1 -1
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/futdevpro-fsm-dynamo-01.10.39.tgz +0 -0
- package/package.json +9 -5
- package/src/_collections/constants/error-defaults.const.ts +8 -0
- package/src/_collections/constants/global-settings.const.ts +12 -2
- package/src/_collections/constants/numbers.const.ts +32 -0
- package/src/_collections/constants/times.const.ts +37 -0
- package/src/_collections/utils/array.util.spec.ts +36 -38
- package/src/_collections/utils/array.util.ts +146 -12
- package/src/_collections/utils/log.util.ts +126 -2
- package/src/_collections/utils/math/box-bounds.spec.ts +8 -13
- package/src/_collections/utils/math/box-bounds.util.spec.ts +3 -3
- package/src/_collections/utils/math/box-bounds.util.ts +65 -12
- package/src/_collections/utils/math/math.util.ts +30 -6
- package/src/_collections/utils/math/random.util.spec.ts +7 -7
- package/src/_collections/utils/math/random.util.ts +27 -4
- package/src/_collections/utils/math/vector2.util.ts +148 -21
- package/src/_collections/utils/round-list.util.ts +36 -3
- package/src/_collections/utils/shared.util.ts +17 -17
- package/src/_collections/utils/stack.util.ts +6 -6
- package/src/_collections/utils/string.util.ts +8 -1
- package/src/_collections/utils/time.util.ts +37 -2
- package/src/_collections/utils/type-cloning-facility.util.ts +57 -8
- package/src/_collections/utils/utilities.util.spec.ts +2 -2
- package/src/_collections/utils/utilities.util.ts +61 -8
- package/src/_collections/utils/uuid.util.ts +5 -0
- package/src/_enums/basic-property-type.enum.ts +8 -0
- package/src/_enums/data-model-type.enum.ts +11 -6
- package/src/_enums/environment-flag.enum.ts +18 -0
- package/src/_enums/error-level.enum.ts +10 -0
- package/src/_enums/http-call-type.enum.ts +6 -2
- package/src/_enums/http-response-type.enum.ts +8 -0
- package/src/_enums/log-style.enum.ts +8 -0
- package/src/_enums/time/day-of-week.enum.ts +13 -1
- package/src/_enums/time/month.enum.ts +8 -0
- package/src/_enums/time/relative-date.enum.ts +10 -0
- package/src/_models/control-models/data-model-params.control-model.ts +6 -6
- package/src/_models/control-models/data-property-params.control-model.ts +1 -1
- package/src/_models/control-models/error.control-model.spec.ts +2 -2
- package/src/_models/interfaces/box-bounds.interface.ts +8 -0
- package/src/_models/interfaces/environment/global-settings.interface.ts +2 -0
- package/src/_models/interfaces/route-settings.interface.ts +6 -1
- package/src/_modules/crypto/_collections/crypto.util.spec.ts +428 -0
- package/src/_modules/crypto/_collections/crypto.util.ts +88 -52
- package/src/_modules/custom-data/_collections/cud-module-settings.const.ts +6 -0
- package/src/_modules/custom-data/_models/cud.data-model.ts +3 -0
- package/src/_modules/location/_collections/loc-country-divisions.const.ts +2 -1
- package/src/_modules/location/_collections/loc-regions.util.ts +4 -0
- package/src/_modules/location/_collections/loc.util.ts +13 -5
- package/src/_modules/location/_enums/loc-region.enum.ts +3 -0
- package/src/_modules/location/_enums/loc-sub-region.enum.ts +3 -0
- package/src/_modules/location/_enums/loc-subdivision-region-type.enum.ts +37 -34
- package/src/_modules/location/_models/loc-coordinates.interface.ts +1 -0
- package/src/_modules/open-ai/_enums/open-ai-model.enum.ts +11 -8
- package/src/_modules/pipe/_enums/pip-range-pipe-setting.enum.ts +3 -0
- package/src/_modules/pipe/_enums/pip.enum.ts +17 -3
- package/src/_modules/socket/_enums/sck-event-key.enum.ts +3 -0
- package/src/_modules/socket/_models/sck-client-params.control-model.ts +12 -0
- package/src/_modules/socket/_models/sck-socket-event.control-model.ts +12 -1
- package/src/_modules/socket/_services/sck-client.service-base.ts +4 -0
- package/src/_modules/test/_collections/tst-module-settings.const.ts +9 -0
- package/src/_modules/usage/_models/usg-action.control-model.ts +13 -0
- package/src/_modules/usage/_models/usg-daily-usage-data.control-model.ts +14 -0
- package/src/_modules/usage/_models/usg-data.control-model.ts +16 -0
- package/src/_modules/usage/_models/usg-session.data-model.spec.ts +2 -1
- package/src/_modules/usage/_models/usg-session.data-model.ts +17 -0
- package/src/index.ts +1 -0
- package/tsconfig.json +1 -0
- package/futdevpro-fsm-dynamo-01.10.37.tgz +0 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
export type DyFM_TCF = DyFM_TypeCloningFacility;
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -15,6 +14,14 @@ export type DyFM_TCF = DyFM_TypeCloningFacility;
|
|
|
15
14
|
* */
|
|
16
15
|
export class DyFM_TypeCloningFacility {
|
|
17
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Clone an object
|
|
19
|
+
* @param object - The object to clone
|
|
20
|
+
* @param skip - An array of keys to skip
|
|
21
|
+
* @param affectedObjects - An array of objects that have already been cloned
|
|
22
|
+
* @param debug - Whether to log debug information
|
|
23
|
+
* @returns The cloned object
|
|
24
|
+
*/
|
|
18
25
|
static clone<T>(
|
|
19
26
|
object: T,
|
|
20
27
|
skip: string[] = [],
|
|
@@ -28,8 +35,8 @@ export class DyFM_TypeCloningFacility {
|
|
|
28
35
|
console.log('clone DEBUG; key:', key);
|
|
29
36
|
}
|
|
30
37
|
|
|
31
|
-
if (typeof object === 'object'/* object.hasOwnProperty(key) */) {
|
|
32
|
-
const type = typeof object[key];
|
|
38
|
+
if (object && typeof object === 'object'/* object.hasOwnProperty(key) */) {
|
|
39
|
+
const type: string = typeof object[key];
|
|
33
40
|
|
|
34
41
|
if (skip.includes(key)) {
|
|
35
42
|
continue;
|
|
@@ -44,7 +51,7 @@ export class DyFM_TypeCloningFacility {
|
|
|
44
51
|
|
|
45
52
|
} else {
|
|
46
53
|
const newAffectedObject: ObjectCollector = {
|
|
47
|
-
id: object[key]
|
|
54
|
+
id: object[key] as string
|
|
48
55
|
};
|
|
49
56
|
|
|
50
57
|
affectedObjects.push(newAffectedObject);
|
|
@@ -83,6 +90,14 @@ export class DyFM_TypeCloningFacility {
|
|
|
83
90
|
return result;
|
|
84
91
|
}
|
|
85
92
|
|
|
93
|
+
/**
|
|
94
|
+
* Clone an array
|
|
95
|
+
* @param array - The array to clone
|
|
96
|
+
* @param skip - An array of keys to skip
|
|
97
|
+
* @param affectedObjects - An array of objects that have already been cloned
|
|
98
|
+
* @param debug - Whether to log debug information
|
|
99
|
+
* @returns The cloned array
|
|
100
|
+
*/
|
|
86
101
|
static cloneArray<T>(
|
|
87
102
|
array: T[],
|
|
88
103
|
skip: string[] = [],
|
|
@@ -107,13 +122,47 @@ export class DyFM_TypeCloningFacility {
|
|
|
107
122
|
return result;
|
|
108
123
|
}
|
|
109
124
|
|
|
110
|
-
|
|
125
|
+
/**
|
|
126
|
+
* Store the circulation of an object
|
|
127
|
+
* @param object - The object to store the circulation of
|
|
128
|
+
* @returns The serialized object
|
|
129
|
+
*/
|
|
130
|
+
static storeCirculation(object: any): string {
|
|
131
|
+
const cache = new Map();
|
|
132
|
+
const result = JSON.stringify(object, (key, value) => {
|
|
133
|
+
if (typeof value === 'object' && value !== null) {
|
|
134
|
+
if (cache.has(value)) {
|
|
135
|
+
return `__cycle__${cache.get(value)}`;
|
|
136
|
+
}
|
|
137
|
+
cache.set(value, cache.size);
|
|
138
|
+
}
|
|
139
|
+
return value;
|
|
140
|
+
});
|
|
141
|
+
return result;
|
|
142
|
+
}
|
|
111
143
|
|
|
112
|
-
|
|
144
|
+
/**
|
|
145
|
+
* Restore the circulation of an object
|
|
146
|
+
* @param serialized - The serialized object
|
|
147
|
+
* @returns The restored object
|
|
148
|
+
*/
|
|
149
|
+
static restoreCirculation(serialized: string): any {
|
|
150
|
+
const cache = new Map();
|
|
151
|
+
const result = JSON.parse(serialized, (key, value) => {
|
|
152
|
+
if (typeof value === 'string' && value.startsWith('__cycle__')) {
|
|
153
|
+
return cache.get(parseInt(value.slice(9), 10));
|
|
154
|
+
}
|
|
155
|
+
if (typeof value === 'object' && value !== null) {
|
|
156
|
+
cache.set(cache.size, value);
|
|
157
|
+
}
|
|
158
|
+
return value;
|
|
159
|
+
});
|
|
160
|
+
return result;
|
|
161
|
+
}
|
|
113
162
|
}
|
|
114
163
|
|
|
115
164
|
interface ObjectCollector {
|
|
116
|
-
id;
|
|
117
|
-
clonedObject
|
|
165
|
+
id: string;
|
|
166
|
+
clonedObject?: any;
|
|
118
167
|
}
|
|
119
168
|
|
|
@@ -157,8 +157,8 @@ describe('| Utilities', () => {
|
|
|
157
157
|
|
|
158
158
|
describe('| DyFM_JSONListify', () => {
|
|
159
159
|
it('| should convert a JSON list to an array', () => {
|
|
160
|
-
const JSONList = { 0: 'a', 1: 'b', 2: 'c' };
|
|
161
|
-
const result = DyFM_JSONListify<string>(JSONList);
|
|
160
|
+
const JSONList: Record<string, string> = { 0: 'a', 1: 'b', 2: 'c' };
|
|
161
|
+
const result = DyFM_JSONListify<string>(JSONList as any as string[]);
|
|
162
162
|
expect(result).toEqual(['a', 'b', 'c']);
|
|
163
163
|
});
|
|
164
164
|
});
|
|
@@ -8,6 +8,11 @@ const defaultErrorMsg =
|
|
|
8
8
|
'contains object hooks for its own objects, therefore its creating an object loop. ' +
|
|
9
9
|
'See further information in the detailed error:\n\n';
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Clone an object
|
|
13
|
+
* @param object - The object to clone
|
|
14
|
+
* @returns The cloned object
|
|
15
|
+
*/
|
|
11
16
|
export function DyFM_clone<T>(object: T): T {
|
|
12
17
|
try {
|
|
13
18
|
return object ? JSON.parse(JSON.stringify(object)) as T : object;
|
|
@@ -22,9 +27,14 @@ export function DyFM_clone<T>(object: T): T {
|
|
|
22
27
|
}
|
|
23
28
|
export const DyFM_copy = DyFM_clone;
|
|
24
29
|
|
|
25
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Surface clone an object
|
|
32
|
+
* @param object - The object to surface clone
|
|
33
|
+
* @returns The surface cloned object
|
|
34
|
+
*/
|
|
35
|
+
export function DyFM_surfaceClone<T extends Record<string, any>>(object: T): T {
|
|
26
36
|
try {
|
|
27
|
-
const result = {};
|
|
37
|
+
const result: Record<string, any> = {};
|
|
28
38
|
|
|
29
39
|
Object.keys(object).forEach((key: string): void => {
|
|
30
40
|
result[key] = object[key];
|
|
@@ -42,9 +52,14 @@ export function DyFM_surfaceClone<T>(object: T): T {
|
|
|
42
52
|
}
|
|
43
53
|
export const DyFM_surfaceCopy = DyFM_surfaceClone;
|
|
44
54
|
|
|
45
|
-
|
|
55
|
+
/**
|
|
56
|
+
* Deep clone an object
|
|
57
|
+
* @param object - The object to deep clone
|
|
58
|
+
* @returns The deep cloned object
|
|
59
|
+
*/
|
|
60
|
+
export function DyFM_deepClone<T extends Record<string, any>>(object: T): T {
|
|
46
61
|
try {
|
|
47
|
-
const result = {};
|
|
62
|
+
const result: Record<string, any> = {};
|
|
48
63
|
|
|
49
64
|
Object.keys(object).forEach((key: string): void => {
|
|
50
65
|
if (typeof object[key] === 'object') {
|
|
@@ -141,6 +156,13 @@ export function DyFM_orderedSameObject<T>(objA: T, objB: T): boolean {
|
|
|
141
156
|
}
|
|
142
157
|
}
|
|
143
158
|
|
|
159
|
+
/**
|
|
160
|
+
* We experienced that sameObjects() function is not working properly for cases when
|
|
161
|
+
* deleting a key from the objects (to prevent strict results).
|
|
162
|
+
*
|
|
163
|
+
* This function is created to prevent that issue.
|
|
164
|
+
* But be aware that this function is not as fast as sameObjects() function.
|
|
165
|
+
*/
|
|
144
166
|
export function DyFM_orderedSameObject2<T>(objA: T, objB: T): boolean {
|
|
145
167
|
try {
|
|
146
168
|
console.log('using orderedSameObject2');
|
|
@@ -175,6 +197,12 @@ export function DyFM_orderedSameObject2<T>(objA: T, objB: T): boolean {
|
|
|
175
197
|
}
|
|
176
198
|
}
|
|
177
199
|
|
|
200
|
+
/**
|
|
201
|
+
* compares the surface of two objects
|
|
202
|
+
* @param objA
|
|
203
|
+
* @param objB
|
|
204
|
+
* @returns
|
|
205
|
+
*/
|
|
178
206
|
export function DyFM_sameObjectSurface<T>(objA: T, objB: T): boolean {
|
|
179
207
|
let result = true;
|
|
180
208
|
|
|
@@ -201,6 +229,11 @@ export function DyFM_setExistingValuesOnly(setOn: any, setTo: any): void {
|
|
|
201
229
|
}
|
|
202
230
|
}
|
|
203
231
|
|
|
232
|
+
/**
|
|
233
|
+
* delays the execution of a function
|
|
234
|
+
* @param ms
|
|
235
|
+
* @returns
|
|
236
|
+
*/
|
|
204
237
|
export function DyFM_delay(ms: number): Promise<void> {
|
|
205
238
|
return new Promise((resolve): any => setTimeout(resolve, ms));
|
|
206
239
|
}
|
|
@@ -267,13 +300,16 @@ export function DyFM_takeUntil<T>(
|
|
|
267
300
|
(value?: T): void => {
|
|
268
301
|
if (check(value)) {
|
|
269
302
|
sub.unsubscribe();
|
|
270
|
-
resolve(value);
|
|
303
|
+
resolve(value as T);
|
|
271
304
|
}
|
|
272
305
|
}
|
|
273
306
|
);
|
|
274
307
|
});
|
|
275
308
|
}
|
|
276
309
|
|
|
310
|
+
/**
|
|
311
|
+
* the return type of the sortForTrue function
|
|
312
|
+
*/
|
|
277
313
|
export type DyFM_SortDirection = 0 | 1 | -1
|
|
278
314
|
|
|
279
315
|
/**
|
|
@@ -294,20 +330,37 @@ export function DyFM_sortForTrue<T>(
|
|
|
294
330
|
): DyFM_SortDirection {
|
|
295
331
|
const isA = check(a);
|
|
296
332
|
|
|
297
|
-
|
|
333
|
+
if (isA === check(b)) {
|
|
334
|
+
return 0;
|
|
335
|
+
} else if (isA) {
|
|
336
|
+
return -1;
|
|
337
|
+
} else {
|
|
338
|
+
return 1;
|
|
339
|
+
}
|
|
298
340
|
}
|
|
299
341
|
|
|
342
|
+
/**
|
|
343
|
+
* returns a function that can be used to sort an array of objects
|
|
344
|
+
* sorts so that the objects that have the value true for the checkFor function are at the beginning of the array
|
|
345
|
+
* @param checkFor
|
|
346
|
+
* @returns
|
|
347
|
+
*/
|
|
300
348
|
export function DyFM_getSortForTrueFn<T>(
|
|
301
349
|
checkFor: (a: T) => boolean
|
|
302
350
|
): (a: T, b: T) => DyFM_SortDirection {
|
|
303
351
|
return (a: T, b: T): DyFM_SortDirection => DyFM_sortForTrue<T>(a, b, checkFor);
|
|
304
352
|
}
|
|
305
353
|
|
|
306
|
-
|
|
354
|
+
/**
|
|
355
|
+
* converts a JSONList to an array
|
|
356
|
+
* @param JSONList
|
|
357
|
+
* @returns
|
|
358
|
+
*/
|
|
359
|
+
export function DyFM_JSONListify<T>(JSONList: any): T[] {
|
|
307
360
|
const result: T[] = [];
|
|
308
361
|
|
|
309
362
|
for (let i = 0; JSONList[i]; i++) {
|
|
310
|
-
result.push(JSONList[i]
|
|
363
|
+
result.push(JSONList[i]);
|
|
311
364
|
}
|
|
312
365
|
|
|
313
366
|
return result;
|
|
@@ -5,6 +5,11 @@ import * as UUID from 'uuid';
|
|
|
5
5
|
export class DyFM_UUID {
|
|
6
6
|
/* static readonly getUUID = UUID.v4; */
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* generates a UUID
|
|
10
|
+
* @param reserved - an array of reserved UUIDs
|
|
11
|
+
* @returns a UUID
|
|
12
|
+
*/
|
|
8
13
|
static generate(reserved?: string[]): string {
|
|
9
14
|
let uuid = UUID.v4();
|
|
10
15
|
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Basic property types used by the framework.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* const type: DyFM_BasicProperty_Type = DyFM_BasicProperty_Type.string;
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
4
12
|
export enum DyFM_BasicProperty_Type {
|
|
5
13
|
string = 'string',
|
|
6
14
|
number = 'number',
|
|
@@ -2,17 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
5
|
+
* Indicates in which layer a given structure is used based on its model type.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* const type = DyFM_DataModel_Type.data;
|
|
10
|
+
* ```
|
|
10
11
|
*/
|
|
11
12
|
export enum DyFM_DataModel_Type {
|
|
12
13
|
data = 'data-model',
|
|
13
14
|
control = 'control-model',
|
|
14
15
|
interface = 'interface',
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Array containing every available data model type.
|
|
20
|
+
*/
|
|
21
|
+
export const DyFM_allDataModelTypes: DyFM_DataModel_Type[] =
|
|
17
22
|
Object.values(DyFM_DataModel_Type);
|
|
18
23
|
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Flags representing the runtime environment of the application.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* if (flag === DyFM_EnvironmentFlag.dev) {
|
|
9
|
+
* console.log('Development environment');
|
|
10
|
+
* }
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
3
13
|
export enum DyFM_EnvironmentFlag {
|
|
4
14
|
local = 'local',
|
|
5
15
|
dev = 'dev',
|
|
@@ -7,4 +17,12 @@ export enum DyFM_EnvironmentFlag {
|
|
|
7
17
|
prod = 'prod',
|
|
8
18
|
}
|
|
9
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Every available environment flag collected into an array.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* console.log(DyFM_allEnvironmentFlags);
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
10
28
|
export const DyFM_allEnvironmentFlags = Object.values(DyFM_EnvironmentFlag);
|
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Severity levels used for logging and error handling.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* if (err.level === DyFM_ErrorLevel.warning) {
|
|
11
|
+
* console.warn('Handle warning');
|
|
12
|
+
* }
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
5
15
|
export enum DyFM_ErrorLevel {
|
|
6
16
|
user = 'user',
|
|
7
17
|
debug = 'debug',
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* Basic HTTP request methods.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* const method: DyFM_HttpCallType = DyFM_HttpCallType.get;
|
|
8
|
+
* ```
|
|
5
9
|
*/
|
|
6
10
|
export enum DyFM_HttpCallType {
|
|
7
11
|
get = 'get',
|
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Names of the days of the week.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const today = DyFM_DayOfWeek.monday;
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
5
13
|
export enum DyFM_DayOfWeek {
|
|
6
14
|
monday = 'monday',
|
|
7
15
|
tuesday = 'tuesday',
|
|
@@ -12,10 +20,13 @@ export enum DyFM_DayOfWeek {
|
|
|
12
20
|
sunday = 'sunday',
|
|
13
21
|
}
|
|
14
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Every day of the week in an array.
|
|
25
|
+
*/
|
|
15
26
|
export const DyFM_allDaysOfWeek = Object.values(DyFM_DayOfWeek);
|
|
16
27
|
|
|
17
28
|
|
|
18
|
-
/**
|
|
29
|
+
/** In U.S. order starting with Sunday */
|
|
19
30
|
export const DyFM_allDaysOfWeekAmericanStyle = [
|
|
20
31
|
DyFM_DayOfWeek.sunday,
|
|
21
32
|
DyFM_DayOfWeek.monday,
|
|
@@ -26,5 +37,6 @@ export const DyFM_allDaysOfWeekAmericanStyle = [
|
|
|
26
37
|
DyFM_DayOfWeek.saturday,
|
|
27
38
|
];
|
|
28
39
|
|
|
40
|
+
/** Same as `DyFM_allDaysOfWeekAmericanStyle`. */
|
|
29
41
|
export const DyFM_allDaysOfWeekStupid = DyFM_allDaysOfWeekAmericanStyle;
|
|
30
42
|
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Human readable identifiers for relative date ranges.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* if (range === DyFM_RelativeDate.lastWeek) {
|
|
10
|
+
* // ...
|
|
11
|
+
* }
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
4
14
|
export enum DyFM_RelativeDate {
|
|
5
15
|
lastDay = 'lastDay',
|
|
6
16
|
lastWeek = 'lastWeek',
|
|
@@ -5,20 +5,20 @@ import { DyFM_DataModel_Type } from '../../_enums/data-model-type.enum';
|
|
|
5
5
|
import { DyFM_Metadata } from '../data-models/metadata.data-model';
|
|
6
6
|
import { DyFM_DataProperties, DyFM_DataProperty_Params } from './data-property-params.control-model';
|
|
7
7
|
|
|
8
|
-
export type DyFM_Data_S<T> = DyFM_DataModel_Settings<T>;
|
|
9
|
-
export type DyFM_Data_Settings<T> = DyFM_DataModel_Settings<T>;
|
|
8
|
+
export type DyFM_Data_S<T extends DyFM_Metadata> = DyFM_DataModel_Settings<T>;
|
|
9
|
+
export type DyFM_Data_Settings<T extends DyFM_Metadata> = DyFM_DataModel_Settings<T>;
|
|
10
10
|
export class DyFM_DataModel_Settings<T extends DyFM_Metadata> extends DyFM_Metadata {
|
|
11
11
|
/** this will be used as db table name, therefore it should be in snake_case,
|
|
12
12
|
* this also will be used in logs and errors
|
|
13
13
|
*/
|
|
14
|
-
dataName
|
|
14
|
+
dataName!: string;
|
|
15
15
|
modelType?: DyFM_DataModel_Type;
|
|
16
16
|
addArchive?: boolean;
|
|
17
|
-
properties
|
|
17
|
+
properties!: DyFM_DataProperties<T>;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export type DyFM_Data_P<T> = DyFM_DataModel_Params<T>;
|
|
21
|
-
export type DyFM_Data_Params<T> = DyFM_DataModel_Params<T>;
|
|
20
|
+
export type DyFM_Data_P<T extends DyFM_Metadata> = DyFM_DataModel_Params<T>;
|
|
21
|
+
export type DyFM_Data_Params<T extends DyFM_Metadata> = DyFM_DataModel_Params<T>;
|
|
22
22
|
export class DyFM_DataModel_Params<T extends DyFM_Metadata> extends DyFM_DataModel_Settings<T> {
|
|
23
23
|
|
|
24
24
|
/* override properties?: DyFM_DataProperties<T>; */
|
|
@@ -11,7 +11,7 @@ export type DyFM_DataPropertySettings<T = any> = DyFM_DataProperty_Settings<T>;
|
|
|
11
11
|
|
|
12
12
|
export class DyFM_DataProperty_Settings<T>{
|
|
13
13
|
key?: string;
|
|
14
|
-
type
|
|
14
|
+
type!: DyFM_BasicProperty_Type | string;
|
|
15
15
|
default?: T;
|
|
16
16
|
|
|
17
17
|
unique?: boolean;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { DyFM_error_defaults } from '../../_collections/constants/error-defaults.const';
|
|
4
4
|
import { DyFM_Log } from '../../_collections/utils/log.util';
|
|
5
|
-
import { DyFM_Error } from './error.control-model';
|
|
5
|
+
import { DyFM_Error, DyFM_Error_Settings } from './error.control-model';
|
|
6
6
|
|
|
7
7
|
function testFormatter(any: any): any {
|
|
8
8
|
if (any instanceof Error) {
|
|
@@ -479,7 +479,7 @@ describe('| DyFM_Error;', (): void => {
|
|
|
479
479
|
});
|
|
480
480
|
|
|
481
481
|
describe('| should have get proper simplified;', (): void => {
|
|
482
|
-
let simplified;
|
|
482
|
+
let simplified: DyFM_Error_Settings;
|
|
483
483
|
|
|
484
484
|
describe('| on error_0;', (): void => {
|
|
485
485
|
beforeEach((): void => {
|
|
@@ -9,6 +9,8 @@ import { DyFM_GlobalLog_Settings } from './global-log-settings.interface';
|
|
|
9
9
|
*
|
|
10
10
|
*/
|
|
11
11
|
export interface DyFM_Global_Settings {
|
|
12
|
+
systemShortCodeName: string;
|
|
13
|
+
|
|
12
14
|
/**
|
|
13
15
|
* this will be used as the main baseUrl for the application,
|
|
14
16
|
* this is not required, but we suggest to use at least a '/api' as base route
|
|
@@ -3,7 +3,12 @@ export type DyFM_Route_S<T> = DyFM_Route_Settings<T>;
|
|
|
3
3
|
export interface DyFM_Route_Settings<T> {
|
|
4
4
|
mainRoute: string;
|
|
5
5
|
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Mapping of route keys to their endpoint paths.
|
|
8
|
+
*
|
|
9
|
+
* The generic type is not fully enforced here, so make sure
|
|
10
|
+
* that the keys correspond to the enum provided for <T>.
|
|
11
|
+
*/
|
|
7
12
|
endPoints: {
|
|
8
13
|
[key in T as string]: string
|
|
9
14
|
};
|