@venizia/ignis-inversion 0.4.2 → 0.4.4

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 (160) hide show
  1. package/LICENSE.md +2 -5
  2. package/README.md +18 -6
  3. package/dist/esm/modules/container/base.d.ts.map +1 -1
  4. package/dist/esm/modules/container/base.js +3 -1
  5. package/dist/esm/modules/container/base.js.map +1 -1
  6. package/dist/esm/modules/container/container.d.ts.map +1 -1
  7. package/dist/esm/modules/container/container.js +1 -0
  8. package/dist/esm/modules/container/container.js.map +1 -1
  9. package/dist/esm/modules/container/index.d.ts +1 -0
  10. package/dist/esm/modules/container/index.d.ts.map +1 -1
  11. package/dist/esm/modules/container/index.js +1 -0
  12. package/dist/esm/modules/container/index.js.map +1 -1
  13. package/dist/esm/modules/container/verifier.d.ts +47 -0
  14. package/dist/esm/modules/container/verifier.d.ts.map +1 -0
  15. package/dist/esm/modules/container/verifier.js +115 -0
  16. package/dist/esm/modules/container/verifier.js.map +1 -0
  17. package/dist/esm/modules/error/common/constants.d.ts +14 -0
  18. package/dist/esm/modules/error/common/constants.d.ts.map +1 -0
  19. package/dist/esm/modules/error/common/constants.js +19 -0
  20. package/dist/esm/modules/error/common/constants.js.map +1 -0
  21. package/dist/esm/modules/error/common/index.d.ts +1 -0
  22. package/dist/esm/modules/error/common/index.d.ts.map +1 -1
  23. package/dist/esm/modules/error/common/index.js +1 -0
  24. package/dist/esm/modules/error/common/index.js.map +1 -1
  25. package/dist/esm/modules/error/common/types.d.ts +1 -2
  26. package/dist/esm/modules/error/common/types.d.ts.map +1 -1
  27. package/dist/esm/modules/error/common/types.js.map +1 -1
  28. package/package.json +7 -15
  29. package/dist/cjs/common/base-helper.d.ts +0 -9
  30. package/dist/cjs/common/base-helper.d.ts.map +0 -1
  31. package/dist/cjs/common/base-helper.js +0 -11
  32. package/dist/cjs/common/base-helper.js.map +0 -1
  33. package/dist/cjs/common/index.d.ts +0 -5
  34. package/dist/cjs/common/index.d.ts.map +0 -1
  35. package/dist/cjs/common/index.js +0 -21
  36. package/dist/cjs/common/index.js.map +0 -1
  37. package/dist/cjs/common/logger.d.ts +0 -11
  38. package/dist/cjs/common/logger.d.ts.map +0 -1
  39. package/dist/cjs/common/logger.js +0 -26
  40. package/dist/cjs/common/logger.js.map +0 -1
  41. package/dist/cjs/common/types.d.ts +0 -22
  42. package/dist/cjs/common/types.d.ts.map +0 -1
  43. package/dist/cjs/common/types.js +0 -3
  44. package/dist/cjs/common/types.js.map +0 -1
  45. package/dist/cjs/common/utilities.d.ts +0 -38
  46. package/dist/cjs/common/utilities.d.ts.map +0 -1
  47. package/dist/cjs/common/utilities.js +0 -83
  48. package/dist/cjs/common/utilities.js.map +0 -1
  49. package/dist/cjs/index.d.ts +0 -4
  50. package/dist/cjs/index.d.ts.map +0 -1
  51. package/dist/cjs/index.js +0 -26
  52. package/dist/cjs/index.js.map +0 -1
  53. package/dist/cjs/modules/binding/binding.d.ts +0 -37
  54. package/dist/cjs/modules/binding/binding.d.ts.map +0 -1
  55. package/dist/cjs/modules/binding/binding.js +0 -120
  56. package/dist/cjs/modules/binding/binding.js.map +0 -1
  57. package/dist/cjs/modules/binding/common/constants.d.ts +0 -19
  58. package/dist/cjs/modules/binding/common/constants.d.ts.map +0 -1
  59. package/dist/cjs/modules/binding/common/constants.js +0 -33
  60. package/dist/cjs/modules/binding/common/constants.js.map +0 -1
  61. package/dist/cjs/modules/binding/common/index.d.ts +0 -3
  62. package/dist/cjs/modules/binding/common/index.d.ts.map +0 -1
  63. package/dist/cjs/modules/binding/common/index.js +0 -19
  64. package/dist/cjs/modules/binding/common/index.js.map +0 -1
  65. package/dist/cjs/modules/binding/common/types.d.ts +0 -28
  66. package/dist/cjs/modules/binding/common/types.d.ts.map +0 -1
  67. package/dist/cjs/modules/binding/common/types.js +0 -8
  68. package/dist/cjs/modules/binding/common/types.js.map +0 -1
  69. package/dist/cjs/modules/binding/index.d.ts +0 -3
  70. package/dist/cjs/modules/binding/index.d.ts.map +0 -1
  71. package/dist/cjs/modules/binding/index.js +0 -19
  72. package/dist/cjs/modules/binding/index.js.map +0 -1
  73. package/dist/cjs/modules/container/abstract.d.ts +0 -69
  74. package/dist/cjs/modules/container/abstract.d.ts.map +0 -1
  75. package/dist/cjs/modules/container/abstract.js +0 -12
  76. package/dist/cjs/modules/container/abstract.js.map +0 -1
  77. package/dist/cjs/modules/container/base.d.ts +0 -101
  78. package/dist/cjs/modules/container/base.d.ts.map +0 -1
  79. package/dist/cjs/modules/container/base.js +0 -193
  80. package/dist/cjs/modules/container/base.js.map +0 -1
  81. package/dist/cjs/modules/container/common/index.d.ts +0 -2
  82. package/dist/cjs/modules/container/common/index.d.ts.map +0 -1
  83. package/dist/cjs/modules/container/common/index.js +0 -18
  84. package/dist/cjs/modules/container/common/index.js.map +0 -1
  85. package/dist/cjs/modules/container/common/types.d.ts +0 -60
  86. package/dist/cjs/modules/container/common/types.d.ts.map +0 -1
  87. package/dist/cjs/modules/container/common/types.js +0 -3
  88. package/dist/cjs/modules/container/common/types.js.map +0 -1
  89. package/dist/cjs/modules/container/container.d.ts +0 -24
  90. package/dist/cjs/modules/container/container.d.ts.map +0 -1
  91. package/dist/cjs/modules/container/container.js +0 -100
  92. package/dist/cjs/modules/container/container.js.map +0 -1
  93. package/dist/cjs/modules/container/index.d.ts +0 -5
  94. package/dist/cjs/modules/container/index.d.ts.map +0 -1
  95. package/dist/cjs/modules/container/index.js +0 -21
  96. package/dist/cjs/modules/container/index.js.map +0 -1
  97. package/dist/cjs/modules/error/app-error.d.ts +0 -32
  98. package/dist/cjs/modules/error/app-error.d.ts.map +0 -1
  99. package/dist/cjs/modules/error/app-error.js +0 -102
  100. package/dist/cjs/modules/error/app-error.js.map +0 -1
  101. package/dist/cjs/modules/error/common/index.d.ts +0 -2
  102. package/dist/cjs/modules/error/common/index.d.ts.map +0 -1
  103. package/dist/cjs/modules/error/common/index.js +0 -18
  104. package/dist/cjs/modules/error/common/index.js.map +0 -1
  105. package/dist/cjs/modules/error/common/types.d.ts +0 -76
  106. package/dist/cjs/modules/error/common/types.d.ts.map +0 -1
  107. package/dist/cjs/modules/error/common/types.js +0 -3
  108. package/dist/cjs/modules/error/common/types.js.map +0 -1
  109. package/dist/cjs/modules/error/definition.d.ts +0 -10
  110. package/dist/cjs/modules/error/definition.d.ts.map +0 -1
  111. package/dist/cjs/modules/error/definition.js +0 -12
  112. package/dist/cjs/modules/error/definition.js.map +0 -1
  113. package/dist/cjs/modules/error/index.d.ts +0 -6
  114. package/dist/cjs/modules/error/index.d.ts.map +0 -1
  115. package/dist/cjs/modules/error/index.js +0 -22
  116. package/dist/cjs/modules/error/index.js.map +0 -1
  117. package/dist/cjs/modules/error/message-code.d.ts +0 -28
  118. package/dist/cjs/modules/error/message-code.d.ts.map +0 -1
  119. package/dist/cjs/modules/error/message-code.js +0 -57
  120. package/dist/cjs/modules/error/message-code.js.map +0 -1
  121. package/dist/cjs/modules/error/message-template.d.ts +0 -19
  122. package/dist/cjs/modules/error/message-template.d.ts.map +0 -1
  123. package/dist/cjs/modules/error/message-template.js +0 -38
  124. package/dist/cjs/modules/error/message-template.js.map +0 -1
  125. package/dist/cjs/modules/index.d.ts +0 -6
  126. package/dist/cjs/modules/index.d.ts.map +0 -1
  127. package/dist/cjs/modules/index.js +0 -22
  128. package/dist/cjs/modules/index.js.map +0 -1
  129. package/dist/cjs/modules/metadata/common/constants.d.ts +0 -6
  130. package/dist/cjs/modules/metadata/common/constants.d.ts.map +0 -1
  131. package/dist/cjs/modules/metadata/common/constants.js +0 -9
  132. package/dist/cjs/modules/metadata/common/constants.js.map +0 -1
  133. package/dist/cjs/modules/metadata/common/index.d.ts +0 -2
  134. package/dist/cjs/modules/metadata/common/index.d.ts.map +0 -1
  135. package/dist/cjs/modules/metadata/common/index.js +0 -18
  136. package/dist/cjs/modules/metadata/common/index.js.map +0 -1
  137. package/dist/cjs/modules/metadata/index.d.ts +0 -3
  138. package/dist/cjs/modules/metadata/index.d.ts.map +0 -1
  139. package/dist/cjs/modules/metadata/index.js +0 -19
  140. package/dist/cjs/modules/metadata/index.js.map +0 -1
  141. package/dist/cjs/modules/metadata/injectors.d.ts +0 -16
  142. package/dist/cjs/modules/metadata/injectors.d.ts.map +0 -1
  143. package/dist/cjs/modules/metadata/injectors.js +0 -47
  144. package/dist/cjs/modules/metadata/injectors.js.map +0 -1
  145. package/dist/cjs/modules/registry/common/index.d.ts +0 -2
  146. package/dist/cjs/modules/registry/common/index.d.ts.map +0 -1
  147. package/dist/cjs/modules/registry/common/index.js +0 -18
  148. package/dist/cjs/modules/registry/common/index.js.map +0 -1
  149. package/dist/cjs/modules/registry/common/types.d.ts +0 -20
  150. package/dist/cjs/modules/registry/common/types.d.ts.map +0 -1
  151. package/dist/cjs/modules/registry/common/types.js +0 -3
  152. package/dist/cjs/modules/registry/common/types.js.map +0 -1
  153. package/dist/cjs/modules/registry/index.d.ts +0 -3
  154. package/dist/cjs/modules/registry/index.d.ts.map +0 -1
  155. package/dist/cjs/modules/registry/index.js +0 -19
  156. package/dist/cjs/modules/registry/index.js.map +0 -1
  157. package/dist/cjs/modules/registry/registry.d.ts +0 -66
  158. package/dist/cjs/modules/registry/registry.d.ts.map +0 -1
  159. package/dist/cjs/modules/registry/registry.js +0 -98
  160. package/dist/cjs/modules/registry/registry.js.map +0 -1
@@ -1,28 +0,0 @@
1
- import type { TNullable } from '../../common/types';
2
- import type { TError } from './common';
3
- type TErrorFactory = (opts: TError) => Error;
4
- export declare class MessageCode {
5
- static readonly SEPARATOR = ".";
6
- static readonly SEGMENT_PATTERN: RegExp;
7
- static readonly MIN_SEGMENTS = 2;
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;
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. */
19
- static build(opts: {
20
- parts: Array<string>;
21
- }): string;
22
- /** True when `code` is well-formed. Takes `unknown` because it guards codes arriving from outside - a guard that throws on the very input it exists to screen is not a guard. */
23
- static isValid(code: unknown): boolean;
24
- /** Normalizes an absent, empty or non-string code to {@link DEFAULT}. */
25
- static resolve(code?: TNullable<string>): string;
26
- }
27
- export {};
28
- //# sourceMappingURL=message-code.d.ts.map
@@ -1 +0,0 @@
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,CAEiE;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,57 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MessageCode = void 0;
4
- class MessageCode {
5
- static { this.SEPARATOR = '.'; }
6
- static { this.SEGMENT_PATTERN = /^[a-z0-9]+(_[a-z0-9]+)*$/; }
7
- static { this.MIN_SEGMENTS = 2; }
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) =>
11
- // eslint-disable-next-line venizia/no-new-error -- the bootstrap factory, replaced by getError at init
12
- new Error(typeof opts.message === 'string' ? opts.message : JSON.stringify(opts.message)); }
13
- /**
14
- * Registered by the package entry at module init; keeps the throws identical without a
15
- * static import of app-error (that import was the cycle).
16
- * @internal Framework wiring; consumers must not replace the factory.
17
- */
18
- static useErrorFactory(opts) {
19
- this.errorFactory = opts.factory;
20
- }
21
- /** 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. */
22
- static build(opts) {
23
- const { parts } = opts;
24
- if (parts.length < this.MIN_SEGMENTS) {
25
- throw this.errorFactory({
26
- messageCode: 'core.message_code.invalid_segment_count',
27
- message: `[MessageCode][build] A code needs at least ${this.MIN_SEGMENTS} segments (namespace + reason) | Got: ${JSON.stringify(parts)}`,
28
- });
29
- }
30
- for (const segment of parts) {
31
- if (!this.SEGMENT_PATTERN.test(segment)) {
32
- throw this.errorFactory({
33
- messageCode: 'core.message_code.invalid_segment_format',
34
- message: `[MessageCode][build] Invalid segment '${segment}' | Expected lower snake_case (a-z, 0-9, '_') | Full: ${JSON.stringify(parts)}`,
35
- });
36
- }
37
- }
38
- return parts.join(this.SEPARATOR).toLowerCase();
39
- }
40
- /** True when `code` is well-formed. Takes `unknown` because it guards codes arriving from outside - a guard that throws on the very input it exists to screen is not a guard. */
41
- static isValid(code) {
42
- if (typeof code !== 'string') {
43
- return false;
44
- }
45
- const segments = code.split(this.SEPARATOR);
46
- return (segments.length >= this.MIN_SEGMENTS &&
47
- segments.every((segment) => this.SEGMENT_PATTERN.test(segment)));
48
- }
49
- /** Normalizes an absent, empty or non-string code to {@link DEFAULT}. */
50
- static resolve(code) {
51
- return typeof code === 'string' && code.length
52
- ? code.toLowerCase()
53
- : this.DEFAULT.toLowerCase();
54
- }
55
- }
56
- exports.MessageCode = MessageCode;
57
- //# sourceMappingURL=message-code.js.map
@@ -1 +0,0 @@
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,CAAC,IAAI,EAAE,EAAE;IACpD,uGAAuG;IACvG,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,MAAM,IAAI,CAAC,YAAY,CAAC;gBACtB,WAAW,EAAE,yCAAyC;gBACtD,OAAO,EAAE,8CAA8C,IAAI,CAAC,YAAY,yCAAyC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;aACzI,CAAC,CAAC;QACL,CAAC;QAED,KAAK,MAAM,OAAO,IAAI,KAAK,EAAE,CAAC;YAC5B,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;gBACxC,MAAM,IAAI,CAAC,YAAY,CAAC;oBACtB,WAAW,EAAE,0CAA0C;oBACvD,OAAO,EAAE,yCAAyC,OAAO,yDAAyD,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;iBAC1I,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,CAAC;IAClD,CAAC;IAED,iLAAiL;IACjL,MAAM,CAAC,OAAO,CAAC,IAAa;QAC1B,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,OAAO,KAAK,CAAC;QACf,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAE5C,OAAO,CACL,QAAQ,CAAC,MAAM,IAAI,IAAI,CAAC,YAAY;YACpC,QAAQ,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAChE,CAAC;IACJ,CAAC;IAED,yEAAyE;IACzE,MAAM,CAAC,OAAO,CAAC,IAAwB;QACrC,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,MAAM;YAC5C,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE;YACpB,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;IACjC,CAAC;;AA9DH,kCA+DC","sourcesContent":["import type { TNullable } from '@/common/types';\nimport type { TError } from './common';\n\ntype TErrorFactory = (opts: TError) => Error;\n\nexport class MessageCode {\n static readonly SEPARATOR = '.';\n static readonly SEGMENT_PATTERN = /^[a-z0-9]+(_[a-z0-9]+)*$/;\n static readonly MIN_SEGMENTS = 2;\n static readonly DEFAULT = 'core.system_error';\n\n // The one permitted raw `new Error`, used only until `src/index.ts` registers `getError`.\n private static errorFactory: TErrorFactory = (opts) =>\n // eslint-disable-next-line venizia/no-new-error -- the bootstrap factory, replaced by getError at init\n new Error(typeof opts.message === 'string' ? opts.message : JSON.stringify(opts.message));\n\n /**\n * Registered by the package entry at module init; keeps the throws identical without a\n * static import of app-error (that import was the cycle).\n * @internal Framework wiring; consumers must not replace the factory.\n */\n static useErrorFactory(opts: { factory: TErrorFactory }): void {\n this.errorFactory = opts.factory;\n }\n\n /** 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. */\n static build(opts: { parts: Array<string> }): string {\n const { parts } = opts;\n\n if (parts.length < this.MIN_SEGMENTS) {\n throw this.errorFactory({\n messageCode: 'core.message_code.invalid_segment_count',\n message: `[MessageCode][build] A code needs at least ${this.MIN_SEGMENTS} segments (namespace + reason) | Got: ${JSON.stringify(parts)}`,\n });\n }\n\n for (const segment of parts) {\n if (!this.SEGMENT_PATTERN.test(segment)) {\n throw this.errorFactory({\n messageCode: 'core.message_code.invalid_segment_format',\n message: `[MessageCode][build] Invalid segment '${segment}' | Expected lower snake_case (a-z, 0-9, '_') | Full: ${JSON.stringify(parts)}`,\n });\n }\n }\n\n return parts.join(this.SEPARATOR).toLowerCase();\n }\n\n /** True when `code` is well-formed. Takes `unknown` because it guards codes arriving from outside - a guard that throws on the very input it exists to screen is not a guard. */\n static isValid(code: unknown): boolean {\n if (typeof code !== 'string') {\n return false;\n }\n\n const segments = code.split(this.SEPARATOR);\n\n return (\n segments.length >= this.MIN_SEGMENTS &&\n segments.every((segment) => this.SEGMENT_PATTERN.test(segment))\n );\n }\n\n /** Normalizes an absent, empty or non-string code to {@link DEFAULT}. */\n static resolve(code?: TNullable<string>): string {\n return typeof code === 'string' && code.length\n ? code.toLowerCase()\n : this.DEFAULT.toLowerCase();\n }\n}\n"]}
@@ -1,19 +0,0 @@
1
- /**
2
- * Fills a catalog template - `Only %{available} left of %{sku}` - from its args. The error keeps the
3
- * template in `message` and `normalized.text`, so a log redacts values by key and a client can
4
- * translate `code` + `args`; this is where a reader that wants the sentence gets it.
5
- */
6
- export declare class MessageTemplate {
7
- /**
8
- * Each `%{key}` replaced by `String(args[key])`. A key with no arg (absent or `undefined`) stays as
9
- * written and is listed in `missing`. Never throws: it runs inside the last-resort error handler.
10
- */
11
- static render(opts: {
12
- text: string;
13
- args: unknown;
14
- }): {
15
- text: string;
16
- missing: Array<string>;
17
- };
18
- }
19
- //# sourceMappingURL=message-template.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"message-template.d.ts","sourceRoot":"","sources":["../../../../src/modules/error/message-template.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,qBAAa,eAAe;IAC1B;;;OAGG;IACH,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;KAAE;CAuB/F"}
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MessageTemplate = void 0;
4
- /** `%{key}`: a placeholder a catalog message carries for one of its args. */
5
- const PLACEHOLDER_PATTERN = /%\{(\w+)\}/g;
6
- /**
7
- * Fills a catalog template - `Only %{available} left of %{sku}` - from its args. The error keeps the
8
- * template in `message` and `normalized.text`, so a log redacts values by key and a client can
9
- * translate `code` + `args`; this is where a reader that wants the sentence gets it.
10
- */
11
- class MessageTemplate {
12
- /**
13
- * Each `%{key}` replaced by `String(args[key])`. A key with no arg (absent or `undefined`) stays as
14
- * written and is listed in `missing`. Never throws: it runs inside the last-resort error handler.
15
- */
16
- static render(opts) {
17
- const { text, args } = opts;
18
- const values = typeof args === 'object' && args !== null ? args : {};
19
- const missing = new Set();
20
- const rendered = text.replace(PLACEHOLDER_PATTERN, (placeholder, key) => {
21
- const value = Object.hasOwn(values, key) ? Reflect.get(values, key) : undefined;
22
- if (value === undefined) {
23
- missing.add(key);
24
- return placeholder;
25
- }
26
- try {
27
- return String(value);
28
- }
29
- catch {
30
- // A null-prototype object has no `toString`; leave its placeholder rather than fail.
31
- return placeholder;
32
- }
33
- });
34
- return { text: rendered, missing: [...missing] };
35
- }
36
- }
37
- exports.MessageTemplate = MessageTemplate;
38
- //# sourceMappingURL=message-template.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"message-template.js","sourceRoot":"","sources":["../../../../src/modules/error/message-template.ts"],"names":[],"mappings":";;;AAAA,6EAA6E;AAC7E,MAAM,mBAAmB,GAAG,aAAa,CAAC;AAE1C;;;;GAIG;AACH,MAAa,eAAe;IAC1B;;;OAGG;IACH,MAAM,CAAC,MAAM,CAAC,IAAqC;QACjD,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;QAC5B,MAAM,MAAM,GAAG,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QACrE,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;QAElC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,mBAAmB,EAAE,CAAC,WAAW,EAAE,GAAW,EAAE,EAAE;YAC9E,MAAM,KAAK,GAAY,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YAEzF,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBACxB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;gBACjB,OAAO,WAAW,CAAC;YACrB,CAAC;YAED,IAAI,CAAC;gBACH,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;YACvB,CAAC;YAAC,MAAM,CAAC;gBACP,qFAAqF;gBACrF,OAAO,WAAW,CAAC;YACrB,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,EAAE,CAAC;IACnD,CAAC;CACF;AA5BD,0CA4BC","sourcesContent":["/** `%{key}`: a placeholder a catalog message carries for one of its args. */\nconst PLACEHOLDER_PATTERN = /%\\{(\\w+)\\}/g;\n\n/**\n * Fills a catalog template - `Only %{available} left of %{sku}` - from its args. The error keeps the\n * template in `message` and `normalized.text`, so a log redacts values by key and a client can\n * translate `code` + `args`; this is where a reader that wants the sentence gets it.\n */\nexport class MessageTemplate {\n /**\n * Each `%{key}` replaced by `String(args[key])`. A key with no arg (absent or `undefined`) stays as\n * written and is listed in `missing`. Never throws: it runs inside the last-resort error handler.\n */\n static render(opts: { text: string; args: unknown }): { text: string; missing: Array<string> } {\n const { text, args } = opts;\n const values = typeof args === 'object' && args !== null ? args : {};\n const missing = new Set<string>();\n\n const rendered = text.replace(PLACEHOLDER_PATTERN, (placeholder, key: string) => {\n const value: unknown = Object.hasOwn(values, key) ? Reflect.get(values, key) : undefined;\n\n if (value === undefined) {\n missing.add(key);\n return placeholder;\n }\n\n try {\n return String(value);\n } catch {\n // A null-prototype object has no `toString`; leave its placeholder rather than fail.\n return placeholder;\n }\n });\n\n return { text: rendered, missing: [...missing] };\n }\n}\n"]}
@@ -1,6 +0,0 @@
1
- export * from './binding';
2
- export * from './container';
3
- export * from './error';
4
- export * from './metadata';
5
- export * from './registry';
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
@@ -1,22 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./binding"), exports);
18
- __exportStar(require("./container"), exports);
19
- __exportStar(require("./error"), exports);
20
- __exportStar(require("./metadata"), exports);
21
- __exportStar(require("./registry"), exports);
22
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,8CAA4B;AAC5B,0CAAwB;AACxB,6CAA2B;AAC3B,6CAA2B","sourcesContent":["export * from './binding';\nexport * from './container';\nexport * from './error';\nexport * from './metadata';\nexport * from './registry';\n"]}
@@ -1,6 +0,0 @@
1
- export declare const MetadataKeys: {
2
- PROPERTIES: symbol;
3
- INJECT: symbol;
4
- BINDING_KEY: symbol;
5
- };
6
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/modules/metadata/common/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY;;;;CAIxB,CAAC"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MetadataKeys = void 0;
4
- exports.MetadataKeys = {
5
- PROPERTIES: Symbol.for('ignis:properties'),
6
- INJECT: Symbol.for('ignis:inject'),
7
- BINDING_KEY: Symbol.for('ignis:binding-key'),
8
- };
9
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/modules/metadata/common/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG;IAC1B,UAAU,EAAE,MAAM,CAAC,GAAG,CAAC,kBAAkB,CAAC;IAC1C,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC;IAClC,WAAW,EAAE,MAAM,CAAC,GAAG,CAAC,mBAAmB,CAAC;CAC7C,CAAC","sourcesContent":["export const MetadataKeys = {\n PROPERTIES: Symbol.for('ignis:properties'),\n INJECT: Symbol.for('ignis:inject'),\n BINDING_KEY: Symbol.for('ignis:binding-key'),\n};\n"]}
@@ -1,2 +0,0 @@
1
- export * from './constants';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/metadata/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./constants"), exports);
18
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/metadata/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B","sourcesContent":["export * from './constants';\n"]}
@@ -1,3 +0,0 @@
1
- export * from './common';
2
- export * from './injectors';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/metadata/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC"}
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./common"), exports);
18
- __exportStar(require("./injectors"), exports);
19
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/metadata/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,8CAA4B","sourcesContent":["export * from './common';\nexport * from './injectors';\n"]}
@@ -1,16 +0,0 @@
1
- import { type TBindingKey, type TInjectTarget } from '../../common/types';
2
- import { type MetadataRegistry } from '../registry';
3
- /** Either a key, or the class bound under it - never both. The class may be named directly or through a function, which defers the reference past an import cycle. */
4
- export type TInjectOptions = {
5
- isOptional?: boolean;
6
- registry?: MetadataRegistry;
7
- } & ({
8
- key: TBindingKey;
9
- target?: never;
10
- } | {
11
- target: TInjectTarget;
12
- key?: never;
13
- });
14
- /** Marks a property or constructor parameter for dependency injection. */
15
- export declare const inject: (opts: TInjectOptions) => (target: any, propertyName: string | symbol | undefined, parameterIndex?: number) => void;
16
- //# sourceMappingURL=injectors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"injectors.d.ts","sourceRoot":"","sources":["../../../../src/modules/metadata/injectors.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,KAAK,gBAAgB,EAAoB,MAAM,oBAAoB,CAAC;AAE7E,sKAAsK;AACtK,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;CAC7B,GAAG,CAAC;IAAE,GAAG,EAAE,WAAW,CAAC;IAAC,MAAM,CAAC,EAAE,KAAK,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,GAAG,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC;AAEpF,0EAA0E;AAC1E,eAAO,MAAM,MAAM,GAAI,MAAM,cAAc,MAWjC,QAAQ,GAAG,EAAE,cAAc,MAAM,GAAG,MAAM,GAAG,SAAS,EAAE,iBAAiB,MAAM,SAgCxF,CAAC"}
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.inject = void 0;
4
- const error_1 = require("../error");
5
- const registry_1 = require("../registry");
6
- /** Marks a property or constructor parameter for dependency injection. */
7
- const inject = (opts) => {
8
- const { key, target: injected } = opts;
9
- // A circular import leaves `target` undefined; fail here, not at resolve time. A function is the
10
- // deferred form - what it returns is checked when the container resolves it.
11
- if (key === undefined && typeof injected !== 'function') {
12
- throw (0, error_1.getError)({
13
- message: `@inject was given no binding key and no class | target: ${String(injected)}`,
14
- });
15
- }
16
- return (target, propertyName, parameterIndex) => {
17
- const registry = opts.registry ?? registry_1.metadataRegistry;
18
- if (typeof parameterIndex === 'number') {
19
- registry.setInjectMetadata({
20
- target,
21
- index: parameterIndex,
22
- metadata: {
23
- ...(key === undefined ? { target: injected } : { key }),
24
- index: parameterIndex,
25
- isOptional: opts.isOptional ?? false,
26
- },
27
- });
28
- return;
29
- }
30
- if (propertyName !== undefined) {
31
- registry.setPropertyMetadata({
32
- target,
33
- propertyName: propertyName,
34
- metadata: {
35
- ...(key === undefined ? { target: injected } : { bindingKey: key }),
36
- isOptional: opts.isOptional ?? false,
37
- },
38
- });
39
- return;
40
- }
41
- throw (0, error_1.getError)({
42
- message: '@inject decorator can only be used on class properties or constructor parameters',
43
- });
44
- };
45
- };
46
- exports.inject = inject;
47
- //# sourceMappingURL=injectors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"injectors.js","sourceRoot":"","sources":["../../../../src/modules/metadata/injectors.ts"],"names":[],"mappings":";;;AAAA,2CAA2C;AAE3C,iDAA6E;AAQ7E,0EAA0E;AACnE,MAAM,MAAM,GAAG,CAAC,IAAoB,EAAE,EAAE;IAC7C,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAEvC,iGAAiG;IACjG,6EAA6E;IAC7E,IAAI,GAAG,KAAK,SAAS,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;QACxD,MAAM,IAAA,gBAAQ,EAAC;YACb,OAAO,EAAE,2DAA2D,MAAM,CAAC,QAAQ,CAAC,EAAE;SACvF,CAAC,CAAC;IACL,CAAC;IAED,OAAO,CAAC,MAAW,EAAE,YAAyC,EAAE,cAAuB,EAAE,EAAE;QACzF,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,2BAAgB,CAAC;QAEnD,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE,CAAC;YACvC,QAAQ,CAAC,iBAAiB,CAAC;gBACzB,MAAM;gBACN,KAAK,EAAE,cAAc;gBACrB,QAAQ,EAAE;oBACR,GAAG,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC;oBACvD,KAAK,EAAE,cAAc;oBACrB,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,KAAK;iBACrC;aACF,CAAC,CAAC;YACH,OAAO;QACT,CAAC;QAED,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;YAC/B,QAAQ,CAAC,mBAAmB,CAAC;gBAC3B,MAAM;gBACN,YAAY,EAAE,YAAY;gBAC1B,QAAQ,EAAE;oBACR,GAAG,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC;oBACnE,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,KAAK;iBACrC;aACF,CAAC,CAAC;YACH,OAAO;QACT,CAAC;QAED,MAAM,IAAA,gBAAQ,EAAC;YACb,OAAO,EAAE,kFAAkF;SAC5F,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC,CAAC;AA3CW,QAAA,MAAM,UA2CjB","sourcesContent":["import { getError } from '@/modules/error';\nimport { type TBindingKey, type TInjectTarget } from '@/common/types';\nimport { type MetadataRegistry, metadataRegistry } from '@/modules/registry';\n\n/** Either a key, or the class bound under it - never both. The class may be named directly or through a function, which defers the reference past an import cycle. */\nexport type TInjectOptions = {\n isOptional?: boolean;\n registry?: MetadataRegistry;\n} & ({ key: TBindingKey; target?: never } | { target: TInjectTarget; key?: never });\n\n/** Marks a property or constructor parameter for dependency injection. */\nexport const inject = (opts: TInjectOptions) => {\n const { key, target: injected } = opts;\n\n // A circular import leaves `target` undefined; fail here, not at resolve time. A function is the\n // deferred form - what it returns is checked when the container resolves it.\n if (key === undefined && typeof injected !== 'function') {\n throw getError({\n message: `@inject was given no binding key and no class | target: ${String(injected)}`,\n });\n }\n\n return (target: any, propertyName: string | symbol | undefined, parameterIndex?: number) => {\n const registry = opts.registry ?? metadataRegistry;\n\n if (typeof parameterIndex === 'number') {\n registry.setInjectMetadata({\n target,\n index: parameterIndex,\n metadata: {\n ...(key === undefined ? { target: injected } : { key }),\n index: parameterIndex,\n isOptional: opts.isOptional ?? false,\n },\n });\n return;\n }\n\n if (propertyName !== undefined) {\n registry.setPropertyMetadata({\n target,\n propertyName: propertyName,\n metadata: {\n ...(key === undefined ? { target: injected } : { bindingKey: key }),\n isOptional: opts.isOptional ?? false,\n },\n });\n return;\n }\n\n throw getError({\n message: '@inject decorator can only be used on class properties or constructor parameters',\n });\n };\n};\n"]}
@@ -1,2 +0,0 @@
1
- export * from './types';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/registry/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./types"), exports);
18
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/registry/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB","sourcesContent":["export * from './types';\n"]}
@@ -1,20 +0,0 @@
1
- import type { TBindingKey, TInjectTarget } from '../../../common/types';
2
- export interface IPropertyMetadata {
3
- bindingKey?: TBindingKey;
4
- /** Named by class, or by a function returning it; the key is read off the class at resolve time. */
5
- target?: TInjectTarget;
6
- isOptional?: boolean;
7
- }
8
- export interface IInjectMetadata {
9
- key?: TBindingKey;
10
- /** Named by class, or by a function returning it; the key is read off the class at resolve time. */
11
- target?: TInjectTarget;
12
- index: number;
13
- isOptional?: boolean;
14
- }
15
- /** What `MetadataKeys.BINDING_KEY` holds. */
16
- export interface IBindingKeyRecord {
17
- key: TBindingKey;
18
- isProvisional: boolean;
19
- }
20
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/modules/registry/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGjE,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,WAAW,CAAC;IACzB,oGAAoG;IACpG,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,GAAG,CAAC,EAAE,WAAW,CAAC;IAClB,oGAAoG;IACpG,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,6CAA6C;AAC7C,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,WAAW,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;CACxB"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/modules/registry/common/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TBindingKey, TInjectTarget } from '@/common/types';\n\n// No index signature: it would let a misspelled read (`metadata.optional`) compile as `any`.\nexport interface IPropertyMetadata {\n bindingKey?: TBindingKey;\n /** Named by class, or by a function returning it; the key is read off the class at resolve time. */\n target?: TInjectTarget;\n isOptional?: boolean;\n}\n\nexport interface IInjectMetadata {\n key?: TBindingKey;\n /** Named by class, or by a function returning it; the key is read off the class at resolve time. */\n target?: TInjectTarget;\n index: number;\n isOptional?: boolean;\n}\n\n/** What `MetadataKeys.BINDING_KEY` holds. */\nexport interface IBindingKeyRecord {\n key: TBindingKey;\n isProvisional: boolean;\n}\n"]}
@@ -1,3 +0,0 @@
1
- export * from './common';
2
- export * from './registry';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/registry/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC"}
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./common"), exports);
18
- __exportStar(require("./registry"), exports);
19
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/registry/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,6CAA2B","sourcesContent":["export * from './common';\nexport * from './registry';\n"]}
@@ -1,66 +0,0 @@
1
- import 'reflect-metadata';
2
- import { BaseHelper } from '../../common/base-helper';
3
- import { type TBindingKey, type TClass } from '../../common/types';
4
- import { type IInjectMetadata, type IPropertyMetadata } from './common/types';
5
- /** Central metadata registry for storing and retrieving decorator metadata. */
6
- export declare class MetadataRegistry extends BaseHelper {
7
- constructor();
8
- define<Target extends object = object, Value = any>(opts: {
9
- target: Target;
10
- key: TBindingKey;
11
- value: Value;
12
- }): void;
13
- get<Target extends object = object, Value = any>(opts: {
14
- target: Target;
15
- key: TBindingKey;
16
- }): Value | undefined;
17
- has<Target extends object = object>(opts: {
18
- target: Target;
19
- key: TBindingKey;
20
- }): boolean;
21
- delete<Target extends object = object>(opts: {
22
- target: Target;
23
- key: TBindingKey;
24
- }): boolean;
25
- getKeys<Target extends object = object>(opts: {
26
- target: Target;
27
- }): TBindingKey[];
28
- getMethodNames<T = any>(opts: {
29
- target: TClass<T>;
30
- }): string[];
31
- clearMetadata<T extends object = object>(opts: {
32
- target: T;
33
- }): void;
34
- setPropertyMetadata<T extends object = object>(opts: {
35
- target: T;
36
- propertyName: string | symbol;
37
- metadata: IPropertyMetadata;
38
- }): void;
39
- getPropertiesMetadata<T extends object = object>(opts: {
40
- target: T;
41
- }): Map<string | symbol, IPropertyMetadata> | undefined;
42
- getPropertyMetadata<T extends object = object>(opts: {
43
- target: T;
44
- propertyName: string | symbol;
45
- }): IPropertyMetadata | undefined;
46
- setInjectMetadata<T extends object = object>(opts: {
47
- target: T;
48
- index: number;
49
- metadata: IInjectMetadata;
50
- }): void;
51
- getInjectMetadata<T extends object = object>(opts: {
52
- target: T;
53
- }): IInjectMetadata[] | undefined;
54
- /** `isProvisional` marks a DERIVED key; a registration replaces it silently, having seen the call-site override. */
55
- setBindingKey<T extends object = object>(opts: {
56
- target: T;
57
- key: TBindingKey;
58
- isProvisional?: boolean;
59
- }): void;
60
- /** Own metadata only: a subclass is not registered, and the parent key would resolve the wrong binding. */
61
- getBindingKey<T extends object = object>(opts: {
62
- target: T;
63
- }): TBindingKey | undefined;
64
- }
65
- export declare const metadataRegistry: MetadataRegistry;
66
- //# sourceMappingURL=registry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/modules/registry/registry.ts"],"names":[],"mappings":"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"}