@leyyo/common 1.0.8 → 1.0.10
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/dist/assertion/assertion.common.d.ts +183 -0
- package/dist/assertion/assertion.common.js +663 -0
- package/dist/assertion/assertion.common.js.map +1 -0
- package/dist/assertion/index.d.ts +1 -1
- package/dist/assertion/index.js +1 -1
- package/dist/assertion/index.types.d.ts +661 -0
- package/dist/assertion/{index-types.js → index.types.js} +1 -1
- package/dist/assertion/index.types.js.map +1 -0
- package/dist/assets/.gitkeep +0 -0
- package/dist/config/config.common.d.ts +16 -0
- package/dist/config/config.common.js +81 -0
- package/dist/config/config.common.js.map +1 -0
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.js +18 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/index.types.d.ts +13 -0
- package/dist/{descriptor/index-types.js → config/index.types.js} +1 -1
- package/dist/config/index.types.js.map +1 -0
- package/dist/deploy/deploy.common.d.ts +29 -0
- package/dist/deploy/deploy.common.js +106 -0
- package/dist/deploy/deploy.common.js.map +1 -0
- package/dist/deploy/index.d.ts +1 -0
- package/dist/deploy/index.js +18 -0
- package/dist/deploy/index.js.map +1 -0
- package/dist/deploy/index.types.d.ts +25 -0
- package/dist/{developer/index-types.js → deploy/index.types.js} +1 -1
- package/dist/deploy/index.types.js.map +1 -0
- package/dist/descriptor/descriptor.common.d.ts +22 -0
- package/dist/descriptor/descriptor.common.js +117 -0
- package/dist/descriptor/descriptor.common.js.map +1 -0
- package/dist/descriptor/index.d.ts +1 -1
- package/dist/descriptor/index.js +1 -1
- package/dist/descriptor/index.types.d.ts +23 -0
- package/dist/{error/index-types.js → descriptor/index.types.js} +1 -1
- package/dist/descriptor/index.types.js.map +1 -0
- package/dist/developer/developer.common.d.ts +32 -0
- package/dist/developer/{common-developer.js → developer.common.js} +85 -106
- package/dist/developer/developer.common.js.map +1 -0
- package/dist/developer/index.d.ts +2 -1
- package/dist/developer/index.errors.d.ts +13 -0
- package/dist/developer/index.errors.js +24 -0
- package/dist/developer/index.errors.js.map +1 -0
- package/dist/developer/index.js +2 -1
- package/dist/developer/index.js.map +1 -1
- package/dist/developer/{index-types.d.ts → index.types.d.ts} +23 -15
- package/dist/developer/index.types.js +3 -0
- package/dist/developer/index.types.js.map +1 -0
- package/dist/error/{common-error.d.ts → error.common.d.ts} +10 -9
- package/dist/error/{common-error.js → error.common.js} +21 -16
- package/dist/error/error.common.js.map +1 -0
- package/dist/error/index.d.ts +1 -1
- package/dist/error/index.js +1 -1
- package/dist/error/{index-types.d.ts → index.types.d.ts} +5 -5
- package/dist/error/index.types.js +3 -0
- package/dist/error/index.types.js.map +1 -0
- package/dist/exception/{assertion-exception.d.ts → assertion.exception.d.ts} +1 -1
- package/dist/exception/{assertion-exception.js → assertion.exception.js} +1 -1
- package/dist/exception/assertion.exception.js.map +1 -0
- package/dist/exception/{caused-exception.d.ts → caused.exception.d.ts} +1 -1
- package/dist/exception/{caused-exception.js → caused.exception.js} +1 -1
- package/dist/exception/{caused-exception.js.map → caused.exception.js.map} +1 -1
- package/dist/exception/{developer-exception.d.ts → developer.exception.d.ts} +1 -1
- package/dist/exception/{developer-exception.js → developer.exception.js} +1 -1
- package/dist/exception/developer.exception.js.map +1 -0
- package/dist/exception/exception.d.ts +7 -11
- package/dist/exception/exception.js +17 -34
- package/dist/exception/exception.js.map +1 -1
- package/dist/exception/index.d.ts +6 -6
- package/dist/exception/index.js +6 -6
- package/dist/exception/{index-types.d.ts → index.types.d.ts} +1 -1
- package/dist/exception/index.types.js +3 -0
- package/dist/exception/index.types.js.map +1 -0
- package/dist/exception/{invalid-value-exception.d.ts → invalid-value.exception.d.ts} +1 -1
- package/dist/exception/{invalid-value-exception.js → invalid-value.exception.js} +1 -1
- package/dist/exception/invalid-value.exception.js.map +1 -0
- package/dist/exception/{multiple-exception.d.ts → multiple.exception.d.ts} +1 -1
- package/dist/exception/{multiple-exception.js → multiple.exception.js} +1 -1
- package/dist/exception/{multiple-exception.js.map → multiple.exception.js.map} +1 -1
- package/dist/fqn/fqn.common.d.ts +20 -0
- package/dist/fqn/{common-fqn.js → fqn.common.js} +27 -20
- package/dist/fqn/fqn.common.js.map +1 -0
- package/dist/fqn/index.d.ts +1 -1
- package/dist/fqn/index.js +1 -1
- package/dist/fqn/{index-types.d.ts → index.types.d.ts} +8 -8
- package/dist/fqn/index.types.js +3 -0
- package/dist/fqn/index.types.js.map +1 -0
- package/dist/hook/hook.common.d.ts +25 -0
- package/dist/hook/hook.common.js +95 -0
- package/dist/hook/hook.common.js.map +1 -0
- package/dist/hook/index.d.ts +1 -1
- package/dist/hook/index.js +1 -1
- package/dist/hook/{index-types.d.ts → index.types.d.ts} +7 -6
- package/dist/hook/index.types.js +3 -0
- package/dist/hook/index.types.js.map +1 -0
- package/dist/index.d.ts +24 -14
- package/dist/index.js +16 -5
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +1 -3
- package/dist/internal.js +2 -4
- package/dist/internal.js.map +1 -1
- package/dist/is/index.d.ts +1 -1
- package/dist/is/index.js +1 -1
- package/dist/is/{index-types.d.ts → index.types.d.ts} +58 -7
- package/dist/is/index.types.js +3 -0
- package/dist/is/index.types.js.map +1 -0
- package/dist/is/{common-is.d.ts → is.common.d.ts} +22 -8
- package/dist/is/{common-is.js → is.common.js} +57 -16
- package/dist/is/is.common.js.map +1 -0
- package/dist/leyyo/index.d.ts +2 -2
- package/dist/leyyo/index.js +2 -2
- package/dist/leyyo/index.types.d.ts +41 -0
- package/dist/leyyo/index.types.js +3 -0
- package/dist/leyyo/index.types.js.map +1 -0
- package/dist/leyyo/{leyyo-common-hook.d.ts → leyyo-hook.common.d.ts} +1 -1
- package/dist/leyyo/leyyo-hook.common.js +18 -0
- package/dist/leyyo/leyyo-hook.common.js.map +1 -0
- package/dist/leyyo/leyyo.d.ts +38 -28
- package/dist/leyyo/leyyo.js +46 -31
- package/dist/leyyo/leyyo.js.map +1 -1
- package/dist/log/index.d.ts +2 -2
- package/dist/log/index.js +2 -2
- package/dist/log/{index-types.d.ts → index.types.d.ts} +24 -29
- package/dist/log/index.types.js +3 -0
- package/dist/log/index.types.js.map +1 -0
- package/dist/log/log.common.d.ts +15 -0
- package/dist/log/log.common.js +160 -0
- package/dist/log/log.common.js.map +1 -0
- package/dist/log/logger.instance.d.ts +26 -0
- package/dist/log/logger.instance.js +149 -0
- package/dist/log/logger.instance.js.map +1 -0
- package/dist/log/severity.d.ts +1 -1
- package/dist/log/severity.js +1 -1
- package/dist/log/severity.js.map +1 -1
- package/dist/mixin/index.d.ts +1 -0
- package/dist/mixin/index.js +18 -0
- package/dist/mixin/index.js.map +1 -0
- package/dist/mixin/index.types.d.ts +19 -0
- package/dist/mixin/index.types.js +3 -0
- package/dist/mixin/index.types.js.map +1 -0
- package/dist/mixin/mixin.common.d.ts +22 -0
- package/dist/mixin/mixin.common.js +165 -0
- package/dist/mixin/mixin.common.js.map +1 -0
- package/dist/name/index.d.ts +1 -0
- package/dist/name/index.js +18 -0
- package/dist/name/index.js.map +1 -0
- package/dist/name/index.types.d.ts +21 -0
- package/dist/name/index.types.js +3 -0
- package/dist/name/index.types.js.map +1 -0
- package/dist/name/name.common.d.ts +16 -0
- package/dist/name/name.common.js +82 -0
- package/dist/name/name.common.js.map +1 -0
- package/dist/repo/index.d.ts +1 -2
- package/dist/repo/index.js +1 -2
- package/dist/repo/index.js.map +1 -1
- package/dist/repo/{index-types.d.ts → index.types.d.ts} +36 -18
- package/dist/repo/index.types.js +3 -0
- package/dist/repo/index.types.js.map +1 -0
- package/dist/repo/repo.common.d.ts +47 -0
- package/dist/repo/repo.common.js +166 -0
- package/dist/repo/repo.common.js.map +1 -0
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/dist/shared/index.d.ts +1 -1
- package/dist/shared/index.js +1 -1
- package/dist/shared/{index-types.d.ts → index.types.d.ts} +48 -30
- package/dist/shared/{index-types.js → index.types.js} +2 -1
- package/dist/shared/index.types.js.map +1 -0
- package/dist/system/index.d.ts +1 -3
- package/dist/system/index.js +1 -3
- package/dist/system/index.js.map +1 -1
- package/dist/system/index.types.d.ts +6 -0
- package/dist/system/index.types.js +3 -0
- package/dist/system/index.types.js.map +1 -0
- package/dist/system/system.common.d.ts +11 -0
- package/dist/system/{common-system.js → system.common.js} +14 -15
- package/dist/system/system.common.js.map +1 -0
- package/dist/test/index.d.ts +2 -0
- package/dist/test/index.js +19 -0
- package/dist/test/index.js.map +1 -0
- package/dist/test/index.types.d.ts +9 -0
- package/dist/test/index.types.js +3 -0
- package/dist/test/index.types.js.map +1 -0
- package/dist/test/test.common.d.ts +14 -0
- package/dist/test/test.common.js +48 -0
- package/dist/test/test.common.js.map +1 -0
- package/dist/test/tested.d.ts +1 -0
- package/dist/test/tested.js +9 -0
- package/dist/test/tested.js.map +1 -0
- package/dist/to/index.d.ts +1 -1
- package/dist/to/index.js +1 -1
- package/dist/to/index.types.d.ts +72 -0
- package/dist/to/index.types.js +3 -0
- package/dist/to/index.types.js.map +1 -0
- package/dist/to/list.d.ts +10 -0
- package/dist/to/list.js +18 -0
- package/dist/to/list.js.map +1 -1
- package/dist/to/to.common.d.ts +73 -0
- package/dist/to/{common-to.js → to.common.js} +558 -385
- package/dist/to/to.common.js.map +1 -0
- package/dist/wrapper/index.d.ts +1 -1
- package/dist/wrapper/index.js +1 -1
- package/dist/wrapper/{index-types.d.ts → index.types.d.ts} +8 -8
- package/dist/wrapper/index.types.js +3 -0
- package/dist/wrapper/index.types.js.map +1 -0
- package/dist/wrapper/wrap.d.ts +3 -3
- package/dist/wrapper/wrapper.common.d.ts +26 -0
- package/dist/wrapper/{common-wrapper.js → wrapper.common.js} +15 -14
- package/dist/wrapper/wrapper.common.js.map +1 -0
- package/package.json +5 -2
- package/dist/assertion/common-assertion.d.ts +0 -54
- package/dist/assertion/common-assertion.js +0 -180
- package/dist/assertion/common-assertion.js.map +0 -1
- package/dist/assertion/index-types.d.ts +0 -465
- package/dist/assertion/index-types.js.map +0 -1
- package/dist/descriptor/common-descriptor.d.ts +0 -19
- package/dist/descriptor/common-descriptor.js +0 -92
- package/dist/descriptor/common-descriptor.js.map +0 -1
- package/dist/descriptor/index-types.d.ts +0 -21
- package/dist/descriptor/index-types.js.map +0 -1
- package/dist/developer/common-developer.d.ts +0 -29
- package/dist/developer/common-developer.js.map +0 -1
- package/dist/developer/index-types.js.map +0 -1
- package/dist/error/common-error.js.map +0 -1
- package/dist/error/index-types.js.map +0 -1
- package/dist/exception/assertion-exception.js.map +0 -1
- package/dist/exception/developer-exception.js.map +0 -1
- package/dist/exception/index-types.js +0 -3
- package/dist/exception/index-types.js.map +0 -1
- package/dist/exception/invalid-value-exception.js.map +0 -1
- package/dist/fqn/common-fqn.d.ts +0 -20
- package/dist/fqn/common-fqn.js.map +0 -1
- package/dist/fqn/index-types.js +0 -3
- package/dist/fqn/index-types.js.map +0 -1
- package/dist/hook/common-hook.d.ts +0 -32
- package/dist/hook/common-hook.js +0 -117
- package/dist/hook/common-hook.js.map +0 -1
- package/dist/hook/index-types.js +0 -3
- package/dist/hook/index-types.js.map +0 -1
- package/dist/is/common-is.js.map +0 -1
- package/dist/is/index-types.js +0 -3
- package/dist/is/index-types.js.map +0 -1
- package/dist/leyyo/index-types.d.ts +0 -31
- package/dist/leyyo/index-types.js +0 -3
- package/dist/leyyo/index-types.js.map +0 -1
- package/dist/leyyo/leyyo-common-hook.js +0 -18
- package/dist/leyyo/leyyo-common-hook.js.map +0 -1
- package/dist/log/common-log.d.ts +0 -14
- package/dist/log/common-log.js +0 -92
- package/dist/log/common-log.js.map +0 -1
- package/dist/log/index-types.js +0 -3
- package/dist/log/index-types.js.map +0 -1
- package/dist/log/logger-instance.d.ts +0 -31
- package/dist/log/logger-instance.js +0 -113
- package/dist/log/logger-instance.js.map +0 -1
- package/dist/repo/common-repo.d.ts +0 -44
- package/dist/repo/common-repo.js +0 -180
- package/dist/repo/common-repo.js.map +0 -1
- package/dist/repo/index-types.js +0 -3
- package/dist/repo/index-types.js.map +0 -1
- package/dist/repo/repo-type.d.ts +0 -8
- package/dist/repo/repo-type.js +0 -8
- package/dist/repo/repo-type.js.map +0 -1
- package/dist/shared/index-types.js.map +0 -1
- package/dist/system/common-system.d.ts +0 -10
- package/dist/system/common-system.js.map +0 -1
- package/dist/system/http-method.d.ts +0 -8
- package/dist/system/http-method.js +0 -8
- package/dist/system/http-method.js.map +0 -1
- package/dist/system/http-place.d.ts +0 -8
- package/dist/system/http-place.js +0 -8
- package/dist/system/http-place.js.map +0 -1
- package/dist/system/index-types.d.ts +0 -6
- package/dist/system/index-types.js +0 -3
- package/dist/system/index-types.js.map +0 -1
- package/dist/to/common-to.d.ts +0 -45
- package/dist/to/common-to.js.map +0 -1
- package/dist/to/index-types.d.ts +0 -40
- package/dist/to/index-types.js +0 -3
- package/dist/to/index-types.js.map +0 -1
- package/dist/wrapper/common-wrapper.d.ts +0 -26
- package/dist/wrapper/common-wrapper.js.map +0 -1
- package/dist/wrapper/index-types.js +0 -3
- package/dist/wrapper/index-types.js.map +0 -1
package/dist/leyyo/leyyo.d.ts
CHANGED
|
@@ -1,35 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
1
|
+
import type { Fnc } from "../shared";
|
|
2
|
+
import type { ConfigCommonLike } from "../config";
|
|
3
|
+
import type { DeployCommonLike } from "../deploy";
|
|
4
|
+
import type { MixinCommonLike } from "../mixin";
|
|
5
|
+
import type { NameCommonLike } from "../name";
|
|
6
|
+
import type { HookCommonLike } from "../hook";
|
|
7
|
+
import type { LeyyoLike, LeyyoSecure } from "./index.types";
|
|
8
|
+
import type { IsCommonLike } from "../is";
|
|
9
|
+
import type { AssertionCommonLike } from "../assertion";
|
|
10
|
+
import type { ErrorCommonLike } from "../error";
|
|
11
|
+
import type { LogCommonLike } from "../log";
|
|
12
|
+
import type { RepoCommonLike } from "../repo";
|
|
13
|
+
import type { ToCommonLike } from "../to";
|
|
14
|
+
import type { FqnCommonLike } from "../fqn";
|
|
15
|
+
import type { SystemCommonLike } from "../system";
|
|
16
|
+
import type { DeveloperCommonLike } from "../developer";
|
|
17
|
+
import type { DescriptorCommonLike } from "../descriptor";
|
|
18
|
+
import type { WrapperCommonLike } from "../wrapper";
|
|
19
|
+
import type { TestCommonLike } from "../test";
|
|
15
20
|
export declare class Leyyo implements LeyyoLike, LeyyoSecure {
|
|
16
21
|
private _lazyCallbacks;
|
|
17
22
|
private _earlyCallbacks;
|
|
18
|
-
readonly hook:
|
|
19
|
-
readonly is:
|
|
20
|
-
readonly assertion:
|
|
21
|
-
readonly error:
|
|
22
|
-
readonly log:
|
|
23
|
-
readonly repo:
|
|
24
|
-
readonly to:
|
|
25
|
-
readonly fqn:
|
|
26
|
-
readonly system:
|
|
27
|
-
readonly dev:
|
|
28
|
-
readonly descriptor:
|
|
29
|
-
readonly wrapper:
|
|
23
|
+
readonly hook: HookCommonLike;
|
|
24
|
+
readonly is: IsCommonLike;
|
|
25
|
+
readonly assertion: AssertionCommonLike;
|
|
26
|
+
readonly error: ErrorCommonLike;
|
|
27
|
+
readonly log: LogCommonLike;
|
|
28
|
+
readonly repo: RepoCommonLike;
|
|
29
|
+
readonly to: ToCommonLike;
|
|
30
|
+
readonly fqn: FqnCommonLike;
|
|
31
|
+
readonly system: SystemCommonLike;
|
|
32
|
+
readonly dev: DeveloperCommonLike;
|
|
33
|
+
readonly descriptor: DescriptorCommonLike;
|
|
34
|
+
readonly wrapper: WrapperCommonLike;
|
|
35
|
+
readonly test: TestCommonLike;
|
|
36
|
+
readonly deploy: DeployCommonLike;
|
|
37
|
+
readonly name: NameCommonLike;
|
|
38
|
+
readonly config: ConfigCommonLike;
|
|
39
|
+
readonly mixin: MixinCommonLike;
|
|
30
40
|
constructor();
|
|
31
41
|
get $secure(): LeyyoSecure;
|
|
32
42
|
get $back(): LeyyoLike;
|
|
33
|
-
$earlyRun(fn:
|
|
34
|
-
$lazyRun(fn:
|
|
43
|
+
$earlyRun(fn: Fnc): LeyyoSecure;
|
|
44
|
+
$lazyRun(fn: Fnc): LeyyoSecure;
|
|
35
45
|
}
|
package/dist/leyyo/leyyo.js
CHANGED
|
@@ -2,51 +2,66 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Leyyo = void 0;
|
|
4
4
|
const internal_1 = require("../internal");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
5
|
+
const system_common_1 = require("../system/system.common");
|
|
6
|
+
const is_common_1 = require("../is/is.common");
|
|
7
|
+
const repo_common_1 = require("../repo/repo.common");
|
|
8
|
+
const hook_common_1 = require("../hook/hook.common");
|
|
9
|
+
const log_common_1 = require("../log/log.common");
|
|
10
|
+
const fqn_common_1 = require("../fqn/fqn.common");
|
|
11
|
+
const developer_common_1 = require("../developer/developer.common");
|
|
12
|
+
const error_common_1 = require("../error/error.common");
|
|
13
|
+
const assertion_common_1 = require("../assertion/assertion.common");
|
|
14
|
+
const to_common_1 = require("../to/to.common");
|
|
15
|
+
const descriptor_common_1 = require("../descriptor/descriptor.common");
|
|
16
|
+
const wrapper_common_1 = require("../wrapper/wrapper.common");
|
|
17
|
+
const test_common_1 = require("../test/test.common");
|
|
18
|
+
const deploy_common_1 = require("../deploy/deploy.common");
|
|
19
|
+
const name_common_1 = require("../name/name.common");
|
|
20
|
+
const config_common_1 = require("../config/config.common");
|
|
21
|
+
const mixin_common_1 = require("../mixin/mixin.common");
|
|
17
22
|
class Leyyo {
|
|
18
23
|
constructor() {
|
|
19
24
|
this._lazyCallbacks = [];
|
|
20
25
|
this._earlyCallbacks = [];
|
|
21
|
-
this.system = new
|
|
22
|
-
this.is = new
|
|
23
|
-
this.
|
|
24
|
-
this.
|
|
25
|
-
this.
|
|
26
|
-
this.
|
|
27
|
-
this.dev = new
|
|
28
|
-
this.
|
|
29
|
-
this.assertion = new
|
|
30
|
-
this.
|
|
31
|
-
this.descriptor = new
|
|
32
|
-
this.
|
|
26
|
+
this.system = new system_common_1.SystemCommon(this); // no
|
|
27
|
+
this.is = new is_common_1.IsCommon(this); // no
|
|
28
|
+
this.test = new test_common_1.TestCommon(this); // no
|
|
29
|
+
this.repo = new repo_common_1.RepoCommon(this); // none
|
|
30
|
+
this.config = new config_common_1.ConfigCommon(this); // is
|
|
31
|
+
this.mixin = new mixin_common_1.MixinCommon(this); // is
|
|
32
|
+
this.dev = new developer_common_1.DeveloperCommon(this); // test
|
|
33
|
+
this.deploy = new deploy_common_1.DeployCommon(this); // dev, test
|
|
34
|
+
this.assertion = new assertion_common_1.AssertionCommon(this); // dev, test
|
|
35
|
+
this.wrapper = new wrapper_common_1.WrapperCommon(this); // assertion, dev
|
|
36
|
+
this.descriptor = new descriptor_common_1.DescriptorCommon(this); // assertion, dev
|
|
37
|
+
this.name = new name_common_1.NameCommon(this); // assertion, dev, descriptor
|
|
38
|
+
this.to = new to_common_1.ToCommon(this); // is, dev, wrapper
|
|
39
|
+
this.hook = new hook_common_1.HookCommon(this); // repo, assertion, dev, sym
|
|
40
|
+
this.error = new error_common_1.ErrorCommon(this); // hook
|
|
41
|
+
this.log = new log_common_1.LogCommon(this); // hook, test
|
|
42
|
+
this.fqn = new fqn_common_1.FqnCommon(this); // hook, descriptor, dev
|
|
33
43
|
const members = [
|
|
34
44
|
this.system.$secure,
|
|
35
45
|
this.is.$secure,
|
|
46
|
+
this.test.$secure,
|
|
36
47
|
this.repo.$secure,
|
|
37
|
-
this.
|
|
38
|
-
this.
|
|
48
|
+
this.config.$secure,
|
|
49
|
+
this.mixin.$secure,
|
|
39
50
|
this.dev.$secure,
|
|
40
|
-
this.
|
|
41
|
-
this.error.$secure,
|
|
51
|
+
this.deploy.$secure,
|
|
42
52
|
this.assertion.$secure,
|
|
43
|
-
this.to.$secure,
|
|
44
|
-
this.descriptor.$secure,
|
|
45
53
|
this.wrapper.$secure,
|
|
54
|
+
this.descriptor.$secure,
|
|
55
|
+
this.name.$secure,
|
|
56
|
+
this.to.$secure,
|
|
57
|
+
this.hook.$secure,
|
|
58
|
+
this.error.$secure,
|
|
59
|
+
this.log.$secure,
|
|
60
|
+
this.fqn.$secure,
|
|
46
61
|
];
|
|
47
62
|
members.forEach(member => member.$init(this));
|
|
48
63
|
this.$lazyRun(() => {
|
|
49
|
-
this.fqn.register(null, Leyyo, 'class', internal_1.
|
|
64
|
+
this.fqn.register(null, Leyyo, 'class', internal_1.FQN);
|
|
50
65
|
});
|
|
51
66
|
this._earlyCallbacks.forEach(fn => fn());
|
|
52
67
|
this._lazyCallbacks.forEach(fn => fn());
|
package/dist/leyyo/leyyo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leyyo.js","sourceRoot":"","sources":["../../src/leyyo/leyyo.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"leyyo.js","sourceRoot":"","sources":["../../src/leyyo/leyyo.ts"],"names":[],"mappings":";;;AACA,0CAAgC;AAChC,2DAAqD;AACrD,+CAAyC;AACzC,qDAA+C;AAC/C,qDAA+C;AAC/C,kDAA4C;AAC5C,kDAA4C;AAC5C,oEAA8D;AAC9D,wDAAkD;AAClD,oEAA8D;AAC9D,+CAAyC;AACzC,uEAAiE;AACjE,8DAAwD;AACxD,qDAA+C;AAC/C,2DAAqD;AACrD,qDAA+C;AAC/C,2DAAqD;AACrD,wDAAkD;AAqBlD,MAAa,KAAK;IAqBd;QApBQ,mBAAc,GAAe,EAAE,CAAC;QAChC,oBAAe,GAAe,EAAE,CAAC;QAoBrC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;QACxC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YACrB,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;QAEH,CAAC,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,gBAAgB,EAAE,iBAAiB,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YAC/F,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACxC,CAAC,CAAC,CAAA;IACN,CAAC;IAED,gBAAgB;IAEhB,IAAI,OAAO;QACP,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,IAAI,KAAK;QACL,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,SAAS,CAAC,EAAO;QACb,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC9B,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,QAAQ,CAAC,EAAO;QACZ,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC7B,OAAO,IAAI,CAAC;IAChB,CAAC;CAGJ;AAhGD,sBAgGC"}
|
package/dist/log/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './index
|
|
2
|
-
export * from './logger
|
|
1
|
+
export * from './index.types';
|
|
2
|
+
export * from './logger.instance';
|
|
3
3
|
export * from './severity';
|
package/dist/log/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./index
|
|
18
|
-
__exportStar(require("./logger
|
|
17
|
+
__exportStar(require("./index.types"), exports);
|
|
18
|
+
__exportStar(require("./logger.instance"), exports);
|
|
19
19
|
__exportStar(require("./severity"), exports);
|
|
20
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { Dict, InitLike, ShiftMain, ShiftSecure } from "../shared";
|
|
2
|
-
import { HookDefinedProvider } from "../hook";
|
|
3
|
-
import { DevOpt } from "../developer";
|
|
4
|
-
import { Severity } from "./severity";
|
|
5
|
-
|
|
1
|
+
import type { Dict, InitLike, ShiftMain, ShiftSecure } from "../shared";
|
|
2
|
+
import type { HookDefinedProvider } from "../hook";
|
|
3
|
+
import type { DevOpt } from "../developer";
|
|
4
|
+
import type { Severity } from "./severity";
|
|
5
|
+
import type { DeployCommonSecure } from "../deploy";
|
|
6
|
+
export interface LogCommonLike extends ShiftSecure<LogCommonSecure>, LogConsumer {
|
|
6
7
|
create(clazz: Object | Function | string): Logger;
|
|
7
8
|
}
|
|
8
|
-
export type
|
|
9
|
+
export type LogCommonSecure = ShiftMain<LogCommonLike> & InitLike;
|
|
9
10
|
export interface LogDefinedProvider extends HookDefinedProvider {
|
|
10
11
|
create?(clazz: Object | Function | string): Logger;
|
|
11
12
|
apply?(line: LogLine): void;
|
|
@@ -26,34 +27,28 @@ export interface LogLineEnhanced<L = Dict> extends LogLine {
|
|
|
26
27
|
locals?: L;
|
|
27
28
|
}
|
|
28
29
|
export interface Logger extends ShiftSecure<LoggerSecure> {
|
|
29
|
-
error(message: string, params?: any | DevOpt): void;
|
|
30
|
-
error(error: Error, params?: any | DevOpt): void;
|
|
31
|
-
error(whatever: any, params?: any | DevOpt): void;
|
|
32
|
-
error$(opt: DevOpt): void;
|
|
33
|
-
warn(message: string, params?: any | DevOpt): void;
|
|
34
|
-
warn(error: Error, params?: any | DevOpt): void;
|
|
35
|
-
warn(whatever: any, params?: any | DevOpt): void;
|
|
36
|
-
info(message: string, params?: any | DevOpt): void;
|
|
37
|
-
info(error: Error, params?: any | DevOpt): void;
|
|
38
|
-
info(whatever: any, params?: any | DevOpt): void;
|
|
39
|
-
log(message: string, params?: any | DevOpt): void;
|
|
40
|
-
log(error: Error, params?: any | DevOpt): void;
|
|
41
|
-
log(whatever: any, params?: any | DevOpt): void;
|
|
42
|
-
trace(message: string, params?: any | DevOpt): void;
|
|
43
|
-
trace(error: Error, params?: any | DevOpt): void;
|
|
44
|
-
trace(whatever: any, params?: any | DevOpt): void;
|
|
45
30
|
debug(message: string, params?: any | DevOpt): void;
|
|
46
31
|
debug(error: Error, params?: any | DevOpt): void;
|
|
47
32
|
debug(whatever: any, params?: any | DevOpt): void;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
33
|
+
trace(message: string, params?: any | DevOpt): void;
|
|
34
|
+
trace(error: Error, params?: any | DevOpt): void;
|
|
35
|
+
trace(whatever: any, params?: any | DevOpt): void;
|
|
36
|
+
info(message: string, params?: any | DevOpt): void;
|
|
37
|
+
info(error: Error, params?: any | DevOpt): void;
|
|
38
|
+
info(whatever: any, params?: any | DevOpt): void;
|
|
39
|
+
warn(message: string, params?: any | DevOpt): void;
|
|
40
|
+
warn(error: Error, params?: any | DevOpt): void;
|
|
41
|
+
warn(whatever: any, params?: any | DevOpt): void;
|
|
42
|
+
error(message: string, params?: any | DevOpt): void;
|
|
43
|
+
error(error: Error, params?: any | DevOpt): void;
|
|
44
|
+
error(whatever: any, params?: any | DevOpt): void;
|
|
45
|
+
fatal(message: string, params?: any | DevOpt): void;
|
|
46
|
+
fatal(error: Error, params?: any | DevOpt): void;
|
|
47
|
+
fatal(whatever: any, params?: any | DevOpt): void;
|
|
48
|
+
get deploy(): DeployCommonSecure;
|
|
53
49
|
}
|
|
54
50
|
export interface LoggerSecure extends ShiftMain<Logger> {
|
|
55
51
|
get $clazz(): Function;
|
|
56
52
|
get $name(): string;
|
|
57
|
-
$
|
|
53
|
+
$refresh(severity: Severity): void;
|
|
58
54
|
}
|
|
59
|
-
export type LoggerLambda = (whatever: any, params?: any | DevOpt) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.types.js","sourceRoot":"","sources":["../../src/log/index.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type LeyyoLike } from "../leyyo";
|
|
2
|
+
import type { LogCommonLike, LogCommonSecure, Logger, LogLine } from "./index.types";
|
|
3
|
+
export declare class LogCommon implements LogCommonLike, LogCommonSecure {
|
|
4
|
+
private lyy;
|
|
5
|
+
private COLORS;
|
|
6
|
+
constructor(lyy: LeyyoLike);
|
|
7
|
+
get $secure(): LogCommonSecure;
|
|
8
|
+
$init(): void;
|
|
9
|
+
create(clazz: Object | Function | string): Logger;
|
|
10
|
+
apply(line: LogLine): void;
|
|
11
|
+
private check;
|
|
12
|
+
private where;
|
|
13
|
+
private print;
|
|
14
|
+
get $back(): LogCommonLike;
|
|
15
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LogCommon = void 0;
|
|
4
|
+
const leyyo_1 = require("../leyyo");
|
|
5
|
+
const logger_instance_1 = require("./logger.instance");
|
|
6
|
+
const internal_1 = require("../internal");
|
|
7
|
+
const severity_1 = require("./severity");
|
|
8
|
+
const index_1 = require("../index");
|
|
9
|
+
const BLINK = '\\033[5m';
|
|
10
|
+
const RED1 = '\x1b[31m';
|
|
11
|
+
const RED2 = '\x1b[101m';
|
|
12
|
+
const GREEN1 = '\x1b[32m';
|
|
13
|
+
const GREEN2 = '\x1b[102m';
|
|
14
|
+
const YELLOW1 = '\x1b[33m';
|
|
15
|
+
const YELLOW2 = '\x1b[103m';
|
|
16
|
+
const BLUE1 = '\x1b[34m';
|
|
17
|
+
const BLUE2 = '\x1b[104m';
|
|
18
|
+
const MAGENTA1 = '\x1b[35m';
|
|
19
|
+
const MAGENTA2 = '\x1b[105m';
|
|
20
|
+
const CYAN1 = '\x1b[36m';
|
|
21
|
+
const CYAN2 = '\x1b[106m';
|
|
22
|
+
const GRAY1 = '\x1b[37m';
|
|
23
|
+
const END = '\x1b[0m';
|
|
24
|
+
const RED_FG = '\x1b[31m';
|
|
25
|
+
const GREEN_FG = '\x1b[32m';
|
|
26
|
+
const YELLOW_FG = '\x1b[33m';
|
|
27
|
+
const BLUE_FG = '\x1b[34m';
|
|
28
|
+
const MAGENTA_FG = '\x1b[35m';
|
|
29
|
+
const CYAN_FG = '\x1b[36m';
|
|
30
|
+
const RED_BG = '\x1b[41m';
|
|
31
|
+
const GREEN_BG = '\x1b[42m';
|
|
32
|
+
const YELLOW_BG = '\x1b[43m';
|
|
33
|
+
const BLUE_BG = '\x1b[44m';
|
|
34
|
+
const MAGENTA_BG = '\x1b[45m';
|
|
35
|
+
const CYAN_BG = '\x1b[46m';
|
|
36
|
+
// noinspection JSUnusedLocalSymbols,JSUnusedGlobalSymbols
|
|
37
|
+
class LogCommon {
|
|
38
|
+
constructor(lyy) {
|
|
39
|
+
this.lyy = lyy;
|
|
40
|
+
this.COLORS = {
|
|
41
|
+
debug: ['debug', 'DEBUG', GRAY1, CYAN_FG, '', ''],
|
|
42
|
+
trace: ['trace', 'TRACE', GRAY1, CYAN_FG, '', ''],
|
|
43
|
+
info: ['info', ' INFO', GREEN_BG, GREEN_FG, '', ''],
|
|
44
|
+
warn: ['warn', ' WARN', YELLOW_BG, YELLOW_FG, YELLOW_FG, END],
|
|
45
|
+
error: ['error', 'ERROR', RED_BG, RED_FG, RED_BG, END],
|
|
46
|
+
fatal: ['error', 'FATAL', MAGENTA_BG, MAGENTA_FG, MAGENTA_BG, END],
|
|
47
|
+
};
|
|
48
|
+
this.create.bind(this);
|
|
49
|
+
this.apply.bind(this);
|
|
50
|
+
this.check.bind(this);
|
|
51
|
+
this.print.bind(this);
|
|
52
|
+
}
|
|
53
|
+
get $secure() {
|
|
54
|
+
return this;
|
|
55
|
+
}
|
|
56
|
+
$init() {
|
|
57
|
+
// @formatter:off
|
|
58
|
+
this.lyy.$secure.
|
|
59
|
+
$earlyRun(() => {
|
|
60
|
+
logger_instance_1.LoggerInstance.$setLeyyo(this.lyy);
|
|
61
|
+
}).
|
|
62
|
+
$lazyRun(() => {
|
|
63
|
+
const fields = ['create', 'apply', 'check', 'print'];
|
|
64
|
+
const rec = { proper: false };
|
|
65
|
+
fields.forEach(field => {
|
|
66
|
+
rec[field] = this[field];
|
|
67
|
+
});
|
|
68
|
+
// define itself temporarily for log operations
|
|
69
|
+
this.lyy.hook.defineProvider(leyyo_1.LeyyoHookCommon.logAttached, LogCommon, rec);
|
|
70
|
+
// when new log provider is defined, replace all common methods
|
|
71
|
+
this.lyy.hook.whenProviderDefined(leyyo_1.LeyyoHookCommon.logAttached, LogCommon, (ins) => {
|
|
72
|
+
fields.forEach(field => {
|
|
73
|
+
if (typeof ins[field] === 'function') {
|
|
74
|
+
this[field] = ins[field];
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
}).
|
|
79
|
+
$lazyRun(() => {
|
|
80
|
+
this.lyy.fqn.register(null, LogCommon, 'class', internal_1.FQN);
|
|
81
|
+
this.lyy.fqn.register(null, logger_instance_1.LoggerInstance, 'class', internal_1.FQN);
|
|
82
|
+
const enumMap = {
|
|
83
|
+
Severity: severity_1.SeverityItems,
|
|
84
|
+
};
|
|
85
|
+
for (const [name, value] of Object.entries(enumMap)) {
|
|
86
|
+
this.lyy.fqn.register(name, value, 'enum', internal_1.FQN);
|
|
87
|
+
this.lyy.hook.queueForCallback(leyyo_1.LeyyoHookCommon.enumPendingRegister, value);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
// @formatter:off
|
|
91
|
+
}
|
|
92
|
+
create(clazz) {
|
|
93
|
+
const ins = new logger_instance_1.LoggerInstance(clazz);
|
|
94
|
+
this.lyy.hook.queueForCallback(leyyo_1.LeyyoHookCommon.logPendingRegister, ins, clazz);
|
|
95
|
+
return ins;
|
|
96
|
+
}
|
|
97
|
+
apply(line) {
|
|
98
|
+
if ((global === null || global === void 0 ? void 0 : global.leyyo_is_testing) || this.lyy.test.is || !line) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const lineEnhanced = line;
|
|
102
|
+
lineEnhanced.time = new Date();
|
|
103
|
+
lineEnhanced.where = this.lyy.dev.fetch(lineEnhanced.params, 'where');
|
|
104
|
+
this.check(lineEnhanced);
|
|
105
|
+
this.print(lineEnhanced);
|
|
106
|
+
}
|
|
107
|
+
check(line) {
|
|
108
|
+
// nothing
|
|
109
|
+
}
|
|
110
|
+
where(where) {
|
|
111
|
+
if (typeof where !== 'string') {
|
|
112
|
+
where = index_1.$dev.secureJson(where, true);
|
|
113
|
+
}
|
|
114
|
+
if (!where) {
|
|
115
|
+
where = ''.padStart(20);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
if (where.includes('.')) {
|
|
119
|
+
const parts = where.split('.');
|
|
120
|
+
where = parts.pop();
|
|
121
|
+
if (parts.length > 0) {
|
|
122
|
+
where = parts.map(w => w.slice(0, 1)).join('.') + '.' + where;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (where.length <= 20) {
|
|
127
|
+
return where.padStart(20);
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
return where.substring(where.length - 20);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
print(line) {
|
|
134
|
+
var _a;
|
|
135
|
+
let where = this.where(line.where);
|
|
136
|
+
const date = line.time.toISOString();
|
|
137
|
+
let json = '';
|
|
138
|
+
if (line.params && Object.keys(line.params).length > 0) {
|
|
139
|
+
json = GRAY1 + ' => ' + this.lyy.dev.secureJson(line.params, true) + END;
|
|
140
|
+
}
|
|
141
|
+
const colors = (_a = this.COLORS[line.severity]) !== null && _a !== void 0 ? _a : this.COLORS.trace;
|
|
142
|
+
const [severity, short, bg, clr1, clr2S, cls2E] = colors;
|
|
143
|
+
const arr = [
|
|
144
|
+
BLUE1, date.substring(11, 23), END,
|
|
145
|
+
' | ',
|
|
146
|
+
bg, short, END,
|
|
147
|
+
' | ',
|
|
148
|
+
clr1, where, END,
|
|
149
|
+
' | ',
|
|
150
|
+
clr2S, line.message, cls2E,
|
|
151
|
+
json,
|
|
152
|
+
];
|
|
153
|
+
console[severity](arr.join(''));
|
|
154
|
+
}
|
|
155
|
+
get $back() {
|
|
156
|
+
return this;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
exports.LogCommon = LogCommon;
|
|
160
|
+
//# sourceMappingURL=log.common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.common.js","sourceRoot":"","sources":["../../src/log/log.common.ts"],"names":[],"mappings":";;;AAAA,oCAAyD;AAEzD,uDAAiD;AAEjD,0CAAgC;AAChC,yCAAwD;AACxD,oCAA8B;AAE9B,MAAM,KAAK,GAAG,UAAU,CAAC;AACzB,MAAM,IAAI,GAAG,UAAU,CAAC;AACxB,MAAM,IAAI,GAAG,WAAW,CAAC;AACzB,MAAM,MAAM,GAAG,UAAU,CAAC;AAC1B,MAAM,MAAM,GAAG,WAAW,CAAC;AAC3B,MAAM,OAAO,GAAG,UAAU,CAAC;AAC3B,MAAM,OAAO,GAAG,WAAW,CAAC;AAC5B,MAAM,KAAK,GAAG,UAAU,CAAC;AACzB,MAAM,KAAK,GAAG,WAAW,CAAC;AAC1B,MAAM,QAAQ,GAAG,UAAU,CAAC;AAC5B,MAAM,QAAQ,GAAG,WAAW,CAAC;AAC7B,MAAM,KAAK,GAAG,UAAU,CAAC;AACzB,MAAM,KAAK,GAAG,WAAW,CAAC;AAC1B,MAAM,KAAK,GAAG,UAAU,CAAC;AACzB,MAAM,GAAG,GAAG,SAAS,CAAC;AAEtB,MAAM,MAAM,GAAG,UAAU,CAAC;AAC1B,MAAM,QAAQ,GAAG,UAAU,CAAC;AAC5B,MAAM,SAAS,GAAG,UAAU,CAAC;AAC7B,MAAM,OAAO,GAAG,UAAU,CAAC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QACrC,IAAI,IAAI,GAAG,EAAE,CAAC;QACd,IAAI,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACrD,IAAI,GAAG,KAAK,GAAG,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,GAAG,CAAC;QAC7E,CAAC;QACD,MAAM,MAAM,GAAG,MAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,mCAAI,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;QAC/D,MAAM,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,CAAC;QAEzD,MAAM,GAAG,GAAG;YACR,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG;YAClC,KAAK;YACL,EAAE,EAAE,KAAK,EAAE,GAAG;YACd,KAAK;YACL,IAAI,EAAE,KAAK,EAAE,GAAG;YAChB,KAAK;YACL,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK;YAC1B,IAAI;SACP,CAAC;QACF,OAAO,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IACpC,CAAC;IAED,IAAI,KAAK;QACL,OAAO,IAAI,CAAC;IAChB,CAAC;CAIJ;AAxID,8BAwIC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Logger, LoggerSecure } from "./index.types";
|
|
2
|
+
import type { LeyyoLike } from "../leyyo";
|
|
3
|
+
import type { DevOpt } from "../developer";
|
|
4
|
+
import type { Severity } from "./severity";
|
|
5
|
+
import type { DeployCommonSecure } from "../deploy";
|
|
6
|
+
export declare class LoggerInstance implements Logger, LoggerSecure {
|
|
7
|
+
private static lyy;
|
|
8
|
+
private _clazz;
|
|
9
|
+
private _name;
|
|
10
|
+
private _name2;
|
|
11
|
+
constructor(value: Object | Function | string);
|
|
12
|
+
private _prepare;
|
|
13
|
+
debug(message: any, params?: any | DevOpt): void;
|
|
14
|
+
trace(message: any, params?: any | DevOpt): void;
|
|
15
|
+
info(message: any, params?: any | DevOpt): void;
|
|
16
|
+
warn(message: any, params?: any | DevOpt): void;
|
|
17
|
+
error(message: any, params?: any | DevOpt): void;
|
|
18
|
+
fatal(message: any, params?: any | DevOpt): void;
|
|
19
|
+
get deploy(): DeployCommonSecure;
|
|
20
|
+
get $back(): Logger;
|
|
21
|
+
get $secure(): LoggerSecure;
|
|
22
|
+
get $clazz(): Function;
|
|
23
|
+
get $name(): string;
|
|
24
|
+
static $setLeyyo(lyy: LeyyoLike): void;
|
|
25
|
+
$refresh(severity: Severity): void;
|
|
26
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LoggerInstance = void 0;
|
|
4
|
+
const internal_1 = require("../internal");
|
|
5
|
+
// noinspection JSUnusedLocalSymbols
|
|
6
|
+
class LoggerInstance {
|
|
7
|
+
constructor(value) {
|
|
8
|
+
var _a;
|
|
9
|
+
switch (typeof value) {
|
|
10
|
+
case "function":
|
|
11
|
+
this._clazz = value;
|
|
12
|
+
break;
|
|
13
|
+
case "object":
|
|
14
|
+
this._clazz = value.constructor;
|
|
15
|
+
break;
|
|
16
|
+
case "string":
|
|
17
|
+
this._name = value;
|
|
18
|
+
break;
|
|
19
|
+
default:
|
|
20
|
+
LoggerInstance.lyy.dev.developerError({
|
|
21
|
+
issue: 'invalid.logger.name',
|
|
22
|
+
where: `${internal_1.FQN}.LoggerInstance`,
|
|
23
|
+
type: typeof value
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
if (typeof this._clazz === 'function') {
|
|
27
|
+
if (LoggerInstance.lyy.fqn.exists(this._clazz)) {
|
|
28
|
+
this._name = LoggerInstance.lyy.fqn.name(this._clazz);
|
|
29
|
+
delete this._name2;
|
|
30
|
+
delete this._clazz;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
this._name2 = (_a = this._clazz) === null || _a === void 0 ? void 0 : _a.name;
|
|
34
|
+
// when this object is signed by FQN, then refresh logger name
|
|
35
|
+
LoggerInstance.lyy.fqn.addHook(value, (name) => {
|
|
36
|
+
this._name = name;
|
|
37
|
+
delete this._name2;
|
|
38
|
+
delete this._clazz;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
_prepare(severity, info, params) {
|
|
44
|
+
var _a;
|
|
45
|
+
const extra = {};
|
|
46
|
+
let e;
|
|
47
|
+
if (info instanceof Error) {
|
|
48
|
+
e = info;
|
|
49
|
+
}
|
|
50
|
+
else if (typeof info === 'string') {
|
|
51
|
+
extra['message'] = info;
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
extra['info'] = info;
|
|
55
|
+
}
|
|
56
|
+
const { message, opt } = LoggerInstance.lyy.dev.buildParameters(params, extra, e);
|
|
57
|
+
const where = (_a = this._name) !== null && _a !== void 0 ? _a : this._name2;
|
|
58
|
+
if (where && opt.where !== where) {
|
|
59
|
+
if (opt.where) {
|
|
60
|
+
opt[`where-${Date.now()}`] = LoggerInstance.lyy.dev.fetch(opt, 'where');
|
|
61
|
+
}
|
|
62
|
+
else if (where) {
|
|
63
|
+
opt['where'] = where;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return { severity, message, params: opt };
|
|
67
|
+
}
|
|
68
|
+
debug(message, params) {
|
|
69
|
+
LoggerInstance.lyy.log.apply(this._prepare('debug', message, params));
|
|
70
|
+
}
|
|
71
|
+
trace(message, params) {
|
|
72
|
+
LoggerInstance.lyy.log.apply(this._prepare('trace', message, params));
|
|
73
|
+
}
|
|
74
|
+
info(message, params) {
|
|
75
|
+
LoggerInstance.lyy.log.apply(this._prepare('info', message, params));
|
|
76
|
+
}
|
|
77
|
+
warn(message, params) {
|
|
78
|
+
LoggerInstance.lyy.log.apply(this._prepare('warn', message, params));
|
|
79
|
+
}
|
|
80
|
+
error(message, params) {
|
|
81
|
+
LoggerInstance.lyy.log.apply(this._prepare('error', message, params));
|
|
82
|
+
}
|
|
83
|
+
fatal(message, params) {
|
|
84
|
+
LoggerInstance.lyy.log.apply(this._prepare('fatal', message, params));
|
|
85
|
+
}
|
|
86
|
+
get deploy() {
|
|
87
|
+
return LoggerInstance.lyy.deploy.logger(this);
|
|
88
|
+
}
|
|
89
|
+
// region secure
|
|
90
|
+
get $back() {
|
|
91
|
+
return this;
|
|
92
|
+
}
|
|
93
|
+
get $secure() {
|
|
94
|
+
return this;
|
|
95
|
+
}
|
|
96
|
+
get $clazz() {
|
|
97
|
+
return this._clazz;
|
|
98
|
+
}
|
|
99
|
+
get $name() {
|
|
100
|
+
return this._name;
|
|
101
|
+
}
|
|
102
|
+
static $setLeyyo(lyy) {
|
|
103
|
+
this.lyy = lyy;
|
|
104
|
+
}
|
|
105
|
+
$refresh(severity) {
|
|
106
|
+
const rec = {
|
|
107
|
+
debug: false,
|
|
108
|
+
trace: false,
|
|
109
|
+
info: false,
|
|
110
|
+
warn: false,
|
|
111
|
+
error: true,
|
|
112
|
+
fatal: true,
|
|
113
|
+
};
|
|
114
|
+
switch (severity) {
|
|
115
|
+
case 'debug':
|
|
116
|
+
rec.debug = true;
|
|
117
|
+
rec.trace = true;
|
|
118
|
+
rec.info = true;
|
|
119
|
+
rec.warn = true;
|
|
120
|
+
break;
|
|
121
|
+
case 'trace':
|
|
122
|
+
rec.trace = true;
|
|
123
|
+
rec.info = true;
|
|
124
|
+
rec.warn = true;
|
|
125
|
+
break;
|
|
126
|
+
case 'info':
|
|
127
|
+
rec.info = true;
|
|
128
|
+
rec.warn = true;
|
|
129
|
+
break;
|
|
130
|
+
case 'warn':
|
|
131
|
+
rec.warn = true;
|
|
132
|
+
break;
|
|
133
|
+
default:
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
for (const [k, active] of Object.entries(rec)) {
|
|
137
|
+
if (active) {
|
|
138
|
+
this[k] = (message, params) => {
|
|
139
|
+
LoggerInstance.lyy.log.apply(this._prepare(k, message, params));
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
this[k] = (_message, _params) => { };
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
exports.LoggerInstance = LoggerInstance;
|
|
149
|
+
//# sourceMappingURL=logger.instance.js.map
|