@intuitionrobotics/ts-common 0.46.0 → 0.47.1
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 +17 -0
- package/consts/consts.js.map +1 -1
- package/core/application.js +17 -0
- package/core/application.js.map +1 -1
- package/core/debug-flags.js +19 -2
- package/core/debug-flags.js.map +1 -1
- package/core/dispatcher.d.ts +4 -4
- package/core/dispatcher.js +7 -9
- package/core/dispatcher.js.map +1 -1
- package/core/error-handling.d.ts +1 -1
- package/core/error-handling.js +18 -1
- package/core/error-handling.js.map +1 -1
- package/core/exceptions.d.ts +5 -2
- package/core/exceptions.js +23 -1
- package/core/exceptions.js.map +1 -1
- package/core/logger/BeLogged.js +18 -1
- package/core/logger/BeLogged.js.map +1 -1
- package/core/logger/LogClient.d.ts +1 -1
- package/core/logger/LogClient.js +17 -0
- package/core/logger/LogClient.js.map +1 -1
- package/core/logger/LogClient_BaseRotate.d.ts +1 -1
- package/core/logger/LogClient_BaseRotate.js +19 -1
- package/core/logger/LogClient_BaseRotate.js.map +1 -1
- package/core/logger/LogClient_Browser.js +17 -0
- package/core/logger/LogClient_Browser.js.map +1 -1
- package/core/logger/LogClient_Function.js +18 -1
- package/core/logger/LogClient_Function.js.map +1 -1
- package/core/logger/LogClient_MemBuffer.js +18 -0
- package/core/logger/LogClient_MemBuffer.js.map +1 -1
- package/core/logger/LogClient_Terminal.js +19 -2
- package/core/logger/LogClient_Terminal.js.map +1 -1
- package/core/logger/Logger.js +17 -0
- package/core/logger/Logger.js.map +1 -1
- package/core/logger/types.d.ts +2 -2
- package/core/logger/types.js +18 -1
- package/core/logger/types.js.map +1 -1
- package/core/logger/utils.js +23 -3
- package/core/logger/utils.js.map +1 -1
- package/core/module-manager.js +2 -2
- package/core/module-manager.js.map +1 -1
- package/core/module.d.ts +2 -6
- package/core/module.js +14 -24
- package/core/module.js.map +1 -1
- package/index.d.ts +35 -0
- package/index.js +67 -0
- package/index.js.map +1 -1
- package/modules/CliParamsModule.d.ts +3 -3
- package/modules/CliParamsModule.js +3 -3
- package/modules/CliParamsModule.js.map +1 -1
- package/package.json +4 -4
- package/permissions/permission-group.js +20 -4
- package/permissions/permission-group.js.map +1 -1
- package/testing/test-model.d.ts +4 -4
- package/testing/test-model.js +17 -0
- package/testing/test-model.js.map +1 -1
- package/utils/array-tools.d.ts +2 -2
- package/utils/array-tools.js +17 -0
- package/utils/array-tools.js.map +1 -1
- package/utils/crypto-tools.js +18 -1
- package/utils/crypto-tools.js.map +1 -1
- package/utils/date-time-tools.d.ts +5 -2
- package/utils/date-time-tools.js +42 -3
- package/utils/date-time-tools.js.map +1 -1
- package/utils/filter-tools.js +17 -0
- package/utils/filter-tools.js.map +1 -1
- package/utils/hash-tools.js +17 -0
- package/utils/hash-tools.js.map +1 -1
- package/utils/merge-tools.js +22 -6
- package/utils/merge-tools.js.map +1 -1
- package/utils/object-tools.d.ts +1 -1
- package/utils/object-tools.js +20 -3
- package/utils/object-tools.js.map +1 -1
- package/utils/queue.d.ts +2 -2
- package/utils/queue.js +3 -3
- package/utils/queue.js.map +1 -1
- package/utils/random-tools.js +18 -1
- package/utils/random-tools.js.map +1 -1
- package/utils/string-tools.js +17 -0
- package/utils/string-tools.js.map +1 -1
- package/utils/tools.js +5 -3
- package/utils/tools.js.map +1 -1
- package/utils/types.d.ts +25 -23
- package/utils/types.js +17 -0
- package/utils/types.js.map +1 -1
- package/utils/version-tools.d.ts +1 -1
- package/utils/version-tools.js +20 -3
- package/utils/version-tools.js.map +1 -1
- package/validator/validator.d.ts +9 -7
- package/validator/validator.js +35 -21
- package/validator/validator.js.map +1 -1
- package/ts-generics/array-params.d.ts +0 -17
- package/ts-generics/array-params.js +0 -27
- package/ts-generics/array-params.js.map +0 -1
- package/ts-generics/omit-and-join.d.ts +0 -12
- package/ts-generics/omit-and-join.js +0 -18
- package/ts-generics/omit-and-join.js.map +0 -1
- package/utils/date-manipulation-tools.d.ts +0 -4
- package/utils/date-manipulation-tools.js +0 -28
- package/utils/date-manipulation-tools.js.map +0 -1
package/consts/consts.js
CHANGED
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* ts-common is the basic building blocks of our typescript projects
|
|
4
|
+
*
|
|
5
|
+
* Copyright (C) 2020 Intuition Robotics
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
2
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
20
|
exports._U = void 0;
|
|
4
21
|
exports._U = undefined;
|
package/consts/consts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../../src/main/consts/consts.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../../src/main/consts/consts.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAEU,QAAA,EAAE,GAAG,SAAS,CAAC"}
|
package/core/application.js
CHANGED
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* ts-common is the basic building blocks of our typescript projects
|
|
4
|
+
*
|
|
5
|
+
* Copyright (C) 2020 Intuition Robotics
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
2
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
20
|
exports.Application = void 0;
|
|
4
21
|
const module_manager_1 = require("./module-manager");
|
package/core/application.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.js","sourceRoot":"","sources":["../../src/main/core/application.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"application.js","sourceRoot":"","sources":["../../src/main/core/application.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAEH,qDAA+C;AAE/C,MAAa,WACZ,SAAQ,8BAAa;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;AAhBD,kCAgBC"}
|
package/core/debug-flags.js
CHANGED
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* ts-common is the basic building blocks of our typescript projects
|
|
4
|
+
*
|
|
5
|
+
* Copyright (C) 2020 Intuition Robotics
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
2
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
20
|
exports.DebugFlags = exports.DebugFlag = void 0;
|
|
4
21
|
const array_tools_1 = require("../utils/array-tools");
|
|
@@ -22,10 +39,10 @@ class DebugFlag {
|
|
|
22
39
|
this._disable();
|
|
23
40
|
}
|
|
24
41
|
_enable() {
|
|
25
|
-
array_tools_1.addItemToArray(DebugFlags.instance.ActiveDebugFlags, this.key);
|
|
42
|
+
(0, array_tools_1.addItemToArray)(DebugFlags.instance.ActiveDebugFlags, this.key);
|
|
26
43
|
}
|
|
27
44
|
_disable() {
|
|
28
|
-
array_tools_1.removeItemFromArray(DebugFlags.instance.ActiveDebugFlags, this.key);
|
|
45
|
+
(0, array_tools_1.removeItemFromArray)(DebugFlags.instance.ActiveDebugFlags, this.key);
|
|
29
46
|
}
|
|
30
47
|
isEnabled() {
|
|
31
48
|
return DebugFlags.instance.ActiveDebugFlags.includes(this.key);
|
package/core/debug-flags.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug-flags.js","sourceRoot":"","sources":["../../src/main/core/debug-flags.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"debug-flags.js","sourceRoot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CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC;IACnD,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,WAAmB,EAAE,MAAc;QAChD,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;QACtD,IAAI,CAAC,IAAI;YACR,OAAO;QAER,OAAO,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;QAChD,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAC5C,CAAC;;AA1BF,gCA2BC;AAzBgB,mBAAQ,GAAe,IAAI,UAAU,EAAE,AAA/B,CAAgC"}
|
package/core/dispatcher.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { FunctionKeys,
|
|
2
|
-
export declare class Dispatcher<T extends
|
|
1
|
+
import { FunctionKeys, ParamResolver, ReturnTypeResolver } from "../utils/types";
|
|
2
|
+
export declare class Dispatcher<T, K extends FunctionKeys<T>, P extends ParamResolver<T, K> = ParamResolver<T, K>, R extends ReturnTypeResolver<T, K> = ReturnTypeResolver<T, K>> {
|
|
3
3
|
static modulesResolver: () => any[];
|
|
4
4
|
protected readonly method: K;
|
|
5
5
|
protected readonly filter: (listener: any) => boolean;
|
|
6
6
|
constructor(method: K);
|
|
7
|
-
dispatchModule(p:
|
|
8
|
-
dispatchModuleAsync(p:
|
|
7
|
+
dispatchModule(...p: P): R[];
|
|
8
|
+
dispatchModuleAsync(...p: P): Promise<R[]>;
|
|
9
9
|
}
|
package/core/dispatcher.js
CHANGED
|
@@ -15,18 +15,16 @@ class Dispatcher {
|
|
|
15
15
|
this.method = method;
|
|
16
16
|
this.filter = (listener) => !!listener[this.method];
|
|
17
17
|
}
|
|
18
|
-
dispatchModule(p) {
|
|
18
|
+
dispatchModule(...p) {
|
|
19
19
|
const listeners = Dispatcher.modulesResolver();
|
|
20
|
-
|
|
21
|
-
return listeners.filter(this.filter).map((listener) => listener[this.method](...
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
return listeners.filter(this.filter).map((listener) => listener[this.method](...p));
|
|
22
22
|
}
|
|
23
|
-
dispatchModuleAsync(p) {
|
|
23
|
+
dispatchModuleAsync(...p) {
|
|
24
24
|
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return listener[this.method](...params);
|
|
29
|
-
})));
|
|
25
|
+
const filtered = Dispatcher.modulesResolver().filter(this.filter);
|
|
26
|
+
// @ts-ignore
|
|
27
|
+
return Promise.all(filtered.map((listener) => __awaiter(this, void 0, void 0, function* () { return listener[this.method](...p); })));
|
|
30
28
|
});
|
|
31
29
|
}
|
|
32
30
|
}
|
package/core/dispatcher.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatcher.js","sourceRoot":"","sources":["../../src/main/core/dispatcher.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"dispatcher.js","sourceRoot":"","sources":["../../src/main/core/dispatcher.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,UAAU;IAUnB,YAAY,MAAS;QACjB,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;IAC7D,CAAC;IAEM,cAAc,CAAC,GAAG,CAAI;QACzB,MAAM,SAAS,GAAG,UAAU,CAAC,eAAe,EAAE,CAAC;QAC/C,aAAa;QACb,OAAO,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,QAAW,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC3F,CAAC;IAEY,mBAAmB,CAAC,GAAG,CAAI;;YACpC,MAAM,QAAQ,GAAG,UAAU,CAAC,eAAe,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAClE,aAAa;YACb,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAO,QAAW,EAAE,EAAE,gDAAC,OAAA,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA,GAAA,CAAC,CAAC,CAAC;QACzF,CAAC;KAAA;CACJ;AA1BD,gCA0BC"}
|
package/core/error-handling.d.ts
CHANGED
|
@@ -11,4 +11,4 @@ export declare const ServerErrorSeverity_Ordinal: ServerErrorSeverity[];
|
|
|
11
11
|
export interface OnApplicationError {
|
|
12
12
|
__processApplicationError(errorLevel: ServerErrorSeverity, module: Module, message: string): Promise<void>;
|
|
13
13
|
}
|
|
14
|
-
export declare const dispatch_onServerError: Dispatcher<OnApplicationError, "__processApplicationError">;
|
|
14
|
+
export declare const dispatch_onServerError: Dispatcher<OnApplicationError, "__processApplicationError", [errorLevel: ServerErrorSeverity, module: Module<any>, message: string], void>;
|
package/core/error-handling.js
CHANGED
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* ts-common is the basic building blocks of our typescript projects
|
|
4
|
+
*
|
|
5
|
+
* Copyright (C) 2020 Intuition Robotics
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
2
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
20
|
exports.dispatch_onServerError = exports.ServerErrorSeverity_Ordinal = exports.ServerErrorSeverity = void 0;
|
|
4
21
|
const dispatcher_1 = require("./dispatcher");
|
|
@@ -9,7 +26,7 @@ var ServerErrorSeverity;
|
|
|
9
26
|
ServerErrorSeverity["Warning"] = "Warning";
|
|
10
27
|
ServerErrorSeverity["Error"] = "Error";
|
|
11
28
|
ServerErrorSeverity["Critical"] = "Critical";
|
|
12
|
-
})(ServerErrorSeverity
|
|
29
|
+
})(ServerErrorSeverity || (exports.ServerErrorSeverity = ServerErrorSeverity = {}));
|
|
13
30
|
exports.ServerErrorSeverity_Ordinal = [
|
|
14
31
|
ServerErrorSeverity.Debug,
|
|
15
32
|
ServerErrorSeverity.Info,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-handling.js","sourceRoot":"","sources":["../../src/main/core/error-handling.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"error-handling.js","sourceRoot":"","sources":["../../src/main/core/error-handling.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAGH,6CAAwC;AAExC,IAAY,mBAMX;AAND,WAAY,mBAAmB;IAC9B,sCAAkB,CAAA;IAClB,oCAAiB,CAAA;IACjB,0CAAoB,CAAA;IACpB,sCAAkB,CAAA;IAClB,4CAAqB,CAAA;AACtB,CAAC,EANW,mBAAmB,mCAAnB,mBAAmB,QAM9B;AAEY,QAAA,2BAA2B,GAAG;IAC1C,mBAAmB,CAAC,KAAK;IACzB,mBAAmB,CAAC,IAAI;IACxB,mBAAmB,CAAC,OAAO;IAC3B,mBAAmB,CAAC,KAAK;IACzB,mBAAmB,CAAC,QAAQ;CAC5B,CAAC;AAMW,QAAA,sBAAsB,GAAG,IAAI,uBAAU,CAAkD,2BAA2B,CAAC,CAAC"}
|
package/core/exceptions.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Created by IR on 3/16/17.
|
|
3
|
+
*/
|
|
1
4
|
import { Constructor } from "../utils/types";
|
|
2
|
-
export declare function isErrorOfType<T extends Error>(e:
|
|
5
|
+
export declare function isErrorOfType<T extends Error>(e: any, _exceptionType: Constructor<T>): T | undefined;
|
|
3
6
|
export declare abstract class CustomException extends Error {
|
|
4
7
|
exceptionType: string;
|
|
5
8
|
isInstanceOf: (_exceptionType: Function) => boolean;
|
|
6
9
|
cause?: Error;
|
|
7
|
-
protected constructor(exceptionType: Function, message: string, cause?:
|
|
10
|
+
protected constructor(exceptionType: Function, message: string, cause?: any);
|
|
8
11
|
}
|
|
9
12
|
export declare class Exception extends CustomException {
|
|
10
13
|
constructor(message: string, cause?: Error);
|
package/core/exceptions.js
CHANGED
|
@@ -1,7 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* ts-common is the basic building blocks of our typescript projects
|
|
4
|
+
*
|
|
5
|
+
* Copyright (C) 2020 Intuition Robotics
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Created by IR on 3/16/17.
|
|
21
|
+
*/
|
|
2
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
23
|
exports.AssertionException = exports.WhoCallthisException = exports.DontCallthisException = exports.ThisShouldNotHappenException = exports.NotImplementedYetException = exports.MUSTNeverHappenException = exports.ImplementationMissingException = exports.BadImplementationException = exports.Exception = exports.CustomException = exports.isErrorOfType = void 0;
|
|
4
24
|
function isErrorOfType(e, _exceptionType) {
|
|
25
|
+
if (!(e instanceof Error))
|
|
26
|
+
return;
|
|
5
27
|
const _e = e;
|
|
6
28
|
if (_e.isInstanceOf && _e.isInstanceOf(_exceptionType))
|
|
7
29
|
return e;
|
|
@@ -12,7 +34,7 @@ class CustomException extends Error {
|
|
|
12
34
|
super(message);
|
|
13
35
|
this.message = message;
|
|
14
36
|
this.stack = (new Error(message)).stack;
|
|
15
|
-
this.cause = cause;
|
|
37
|
+
this.cause = cause instanceof Error ? cause : new Error(JSON.stringify(cause));
|
|
16
38
|
this.exceptionType = exceptionType.name;
|
|
17
39
|
this.isInstanceOf = (_exceptionType) => {
|
|
18
40
|
return this.exceptionType === _exceptionType.name;
|
package/core/exceptions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exceptions.js","sourceRoot":"","sources":["../../src/main/core/exceptions.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"exceptions.js","sourceRoot":"","sources":["../../src/main/core/exceptions.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;AACH;;GAEG;;;AAKH,SAAgB,aAAa,CAAkB,CAAM,EAAE,cAA8B;IACjF,IAAI,CAAC,CAAC,CAAC,YAAY,KAAK,CAAC;QACrB,OAAO;IAEX,MAAM,EAAE,GAAG,CAAQ,CAAC;IACpB,IAAI,EAAE,CAAC,YAAY,IAAI,EAAE,CAAC,YAAY,CAAC,cAAc,CAAC;QAClD,OAAO,CAAM,CAAC;AACtB,CAAC;AAPD,sCAOC;AAED,MAAsB,eAClB,SAAQ,KAAK;IAOb,YAAsB,aAAuB,EAAE,OAAe,EAAE,KAAW;QACvE,KAAK,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B,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IACtD,CAAC;CACJ;AAND,gEAMC;AAED,MAAa,4BACT,SAAQ,eAAe;IAEvB,YAAY,OAAe,EAAE,KAAa;QACtC,KAAK,CAAC,4BAA4B,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IACxD,CAAC;CACJ;AAND,oEAMC;AAED,MAAa,qBACT,SAAQ,eAAe;IAEvB,YAAY,OAAe,EAAE,KAAa;QACtC,KAAK,CAAC,qBAAqB,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IACjD,CAAC;CACJ;AAND,sDAMC;AAED,MAAa,oBACT,SAAQ,eAAe;IAEvB,YAAY,OAAe,EAAE,KAAa;QACtC,KAAK,CAAC,oBAAoB,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IAChD,CAAC;CACJ;AAND,oDAMC;AAED,MAAa,kBACT,SAAQ,eAAe;IAEvB,YAAY,OAAe,EAAE,KAAa;QACtC,KAAK,CAAC,kBAAkB,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IAC9C,CAAC;CACJ;AAND,gDAMC"}
|
package/core/logger/BeLogged.js
CHANGED
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* ts-common is the basic building blocks of our typescript projects
|
|
4
|
+
*
|
|
5
|
+
* Copyright (C) 2020 Intuition Robotics
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
2
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
20
|
exports.BeLogged = void 0;
|
|
4
21
|
const array_tools_1 = require("../../utils/array-tools");
|
|
@@ -15,7 +32,7 @@ class BeLogged_Class {
|
|
|
15
32
|
removeConsole(client) {
|
|
16
33
|
if (this.clients.indexOf(client) === -1)
|
|
17
34
|
return;
|
|
18
|
-
array_tools_1.removeItemFromArray(this.clients, client);
|
|
35
|
+
(0, array_tools_1.removeItemFromArray)(this.clients, client);
|
|
19
36
|
}
|
|
20
37
|
log(tag, level, bold, ...toLog) {
|
|
21
38
|
this.logImpl(tag, level, bold, toLog);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BeLogged.js","sourceRoot":"","sources":["../../../src/main/core/logger/BeLogged.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"BeLogged.js","sourceRoot":"","sources":["../../../src/main/core/logger/BeLogged.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAIH,yDAA4D;AAM5D,MAAM,cAAc;IAApB;QAES,YAAO,GAAgB,EAAE,CAAC;QAC1B,cAAS,GAAG,CAAC,CAAC;IAoCvB,CAAC;IAlCO,SAAS,CAA2B,MAAc;QACxD,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACtC,OAAO;QAER,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC3B,CAAC;IAEM,aAAa,CAA2B,MAAc;QAC5D,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACtC,OAAO;QAER,IAAA,iCAAmB,EAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC;IAEM,GAAG,CAAC,GAAW,EAAE,KAAe,EAAE,IAAa,EAAE,GAAG,KAAiB;QAC3E,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IACvC,CAAC;IAEO,OAAO,CAAC,GAAW,EAAE,KAAe,EAAE,IAAa,EAAE,KAAiB;QAC7E,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACnC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QACrC,CAAC;IACF,CAAC;IAGM,WAAW;QACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,SAAS,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAC7C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC5B,CAAC;IACF,CAAC;IAEM,cAAc,CAAC,SAAiB;QACtC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC5B,CAAC;CACD;AAEY,QAAA,QAAQ,GAAG,IAAI,cAAc,EAAE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LogLevel, LogParam, LogPrefixComposer } from "./types";
|
|
2
|
-
export
|
|
2
|
+
export type LogFilter = (level: LogLevel, tag: string) => boolean;
|
|
3
3
|
export declare abstract class LogClient {
|
|
4
4
|
private prefixComposer;
|
|
5
5
|
private filter;
|
package/core/logger/LogClient.js
CHANGED
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* ts-common is the basic building blocks of our typescript projects
|
|
4
|
+
*
|
|
5
|
+
* Copyright (C) 2020 Intuition Robotics
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
2
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
20
|
exports.DefaultLogPrefixComposer = exports._logger_getPrefix = exports._logger_finalDate = exports._logger_timezoneOffset = exports.LogClient = void 0;
|
|
4
21
|
const types_1 = require("./types");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogClient.js","sourceRoot":"","sources":["../../../src/main/core/logger/LogClient.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"LogClient.js","sourceRoot":"","sources":["../../../src/main/core/logger/LogClient.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAEH,mCAIiB;AAIjB,MAAsB,SAAS;IAA/B;QAES,mBAAc,GAAsB,gCAAwB,CAAC;QAC7D,WAAM,GAAc,GAAG,EAAE,CAAC,IAAI,CAAC;IAmBxC,CAAC;IAfO,WAAW,CAAC,WAA8B;QAChD,IAAI,CAAC,cAAc,GAAG,WAAW,CAAC;IACnC,CAAC;IAED,SAAS,CAAC,MAAiB;QAC1B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,GAAG,CAAC,GAAW,EAAE,KAAe,EAAE,IAAa,EAAE,KAAiB;QACxE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC;YAC3B,OAAO;QAER,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;IACtE,CAAC;CACD;AAtBD,8BAsBC;AAEY,QAAA,sBAAsB,GAAW,IAAI,IAAI,EAAE,CAAC,iBAAiB,EAAE,GAAG,KAAK,CAAC,CAAC,wBAAwB;AACjG,QAAA,iBAAiB,GAAS,IAAI,IAAI,EAAE,CAAC;AAElD,SAAgB,iBAAiB,CAAC,KAAe;IAChD,QAAQ,KAAK,EAAE,CAAC;QACf,KAAK,gBAAQ,CAAC,OAAO;YACpB,OAAO,KAAK,CAAC;QAEd,KAAK,gBAAQ,CAAC,KAAK;YAClB,OAAO,KAAK,CAAC;QAEd,KAAK,gBAAQ,CAAC,IAAI;YACjB,OAAO,KAAK,CAAC;QAEd,KAAK,gBAAQ,CAAC,OAAO;YACpB,OAAO,KAAK,CAAC;QAEd,KAAK,gBAAQ,CAAC,KAAK;YAClB,OAAO,KAAK,CAAC;QAEd;YACC,OAAO,KAAK,CAAC;IACf,CAAC;AACF,CAAC;AApBD,8CAoBC;AAEM,MAAM,wBAAwB,GAAsB,CAAC,GAAW,EAAE,KAAe,EAAU,EAAE;IACnG,yBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,8BAAsB,CAAC,CAAC;IAC/D,MAAM,IAAI,GAAG,yBAAiB,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC9F,OAAO,KAAK,IAAI,IAAI,iBAAiB,CAAC,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC;AAC1D,CAAC,CAAC;AAJW,QAAA,wBAAwB,4BAInC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LogClient } from "./LogClient";
|
|
2
2
|
import { LogLevel, LogParam } from "./types";
|
|
3
|
-
|
|
3
|
+
type LogRotateListener = () => void;
|
|
4
4
|
export declare abstract class LogClient_BaseRotate extends LogClient {
|
|
5
5
|
readonly name: string;
|
|
6
6
|
readonly maxEntries: number;
|
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Permissions management system, define access level for each of
|
|
4
|
+
* your server apis, and restrict users by giving them access levels
|
|
5
|
+
*
|
|
6
|
+
* Copyright (C) 2020 Intuition Robotics
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
* you may not use this file except in compliance with the License.
|
|
10
|
+
* You may obtain a copy of the License at
|
|
11
|
+
*
|
|
12
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
*
|
|
14
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
* See the License for the specific language governing permissions and
|
|
18
|
+
* limitations under the License.
|
|
19
|
+
*/
|
|
2
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
21
|
exports.LogClient_BaseRotate = void 0;
|
|
4
22
|
const LogClient_1 = require("./LogClient");
|
|
@@ -12,7 +30,7 @@ class LogClient_BaseRotate extends LogClient_1.LogClient {
|
|
|
12
30
|
this.maxEntries = maxEntries;
|
|
13
31
|
}
|
|
14
32
|
logMessage(level, bold, prefix, toLog) {
|
|
15
|
-
const toLogAsString = utils_1._logger_convertLogParamsToStrings(toLog);
|
|
33
|
+
const toLogAsString = (0, utils_1._logger_convertLogParamsToStrings)(toLog);
|
|
16
34
|
this.rotate();
|
|
17
35
|
for (const paramAsString of toLogAsString) {
|
|
18
36
|
const log = paramAsString + "\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogClient_BaseRotate.js","sourceRoot":"","sources":["../../../src/main/core/logger/LogClient_BaseRotate.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"LogClient_BaseRotate.js","sourceRoot":"","sources":["../../../src/main/core/logger/LogClient_BaseR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gB,oDAAI,CAAC;QAC1B,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,OAAO,EAAE,CAAC;IAChB,CAAC;CAQD;AAxDD,oDAwDC"}
|
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* ts-common is the basic building blocks of our typescript projects
|
|
4
|
+
*
|
|
5
|
+
* Copyright (C) 2020 Intuition Robotics
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
2
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
20
|
exports.LogClient_Browser = void 0;
|
|
4
21
|
const types_1 = require("./types");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogClient_Browser.js","sourceRoot":"","sources":["../../../src/main/core/logger/LogClient_Browser.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"LogClient_Browser.js","sourceRoot":"","sources":["../../../src/main/core/logger/LogClient_Browser.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAEH,mCAGiB;AACjB,2CAAsC;AAEtC,MAAM,uBACL,SAAQ,qBAAS;IAEjB,QAAQ,CAAC,KAAe,EAAE,IAAa;QACtC,IAAI,KAAK,CAAC;QACV,QAAQ,KAAK,EAAE,CAAC;YACf,KAAK,gBAAQ,CAAC,OAAO;gBACpB,KAAK,GAAG,SAAS,CAAC;gBAClB,MAAM;YAEP,KAAK,gBAAQ,CAAC,KAAK;gBAClB,KAAK,GAAG,SAAS,CAAC;gBAClB,MAAM;YAEP,KAAK,gBAAQ,CAAC,IAAI;gBACjB,KAAK,GAAG,SAAS,CAAC;gBAClB,MAAM;YAEP,KAAK,gBAAQ,CAAC,OAAO;gBACpB,KAAK,GAAG,SAAS,CAAC;gBAClB,MAAM;YAEP,KAAK,gBAAQ,CAAC,KAAK;gBAClB,KAAK,GAAG,SAAS,CAAC;gBAClB,MAAM;QACR,CAAC;QAED,OAAO,KAAK,IAAI,SAAS,CAAC;IAC3B,CAAC;IAES,UAAU,CAAC,KAAe,EAAE,IAAa,EAAE,MAAc,EAAE,KAAiB;QACrF,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QACzC,KAAK,MAAM,KAAK,IAAI,KAAK,EAAE,CAAC;YAC3B,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;gBAC/B,OAAO,CAAC,GAAG,CAAC,KAAK,MAAM,GAAG,KAAK,EAAE,EAAE,UAAU,KAAK,EAAE,CAAC,CAAC;gBACtD,SAAQ;YACT,CAAC;YAED,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC;IACF,CAAC;CACD;AAEY,QAAA,iBAAiB,GAAG,IAAI,uBAAuB,EAAE,CAAC"}
|
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* ts-common is the basic building blocks of our typescript projects
|
|
4
|
+
*
|
|
5
|
+
* Copyright (C) 2020 Intuition Robotics
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
2
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
20
|
exports.LogClient_Function = void 0;
|
|
4
21
|
const LogClient_1 = require("./LogClient");
|
|
@@ -13,7 +30,7 @@ class LogClient_Function_class extends LogClient_1.LogClient {
|
|
|
13
30
|
if (logParam)
|
|
14
31
|
// @ts-ignore
|
|
15
32
|
if (logParam.stack) {
|
|
16
|
-
console.log(`${prefix}${utils_1._logger_logException(logParam)}`);
|
|
33
|
+
console.log(`${prefix}${(0, utils_1._logger_logException)(logParam)}`);
|
|
17
34
|
continue;
|
|
18
35
|
}
|
|
19
36
|
switch (typeof logParam) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogClient_Function.js","sourceRoot":"","sources":["../../../src/main/core/logger/LogClient_Function.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"LogClient_Function.js","sourceRoot":"","sources":["../../../src/main/core/logger/LogClient_Function.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAMH,2CAAsC;AACtC,mCAA6C;AAE7C,MAAM,wBACL,SAAQ,qBAAS;IACjB;QACC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,IAAI,GAAG,IAAI,CAAC,CAAA;IACtD,CAAC;IAES,UAAU,CAAC,KAAe,EAAE,IAAa,EAAE,MAAc,EAAE,KAAiB;QACrF,KAAK,MAAM,QAAQ,IAAI,KAAK,EAAE,CAAC;YAC9B,IAAI,QAAQ;gBACX,aAAa;gBACb,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;oBACpB,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,IAAA,4BAAoB,EAAC,QAAiB,CAAC,EAAE,CAAC,CAAC;oBACnE,SAAS;gBACV,CAAC;YAEF,QAAQ,OAAO,QAAQ,EAAE,CAAC;gBACzB,KAAK,WAAW,CAAC;gBACjB,KAAK,UAAU,CAAC;gBAChB,KAAK,QAAQ,CAAC;gBACd,KAAK,QAAQ;oBACZ,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,OAAO,QAAQ,EAAE,CAAC,CAAC;oBAC3C,SAAS;gBAEV,KAAK,SAAS,CAAC;gBACf,KAAK,QAAQ,CAAC;gBACd,KAAK,QAAQ;oBACZ,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,QAAQ,EAAE,CAAC,CAAC;oBACpC,SAAS;gBAEV,KAAK,QAAQ;oBACZ,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;oBACpD,SAAS;YACX,CAAC;QACF,CAAC;IACF,CAAC;CACD;AAEY,QAAA,kBAAkB,GAAG,IAAI,wBAAwB,EAAE,CAAC"}
|
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Permissions management system, define access level for each of
|
|
4
|
+
* your server apis, and restrict users by giving them access levels
|
|
5
|
+
*
|
|
6
|
+
* Copyright (C) 2020 Intuition Robotics
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
* you may not use this file except in compliance with the License.
|
|
10
|
+
* You may obtain a copy of the License at
|
|
11
|
+
*
|
|
12
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
*
|
|
14
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
* See the License for the specific language governing permissions and
|
|
18
|
+
* limitations under the License.
|
|
19
|
+
*/
|
|
2
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
21
|
exports.LogClient_MemBuffer = void 0;
|
|
4
22
|
const LogClient_BaseRotate_1 = require("./LogClient_BaseRotate");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogClient_MemBuffer.js","sourceRoot":"","sources":["../../../src/main/core/logger/LogClient_MemBuffer.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"LogClient_MemBuffer.js","sourceRoot":"","sources":["../../../src/main/core/logger/LogClient_MemBuffer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAEH,iEAA4D;AAG5D,MAAa,mBACZ,SAAQ,2CAAoB;IAI5B,YAAY,IAAY,EAAE,UAAU,GAAG,EAAE,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI;QAC/D,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;QAHzB,YAAO,GAAa,CAAC,EAAE,CAAC,CAAC;IAIlC,CAAC;IAES,eAAe,CAAC,GAAW;QACpC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC;IACxB,CAAC;IAES,OAAO;IACjB,CAAC;IAES,YAAY,CAAC,SAAiB,EAAE,OAAe;QACxD,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACjD,CAAC;IAES,OAAO;QAChB,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;IACtB,CAAC;CACD;AAvBD,kDAuBC"}
|
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* ts-common is the basic building blocks of our typescript projects
|
|
4
|
+
*
|
|
5
|
+
* Copyright (C) 2020 Intuition Robotics
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
2
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
20
|
exports.LogClient_Terminal = exports.NoColor = void 0;
|
|
4
21
|
const types_1 = require("./types");
|
|
@@ -29,8 +46,8 @@ class LogClient_Terminal_class extends LogClient_1.LogClient {
|
|
|
29
46
|
}
|
|
30
47
|
logMessage(level, bold, prefix, toLog) {
|
|
31
48
|
const color = this.getColor(level, bold);
|
|
32
|
-
const paramsAsStrings = utils_1._logger_convertLogParamsToStrings(toLog);
|
|
33
|
-
console.log(utils_1._logger_indentNewLineBy(color + prefix, paramsAsStrings.join(" ")) + exports.NoColor);
|
|
49
|
+
const paramsAsStrings = (0, utils_1._logger_convertLogParamsToStrings)(toLog);
|
|
50
|
+
console.log((0, utils_1._logger_indentNewLineBy)(color + prefix, paramsAsStrings.join(" ")) + exports.NoColor);
|
|
34
51
|
}
|
|
35
52
|
}
|
|
36
53
|
exports.LogClient_Terminal = new LogClient_Terminal_class();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogClient_Terminal.js","sourceRoot":"","sources":["../../../src/main/core/logger/LogClient_Terminal.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"LogClient_Terminal.js","sourceRoot":"","sources":["../../../src/main/core/logger/LogClient_Terminal.ts"],"names":[],"mappings":";AAAA;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";
|
|
2
|
+
/*
|
|
3
|
+
* ts-common is the basic building blocks of our typescript projects
|
|
4
|
+
*
|
|
5
|
+
* Copyright (C) 2020 Intuition Robotics
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
2
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
20
|
exports.Logger = void 0;
|
|
4
21
|
const debug_flags_1 = require("../debug-flags");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Logger.js","sourceRoot":"","sources":["../../../src/main/core/logger/Logger.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"Logger.js","sourceRoot":"","sources":["../../../src/main/core/logger/Logger.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAEH,gDAGwB;AACxB,mCAIiB;AACjB,yCAAoC;AAEpC,MAAa,MAAM;IASlB,YAAmB,GAAY;QAFrB,aAAQ,GAAG,gBAAQ,CAAC,OAAO,CAAC;QAGrC,IAAI,CAAC,GAAG,GAAG,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAE3C,IAAI,CAAC,WAAW,GAAG,wBAAU,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACnD,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC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AAE,IAAI,EAAE,KAAK,CAAC,CAAC;IACtC,CAAC;IAEM,cAAc,CAAC,GAAG,KAAiB;QACzC,IAAI,CAAC,GAAG,CAAC,gBAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IACzC,CAAC;IAEM,YAAY,CAAC,GAAG,KAAiB;QACvC,IAAI,CAAC,GAAG,CAAC,gBAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IACvC,CAAC;IAEM,GAAG,CAAC,KAAe,EAAE,IAAa,EAAE,KAAiB;QAC3D,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC;YAC9B,OAAO;QAER,aAAa;QACb,mBAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IAChD,CAAC;IAEO,cAAc,CAAC,KAAe;QACrC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE;YAChC,OAAO;QAER,OAAO,uBAAe,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,uBAAe,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAChF,CAAC;;AA9EF,wBA+EC;AA7EuB,UAAG,GAAG,IAAI,MAAM,CAAC,QAAQ,CAAC,AAAvB,CAAwB;AAGpC,uBAAgB,GAAG,IAAI,AAAP,CAAQ"}
|
package/core/logger/types.d.ts
CHANGED
|
@@ -6,5 +6,5 @@ export declare enum LogLevel {
|
|
|
6
6
|
Error = "Error"
|
|
7
7
|
}
|
|
8
8
|
export declare const LogLevelOrdinal: LogLevel[];
|
|
9
|
-
export
|
|
10
|
-
export
|
|
9
|
+
export type LogPrefixComposer = (tag: string, level: LogLevel) => string;
|
|
10
|
+
export type LogParam = string | number | object | any[] | Error | undefined | null | unknown;
|