@leyyo/common 1.2.6 → 1.3.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/README.md +395 -3
- package/dist/class/index.d.ts +2 -0
- package/dist/{opt → class}/index.js +2 -1
- package/dist/class/index.js.map +1 -0
- package/dist/class/list.d.ts +13 -0
- package/dist/class/list.js +37 -0
- package/dist/class/list.js.map +1 -0
- package/dist/{log → class}/logger.instance.d.ts +10 -12
- package/dist/class/logger.instance.js +150 -0
- package/dist/class/logger.instance.js.map +1 -0
- package/dist/common/array.fn.d.ts +46 -0
- package/dist/common/array.fn.js +123 -0
- package/dist/common/array.fn.js.map +1 -0
- package/dist/common/deploy.fn.d.ts +18 -0
- package/dist/common/deploy.fn.js +73 -0
- package/dist/common/deploy.fn.js.map +1 -0
- package/dist/common/enum.fn.d.ts +63 -0
- package/dist/common/enum.fn.js +191 -0
- package/dist/common/enum.fn.js.map +1 -0
- package/dist/common/error.fn.d.ts +91 -0
- package/dist/common/error.fn.js +400 -0
- package/dist/common/error.fn.js.map +1 -0
- package/dist/common/event.fn.d.ts +45 -0
- package/dist/common/event.fn.js +160 -0
- package/dist/common/event.fn.js.map +1 -0
- package/dist/common/exporter.fn.d.ts +7 -0
- package/dist/common/exporter.fn.js +49 -0
- package/dist/common/exporter.fn.js.map +1 -0
- package/dist/common/fqn.fn.d.ts +27 -0
- package/dist/common/fqn.fn.js +104 -0
- package/dist/common/fqn.fn.js.map +1 -0
- package/dist/common/index.d.ts +14 -0
- package/dist/{hub → common}/index.js +14 -1
- package/dist/common/index.js.map +1 -0
- package/dist/common/lifecycle.fn.d.ts +24 -0
- package/dist/common/lifecycle.fn.js +135 -0
- package/dist/common/lifecycle.fn.js.map +1 -0
- package/dist/common/list.fn.d.ts +47 -0
- package/dist/common/list.fn.js +122 -0
- package/dist/common/list.fn.js.map +1 -0
- package/dist/common/loader.fn.d.ts +15 -0
- package/dist/common/loader.fn.js +38 -0
- package/dist/common/loader.fn.js.map +1 -0
- package/dist/common/log.fn.d.ts +21 -0
- package/dist/common/log.fn.js +321 -0
- package/dist/common/log.fn.js.map +1 -0
- package/dist/common/map.fn.d.ts +46 -0
- package/dist/common/map.fn.js +123 -0
- package/dist/common/map.fn.js.map +1 -0
- package/dist/common/opt.fn.d.ts +48 -0
- package/dist/common/opt.fn.js +137 -0
- package/dist/common/opt.fn.js.map +1 -0
- package/dist/common/set.fn.d.ts +46 -0
- package/dist/common/set.fn.js +123 -0
- package/dist/common/set.fn.js.map +1 -0
- package/dist/common/test.fn.d.ts +26 -0
- package/dist/common/test.fn.js +81 -0
- package/dist/common/test.fn.js.map +1 -0
- package/dist/const/index.d.ts +23 -0
- package/dist/const/index.js +28 -0
- package/dist/const/index.js.map +1 -0
- package/dist/enum/index.d.ts +1 -0
- package/dist/{deploy → enum}/index.js +1 -1
- package/dist/enum/index.js.map +1 -0
- package/dist/{log → enum}/log-level.js +2 -2
- package/dist/enum/log-level.js.map +1 -0
- package/dist/error/caused.error.d.ts +15 -0
- package/dist/error/caused.error.js +24 -0
- package/dist/error/caused.error.js.map +1 -0
- package/dist/error/developer.error.d.ts +24 -0
- package/dist/error/developer.error.js +69 -0
- package/dist/error/developer.error.js.map +1 -0
- package/dist/error/{items/http.error.d.ts → http.error.d.ts} +1 -1
- package/dist/error/http.error.js +31 -0
- package/dist/error/http.error.js.map +1 -0
- package/dist/error/index.d.ts +6 -3
- package/dist/error/index.js +6 -3
- package/dist/error/index.js.map +1 -1
- package/dist/error/{items/invalid-value.error.js → invalid-value.error.js} +6 -2
- package/dist/error/invalid-value.error.js.map +1 -0
- package/dist/error/leyyo.error.d.ts +87 -0
- package/dist/error/leyyo.error.js +259 -0
- package/dist/error/leyyo.error.js.map +1 -0
- package/dist/error/{items/multiple.error.d.ts → multiple.error.d.ts} +1 -1
- package/dist/error/{items/multiple.error.js → multiple.error.js} +5 -4
- package/dist/error/multiple.error.js.map +1 -0
- package/dist/{util → function}/delay.js +1 -0
- package/dist/function/delay.js.map +1 -0
- package/dist/function/empty.fn.d.ts +8 -0
- package/dist/{util → function}/empty.fn.js +3 -2
- package/dist/function/empty.fn.js.map +1 -0
- package/dist/function/error-obj.d.ts +8 -0
- package/dist/function/error-obj.js +25 -0
- package/dist/function/error-obj.js.map +1 -0
- package/dist/function/error-text.d.ts +7 -0
- package/dist/function/error-text.js +18 -0
- package/dist/function/error-text.js.map +1 -0
- package/dist/function/extended-type.d.ts +8 -0
- package/dist/function/extended-type.js +56 -0
- package/dist/function/extended-type.js.map +1 -0
- package/dist/{util → function}/index.d.ts +4 -4
- package/dist/{util → function}/index.js +4 -4
- package/dist/function/index.js.map +1 -0
- package/dist/{util → function}/is.d.ts +12 -13
- package/dist/function/is.js +89 -0
- package/dist/function/is.js.map +1 -0
- package/dist/{util → function}/jitter-interval.js +1 -0
- package/dist/function/jitter-interval.js.map +1 -0
- package/dist/{util → function}/one-or-more.d.ts +1 -1
- package/dist/{util → function}/one-or-more.js +1 -0
- package/dist/function/one-or-more.js.map +1 -0
- package/dist/{util → function}/secure-clone.d.ts +1 -1
- package/dist/function/secure-clone.js.map +1 -0
- package/dist/function/secure-json.js.map +1 -0
- package/dist/index.d.ts +7 -19
- package/dist/index.js +7 -21
- package/dist/index.js.map +1 -1
- package/dist/index.types.d.ts +510 -0
- package/dist/{shared/index.types.js → index.types.js} +1 -1
- package/dist/index.types.js.map +1 -0
- package/dist/loader.d.ts +2 -0
- package/dist/loader.js +98 -0
- package/dist/loader.js.map +1 -0
- package/package.json +5 -3
- package/dist/$$leyyo-loader.d.ts +0 -1
- package/dist/$$leyyo-loader.js +0 -40
- package/dist/$$leyyo-loader.js.map +0 -1
- package/dist/deploy/deploy.common.d.ts +0 -34
- package/dist/deploy/deploy.common.js +0 -125
- package/dist/deploy/deploy.common.js.map +0 -1
- package/dist/deploy/index.d.ts +0 -1
- package/dist/deploy/index.js.map +0 -1
- package/dist/deploy/index.types.d.ts +0 -29
- package/dist/deploy/index.types.js +0 -3
- package/dist/deploy/index.types.js.map +0 -1
- package/dist/error/error.common.d.ts +0 -34
- package/dist/error/error.common.js +0 -220
- package/dist/error/error.common.js.map +0 -1
- package/dist/error/index.const.d.ts +0 -4
- package/dist/error/index.const.js +0 -8
- package/dist/error/index.const.js.map +0 -1
- package/dist/error/index.types.d.ts +0 -109
- package/dist/error/index.types.js +0 -3
- package/dist/error/index.types.js.map +0 -1
- package/dist/error/items/caused.error.d.ts +0 -6
- package/dist/error/items/caused.error.js +0 -11
- package/dist/error/items/caused.error.js.map +0 -1
- package/dist/error/items/developer.error.d.ts +0 -4
- package/dist/error/items/developer.error.js +0 -11
- package/dist/error/items/developer.error.js.map +0 -1
- package/dist/error/items/http.error.js +0 -37
- package/dist/error/items/http.error.js.map +0 -1
- package/dist/error/items/index.d.ts +0 -6
- package/dist/error/items/index.js +0 -23
- package/dist/error/items/index.js.map +0 -1
- package/dist/error/items/invalid-value.error.js.map +0 -1
- package/dist/error/items/leyyo.error.d.ts +0 -60
- package/dist/error/items/leyyo.error.js +0 -144
- package/dist/error/items/leyyo.error.js.map +0 -1
- package/dist/error/items/multiple.error.js.map +0 -1
- package/dist/event/event.common.d.ts +0 -80
- package/dist/event/event.common.js +0 -308
- package/dist/event/event.common.js.map +0 -1
- package/dist/event/event.error.d.ts +0 -3
- package/dist/event/event.error.js +0 -9
- package/dist/event/event.error.js.map +0 -1
- package/dist/event/index.d.ts +0 -2
- package/dist/event/index.js +0 -19
- package/dist/event/index.js.map +0 -1
- package/dist/event/index.types.d.ts +0 -265
- package/dist/event/index.types.js +0 -3
- package/dist/event/index.types.js.map +0 -1
- package/dist/hub/hub.channel.d.ts +0 -27
- package/dist/hub/hub.channel.js +0 -83
- package/dist/hub/hub.channel.js.map +0 -1
- package/dist/hub/hub.common.d.ts +0 -27
- package/dist/hub/hub.common.js +0 -92
- package/dist/hub/hub.common.js.map +0 -1
- package/dist/hub/index.d.ts +0 -1
- package/dist/hub/index.js.map +0 -1
- package/dist/hub/index.types.d.ts +0 -105
- package/dist/hub/index.types.js +0 -3
- package/dist/hub/index.types.js.map +0 -1
- package/dist/leyyo/index.d.ts +0 -1
- package/dist/leyyo/index.js +0 -18
- package/dist/leyyo/index.js.map +0 -1
- package/dist/leyyo/index.types.d.ts +0 -21
- package/dist/leyyo/index.types.js +0 -3
- package/dist/leyyo/index.types.js.map +0 -1
- package/dist/leyyo/leyyo.d.ts +0 -25
- package/dist/leyyo/leyyo.js +0 -62
- package/dist/leyyo/leyyo.js.map +0 -1
- package/dist/log/index.d.ts +0 -4
- package/dist/log/index.js +0 -21
- package/dist/log/index.js.map +0 -1
- package/dist/log/index.types.d.ts +0 -47
- package/dist/log/index.types.js +0 -3
- package/dist/log/index.types.js.map +0 -1
- package/dist/log/log-level.js.map +0 -1
- package/dist/log/log.common.d.ts +0 -15
- package/dist/log/log.common.js +0 -135
- package/dist/log/log.common.js.map +0 -1
- package/dist/log/logger.error.d.ts +0 -3
- package/dist/log/logger.error.js +0 -9
- package/dist/log/logger.error.js.map +0 -1
- package/dist/log/logger.instance.js +0 -139
- package/dist/log/logger.instance.js.map +0 -1
- package/dist/name/index.d.ts +0 -2
- package/dist/name/index.js +0 -19
- package/dist/name/index.js.map +0 -1
- package/dist/name/index.types.d.ts +0 -21
- package/dist/name/index.types.js +0 -3
- package/dist/name/index.types.js.map +0 -1
- package/dist/name/name.common.d.ts +0 -16
- package/dist/name/name.common.js +0 -109
- package/dist/name/name.common.js.map +0 -1
- package/dist/name/name.error.d.ts +0 -3
- package/dist/name/name.error.js +0 -9
- package/dist/name/name.error.js.map +0 -1
- package/dist/opt/index.d.ts +0 -1
- package/dist/opt/index.js.map +0 -1
- package/dist/opt/index.types.d.ts +0 -33
- package/dist/opt/index.types.js +0 -3
- package/dist/opt/index.types.js.map +0 -1
- package/dist/opt/opt.common.d.ts +0 -15
- package/dist/opt/opt.common.js +0 -93
- package/dist/opt/opt.common.js.map +0 -1
- package/dist/repo/index.d.ts +0 -1
- package/dist/repo/index.js +0 -18
- package/dist/repo/index.js.map +0 -1
- package/dist/repo/index.types.d.ts +0 -104
- package/dist/repo/index.types.js +0 -3
- package/dist/repo/index.types.js.map +0 -1
- package/dist/repo/repo.common.d.ts +0 -41
- package/dist/repo/repo.common.js +0 -146
- package/dist/repo/repo.common.js.map +0 -1
- package/dist/server.d.ts +0 -1
- package/dist/server.js +0 -5
- package/dist/server.js.map +0 -1
- package/dist/shared/index.d.ts +0 -5
- package/dist/shared/index.enum.d.ts +0 -7
- package/dist/shared/index.enum.js +0 -3
- package/dist/shared/index.enum.js.map +0 -1
- package/dist/shared/index.fqn.d.ts +0 -3
- package/dist/shared/index.fqn.js +0 -3
- package/dist/shared/index.fqn.js.map +0 -1
- package/dist/shared/index.js +0 -22
- package/dist/shared/index.js.map +0 -1
- package/dist/shared/index.json.d.ts +0 -33
- package/dist/shared/index.json.js +0 -3
- package/dist/shared/index.json.js.map +0 -1
- package/dist/shared/index.loader.d.ts +0 -5
- package/dist/shared/index.loader.js +0 -3
- package/dist/shared/index.loader.js.map +0 -1
- package/dist/shared/index.types.d.ts +0 -168
- package/dist/shared/index.types.js.map +0 -1
- package/dist/util/$define-error.d.ts +0 -9
- package/dist/util/$define-error.js +0 -25
- package/dist/util/$define-error.js.map +0 -1
- package/dist/util/$enum-name.d.ts +0 -16
- package/dist/util/$enum-name.js +0 -18
- package/dist/util/$enum-name.js.map +0 -1
- package/dist/util/$loader.d.ts +0 -18
- package/dist/util/$loader.js +0 -40
- package/dist/util/$loader.js.map +0 -1
- package/dist/util/delay.js.map +0 -1
- package/dist/util/empty.fn.d.ts +0 -8
- package/dist/util/empty.fn.js.map +0 -1
- package/dist/util/index.js.map +0 -1
- package/dist/util/is.js +0 -68
- package/dist/util/is.js.map +0 -1
- package/dist/util/jitter-interval.js.map +0 -1
- package/dist/util/one-or-more.js.map +0 -1
- package/dist/util/secure-clone.js.map +0 -1
- package/dist/util/secure-json.js.map +0 -1
- /package/dist/{log → enum}/log-level.d.ts +0 -0
- /package/dist/error/{items/invalid-value.error.d.ts → invalid-value.error.d.ts} +0 -0
- /package/dist/{util → function}/delay.d.ts +0 -0
- /package/dist/{util → function}/jitter-interval.d.ts +0 -0
- /package/dist/{util → function}/secure-clone.js +0 -0
- /package/dist/{util → function}/secure-json.d.ts +0 -0
- /package/dist/{util → function}/secure-json.js +0 -0
package/dist/hub/hub.channel.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HubChannel = void 0;
|
|
4
|
-
const internal_1 = require("../internal");
|
|
5
|
-
const error_1 = require("../error");
|
|
6
|
-
const WHERE = `${internal_1.FQN}.HubChannel`;
|
|
7
|
-
// noinspection JSUnusedGlobalSymbols
|
|
8
|
-
class HubChannel {
|
|
9
|
-
// endregion protected-property
|
|
10
|
-
/**
|
|
11
|
-
* Default constructor
|
|
12
|
-
*
|
|
13
|
-
* Responsibilities
|
|
14
|
-
* - Create repositories => ie: callbacks
|
|
15
|
-
* - Trigger clear pending operation
|
|
16
|
-
* */
|
|
17
|
-
constructor(type, repo) {
|
|
18
|
-
this.type = type;
|
|
19
|
-
this._items = repo.newMap(WHERE, 'items');
|
|
20
|
-
}
|
|
21
|
-
// region protected-method
|
|
22
|
-
_validName(value, method, throwable) {
|
|
23
|
-
const type = (typeof value);
|
|
24
|
-
if (!['string', 'symbol'].includes(type)) {
|
|
25
|
-
if (!throwable) {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
throw new error_1.InvalidValueError(`Invalid type of channel with ${type}`, { where: WHERE, method, field: 'name', type });
|
|
29
|
-
}
|
|
30
|
-
if (type === 'string') {
|
|
31
|
-
const str = value.trim();
|
|
32
|
-
if (str === '' || str !== value) {
|
|
33
|
-
if (!throwable) {
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
throw new error_1.InvalidValueError(`Channel should be trimmed and filled`, { where: WHERE, method, field: 'name' });
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
// endregion protected-method
|
|
42
|
-
// region getter
|
|
43
|
-
/** @inheritDoc */
|
|
44
|
-
get names() {
|
|
45
|
-
return Array.from(this._items.keys());
|
|
46
|
-
}
|
|
47
|
-
// endregion getter
|
|
48
|
-
// region get
|
|
49
|
-
/** @inheritDoc */
|
|
50
|
-
has(name) {
|
|
51
|
-
return this._validName(name) ? this._items.has(name) : false;
|
|
52
|
-
}
|
|
53
|
-
/** @inheritDoc */
|
|
54
|
-
get(name) {
|
|
55
|
-
return this._validName(name) ? this._items.get(name) : undefined;
|
|
56
|
-
}
|
|
57
|
-
// endregion get
|
|
58
|
-
// region as
|
|
59
|
-
/** @inheritDoc */
|
|
60
|
-
as() {
|
|
61
|
-
return this;
|
|
62
|
-
}
|
|
63
|
-
// endregion as
|
|
64
|
-
// region registration
|
|
65
|
-
/** @inheritDoc */
|
|
66
|
-
set(name, value) {
|
|
67
|
-
this._validName(name, 'set', true);
|
|
68
|
-
const old = this._items.has(name);
|
|
69
|
-
this._items.set(name, value);
|
|
70
|
-
return old;
|
|
71
|
-
}
|
|
72
|
-
/** @inheritDoc */
|
|
73
|
-
delete(name) {
|
|
74
|
-
this._validName(name, 'delete', true);
|
|
75
|
-
if (this._items.has(name)) {
|
|
76
|
-
this._items.delete(name);
|
|
77
|
-
return true;
|
|
78
|
-
}
|
|
79
|
-
return true;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
exports.HubChannel = HubChannel;
|
|
83
|
-
//# sourceMappingURL=hub.channel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hub.channel.js","sourceRoot":"","sources":["../../src/hub/hub.channel.ts"],"names":[],"mappings":";;;AACA,0CAAgC;AAGhC,oCAA2C;AAE3C,MAAM,KAAK,GAAG,GAAG,cAAG,aAAa,CAAC;AAClC,qCAAqC;AACrC,MAAa,UAAU;IAGnB,+BAA+B;IAE/B;;;;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2
|
-
import { HubChannelLike, HubCommonLike, HubCommonSecure, HubType } from "./index.types";
|
|
3
|
-
export declare class HubCommon<T extends HubType = string> implements HubCommonLike<T>, HubCommonSecure<T> {
|
|
4
|
-
private lyy;
|
|
5
|
-
protected _channels: Map<T, HubChannelLike>;
|
|
6
|
-
/**
|
|
7
|
-
* Default constructor
|
|
8
|
-
* */
|
|
9
|
-
constructor(lyy: LeyyoLike);
|
|
10
|
-
protected _validChannel(value: unknown, method?: keyof HubCommonLike, throwable?: boolean): boolean;
|
|
11
|
-
/** @inheritDoc */
|
|
12
|
-
$init(): void;
|
|
13
|
-
/** @inheritDoc */
|
|
14
|
-
get $secure(): HubCommonSecure<T>;
|
|
15
|
-
/** @inheritDoc */
|
|
16
|
-
get $back(): HubCommonLike<T>;
|
|
17
|
-
/** @inheritDoc */
|
|
18
|
-
get channels(): Array<T>;
|
|
19
|
-
/** @inheritDoc */
|
|
20
|
-
has(channel: T): boolean;
|
|
21
|
-
/** @inheritDoc */
|
|
22
|
-
channel<C extends string = string>(channel: T): HubChannelLike<T, C>;
|
|
23
|
-
/** @inheritDoc */
|
|
24
|
-
as<F extends HubType = string>(): HubCommonLike<T | F>;
|
|
25
|
-
/** @inheritDoc */
|
|
26
|
-
delete(channel: T): boolean;
|
|
27
|
-
}
|
package/dist/hub/hub.common.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HubCommon = void 0;
|
|
4
|
-
const internal_1 = require("../internal");
|
|
5
|
-
const hub_channel_1 = require("./hub.channel");
|
|
6
|
-
const error_1 = require("../error");
|
|
7
|
-
const WHERE = `${internal_1.FQN}.HubCommon`;
|
|
8
|
-
// noinspection JSUnusedGlobalSymbols
|
|
9
|
-
class HubCommon {
|
|
10
|
-
// endregion protected-property
|
|
11
|
-
/**
|
|
12
|
-
* Default constructor
|
|
13
|
-
* */
|
|
14
|
-
constructor(lyy) {
|
|
15
|
-
this.lyy = lyy;
|
|
16
|
-
}
|
|
17
|
-
// region protected-method
|
|
18
|
-
_validChannel(value, method, throwable) {
|
|
19
|
-
const type = (typeof value);
|
|
20
|
-
if (!['string', 'symbol'].includes(type)) {
|
|
21
|
-
if (!throwable) {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
throw new error_1.InvalidValueError(`Invalid type of channel with ${type}`, { where: WHERE, method, field: 'channel', type });
|
|
25
|
-
}
|
|
26
|
-
if (type === 'string') {
|
|
27
|
-
const str = value.trim();
|
|
28
|
-
if (str === '' || str !== value) {
|
|
29
|
-
if (!throwable) {
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
throw new error_1.InvalidValueError(`Channel should be trimmed and filled`, { where: WHERE, method, field: 'channel' });
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
// endregion protected-method
|
|
38
|
-
// region secure
|
|
39
|
-
/** @inheritDoc */
|
|
40
|
-
$init() {
|
|
41
|
-
this._channels = this.lyy.repo.newMap(WHERE, 'channels');
|
|
42
|
-
this.lyy.$secure.$lazyRun(() => {
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
/** @inheritDoc */
|
|
46
|
-
get $secure() {
|
|
47
|
-
return this;
|
|
48
|
-
}
|
|
49
|
-
/** @inheritDoc */
|
|
50
|
-
get $back() {
|
|
51
|
-
return this;
|
|
52
|
-
}
|
|
53
|
-
// endregion secure
|
|
54
|
-
// region getter
|
|
55
|
-
/** @inheritDoc */
|
|
56
|
-
get channels() {
|
|
57
|
-
return Array.from(this._channels.keys());
|
|
58
|
-
}
|
|
59
|
-
// endregion getter
|
|
60
|
-
// region get
|
|
61
|
-
/** @inheritDoc */
|
|
62
|
-
has(channel) {
|
|
63
|
-
return this._validChannel(channel) ? this._channels.has(channel) : false;
|
|
64
|
-
}
|
|
65
|
-
/** @inheritDoc */
|
|
66
|
-
channel(channel) {
|
|
67
|
-
this._validChannel(channel, 'channel', true);
|
|
68
|
-
if (!this._channels.has(channel)) {
|
|
69
|
-
this._channels.set(channel, new hub_channel_1.HubChannel(channel, this.lyy.repo));
|
|
70
|
-
}
|
|
71
|
-
return this._channels.get(channel);
|
|
72
|
-
}
|
|
73
|
-
// endregion get
|
|
74
|
-
// region as
|
|
75
|
-
/** @inheritDoc */
|
|
76
|
-
as() {
|
|
77
|
-
return this;
|
|
78
|
-
}
|
|
79
|
-
// endregion as
|
|
80
|
-
// region registration
|
|
81
|
-
/** @inheritDoc */
|
|
82
|
-
delete(channel) {
|
|
83
|
-
this._validChannel(channel, 'delete', true);
|
|
84
|
-
if (this._channels.has(channel)) {
|
|
85
|
-
this._channels.delete(channel);
|
|
86
|
-
return true;
|
|
87
|
-
}
|
|
88
|
-
return true;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
exports.HubCommon = HubCommon;
|
|
92
|
-
//# sourceMappingURL=hub.common.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hub.common.js","sourceRoot":"","sources":["../../src/hub/hub.common.ts"],"names":[],"mappings":";;;AAEA,0CAAgC;AAEhC,+CAAyC;AACzC,oCAA2C;AAE3C,MAAM,KAAK,GAAG,GAAG,cAAG,YAAY,CAAC;AACjC,qCAAqC;AACrC,MAAa,SAAS;IAGlB,+BAA+B;IAE/B;;SAEK;IACL,YAAoB,GAAc;QAAd,QAAG,GAAH,GAAG,CAAW;IAClC,CAAC;IAED,0BAA0B;IAEhB,aAAa,CAAC,KAAc,EAAE,MAA4B,EAAE,SAAmB;QACrF,MAAM,IAAI,GAAG,CAAC,OAAO,KAAK,CAAc,CAAC;QACzC,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YACvC,IAAI,CAAC,SAAS,EAAE,CAAC;gBACb,OAAO,KAAK,CAAC;YACjB,CAAC;YACD,MAAM,IAAI,yBAAiB,C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CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAC7E,CAAC;IAED,kBAAkB;IAClB,OAAO,CAA4B,OAAU;QACzC,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;QAC7C,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;YAC/B,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,wBAAU,CAAI,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAmB,CAAC,CAAC;QAC7F,CAAC;QACD,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAyB,CAAC;IAC/D,CAAC;IACD,gBAAgB;IAEhB,YAAY;IACZ,kBAAkB;IAClB,EAAE;QACE,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,eAAe;IAEf,sBAAsB;IACtB,kBAAkB;IAClB,MAAM,CAAC,OAAU;QACb,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC5C,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;YAC9B,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAC/B,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;CAEJ;AAjGD,8BAiGC"}
|
package/dist/hub/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './index.types';
|
package/dist/hub/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hub/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B"}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import type { InitLike, ShiftMain, ShiftSecure } from "../shared";
|
|
2
|
-
export type HubType = string | symbol;
|
|
3
|
-
/**
|
|
4
|
-
* Callback interface, it collects all jobs and fire them when callback is defined
|
|
5
|
-
* */
|
|
6
|
-
export interface HubCommonLike<T extends HubType = string> extends ShiftSecure<HubCommonSecure<T>> {
|
|
7
|
-
/**
|
|
8
|
-
* Cast hub with different type names
|
|
9
|
-
*
|
|
10
|
-
* @return {HubCommonLike} - cast hub
|
|
11
|
-
* */
|
|
12
|
-
as<F extends HubType = string>(): HubCommonLike<T | F>;
|
|
13
|
-
/**
|
|
14
|
-
* List channels
|
|
15
|
-
*
|
|
16
|
-
* @return {Array<HubType>} - channels
|
|
17
|
-
* */
|
|
18
|
-
get channels(): Array<T>;
|
|
19
|
-
/**
|
|
20
|
-
* Remove a channel
|
|
21
|
-
*
|
|
22
|
-
* Notes:
|
|
23
|
-
* - channel should be regular string
|
|
24
|
-
*
|
|
25
|
-
* @param {HubType} channel
|
|
26
|
-
* @return {boolean} - removed or not
|
|
27
|
-
* */
|
|
28
|
-
delete(channel: T): boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Return a channel
|
|
31
|
-
*
|
|
32
|
-
* Notes:
|
|
33
|
-
* - channel should be regular string
|
|
34
|
-
*
|
|
35
|
-
* @param {HubType} channel
|
|
36
|
-
* @return {function} - callback function
|
|
37
|
-
* */
|
|
38
|
-
channel<C extends string = string>(channel: T): HubChannelLike<T, C>;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Secure hub interface
|
|
42
|
-
* */
|
|
43
|
-
export interface HubCommonSecure<T extends HubType = string> extends ShiftMain<HubCommonLike<T>>, InitLike {
|
|
44
|
-
}
|
|
45
|
-
export interface HubChannelLike<T extends HubType = string, C extends string = string> {
|
|
46
|
-
/**
|
|
47
|
-
* Hub type
|
|
48
|
-
*
|
|
49
|
-
* @type {HubType}
|
|
50
|
-
* */
|
|
51
|
-
readonly type: T;
|
|
52
|
-
/**
|
|
53
|
-
* Cast channel with different channel names
|
|
54
|
-
*
|
|
55
|
-
* @return {HubChannelLike} - cast channel
|
|
56
|
-
* */
|
|
57
|
-
as<F extends string = string>(): HubChannelLike<T, C | F>;
|
|
58
|
-
/**
|
|
59
|
-
* List all names
|
|
60
|
-
*
|
|
61
|
-
* @return {Array<string>} - names
|
|
62
|
-
* */
|
|
63
|
-
get names(): Array<C>;
|
|
64
|
-
/**
|
|
65
|
-
* Set a names
|
|
66
|
-
*
|
|
67
|
-
* Notes:
|
|
68
|
-
* - name should be regular string
|
|
69
|
-
*
|
|
70
|
-
* @param {string} name
|
|
71
|
-
* @param {any} value
|
|
72
|
-
* @return {boolean} - is success, otherwise it already exists
|
|
73
|
-
* */
|
|
74
|
-
set<V>(name: C, value: V): boolean;
|
|
75
|
-
/**
|
|
76
|
-
* Delete a channel from register
|
|
77
|
-
*
|
|
78
|
-
* Notes:
|
|
79
|
-
* - name should be regular string
|
|
80
|
-
*
|
|
81
|
-
* @param {string} name
|
|
82
|
-
* @return {boolean} - removed or not
|
|
83
|
-
* */
|
|
84
|
-
delete(name: C): boolean;
|
|
85
|
-
/**
|
|
86
|
-
* Check a channel exists or not
|
|
87
|
-
*
|
|
88
|
-
* Notes:
|
|
89
|
-
* - name should be regular string
|
|
90
|
-
*
|
|
91
|
-
* @param {string} name
|
|
92
|
-
* @return {boolean} - exists or not
|
|
93
|
-
* */
|
|
94
|
-
has(name: C): boolean;
|
|
95
|
-
/**
|
|
96
|
-
* Return a channel
|
|
97
|
-
*
|
|
98
|
-
* Notes:
|
|
99
|
-
* - channel should be regular string
|
|
100
|
-
*
|
|
101
|
-
* @param {string} name
|
|
102
|
-
* @return {any} - value of channel
|
|
103
|
-
* */
|
|
104
|
-
get<V>(name: C): V;
|
|
105
|
-
}
|
package/dist/hub/index.types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.types.js","sourceRoot":"","sources":["../../src/hub/index.types.ts"],"names":[],"mappings":""}
|
package/dist/leyyo/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './index.types';
|
package/dist/leyyo/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./index.types"), exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
package/dist/leyyo/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/leyyo/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { ErrorCommonLike } from "../error";
|
|
2
|
-
import type { LogCommonLike } from "../log";
|
|
3
|
-
import type { RepoCommonLike } from "../repo";
|
|
4
|
-
import type { Fnc, ShiftMain, ShiftSecure } from "../shared";
|
|
5
|
-
import type { DeployCommonLike } from "../deploy";
|
|
6
|
-
import type { NameCommonLike } from "../name";
|
|
7
|
-
import type { EventCommonLike } from "../event";
|
|
8
|
-
import type { OptCommonLike } from "../opt";
|
|
9
|
-
export interface LeyyoLike extends ShiftSecure<LeyyoSecure> {
|
|
10
|
-
readonly error: ErrorCommonLike;
|
|
11
|
-
readonly log: LogCommonLike;
|
|
12
|
-
readonly repo: RepoCommonLike;
|
|
13
|
-
readonly deploy: DeployCommonLike;
|
|
14
|
-
readonly name: NameCommonLike;
|
|
15
|
-
readonly event: EventCommonLike;
|
|
16
|
-
readonly opt: OptCommonLike;
|
|
17
|
-
}
|
|
18
|
-
export interface LeyyoSecure extends ShiftMain<LeyyoLike> {
|
|
19
|
-
$earlyRun(fn: Fnc): LeyyoSecure;
|
|
20
|
-
$lazyRun(fn: Fnc): LeyyoSecure;
|
|
21
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.types.js","sourceRoot":"","sources":["../../src/leyyo/index.types.ts"],"names":[],"mappings":""}
|
package/dist/leyyo/leyyo.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { OptCommon } from "../opt/opt.common";
|
|
2
|
-
import { Fnc } from "../shared";
|
|
3
|
-
import { DeployCommonLike } from "../deploy";
|
|
4
|
-
import { NameCommonLike } from "../name";
|
|
5
|
-
import { LeyyoLike, LeyyoSecure } from "./index.types";
|
|
6
|
-
import { ErrorCommonLike } from "../error";
|
|
7
|
-
import { LogCommonLike } from "../log";
|
|
8
|
-
import { RepoCommonLike } from "../repo";
|
|
9
|
-
import { EventCommonLike } from "../event";
|
|
10
|
-
export declare class Leyyo implements LeyyoLike, LeyyoSecure {
|
|
11
|
-
private _lazyCallbacks;
|
|
12
|
-
private _earlyCallbacks;
|
|
13
|
-
readonly error: ErrorCommonLike;
|
|
14
|
-
readonly log: LogCommonLike;
|
|
15
|
-
readonly repo: RepoCommonLike;
|
|
16
|
-
readonly deploy: DeployCommonLike;
|
|
17
|
-
readonly name: NameCommonLike;
|
|
18
|
-
readonly event: EventCommonLike;
|
|
19
|
-
readonly opt: OptCommon;
|
|
20
|
-
constructor();
|
|
21
|
-
get $secure(): LeyyoSecure;
|
|
22
|
-
get $back(): LeyyoLike;
|
|
23
|
-
$earlyRun(fn: Fnc): LeyyoSecure;
|
|
24
|
-
$lazyRun(fn: Fnc): LeyyoSecure;
|
|
25
|
-
}
|
package/dist/leyyo/leyyo.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Leyyo = void 0;
|
|
4
|
-
const internal_1 = require("../internal");
|
|
5
|
-
const repo_common_1 = require("../repo/repo.common");
|
|
6
|
-
const log_common_1 = require("../log/log.common");
|
|
7
|
-
const error_common_1 = require("../error/error.common");
|
|
8
|
-
const deploy_common_1 = require("../deploy/deploy.common");
|
|
9
|
-
const name_common_1 = require("../name/name.common");
|
|
10
|
-
const event_common_1 = require("../event/event.common");
|
|
11
|
-
const opt_common_1 = require("../opt/opt.common");
|
|
12
|
-
class Leyyo {
|
|
13
|
-
constructor() {
|
|
14
|
-
this._lazyCallbacks = [];
|
|
15
|
-
this._earlyCallbacks = [];
|
|
16
|
-
this.repo = new repo_common_1.RepoCommon(this); // none
|
|
17
|
-
this.deploy = new deploy_common_1.DeployCommon(this); // dev, test
|
|
18
|
-
this.name = new name_common_1.NameCommon(this); // dev
|
|
19
|
-
this.error = new error_common_1.ErrorCommon(this); //
|
|
20
|
-
this.log = new log_common_1.LogCommon(this); // test
|
|
21
|
-
this.event = new event_common_1.EventCommon(this); // repo, assertion
|
|
22
|
-
this.opt = new opt_common_1.OptCommon(this);
|
|
23
|
-
const members = [
|
|
24
|
-
this.repo.$secure,
|
|
25
|
-
this.deploy.$secure,
|
|
26
|
-
this.name.$secure,
|
|
27
|
-
this.error.$secure,
|
|
28
|
-
this.log.$secure,
|
|
29
|
-
this.event.$secure,
|
|
30
|
-
this.opt.$secure,
|
|
31
|
-
];
|
|
32
|
-
members.forEach(member => member.$init(this));
|
|
33
|
-
this.$lazyRun(() => {
|
|
34
|
-
this.event.emit('ly:fqn:register', 'class', internal_1.FQN, Leyyo);
|
|
35
|
-
});
|
|
36
|
-
this._earlyCallbacks.forEach(fn => fn());
|
|
37
|
-
this._lazyCallbacks.forEach(fn => fn());
|
|
38
|
-
members.forEach(member => {
|
|
39
|
-
delete member.$init;
|
|
40
|
-
});
|
|
41
|
-
['$secure', '$back', '$earlyRun', '$lazyRun', '_lazyCallbacks', '_earlyCallbacks'].forEach(field => {
|
|
42
|
-
delete this[field];
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
// region secure
|
|
46
|
-
get $secure() {
|
|
47
|
-
return this;
|
|
48
|
-
}
|
|
49
|
-
get $back() {
|
|
50
|
-
return this;
|
|
51
|
-
}
|
|
52
|
-
$earlyRun(fn) {
|
|
53
|
-
this._earlyCallbacks.push(fn);
|
|
54
|
-
return this;
|
|
55
|
-
}
|
|
56
|
-
$lazyRun(fn) {
|
|
57
|
-
this._lazyCallbacks.push(fn);
|
|
58
|
-
return this;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
exports.Leyyo = Leyyo;
|
|
62
|
-
//# sourceMappingURL=leyyo.js.map
|
package/dist/leyyo/leyyo.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"leyyo.js","sourceRoot":"","sources":["../../src/leyyo/leyyo.ts"],"names":[],"mappings":";;;AAAA,0CAAgC;AAChC,qDAA+C;AAC/C,kDAA4C;AAC5C,wDAAkD;AAClD,2DAAqD;AACrD,qDAA+C;AAC/C,wDAAkD;AAClD,kDAA4C;AAU5C,MAAa,KAAK;IAWd;QAVQ,mBAAc,GAAe,EAAE,CAAC;QAChC,oBAAe,GAAe,EAAE,CAAC;QAUrC,IAAI,CAAC,IAAI,GAAG,IAAI,wBAAU,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO;QACzC,IAAI,CAAC,MAAM,GAAG,IAAI,4BAAY,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY;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;QAEH,CAAC,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,gBAAgB,EAAE,iBAAiB,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YAC/F,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;QACvB,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;AAlED,sBAkEC"}
|
package/dist/log/index.d.ts
DELETED
package/dist/log/index.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./index.types"), exports);
|
|
18
|
-
__exportStar(require("./logger.instance"), exports);
|
|
19
|
-
__exportStar(require("./log-level"), exports);
|
|
20
|
-
__exportStar(require("./logger.error"), exports);
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
package/dist/log/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/log/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,oDAAkC;AAClC,8CAA4B;AAC5B,iDAA+B"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import type { Dict, InitLike, ShiftMain, ShiftSecure } from "../shared";
|
|
2
|
-
import type { LogLevel } from "./log-level";
|
|
3
|
-
import type { DeployCommonSecure } from "../deploy";
|
|
4
|
-
import type { Opt } from "../opt";
|
|
5
|
-
export interface LogCommonLike extends ShiftSecure<LogCommonSecure>, LogConsumer {
|
|
6
|
-
create(clazz: Object | Function | string): Logger;
|
|
7
|
-
}
|
|
8
|
-
export type LogCommonSecure = ShiftMain<LogCommonLike> & InitLike;
|
|
9
|
-
export interface LogConsumer {
|
|
10
|
-
apply(line: LogLine): void;
|
|
11
|
-
}
|
|
12
|
-
export interface LogLine {
|
|
13
|
-
level: LogLevel;
|
|
14
|
-
message: string | Error;
|
|
15
|
-
params?: Dict;
|
|
16
|
-
}
|
|
17
|
-
export interface LogLineEnhanced<L = Dict> extends LogLine {
|
|
18
|
-
time?: Date;
|
|
19
|
-
where?: string;
|
|
20
|
-
locals?: L;
|
|
21
|
-
}
|
|
22
|
-
export interface Logger extends ShiftSecure<LoggerSecure> {
|
|
23
|
-
debug(message: string, params?: any | Opt): void;
|
|
24
|
-
debug(error: Error, params?: any | Opt): void;
|
|
25
|
-
debug(whatever: any, params?: any | Opt): void;
|
|
26
|
-
trace(message: string, params?: any | Opt): void;
|
|
27
|
-
trace(error: Error, params?: any | Opt): void;
|
|
28
|
-
trace(whatever: any, params?: any | Opt): void;
|
|
29
|
-
info(message: string, params?: any | Opt): void;
|
|
30
|
-
info(error: Error, params?: any | Opt): void;
|
|
31
|
-
info(whatever: any, params?: any | Opt): void;
|
|
32
|
-
warn(message: string, params?: any | Opt): void;
|
|
33
|
-
warn(error: Error, params?: any | Opt): void;
|
|
34
|
-
warn(whatever: any, params?: any | Opt): void;
|
|
35
|
-
error(message: string, params?: any | Opt): void;
|
|
36
|
-
error(error: Error, params?: any | Opt): void;
|
|
37
|
-
error(whatever: any, params?: any | Opt): void;
|
|
38
|
-
fatal(message: string, params?: any | Opt): void;
|
|
39
|
-
fatal(error: Error, params?: any | Opt): void;
|
|
40
|
-
fatal(whatever: any, params?: any | Opt): void;
|
|
41
|
-
get deploy(): DeployCommonSecure;
|
|
42
|
-
}
|
|
43
|
-
export interface LoggerSecure extends ShiftMain<Logger> {
|
|
44
|
-
get $clazz(): Function;
|
|
45
|
-
get $name(): string;
|
|
46
|
-
$refresh(level: LogLevel): void;
|
|
47
|
-
}
|
package/dist/log/index.types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.types.js","sourceRoot":"","sources":["../../src/log/index.types.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"log-level.js","sourceRoot":"","sources":["../../src/log/log-level.ts"],"names":[],"mappings":";;;AAAA,kCAAkC;AAElC,MAAM,QAAQ,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAU,CAAC;AAKlE,QAAA,aAAa,GAAG,QAAmC,CAAA;AAChE,IAAA,gBAAS,EAAC,qBAAa,EAAE,UAAU,CAAC,CAAC"}
|
package/dist/log/log.common.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { LeyyoLike } from "../leyyo";
|
|
2
|
-
import { 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
|
-
}
|