@leyyo/common 1.3.7 → 1.3.9

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.
Files changed (211) hide show
  1. package/dist/base/index.d.ts +3 -3
  2. package/dist/base/index.js +3 -20
  3. package/dist/base/index.types.d.ts +32 -18
  4. package/dist/base/index.types.js +1 -3
  5. package/dist/base/leyyo.d.ts +1 -1
  6. package/dist/base/leyyo.js +35 -26
  7. package/dist/base/leyyo.types.d.ts +3 -3
  8. package/dist/base/leyyo.types.js +1 -3
  9. package/dist/class/index.d.ts +2 -2
  10. package/dist/class/index.js +2 -19
  11. package/dist/class/index.types.d.ts +1 -1
  12. package/dist/class/index.types.js +1 -3
  13. package/dist/class/list.d.ts +1 -1
  14. package/dist/class/list.js +1 -6
  15. package/dist/class/logger.instance.d.ts +5 -5
  16. package/dist/class/logger.instance.js +8 -12
  17. package/dist/common/deploy.common.d.ts +2 -2
  18. package/dist/common/deploy.common.js +14 -16
  19. package/dist/common/enum.pool.d.ts +5 -3
  20. package/dist/common/enum.pool.js +36 -48
  21. package/dist/common/error.common.d.ts +4 -4
  22. package/dist/common/error.common.js +45 -85
  23. package/dist/common/error.pool.d.ts +5 -3
  24. package/dist/common/error.pool.js +12 -23
  25. package/dist/common/event.common.d.ts +2 -2
  26. package/dist/common/event.common.js +25 -28
  27. package/dist/common/index.d.ts +11 -11
  28. package/dist/common/index.js +11 -28
  29. package/dist/common/index.types.d.ts +42 -6
  30. package/dist/common/index.types.js +1 -3
  31. package/dist/common/inert.d.ts +4 -2
  32. package/dist/common/inert.js +97 -110
  33. package/dist/common/lifecycle.common.d.ts +2 -2
  34. package/dist/common/lifecycle.common.js +48 -61
  35. package/dist/common/literal.pool.d.ts +6 -3
  36. package/dist/common/literal.pool.js +37 -48
  37. package/dist/common/log.common.d.ts +4 -4
  38. package/dist/common/log.common.js +63 -60
  39. package/dist/common/repo.common.d.ts +3 -3
  40. package/dist/common/repo.common.js +50 -52
  41. package/dist/const/index.js +26 -30
  42. package/dist/enum/index.d.ts +1 -1
  43. package/dist/enum/index.js +1 -18
  44. package/dist/enum/log-level.js +1 -5
  45. package/dist/error/caused.error.d.ts +2 -2
  46. package/dist/error/caused.error.js +2 -7
  47. package/dist/error/developer.error.d.ts +3 -3
  48. package/dist/error/developer.error.js +9 -9
  49. package/dist/error/http.error.d.ts +2 -2
  50. package/dist/error/http.error.js +9 -15
  51. package/dist/error/index.d.ts +7 -7
  52. package/dist/error/index.js +7 -24
  53. package/dist/error/index.types.d.ts +3 -3
  54. package/dist/error/index.types.js +1 -3
  55. package/dist/error/invalid-value.error.d.ts +1 -1
  56. package/dist/error/invalid-value.error.js +6 -13
  57. package/dist/error/leyyo.error.d.ts +5 -5
  58. package/dist/error/leyyo.error.js +45 -34
  59. package/dist/error/multiple.error.d.ts +2 -2
  60. package/dist/error/multiple.error.js +6 -12
  61. package/dist/function/define-loader.d.ts +1 -1
  62. package/dist/function/define-loader.js +7 -10
  63. package/dist/function/delay.js +2 -6
  64. package/dist/function/delete-prop.js +9 -15
  65. package/dist/function/{empty.fn.js → empty-fn.js} +1 -5
  66. package/dist/function/extended-type.d.ts +1 -1
  67. package/dist/function/extended-type.js +8 -12
  68. package/dist/function/get-fqn.d.ts +1 -1
  69. package/dist/function/get-fqn.js +7 -12
  70. package/dist/function/get-prop.js +10 -16
  71. package/dist/function/has-fqn.d.ts +1 -1
  72. package/dist/function/has-fqn.js +7 -11
  73. package/dist/function/index.d.ts +38 -28
  74. package/dist/function/index.js +38 -45
  75. package/dist/function/index.types.d.ts +2 -2
  76. package/dist/function/index.types.js +1 -3
  77. package/dist/function/is-anonymous-name.js +3 -7
  78. package/dist/function/is-class.d.ts +7 -0
  79. package/dist/function/is-class.js +18 -0
  80. package/dist/function/is-empty.d.ts +12 -0
  81. package/dist/function/is-empty.js +18 -0
  82. package/dist/function/is-filled-arr.d.ts +10 -0
  83. package/dist/function/is-filled-arr.js +12 -0
  84. package/dist/function/is-filled-obj.d.ts +10 -0
  85. package/dist/function/is-filled-obj.js +13 -0
  86. package/dist/function/is-obj.d.ts +9 -0
  87. package/dist/function/is-obj.js +11 -0
  88. package/dist/function/is-test.js +2 -7
  89. package/dist/function/is-text.d.ts +11 -0
  90. package/dist/function/is-text.js +17 -0
  91. package/dist/function/jitter-interval.js +2 -6
  92. package/dist/function/leyyo-fn.d.ts +1 -1
  93. package/dist/function/leyyo-fn.js +2 -7
  94. package/dist/function/on-fqn-set.d.ts +1 -1
  95. package/dist/function/on-fqn-set.js +9 -13
  96. package/dist/function/one-or-more.d.ts +1 -1
  97. package/dist/function/one-or-more.js +1 -5
  98. package/dist/function/opt-add.d.ts +10 -0
  99. package/dist/function/opt-add.js +29 -0
  100. package/dist/function/opt-append.d.ts +9 -0
  101. package/dist/function/opt-append.js +24 -0
  102. package/dist/function/opt-check.d.ts +8 -0
  103. package/dist/function/opt-check.js +31 -0
  104. package/dist/function/opt-clone.d.ts +8 -0
  105. package/dist/function/opt-clone.js +12 -0
  106. package/dist/function/opt-field.d.ts +11 -0
  107. package/dist/function/opt-field.js +31 -0
  108. package/dist/function/opt-fn.d.ts +8 -0
  109. package/dist/function/opt-fn.js +11 -0
  110. package/dist/function/random-test-no.js +1 -5
  111. package/dist/function/remove-fqn.d.ts +1 -1
  112. package/dist/function/remove-fqn.js +10 -14
  113. package/dist/function/run-exporter.d.ts +1 -1
  114. package/dist/function/run-exporter.js +12 -27
  115. package/dist/function/secure-clone.d.ts +1 -1
  116. package/dist/function/secure-clone.js +2 -7
  117. package/dist/function/secure-json.js +6 -12
  118. package/dist/function/set-anonymous-fqn.d.ts +1 -1
  119. package/dist/function/set-anonymous-fqn.js +15 -19
  120. package/dist/function/set-anonymous-name.d.ts +1 -1
  121. package/dist/function/set-anonymous-name.js +23 -26
  122. package/dist/function/set-fqn.d.ts +1 -1
  123. package/dist/function/set-fqn.js +28 -31
  124. package/dist/function/set-prop.js +9 -15
  125. package/dist/function/stamp-loader.d.ts +1 -1
  126. package/dist/function/stamp-loader.js +4 -8
  127. package/dist/function/test-case.js +5 -9
  128. package/dist/function/test-name.js +4 -8
  129. package/dist/function/trigger-fqn.d.ts +1 -1
  130. package/dist/function/trigger-fqn.js +5 -9
  131. package/dist/index.d.ts +19 -19
  132. package/dist/index.foretell.js +10 -88
  133. package/dist/index.js +22 -40
  134. package/dist/index.loader.d.ts +1 -1
  135. package/dist/index.loader.js +6 -43
  136. package/dist/init/index.js +3 -7
  137. package/dist/internal.js +1 -5
  138. package/package.json +26 -16
  139. package/dist/assets/.gitkeep +0 -0
  140. package/dist/base/index.js.map +0 -1
  141. package/dist/base/index.types.js.map +0 -1
  142. package/dist/base/leyyo.js.map +0 -1
  143. package/dist/base/leyyo.types.js.map +0 -1
  144. package/dist/class/index.js.map +0 -1
  145. package/dist/class/index.types.js.map +0 -1
  146. package/dist/class/list.js.map +0 -1
  147. package/dist/class/logger.instance.js.map +0 -1
  148. package/dist/common/deploy.common.js.map +0 -1
  149. package/dist/common/enum.pool.js.map +0 -1
  150. package/dist/common/error.common.js.map +0 -1
  151. package/dist/common/error.pool.js.map +0 -1
  152. package/dist/common/event.common.js.map +0 -1
  153. package/dist/common/index.js.map +0 -1
  154. package/dist/common/index.types.js.map +0 -1
  155. package/dist/common/inert.js.map +0 -1
  156. package/dist/common/lifecycle.common.js.map +0 -1
  157. package/dist/common/literal.pool.js.map +0 -1
  158. package/dist/common/log.common.js.map +0 -1
  159. package/dist/common/repo.common.js.map +0 -1
  160. package/dist/const/index.js.map +0 -1
  161. package/dist/enum/index.js.map +0 -1
  162. package/dist/enum/log-level.js.map +0 -1
  163. package/dist/error/caused.error.js.map +0 -1
  164. package/dist/error/developer.error.js.map +0 -1
  165. package/dist/error/http.error.js.map +0 -1
  166. package/dist/error/index.js.map +0 -1
  167. package/dist/error/index.types.js.map +0 -1
  168. package/dist/error/invalid-value.error.js.map +0 -1
  169. package/dist/error/leyyo.error.js.map +0 -1
  170. package/dist/error/multiple.error.js.map +0 -1
  171. package/dist/function/define-loader.js.map +0 -1
  172. package/dist/function/delay.js.map +0 -1
  173. package/dist/function/delete-prop.js.map +0 -1
  174. package/dist/function/empty.fn.js.map +0 -1
  175. package/dist/function/extended-type.js.map +0 -1
  176. package/dist/function/get-fqn.js.map +0 -1
  177. package/dist/function/get-prop.js.map +0 -1
  178. package/dist/function/has-fqn.js.map +0 -1
  179. package/dist/function/index.js.map +0 -1
  180. package/dist/function/index.types.js.map +0 -1
  181. package/dist/function/is-anonymous-name.js.map +0 -1
  182. package/dist/function/is-test.js.map +0 -1
  183. package/dist/function/is.fn.d.ts +0 -59
  184. package/dist/function/is.fn.js +0 -93
  185. package/dist/function/is.fn.js.map +0 -1
  186. package/dist/function/jitter-interval.js.map +0 -1
  187. package/dist/function/leyyo-fn.js.map +0 -1
  188. package/dist/function/on-fqn-set.js.map +0 -1
  189. package/dist/function/one-or-more.js.map +0 -1
  190. package/dist/function/opt.fn.d.ts +0 -49
  191. package/dist/function/opt.fn.js +0 -142
  192. package/dist/function/opt.fn.js.map +0 -1
  193. package/dist/function/random-test-no.js.map +0 -1
  194. package/dist/function/remove-fqn.js.map +0 -1
  195. package/dist/function/run-exporter.js.map +0 -1
  196. package/dist/function/secure-clone.js.map +0 -1
  197. package/dist/function/secure-json.js.map +0 -1
  198. package/dist/function/set-anonymous-fqn.js.map +0 -1
  199. package/dist/function/set-anonymous-name.js.map +0 -1
  200. package/dist/function/set-fqn.js.map +0 -1
  201. package/dist/function/set-prop.js.map +0 -1
  202. package/dist/function/stamp-loader.js.map +0 -1
  203. package/dist/function/test-case.js.map +0 -1
  204. package/dist/function/test-name.js.map +0 -1
  205. package/dist/function/trigger-fqn.js.map +0 -1
  206. package/dist/index.foretell.js.map +0 -1
  207. package/dist/index.js.map +0 -1
  208. package/dist/index.loader.js.map +0 -1
  209. package/dist/init/index.js.map +0 -1
  210. package/dist/internal.js.map +0 -1
  211. /package/dist/function/{empty.fn.d.ts → empty-fn.d.ts} +0 -0
@@ -1,3 +1,3 @@
1
- export * from './index.types';
2
- export * from './leyyo.types';
3
- export * from './leyyo';
1
+ export * from './index.types.js';
2
+ export * from './leyyo.types.js';
3
+ export * from './leyyo.js';
@@ -1,20 +1,3 @@
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("./leyyo.types"), exports);
19
- __exportStar(require("./leyyo"), exports);
20
- //# sourceMappingURL=index.js.map
1
+ export * from './index.types.js';
2
+ export * from './leyyo.types.js';
3
+ export * from './leyyo.js';
@@ -6,24 +6,26 @@ export type AnyKey = string | number | symbol;
6
6
  export type Obj = Object & {};
7
7
  export type Dict<T = unknown> = Record<KeyValue, T>;
8
8
  export type Arr<T = unknown> = Array<T>;
9
- export type Id = string | number;
10
- export type Integer = number;
11
- export type Float = number;
12
- export type Alpha = string;
13
- export type Text = string;
14
- export type Digit = string;
15
- export type Title = string;
16
- export type Description = string;
17
- export type RichText = string;
18
- export type Uuid = string;
19
- export type Host = string;
20
- export type Url = string;
21
- export type Email = string;
22
- export type Folder = string;
23
- export type Timestamp = number;
24
- export type IsoDatetime = string;
25
- export type IsoDate = string;
26
- export type IsoTime = string;
9
+ export type KeyLike = string | number;
10
+ export type IdLike = string | number;
11
+ export type IntegerLike = number;
12
+ export type FloatLike = number;
13
+ export type AlphaLike = string;
14
+ export type SlugLike = string;
15
+ export type TextLike = string;
16
+ export type DigitLike = string;
17
+ export type TitleLike = string;
18
+ export type DescriptionLike = string;
19
+ export type RichTextLike = string;
20
+ export type UuidLike = string;
21
+ export type HostLike = string;
22
+ export type UrlLike = string;
23
+ export type EmailLike = string;
24
+ export type FolderLike = string;
25
+ export type PhoneLike = string;
26
+ export type UrnLike = string;
27
+ export type HashText = string;
28
+ export type EncryptedText = string;
27
29
  export type Fnc<R = unknown> = ((...args: Arr) => R) & Function;
28
30
  export type Async<R = unknown> = ((...args: Arr) => Promise<R>) & AsyncGeneratorFunction;
29
31
  export interface Abstract<T = {}> extends Function {
@@ -160,6 +162,18 @@ type OneOfByKey<T> = {
160
162
  type XorIn<T> = {
161
163
  [K in keyof T]: T[K];
162
164
  } & unknown;
165
+ export type Timestamp = number;
166
+ export type TimeLong = Timestamp;
167
+ export type TtlMsec = number;
168
+ export type TtlLong = TtlMsec;
169
+ export type EpochTime = number;
170
+ export type TimeShort = EpochTime;
171
+ export type TtlSecond = number;
172
+ export type TtlShort = TtlSecond;
173
+ export type IsoDatetime = string;
174
+ export type IsoDate = string;
175
+ export type IsoTime = string;
176
+ export type JsonText<T = unknown> = string;
163
177
  /**
164
178
  * JSON Object, record of `JsonValue`
165
179
  *
@@ -1,5 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  // endregion json
4
3
  /*
5
4
 
@@ -32,4 +31,3 @@ interface _AsyncFnc<R> extends _BaseFunc {
32
31
  // export type AnyFnc<R = unknown> = Fnc<R> | Async<R>;
33
32
 
34
33
  */
35
- //# sourceMappingURL=index.types.js.map
@@ -1,4 +1,4 @@
1
- import { LeyyoLike } from "./index";
1
+ import { LeyyoLike } from "./leyyo.types.js";
2
2
  /**
3
3
  * Leyyo common instance
4
4
  * */
@@ -1,32 +1,42 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.leyyo = void 0;
4
- const common_1 = require("../common");
5
- const error_1 = require("../error");
6
- const logger_instance_1 = require("../class/logger.instance");
7
- const const_1 = require("../const");
8
- const leyyo_fn_1 = require("../function/leyyo-fn");
1
+ import { DeployCommon, EnumPool, ErrorCommon, ErrorPool, EventCommon, LifecycleCommon, LiteralPool, LogCommon, RepoCommon } from "../common/index.js";
2
+ import { DeveloperError, LeyyoError } from "../error/index.js";
3
+ import { LoggerInstance } from "../class/logger.instance.js";
4
+ import { KEY_SECURE_1 } from "../const/index.js";
5
+ import { $$set_leyyo_fn } from "../function/leyyo-fn.js";
9
6
  class Leyyo {
7
+ _developerError;
8
+ _leyyoError;
9
+ _loggerInstance;
10
+ _repoCommon;
11
+ _deployCommon;
12
+ _enumPool;
13
+ _errorCommon;
14
+ _errorPool;
15
+ _eventCommon;
16
+ _lifecycleCommon;
17
+ _literalPool;
18
+ _logCommon;
19
+ _logger;
10
20
  constructor() {
11
21
  // region binding
12
- (0, leyyo_fn_1.$$set_leyyo_fn)(this);
13
- this._developerError = error_1.DeveloperError;
14
- this._developerError[const_1.KEY_SECURE_1](this);
15
- this._leyyoError = error_1.LeyyoError;
16
- this._leyyoError[const_1.KEY_SECURE_1](this);
17
- this._loggerInstance = logger_instance_1.LoggerInstance;
18
- this._loggerInstance[const_1.KEY_SECURE_1](this);
22
+ $$set_leyyo_fn(this);
23
+ this._developerError = DeveloperError;
24
+ this._developerError[KEY_SECURE_1](this);
25
+ this._leyyoError = LeyyoError;
26
+ this._leyyoError[KEY_SECURE_1](this);
27
+ this._loggerInstance = LoggerInstance;
28
+ this._loggerInstance[KEY_SECURE_1](this);
19
29
  // endregion binding
20
30
  // region instances
21
- this._repoCommon = new common_1.RepoCommon(this); // none
22
- this._errorCommon = new common_1.ErrorCommon(this); // none
23
- this._logCommon = new common_1.LogCommon(this); // repo
24
- this._eventCommon = new common_1.EventCommon(this); // repo
25
- this._deployCommon = new common_1.DeployCommon(this); // repo
26
- this._lifecycleCommon = new common_1.LifecycleCommon(this); // repo
27
- this._enumPool = new common_1.EnumPool(this); // complex
28
- this._errorPool = new common_1.ErrorPool(this);
29
- this._literalPool = new common_1.LiteralPool(this);
31
+ this._repoCommon = new RepoCommon(this); // none
32
+ this._errorCommon = new ErrorCommon(this); // none
33
+ this._logCommon = new LogCommon(this); // repo
34
+ this._eventCommon = new EventCommon(this); // repo
35
+ this._deployCommon = new DeployCommon(this); // repo
36
+ this._lifecycleCommon = new LifecycleCommon(this); // repo
37
+ this._enumPool = new EnumPool(this); // complex
38
+ this._errorPool = new ErrorPool(this);
39
+ this._literalPool = new LiteralPool(this);
30
40
  // endregion instances
31
41
  // region instance-ops
32
42
  this._logger = this._logCommon.of(Leyyo);
@@ -81,5 +91,4 @@ class Leyyo {
81
91
  /**
82
92
  * Leyyo common instance
83
93
  * */
84
- exports.leyyo = new Leyyo();
85
- //# sourceMappingURL=leyyo.js.map
94
+ export const leyyo = new Leyyo();
@@ -1,6 +1,6 @@
1
- import { DeveloperErrorCtor, LeyyoErrorCtor } from "../error";
2
- import { LoggerInstanceCtor } from "../class";
3
- import { DeployCommonLike, EnumPoolLike, ErrorCommonLike, ErrorPoolLike, EventCommonLike, EventType, LifecycleCommonLike, LiteralPoolLike, LogCommonLike, Logger, RepoCommonLike } from "../common";
1
+ import { DeveloperErrorCtor, LeyyoErrorCtor } from "../error/index.js";
2
+ import { LoggerInstanceCtor } from "../class/index.js";
3
+ import { DeployCommonLike, EnumPoolLike, ErrorCommonLike, ErrorPoolLike, EventCommonLike, EventType, LifecycleCommonLike, LiteralPoolLike, LogCommonLike, Logger, RepoCommonLike } from "../common/index.js";
4
4
  export interface LeyyoLike {
5
5
  get developerError(): DeveloperErrorCtor;
6
6
  get leyyoError(): LeyyoErrorCtor;
@@ -1,3 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=leyyo.types.js.map
1
+ export {};
@@ -1,2 +1,2 @@
1
- export * from './index.types';
2
- export * from './list';
1
+ export * from './index.types.js';
2
+ export * from './list.js';
@@ -1,19 +1,2 @@
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("./list"), exports);
19
- //# sourceMappingURL=index.js.map
1
+ export * from './index.types.js';
2
+ export * from './list.js';
@@ -1,4 +1,4 @@
1
- import { Logger } from "../common";
1
+ import { Logger } from "../common/index.js";
2
2
  export interface LoggerInstanceCtor {
3
3
  new (name: string): Logger;
4
4
  }
@@ -1,3 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=index.types.js.map
1
+ export {};
@@ -1,4 +1,4 @@
1
- import { ListLike, ListPredicate } from "./index.types";
1
+ import { ListLike, ListPredicate } from "./index.types.js";
2
2
  /**
3
3
  * Extended array class, ie: Clearable arrays
4
4
  * */
@@ -1,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.List = void 0;
4
1
  /**
5
2
  * Extended array class, ie: Clearable arrays
6
3
  * */
7
- class List extends Array {
4
+ export class List extends Array {
8
5
  constructor(...items) {
9
6
  super(...items);
10
7
  }
@@ -33,5 +30,3 @@ class List extends Array {
33
30
  return false;
34
31
  }
35
32
  }
36
- exports.List = List;
37
- //# sourceMappingURL=list.js.map
@@ -1,8 +1,8 @@
1
- import { LeyyoLike } from "../base";
2
- import { LogLevel } from "../enum";
3
- import { Opt } from "../function";
4
- import { KEY_SECURE_1 } from "../const";
5
- import { Logger, LoggerSecure } from "../common";
1
+ import { LeyyoLike } from "../base/index.js";
2
+ import { LogLevel } from "../enum/index.js";
3
+ import { Opt } from "../function/index.js";
4
+ import { KEY_SECURE_1 } from "../const/index.js";
5
+ import { Logger, LoggerSecure } from "../common/index.js";
6
6
  export declare class LoggerInstance implements Logger, LoggerSecure {
7
7
  private _name;
8
8
  constructor(name: string);
@@ -1,21 +1,19 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LoggerInstance = void 0;
4
- const function_1 = require("../function");
5
- const const_1 = require("../const");
1
+ import { isText } from "../function/index.js";
2
+ import { KEY_SECURE_1 } from "../const/index.js";
6
3
  // region property
7
4
  let _leyyo;
8
5
  // endregion property
9
6
  // noinspection JSUnusedLocalSymbols
10
- class LoggerInstance {
7
+ export class LoggerInstance {
8
+ _name;
11
9
  constructor(name) {
12
- if (!(0, function_1.isText)(name)) {
10
+ if (!isText(name)) {
13
11
  name = `Logger@` + Math.round(Math.random() * Number.MAX_SAFE_INTEGER).toString(10);
14
12
  }
15
13
  this._name = name;
16
14
  }
17
15
  // region static
18
- static [const_1.KEY_SECURE_1](leyyo) {
16
+ static [KEY_SECURE_1](leyyo) {
19
17
  if (!_leyyo) {
20
18
  _leyyo = leyyo;
21
19
  }
@@ -56,14 +54,14 @@ class LoggerInstance {
56
54
  }
57
55
  /** @inheritDoc */
58
56
  $refreshName(name) {
59
- if (!(0, function_1.isText)(name)) {
57
+ if (!isText(name)) {
60
58
  return;
61
59
  }
62
60
  this._name = name;
63
61
  }
64
62
  /** @inheritDoc */
65
63
  $refreshLevels(level) {
66
- if (!(0, function_1.isText)(level)) {
64
+ if (!isText(level)) {
67
65
  return;
68
66
  }
69
67
  const rec = {
@@ -107,5 +105,3 @@ class LoggerInstance {
107
105
  }
108
106
  }
109
107
  }
110
- exports.LoggerInstance = LoggerInstance;
111
- //# sourceMappingURL=logger.instance.js.map
@@ -1,5 +1,5 @@
1
- import { Fnc, LeyyoLike } from "../base";
2
- import { DeployCommonLike } from "./index.types";
1
+ import { Fnc, LeyyoLike } from "../base/index.js";
2
+ import { DeployCommonLike } from "./index.types.js";
3
3
  /**
4
4
  * Deploy common interface
5
5
  * */
@@ -1,14 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DeployCommon = void 0;
4
- const internal_1 = require("../internal");
5
- const function_1 = require("../function");
6
- const where = `${internal_1.FQN}.DeployCommon`;
1
+ import { FQN } from "../internal.js";
2
+ import { isText, testCase } from "../function/index.js";
3
+ const where = `${FQN}.DeployCommon`;
7
4
  // noinspection JSUnusedGlobalSymbols
8
5
  /**
9
6
  * Deploy common interface
10
7
  * */
11
- class DeployCommon {
8
+ export class DeployCommon {
9
+ leyyo;
10
+ _waitingCallbacks;
11
+ _alreadyDeployed;
12
12
  constructor(leyyo) {
13
13
  this.leyyo = leyyo;
14
14
  this._waitingCallbacks = this.leyyo.repoCommon.newMap(`${where}.waitingCallbacks`);
@@ -21,18 +21,18 @@ class DeployCommon {
21
21
  * @param {function} callback - callback for creator of component, if it completes it, this callback will be called
22
22
  * */
23
23
  wait(name, callback) {
24
- if (!(0, function_1.isText)(name)) {
25
- throw new this.leyyo.developerError('Invalid component name', (0, function_1.testCase)(internal_1.FQN, 120), where);
24
+ if (!isText(name)) {
25
+ throw new this.leyyo.developerError('Invalid component name', testCase(FQN, 120), where);
26
26
  }
27
27
  if (typeof callback !== 'function') {
28
- throw new this.leyyo.developerError(`Invalid caller callback [${name}]`, (0, function_1.testCase)(internal_1.FQN, 121), where);
28
+ throw new this.leyyo.developerError(`Invalid caller callback [${name}]`, testCase(FQN, 121), where);
29
29
  }
30
30
  if (this._alreadyDeployed.has(name)) {
31
31
  try {
32
32
  callback(...this._alreadyDeployed.get(name));
33
33
  }
34
34
  catch (e) {
35
- new this.leyyo.developerError(`Callback error during caller's callback [${name}]`, (0, function_1.testCase)(internal_1.FQN, 122), where).log(e);
35
+ new this.leyyo.developerError(`Callback error during caller's callback [${name}]`, testCase(FQN, 122), where).log(e);
36
36
  }
37
37
  return;
38
38
  }
@@ -49,8 +49,8 @@ class DeployCommon {
49
49
  * @param {...Array} values - They will be sent to callback of waiting component, {@link #wait}
50
50
  * */
51
51
  complete(name, ...values) {
52
- if (!(0, function_1.isText)(name)) {
53
- throw new this.leyyo.developerError('Invalid component name', (0, function_1.testCase)(internal_1.FQN, 123), where);
52
+ if (!isText(name)) {
53
+ throw new this.leyyo.developerError('Invalid component name', testCase(FQN, 123), where);
54
54
  }
55
55
  const isNew = !this._alreadyDeployed.has(name);
56
56
  this._alreadyDeployed.set(name, values);
@@ -63,12 +63,10 @@ class DeployCommon {
63
63
  callback(...values);
64
64
  }
65
65
  catch (e) {
66
- new this.leyyo.developerError(`Callback error during pending callback [${name}]`, (0, function_1.testCase)(internal_1.FQN, 124), where).log(e);
66
+ new this.leyyo.developerError(`Callback error during pending callback [${name}]`, testCase(FQN, 124), where).log(e);
67
67
  }
68
68
  });
69
69
  }
70
70
  }
71
71
  }
72
72
  }
73
- exports.DeployCommon = DeployCommon;
74
- //# sourceMappingURL=deploy.common.js.map
@@ -1,6 +1,6 @@
1
- import { Inert } from "./inert";
2
- import { Enum, EnumItemConfig, EnumPoolItem, EnumPoolLike, EnumPoolOpt } from "./index.types";
3
- import { LeyyoLike } from "../base";
1
+ import { Inert } from "./inert.js";
2
+ import { Enum, EnumItemConfig, EnumPoolItem, EnumPoolLike, EnumPoolOpt } from "./index.types.js";
3
+ import { LeyyoLike } from "../base/index.js";
4
4
  /**
5
5
  * Enum pool for call with name and lazy loading
6
6
  * */
@@ -20,4 +20,6 @@ export declare class EnumPool extends Inert<EnumPoolItem, Enum, EnumPoolOpt> imp
20
20
  /** @inheritDoc */
21
21
  setConfigItem(enm: Enum, conf: EnumItemConfig): void;
22
22
  getConfigItem(enm: Enum): EnumItemConfig;
23
+ /** @inheritDoc */
24
+ define(fqn: string, name: string, target: Enum, opt?: Omit<EnumPoolOpt, 'name' | 'target' | 'lazyTarget' | 'fqn'>): void;
23
25
  }
@@ -1,25 +1,14 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.EnumPool = void 0;
13
- const inert_1 = require("./inert");
14
- const function_1 = require("../function");
15
- const internal_1 = require("../internal");
16
- const const_1 = require("../const");
17
- const where = `${internal_1.FQN}.EnumPool`;
1
+ import { Inert } from "./inert.js";
2
+ import { getSymbol, isEmpty, isFilledObj, isObj, isText, setSymbol, testCase } from "../function/index.js";
3
+ import { FQN } from "../internal.js";
4
+ import { KEY_ENUM_ALT, KEY_ENUM_I18N, KEY_ENUM_NAME } from "../const/index.js";
5
+ const where = `${FQN}.EnumPool`;
18
6
  // noinspection JSUnusedGlobalSymbols
19
7
  /**
20
8
  * Enum pool for call with name and lazy loading
21
9
  * */
22
- class EnumPool extends inert_1.Inert {
10
+ export class EnumPool extends Inert {
11
+ leyyo;
23
12
  constructor(leyyo) {
24
13
  super(leyyo, 'enum', {});
25
14
  this.leyyo = leyyo;
@@ -27,29 +16,26 @@ class EnumPool extends inert_1.Inert {
27
16
  // region protected
28
17
  /** @inheritDoc */
29
18
  _getName(enm) {
30
- var _a;
31
- return (_a = this.getConfigItem(enm)) === null || _a === void 0 ? void 0 : _a.name;
19
+ return this.getConfigItem(enm)?.name;
32
20
  }
33
21
  /** @inheritDoc */
34
- _nextLoad(item) {
35
- return __awaiter(this, void 0, void 0, function* () {
36
- if (item.target && item.lazyAlt) {
37
- try {
38
- item.alt = yield item.lazyAlt;
39
- delete item.lazyAlt;
40
- this.setConfigItem(item.target, item);
41
- }
42
- catch (e) {
43
- new this.leyyo.developerError('Callback error during loading enum alternate data', (0, function_1.testCase)(internal_1.FQN, 186), where).log(e);
44
- }
22
+ async _nextLoad(item) {
23
+ if (item.target && item.lazyAlt) {
24
+ try {
25
+ item.alt = await item.lazyAlt;
26
+ delete item.lazyAlt;
27
+ this.setConfigItem(item.target, item);
45
28
  }
46
- delete item.lazyAlt;
47
- });
29
+ catch (e) {
30
+ new this.leyyo.developerError('Callback error during loading enum alternate data', testCase(FQN, 186), where).log(e);
31
+ }
32
+ }
33
+ delete item.lazyAlt;
48
34
  }
49
35
  /** @inheritDoc */
50
36
  _setName(enm, name) {
51
- if ((0, function_1.isText)(name)) {
52
- (0, function_1.setSymbol)(enm, const_1.KEY_ENUM_NAME, name);
37
+ if (isText(name)) {
38
+ setSymbol(enm, KEY_ENUM_NAME, name);
53
39
  return name;
54
40
  }
55
41
  return undefined;
@@ -66,23 +52,23 @@ class EnumPool extends inert_1.Inert {
66
52
  }
67
53
  /** @inheritDoc */
68
54
  _validate(enm) {
69
- return (0, function_1.isFilledObj)(enm);
55
+ return isFilledObj(enm);
70
56
  }
71
57
  // endregion protected
72
58
  // region public
73
59
  /** @inheritDoc */
74
60
  setConfigItem(enm, conf) {
75
- if (!(0, function_1.isObj)(conf)) {
61
+ if (!isObj(conf)) {
76
62
  return;
77
63
  }
78
- if ((0, function_1.isText)(conf.name)) {
79
- (0, function_1.setSymbol)(enm, const_1.KEY_ENUM_NAME, conf.name);
64
+ if (isText(conf.name)) {
65
+ setSymbol(enm, KEY_ENUM_NAME, conf.name);
80
66
  }
81
- if (!(0, function_1.isEmpty)(conf.i18n)) {
82
- (0, function_1.setSymbol)(enm, const_1.KEY_ENUM_I18N, conf.i18n);
67
+ if (!isEmpty(conf.i18n)) {
68
+ setSymbol(enm, KEY_ENUM_I18N, conf.i18n);
83
69
  }
84
- if ((0, function_1.isFilledObj)(conf.alt)) {
85
- (0, function_1.setSymbol)(enm, const_1.KEY_ENUM_ALT, conf.alt);
70
+ if (isFilledObj(conf.alt)) {
71
+ setSymbol(enm, KEY_ENUM_ALT, conf.alt);
86
72
  }
87
73
  }
88
74
  getConfigItem(enm) {
@@ -90,11 +76,13 @@ class EnumPool extends inert_1.Inert {
90
76
  return undefined;
91
77
  }
92
78
  return {
93
- name: (0, function_1.getSymbol)(enm, const_1.KEY_ENUM_NAME),
94
- i18n: (0, function_1.getSymbol)(enm, const_1.KEY_ENUM_I18N),
95
- alt: (0, function_1.getSymbol)(enm, const_1.KEY_ENUM_ALT),
79
+ name: getSymbol(enm, KEY_ENUM_NAME),
80
+ i18n: getSymbol(enm, KEY_ENUM_I18N),
81
+ alt: getSymbol(enm, KEY_ENUM_ALT),
96
82
  };
97
83
  }
84
+ /** @inheritDoc */
85
+ define(fqn, name, target, opt) {
86
+ this.register({ ...(opt ?? {}), fqn, name, target });
87
+ }
98
88
  }
99
- exports.EnumPool = EnumPool;
100
- //# sourceMappingURL=enum.pool.js.map
@@ -1,7 +1,7 @@
1
- import { ErrorCommonLike, ErrorItemConfig, ErrorObject } from "./index.types";
2
- import { ClassLike, LeyyoLike } from "../base";
3
- import { Opt } from "../function";
4
- import { LeyyoErrorLike } from "../error";
1
+ import { ErrorCommonLike, ErrorItemConfig, ErrorObject } from "./index.types.js";
2
+ import { ClassLike, LeyyoLike } from "../base/index.js";
3
+ import { Opt } from "../function/index.js";
4
+ import { LeyyoErrorLike } from "../error/index.js";
5
5
  export declare class ErrorCommon implements ErrorCommonLike {
6
6
  private leyyo;
7
7
  private _knownPackages;