@venizia/ignis-inversion 0.4.2 → 0.4.3

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.
@@ -0,0 +1,14 @@
1
+ import type { TConstValue } from '../../../common/types';
2
+ /** Declared here, not imported from helpers' `LogLevels` (browser-safe); a helpers guard pins them equal. */
3
+ export declare class ErrorLogLevels {
4
+ static readonly ERROR = "error";
5
+ static readonly EMERG = "emerg";
6
+ static readonly WARN = "warn";
7
+ static readonly INFO = "info";
8
+ static readonly DEBUG = "debug";
9
+ static readonly SCHEME_SET: Set<string>;
10
+ static isValid(value: string): boolean;
11
+ }
12
+ /** The level an error is logged at. */
13
+ export type TErrorLogLevel = TConstValue<typeof ErrorLogLevels>;
14
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/modules/error/common/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,6GAA6G;AAC7G,qBAAa,cAAc;IACzB,MAAM,CAAC,QAAQ,CAAC,KAAK,WAAW;IAChC,MAAM,CAAC,QAAQ,CAAC,KAAK,WAAW;IAChC,MAAM,CAAC,QAAQ,CAAC,IAAI,UAAU;IAC9B,MAAM,CAAC,QAAQ,CAAC,IAAI,UAAU;IAC9B,MAAM,CAAC,QAAQ,CAAC,KAAK,WAAW;IAEhC,MAAM,CAAC,QAAQ,CAAC,UAAU,cAMvB;IAEH,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;CAGvC;AAED,uCAAuC;AACvC,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,OAAO,cAAc,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ErrorLogLevels = void 0;
4
+ /** Declared here, not imported from helpers' `LogLevels` (browser-safe); a helpers guard pins them equal. */
5
+ class ErrorLogLevels {
6
+ static { this.ERROR = 'error'; }
7
+ static { this.EMERG = 'emerg'; }
8
+ static { this.WARN = 'warn'; }
9
+ static { this.INFO = 'info'; }
10
+ static { this.DEBUG = 'debug'; }
11
+ static { this.SCHEME_SET = new Set([
12
+ this.ERROR,
13
+ this.EMERG,
14
+ this.WARN,
15
+ this.INFO,
16
+ this.DEBUG,
17
+ ]); }
18
+ static isValid(value) {
19
+ return this.SCHEME_SET.has(value);
20
+ }
21
+ }
22
+ exports.ErrorLogLevels = ErrorLogLevels;
23
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/modules/error/common/constants.ts"],"names":[],"mappings":";;;AAEA,6GAA6G;AAC7G,MAAa,cAAc;aACT,UAAK,GAAG,OAAO,CAAC;aAChB,UAAK,GAAG,OAAO,CAAC;aAChB,SAAI,GAAG,MAAM,CAAC;aACd,SAAI,GAAG,MAAM,CAAC;aACd,UAAK,GAAG,OAAO,CAAC;aAEhB,eAAU,GAAG,IAAI,GAAG,CAAS;QAC3C,IAAI,CAAC,KAAK;QACV,IAAI,CAAC,KAAK;QACV,IAAI,CAAC,IAAI;QACT,IAAI,CAAC,IAAI;QACT,IAAI,CAAC,KAAK;KACX,CAAC,CAAC;IAEH,MAAM,CAAC,OAAO,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;;AAjBH,wCAkBC","sourcesContent":["import type { TConstValue } from '@/common/types';\n\n/** Declared here, not imported from helpers' `LogLevels` (browser-safe); a helpers guard pins them equal. */\nexport class ErrorLogLevels {\n static readonly ERROR = 'error';\n static readonly EMERG = 'emerg';\n static readonly WARN = 'warn';\n static readonly INFO = 'info';\n static readonly DEBUG = 'debug';\n\n static readonly SCHEME_SET = new Set<string>([\n this.ERROR,\n this.EMERG,\n this.WARN,\n this.INFO,\n this.DEBUG,\n ]);\n\n static isValid(value: string): boolean {\n return this.SCHEME_SET.has(value);\n }\n}\n\n/** The level an error is logged at. */\nexport type TErrorLogLevel = TConstValue<typeof ErrorLogLevels>;\n"]}
@@ -1,2 +1,3 @@
1
+ export * from './constants';
1
2
  export * from './types';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/error/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/error/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
@@ -14,5 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./constants"), exports);
17
18
  __exportStar(require("./types"), exports);
18
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/error/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB","sourcesContent":["export * from './types';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/error/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,0CAAwB","sourcesContent":["export * from './constants';\nexport * from './types';\n"]}
@@ -1,6 +1,5 @@
1
1
  import type { TErrorScope } from '../definition';
2
- /** Declared here, not imported from helpers' `TLogLevel` (browser-safe); a helpers guard pins them equal. */
3
- export type TErrorLogLevel = 'error' | 'emerg' | 'warn' | 'info' | 'debug';
2
+ import type { TErrorLogLevel } from './constants';
4
3
  /** Resolved message a client renders. All fields always present - no null-checks downstream. */
5
4
  export type TErrorNormalized = {
6
5
  text: string;
@@ -1 +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,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,SAAS,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;IACnD,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC,CAAC;AAEF,oLAAoL;AACpL,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1F,kEAAkE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ACjC,KAAK,gBAAgB,CAAC;AAEvB,oLAAoL;AACpL,KAAK,YAAY,GAAG;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,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"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/modules/error/common/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TErrorScope } from '../definition';\n\n/** Declared here, not imported from helpers' `TLogLevel` (browser-safe); a helpers guard pins them equal. */\nexport type TErrorLogLevel = 'error' | 'emerg' | 'warn' | 'info' | 'debug';\n\n/** Resolved message a client renders. All fields always present - no null-checks downstream. */\nexport type TErrorNormalized = {\n text: string;\n code: string;\n args: Record<string, unknown>;\n};\n\n/** Wire payload as a CLIENT receives it - the input to {@link ApplicationError.fromError}. Every field is optional on purpose: a client parses what a gateway, a proxy or an older server actually sent. */\nexport type TResponsedError = {\n message?: string;\n statusCode?: number;\n normalized?: Partial<TErrorNormalized>;\n extra?: Record<string, unknown>;\n requestId?: string;\n details?: Record<string, unknown>;\n};\n\n/** The message a CALLER supplies - only `text` is required, the rest is what {@link TErrorNormalized} resolves; every other message shape is derived from this one. */\nexport type TErrorMessageInput = {\n text: string;\n code?: TErrorKey | (string & Record<never, never>);\n args?: Record<string, unknown>;\n};\n\n/** Catalogued message - `code` required, typed `string` and not {@link TErrorKey}: catalogs DECLARE the registry keys, so typing against the registry would be self-referential. */\nexport type TErrorDefinitionMessage = Omit<TErrorMessageInput, 'code'> & { code: string };\n\n/** The free-form input: a bare string is the historical shape. */\nexport type TErrorMessage = string | TErrorMessageInput;\n\n/** The catalogued form's override - every field optional, since the definition supplies the rest. */\nexport type TErrorMessageOverride = string | Partial<TErrorMessageInput>;\n\nexport type TErrorDefinition = {\n message: TErrorDefinitionMessage;\n statusCode: number;\n category?: TErrorScope;\n description?: string;\n};\n\n/** Augmented per-package via declaration merging, driving `messageCode` autocomplete. */\nexport interface IErrorKeyRegistry {}\n\nexport type TErrorKey = [keyof IErrorKeyRegistry] extends [never]\n ? string\n : Extract<keyof IErrorKeyRegistry, string>;\n\n/** Builds {@link TErrorNormalized} in place of the default; `message` is the default it replaces. */\nexport type TErrorNormalizeTransformFn = (opts: {\n message: TErrorNormalized;\n statusCode: number;\n extra?: Record<string, unknown>;\n}) => TErrorNormalized;\n\n/** Shared by both input forms - unknown keys ride the index signature into `extra`, so a throw site can attach context the framework does not model, and so does a mistyped key. */\ntype TErrorCommon = {\n statusCode?: number;\n messageArgs?: Record<string, unknown>;\n cause?: unknown;\n extra?: Record<string, unknown>;\n transform?: TErrorNormalizeTransformFn;\n logLevel?: TErrorLogLevel; // Default: error\n};\n\n/** Catalogued form - `message` and `statusCode` override the definition's defaults; the object form is partial, so `{ message: { args } }` amends the args and keeps the definition's text and code. */\nexport type TErrorByDefinition = TErrorCommon & {\n error: TErrorDefinition;\n message?: TErrorMessageOverride;\n [key: string]: unknown;\n};\n\n/** Free-form: an invariant, a misconfiguration, a failure carrying no i18n code. `message` is the only required field - most throw sites legitimately fall back to `MessageCode.DEFAULT`. */\nexport type TErrorByField = TErrorCommon & {\n message: TErrorMessage;\n messageCode?: TErrorKey | (string & Record<never, never>);\n /** Never valid here - `error` is the catalogued form's discriminant and a CONSUMED key, so a wrapped failure passed as `error` would vanish; use `cause`. */\n error?: never;\n [key: string]: unknown;\n};\n\nexport type TError = TErrorByDefinition | TErrorByField;\n\n/** Registers a catalog's keys with {@link IErrorKeyRegistry}, via `declare module '@venizia/ignis-helpers' { interface IErrorKeyRegistry extends TRegisterErrors<typeof CategoryErrors> {} }`. */\nexport type TRegisterErrors<T extends Record<string, TErrorDefinition>> = Record<\n T[keyof T]['message']['code'],\n true\n>;\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/modules/error/common/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TErrorScope } from '../definition';\nimport type { TErrorLogLevel } from './constants';\n\n/** Resolved message a client renders. All fields always present - no null-checks downstream. */\nexport type TErrorNormalized = {\n text: string;\n code: string;\n args: Record<string, unknown>;\n};\n\n/** Wire payload as a CLIENT receives it - the input to {@link ApplicationError.fromError}. Every field is optional on purpose: a client parses what a gateway, a proxy or an older server actually sent. */\nexport type TResponsedError = {\n message?: string;\n statusCode?: number;\n normalized?: Partial<TErrorNormalized>;\n extra?: Record<string, unknown>;\n requestId?: string;\n details?: Record<string, unknown>;\n};\n\n/** The message a CALLER supplies - only `text` is required, the rest is what {@link TErrorNormalized} resolves; every other message shape is derived from this one. */\nexport type TErrorMessageInput = {\n text: string;\n code?: TErrorKey | (string & Record<never, never>);\n args?: Record<string, unknown>;\n};\n\n/** Catalogued message - `code` required, typed `string` and not {@link TErrorKey}: catalogs DECLARE the registry keys, so typing against the registry would be self-referential. */\nexport type TErrorDefinitionMessage = Omit<TErrorMessageInput, 'code'> & { code: string };\n\n/** The free-form input: a bare string is the historical shape. */\nexport type TErrorMessage = string | TErrorMessageInput;\n\n/** The catalogued form's override - every field optional, since the definition supplies the rest. */\nexport type TErrorMessageOverride = string | Partial<TErrorMessageInput>;\n\nexport type TErrorDefinition = {\n message: TErrorDefinitionMessage;\n statusCode: number;\n category?: TErrorScope;\n description?: string;\n};\n\n/** Augmented per-package via declaration merging, driving `messageCode` autocomplete. */\nexport interface IErrorKeyRegistry {}\n\nexport type TErrorKey = [keyof IErrorKeyRegistry] extends [never]\n ? string\n : Extract<keyof IErrorKeyRegistry, string>;\n\n/** Builds {@link TErrorNormalized} in place of the default; `message` is the default it replaces. */\nexport type TErrorNormalizeTransformFn = (opts: {\n message: TErrorNormalized;\n statusCode: number;\n extra?: Record<string, unknown>;\n}) => TErrorNormalized;\n\n/** Shared by both input forms - unknown keys ride the index signature into `extra`, so a throw site can attach context the framework does not model, and so does a mistyped key. */\ntype TErrorCommon = {\n statusCode?: number;\n messageArgs?: Record<string, unknown>;\n cause?: unknown;\n extra?: Record<string, unknown>;\n transform?: TErrorNormalizeTransformFn;\n logLevel?: TErrorLogLevel; // Default: error\n};\n\n/** Catalogued form - `message` and `statusCode` override the definition's defaults; the object form is partial, so `{ message: { args } }` amends the args and keeps the definition's text and code. */\nexport type TErrorByDefinition = TErrorCommon & {\n error: TErrorDefinition;\n message?: TErrorMessageOverride;\n [key: string]: unknown;\n};\n\n/** Free-form: an invariant, a misconfiguration, a failure carrying no i18n code. `message` is the only required field - most throw sites legitimately fall back to `MessageCode.DEFAULT`. */\nexport type TErrorByField = TErrorCommon & {\n message: TErrorMessage;\n messageCode?: TErrorKey | (string & Record<never, never>);\n /** Never valid here - `error` is the catalogued form's discriminant and a CONSUMED key, so a wrapped failure passed as `error` would vanish; use `cause`. */\n error?: never;\n [key: string]: unknown;\n};\n\nexport type TError = TErrorByDefinition | TErrorByField;\n\n/** Registers a catalog's keys with {@link IErrorKeyRegistry}, via `declare module '@venizia/ignis-helpers' { interface IErrorKeyRegistry extends TRegisterErrors<typeof CategoryErrors> {} }`. */\nexport type TRegisterErrors<T extends Record<string, TErrorDefinition>> = Record<\n T[keyof T]['message']['code'],\n true\n>;\n"]}
@@ -0,0 +1,14 @@
1
+ import type { TConstValue } from '../../../common/types.js';
2
+ /** Declared here, not imported from helpers' `LogLevels` (browser-safe); a helpers guard pins them equal. */
3
+ export declare class ErrorLogLevels {
4
+ static readonly ERROR = "error";
5
+ static readonly EMERG = "emerg";
6
+ static readonly WARN = "warn";
7
+ static readonly INFO = "info";
8
+ static readonly DEBUG = "debug";
9
+ static readonly SCHEME_SET: Set<string>;
10
+ static isValid(value: string): boolean;
11
+ }
12
+ /** The level an error is logged at. */
13
+ export type TErrorLogLevel = TConstValue<typeof ErrorLogLevels>;
14
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/modules/error/common/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,6GAA6G;AAC7G,qBAAa,cAAc;IACzB,MAAM,CAAC,QAAQ,CAAC,KAAK,WAAW;IAChC,MAAM,CAAC,QAAQ,CAAC,KAAK,WAAW;IAChC,MAAM,CAAC,QAAQ,CAAC,IAAI,UAAU;IAC9B,MAAM,CAAC,QAAQ,CAAC,IAAI,UAAU;IAC9B,MAAM,CAAC,QAAQ,CAAC,KAAK,WAAW;IAEhC,MAAM,CAAC,QAAQ,CAAC,UAAU,cAMvB;IAEH,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;CAGvC;AAED,uCAAuC;AACvC,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,OAAO,cAAc,CAAC,CAAC"}
@@ -0,0 +1,19 @@
1
+ /** Declared here, not imported from helpers' `LogLevels` (browser-safe); a helpers guard pins them equal. */
2
+ export class ErrorLogLevels {
3
+ static { this.ERROR = 'error'; }
4
+ static { this.EMERG = 'emerg'; }
5
+ static { this.WARN = 'warn'; }
6
+ static { this.INFO = 'info'; }
7
+ static { this.DEBUG = 'debug'; }
8
+ static { this.SCHEME_SET = new Set([
9
+ this.ERROR,
10
+ this.EMERG,
11
+ this.WARN,
12
+ this.INFO,
13
+ this.DEBUG,
14
+ ]); }
15
+ static isValid(value) {
16
+ return this.SCHEME_SET.has(value);
17
+ }
18
+ }
19
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/modules/error/common/constants.ts"],"names":[],"mappings":"AAEA,6GAA6G;AAC7G,MAAM,OAAO,cAAc;aACT,UAAK,GAAG,OAAO,CAAC;aAChB,UAAK,GAAG,OAAO,CAAC;aAChB,SAAI,GAAG,MAAM,CAAC;aACd,SAAI,GAAG,MAAM,CAAC;aACd,UAAK,GAAG,OAAO,CAAC;aAEhB,eAAU,GAAG,IAAI,GAAG,CAAS;QAC3C,IAAI,CAAC,KAAK;QACV,IAAI,CAAC,KAAK;QACV,IAAI,CAAC,IAAI;QACT,IAAI,CAAC,IAAI;QACT,IAAI,CAAC,KAAK;KACX,CAAC,CAAC;IAEH,MAAM,CAAC,OAAO,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC","sourcesContent":["import type { TConstValue } from '@/common/types';\n\n/** Declared here, not imported from helpers' `LogLevels` (browser-safe); a helpers guard pins them equal. */\nexport class ErrorLogLevels {\n static readonly ERROR = 'error';\n static readonly EMERG = 'emerg';\n static readonly WARN = 'warn';\n static readonly INFO = 'info';\n static readonly DEBUG = 'debug';\n\n static readonly SCHEME_SET = new Set<string>([\n this.ERROR,\n this.EMERG,\n this.WARN,\n this.INFO,\n this.DEBUG,\n ]);\n\n static isValid(value: string): boolean {\n return this.SCHEME_SET.has(value);\n }\n}\n\n/** The level an error is logged at. */\nexport type TErrorLogLevel = TConstValue<typeof ErrorLogLevels>;\n"]}
@@ -1,2 +1,3 @@
1
+ export * from './constants.js';
1
2
  export * from './types.js';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/error/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/error/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
@@ -1,2 +1,3 @@
1
+ export * from './constants.js';
1
2
  export * from './types.js';
2
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/error/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC","sourcesContent":["export * from './types';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/error/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC","sourcesContent":["export * from './constants';\nexport * from './types';\n"]}
@@ -1,6 +1,5 @@
1
1
  import type { TErrorScope } from '../definition.js';
2
- /** Declared here, not imported from helpers' `TLogLevel` (browser-safe); a helpers guard pins them equal. */
3
- export type TErrorLogLevel = 'error' | 'emerg' | 'warn' | 'info' | 'debug';
2
+ import type { TErrorLogLevel } from './constants.js';
4
3
  /** Resolved message a client renders. All fields always present - no null-checks downstream. */
5
4
  export type TErrorNormalized = {
6
5
  text: string;
@@ -1 +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,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,SAAS,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;IACnD,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC,CAAC;AAEF,oLAAoL;AACpL,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1F,kEAAkE;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jC,KAAK,gBAAgB,CAAC;AAEvB,oLAAoL;AACpL,KAAK,YAAY,GAAG;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,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"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/modules/error/common/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TErrorScope } from '../definition';\n\n/** Declared here, not imported from helpers' `TLogLevel` (browser-safe); a helpers guard pins them equal. */\nexport type TErrorLogLevel = 'error' | 'emerg' | 'warn' | 'info' | 'debug';\n\n/** Resolved message a client renders. All fields always present - no null-checks downstream. */\nexport type TErrorNormalized = {\n text: string;\n code: string;\n args: Record<string, unknown>;\n};\n\n/** Wire payload as a CLIENT receives it - the input to {@link ApplicationError.fromError}. Every field is optional on purpose: a client parses what a gateway, a proxy or an older server actually sent. */\nexport type TResponsedError = {\n message?: string;\n statusCode?: number;\n normalized?: Partial<TErrorNormalized>;\n extra?: Record<string, unknown>;\n requestId?: string;\n details?: Record<string, unknown>;\n};\n\n/** The message a CALLER supplies - only `text` is required, the rest is what {@link TErrorNormalized} resolves; every other message shape is derived from this one. */\nexport type TErrorMessageInput = {\n text: string;\n code?: TErrorKey | (string & Record<never, never>);\n args?: Record<string, unknown>;\n};\n\n/** Catalogued message - `code` required, typed `string` and not {@link TErrorKey}: catalogs DECLARE the registry keys, so typing against the registry would be self-referential. */\nexport type TErrorDefinitionMessage = Omit<TErrorMessageInput, 'code'> & { code: string };\n\n/** The free-form input: a bare string is the historical shape. */\nexport type TErrorMessage = string | TErrorMessageInput;\n\n/** The catalogued form's override - every field optional, since the definition supplies the rest. */\nexport type TErrorMessageOverride = string | Partial<TErrorMessageInput>;\n\nexport type TErrorDefinition = {\n message: TErrorDefinitionMessage;\n statusCode: number;\n category?: TErrorScope;\n description?: string;\n};\n\n/** Augmented per-package via declaration merging, driving `messageCode` autocomplete. */\nexport interface IErrorKeyRegistry {}\n\nexport type TErrorKey = [keyof IErrorKeyRegistry] extends [never]\n ? string\n : Extract<keyof IErrorKeyRegistry, string>;\n\n/** Builds {@link TErrorNormalized} in place of the default; `message` is the default it replaces. */\nexport type TErrorNormalizeTransformFn = (opts: {\n message: TErrorNormalized;\n statusCode: number;\n extra?: Record<string, unknown>;\n}) => TErrorNormalized;\n\n/** Shared by both input forms - unknown keys ride the index signature into `extra`, so a throw site can attach context the framework does not model, and so does a mistyped key. */\ntype TErrorCommon = {\n statusCode?: number;\n messageArgs?: Record<string, unknown>;\n cause?: unknown;\n extra?: Record<string, unknown>;\n transform?: TErrorNormalizeTransformFn;\n logLevel?: TErrorLogLevel; // Default: error\n};\n\n/** Catalogued form - `message` and `statusCode` override the definition's defaults; the object form is partial, so `{ message: { args } }` amends the args and keeps the definition's text and code. */\nexport type TErrorByDefinition = TErrorCommon & {\n error: TErrorDefinition;\n message?: TErrorMessageOverride;\n [key: string]: unknown;\n};\n\n/** Free-form: an invariant, a misconfiguration, a failure carrying no i18n code. `message` is the only required field - most throw sites legitimately fall back to `MessageCode.DEFAULT`. */\nexport type TErrorByField = TErrorCommon & {\n message: TErrorMessage;\n messageCode?: TErrorKey | (string & Record<never, never>);\n /** Never valid here - `error` is the catalogued form's discriminant and a CONSUMED key, so a wrapped failure passed as `error` would vanish; use `cause`. */\n error?: never;\n [key: string]: unknown;\n};\n\nexport type TError = TErrorByDefinition | TErrorByField;\n\n/** Registers a catalog's keys with {@link IErrorKeyRegistry}, via `declare module '@venizia/ignis-helpers' { interface IErrorKeyRegistry extends TRegisterErrors<typeof CategoryErrors> {} }`. */\nexport type TRegisterErrors<T extends Record<string, TErrorDefinition>> = Record<\n T[keyof T]['message']['code'],\n true\n>;\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/modules/error/common/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TErrorScope } from '../definition';\nimport type { TErrorLogLevel } from './constants';\n\n/** Resolved message a client renders. All fields always present - no null-checks downstream. */\nexport type TErrorNormalized = {\n text: string;\n code: string;\n args: Record<string, unknown>;\n};\n\n/** Wire payload as a CLIENT receives it - the input to {@link ApplicationError.fromError}. Every field is optional on purpose: a client parses what a gateway, a proxy or an older server actually sent. */\nexport type TResponsedError = {\n message?: string;\n statusCode?: number;\n normalized?: Partial<TErrorNormalized>;\n extra?: Record<string, unknown>;\n requestId?: string;\n details?: Record<string, unknown>;\n};\n\n/** The message a CALLER supplies - only `text` is required, the rest is what {@link TErrorNormalized} resolves; every other message shape is derived from this one. */\nexport type TErrorMessageInput = {\n text: string;\n code?: TErrorKey | (string & Record<never, never>);\n args?: Record<string, unknown>;\n};\n\n/** Catalogued message - `code` required, typed `string` and not {@link TErrorKey}: catalogs DECLARE the registry keys, so typing against the registry would be self-referential. */\nexport type TErrorDefinitionMessage = Omit<TErrorMessageInput, 'code'> & { code: string };\n\n/** The free-form input: a bare string is the historical shape. */\nexport type TErrorMessage = string | TErrorMessageInput;\n\n/** The catalogued form's override - every field optional, since the definition supplies the rest. */\nexport type TErrorMessageOverride = string | Partial<TErrorMessageInput>;\n\nexport type TErrorDefinition = {\n message: TErrorDefinitionMessage;\n statusCode: number;\n category?: TErrorScope;\n description?: string;\n};\n\n/** Augmented per-package via declaration merging, driving `messageCode` autocomplete. */\nexport interface IErrorKeyRegistry {}\n\nexport type TErrorKey = [keyof IErrorKeyRegistry] extends [never]\n ? string\n : Extract<keyof IErrorKeyRegistry, string>;\n\n/** Builds {@link TErrorNormalized} in place of the default; `message` is the default it replaces. */\nexport type TErrorNormalizeTransformFn = (opts: {\n message: TErrorNormalized;\n statusCode: number;\n extra?: Record<string, unknown>;\n}) => TErrorNormalized;\n\n/** Shared by both input forms - unknown keys ride the index signature into `extra`, so a throw site can attach context the framework does not model, and so does a mistyped key. */\ntype TErrorCommon = {\n statusCode?: number;\n messageArgs?: Record<string, unknown>;\n cause?: unknown;\n extra?: Record<string, unknown>;\n transform?: TErrorNormalizeTransformFn;\n logLevel?: TErrorLogLevel; // Default: error\n};\n\n/** Catalogued form - `message` and `statusCode` override the definition's defaults; the object form is partial, so `{ message: { args } }` amends the args and keeps the definition's text and code. */\nexport type TErrorByDefinition = TErrorCommon & {\n error: TErrorDefinition;\n message?: TErrorMessageOverride;\n [key: string]: unknown;\n};\n\n/** Free-form: an invariant, a misconfiguration, a failure carrying no i18n code. `message` is the only required field - most throw sites legitimately fall back to `MessageCode.DEFAULT`. */\nexport type TErrorByField = TErrorCommon & {\n message: TErrorMessage;\n messageCode?: TErrorKey | (string & Record<never, never>);\n /** Never valid here - `error` is the catalogued form's discriminant and a CONSUMED key, so a wrapped failure passed as `error` would vanish; use `cause`. */\n error?: never;\n [key: string]: unknown;\n};\n\nexport type TError = TErrorByDefinition | TErrorByField;\n\n/** Registers a catalog's keys with {@link IErrorKeyRegistry}, via `declare module '@venizia/ignis-helpers' { interface IErrorKeyRegistry extends TRegisterErrors<typeof CategoryErrors> {} }`. */\nexport type TRegisterErrors<T extends Record<string, TErrorDefinition>> = Record<\n T[keyof T]['message']['code'],\n true\n>;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@venizia/ignis-inversion",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
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",
@@ -97,7 +97,7 @@
97
97
  },
98
98
  "devDependencies": {
99
99
  "@types/bun": "^1.4.3",
100
- "@venizia/dev-configs": "0.4.2",
100
+ "@venizia/dev-configs": "0.4.3",
101
101
  "eslint": "^10.13.0",
102
102
  "oxlint": "1.89.0",
103
103
  "oxlint-tsgolint": "7.0.2004",