@leyyo/common 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +25 -0
  3. package/dist/aliases.d.ts +139 -0
  4. package/dist/aliases.js +4 -0
  5. package/dist/assertion/assert.d.ts +6 -0
  6. package/dist/assertion/assert.js +13 -0
  7. package/dist/assertion/common-assertion-impl.d.ts +34 -0
  8. package/dist/assertion/common-assertion-impl.js +210 -0
  9. package/dist/assertion/index-types.d.ts +79 -0
  10. package/dist/assertion/index-types.js +2 -0
  11. package/dist/assertion/index.d.ts +3 -0
  12. package/dist/assertion/index.js +19 -0
  13. package/dist/callback/common-callback-impl.d.ts +31 -0
  14. package/dist/callback/common-callback-impl.js +134 -0
  15. package/dist/callback/index-types.d.ts +75 -0
  16. package/dist/callback/index-types.js +2 -0
  17. package/dist/callback/index.d.ts +2 -0
  18. package/dist/callback/index.js +18 -0
  19. package/dist/constants.d.ts +7 -0
  20. package/dist/constants.js +10 -0
  21. package/dist/error/assertion-exception.d.ts +5 -0
  22. package/dist/error/assertion-exception.js +11 -0
  23. package/dist/error/caused-exception.d.ts +5 -0
  24. package/dist/error/caused-exception.js +12 -0
  25. package/dist/error/common-error-impl.d.ts +24 -0
  26. package/dist/error/common-error-impl.js +88 -0
  27. package/dist/error/developer-exception.d.ts +5 -0
  28. package/dist/error/developer-exception.js +11 -0
  29. package/dist/error/exception.d.ts +33 -0
  30. package/dist/error/exception.js +124 -0
  31. package/dist/error/index-types.d.ts +70 -0
  32. package/dist/error/index-types.js +2 -0
  33. package/dist/error/index.d.ts +7 -0
  34. package/dist/error/index.js +23 -0
  35. package/dist/error/multiple-exception.d.ts +8 -0
  36. package/dist/error/multiple-exception.js +33 -0
  37. package/dist/index.d.ts +7 -0
  38. package/dist/index.js +26 -0
  39. package/dist/internal.d.ts +1 -0
  40. package/dist/internal.js +4 -0
  41. package/dist/is/common-is-impl.d.ts +22 -0
  42. package/dist/is/common-is-impl.js +66 -0
  43. package/dist/is/index-types.d.ts +22 -0
  44. package/dist/is/index-types.js +2 -0
  45. package/dist/is/index.d.ts +2 -0
  46. package/dist/is/index.js +18 -0
  47. package/dist/leyyo/index-types.d.ts +16 -0
  48. package/dist/leyyo/index-types.js +2 -0
  49. package/dist/leyyo/index.d.ts +2 -0
  50. package/dist/leyyo/index.js +18 -0
  51. package/dist/leyyo/leyyo-impl.d.ts +24 -0
  52. package/dist/leyyo/leyyo-impl.js +71 -0
  53. package/dist/literals.d.ts +98 -0
  54. package/dist/literals.js +77 -0
  55. package/dist/log/common-log-impl.d.ts +13 -0
  56. package/dist/log/common-log-impl.js +59 -0
  57. package/dist/log/index-types.d.ts +58 -0
  58. package/dist/log/index-types.js +3 -0
  59. package/dist/log/index.d.ts +3 -0
  60. package/dist/log/index.js +19 -0
  61. package/dist/log/logger-impl.d.ts +23 -0
  62. package/dist/log/logger-impl.js +73 -0
  63. package/dist/storage/common-storage-impl.d.ts +46 -0
  64. package/dist/storage/common-storage-impl.js +150 -0
  65. package/dist/storage/index-types.d.ts +102 -0
  66. package/dist/storage/index-types.js +2 -0
  67. package/dist/storage/index.d.ts +3 -0
  68. package/dist/storage/index.js +19 -0
  69. package/dist/storage/list.d.ts +9 -0
  70. package/dist/storage/list.js +16 -0
  71. package/dist/to/common-to-impl.d.ts +38 -0
  72. package/dist/to/common-to-impl.js +553 -0
  73. package/dist/to/index-types.d.ts +50 -0
  74. package/dist/to/index-types.js +2 -0
  75. package/dist/to/index.d.ts +2 -0
  76. package/dist/to/index.js +18 -0
  77. package/package.json +53 -0
@@ -0,0 +1,23 @@
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("./common-error-impl"), exports);
19
+ __exportStar(require("./exception"), exports);
20
+ __exportStar(require("./caused-exception"), exports);
21
+ __exportStar(require("./developer-exception"), exports);
22
+ __exportStar(require("./assertion-exception"), exports);
23
+ __exportStar(require("./multiple-exception"), exports);
@@ -0,0 +1,8 @@
1
+ import { ExceptionLike } from "./index-types";
2
+ import { Exception } from "./exception";
3
+ export declare class MultipleException extends Exception {
4
+ protected _errors: Array<ExceptionLike>;
5
+ constructor(...errors: Array<Error>);
6
+ push(...errors: Array<Error>): this;
7
+ get errors(): Array<ExceptionLike>;
8
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MultipleException = void 0;
4
+ const exception_1 = require("./exception");
5
+ // noinspection Annotator
6
+ class MultipleException extends exception_1.Exception {
7
+ constructor(...errors) {
8
+ var _a;
9
+ const first = errors[0];
10
+ super((_a = first === null || first === void 0 ? void 0 : first.name) !== null && _a !== void 0 ? _a : "Multiple exceptions are occurred", {});
11
+ this._errors = [];
12
+ this.push(...errors);
13
+ }
14
+ push(...errors) {
15
+ errors.forEach(e => {
16
+ if (e instanceof MultipleException) {
17
+ this._errors.push(...e._errors);
18
+ }
19
+ else if (e instanceof exception_1.Exception) {
20
+ this._errors.push(e);
21
+ }
22
+ else {
23
+ this._errors.push(exception_1.Exception.$error.build(e));
24
+ }
25
+ });
26
+ return this;
27
+ }
28
+ // noinspection JSUnusedGlobalSymbols
29
+ get errors() {
30
+ return [...this._errors]; // cloned response
31
+ }
32
+ }
33
+ exports.MultipleException = MultipleException;
@@ -0,0 +1,7 @@
1
+ import { leyyo } from "./leyyo";
2
+ export * from './aliases';
3
+ export * from './constants';
4
+ export * from './literals';
5
+ declare const is: import("./is").CommonIs;
6
+ declare const callback: import("./callback").CommonCallback;
7
+ export { leyyo, is, callback };
package/dist/index.js ADDED
@@ -0,0 +1,26 @@
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
+ exports.callback = exports.is = exports.leyyo = void 0;
18
+ const leyyo_1 = require("./leyyo");
19
+ Object.defineProperty(exports, "leyyo", { enumerable: true, get: function () { return leyyo_1.leyyo; } });
20
+ __exportStar(require("./aliases"), exports);
21
+ __exportStar(require("./constants"), exports);
22
+ __exportStar(require("./literals"), exports);
23
+ const is = leyyo_1.leyyo.is;
24
+ exports.is = is;
25
+ const callback = leyyo_1.leyyo.callback;
26
+ exports.callback = callback;
@@ -0,0 +1 @@
1
+ export declare const FQN_PCK = "leyyo.common";
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FQN_PCK = void 0;
4
+ exports.FQN_PCK = 'leyyo.common';
@@ -0,0 +1,22 @@
1
+ import { CommonIs, CommonIsSecure } from "./index-types";
2
+ import { Leyyo } from "../leyyo";
3
+ export declare class CommonIsImpl implements CommonIs, CommonIsSecure {
4
+ $init(leyyo: Leyyo): void;
5
+ empty(value: unknown): boolean;
6
+ primitive(value: unknown): boolean;
7
+ value(value: unknown): boolean;
8
+ key(value: unknown): boolean;
9
+ object(value: unknown): boolean;
10
+ array(value: unknown): boolean;
11
+ func(value: unknown): boolean;
12
+ number(value: unknown): boolean;
13
+ integer(value: unknown): boolean;
14
+ string(value: unknown): boolean;
15
+ text(value: unknown): boolean;
16
+ clazz(value: unknown): boolean;
17
+ boolean(value: unknown): boolean;
18
+ true(value: unknown): boolean;
19
+ false(value: unknown): boolean;
20
+ get $back(): CommonIs;
21
+ get $secure(): CommonIsSecure;
22
+ }
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CommonIsImpl = void 0;
4
+ const literals_1 = require("../literals");
5
+ // noinspection JSUnusedGlobalSymbols, JSUnusedLocalSymbols
6
+ class CommonIsImpl {
7
+ $init(leyyo) {
8
+ }
9
+ // region is
10
+ empty(value) {
11
+ return (value === undefined || value === null);
12
+ }
13
+ primitive(value) {
14
+ return literals_1.PrimitiveItems.includes((typeof value));
15
+ }
16
+ value(value) {
17
+ return literals_1.RealValueItems.includes((typeof value));
18
+ }
19
+ key(value) {
20
+ return literals_1.KeyValueItems.includes((typeof value));
21
+ }
22
+ object(value) {
23
+ return value && typeof value === 'object' && !Array.isArray(value);
24
+ }
25
+ array(value) {
26
+ return value && typeof value === 'object' && Array.isArray(value);
27
+ }
28
+ func(value) {
29
+ return typeof value === 'function';
30
+ }
31
+ number(value) {
32
+ return (typeof value === 'number') && !isNaN(value) && isFinite(value);
33
+ }
34
+ integer(value) {
35
+ return this.number(value) && Number.isSafeInteger(value);
36
+ }
37
+ string(value) {
38
+ return typeof value === 'string';
39
+ }
40
+ text(value) {
41
+ return this.string(value) && value.trim() !== '';
42
+ }
43
+ clazz(value) {
44
+ return this.text(value) || this.func(value) || this.object(value);
45
+ }
46
+ boolean(value) {
47
+ return (typeof value === 'boolean');
48
+ }
49
+ true(value) {
50
+ return (value === true) ||
51
+ (this.text(value) && literals_1.WeakTrueItems.includes(value.toLowerCase())) ||
52
+ (this.number(value) && value > 0);
53
+ }
54
+ false(value) {
55
+ return (value === false) ||
56
+ (this.text(value) && literals_1.WeakFalseItems.includes(value.toLowerCase())) ||
57
+ (this.number(value) && value <= 0);
58
+ }
59
+ get $back() {
60
+ return this;
61
+ }
62
+ get $secure() {
63
+ return this;
64
+ }
65
+ }
66
+ exports.CommonIsImpl = CommonIsImpl;
@@ -0,0 +1,22 @@
1
+ import { ShiftMain, ShiftSecure } from "../aliases";
2
+ import { Leyyo } from "../leyyo";
3
+ export interface CommonIs extends ShiftSecure<CommonIsSecure> {
4
+ empty(value: unknown): boolean;
5
+ primitive(value: unknown): boolean;
6
+ value(value: unknown): boolean;
7
+ key(value: unknown): boolean;
8
+ object(value: unknown): boolean;
9
+ array(value: unknown): boolean;
10
+ func(value: unknown): boolean;
11
+ number(value: unknown): boolean;
12
+ integer(value: unknown): boolean;
13
+ string(value: unknown): boolean;
14
+ text(value: unknown): boolean;
15
+ clazz(value: unknown): boolean;
16
+ boolean(value: unknown): boolean;
17
+ true(value: unknown): boolean;
18
+ false(value: unknown): boolean;
19
+ }
20
+ export interface CommonIsSecure extends ShiftMain<CommonIs> {
21
+ $init(leyyo: Leyyo): void;
22
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from './index-types';
2
+ export * from './common-is-impl';
@@ -0,0 +1,18 @@
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("./common-is-impl"), exports);
@@ -0,0 +1,16 @@
1
+ import { CommonCallback } from "../callback";
2
+ import { CommonIs } from "../is";
3
+ import { CommonAssertion } from "../assertion";
4
+ import { CommonError } from "../error";
5
+ import { CommonLog } from "../log";
6
+ import { CommonStorage } from "../storage";
7
+ import { CommonTo } from "../to";
8
+ export interface Leyyo {
9
+ readonly is: CommonIs;
10
+ readonly callback: CommonCallback;
11
+ readonly assertion: CommonAssertion;
12
+ readonly error: CommonError;
13
+ readonly log: CommonLog;
14
+ readonly storage: CommonStorage;
15
+ readonly to: CommonTo;
16
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from './index-types';
2
+ export * from './leyyo-impl';
@@ -0,0 +1,18 @@
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-impl"), exports);
@@ -0,0 +1,24 @@
1
+ import { CommonCallback } from "../callback";
2
+ import { Leyyo } from "./index-types";
3
+ import { CommonIs } from "../is";
4
+ import { CommonAssertion } from "../assertion";
5
+ import { CommonError } from "../error";
6
+ import { CommonLog } from "../log";
7
+ import { CommonStorage } from "../storage";
8
+ import { CommonTo } from "../to";
9
+ export declare class LeyyoImpl implements Leyyo {
10
+ readonly callback: CommonCallback;
11
+ readonly is: CommonIs;
12
+ readonly assertion: CommonAssertion;
13
+ readonly error: CommonError;
14
+ readonly log: CommonLog;
15
+ readonly storage: CommonStorage;
16
+ readonly to: CommonTo;
17
+ constructor();
18
+ private init;
19
+ private postInit;
20
+ private initFqnRegister;
21
+ private initErrorRegister;
22
+ private initEnumRegister;
23
+ }
24
+ export declare const leyyo: Leyyo;
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.leyyo = exports.LeyyoImpl = void 0;
4
+ const callback_1 = require("../callback");
5
+ const is_1 = require("../is");
6
+ const assertion_1 = require("../assertion");
7
+ const error_1 = require("../error");
8
+ const log_1 = require("../log");
9
+ const storage_1 = require("../storage");
10
+ const to_1 = require("../to");
11
+ const constants_1 = require("../constants");
12
+ const internal_1 = require("../internal");
13
+ const literals_1 = require("../literals");
14
+ class LeyyoImpl {
15
+ constructor() {
16
+ this.is = new is_1.CommonIsImpl();
17
+ this.storage = new storage_1.CommonStorageImpl();
18
+ this.callback = new callback_1.CommonCallbackImpl(); // storage
19
+ this.log = new log_1.CommonLogImpl(); // callback
20
+ this.error = new error_1.CommonErrorImpl(); // callback
21
+ this.assertion = new assertion_1.CommonAssertionImpl(); // is, callback
22
+ this.to = new to_1.CommonToImpl(); // is, callback, assertion
23
+ this.init();
24
+ this.postInit();
25
+ this.initFqnRegister();
26
+ this.initErrorRegister();
27
+ this.initEnumRegister();
28
+ }
29
+ init() {
30
+ this.is.$secure.$init(this);
31
+ this.storage.$secure.$init(this);
32
+ this.callback.$secure.$init(this);
33
+ this.log.$secure.$init(this);
34
+ this.error.$secure.$init(this);
35
+ this.assertion.$secure.$init(this);
36
+ this.to.$secure.$init(this);
37
+ }
38
+ postInit() {
39
+ (0, assertion_1.$$setLeyyo)(this);
40
+ log_1.LoggerImpl.$setLeyyo(this);
41
+ error_1.Exception.$setLeyyo(this);
42
+ }
43
+ initFqnRegister() {
44
+ this.callback.queueForCallback(constants_1.LY_PENDING_FQN_REGISTER, is_1.CommonIsImpl, 'class', internal_1.FQN_PCK);
45
+ this.callback.queueForCallback(constants_1.LY_PENDING_FQN_REGISTER, storage_1.CommonStorageImpl, 'class', internal_1.FQN_PCK);
46
+ this.callback.queueForCallback(constants_1.LY_PENDING_FQN_REGISTER, callback_1.CommonCallbackImpl, 'class', internal_1.FQN_PCK);
47
+ this.callback.queueForCallback(constants_1.LY_PENDING_FQN_REGISTER, log_1.CommonLogImpl, 'class', internal_1.FQN_PCK);
48
+ this.callback.queueForCallback(constants_1.LY_PENDING_FQN_REGISTER, error_1.CommonErrorImpl, 'class', internal_1.FQN_PCK);
49
+ this.callback.queueForCallback(constants_1.LY_PENDING_FQN_REGISTER, assertion_1.CommonAssertionImpl, 'class', internal_1.FQN_PCK);
50
+ this.callback.queueForCallback(constants_1.LY_PENDING_FQN_REGISTER, to_1.CommonToImpl, 'class', internal_1.FQN_PCK);
51
+ this.callback.queueForCallback(constants_1.LY_PENDING_FQN_REGISTER, storage_1.List, 'class', internal_1.FQN_PCK);
52
+ this.callback.queueForCallback(constants_1.LY_PENDING_FQN_REGISTER, log_1.LoggerImpl, 'class', internal_1.FQN_PCK);
53
+ this.callback.queueForCallback(constants_1.LY_PENDING_FQN_REGISTER, assertion_1.assert, 'function', internal_1.FQN_PCK);
54
+ }
55
+ initErrorRegister() {
56
+ [error_1.Exception, error_1.AssertionException, error_1.CausedException, error_1.DeveloperException, error_1.MultipleException].forEach(cls => {
57
+ this.callback.queueForCallback(constants_1.LY_PENDING_FQN_REGISTER, cls, 'class', internal_1.FQN_PCK);
58
+ this.callback.queueForCallback(constants_1.LY_PENDING_ERROR_REGISTER, cls);
59
+ });
60
+ }
61
+ initEnumRegister() {
62
+ [literals_1.PrimitiveItems, literals_1.RealValueItems, literals_1.KeyValueItems, literals_1.WeakTrueItems, literals_1.WeakFalseItems,
63
+ literals_1.HttpMethodItems, literals_1.HttpPlaceItems, literals_1.SeverityItems, literals_1.EnvironmentItems,
64
+ literals_1.CountryCodeItems, literals_1.LanguageCodeItems, literals_1.LocaleCodeItems].forEach(enm => {
65
+ this.callback.queueForCallback(constants_1.LY_PENDING_FQN_REGISTER, enm, 'enum', internal_1.FQN_PCK);
66
+ this.callback.queueForCallback(constants_1.LY_PENDING_ENUM_REGISTER, enm);
67
+ });
68
+ }
69
+ }
70
+ exports.LeyyoImpl = LeyyoImpl;
71
+ exports.leyyo = new LeyyoImpl();
@@ -0,0 +1,98 @@
1
+ /**
2
+ * Weak True items
3
+ * */
4
+ export declare const PrimitiveItems: readonly ["string", "number", "bigint", "boolean"];
5
+ /**
6
+ * Weak True
7
+ * */
8
+ export type Primitive = typeof PrimitiveItems[number];
9
+ /**
10
+ * Weak True items
11
+ * */
12
+ export declare const RealValueItems: readonly ["string", "number", "bigint", "boolean", "object", "function"];
13
+ /**
14
+ * Weak True
15
+ * */
16
+ export type RealValue = typeof RealValueItems[number];
17
+ /**
18
+ * Weak True items
19
+ * */
20
+ export declare const KeyValueItems: readonly ["string", "number"];
21
+ /**
22
+ * Weak True items
23
+ * */
24
+ export declare const WeakTrueItems: readonly ["1", "true", "t", "yes", "y", "on"];
25
+ /**
26
+ * Weak True
27
+ * */
28
+ export type WeakTrue = typeof WeakTrueItems[number];
29
+ /**
30
+ * Weak False items
31
+ * */
32
+ export declare const WeakFalseItems: readonly ["0", "-1", "false", "f", "no", "n", "off"];
33
+ /**
34
+ * Weak False
35
+ * */
36
+ export type WeakFalse = typeof WeakFalseItems[number];
37
+ /**
38
+ * Weak Boolean
39
+ * */
40
+ export type WeakBoolean = WeakTrue & WeakFalse;
41
+ /**
42
+ * Http Method items
43
+ * */
44
+ export declare const HttpMethodItems: readonly ["delete", "get", "head", "link", "options", "patch", "post", "purge", "put", "unlink"];
45
+ /**
46
+ * Http Method
47
+ * */
48
+ export type HttpMethod = typeof HttpMethodItems[number];
49
+ /**
50
+ * Http Place items
51
+ * */
52
+ export declare const HttpPlaceItems: readonly ["query", "body", "header", "path"];
53
+ /**
54
+ * Http Place
55
+ * */
56
+ export type HttpPlace = typeof HttpPlaceItems[number];
57
+ /**
58
+ * Severity items
59
+ * */
60
+ export declare const SeverityItems: readonly ["debug", "error", "fatal", "info", "log", "trace", "warn"];
61
+ /**
62
+ * Severity for log and errors
63
+ * */
64
+ export type Severity = typeof SeverityItems[number];
65
+ /**
66
+ * Environment items
67
+ * */
68
+ export declare const EnvironmentItems: readonly ["automation", "development", "local", "production", "staging", "test"];
69
+ /**
70
+ * Environment
71
+ * */
72
+ export type Environment = typeof EnvironmentItems[number];
73
+ /**
74
+ * Country code items
75
+ * */
76
+ export declare const CountryCodeItems: readonly ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AN", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BM", "BN", "BO", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CS", "CU", "CV", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "ST", "SV", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "YE", "YT", "ZA", "ZM", "ZW"];
77
+ /**
78
+ * Country code
79
+ * */
80
+ export type CountryCode = typeof CountryCodeItems[number];
81
+ /**
82
+ * Language code items
83
+ * */
84
+ export declare const LanguageCodeItems: readonly ["af", "an", "ar", "as", "ast", "az", "be", "bg", "bn", "br", "bs", "ca", "ce", "ch", "co", "cr", "cs", "cv", "cy", "da", "de", "el", "en", "eo", "es", "et", "eu", "fa", "fi", "fj", "fo", "fr", "fur", "fy", "ga", "gd", "gl", "gu", "he", "hi", "hr", "hsb", "ht", "hu", "hy", "id", "is", "it", "iu", "ja", "ji", "ka", "kk", "km", "kn", "ko", "ks", "ky", "la", "lb", "lt", "lv", "mi", "mk", "ml", "mo", "mr", "ms", "mt", "my", "nb", "ne", "ng", "nl", "nn", "no", "nv", "oc", "om", "or", "pa", "pl", "pt", "qu", "rm", "ro", "ru", "sa", "sb", "sc", "sd", "sg", "si", "sk", "sl", "so", "sq", "sr", "sv", "sw", "sx", "sz", "ta", "te", "th", "tig", "tk", "tlh", "tn", "tr", "ts", "tt", "uk", "ur", "ve", "vi", "vo", "wa", "xh", "zh", "zu"];
85
+ /**
86
+ * Language codes
87
+ * */
88
+ export type LanguageCode = typeof LanguageCodeItems[number];
89
+ /**
90
+ * Locale code items
91
+ * */
92
+ export declare const LocaleCodeItems: readonly ["af", "an", "ar", "ar-ae", "ar-bh", "ar-dz", "ar-eg", "ar-iq", "ar-jo", "ar-kw", "ar-lb", "ar-ly", "ar-ma", "ar-om", "ar-qa", "ar-sa", "ar-sy", "ar-tn", "ar-ye", "as", "ast", "az", "be", "bg", "bn", "br", "bs", "ca", "ce", "ch", "co", "cr", "cs", "cv", "cy", "da", "de", "de-at", "de-ch", "de-de", "de-li", "de-lu", "el", "en", "en-au", "en-bz", "en-ca", "en-gb", "en-ie", "en-jm", "en-nz", "en-ph", "en-tt", "en-us", "en-za", "en-zw", "eo", "es", "es-ar", "es-bo", "es-cl", "es-co", "es-cr", "es-do", "es-ec", "es-es", "es-gt", "es-hn", "es-mx", "es-ni", "es-pa", "es-pe", "es-pr", "es-py", "es-sv", "es-uy", "es-ve", "et", "eu", "fa", "fa-ir", "fi", "fj", "fo", "fr", "fr-be", "fr-ca", "fr-ch", "fr-fr", "fr-lu", "fr-mc", "fur", "fy", "ga", "gd", "gd-ie", "gl", "gu", "he", "hi", "hr", "hsb", "ht", "hu", "hy", "id", "is", "it", "it-ch", "iu", "ja", "ji", "ka", "kk", "km", "kn", "ko", "ko-kp", "ko-kr", "ks", "ky", "la", "lb", "lt", "lv", "mi", "mk", "ml", "mo", "mr", "ms", "mt", "my", "nb", "ne", "ng", "nl", "nl-be", "nn", "no", "nv", "oc", "om", "or", "pa", "pa-in", "pa-pk", "pl", "pt", "pt-br", "qu", "rm", "ro", "ro-mo", "ru", "ru-mo", "sa", "sb", "sc", "sd", "sg", "si", "sk", "sl", "so", "sq", "sr", "sv", "sv-fi", "sv-sv", "sw", "sx", "sz", "ta", "te", "th", "tig", "tk", "tlh", "tn", "tr", "ts", "tt", "uk", "ur", "ve", "vi", "vo", "wa", "xh", "zh", "zh-cn", "zh-hk", "zh-sg", "zh-tw", "zu"];
93
+ /**
94
+ * Locale codes
95
+ *
96
+ * Pattern: [Language Code]-[Country Code]
97
+ * */
98
+ export type LocaleCode = typeof LocaleCodeItems[number];
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ // noinspection JSUnusedGlobalSymbols
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.LocaleCodeItems = exports.LanguageCodeItems = exports.CountryCodeItems = exports.EnvironmentItems = exports.SeverityItems = exports.HttpPlaceItems = exports.HttpMethodItems = exports.WeakFalseItems = exports.WeakTrueItems = exports.KeyValueItems = exports.RealValueItems = exports.PrimitiveItems = void 0;
5
+ /**
6
+ * Weak True items
7
+ * */
8
+ exports.PrimitiveItems = ['string', 'number', 'bigint', 'boolean'];
9
+ /**
10
+ * Weak True items
11
+ * */
12
+ exports.RealValueItems = ['string', 'number', 'bigint', 'boolean', 'object', 'function'];
13
+ /**
14
+ * Weak True items
15
+ * */
16
+ exports.KeyValueItems = ['string', 'number'];
17
+ /**
18
+ * Weak True items
19
+ * */
20
+ exports.WeakTrueItems = ['1', 'true', 't', 'yes', 'y', 'on'];
21
+ /**
22
+ * Weak False items
23
+ * */
24
+ exports.WeakFalseItems = ['0', '-1', 'false', 'f', 'no', 'n', 'off'];
25
+ /**
26
+ * Http Method items
27
+ * */
28
+ exports.HttpMethodItems = ['delete', 'get', 'head', 'link', 'options', 'patch', 'post', 'purge', 'put', 'unlink'];
29
+ /**
30
+ * Http Place items
31
+ * */
32
+ exports.HttpPlaceItems = ['query', 'body', 'header', 'path'];
33
+ /**
34
+ * Severity items
35
+ * */
36
+ exports.SeverityItems = ['debug', 'error', 'fatal', 'info', 'log', 'trace', 'warn'];
37
+ /**
38
+ * Environment items
39
+ * */
40
+ exports.EnvironmentItems = ['automation', 'development', 'local', 'production', 'staging', 'test'];
41
+ /**
42
+ * Country code items
43
+ * */
44
+ exports.CountryCodeItems = ['AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AN', 'AO', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AW', 'AX',
45
+ 'AZ', 'BA', 'BB', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BM', 'BN', 'BO', 'BR', 'BS', 'BT', 'BV', 'BW', 'BY', 'BZ', 'CA', 'CC', 'CD',
46
+ 'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR', 'CS', 'CU', 'CV', 'CX', 'CY', 'CZ', 'DE', 'DJ', 'DK', 'DM', 'DO', 'DZ', 'EC',
47
+ 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'FI', 'FJ', 'FK', 'FM', 'FO', 'FR', 'GA', 'GB', 'GD', 'GE', 'GF', 'GG', 'GH', 'GI', 'GL', 'GM', 'GN',
48
+ 'GP', 'GQ', 'GR', 'GS', 'GT', 'GU', 'GW', 'GY', 'HK', 'HM', 'HN', 'HR', 'HT', 'HU', 'ID', 'IE', 'IL', 'IM', 'IN', 'IO', 'IQ', 'IR', 'IS',
49
+ 'IT', 'JE', 'JM', 'JO', 'JP', 'KE', 'KG', 'KH', 'KI', 'KM', 'KN', 'KP', 'KR', 'KW', 'KY', 'KZ', 'LA', 'LB', 'LC', 'LI', 'LK', 'LR', 'LS',
50
+ 'LT', 'LU', 'LV', 'LY', 'MA', 'MC', 'MD', 'MG', 'MH', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS', 'MT', 'MU', 'MV', 'MW', 'MX',
51
+ 'MY', 'MZ', 'NA', 'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU', 'NZ', 'OM', 'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM',
52
+ 'PN', 'PR', 'PS', 'PT', 'PW', 'PY', 'QA', 'RE', 'RO', 'RU', 'RW', 'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SJ', 'SK', 'SL', 'SM',
53
+ 'SN', 'SO', 'SR', 'ST', 'SV', 'SY', 'SZ', 'TC', 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ',
54
+ 'UA', 'UG', 'UM', 'US', 'UY', 'UZ', 'VA', 'VC', 'VE', 'VG', 'VI', 'VN', 'VU', 'WF', 'WS', 'YE', 'YT', 'ZA', 'ZM', 'ZW'];
55
+ /**
56
+ * Language code items
57
+ * */
58
+ exports.LanguageCodeItems = ['af', 'an', 'ar', 'as', 'ast', 'az', 'be', 'bg', 'bn', 'br', 'bs', 'ca', 'ce', 'ch', 'co', 'cr', 'cs',
59
+ 'cv', 'cy', 'da', 'de', 'el', 'en', 'eo', 'es', 'et', 'eu', 'fa', 'fi', 'fj', 'fo', 'fr', 'fur', 'fy', 'ga', 'gd', 'gl', 'gu', 'he', 'hi',
60
+ 'hr', 'hsb', 'ht', 'hu', 'hy', 'id', 'is', 'it', 'iu', 'ja', 'ji', 'ka', 'kk', 'km', 'kn', 'ko', 'ks', 'ky', 'la', 'lb', 'lt', 'lv', 'mi',
61
+ 'mk', 'ml', 'mo', 'mr', 'ms', 'mt', 'my', 'nb', 'ne', 'ng', 'nl', 'nn', 'no', 'nv', 'oc', 'om', 'or', 'pa', 'pl', 'pt', 'qu', 'rm', 'ro',
62
+ 'ru', 'sa', 'sb', 'sc', 'sd', 'sg', 'si', 'sk', 'sl', 'so', 'sq', 'sr', 'sv', 'sw', 'sx', 'sz', 'ta', 'te', 'th', 'tig', 'tk', 'tlh',
63
+ 'tn', 'tr', 'ts', 'tt', 'uk', 'ur', 've', 'vi', 'vo', 'wa', 'xh', 'zh', 'zu'];
64
+ /**
65
+ * Locale code items
66
+ * */
67
+ exports.LocaleCodeItems = ['af', 'an', 'ar', 'ar-ae', 'ar-bh', 'ar-dz', 'ar-eg', 'ar-iq', 'ar-jo', 'ar-kw', 'ar-lb', 'ar-ly',
68
+ 'ar-ma', 'ar-om', 'ar-qa', 'ar-sa', 'ar-sy', 'ar-tn', 'ar-ye', 'as', 'ast', 'az', 'be', 'bg', 'bn', 'br', 'bs', 'ca', 'ce', 'ch',
69
+ 'co', 'cr', 'cs', 'cv', 'cy', 'da', 'de', 'de-at', 'de-ch', 'de-de', 'de-li', 'de-lu', 'el', 'en', 'en-au', 'en-bz', 'en-ca',
70
+ 'en-gb', 'en-ie', 'en-jm', 'en-nz', 'en-ph', 'en-tt', 'en-us', 'en-za', 'en-zw', 'eo', 'es', 'es-ar', 'es-bo', 'es-cl', 'es-co',
71
+ 'es-cr', 'es-do', 'es-ec', 'es-es', 'es-gt', 'es-hn', 'es-mx', 'es-ni', 'es-pa', 'es-pe', 'es-pr', 'es-py', 'es-sv', 'es-uy',
72
+ 'es-ve', 'et', 'eu', 'fa', 'fa-ir', 'fi', 'fj', 'fo', 'fr', 'fr-be', 'fr-ca', 'fr-ch', 'fr-fr', 'fr-lu', 'fr-mc', 'fur', 'fy', 'ga',
73
+ 'gd', 'gd-ie', 'gl', 'gu', 'he', 'hi', 'hr', 'hsb', 'ht', 'hu', 'hy', 'id', 'is', 'it', 'it-ch', 'iu', 'ja', 'ji', 'ka', 'kk', 'km',
74
+ 'kn', 'ko', 'ko-kp', 'ko-kr', 'ks', 'ky', 'la', 'lb', 'lt', 'lv', 'mi', 'mk', 'ml', 'mo', 'mr', 'ms', 'mt', 'my', 'nb', 'ne', 'ng', 'nl',
75
+ 'nl-be', 'nn', 'no', 'nv', 'oc', 'om', 'or', 'pa', 'pa-in', 'pa-pk', 'pl', 'pt', 'pt-br', 'qu', 'rm', 'ro', 'ro-mo', 'ru', 'ru-mo',
76
+ 'sa', 'sb', 'sc', 'sd', 'sg', 'si', 'sk', 'sl', 'so', 'sq', 'sr', 'sv', 'sv-fi', 'sv-sv', 'sw', 'sx', 'sz', 'ta', 'te', 'th', 'tig',
77
+ 'tk', 'tlh', 'tn', 'tr', 'ts', 'tt', 'uk', 'ur', 've', 'vi', 'vo', 'wa', 'xh', 'zh', 'zh-cn', 'zh-hk', 'zh-sg', 'zh-tw', 'zu'];
@@ -0,0 +1,13 @@
1
+ import { Leyyo } from "../leyyo";
2
+ import { CommonLog, CommonLogSecure, Logger, LogLine } from "./index-types";
3
+ export declare class CommonLogImpl implements CommonLog, CommonLogSecure {
4
+ private callback;
5
+ constructor();
6
+ get $secure(): CommonLogSecure;
7
+ $init(leyyo: Leyyo): void;
8
+ create(clazz: Object | Function | string): Logger;
9
+ apply(line: LogLine): void;
10
+ private check;
11
+ private print;
12
+ get $back(): CommonLog;
13
+ }