@nu-art/ts-common 0.300.7 → 0.400.0
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/consts/consts.js +2 -4
- package/consts/consts.js.map +1 -0
- package/core/application.d.ts +1 -1
- package/core/application.js +3 -6
- package/core/application.js.map +1 -0
- package/core/debug-flags.d.ts +1 -1
- package/core/debug-flags.js +15 -17
- package/core/debug-flags.js.map +1 -0
- package/core/dispatcher.d.ts +2 -2
- package/core/dispatcher.js +7 -8
- package/core/dispatcher.js.map +1 -0
- package/core/error-handling.d.ts +5 -5
- package/core/error-handling.js +7 -9
- package/core/error-handling.js.map +1 -0
- package/core/exceptions/exceptions.d.ts +2 -2
- package/core/exceptions/exceptions.js +33 -44
- package/core/exceptions/exceptions.js.map +1 -0
- package/core/exceptions/http-codes.d.ts +8 -2
- package/core/exceptions/http-codes.js +6 -6
- package/core/exceptions/http-codes.js.map +1 -0
- package/core/exceptions/types.js +2 -2
- package/core/exceptions/types.js.map +1 -0
- package/core/logger/BeLogged.d.ts +2 -2
- package/core/logger/BeLogged.js +9 -11
- package/core/logger/BeLogged.js.map +1 -0
- package/core/logger/LogClient.d.ts +3 -1
- package/core/logger/LogClient.js +21 -24
- package/core/logger/LogClient.js.map +1 -0
- package/core/logger/LogClient_BaseRotate.d.ts +2 -2
- package/core/logger/LogClient_BaseRotate.js +12 -12
- package/core/logger/LogClient_BaseRotate.js.map +1 -0
- package/core/logger/LogClient_Browser.d.ts +2 -2
- package/core/logger/LogClient_Browser.js +40 -45
- package/core/logger/LogClient_Browser.js.map +1 -0
- package/core/logger/LogClient_BrowserGroups.d.ts +2 -2
- package/core/logger/LogClient_BrowserGroups.js +65 -67
- package/core/logger/LogClient_BrowserGroups.js.map +1 -0
- package/core/logger/LogClient_ConsoleProxy.d.ts +23 -0
- package/core/logger/LogClient_ConsoleProxy.js +89 -0
- package/core/logger/LogClient_ConsoleProxy.js.map +1 -0
- package/core/logger/LogClient_File.d.ts +1 -1
- package/core/logger/LogClient_File.js +6 -30
- package/core/logger/LogClient_File.js.map +1 -0
- package/core/logger/LogClient_Function.d.ts +2 -2
- package/core/logger/LogClient_Function.js +6 -8
- package/core/logger/LogClient_Function.js.map +1 -0
- package/core/logger/LogClient_MemBuffer.d.ts +2 -2
- package/core/logger/LogClient_MemBuffer.js +19 -21
- package/core/logger/LogClient_MemBuffer.js.map +1 -0
- package/core/logger/LogClient_Terminal.d.ts +2 -2
- package/core/logger/LogClient_Terminal.js +16 -21
- package/core/logger/LogClient_Terminal.js.map +1 -0
- package/core/logger/Logger.d.ts +2 -2
- package/core/logger/Logger.js +37 -39
- package/core/logger/Logger.js.map +1 -0
- package/core/logger/types.js +4 -6
- package/core/logger/types.js.map +1 -0
- package/core/logger/utils.d.ts +1 -1
- package/core/logger/utils.js +10 -15
- package/core/logger/utils.js.map +1 -0
- package/core/module-manager.d.ts +8 -6
- package/core/module-manager.js +28 -26
- package/core/module-manager.js.map +1 -0
- package/core/module.d.ts +5 -5
- package/core/module.js +28 -28
- package/core/module.js.map +1 -0
- package/csv.d.ts +2 -2
- package/csv.js +3 -18
- package/csv.js.map +1 -0
- package/db/consts.d.ts +3 -0
- package/db/consts.js +17 -7
- package/db/consts.js.map +1 -0
- package/db/dependencies-test.js +2 -2
- package/db/dependencies-test.js.map +1 -0
- package/db/types.d.ts +10 -2
- package/db/types.js +2 -2
- package/db/types.js.map +1 -0
- package/esm.d.ts +1 -0
- package/esm.js +4 -0
- package/esm.js.map +1 -0
- package/index.d.ts +50 -49
- package/index.js +51 -65
- package/index.js.map +1 -0
- package/mem-storage/MemStorage.d.ts +3 -1
- package/mem-storage/MemStorage.js +90 -72
- package/mem-storage/MemStorage.js.map +1 -0
- package/mem-storage/index.d.ts +1 -0
- package/mem-storage/index.js +2 -0
- package/mem-storage/index.js.map +1 -0
- package/modules/CSVModule.d.ts +2 -2
- package/modules/CSVModule.js +22 -48
- package/modules/CSVModule.js.map +1 -0
- package/modules/CSVModuleV3.d.ts +2 -2
- package/modules/CSVModuleV3.js +60 -86
- package/modules/CSVModuleV3.js.map +1 -0
- package/modules/CliParamsModule.d.ts +2 -2
- package/modules/CliParamsModule.js +23 -28
- package/modules/CliParamsModule.js.map +1 -0
- package/modules/JSONCSVModule.d.ts +2 -2
- package/modules/JSONCSVModule.js +56 -78
- package/modules/JSONCSVModule.js.map +1 -0
- package/modules/csv-serializer.d.ts +1 -1
- package/modules/csv-serializer.js +11 -5
- package/modules/csv-serializer.js.map +1 -0
- package/package.json +20 -11
- package/replacer-v2/ReplacerV2.d.ts +1 -1
- package/replacer-v2/ReplacerV2.js +6 -9
- package/replacer-v2/ReplacerV2.js.map +1 -0
- package/test-index.d.ts +2 -2
- package/test-index.js +3 -18
- package/test-index.js.map +1 -0
- package/testing/consts.d.ts +13 -2
- package/testing/consts.js +66 -26
- package/testing/consts.js.map +1 -0
- package/testing/test-template.test.d.ts +1 -0
- package/testing/test-template.test.js +42 -0
- package/testing/test-template.test.js.map +1 -0
- package/testing/types.d.ts +17 -5
- package/testing/types.js +2 -2
- package/testing/types.js.map +1 -0
- package/testing/workspace-creator.d.ts +10 -0
- package/testing/workspace-creator.js +79 -0
- package/testing/workspace-creator.js.map +1 -0
- package/tools/Replacer.d.ts +2 -2
- package/tools/Replacer.js +22 -24
- package/tools/Replacer.js.map +1 -0
- package/tools/get-log-style.js +4 -6
- package/tools/get-log-style.js.map +1 -0
- package/utils/FileSystemUtils.d.ts +34 -0
- package/utils/FileSystemUtils.js +153 -0
- package/utils/FileSystemUtils.js.map +1 -0
- package/utils/array-tools.d.ts +4 -4
- package/utils/array-tools.js +56 -83
- package/utils/array-tools.js.map +1 -0
- package/utils/conflict-tools.d.ts +1 -0
- package/utils/conflict-tools.js +3 -0
- package/utils/conflict-tools.js.map +1 -0
- package/utils/crypto-tools.d.ts +44 -0
- package/utils/crypto-tools.js +101 -10
- package/utils/crypto-tools.js.map +1 -0
- package/utils/date-time-tools.d.ts +48 -4
- package/utils/date-time-tools.js +166 -64
- package/utils/date-time-tools.js.map +1 -0
- package/utils/db-object-tools.d.ts +7 -2
- package/utils/db-object-tools.js +20 -20
- package/utils/db-object-tools.js.map +1 -0
- package/utils/exception-tools.js +13 -15
- package/utils/exception-tools.js.map +1 -0
- package/utils/filter-tools.js +48 -48
- package/utils/filter-tools.js.map +1 -0
- package/utils/hash-tools.js +14 -22
- package/utils/hash-tools.js.map +1 -0
- package/utils/index.d.ts +27 -0
- package/utils/index.js +28 -0
- package/utils/index.js.map +1 -0
- package/utils/json-tools.js +5 -8
- package/utils/json-tools.js.map +1 -0
- package/utils/merge-tools.d.ts +9 -0
- package/utils/merge-tools.js +18 -19
- package/utils/merge-tools.js.map +1 -0
- package/utils/mimetype-tools.d.ts +1 -0
- package/utils/mimetype-tools.js +26 -27
- package/utils/mimetype-tools.js.map +1 -0
- package/utils/number-tools.js +3 -7
- package/utils/number-tools.js.map +1 -0
- package/utils/object-tools.d.ts +15 -1
- package/utils/object-tools.js +110 -33
- package/utils/object-tools.js.map +1 -0
- package/utils/promise-tools.d.ts +5 -0
- package/utils/promise-tools.js +9 -5
- package/utils/promise-tools.js.map +1 -0
- package/utils/query-params.js +3 -6
- package/utils/query-params.js.map +1 -0
- package/utils/queue-v2.d.ts +1 -1
- package/utils/queue-v2.js +72 -73
- package/utils/queue-v2.js.map +1 -0
- package/utils/queue.d.ts +1 -1
- package/utils/queue.js +15 -17
- package/utils/queue.js.map +1 -0
- package/utils/random-tools.js +7 -11
- package/utils/random-tools.js.map +1 -0
- package/utils/storage-capacity-tools.js +7 -9
- package/utils/storage-capacity-tools.js.map +1 -0
- package/utils/string-tools.js +17 -31
- package/utils/string-tools.js.map +1 -0
- package/utils/time-proxy.d.ts +8 -0
- package/utils/time-proxy.js +10 -0
- package/utils/time-proxy.js.map +1 -0
- package/utils/tools.d.ts +1 -1
- package/utils/tools.js +18 -28
- package/utils/tools.js.map +1 -0
- package/utils/types.d.ts +9 -3
- package/utils/types.js +2 -4
- package/utils/types.js.map +1 -0
- package/utils/ui-tools.js +6 -12
- package/utils/ui-tools.js.map +1 -0
- package/utils/url-tools.d.ts +5 -0
- package/utils/url-tools.js +20 -0
- package/utils/url-tools.js.map +1 -0
- package/utils/version-tools.js +17 -12
- package/utils/version-tools.js.map +1 -0
- package/validator/type-validators.d.ts +14 -10
- package/validator/type-validators.js +84 -105
- package/validator/type-validators.js.map +1 -0
- package/validator/validator-core.d.ts +4 -4
- package/validator/validator-core.js +16 -21
- package/validator/validator-core.js.map +1 -0
- package/validator/validators.d.ts +9 -5
- package/validator/validators.js +48 -47
- package/validator/validators.js.map +1 -0
- package/tsconfig.json +0 -23
package/consts/consts.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* ts-common is the basic building blocks of our typescript projects
|
|
4
3
|
*
|
|
@@ -16,6 +15,5 @@
|
|
|
16
15
|
* See the License for the specific language governing permissions and
|
|
17
16
|
* limitations under the License.
|
|
18
17
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
exports._U = undefined;
|
|
18
|
+
export const _U = undefined;
|
|
19
|
+
//# sourceMappingURL=consts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.js","sourceRoot":"/Users/tacb0ss/dev/nu-art/beamz/_thunderstorm/ts-common/src/main/","sources":["consts/consts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,CAAC,MAAM,EAAE,GAAG,SAAS,CAAC"}
|
package/core/application.d.ts
CHANGED
package/core/application.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* ts-common is the basic building blocks of our typescript projects
|
|
4
3
|
*
|
|
@@ -16,10 +15,8 @@
|
|
|
16
15
|
* See the License for the specific language governing permissions and
|
|
17
16
|
* limitations under the License.
|
|
18
17
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const module_manager_1 = require("./module-manager");
|
|
22
|
-
class Application extends module_manager_1.ModuleManager {
|
|
18
|
+
import { ModuleManager } from "./module-manager.js";
|
|
19
|
+
export class Application extends ModuleManager {
|
|
23
20
|
constructor() {
|
|
24
21
|
super();
|
|
25
22
|
}
|
|
@@ -33,4 +30,4 @@ class Application extends module_manager_1.ModuleManager {
|
|
|
33
30
|
.catch((err) => this.logError("Error", err));
|
|
34
31
|
}
|
|
35
32
|
}
|
|
36
|
-
|
|
33
|
+
//# sourceMappingURL=application.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"application.js","sourceRoot":"/Users/tacb0ss/dev/nu-art/beamz/_thunderstorm/ts-common/src/main/","sources":["core/application.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAElD,MAAM,OAAO,WACZ,SAAQ,aAAa;IAErB;QACC,KAAK,EAAE,CAAC;IACT,CAAC;IAED,KAAK,CAAC,SAA8B;QACnC,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,SAAS,IAAI,SAAS,EAAE;aACtB,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;YACd,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YACrC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAC3B,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;IAC/C,CAAC;CACD"}
|
package/core/debug-flags.d.ts
CHANGED
package/core/debug-flags.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* ts-common is the basic building blocks of our typescript projects
|
|
4
3
|
*
|
|
@@ -16,11 +15,12 @@
|
|
|
16
15
|
* See the License for the specific language governing permissions and
|
|
17
16
|
* limitations under the License.
|
|
18
17
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
import { addItemToArray, removeItemFromArray } from '../utils/array-tools.js';
|
|
19
|
+
import { LogLevel, LogLevelOrdinal } from './logger/types.js';
|
|
20
|
+
export class DebugFlag {
|
|
21
|
+
static DefaultLogLevel = LogLevel.Info;
|
|
22
|
+
key;
|
|
23
|
+
minLogLevel;
|
|
24
24
|
constructor(key, minLogLevel = DebugFlag.DefaultLogLevel) {
|
|
25
25
|
this.key = key;
|
|
26
26
|
this.minLogLevel = minLogLevel;
|
|
@@ -47,23 +47,22 @@ class DebugFlag {
|
|
|
47
47
|
return DebugFlags.instance.ActiveDebugFlags.includes(this.key);
|
|
48
48
|
}
|
|
49
49
|
canLog(level) {
|
|
50
|
-
return
|
|
50
|
+
return LogLevelOrdinal.indexOf(level) >= LogLevelOrdinal.indexOf(this.minLogLevel);
|
|
51
51
|
}
|
|
52
52
|
_enable() {
|
|
53
|
-
|
|
53
|
+
addItemToArray(DebugFlags.instance.ActiveDebugFlags, this.key);
|
|
54
54
|
}
|
|
55
55
|
_disable() {
|
|
56
|
-
|
|
56
|
+
removeItemFromArray(DebugFlags.instance.ActiveDebugFlags, this.key);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
export class DebugFlags {
|
|
60
|
+
static instance = new DebugFlags();
|
|
61
|
+
AllDebugFlags = {};
|
|
62
|
+
ActiveDebugFlags = [];
|
|
62
63
|
constructor() {
|
|
63
|
-
this.AllDebugFlags = {};
|
|
64
|
-
this.ActiveDebugFlags = [];
|
|
65
64
|
}
|
|
66
|
-
static createFlag(key, minLogLevel =
|
|
65
|
+
static createFlag(key, minLogLevel = DebugFlag.DefaultLogLevel) {
|
|
67
66
|
// @ts-ignore
|
|
68
67
|
return new DebugFlag(key, minLogLevel);
|
|
69
68
|
}
|
|
@@ -78,5 +77,4 @@ class DebugFlags {
|
|
|
78
77
|
this.instance.AllDebugFlags[newKey] = flag;
|
|
79
78
|
}
|
|
80
79
|
}
|
|
81
|
-
|
|
82
|
-
DebugFlags.instance = new DebugFlags();
|
|
80
|
+
//# sourceMappingURL=debug-flags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug-flags.js","sourceRoot":"/Users/tacb0ss/dev/nu-art/beamz/_thunderstorm/ts-common/src/main/","sources":["core/debug-flags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,cAAc,EAAE,mBAAmB,EAAC,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAC,QAAQ,EAAE,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAG5D,MAAM,OAAO,SAAS;IAEd,MAAM,CAAC,eAAe,GAAG,QAAQ,CAAC,IAAI,CAAC;IAC7B,GAAG,CAAS;IACrB,WAAW,CAAW;IAE9B,YAAoB,GAAW,EAAE,cAAwB,SAAS,CAAC,eAAe;QACjF,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAE/B,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IAED,WAAW,CAAC,WAAqB;QAChC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IAChC,CAAC;IAED,MAAM,CAAC,MAAc;QACpB,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACrC,CAAC;IAED,MAAM;QACL,OAAO,IAAI,CAAC,GAAG,CAAC;IACjB,CAAC;IAED,MAAM,CAAC,MAAM,GAAG,IAAI;QACnB,IAAI,IAAI,CAAC,SAAS,EAAE,KAAK,MAAM;YAC9B,OAAO;QAER,IAAI,MAAM;YACT,IAAI,CAAC,OAAO,EAAE,CAAC;;YAEf,IAAI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AAQ,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAC5C,CAAC"}
|
package/core/dispatcher.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FunctionKeys, ReturnPromiseType } from '../utils/types';
|
|
2
|
-
import { Logger } from './logger/Logger';
|
|
1
|
+
import { FunctionKeys, ReturnPromiseType } from '../utils/types.js';
|
|
2
|
+
import { Logger } from './logger/Logger.js';
|
|
3
3
|
export type ParamResolver<T, K extends keyof T> = T[K] extends (...args: any) => any ? Parameters<T[K]> : never;
|
|
4
4
|
export type ReturnTypeResolver<T, K extends keyof T> = T[K] extends (...args: any) => any ? ReturnPromiseType<T[K]> : never;
|
|
5
5
|
export declare class Processor<T, K extends FunctionKeys<T>> extends Logger {
|
package/core/dispatcher.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* ts-common is the basic building blocks of our typescript projects
|
|
4
3
|
*
|
|
@@ -16,10 +15,11 @@
|
|
|
16
15
|
* See the License for the specific language governing permissions and
|
|
17
16
|
* limitations under the License.
|
|
18
17
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
import { Logger } from './logger/Logger.js';
|
|
19
|
+
export class Processor extends Logger {
|
|
20
|
+
static modulesResolver;
|
|
21
|
+
method;
|
|
22
|
+
filter;
|
|
23
23
|
constructor(method) {
|
|
24
24
|
super(method);
|
|
25
25
|
this.method = method;
|
|
@@ -44,8 +44,7 @@ class Processor extends Logger_1.Logger {
|
|
|
44
44
|
return listeners.filter(this.filter);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
|
|
48
|
-
class Dispatcher extends Processor {
|
|
47
|
+
export class Dispatcher extends Processor {
|
|
49
48
|
constructor(method) {
|
|
50
49
|
super(method);
|
|
51
50
|
}
|
|
@@ -74,4 +73,4 @@ class Dispatcher extends Processor {
|
|
|
74
73
|
});
|
|
75
74
|
}
|
|
76
75
|
}
|
|
77
|
-
|
|
76
|
+
//# sourceMappingURL=dispatcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispatcher.js","sourceRoot":"/Users/tacb0ss/dev/nu-art/beamz/_thunderstorm/ts-common/src/main/","sources":["core/dispatcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAC,MAAM,EAAC,MAAM,oBAAoB,CAAC;AAM1C,MAAM,OAAO,SACZ,SAAQ,MAAM;IAEd,MAAM,CAAC,eAAe,CAAc;IAE3B,MAAM,CAAI;IACA,MAAM,CAA6B;IAEtD,YAAY,MAAS;QACpB,KAAK,CAAC,MAAgB,CAAC,CAAC;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,CAAC,QAAa,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1D,CAAC;IAEM,cAAc,CAAI,SAAyB;QACjD,OAAO,IAAI,CAAC,aAAa,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAChE,CAAC;IAEM,KAAK,CAAC,mBAAmB,CAAI,SAAkC;QACrE,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC;IACzD,CAAC;IAEM,KAAK,CAAC,yBAAyB,CAAI,SAAkC;QAC3E,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;QACrC,MAAM,KAAK,GAAQ,EAAE,CAAC;QACtB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC9B,KAAK,CAAC,IAAI,CAAC,MAAM,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;QACrC,CAAC;QACD,OAAO,KAAK,CAAC;IACd,CAAC;IAED,aAAa;QACZ,MAAM,SAAS,GAAG,UAAU,CAAC,eAAe,EAAE,CAAC;QAC/C,OAAO,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;CACD;AAED,MAAM,OAAO,UAIZ,SAAQ,SAAe;IAEvB,YAAY,MAAS;QACpB,KAAK,CAAC,MAAM,CAAC,CAAC;IACf,CAAC;IAEM,cAAc,CAAC,GAAG,CAAI;QAC5B,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC,QAAW,EAAE,EAAE;YAC1C,aAAa;YACb,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,mBAAmB,CAAC,GAAG,CAAI;QACvC,OAAO,IAAI,CAAC,mBAAmB,CAAI,CAAC,QAAW,EAAE,EAAE;YAClD,qDAAqD;YACrD,+CAA+C;YAC/C,aAAa;YACb,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,+CAA+C;IAC/C,+CAA+C;IAC/C,sEAAsE;IACtE,IAAI;IAEG,KAAK,CAAC,yBAAyB,CAAC,GAAG,CAAI;QAC7C,OAAO,IAAI,CAAC,yBAAyB,CAAI,CAAC,QAAW,EAAE,EAAE;YACxD,aAAa;YACb,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;IACJ,CAAC;CACD"}
|
package/core/error-handling.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Module } from './module';
|
|
2
|
-
import { Dispatcher } from './dispatcher';
|
|
3
|
-
import { CustomException } from './exceptions/exceptions';
|
|
1
|
+
import { Module } from './module.js';
|
|
2
|
+
import { Dispatcher } from './dispatcher.js';
|
|
3
|
+
import { CustomException } from './exceptions/exceptions.js';
|
|
4
4
|
export declare enum ServerErrorSeverity {
|
|
5
5
|
Debug = "Debug",
|
|
6
6
|
Info = "Info",
|
|
@@ -16,8 +16,8 @@ export type ErrorMessage = {
|
|
|
16
16
|
export interface OnApplicationNotification {
|
|
17
17
|
__processApplicationNotification(errorLevel: ServerErrorSeverity, module: Module, message: ErrorMessage): Promise<void>;
|
|
18
18
|
}
|
|
19
|
-
export declare const dispatch_onApplicationNotification: Dispatcher<OnApplicationNotification, "__processApplicationNotification", [errorLevel: ServerErrorSeverity, module: Module<any, any, import("
|
|
19
|
+
export declare const dispatch_onApplicationNotification: Dispatcher<OnApplicationNotification, "__processApplicationNotification", [errorLevel: ServerErrorSeverity, module: Module<any, any, import("../index.js").Validator<any> | import("../index.js").TypeValidator<any>>, message: ErrorMessage], void>;
|
|
20
20
|
export interface OnApplicationException {
|
|
21
21
|
__processApplicationException(e: CustomException, module: Module): Promise<void>;
|
|
22
22
|
}
|
|
23
|
-
export declare const dispatch_onApplicationException: Dispatcher<OnApplicationException, "__processApplicationException", [e: CustomException, module: Module<any, any, import("
|
|
23
|
+
export declare const dispatch_onApplicationException: Dispatcher<OnApplicationException, "__processApplicationException", [e: CustomException, module: Module<any, any, import("../index.js").Validator<any> | import("../index.js").TypeValidator<any>>], void>;
|
package/core/error-handling.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* ts-common is the basic building blocks of our typescript projects
|
|
4
3
|
*
|
|
@@ -16,23 +15,22 @@
|
|
|
16
15
|
* See the License for the specific language governing permissions and
|
|
17
16
|
* limitations under the License.
|
|
18
17
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const dispatcher_1 = require("./dispatcher");
|
|
22
|
-
var ServerErrorSeverity;
|
|
18
|
+
import { Dispatcher } from './dispatcher.js';
|
|
19
|
+
export var ServerErrorSeverity;
|
|
23
20
|
(function (ServerErrorSeverity) {
|
|
24
21
|
ServerErrorSeverity["Debug"] = "Debug";
|
|
25
22
|
ServerErrorSeverity["Info"] = "Info";
|
|
26
23
|
ServerErrorSeverity["Warning"] = "Warning";
|
|
27
24
|
ServerErrorSeverity["Error"] = "Error";
|
|
28
25
|
ServerErrorSeverity["Critical"] = "Critical";
|
|
29
|
-
})(ServerErrorSeverity || (
|
|
30
|
-
|
|
26
|
+
})(ServerErrorSeverity || (ServerErrorSeverity = {}));
|
|
27
|
+
export const ServerErrorSeverity_Ordinal = [
|
|
31
28
|
ServerErrorSeverity.Debug,
|
|
32
29
|
ServerErrorSeverity.Info,
|
|
33
30
|
ServerErrorSeverity.Warning,
|
|
34
31
|
ServerErrorSeverity.Error,
|
|
35
32
|
ServerErrorSeverity.Critical
|
|
36
33
|
];
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
export const dispatch_onApplicationNotification = new Dispatcher('__processApplicationNotification');
|
|
35
|
+
export const dispatch_onApplicationException = new Dispatcher('__processApplicationException');
|
|
36
|
+
//# sourceMappingURL=error-handling.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-handling.js","sourceRoot":"/Users/tacb0ss/dev/nu-art/beamz/_thunderstorm/ts-common/src/main/","sources":["core/error-handling.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAC;AAG3C,MAAM,CAAN,IAAY,mBAMX;AAND,WAAY,mBAAmB;IAC9B,sCAAkB,CAAA;IAClB,oCAAiB,CAAA;IACjB,0CAAoB,CAAA;IACpB,sCAAkB,CAAA;IAClB,4CAAqB,CAAA;AACtB,CAAC,EANW,mBAAmB,KAAnB,mBAAmB,QAM9B;AAED,MAAM,CAAC,MAAM,2BAA2B,GAAG;IAC1C,mBAAmB,CAAC,KAAK;IACzB,mBAAmB,CAAC,IAAI;IACxB,mBAAmB,CAAC,OAAO;IAC3B,mBAAmB,CAAC,KAAK;IACzB,mBAAmB,CAAC,QAAQ;CAC5B,CAAC;AAWF,MAAM,CAAC,MAAM,kCAAkC,GAAG,IAAI,UAAU,CAAgE,kCAAkC,CAAC,CAAC;AAMpK,MAAM,CAAC,MAAM,+BAA+B,GAAG,IAAI,UAAU,CAA0D,+BAA+B,CAAC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Created by TacB0sS on 3/16/17.
|
|
3
3
|
*/
|
|
4
|
-
import { ApiError_GeneralErrorMessage, ApiErrorResponse, ResponseError } from './types';
|
|
5
|
-
import { Constructor, UniqueId } from '../../utils/types';
|
|
4
|
+
import { ApiError_GeneralErrorMessage, ApiErrorResponse, ResponseError } from './types.js';
|
|
5
|
+
import { Constructor, UniqueId } from '../../utils/types.js';
|
|
6
6
|
/**
|
|
7
7
|
* # <ins>isErrorOfType</ins>
|
|
8
8
|
*
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* ts-common is the basic building blocks of our typescript projects
|
|
4
3
|
*
|
|
@@ -19,10 +18,7 @@
|
|
|
19
18
|
/**
|
|
20
19
|
* Created by TacB0sS on 3/16/17.
|
|
21
20
|
*/
|
|
22
|
-
|
|
23
|
-
exports.ApiException = exports.AssertionException = exports.MissingPermissionException = exports.MissingDataException = exports.ConfigMissingException = exports.WhoCallThisException = exports.DontCallThisException = exports.HasDependenciesException = exports.ThisShouldNotHappenException = exports.NotImplementedYetException = exports.MUSTNeverHappenException = exports.ImplementationMissingException = exports.BadImplementationException = exports.Exception = exports.CustomException = void 0;
|
|
24
|
-
exports.isErrorOfType = isErrorOfType;
|
|
25
|
-
const utils_1 = require("../logger/utils");
|
|
21
|
+
import { _logger_logException } from '../logger/utils.js';
|
|
26
22
|
/**
|
|
27
23
|
* # <ins>isErrorOfType</ins>
|
|
28
24
|
*
|
|
@@ -47,10 +43,9 @@ const utils_1 = require("../logger/utils");
|
|
|
47
43
|
* }
|
|
48
44
|
* ```
|
|
49
45
|
*/
|
|
50
|
-
function isErrorOfType(e, _exceptionType) {
|
|
51
|
-
var _a;
|
|
46
|
+
export function isErrorOfType(e, _exceptionType) {
|
|
52
47
|
const _e = e;
|
|
53
|
-
if (
|
|
48
|
+
if (_e.isInstanceOf?.(_exceptionType))
|
|
54
49
|
return e;
|
|
55
50
|
}
|
|
56
51
|
/**
|
|
@@ -64,7 +59,11 @@ function isErrorOfType(e, _exceptionType) {
|
|
|
64
59
|
*
|
|
65
60
|
* @category Exceptions
|
|
66
61
|
*/
|
|
67
|
-
class CustomException extends Error {
|
|
62
|
+
export class CustomException extends Error {
|
|
63
|
+
exceptionType;
|
|
64
|
+
isInstanceOf;
|
|
65
|
+
generateMrkDwnMessage;
|
|
66
|
+
cause;
|
|
68
67
|
constructor(exceptionType, message, cause) {
|
|
69
68
|
super(message);
|
|
70
69
|
this.message = message;
|
|
@@ -80,156 +79,146 @@ class CustomException extends Error {
|
|
|
80
79
|
};
|
|
81
80
|
}
|
|
82
81
|
}
|
|
83
|
-
exports.CustomException = CustomException;
|
|
84
82
|
/**
|
|
85
83
|
* # <ins>Exception</ins>
|
|
86
84
|
* This class inherits {@link CustomException} and functions like it, after setting the exceptionType property as "Exception",
|
|
87
85
|
* @category Exceptions
|
|
88
86
|
*/
|
|
89
|
-
class Exception extends CustomException {
|
|
87
|
+
export class Exception extends CustomException {
|
|
90
88
|
constructor(message, cause) {
|
|
91
89
|
super(Exception, message, cause);
|
|
92
90
|
}
|
|
93
91
|
}
|
|
94
|
-
exports.Exception = Exception;
|
|
95
92
|
/**
|
|
96
93
|
* # <ins>BadImplementationException</ins>
|
|
97
94
|
* This class inherits {@link CustomException} and functions like it, after setting the exceptionType property as "BadImplementationException",
|
|
98
95
|
* @category Exceptions
|
|
99
96
|
*/
|
|
100
|
-
class BadImplementationException extends CustomException {
|
|
97
|
+
export class BadImplementationException extends CustomException {
|
|
101
98
|
constructor(message, cause) {
|
|
102
99
|
super(BadImplementationException, message, cause);
|
|
103
100
|
}
|
|
104
101
|
}
|
|
105
|
-
exports.BadImplementationException = BadImplementationException;
|
|
106
102
|
/**
|
|
107
103
|
* # <ins>ImplementationMissingException</ins>
|
|
108
104
|
* This class inherits {@link CustomException} and functions like it, after setting the exceptionType property as "ImplementationMissingException",
|
|
109
105
|
* @category Exceptions
|
|
110
106
|
*/
|
|
111
|
-
class ImplementationMissingException extends CustomException {
|
|
107
|
+
export class ImplementationMissingException extends CustomException {
|
|
112
108
|
constructor(message, cause) {
|
|
113
109
|
super(ImplementationMissingException, message, cause);
|
|
114
110
|
}
|
|
115
111
|
}
|
|
116
|
-
exports.ImplementationMissingException = ImplementationMissingException;
|
|
117
112
|
/**
|
|
118
113
|
* # <ins>MUSTNeverHappenException</ins>
|
|
119
114
|
* This class inherits {@link CustomException} and functions like it, after setting the exceptionType property as "MUSTNeverHappenException",
|
|
120
115
|
* @category Exceptions
|
|
121
116
|
*/
|
|
122
|
-
class MUSTNeverHappenException extends CustomException {
|
|
117
|
+
export class MUSTNeverHappenException extends CustomException {
|
|
123
118
|
constructor(message, cause) {
|
|
124
119
|
super(MUSTNeverHappenException, message, cause);
|
|
125
120
|
}
|
|
126
121
|
}
|
|
127
|
-
exports.MUSTNeverHappenException = MUSTNeverHappenException;
|
|
128
122
|
/**
|
|
129
123
|
* # <ins>NotImplementedYetException</ins>
|
|
130
124
|
* This class inherits {@link CustomException} and functions like it, after setting the exceptionType property as "NotImplementedYetException",
|
|
131
125
|
* @category Exceptions
|
|
132
126
|
*/
|
|
133
|
-
class NotImplementedYetException extends CustomException {
|
|
127
|
+
export class NotImplementedYetException extends CustomException {
|
|
134
128
|
constructor(message, cause) {
|
|
135
129
|
super(NotImplementedYetException, message, cause);
|
|
136
130
|
}
|
|
137
131
|
}
|
|
138
|
-
exports.NotImplementedYetException = NotImplementedYetException;
|
|
139
132
|
/**
|
|
140
133
|
* # <ins>ThisShouldNotHappenException</ins>
|
|
141
134
|
* This class inherits {@link CustomException} and functions like it, after setting the exceptionType property as "ThisShouldNotHappenException",
|
|
142
135
|
* @category Exceptions
|
|
143
136
|
*/
|
|
144
|
-
class ThisShouldNotHappenException extends CustomException {
|
|
137
|
+
export class ThisShouldNotHappenException extends CustomException {
|
|
145
138
|
constructor(message, cause) {
|
|
146
139
|
super(ThisShouldNotHappenException, message, cause);
|
|
147
140
|
}
|
|
148
141
|
}
|
|
149
|
-
exports.ThisShouldNotHappenException = ThisShouldNotHappenException;
|
|
150
142
|
/**
|
|
151
143
|
* #<ins>EntityHasDependencies</ins>
|
|
152
144
|
* This class inherits {@link CustomException} and represents an error of a entity trying to be deleted that has dependencies
|
|
153
145
|
* @category Exceptions
|
|
154
146
|
*/
|
|
155
|
-
class HasDependenciesException extends CustomException {
|
|
147
|
+
export class HasDependenciesException extends CustomException {
|
|
148
|
+
body;
|
|
149
|
+
entityName;
|
|
150
|
+
responseCode;
|
|
156
151
|
constructor(debugMessage, body, entityName, e) {
|
|
157
152
|
super(HasDependenciesException, debugMessage, e);
|
|
158
153
|
this.body = body;
|
|
159
154
|
this.entityName = entityName;
|
|
160
155
|
}
|
|
161
156
|
}
|
|
162
|
-
exports.HasDependenciesException = HasDependenciesException;
|
|
163
157
|
/**
|
|
164
158
|
* # <ins>DontCallthisException</ins>
|
|
165
159
|
* This class inherits {@link CustomException} and functions like it, after setting the exceptionType property as "DontCallthisException",
|
|
166
160
|
* @category Exceptions
|
|
167
161
|
*/
|
|
168
|
-
class DontCallThisException extends CustomException {
|
|
162
|
+
export class DontCallThisException extends CustomException {
|
|
169
163
|
constructor(message, cause) {
|
|
170
164
|
super(DontCallThisException, message, cause);
|
|
171
165
|
}
|
|
172
166
|
}
|
|
173
|
-
exports.DontCallThisException = DontCallThisException;
|
|
174
167
|
/**
|
|
175
168
|
* # <ins>WhoCallthisException</ins>
|
|
176
169
|
* This class inherits {@link CustomException} and functions like it, after setting the exceptionType property as "WhoCallthisException",
|
|
177
170
|
* @category Exceptions
|
|
178
171
|
*/
|
|
179
|
-
class WhoCallThisException extends CustomException {
|
|
172
|
+
export class WhoCallThisException extends CustomException {
|
|
180
173
|
constructor(message, cause) {
|
|
181
174
|
super(WhoCallThisException, message, cause);
|
|
182
175
|
}
|
|
183
176
|
}
|
|
184
|
-
exports.WhoCallThisException = WhoCallThisException;
|
|
185
177
|
/**
|
|
186
178
|
* When config for components or modules is missing
|
|
187
179
|
*/
|
|
188
|
-
class ConfigMissingException extends CustomException {
|
|
180
|
+
export class ConfigMissingException extends CustomException {
|
|
189
181
|
constructor(message, cause) {
|
|
190
182
|
super(ConfigMissingException, message, cause);
|
|
191
183
|
}
|
|
192
184
|
}
|
|
193
|
-
exports.ConfigMissingException = ConfigMissingException;
|
|
194
185
|
/**
|
|
195
186
|
* When a mandatory field is missing in an object when the object is fetched
|
|
196
187
|
*/
|
|
197
|
-
class MissingDataException extends CustomException {
|
|
188
|
+
export class MissingDataException extends CustomException {
|
|
198
189
|
constructor(message, cause) {
|
|
199
190
|
super(MissingDataException, message, cause);
|
|
200
191
|
}
|
|
201
192
|
}
|
|
202
|
-
exports.MissingDataException = MissingDataException;
|
|
203
193
|
/**
|
|
204
194
|
* When attempting to perform an action without the necessary permission
|
|
205
195
|
*/
|
|
206
|
-
class MissingPermissionException extends CustomException {
|
|
196
|
+
export class MissingPermissionException extends CustomException {
|
|
207
197
|
constructor(message, cause) {
|
|
208
198
|
super(MissingPermissionException, message, cause);
|
|
209
199
|
}
|
|
210
200
|
}
|
|
211
|
-
exports.MissingPermissionException = MissingPermissionException;
|
|
212
201
|
/**
|
|
213
202
|
* # <ins>AssertionException</ins>
|
|
214
203
|
* This class inherits {@link CustomException} and functions like it, after setting the exceptionType property as "AssertionException",
|
|
215
204
|
* @category Exceptions
|
|
216
205
|
*/
|
|
217
|
-
class AssertionException extends CustomException {
|
|
206
|
+
export class AssertionException extends CustomException {
|
|
218
207
|
constructor(message, cause) {
|
|
219
208
|
super(AssertionException, message, cause);
|
|
220
209
|
}
|
|
221
210
|
}
|
|
222
|
-
|
|
223
|
-
|
|
211
|
+
export class ApiException extends CustomException {
|
|
212
|
+
responseBody = {};
|
|
213
|
+
responseCode;
|
|
214
|
+
setErrorBody = (errorBody) => {
|
|
215
|
+
this.responseBody.error = errorBody;
|
|
216
|
+
return this;
|
|
217
|
+
};
|
|
224
218
|
constructor(responseCode, causeOrMessage, cause) {
|
|
225
219
|
super(ApiException, `${responseCode}${ApiException.getMessage(causeOrMessage)}`, ApiException.getCause(causeOrMessage, cause));
|
|
226
|
-
this.responseBody = {};
|
|
227
|
-
this.setErrorBody = (errorBody) => {
|
|
228
|
-
this.responseBody.error = errorBody;
|
|
229
|
-
return this;
|
|
230
|
-
};
|
|
231
220
|
this.responseCode = responseCode;
|
|
232
|
-
this.responseBody.debugMessage =
|
|
221
|
+
this.responseBody.debugMessage = _logger_logException(this);
|
|
233
222
|
}
|
|
234
223
|
static getMessage(causeOrMessage) {
|
|
235
224
|
return typeof causeOrMessage === 'string' ? `-${JSON.stringify(causeOrMessage)}` : '';
|
|
@@ -238,4 +227,4 @@ class ApiException extends CustomException {
|
|
|
238
227
|
return typeof causeOrMessage != 'string' ? causeOrMessage : cause;
|
|
239
228
|
}
|
|
240
229
|
}
|
|
241
|
-
|
|
230
|
+
//# sourceMappingURL=exceptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exceptions.js","sourceRoot":"/Users/tacb0ss/dev/nu-art/beamz/_thunderstorm/ts-common/src/main/","sources":["core/exceptions/exceptions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH;;GAEG;AAKH,OAAO,EAAC,oBAAoB,EAAC,MAAM,oBAAoB,CAAC;AAGxD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,aAAa,CAAkB,CAAkB,EAAE,cAA8B;IAChG,MAAM,EAAE,GAAG,CAAQ,CAAC;IACpB,IAAI,EAAE,CAAC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AAO,OAAO,cAAc,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACvF,CAAC;IAEO,MAAM,CAAC,QAAQ,CAAC,cAA+B,EAAE,KAAa;QACrE,OAAO,OAAO,cAAc,IAAI,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,KAAK,CAAC;IACnE,CAAC;CACD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ApiException } from './exceptions';
|
|
2
|
-
import { ApiError_GeneralErrorMessage } from './types';
|
|
1
|
+
import { ApiException } from './exceptions.js';
|
|
2
|
+
import { ApiError_GeneralErrorMessage } from './types.js';
|
|
3
3
|
export declare const HttpCodes: {
|
|
4
4
|
readonly _1XX: {
|
|
5
5
|
readonly CONTINUE: 100;
|
|
@@ -120,6 +120,9 @@ export declare const HttpCodes: {
|
|
|
120
120
|
readonly UNAVAILABLE_FOR_LEGAL_REASONS: ((userMessage: string, debugMessage?: string, cause?: Error) => ApiException<ApiError_GeneralErrorMessage>) & {
|
|
121
121
|
code: number;
|
|
122
122
|
};
|
|
123
|
+
readonly ENTITY_MISSING: ((userMessage: string, debugMessage?: string, cause?: Error) => ApiException<ApiError_GeneralErrorMessage>) & {
|
|
124
|
+
code: number;
|
|
125
|
+
};
|
|
123
126
|
readonly ENTITY_ALREADY_EXISTS: ((userMessage: string, debugMessage?: string, cause?: Error) => ApiException<ApiError_GeneralErrorMessage>) & {
|
|
124
127
|
code: number;
|
|
125
128
|
};
|
|
@@ -129,6 +132,9 @@ export declare const HttpCodes: {
|
|
|
129
132
|
readonly INTERNAL_MISMATCH: ((userMessage: string, debugMessage?: string, cause?: Error) => ApiException<ApiError_GeneralErrorMessage>) & {
|
|
130
133
|
code: number;
|
|
131
134
|
};
|
|
135
|
+
readonly ENTITY_DOESNT_EXISTS: ((userMessage: string, debugMessage?: string, cause?: Error) => ApiException<ApiError_GeneralErrorMessage>) & {
|
|
136
|
+
code: number;
|
|
137
|
+
};
|
|
132
138
|
readonly OPERATION_FAILED: ((userMessage: string, debugMessage?: string, cause?: Error) => ApiException<ApiError_GeneralErrorMessage>) & {
|
|
133
139
|
code: number;
|
|
134
140
|
};
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HttpCodes = void 0;
|
|
4
|
-
const exceptions_1 = require("./exceptions");
|
|
1
|
+
import { ApiException } from './exceptions.js';
|
|
5
2
|
function createGeneralError(code) {
|
|
6
|
-
const errorFunction = (userMessage, debugMessage = userMessage, cause) => new
|
|
3
|
+
const errorFunction = (userMessage, debugMessage = userMessage, cause) => new ApiException(code, debugMessage, cause).setErrorBody({
|
|
7
4
|
type: 'error-message',
|
|
8
5
|
data: { message: userMessage }
|
|
9
6
|
});
|
|
10
7
|
return Object.assign(errorFunction, { code });
|
|
11
8
|
}
|
|
12
|
-
|
|
9
|
+
export const HttpCodes = {
|
|
13
10
|
_1XX: {
|
|
14
11
|
CONTINUE: 100,
|
|
15
12
|
SWITCHING_PROTOCOLS: 101,
|
|
@@ -70,9 +67,11 @@ exports.HttpCodes = {
|
|
|
70
67
|
REQUEST_HEADER_FIELDS_TOO_LARGE: createGeneralError(431),
|
|
71
68
|
UNAVAILABLE_FOR_LEGAL_REASONS: createGeneralError(451),
|
|
72
69
|
//custom
|
|
70
|
+
ENTITY_MISSING: createGeneralError(459),
|
|
73
71
|
ENTITY_ALREADY_EXISTS: createGeneralError(460),
|
|
74
72
|
ENTITY_IS_OUTDATED: createGeneralError(461),
|
|
75
73
|
INTERNAL_MISMATCH: createGeneralError(462),
|
|
74
|
+
ENTITY_DOESNT_EXISTS: createGeneralError(463),
|
|
76
75
|
OPERATION_FAILED: createGeneralError(490),
|
|
77
76
|
},
|
|
78
77
|
_5XX: {
|
|
@@ -95,3 +94,4 @@ exports.HttpCodes = {
|
|
|
95
94
|
MUST_NEVER_HAPPENED: 599,
|
|
96
95
|
},
|
|
97
96
|
};
|
|
97
|
+
//# sourceMappingURL=http-codes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-codes.js","sourceRoot":"/Users/tacb0ss/dev/nu-art/beamz/_thunderstorm/ts-common/src/main/","sources":["core/exceptions/http-codes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAI7C,SAAS,kBAAkB,CAAC,IAAY;IACvC,MAAM,aAAa,GAAG,CAAC,WAAmB,EAAE,eAAuB,WAAW,EAAE,KAAa,EAAE,EAAE,CAChG,IAAI,YAAY,CAA+B,IAAI,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC,YAAY,CAAC;QACtF,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,EAAC,OAAO,EAAE,WAAW,EAAC;KAC5B,CAAC,CAAC;IACJ,OAAO,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,EAAC,IAAI,EAAC,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,CAAC,MAAM,SAAS,GAAG;IACxB,IAAI,EAAE;QACL,QAAQ,EAAE,GAAG;QACb,mBAAmB,EAAE,GAAG;QACxB,UAAU,EAAE,GAAG;QACf,WAAW,EAAE,GAAG;KAChB;IACD,IAAI,EAAE;QACL,EAAE,EAAE,GAAG;QACP,OAAO,EAAE,GAAG;QACZ,QAAQ,EAAE,GAAG;QACb,6BAA6B,EAAE,GAAG;QAClC,UAAU,EAAE,GAAG;QACf,aAAa,EAAE,GAAG;QAClB,eAAe,EAAE,GAAG;QACpB,YAAY,EAAE,GAAG;QACjB,gBAAgB,EAAE,GAAG;QACrB,OAAO,EAAE,GAAG;KACZ;IACD,IAAI,EAAE;QACL,gBAAgB,EAAE,GAAG;QACrB,iBAAiB,EAAE,GAAG;QACtB,KAAK,EAAE,GAAG;QACV,SAAS,EAAE,GAAG;QACd,YAAY,EAAE,GAAG;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;KAGxB;CACQ,CAAC"}
|
package/core/exceptions/types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export {};
|
|
2
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"/Users/tacb0ss/dev/nu-art/beamz/_thunderstorm/ts-common/src/main/","sources":["core/exceptions/types.ts"],"names":[],"mappings":""}
|
package/core/logger/BeLogged.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* ts-common is the basic building blocks of our typescript projects
|
|
4
3
|
*
|
|
@@ -16,17 +15,14 @@
|
|
|
16
15
|
* See the License for the specific language governing permissions and
|
|
17
16
|
* limitations under the License.
|
|
18
17
|
*/
|
|
19
|
-
|
|
20
|
-
exports.BeLogged = void 0;
|
|
21
|
-
const array_tools_1 = require("../../utils/array-tools");
|
|
18
|
+
import { removeItemFromArray } from '../../utils/array-tools.js';
|
|
22
19
|
class BeLogged_Class {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
this.lineCount = 0;
|
|
26
|
-
}
|
|
20
|
+
clients = [];
|
|
21
|
+
lineCount = 0;
|
|
27
22
|
addClient(client) {
|
|
28
23
|
if (this.clients.indexOf(client) !== -1)
|
|
29
24
|
return;
|
|
25
|
+
client.init();
|
|
30
26
|
this.clients.push(client);
|
|
31
27
|
}
|
|
32
28
|
removeConsole(client) {
|
|
@@ -35,14 +31,15 @@ class BeLogged_Class {
|
|
|
35
31
|
removeClient(client) {
|
|
36
32
|
if (this.clients.indexOf(client) === -1)
|
|
37
33
|
return;
|
|
38
|
-
|
|
34
|
+
removeItemFromArray(this.clients, client);
|
|
35
|
+
client.stop();
|
|
39
36
|
}
|
|
40
37
|
log(tag, level, bold, ...toLog) {
|
|
41
38
|
this.logImpl(tag, level, bold, toLog);
|
|
42
39
|
}
|
|
43
40
|
logImpl(tag, level, bold, toLog) {
|
|
44
41
|
for (const client of this.clients) {
|
|
45
|
-
client.log(tag, level, bold, toLog);
|
|
42
|
+
client.log(tag, level, bold, [...toLog]);
|
|
46
43
|
}
|
|
47
44
|
}
|
|
48
45
|
clearFooter() {
|
|
@@ -54,4 +51,5 @@ class BeLogged_Class {
|
|
|
54
51
|
this.lineCount = lineCount;
|
|
55
52
|
}
|
|
56
53
|
}
|
|
57
|
-
|
|
54
|
+
export const BeLogged = new BeLogged_Class();
|
|
55
|
+
//# sourceMappingURL=BeLogged.js.map
|