@venizia/ignis-inversion 0.2.0-3 → 0.2.0-5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/common/index.d.ts +1 -0
- package/dist/cjs/common/index.d.ts.map +1 -1
- package/dist/cjs/common/index.js +1 -0
- package/dist/cjs/common/index.js.map +1 -1
- package/dist/cjs/common/types.d.ts +0 -2
- package/dist/cjs/common/types.d.ts.map +1 -1
- package/dist/cjs/common/types.js +0 -9
- package/dist/cjs/common/types.js.map +1 -1
- package/dist/cjs/common/utilities.d.ts +4 -0
- package/dist/cjs/common/utilities.d.ts.map +1 -0
- package/dist/cjs/common/utilities.js +12 -0
- package/dist/cjs/common/utilities.js.map +1 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +6 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/modules/error/app-error.d.ts +1 -1
- package/dist/cjs/modules/error/app-error.d.ts.map +1 -1
- package/dist/cjs/modules/error/common/index.d.ts +2 -0
- package/dist/cjs/modules/error/common/index.d.ts.map +1 -0
- package/dist/cjs/modules/error/common/index.js +18 -0
- package/dist/cjs/modules/error/common/index.js.map +1 -0
- package/dist/cjs/modules/error/{types.d.ts → common/types.d.ts} +1 -1
- package/dist/cjs/modules/error/common/types.d.ts.map +1 -0
- package/dist/cjs/modules/error/common/types.js.map +1 -0
- package/dist/cjs/modules/error/index.d.ts +1 -1
- package/dist/cjs/modules/error/index.d.ts.map +1 -1
- package/dist/cjs/modules/error/index.js +1 -1
- package/dist/cjs/modules/error/index.js.map +1 -1
- package/dist/cjs/modules/error/message-code.d.ts +12 -0
- package/dist/cjs/modules/error/message-code.d.ts.map +1 -1
- package/dist/cjs/modules/error/message-code.js +12 -3
- package/dist/cjs/modules/error/message-code.js.map +1 -1
- package/dist/cjs/modules/metadata/injectors.d.ts +1 -1
- package/dist/cjs/modules/metadata/injectors.js +2 -2
- package/dist/esm/common/index.d.ts +1 -0
- package/dist/esm/common/index.d.ts.map +1 -1
- package/dist/esm/common/index.js +1 -0
- package/dist/esm/common/index.js.map +1 -1
- package/dist/esm/common/types.d.ts +0 -2
- package/dist/esm/common/types.d.ts.map +1 -1
- package/dist/esm/common/types.js +1 -7
- package/dist/esm/common/types.js.map +1 -1
- package/dist/esm/common/utilities.d.ts +4 -0
- package/dist/esm/common/utilities.d.ts.map +1 -0
- package/dist/esm/common/utilities.js +8 -0
- package/dist/esm/common/utilities.js.map +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +6 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/modules/error/app-error.d.ts +1 -1
- package/dist/esm/modules/error/app-error.d.ts.map +1 -1
- package/dist/esm/modules/error/common/index.d.ts +2 -0
- package/dist/esm/modules/error/common/index.d.ts.map +1 -0
- package/dist/esm/modules/error/common/index.js +2 -0
- package/dist/esm/modules/error/common/index.js.map +1 -0
- package/dist/esm/modules/error/{types.d.ts → common/types.d.ts} +1 -1
- package/dist/esm/modules/error/common/types.d.ts.map +1 -0
- package/dist/esm/modules/error/common/types.js.map +1 -0
- package/dist/esm/modules/error/index.d.ts +1 -1
- package/dist/esm/modules/error/index.d.ts.map +1 -1
- package/dist/esm/modules/error/index.js +1 -1
- package/dist/esm/modules/error/index.js.map +1 -1
- package/dist/esm/modules/error/message-code.d.ts +12 -0
- package/dist/esm/modules/error/message-code.d.ts.map +1 -1
- package/dist/esm/modules/error/message-code.js +12 -3
- package/dist/esm/modules/error/message-code.js.map +1 -1
- package/dist/esm/modules/metadata/injectors.d.ts +1 -1
- package/dist/esm/modules/metadata/injectors.js +2 -2
- package/package.json +7 -8
- package/dist/cjs/modules/error/types.d.ts.map +0 -1
- package/dist/cjs/modules/error/types.js.map +0 -1
- package/dist/esm/modules/error/types.d.ts.map +0 -1
- package/dist/esm/modules/error/types.js.map +0 -1
- /package/dist/cjs/modules/error/{types.js → common/types.js} +0 -0
- /package/dist/esm/modules/error/{types.js → common/types.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}
|
package/dist/cjs/common/index.js
CHANGED
|
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./base-helper"), exports);
|
|
18
18
|
__exportStar(require("./logger"), exports);
|
|
19
19
|
__exportStar(require("./types"), exports);
|
|
20
|
+
__exportStar(require("./utilities"), exports);
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,2CAAyB;AACzB,0CAAwB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B"}
|
|
@@ -9,8 +9,6 @@ export type TClass<T> = TConstructor<T> & {
|
|
|
9
9
|
};
|
|
10
10
|
export type TConstValue<T extends TClass<any>> = Extract<ValueOf<T>, string | number>;
|
|
11
11
|
export type TBindingKey = string | symbol;
|
|
12
|
-
/** Tells a CONSTRUCTOR from a RESOLVER via source text - `prototype !== undefined` is true of every non-arrow function. Sound only on ES2020+ output (classes emit as `class`); ES5 bundling breaks it. */
|
|
13
|
-
export declare const isClass: <T>(target: any) => target is TClass<T>;
|
|
14
12
|
export interface IBindingTag {
|
|
15
13
|
[name: string]: any;
|
|
16
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/common/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC;AAEhD,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAC/C,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAEpC,MAAM,MAAM,OAAO,GAAG,GAAG,CAAC;AAE1B,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AACxD,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AACzE,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG;IAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAC;AAEtE,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAEtF,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,CAAC;AAE1C,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/common/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC;AAEhD,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAC/C,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAEpC,MAAM,MAAM,OAAO,GAAG,GAAG,CAAC;AAE1B,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AACxD,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AACzE,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG;IAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAC;AAEtE,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAEtF,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,CAAC;AAE1C,MAAM,WAAW,WAAW;IAC1B,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC;CACrB"}
|
package/dist/cjs/common/types.js
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isClass = void 0;
|
|
4
|
-
/** Tells a CONSTRUCTOR from a RESOLVER via source text - `prototype !== undefined` is true of every non-arrow function. Sound only on ES2020+ output (classes emit as `class`); ES5 bundling breaks it. */
|
|
5
|
-
const isClass = (target) => {
|
|
6
|
-
if (typeof target !== 'function' || target.prototype === undefined) {
|
|
7
|
-
return false;
|
|
8
|
-
}
|
|
9
|
-
return /^class[\s{]/.test(Function.prototype.toString.call(target));
|
|
10
|
-
};
|
|
11
|
-
exports.isClass = isClass;
|
|
12
3
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/common/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/common/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { TClass } from './types';
|
|
2
|
+
/** Tells a CONSTRUCTOR from a RESOLVER via source text - `prototype !== undefined` is true of every non-arrow function. Sound only on ES2020+ output (classes emit as `class`); ES5 bundling breaks it. */
|
|
3
|
+
export declare const isClass: <T>(target: any) => target is TClass<T>;
|
|
4
|
+
//# sourceMappingURL=utilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../../src/common/utilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC,2MAA2M;AAC3M,eAAO,MAAM,OAAO,GAAI,CAAC,EAAE,QAAQ,GAAG,KAAG,MAAM,IAAI,MAAM,CAAC,CAAC,CAM1D,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isClass = void 0;
|
|
4
|
+
/** Tells a CONSTRUCTOR from a RESOLVER via source text - `prototype !== undefined` is true of every non-arrow function. Sound only on ES2020+ output (classes emit as `class`); ES5 bundling breaks it. */
|
|
5
|
+
const isClass = (target) => {
|
|
6
|
+
if (typeof target !== 'function' || target.prototype === undefined) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
return /^class[\s{]/.test(Function.prototype.toString.call(target));
|
|
10
|
+
};
|
|
11
|
+
exports.isClass = isClass;
|
|
12
|
+
//# sourceMappingURL=utilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utilities.js","sourceRoot":"","sources":["../../../src/common/utilities.ts"],"names":[],"mappings":";;;AAEA,2MAA2M;AACpM,MAAM,OAAO,GAAG,CAAI,MAAW,EAAuB,EAAE;IAC7D,IAAI,OAAO,MAAM,KAAK,UAAU,IAAI,MAAM,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;QACnE,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AACtE,CAAC,CAAC;AANW,QAAA,OAAO,WAMlB"}
|
package/dist/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAI1B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -15,6 +15,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
require("reflect-metadata");
|
|
18
|
+
const app_error_1 = require("./modules/error/app-error");
|
|
19
|
+
const message_code_1 = require("./modules/error/message-code");
|
|
18
20
|
__exportStar(require("./common"), exports);
|
|
19
21
|
__exportStar(require("./modules"), exports);
|
|
22
|
+
// Lives in the package entry, the one module every consumer evaluates and the only one
|
|
23
|
+
// declared in `sideEffects`: a bundler keeps it, so MessageCode throws ApplicationError in a
|
|
24
|
+
// bundle too.
|
|
25
|
+
message_code_1.MessageCode.useErrorFactory({ factory: app_error_1.getError });
|
|
20
26
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4BAA0B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4BAA0B;AAC1B,yDAAqD;AACrD,+DAA2D;AAE3D,2CAAyB;AACzB,4CAA0B;AAE1B,uFAAuF;AACvF,6FAA6F;AAC7F,cAAc;AACd,0BAAW,CAAC,eAAe,CAAC,EAAE,OAAO,EAAE,oBAAQ,EAAE,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TError, TErrorLogLevel, TErrorNormalized, TResponsedError } from './
|
|
1
|
+
import type { TError, TErrorLogLevel, TErrorNormalized, TResponsedError } from './common';
|
|
2
2
|
export declare class ApplicationError extends Error {
|
|
3
3
|
statusCode: number;
|
|
4
4
|
normalized: TErrorNormalized;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-error.d.ts","sourceRoot":"","sources":["../../../../src/modules/error/app-error.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"app-error.d.ts","sourceRoot":"","sources":["../../../../src/modules/error/app-error.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAgB1F,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,gBAAgB,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC;gBAEvB,IAAI,EAAE,MAAM;IA2CxB,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM;IAI5B,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,eAAe,CAAA;KAAE,GAAG,gBAAgB;CAcrE;AAED,eAAO,MAAM,QAAQ,GAAI,MAAM,MAAM,KAAG,gBAAmD,CAAC;AAE5F,eAAO,MAAM,SAAS,GAAI,MAAM;IAAE,KAAK,EAAE,eAAe,CAAA;CAAE,KAAG,gBAC3B,CAAC;AAEnC,eAAO,MAAM,kBAAkB,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,gBAE5D,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/error/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
|
@@ -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("./types"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/error/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TErrorScope } from '
|
|
1
|
+
import type { TErrorScope } from '../definition';
|
|
2
2
|
/** Declared here, not imported from helpers' `TLogLevel` (browser-safe); a helpers guard pins them equal. */
|
|
3
3
|
export type TErrorLogLevel = 'error' | 'emerg' | 'warn' | 'info' | 'debug';
|
|
4
4
|
/** Resolved message a client renders. All fields always present - no null-checks downstream. */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/modules/error/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,6GAA6G;AAC7G,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3E,gGAAgG;AAChG,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B,CAAC;AAEF,4MAA4M;AAC5M,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC,CAAC;AAEF,uKAAuK;AACvK,MAAM,MAAM,kBAAkB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AM,EAAE,OAAO,CAAC,CAAC;IACtC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,SAAS,CAAC,EAAE,0BAA0B,CAAC;IACvC,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B,CAAC;AAEF,wMAAwM;AACxM,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG;IAC9C,KAAK,EAAE,gBAAgB,CAAC;IACxB,OAAO,CAAC,EAAE,qBAAqB,CAAC;IAChC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF,6LAA6L;AAC7L,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG;IACzC,OAAO,EAAE,aAAa,CAAC;IACvB,WAAW,CAAC,EAAE,SAAS,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;IAC1D,6JAA6J;IAC7J,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,kBAAkB,GAAG,aAAa,CAAC;AAExD,kMAAkM;AAClM,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,MAAM,CAC9E,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,EAC7B,IAAI,CACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/modules/error/common/types.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/error/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/error/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
|
|
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./app-error"), exports);
|
|
18
|
+
__exportStar(require("./common"), exports);
|
|
18
19
|
__exportStar(require("./definition"), exports);
|
|
19
20
|
__exportStar(require("./message-code"), exports);
|
|
20
|
-
__exportStar(require("./types"), exports);
|
|
21
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/error/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,+CAA6B;AAC7B,iDAA+B
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/error/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,2CAAyB;AACzB,+CAA6B;AAC7B,iDAA+B"}
|
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
import type { TNullable } from '../../common/types';
|
|
2
|
+
import type { TError } from './common';
|
|
3
|
+
type TErrorFactory = (opts: TError) => Error;
|
|
2
4
|
export declare class MessageCode {
|
|
3
5
|
static readonly SEPARATOR = ".";
|
|
4
6
|
static readonly SEGMENT_PATTERN: RegExp;
|
|
5
7
|
static readonly MIN_SEGMENTS = 2;
|
|
6
8
|
static readonly DEFAULT = "core.system_error";
|
|
9
|
+
private static errorFactory;
|
|
10
|
+
/**
|
|
11
|
+
* Registered by the package entry at module init; keeps the throws identical without a
|
|
12
|
+
* static import of app-error (that import was the cycle).
|
|
13
|
+
* @internal Framework wiring; consumers must not replace the factory.
|
|
14
|
+
*/
|
|
15
|
+
static useErrorFactory(opts: {
|
|
16
|
+
factory: TErrorFactory;
|
|
17
|
+
}): void;
|
|
7
18
|
/** Builds a code from its segments, throwing on a malformed one - codes are declared at module scope, so a bad code fails the process at import instead of shipping dead into production. */
|
|
8
19
|
static build(opts: {
|
|
9
20
|
parts: Array<string>;
|
|
@@ -13,4 +24,5 @@ export declare class MessageCode {
|
|
|
13
24
|
/** Normalizes an absent, empty or non-string code to {@link DEFAULT}. */
|
|
14
25
|
static resolve(code?: TNullable<string>): string;
|
|
15
26
|
}
|
|
27
|
+
export {};
|
|
16
28
|
//# sourceMappingURL=message-code.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-code.d.ts","sourceRoot":"","sources":["../../../../src/modules/error/message-code.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"message-code.d.ts","sourceRoot":"","sources":["../../../../src/modules/error/message-code.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,KAAK,aAAa,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,KAAK,CAAC;AAE7C,qBAAa,WAAW;IACtB,MAAM,CAAC,QAAQ,CAAC,SAAS,OAAO;IAChC,MAAM,CAAC,QAAQ,CAAC,eAAe,SAA8B;IAC7D,MAAM,CAAC,QAAQ,CAAC,YAAY,KAAK;IACjC,MAAM,CAAC,QAAQ,CAAC,OAAO,uBAAuB;IAG9C,OAAO,CAAC,MAAM,CAAC,YAAY,CACiE;IAE5F;;;;OAIG;IACH,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,aAAa,CAAA;KAAE,GAAG,IAAI;IAI9D,6LAA6L;IAC7L,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;KAAE,GAAG,MAAM;IAsBpD,iLAAiL;IACjL,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO;IAatC,yEAAyE;IACzE,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,GAAG,MAAM;CAKjD"}
|
|
@@ -1,24 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MessageCode = void 0;
|
|
4
|
-
const app_error_1 = require("./app-error");
|
|
5
4
|
class MessageCode {
|
|
6
5
|
static { this.SEPARATOR = '.'; }
|
|
7
6
|
static { this.SEGMENT_PATTERN = /^[a-z0-9]+(_[a-z0-9]+)*$/; }
|
|
8
7
|
static { this.MIN_SEGMENTS = 2; }
|
|
9
8
|
static { this.DEFAULT = 'core.system_error'; }
|
|
9
|
+
// The one permitted raw `new Error`, used only until `src/index.ts` registers `getError`.
|
|
10
|
+
static { this.errorFactory = opts => new Error(typeof opts.message === 'string' ? opts.message : JSON.stringify(opts.message)); }
|
|
11
|
+
/**
|
|
12
|
+
* Registered by the package entry at module init; keeps the throws identical without a
|
|
13
|
+
* static import of app-error (that import was the cycle).
|
|
14
|
+
* @internal Framework wiring; consumers must not replace the factory.
|
|
15
|
+
*/
|
|
16
|
+
static useErrorFactory(opts) {
|
|
17
|
+
this.errorFactory = opts.factory;
|
|
18
|
+
}
|
|
10
19
|
/** Builds a code from its segments, throwing on a malformed one - codes are declared at module scope, so a bad code fails the process at import instead of shipping dead into production. */
|
|
11
20
|
static build(opts) {
|
|
12
21
|
const { parts } = opts;
|
|
13
22
|
if (parts.length < this.MIN_SEGMENTS) {
|
|
14
|
-
throw
|
|
23
|
+
throw this.errorFactory({
|
|
15
24
|
messageCode: 'core.message_code.invalid_segment_count',
|
|
16
25
|
message: `[MessageCode][build] A code needs at least ${this.MIN_SEGMENTS} segments (namespace + reason) | Got: ${JSON.stringify(parts)}`,
|
|
17
26
|
});
|
|
18
27
|
}
|
|
19
28
|
for (const segment of parts) {
|
|
20
29
|
if (!this.SEGMENT_PATTERN.test(segment)) {
|
|
21
|
-
throw
|
|
30
|
+
throw this.errorFactory({
|
|
22
31
|
messageCode: 'core.message_code.invalid_segment_format',
|
|
23
32
|
message: `[MessageCode][build] Invalid segment '${segment}' | Expected lower snake_case (a-z, 0-9, '_') | Full: ${JSON.stringify(parts)}`,
|
|
24
33
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-code.js","sourceRoot":"","sources":["../../../../src/modules/error/message-code.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"message-code.js","sourceRoot":"","sources":["../../../../src/modules/error/message-code.ts"],"names":[],"mappings":";;;AAKA,MAAa,WAAW;aACN,cAAS,GAAG,GAAG,CAAC;aAChB,oBAAe,GAAG,0BAA0B,CAAC;aAC7C,iBAAY,GAAG,CAAC,CAAC;aACjB,YAAO,GAAG,mBAAmB,CAAC;IAE9C,0FAA0F;aAC3E,iBAAY,GAAkB,IAAI,CAAC,EAAE,CAClD,IAAI,KAAK,CAAC,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAE5F;;;;OAIG;IACH,MAAM,CAAC,eAAe,CAAC,IAAgC;QACrD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC;IACnC,CAAC;IAED,6LAA6L;IAC7L,MAAM,CAAC,KAAK,CAAC,IAA8B;QACzC,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;QAEvB,IAAI,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;YACrC,MAA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A7DH,kCA8DC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TBindingKey } from '../../common/types';
|
|
2
|
-
import { MetadataRegistry } from '
|
|
2
|
+
import { MetadataRegistry } from '../registry';
|
|
3
3
|
/** Marks a property or constructor parameter for dependency injection. */
|
|
4
4
|
export declare const inject: (opts: {
|
|
5
5
|
key: TBindingKey;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.inject = void 0;
|
|
4
|
-
const error_1 = require("
|
|
5
|
-
const registry_1 = require("
|
|
4
|
+
const error_1 = require("../error");
|
|
5
|
+
const registry_1 = require("../registry");
|
|
6
6
|
/** Marks a property or constructor parameter for dependency injection. */
|
|
7
7
|
const inject = (opts) => {
|
|
8
8
|
return (target, propertyName, parameterIndex) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}
|
package/dist/esm/common/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}
|
|
@@ -9,8 +9,6 @@ export type TClass<T> = TConstructor<T> & {
|
|
|
9
9
|
};
|
|
10
10
|
export type TConstValue<T extends TClass<any>> = Extract<ValueOf<T>, string | number>;
|
|
11
11
|
export type TBindingKey = string | symbol;
|
|
12
|
-
/** Tells a CONSTRUCTOR from a RESOLVER via source text - `prototype !== undefined` is true of every non-arrow function. Sound only on ES2020+ output (classes emit as `class`); ES5 bundling breaks it. */
|
|
13
|
-
export declare const isClass: <T>(target: any) => target is TClass<T>;
|
|
14
12
|
export interface IBindingTag {
|
|
15
13
|
[name: string]: any;
|
|
16
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/common/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC;AAEhD,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAC/C,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAEpC,MAAM,MAAM,OAAO,GAAG,GAAG,CAAC;AAE1B,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AACxD,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AACzE,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG;IAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAC;AAEtE,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAEtF,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,CAAC;AAE1C,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/common/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC;AAEhD,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAC/C,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAEpC,MAAM,MAAM,OAAO,GAAG,GAAG,CAAC;AAE1B,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AACxD,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AACzE,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG;IAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAC;AAEtE,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAEtF,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,CAAC;AAE1C,MAAM,WAAW,WAAW;IAC1B,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC;CACrB"}
|
package/dist/esm/common/types.js
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export const isClass = (target) => {
|
|
3
|
-
if (typeof target !== 'function' || target.prototype === undefined) {
|
|
4
|
-
return false;
|
|
5
|
-
}
|
|
6
|
-
return /^class[\s{]/.test(Function.prototype.toString.call(target));
|
|
7
|
-
};
|
|
1
|
+
export {};
|
|
8
2
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/common/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/common/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { TClass } from './types';
|
|
2
|
+
/** Tells a CONSTRUCTOR from a RESOLVER via source text - `prototype !== undefined` is true of every non-arrow function. Sound only on ES2020+ output (classes emit as `class`); ES5 bundling breaks it. */
|
|
3
|
+
export declare const isClass: <T>(target: any) => target is TClass<T>;
|
|
4
|
+
//# sourceMappingURL=utilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../../src/common/utilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC,2MAA2M;AAC3M,eAAO,MAAM,OAAO,GAAI,CAAC,EAAE,QAAQ,GAAG,KAAG,MAAM,IAAI,MAAM,CAAC,CAAC,CAM1D,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Tells a CONSTRUCTOR from a RESOLVER via source text - `prototype !== undefined` is true of every non-arrow function. Sound only on ES2020+ output (classes emit as `class`); ES5 bundling breaks it. */
|
|
2
|
+
export const isClass = (target) => {
|
|
3
|
+
if (typeof target !== 'function' || target.prototype === undefined) {
|
|
4
|
+
return false;
|
|
5
|
+
}
|
|
6
|
+
return /^class[\s{]/.test(Function.prototype.toString.call(target));
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=utilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utilities.js","sourceRoot":"","sources":["../../../src/common/utilities.ts"],"names":[],"mappings":"AAEA,2MAA2M;AAC3M,MAAM,CAAC,MAAM,OAAO,GAAG,CAAI,MAAW,EAAuB,EAAE;IAC7D,IAAI,OAAO,MAAM,KAAK,UAAU,IAAI,MAAM,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;QACnE,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AACtE,CAAC,CAAC"}
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAI1B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import 'reflect-metadata';
|
|
2
|
+
import { getError } from './modules/error/app-error';
|
|
3
|
+
import { MessageCode } from './modules/error/message-code';
|
|
2
4
|
export * from './common';
|
|
3
5
|
export * from './modules';
|
|
6
|
+
// Lives in the package entry, the one module every consumer evaluates and the only one
|
|
7
|
+
// declared in `sideEffects`: a bundler keeps it, so MessageCode throws ApplicationError in a
|
|
8
|
+
// bundle too.
|
|
9
|
+
MessageCode.useErrorFactory({ factory: getError });
|
|
4
10
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAE1B,uFAAuF;AACvF,6FAA6F;AAC7F,cAAc;AACd,WAAW,CAAC,eAAe,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TError, TErrorLogLevel, TErrorNormalized, TResponsedError } from './
|
|
1
|
+
import type { TError, TErrorLogLevel, TErrorNormalized, TResponsedError } from './common';
|
|
2
2
|
export declare class ApplicationError extends Error {
|
|
3
3
|
statusCode: number;
|
|
4
4
|
normalized: TErrorNormalized;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-error.d.ts","sourceRoot":"","sources":["../../../../src/modules/error/app-error.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"app-error.d.ts","sourceRoot":"","sources":["../../../../src/modules/error/app-error.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAgB1F,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,gBAAgB,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC;gBAEvB,IAAI,EAAE,MAAM;IA2CxB,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM;IAI5B,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,eAAe,CAAA;KAAE,GAAG,gBAAgB;CAcrE;AAED,eAAO,MAAM,QAAQ,GAAI,MAAM,MAAM,KAAG,gBAAmD,CAAC;AAE5F,eAAO,MAAM,SAAS,GAAI,MAAM;IAAE,KAAK,EAAE,eAAe,CAAA;CAAE,KAAG,gBAC3B,CAAC;AAEnC,eAAO,MAAM,kBAAkB,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,gBAE5D,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/error/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/error/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TErrorScope } from '
|
|
1
|
+
import type { TErrorScope } from '../definition';
|
|
2
2
|
/** Declared here, not imported from helpers' `TLogLevel` (browser-safe); a helpers guard pins them equal. */
|
|
3
3
|
export type TErrorLogLevel = 'error' | 'emerg' | 'warn' | 'info' | 'debug';
|
|
4
4
|
/** Resolved message a client renders. All fields always present - no null-checks downstream. */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/modules/error/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,6GAA6G;AAC7G,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3E,gGAAgG;AAChG,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,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,MAAM,MAAM,GAAG,kBAAkB,GAAG,aAAa,CAAC;AAExD,kMAAkM;AAClM,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,MAAM,CAC9E,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,EAC7B,IAAI,CACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/modules/error/common/types.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/error/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/error/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/error/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/error/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
|
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
import type { TNullable } from '../../common/types';
|
|
2
|
+
import type { TError } from './common';
|
|
3
|
+
type TErrorFactory = (opts: TError) => Error;
|
|
2
4
|
export declare class MessageCode {
|
|
3
5
|
static readonly SEPARATOR = ".";
|
|
4
6
|
static readonly SEGMENT_PATTERN: RegExp;
|
|
5
7
|
static readonly MIN_SEGMENTS = 2;
|
|
6
8
|
static readonly DEFAULT = "core.system_error";
|
|
9
|
+
private static errorFactory;
|
|
10
|
+
/**
|
|
11
|
+
* Registered by the package entry at module init; keeps the throws identical without a
|
|
12
|
+
* static import of app-error (that import was the cycle).
|
|
13
|
+
* @internal Framework wiring; consumers must not replace the factory.
|
|
14
|
+
*/
|
|
15
|
+
static useErrorFactory(opts: {
|
|
16
|
+
factory: TErrorFactory;
|
|
17
|
+
}): void;
|
|
7
18
|
/** Builds a code from its segments, throwing on a malformed one - codes are declared at module scope, so a bad code fails the process at import instead of shipping dead into production. */
|
|
8
19
|
static build(opts: {
|
|
9
20
|
parts: Array<string>;
|
|
@@ -13,4 +24,5 @@ export declare class MessageCode {
|
|
|
13
24
|
/** Normalizes an absent, empty or non-string code to {@link DEFAULT}. */
|
|
14
25
|
static resolve(code?: TNullable<string>): string;
|
|
15
26
|
}
|
|
27
|
+
export {};
|
|
16
28
|
//# sourceMappingURL=message-code.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-code.d.ts","sourceRoot":"","sources":["../../../../src/modules/error/message-code.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"message-code.d.ts","sourceRoot":"","sources":["../../../../src/modules/error/message-code.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,KAAK,aAAa,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,KAAK,CAAC;AAE7C,qBAAa,WAAW;IACtB,MAAM,CAAC,QAAQ,CAAC,SAAS,OAAO;IAChC,MAAM,CAAC,QAAQ,CAAC,eAAe,SAA8B;IAC7D,MAAM,CAAC,QAAQ,CAAC,YAAY,KAAK;IACjC,MAAM,CAAC,QAAQ,CAAC,OAAO,uBAAuB;IAG9C,OAAO,CAAC,MAAM,CAAC,YAAY,CACiE;IAE5F;;;;OAIG;IACH,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,aAAa,CAAA;KAAE,GAAG,IAAI;IAI9D,6LAA6L;IAC7L,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;KAAE,GAAG,MAAM;IAsBpD,iLAAiL;IACjL,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO;IAatC,yEAAyE;IACzE,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,GAAG,MAAM;CAKjD"}
|
|
@@ -1,21 +1,30 @@
|
|
|
1
|
-
import { getError } from './app-error';
|
|
2
1
|
export class MessageCode {
|
|
3
2
|
static { this.SEPARATOR = '.'; }
|
|
4
3
|
static { this.SEGMENT_PATTERN = /^[a-z0-9]+(_[a-z0-9]+)*$/; }
|
|
5
4
|
static { this.MIN_SEGMENTS = 2; }
|
|
6
5
|
static { this.DEFAULT = 'core.system_error'; }
|
|
6
|
+
// The one permitted raw `new Error`, used only until `src/index.ts` registers `getError`.
|
|
7
|
+
static { this.errorFactory = opts => new Error(typeof opts.message === 'string' ? opts.message : JSON.stringify(opts.message)); }
|
|
8
|
+
/**
|
|
9
|
+
* Registered by the package entry at module init; keeps the throws identical without a
|
|
10
|
+
* static import of app-error (that import was the cycle).
|
|
11
|
+
* @internal Framework wiring; consumers must not replace the factory.
|
|
12
|
+
*/
|
|
13
|
+
static useErrorFactory(opts) {
|
|
14
|
+
this.errorFactory = opts.factory;
|
|
15
|
+
}
|
|
7
16
|
/** Builds a code from its segments, throwing on a malformed one - codes are declared at module scope, so a bad code fails the process at import instead of shipping dead into production. */
|
|
8
17
|
static build(opts) {
|
|
9
18
|
const { parts } = opts;
|
|
10
19
|
if (parts.length < this.MIN_SEGMENTS) {
|
|
11
|
-
throw
|
|
20
|
+
throw this.errorFactory({
|
|
12
21
|
messageCode: 'core.message_code.invalid_segment_count',
|
|
13
22
|
message: `[MessageCode][build] A code needs at least ${this.MIN_SEGMENTS} segments (namespace + reason) | Got: ${JSON.stringify(parts)}`,
|
|
14
23
|
});
|
|
15
24
|
}
|
|
16
25
|
for (const segment of parts) {
|
|
17
26
|
if (!this.SEGMENT_PATTERN.test(segment)) {
|
|
18
|
-
throw
|
|
27
|
+
throw this.errorFactory({
|
|
19
28
|
messageCode: 'core.message_code.invalid_segment_format',
|
|
20
29
|
message: `[MessageCode][build] Invalid segment '${segment}' | Expected lower snake_case (a-z, 0-9, '_') | Full: ${JSON.stringify(parts)}`,
|
|
21
30
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-code.js","sourceRoot":"","sources":["../../../../src/modules/error/message-code.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"message-code.js","sourceRoot":"","sources":["../../../../src/modules/error/message-code.ts"],"names":[],"mappings":"AAKA,MAAM,OAAO,WAAW;aACN,cAAS,GAAG,GAAG,CAAC;aAChB,oBAAe,GAAG,0BAA0B,CAAC;aAC7C,iBAAY,GAAG,CAAC,CAAC;aACjB,YAAO,GAAG,mBAAmB,CAAC;IAE9C,0FAA0F;aAC3E,iBAAY,GAAkB,IAAI,CAAC,EAAE,CAClD,IAAI,KAAK,CAAC,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAE5F;;;;OAIG;IACH,MAAM,CAAC,eAAe,CAAC,IAAgC;QACrD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC;IACnC,CAAC;IAED,6LAA6L;IAC7L,MAAM,CAAC,KAAK,CAAC,IAA8B;QACzC,MAAM,EAAE,KA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CAAC,IAAI,CAAC,WAAW,EAAE;YACpB,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;IACjC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TBindingKey } from '../../common/types';
|
|
2
|
-
import { MetadataRegistry } from '
|
|
2
|
+
import { MetadataRegistry } from '../registry';
|
|
3
3
|
/** Marks a property or constructor parameter for dependency injection. */
|
|
4
4
|
export declare const inject: (opts: {
|
|
5
5
|
key: TBindingKey;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getError } from '
|
|
2
|
-
import { metadataRegistry } from '
|
|
1
|
+
import { getError } from '../error';
|
|
2
|
+
import { metadataRegistry } from '../registry';
|
|
3
3
|
/** Marks a property or constructor parameter for dependency injection. */
|
|
4
4
|
export const inject = (opts) => {
|
|
5
5
|
return (target, propertyName, parameterIndex) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@venizia/ignis-inversion",
|
|
3
|
-
"version": "0.2.0-
|
|
3
|
+
"version": "0.2.0-5",
|
|
4
4
|
"description": "Lightweight, high-performance Dependency Injection and Inversion of Control container for TypeScript (~350 lines). Features decorator-based constructor and property injection, fluent Binding API, singleton/transient scoping, namespace auto-tagging, Provider pattern, tag-based discovery, and reflect-metadata integration. Inspired by LoopBack 4 and InversifyJS but simpler. Zero framework lock-in — works standalone or with Ignis.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"architecture",
|
|
@@ -81,7 +81,6 @@
|
|
|
81
81
|
"README.md",
|
|
82
82
|
"LICENSE.md",
|
|
83
83
|
"dist",
|
|
84
|
-
"!/**/tests",
|
|
85
84
|
"!/**/dist/tests",
|
|
86
85
|
"!/**/__tests__",
|
|
87
86
|
"!**/*.tsbuildinfo"
|
|
@@ -108,15 +107,15 @@
|
|
|
108
107
|
"dependencies": {
|
|
109
108
|
"lodash": "^4.18.1",
|
|
110
109
|
"reflect-metadata": "^0.2.2",
|
|
111
|
-
"zod": "^4.4
|
|
110
|
+
"zod": "^4.5.4"
|
|
112
111
|
},
|
|
113
112
|
"devDependencies": {
|
|
114
|
-
"@types/bun": "^1.
|
|
115
|
-
"@types/lodash": "^4.17.
|
|
113
|
+
"@types/bun": "^1.4.1",
|
|
114
|
+
"@types/lodash": "^4.17.25",
|
|
116
115
|
"@venizia/dev-configs": "^0.2.0-3",
|
|
117
|
-
"eslint": "^10.
|
|
118
|
-
"prettier": "^3.9.
|
|
119
|
-
"tsc-alias": "^1.9.
|
|
116
|
+
"eslint": "^10.10.0",
|
|
117
|
+
"prettier": "^3.9.6",
|
|
118
|
+
"tsc-alias": "^1.9.4",
|
|
120
119
|
"typescript": "^6.0.3"
|
|
121
120
|
}
|
|
122
121
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/modules/error/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,6GAA6G;AAC7G,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3E,gGAAgG;AAChG,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B,CAAC;AAEF,4MAA4M;AAC5M,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC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AAM,aAAa,GAAG,YAAY,GAAG;IACzC,OAAO,EAAE,aAAa,CAAC;IACvB,WAAW,CAAC,EAAE,SAAS,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;IAC1D,6JAA6J;IAC7J,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,kBAAkB,GAAG,aAAa,CAAC;AAExD,kMAAkM;AAClM,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,MAAM,CAC9E,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,EAC7B,IAAI,CACL,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/modules/error/types.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
File without changes
|