@futdevpro/fsm-dynamo 1.5.74 → 1.5.76
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/lib/_constants/error-defaults.const.d.ts +2 -2
- package/lib/_constants/error-defaults.const.js +11 -11
- package/lib/_constants/index.d.ts +3 -3
- package/lib/_constants/index.js +8 -8
- package/lib/_constants/location/country-codes-ISO-3166.json +3239 -3239
- package/lib/_constants/location/country-divisions-ISO-3166-all-list.json +19036 -19036
- package/lib/_constants/location/country-phone-codes.json +1202 -1202
- package/lib/_constants/module-settings/custom-data-module-settings.const.d.ts +2 -2
- package/lib/_constants/module-settings/custom-data-module-settings.const.js +10 -10
- package/lib/_constants/module-settings/index.d.ts +3 -3
- package/lib/_constants/module-settings/index.js +7 -7
- package/lib/_constants/module-settings/test-module-settings.const.d.ts +2 -2
- package/lib/_constants/module-settings/test-module-settings.const.js +14 -14
- package/lib/_constants/module-settings/usage-module-settings.const.d.ts +2 -2
- package/lib/_constants/module-settings/usage-module-settings.const.js +12 -12
- package/lib/_constants/times.const.d.ts +7 -7
- package/lib/_constants/times.const.js +10 -10
- package/lib/_enums/basic-property-type.enum.d.ts +7 -7
- package/lib/_enums/basic-property-type.enum.js +11 -11
- package/lib/_enums/basic-property-type.enum.js.map +1 -1
- package/lib/_enums/data-model-type.enum.d.ts +5 -5
- package/lib/_enums/data-model-type.enum.js +9 -9
- package/lib/_enums/data-model-type.enum.js.map +1 -1
- package/lib/_enums/index.d.ts +6 -6
- package/lib/_enums/index.js +10 -10
- package/lib/_enums/log-style.enum.d.ts +25 -25
- package/lib/_enums/log-style.enum.js +29 -29
- package/lib/_enums/log-style.enum.js.map +1 -1
- package/lib/_enums/region.enum.d.ts +7 -7
- package/lib/_enums/region.enum.js +11 -11
- package/lib/_enums/region.enum.js.map +1 -1
- package/lib/_enums/sub-region.enum.d.ts +19 -19
- package/lib/_enums/sub-region.enum.js +23 -23
- package/lib/_enums/sub-region.enum.js.map +1 -1
- package/lib/_enums/subdivision-region-type.enum.d.ts +40 -40
- package/lib/_enums/subdivision-region-type.enum.js +45 -45
- package/lib/_enums/subdivision-region-type.enum.js.map +1 -1
- package/lib/_models/control-models/daily-usage-data.control-model.d.ts +11 -11
- package/lib/_models/control-models/daily-usage-data.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/daily-usage-data.control-model.js +17 -16
- package/lib/_models/control-models/daily-usage-data.control-model.js.map +1 -1
- package/lib/_models/control-models/data-params.control-model.d.ts +12 -12
- package/lib/_models/control-models/data-params.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/data-params.control-model.js +22 -19
- package/lib/_models/control-models/data-params.control-model.js.map +1 -1
- package/lib/_models/control-models/data-property-params.control-model.d.ts +28 -28
- package/lib/_models/control-models/data-property-params.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/data-property-params.control-model.js +69 -54
- package/lib/_models/control-models/data-property-params.control-model.js.map +1 -1
- package/lib/_models/control-models/error.control-model.d.ts +281 -281
- package/lib/_models/control-models/error.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/error.control-model.js +180 -173
- package/lib/_models/control-models/error.control-model.js.map +1 -1
- package/lib/_models/control-models/error.control-model.spec.d.ts +1 -1
- package/lib/_models/control-models/error.control-model.spec.js +551 -573
- package/lib/_models/control-models/error.control-model.spec.js.map +1 -1
- package/lib/_models/control-models/index.d.ts +9 -9
- package/lib/_models/control-models/index.js +13 -13
- package/lib/_models/control-models/poll.control-model.d.ts +31 -31
- package/lib/_models/control-models/poll.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/poll.control-model.js +95 -87
- package/lib/_models/control-models/poll.control-model.js.map +1 -1
- package/lib/_models/control-models/range-value.control-model.d.ts +7 -7
- package/lib/_models/control-models/range-value.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/range-value.control-model.js +12 -10
- package/lib/_models/control-models/range-value.control-model.js.map +1 -1
- package/lib/_models/control-models/usage-action.control-model.d.ts +6 -6
- package/lib/_models/control-models/usage-action.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/usage-action.control-model.js +14 -12
- package/lib/_models/control-models/usage-action.control-model.js.map +1 -1
- package/lib/_models/control-models/usage-data.control-model.d.ts +10 -10
- package/lib/_models/control-models/usage-data.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/usage-data.control-model.js +15 -12
- package/lib/_models/control-models/usage-data.control-model.js.map +1 -1
- package/lib/_models/data-models/custom-data.data-model.d.ts +9 -9
- package/lib/_models/data-models/custom-data.data-model.d.ts.map +1 -1
- package/lib/_models/data-models/custom-data.data-model.js +21 -20
- package/lib/_models/data-models/custom-data.data-model.js.map +1 -1
- package/lib/_models/data-models/index.d.ts +3 -3
- package/lib/_models/data-models/index.js +7 -7
- package/lib/_models/data-models/metadata.data-model.d.ts +14 -14
- package/lib/_models/data-models/metadata.data-model.d.ts.map +1 -1
- package/lib/_models/data-models/metadata.data-model.js +45 -39
- package/lib/_models/data-models/metadata.data-model.js.map +1 -1
- package/lib/_models/data-models/usage-session.data-model.d.ts +18 -18
- package/lib/_models/data-models/usage-session.data-model.d.ts.map +1 -1
- package/lib/_models/data-models/usage-session.data-model.js +44 -36
- package/lib/_models/data-models/usage-session.data-model.js.map +1 -1
- package/lib/_models/index.d.ts +3 -3
- package/lib/_models/index.js +10 -10
- package/lib/_models/interfaces/error-defaults.interface.d.ts +8 -8
- package/lib/_models/interfaces/error-defaults.interface.js +2 -2
- package/lib/_models/interfaces/index.d.ts +4 -4
- package/lib/_models/interfaces/index.js +9 -9
- package/lib/_models/interfaces/location/country-division.interface.d.ts +5 -5
- package/lib/_models/interfaces/location/country-division.interface.js +2 -2
- package/lib/_models/interfaces/location/country-iso.interface.d.ts +18 -18
- package/lib/_models/interfaces/location/country-iso.interface.js +2 -2
- package/lib/_models/interfaces/location/country-phone-code.interface.d.ts +5 -5
- package/lib/_models/interfaces/location/country-phone-code.interface.js +2 -2
- package/lib/_models/interfaces/location/division-collection.interface.d.ts +8 -8
- package/lib/_models/interfaces/location/division-collection.interface.js +2 -2
- package/lib/_models/interfaces/location/division-region-data.interface.d.ts +5 -5
- package/lib/_models/interfaces/location/division-region-data.interface.js +2 -2
- package/lib/_models/interfaces/location/geo-ip-location.interface.d.ts +25 -25
- package/lib/_models/interfaces/location/geo-ip-location.interface.js +2 -2
- package/lib/_models/interfaces/location/index.d.ts +7 -7
- package/lib/_models/interfaces/location/index.js +11 -11
- package/lib/_models/interfaces/location/location-coordinates.interface.d.ts +4 -4
- package/lib/_models/interfaces/location/location-coordinates.interface.js +2 -2
- package/lib/_models/interfaces/random-weight.interface.d.ts +4 -4
- package/lib/_models/interfaces/random-weight.interface.js +2 -2
- package/lib/_models/interfaces/route-settings.interface.d.ts +8 -8
- package/lib/_models/interfaces/route-settings.interface.d.ts.map +1 -1
- package/lib/_models/interfaces/route-settings.interface.js +2 -2
- package/lib/_modules/collections.index.d.ts +1 -1
- package/lib/_modules/collections.index.js +4 -4
- package/lib/_modules/constants.index.d.ts +1 -1
- package/lib/_modules/constants.index.js +4 -4
- package/lib/_modules/custom-data-module.index.d.ts +2 -2
- package/lib/_modules/custom-data-module.index.js +6 -6
- package/lib/_modules/data-modules.index.d.ts +5 -5
- package/lib/_modules/data-modules.index.js +9 -9
- package/lib/_modules/enums.index.d.ts +1 -1
- package/lib/_modules/enums.index.js +4 -4
- package/lib/_modules/error-module.index.d.ts +3 -3
- package/lib/_modules/error-module.index.js +7 -7
- package/lib/_modules/location.index.d.ts +7 -0
- package/lib/_modules/location.index.d.ts.map +1 -0
- package/lib/_modules/location.index.js +13 -0
- package/lib/_modules/location.index.js.map +1 -0
- package/lib/_modules/models.index.d.ts +1 -1
- package/lib/_modules/models.index.js +4 -4
- package/lib/_modules/shared-service.index.d.ts +7 -7
- package/lib/_modules/shared-service.index.js +11 -11
- package/lib/_modules/test-module.index.d.ts +1 -1
- package/lib/_modules/test-module.index.js +5 -5
- package/lib/_modules/usage-module.index.d.ts +5 -5
- package/lib/_modules/usage-module.index.js +9 -9
- package/lib/_utils/array.util.d.ts +7 -7
- package/lib/_utils/array.util.d.ts.map +1 -1
- package/lib/_utils/array.util.js +32 -37
- package/lib/_utils/array.util.js.map +1 -1
- package/lib/_utils/array.util.spec.d.ts +1 -1
- package/lib/_utils/array.util.spec.js +29 -30
- package/lib/_utils/array.util.spec.js.map +1 -1
- package/lib/_utils/index.d.ts +13 -13
- package/lib/_utils/index.js +17 -17
- package/lib/_utils/location.util.d.ts +6 -6
- package/lib/_utils/location.util.d.ts.map +1 -1
- package/lib/_utils/location.util.js +39 -39
- package/lib/_utils/log.util.d.ts +54 -54
- package/lib/_utils/log.util.d.ts.map +1 -1
- package/lib/_utils/log.util.js +189 -189
- package/lib/_utils/log.util.js.map +1 -1
- package/lib/_utils/metadata.util.d.ts +4 -4
- package/lib/_utils/metadata.util.js +24 -24
- package/lib/_utils/random.util.d.ts +8 -8
- package/lib/_utils/random.util.d.ts.map +1 -1
- package/lib/_utils/random.util.js +59 -59
- package/lib/_utils/random.util.js.map +1 -1
- package/lib/_utils/regex.util.d.ts +1 -1
- package/lib/_utils/regex.util.js +4 -4
- package/lib/_utils/regions.util.d.ts +16 -16
- package/lib/_utils/regions.util.d.ts.map +1 -1
- package/lib/_utils/regions.util.js +66 -67
- package/lib/_utils/regions.util.js.map +1 -1
- package/lib/_utils/round-list.util.d.ts +8 -8
- package/lib/_utils/round-list.util.d.ts.map +1 -1
- package/lib/_utils/round-list.util.js +38 -38
- package/lib/_utils/shared.static-service.d.ts +73 -73
- package/lib/_utils/shared.static-service.d.ts.map +1 -1
- package/lib/_utils/shared.static-service.js +150 -150
- package/lib/_utils/shared.static-service.js.map +1 -1
- package/lib/_utils/time.util.d.ts +13 -13
- package/lib/_utils/time.util.d.ts.map +1 -1
- package/lib/_utils/time.util.js +40 -40
- package/lib/_utils/trigonometry.util.d.ts +45 -45
- package/lib/_utils/trigonometry.util.d.ts.map +1 -1
- package/lib/_utils/trigonometry.util.js +61 -61
- package/lib/_utils/utilities.util.d.ts +36 -36
- package/lib/_utils/utilities.util.js +94 -94
- package/lib/_utils/vector.util.d.ts +37 -37
- package/lib/_utils/vector.util.js +109 -106
- package/lib/_utils/vector.util.js.map +1 -1
- package/lib/index.d.ts +4 -4
- package/lib/index.js +11 -11
- package/lib/tsconfig.tsbuildinfo +1 -3519
- package/nodemon.json +7 -4
- package/package.json +28 -15
- package/src/_models/control-models/error.control-model.spec.ts +1 -1
- package/src/_models/control-models/error.control-model.ts +1 -1
- package/src/_modules/location.index.ts +15 -0
- package/tsconfig.json +2 -1
- package/src/sync.ffs_db +0 -0
|
@@ -1,174 +1,181 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Dynamo_Error = void 0;
|
|
4
|
-
const error_defaults_const_1 = require("../../_constants/error-defaults.const");
|
|
5
|
-
const log_util_1 = require("../../_utils/log.util");
|
|
6
|
-
const metadata_data_model_1 = require("../data-models/metadata.data-model");
|
|
7
|
-
class Dynamo_Error extends metadata_data_model_1.Dynamo_Metadata {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
/** set
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if (!set
|
|
46
|
-
set.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
if (
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}
|
|
173
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Dynamo_Error = void 0;
|
|
4
|
+
const error_defaults_const_1 = require("../../_constants/error-defaults.const");
|
|
5
|
+
const log_util_1 = require("../../_utils/log.util");
|
|
6
|
+
const metadata_data_model_1 = require("../data-models/metadata.data-model");
|
|
7
|
+
class Dynamo_Error extends metadata_data_model_1.Dynamo_Metadata {
|
|
8
|
+
flag = 'DYNAMO-ERROR-OBJECT-v2';
|
|
9
|
+
_errorCode;
|
|
10
|
+
_errorCodes = [];
|
|
11
|
+
/** contains all sub error messages, in reversed order */
|
|
12
|
+
_message;
|
|
13
|
+
_messages = [];
|
|
14
|
+
__userMessage;
|
|
15
|
+
/** contains all sub error messages, in reversed order */
|
|
16
|
+
__userMessages = [];
|
|
17
|
+
___handled;
|
|
18
|
+
___status;
|
|
19
|
+
___issuer;
|
|
20
|
+
___issuerSystem;
|
|
21
|
+
___issuerService;
|
|
22
|
+
error;
|
|
23
|
+
errors = [];
|
|
24
|
+
levelUpThis;
|
|
25
|
+
additionalContent;
|
|
26
|
+
constructor(set) {
|
|
27
|
+
super(set, { issuer: set?.issuerService ?? set?.error?.___issuerService ?? error_defaults_const_1.dynamo_error_default.issuerService });
|
|
28
|
+
try {
|
|
29
|
+
if (!set) {
|
|
30
|
+
set = {};
|
|
31
|
+
}
|
|
32
|
+
/** set simple properties */
|
|
33
|
+
this.___handled = Boolean(set?.handled ?? set?.error?.___handled);
|
|
34
|
+
this.___status = set?.status ?? set?.error?.___status;
|
|
35
|
+
this.___issuer = set?.issuer ?? set?.error?.___issuer ?? error_defaults_const_1.dynamo_error_default.issuer;
|
|
36
|
+
this.___issuerSystem = set?.issuerSystem ?? set?.error?.___issuerSystem ?? error_defaults_const_1.dynamo_error_default.issuerSystem;
|
|
37
|
+
this.___issuerService = set?.issuerService ?? set?.error?.___issuerService ?? error_defaults_const_1.dynamo_error_default.issuerService;
|
|
38
|
+
this.levelUpThis = set?.levelUpThis;
|
|
39
|
+
this.additionalContent = set?.additionalContent;
|
|
40
|
+
/** set default error code */
|
|
41
|
+
if (!set.errorCode) {
|
|
42
|
+
set.errorCode = error_defaults_const_1.dynamo_error_default.errorCode;
|
|
43
|
+
}
|
|
44
|
+
/** set default error (self defined) */
|
|
45
|
+
if (!set?.error) {
|
|
46
|
+
set.error = new Error();
|
|
47
|
+
const errorStack = set.error.stack.split('\n');
|
|
48
|
+
errorStack.splice(1, 1);
|
|
49
|
+
set.error.stack = errorStack.join('\n');
|
|
50
|
+
}
|
|
51
|
+
/** set errorCodes */
|
|
52
|
+
const previousErrorCodes = [];
|
|
53
|
+
if (set?.error?._errorCodes) {
|
|
54
|
+
previousErrorCodes.push(...set?.error?._errorCodes);
|
|
55
|
+
}
|
|
56
|
+
if (!set.errorCode) {
|
|
57
|
+
set.errorCode = error_defaults_const_1.dynamo_error_default.errorCode;
|
|
58
|
+
}
|
|
59
|
+
/* if (this.levelUpThis) */
|
|
60
|
+
this._errorCodes = [...previousErrorCodes, set?.errorCode].filter(Boolean);
|
|
61
|
+
/** bring up non NTS and non default first error */
|
|
62
|
+
const filteredErrorCodes = this._errorCodes.filter((code) => code && code !== error_defaults_const_1.dynamo_error_default.errorCode && !code.includes('NTS-'));
|
|
63
|
+
this._errorCode = filteredErrorCodes[0] ?? this._errorCodes?.[0];
|
|
64
|
+
const highlightedErrorCodeIndex = this._errorCodes.findIndex(code => code === filteredErrorCodes?.[0]);
|
|
65
|
+
/** set message */
|
|
66
|
+
if (!set.message) {
|
|
67
|
+
/** simple - non-dynamo - error */
|
|
68
|
+
if (!set?.error?.flag?.includes('DYNAMO') && set?.error?.message) {
|
|
69
|
+
set.message = set?.error?.message;
|
|
70
|
+
}
|
|
71
|
+
else if (set.error.stack) {
|
|
72
|
+
/** error not defined - self defining */
|
|
73
|
+
const posFull = set.error.stack.split('\n')?.[1]?.split('\\');
|
|
74
|
+
set.message = error_defaults_const_1.dynamo_error_default.message + '; ' + posFull[posFull.length - 1];
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/** set messages */
|
|
78
|
+
const previousMessages = [];
|
|
79
|
+
if (set?.error?._messages) {
|
|
80
|
+
previousMessages.push(...set?.error?._messages);
|
|
81
|
+
}
|
|
82
|
+
else if (set?.error?.message) {
|
|
83
|
+
previousErrorCodes.push(set?.error?.message);
|
|
84
|
+
}
|
|
85
|
+
this._messages = [...previousMessages, set?.message,].filter(Boolean);
|
|
86
|
+
if (-1 < highlightedErrorCodeIndex && this._messages[highlightedErrorCodeIndex] && this._messages[highlightedErrorCodeIndex] !== error_defaults_const_1.dynamo_error_default.message) {
|
|
87
|
+
this._message = this._messages[highlightedErrorCodeIndex];
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
this._message = this._messages?.[0];
|
|
91
|
+
}
|
|
92
|
+
/** set userMessages */
|
|
93
|
+
const previousUserMessages = [];
|
|
94
|
+
if (set?.error?.__userMessages) {
|
|
95
|
+
previousUserMessages.push(...set?.error?.__userMessages);
|
|
96
|
+
}
|
|
97
|
+
if (!set.userMessage) {
|
|
98
|
+
set.userMessage = error_defaults_const_1.dynamo_error_default.userMessage;
|
|
99
|
+
}
|
|
100
|
+
if (set.addECToUserMsg && set.userMessage !== error_defaults_const_1.dynamo_error_default.userMessage && set.errorCode) {
|
|
101
|
+
set.userMessage += `\nErrorCode: ${set.errorCode}`;
|
|
102
|
+
}
|
|
103
|
+
this.__userMessages = [...previousUserMessages, set?.userMessage].filter(Boolean);
|
|
104
|
+
if (-1 < highlightedErrorCodeIndex && this.__userMessages[highlightedErrorCodeIndex] && this.__userMessages[highlightedErrorCodeIndex] !== error_defaults_const_1.dynamo_error_default.userMessage) {
|
|
105
|
+
this.__userMessage = this.__userMessages[highlightedErrorCodeIndex];
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
this.__userMessage = this.__userMessages.filter((msg) => msg && msg !== error_defaults_const_1.dynamo_error_default.userMessage)?.[0];
|
|
109
|
+
}
|
|
110
|
+
/** set errors */
|
|
111
|
+
const previousErrors = [];
|
|
112
|
+
if (set?.error?.errors) {
|
|
113
|
+
previousErrors.push(...set?.error?.errors);
|
|
114
|
+
}
|
|
115
|
+
this.errors = [...previousErrors, set?.error].filter(Boolean);
|
|
116
|
+
if (set?.errors) {
|
|
117
|
+
if (0 < this.errors.length) {
|
|
118
|
+
this.errors.push(...set?.errors);
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
this.errors.push(new Error('there are multiple errors. check errors after this one'), ...set?.errors);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
this.error = this.errors?.[0];
|
|
125
|
+
this.errors.map((error) => {
|
|
126
|
+
if (error?.flag?.includes('DYNAMO')) {
|
|
127
|
+
const subError = { ...error };
|
|
128
|
+
if (subError?.errors) {
|
|
129
|
+
delete subError.errors;
|
|
130
|
+
}
|
|
131
|
+
return subError;
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
if (set?.modestLog) {
|
|
135
|
+
console.error(this._message ?? this.__userMessage ?? this.error);
|
|
136
|
+
}
|
|
137
|
+
if (set?.log) {
|
|
138
|
+
console.error(this);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
log_util_1.Dynamo_Log.error('\n\nInternal Dynamo ERROR: Failed to create Dynamo_Error...' +
|
|
143
|
+
'\nerror:\n', error, '\n\ntrace:', new Error(), '\n\nset:', set, '\n\n');
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
getErrorSimplified() {
|
|
147
|
+
const error = { ...this };
|
|
148
|
+
delete error.errors;
|
|
149
|
+
if (error.error?.error) {
|
|
150
|
+
delete error.error.error;
|
|
151
|
+
}
|
|
152
|
+
if (error.error?.errors) {
|
|
153
|
+
delete error.error.errors;
|
|
154
|
+
}
|
|
155
|
+
return error;
|
|
156
|
+
}
|
|
157
|
+
getErrorsFlat() {
|
|
158
|
+
const error = { ...this };
|
|
159
|
+
if (error.error?.error) {
|
|
160
|
+
delete error.error.error;
|
|
161
|
+
}
|
|
162
|
+
if (error.error?.errors) {
|
|
163
|
+
delete error.error.errors;
|
|
164
|
+
}
|
|
165
|
+
error.errors.map((err) => {
|
|
166
|
+
const subError = { ...err };
|
|
167
|
+
if (subError.errors) {
|
|
168
|
+
delete subError.errors;
|
|
169
|
+
}
|
|
170
|
+
if (subError.error?.errors) {
|
|
171
|
+
delete subError.error.errors;
|
|
172
|
+
}
|
|
173
|
+
if (subError.error?.error) {
|
|
174
|
+
delete subError.error.error;
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
return error;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
exports.Dynamo_Error = Dynamo_Error;
|
|
174
181
|
//# sourceMappingURL=error.control-model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.control-model.js","sourceRoot":"","sources":["../../../src/_models/control-models/error.control-model.ts"],"names":[],"mappings":";;;AAAA,gFAA6E;AAC7E,oDAAmD;AACnD,4EAAqE;AAIrE,MAAa,YAAa,SAAQ,qCAAe;
|
|
1
|
+
{"version":3,"file":"error.control-model.js","sourceRoot":"","sources":["../../../src/_models/control-models/error.control-model.ts"],"names":[],"mappings":";;;AAAA,gFAA6E;AAC7E,oDAAmD;AACnD,4EAAqE;AAIrE,MAAa,YAAa,SAAQ,qCAAe;IACtC,IAAI,GAAG,wBAAwB,CAAC;IAEzC,UAAU,CAAU;IACpB,WAAW,GAAc,EAAE,CAAC;IAE5B,yDAAyD;IACzD,QAAQ,CAAU;IAClB,SAAS,GAAc,EAAE,CAAC;IAE1B,aAAa,CAAU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