@cullet/erp-core 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/KIT_CONTEXT.md +1 -67
  2. package/dist/app-error.d.cts +108 -0
  3. package/dist/application/index.cjs +26 -0
  4. package/dist/application/index.d.cts +2 -0
  5. package/dist/application/index.d.ts +1 -1
  6. package/dist/application/index.js +2 -1
  7. package/dist/domain/index.cjs +16 -0
  8. package/dist/domain/index.d.cts +3 -0
  9. package/dist/domain/index.d.ts +3 -0
  10. package/dist/domain/index.js +3 -0
  11. package/dist/domain-event-contracts.cjs +33 -0
  12. package/dist/domain-event-contracts.cjs.map +1 -0
  13. package/dist/domain-event-contracts.d.cts +27 -0
  14. package/dist/domain-event-contracts.d.ts +27 -0
  15. package/dist/domain-event-contracts.js +22 -0
  16. package/dist/domain-event-contracts.js.map +1 -0
  17. package/dist/domain-exception.cjs +17 -0
  18. package/dist/domain-exception.cjs.map +1 -0
  19. package/dist/domain-exception.d.cts +7 -0
  20. package/dist/domain-exception.d.ts +7 -0
  21. package/dist/domain-exception.js +12 -0
  22. package/dist/domain-exception.js.map +1 -0
  23. package/dist/errors/index.cjs +41 -0
  24. package/dist/errors/index.d.cts +3 -0
  25. package/dist/errors/index.js +1 -1
  26. package/dist/exceptions/index.cjs +17 -0
  27. package/dist/exceptions/index.d.cts +5 -0
  28. package/dist/exceptions/index.d.ts +5 -0
  29. package/dist/exceptions/index.js +7 -0
  30. package/dist/exceptions/validation-field.cjs +3 -0
  31. package/dist/exceptions/validation-field.d.cts +2 -0
  32. package/dist/gate-engine-registry.cjs +308 -0
  33. package/dist/gate-engine-registry.cjs.map +1 -0
  34. package/dist/gate-engine-registry.d.cts +81 -0
  35. package/dist/gate-engine-registry.d.ts +2 -1
  36. package/dist/gate-engine-registry.js +2 -1
  37. package/dist/gate-engine-registry.js.map +1 -1
  38. package/dist/gate-types.d.cts +171 -0
  39. package/dist/gate-types.d.ts +3 -139
  40. package/dist/gate-v1-payload.schema.cjs +638 -0
  41. package/dist/gate-v1-payload.schema.cjs.map +1 -0
  42. package/dist/gate-v1-payload.schema.js +2 -116
  43. package/dist/gate-v1-payload.schema.js.map +1 -1
  44. package/dist/hashing.cjs +66 -0
  45. package/dist/hashing.cjs.map +1 -0
  46. package/dist/immutable.cjs +77 -0
  47. package/dist/immutable.cjs.map +1 -0
  48. package/dist/immutable.d.cts +6 -0
  49. package/dist/immutable.d.ts +6 -0
  50. package/dist/immutable.js +54 -0
  51. package/dist/immutable.js.map +1 -0
  52. package/dist/index.cjs +163 -0
  53. package/dist/index.cjs.map +1 -0
  54. package/dist/index.d.cts +30 -0
  55. package/dist/index.d.ts +15 -160
  56. package/dist/index.js +19 -176
  57. package/dist/index.js.map +1 -1
  58. package/dist/invalid-state-transition-exception.cjs +47 -0
  59. package/dist/invalid-state-transition-exception.cjs.map +1 -0
  60. package/dist/invalid-state-transition-exception.js +30 -0
  61. package/dist/invalid-state-transition-exception.js.map +1 -0
  62. package/dist/invariant-violation-exception.cjs +16 -0
  63. package/dist/invariant-violation-exception.cjs.map +1 -0
  64. package/dist/invariant-violation-exception.js +11 -0
  65. package/dist/invariant-violation-exception.js.map +1 -0
  66. package/dist/not-found-error.cjs +65 -0
  67. package/dist/not-found-error.cjs.map +1 -0
  68. package/dist/not-found-error.js +1 -1
  69. package/dist/outcome.cjs +97 -0
  70. package/dist/outcome.cjs.map +1 -0
  71. package/dist/outcome.d.cts +140 -0
  72. package/dist/outcome.d.ts +140 -0
  73. package/dist/outcome.js +1 -1
  74. package/dist/parse-gate-payload.d.cts +62 -0
  75. package/dist/parse-gate-payload.d.ts +2 -1
  76. package/dist/path.d.cts +90 -0
  77. package/dist/path.d.ts +2 -1
  78. package/dist/plugin.cjs +79 -0
  79. package/dist/plugin.cjs.map +1 -0
  80. package/dist/plugin.d.cts +85 -0
  81. package/dist/plugin.d.ts +85 -0
  82. package/dist/plugin.js +74 -0
  83. package/dist/plugin.js.map +1 -0
  84. package/dist/plugins/index.cjs +3 -0
  85. package/dist/plugins/index.d.cts +2 -0
  86. package/dist/plugins/index.d.ts +2 -0
  87. package/dist/plugins/index.js +2 -0
  88. package/dist/policies/engines/index.cjs +10 -0
  89. package/dist/policies/engines/index.d.cts +4 -0
  90. package/dist/policies/engines/index.d.ts +1 -1
  91. package/dist/policies/engines/v1/gate/index.cjs +91 -0
  92. package/dist/policies/engines/v1/gate/index.cjs.map +1 -0
  93. package/dist/policies/engines/v1/gate/index.d.cts +121 -0
  94. package/dist/policies/engines/v1/gate/index.d.ts +2 -1
  95. package/dist/policies/engines/v1/gate/index.js +2 -1
  96. package/dist/policies/engines/v1/gate/index.js.map +1 -1
  97. package/dist/policies/index.cjs +41 -0
  98. package/dist/policies/index.d.cts +7 -0
  99. package/dist/policies/index.d.ts +2 -1
  100. package/dist/policies/index.js +2 -1
  101. package/dist/policy-service.cjs +1190 -0
  102. package/dist/policy-service.cjs.map +1 -0
  103. package/dist/policy-service.d.cts +559 -0
  104. package/dist/policy-service.d.ts +2 -1
  105. package/dist/policy-service.js +6 -3
  106. package/dist/policy-service.js.map +1 -1
  107. package/dist/result/index.cjs +7 -0
  108. package/dist/result/index.d.cts +2 -0
  109. package/dist/result/index.d.ts +2 -0
  110. package/dist/result/index.js +3 -0
  111. package/dist/result.cjs +135 -0
  112. package/dist/result.cjs.map +1 -0
  113. package/dist/result.js +118 -0
  114. package/dist/result.js.map +1 -0
  115. package/dist/ruleset-registry.cjs +47 -0
  116. package/dist/ruleset-registry.cjs.map +1 -0
  117. package/dist/ruleset-registry.js +42 -0
  118. package/dist/ruleset-registry.js.map +1 -0
  119. package/dist/rulesets/index.cjs +3 -0
  120. package/dist/rulesets/index.d.cts +2 -0
  121. package/dist/rulesets/index.d.ts +2 -0
  122. package/dist/rulesets/index.js +2 -0
  123. package/dist/temporal-guards.cjs +32 -0
  124. package/dist/temporal-guards.cjs.map +1 -0
  125. package/dist/temporal-guards.js +2 -17
  126. package/dist/temporal-guards.js.map +1 -1
  127. package/dist/temporal-use-case.cjs +191 -0
  128. package/dist/temporal-use-case.cjs.map +1 -0
  129. package/dist/temporal-use-case.d.cts +304 -0
  130. package/dist/temporal-use-case.d.ts +4 -9
  131. package/dist/temporal-use-case.js +6 -140
  132. package/dist/temporal-use-case.js.map +1 -1
  133. package/dist/unexpected-error.cjs +208 -0
  134. package/dist/unexpected-error.cjs.map +1 -0
  135. package/dist/unexpected-error.js +179 -0
  136. package/dist/unexpected-error.js.map +1 -0
  137. package/dist/use-case.cjs +96 -0
  138. package/dist/use-case.cjs.map +1 -0
  139. package/dist/use-case.js +91 -0
  140. package/dist/use-case.js.map +1 -0
  141. package/dist/uuid-identifier.cjs +65 -0
  142. package/dist/uuid-identifier.cjs.map +1 -0
  143. package/dist/uuid-identifier.d.cts +230 -0
  144. package/dist/uuid-identifier.d.ts +230 -0
  145. package/dist/uuid-identifier.js +60 -0
  146. package/dist/uuid-identifier.js.map +1 -0
  147. package/dist/validation-code.cjs +60 -0
  148. package/dist/validation-code.cjs.map +1 -0
  149. package/dist/validation-code.d.cts +23 -0
  150. package/dist/validation-code.d.ts +23 -0
  151. package/dist/validation-code.js +1 -177
  152. package/dist/validation-code.js.map +1 -1
  153. package/dist/validation-error.cjs +1020 -0
  154. package/dist/validation-error.cjs.map +1 -0
  155. package/dist/validation-error.d.cts +777 -0
  156. package/dist/validation-error.d.ts +1 -21
  157. package/dist/validation-error.js +1 -1
  158. package/dist/validation-exception.cjs +41 -0
  159. package/dist/validation-exception.cjs.map +1 -0
  160. package/dist/validation-exception.d.cts +50 -0
  161. package/dist/validation-exception.d.ts +50 -0
  162. package/dist/validation-exception.js +8 -2
  163. package/dist/validation-exception.js.map +1 -1
  164. package/dist/validation-field.cjs +28 -0
  165. package/dist/validation-field.cjs.map +1 -0
  166. package/dist/validation-field.d.cts +12 -0
  167. package/dist/value-object-ruleset.contracts.d.cts +36 -0
  168. package/dist/value-object-ruleset.contracts.d.ts +36 -0
  169. package/dist/value-object.cjs +208 -0
  170. package/dist/value-object.cjs.map +1 -0
  171. package/dist/value-object.js +191 -0
  172. package/dist/value-object.js.map +1 -0
  173. package/dist/version.d.cts +10 -0
  174. package/dist/version.d.ts +10 -0
  175. package/dist/versioning/index.cjs +7 -0
  176. package/dist/versioning/index.d.cts +3 -0
  177. package/dist/versioning/index.d.ts +3 -0
  178. package/dist/versioning/index.js +3 -0
  179. package/meta.json +18 -3
  180. package/package.json +165 -17
  181. package/src/core/domain/rulesets/index.ts +7 -0
  182. package/src/core/domain/uuid-identifier.ts +72 -0
  183. package/src/core/domain/value-object.ts +37 -5
  184. package/src/core/exceptions/index.ts +13 -0
  185. package/src/core/index.ts +14 -2
  186. package/src/core/plugins/index.ts +7 -0
  187. package/src/core/plugins/plugin.ts +99 -0
  188. package/src/core/plugins/types.ts +53 -0
  189. package/src/core/versioning/index.ts +14 -0
  190. package/src/domain/index.ts +7 -0
  191. package/src/exceptions/index.ts +1 -0
  192. package/src/plugins/index.ts +1 -0
  193. package/src/result/index.ts +2 -0
  194. package/src/rulesets/index.ts +1 -0
  195. package/src/version.ts +1 -1
  196. package/src/versioning/index.ts +1 -0
@@ -0,0 +1,77 @@
1
+ const require_invariant_violation_exception = require("./invariant-violation-exception.cjs");
2
+ //#region src/core/versioning/version.ts
3
+ const CONTRACT_VERSION_PROPERTY = "CONTRACT_VERSION";
4
+ const CONTRACT_VERSION_PATTERN = /^\d+\.\d+$/;
5
+ function version(contractVersion) {
6
+ if (!CONTRACT_VERSION_PATTERN.test(contractVersion)) throw new TypeError(`Invalid contract version "${contractVersion}". Expected MAJOR.MINOR.`);
7
+ return (target) => {
8
+ Object.defineProperty(target, CONTRACT_VERSION_PROPERTY, {
9
+ value: contractVersion,
10
+ writable: false,
11
+ configurable: false,
12
+ enumerable: false
13
+ });
14
+ };
15
+ }
16
+ //#endregion
17
+ //#region \0@oxc-project+runtime@0.132.0/helpers/decorate.js
18
+ function __decorate(decorators, target, key, desc) {
19
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
20
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
21
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
22
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
23
+ }
24
+ //#endregion
25
+ //#region src/core/shared/immutable.ts
26
+ function deepFreeze(value) {
27
+ return deepFreezeInternal(value, /* @__PURE__ */ new WeakSet());
28
+ }
29
+ function deepFreezeInternal(value, seen) {
30
+ if (typeof value !== "object" || value === null || value instanceof Date) return value;
31
+ if (seen.has(value)) return value;
32
+ seen.add(value);
33
+ if (Array.isArray(value)) {
34
+ for (const item of value) deepFreezeInternal(item, seen);
35
+ return Object.freeze(value);
36
+ }
37
+ const objectValue = value;
38
+ for (const propertyKey of Reflect.ownKeys(objectValue)) deepFreezeInternal(objectValue[propertyKey], seen);
39
+ return Object.freeze(value);
40
+ }
41
+ function makeImmutable(value) {
42
+ if (typeof value !== "object" || value === null) return value;
43
+ let snapshot;
44
+ try {
45
+ snapshot = structuredClone(value);
46
+ } catch (error) {
47
+ throw new require_invariant_violation_exception.InvariantViolationException(`makeImmutable requires a structured-cloneable value: ${error instanceof Error ? error.message : String(error)}`);
48
+ }
49
+ return deepFreeze(snapshot);
50
+ }
51
+ //#endregion
52
+ Object.defineProperty(exports, "CONTRACT_VERSION_PROPERTY", {
53
+ enumerable: true,
54
+ get: function() {
55
+ return CONTRACT_VERSION_PROPERTY;
56
+ }
57
+ });
58
+ Object.defineProperty(exports, "__decorate", {
59
+ enumerable: true,
60
+ get: function() {
61
+ return __decorate;
62
+ }
63
+ });
64
+ Object.defineProperty(exports, "makeImmutable", {
65
+ enumerable: true,
66
+ get: function() {
67
+ return makeImmutable;
68
+ }
69
+ });
70
+ Object.defineProperty(exports, "version", {
71
+ enumerable: true,
72
+ get: function() {
73
+ return version;
74
+ }
75
+ });
76
+
77
+ //# sourceMappingURL=immutable.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"immutable.cjs","names":["InvariantViolationException"],"sources":["../src/core/versioning/version.ts","../src/core/shared/immutable.ts"],"sourcesContent":["type ContractVersion = `${number}.${number}`;\n\ntype VersionedTarget = {\n readonly prototype: object;\n};\n\nconst CONTRACT_VERSION_PROPERTY = \"CONTRACT_VERSION\" as const;\nconst CONTRACT_VERSION_PATTERN = /^\\d+\\.\\d+$/;\n\nfunction version<const TVersion extends ContractVersion>(\n contractVersion: TVersion,\n) {\n if (!CONTRACT_VERSION_PATTERN.test(contractVersion)) {\n throw new TypeError(\n `Invalid contract version \"${contractVersion}\". Expected MAJOR.MINOR.`,\n );\n }\n\n return (target: VersionedTarget): void => {\n Object.defineProperty(target, CONTRACT_VERSION_PROPERTY, {\n value: contractVersion,\n writable: false,\n configurable: false,\n enumerable: false,\n });\n };\n}\n\nexport {\n CONTRACT_VERSION_PROPERTY,\n type ContractVersion,\n version,\n type VersionedTarget,\n};\n","import { InvariantViolationException } from \"../exceptions/invariant-violation-exception.js\";\n\ntype PrimitiveValue =\n | bigint\n | boolean\n | null\n | number\n | string\n | symbol\n | undefined;\n\ntype DeepReadonly<T> = T extends PrimitiveValue | Date\n ? T\n : T extends readonly (infer TItem)[]\n ? readonly DeepReadonly<TItem>[]\n : { readonly [TKey in keyof T]: DeepReadonly<T[TKey]> };\n\nfunction deepFreeze<T>(value: T): T {\n return deepFreezeInternal(value, new WeakSet<object>());\n}\n\nfunction deepFreezeInternal<T>(value: T, seen: WeakSet<object>): T {\n // Primitives and `null` need no freezing. `Date` is intentionally returned\n // as-is: `Object.freeze` cannot stop a Date's mutators (`setTime`,\n // `setFullYear`, …) because they write an internal slot, not an own\n // property — freezing it is a no-op against mutation. `makeImmutable`\n // already hands us a `structuredClone` copy, so the caller's original Date\n // is never aliased; deep-freezing of nested Dates is deliberately skipped.\n if (typeof value !== \"object\" || value === null || value instanceof Date) {\n return value;\n }\n\n // A value already on `seen` has been visited on this pass (cyclic graph or a\n // shared reference); revisiting it would recurse forever.\n if (seen.has(value)) {\n return value;\n }\n seen.add(value);\n\n if (Array.isArray(value)) {\n for (const item of value) {\n deepFreezeInternal(item, seen);\n }\n\n return Object.freeze(value);\n }\n\n const objectValue = value as Record<PropertyKey, object | PrimitiveValue>;\n\n for (const propertyKey of Reflect.ownKeys(objectValue)) {\n deepFreezeInternal(objectValue[propertyKey], seen);\n }\n\n return Object.freeze(value);\n}\n\nfunction makeImmutable<T>(value: T): DeepReadonly<T> {\n if (typeof value !== \"object\" || value === null) {\n return value as DeepReadonly<T>;\n }\n\n let snapshot: T;\n try {\n snapshot = structuredClone(value);\n } catch (error) {\n // `structuredClone` throws `DataCloneError` for functions, symbols and\n // class instances. Surface it as a domain invariant instead of leaking\n // a host-specific runtime error to callers building value objects.\n throw new InvariantViolationException(\n `makeImmutable requires a structured-cloneable value: ${\n error instanceof Error ? error.message : String(error)\n }`,\n );\n }\n\n return deepFreeze(snapshot) as DeepReadonly<T>;\n}\n\nexport { deepFreeze, makeImmutable, type DeepReadonly };\n"],"mappings":";;AAMA,MAAM,4BAA4B;AAClC,MAAM,2BAA2B;AAEjC,SAAS,QACL,iBACF;CACE,IAAI,CAAC,yBAAyB,KAAK,eAAe,GAC9C,MAAM,IAAI,UACN,6BAA6B,gBAAgB,yBACjD;CAGJ,QAAQ,WAAkC;EACtC,OAAO,eAAe,QAAQ,2BAA2B;GACrD,OAAO;GACP,UAAU;GACV,cAAc;GACd,YAAY;EAChB,CAAC;CACL;AACJ;;;;;;;;;;;ACTA,SAAS,WAAc,OAAa;CAChC,OAAO,mBAAmB,uBAAO,IAAI,QAAgB,CAAC;AAC1D;AAEA,SAAS,mBAAsB,OAAU,MAA0B;CAO/D,IAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,iBAAiB,MAChE,OAAO;CAKX,IAAI,KAAK,IAAI,KAAK,GACd,OAAO;CAEX,KAAK,IAAI,KAAK;CAEd,IAAI,MAAM,QAAQ,KAAK,GAAG;EACtB,KAAK,MAAM,QAAQ,OACf,mBAAmB,MAAM,IAAI;EAGjC,OAAO,OAAO,OAAO,KAAK;CAC9B;CAEA,MAAM,cAAc;CAEpB,KAAK,MAAM,eAAe,QAAQ,QAAQ,WAAW,GACjD,mBAAmB,YAAY,cAAc,IAAI;CAGrD,OAAO,OAAO,OAAO,KAAK;AAC9B;AAEA,SAAS,cAAiB,OAA2B;CACjD,IAAI,OAAO,UAAU,YAAY,UAAU,MACvC,OAAO;CAGX,IAAI;CACJ,IAAI;EACA,WAAW,gBAAgB,KAAK;CACpC,SAAS,OAAO;EAIZ,MAAM,IAAIA,sCAAAA,4BACN,wDACI,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,GAE7D;CACJ;CAEA,OAAO,WAAW,QAAQ;AAC9B"}
@@ -0,0 +1,6 @@
1
+ //#region src/core/shared/immutable.d.ts
2
+ type PrimitiveValue = bigint | boolean | null | number | string | symbol | undefined;
3
+ type DeepReadonly<T> = T extends PrimitiveValue | Date ? T : T extends readonly (infer TItem)[] ? readonly DeepReadonly<TItem>[] : { readonly [TKey in keyof T]: DeepReadonly<T[TKey]> };
4
+ //#endregion
5
+ export { DeepReadonly as t };
6
+ //# sourceMappingURL=immutable.d.cts.map
@@ -0,0 +1,6 @@
1
+ //#region src/core/shared/immutable.d.ts
2
+ type PrimitiveValue = bigint | boolean | null | number | string | symbol | undefined;
3
+ type DeepReadonly<T> = T extends PrimitiveValue | Date ? T : T extends readonly (infer TItem)[] ? readonly DeepReadonly<TItem>[] : { readonly [TKey in keyof T]: DeepReadonly<T[TKey]> };
4
+ //#endregion
5
+ export { DeepReadonly as t };
6
+ //# sourceMappingURL=immutable.d.ts.map
@@ -0,0 +1,54 @@
1
+ import { t as InvariantViolationException } from "./invariant-violation-exception.js";
2
+ //#region src/core/versioning/version.ts
3
+ const CONTRACT_VERSION_PROPERTY = "CONTRACT_VERSION";
4
+ const CONTRACT_VERSION_PATTERN = /^\d+\.\d+$/;
5
+ function version(contractVersion) {
6
+ if (!CONTRACT_VERSION_PATTERN.test(contractVersion)) throw new TypeError(`Invalid contract version "${contractVersion}". Expected MAJOR.MINOR.`);
7
+ return (target) => {
8
+ Object.defineProperty(target, CONTRACT_VERSION_PROPERTY, {
9
+ value: contractVersion,
10
+ writable: false,
11
+ configurable: false,
12
+ enumerable: false
13
+ });
14
+ };
15
+ }
16
+ //#endregion
17
+ //#region \0@oxc-project+runtime@0.132.0/helpers/decorate.js
18
+ function __decorate(decorators, target, key, desc) {
19
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
20
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
21
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
22
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
23
+ }
24
+ //#endregion
25
+ //#region src/core/shared/immutable.ts
26
+ function deepFreeze(value) {
27
+ return deepFreezeInternal(value, /* @__PURE__ */ new WeakSet());
28
+ }
29
+ function deepFreezeInternal(value, seen) {
30
+ if (typeof value !== "object" || value === null || value instanceof Date) return value;
31
+ if (seen.has(value)) return value;
32
+ seen.add(value);
33
+ if (Array.isArray(value)) {
34
+ for (const item of value) deepFreezeInternal(item, seen);
35
+ return Object.freeze(value);
36
+ }
37
+ const objectValue = value;
38
+ for (const propertyKey of Reflect.ownKeys(objectValue)) deepFreezeInternal(objectValue[propertyKey], seen);
39
+ return Object.freeze(value);
40
+ }
41
+ function makeImmutable(value) {
42
+ if (typeof value !== "object" || value === null) return value;
43
+ let snapshot;
44
+ try {
45
+ snapshot = structuredClone(value);
46
+ } catch (error) {
47
+ throw new InvariantViolationException(`makeImmutable requires a structured-cloneable value: ${error instanceof Error ? error.message : String(error)}`);
48
+ }
49
+ return deepFreeze(snapshot);
50
+ }
51
+ //#endregion
52
+ export { version as i, __decorate as n, CONTRACT_VERSION_PROPERTY as r, makeImmutable as t };
53
+
54
+ //# sourceMappingURL=immutable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"immutable.js","names":[],"sources":["../src/core/versioning/version.ts","../src/core/shared/immutable.ts"],"sourcesContent":["type ContractVersion = `${number}.${number}`;\n\ntype VersionedTarget = {\n readonly prototype: object;\n};\n\nconst CONTRACT_VERSION_PROPERTY = \"CONTRACT_VERSION\" as const;\nconst CONTRACT_VERSION_PATTERN = /^\\d+\\.\\d+$/;\n\nfunction version<const TVersion extends ContractVersion>(\n contractVersion: TVersion,\n) {\n if (!CONTRACT_VERSION_PATTERN.test(contractVersion)) {\n throw new TypeError(\n `Invalid contract version \"${contractVersion}\". Expected MAJOR.MINOR.`,\n );\n }\n\n return (target: VersionedTarget): void => {\n Object.defineProperty(target, CONTRACT_VERSION_PROPERTY, {\n value: contractVersion,\n writable: false,\n configurable: false,\n enumerable: false,\n });\n };\n}\n\nexport {\n CONTRACT_VERSION_PROPERTY,\n type ContractVersion,\n version,\n type VersionedTarget,\n};\n","import { InvariantViolationException } from \"../exceptions/invariant-violation-exception.js\";\n\ntype PrimitiveValue =\n | bigint\n | boolean\n | null\n | number\n | string\n | symbol\n | undefined;\n\ntype DeepReadonly<T> = T extends PrimitiveValue | Date\n ? T\n : T extends readonly (infer TItem)[]\n ? readonly DeepReadonly<TItem>[]\n : { readonly [TKey in keyof T]: DeepReadonly<T[TKey]> };\n\nfunction deepFreeze<T>(value: T): T {\n return deepFreezeInternal(value, new WeakSet<object>());\n}\n\nfunction deepFreezeInternal<T>(value: T, seen: WeakSet<object>): T {\n // Primitives and `null` need no freezing. `Date` is intentionally returned\n // as-is: `Object.freeze` cannot stop a Date's mutators (`setTime`,\n // `setFullYear`, …) because they write an internal slot, not an own\n // property — freezing it is a no-op against mutation. `makeImmutable`\n // already hands us a `structuredClone` copy, so the caller's original Date\n // is never aliased; deep-freezing of nested Dates is deliberately skipped.\n if (typeof value !== \"object\" || value === null || value instanceof Date) {\n return value;\n }\n\n // A value already on `seen` has been visited on this pass (cyclic graph or a\n // shared reference); revisiting it would recurse forever.\n if (seen.has(value)) {\n return value;\n }\n seen.add(value);\n\n if (Array.isArray(value)) {\n for (const item of value) {\n deepFreezeInternal(item, seen);\n }\n\n return Object.freeze(value);\n }\n\n const objectValue = value as Record<PropertyKey, object | PrimitiveValue>;\n\n for (const propertyKey of Reflect.ownKeys(objectValue)) {\n deepFreezeInternal(objectValue[propertyKey], seen);\n }\n\n return Object.freeze(value);\n}\n\nfunction makeImmutable<T>(value: T): DeepReadonly<T> {\n if (typeof value !== \"object\" || value === null) {\n return value as DeepReadonly<T>;\n }\n\n let snapshot: T;\n try {\n snapshot = structuredClone(value);\n } catch (error) {\n // `structuredClone` throws `DataCloneError` for functions, symbols and\n // class instances. Surface it as a domain invariant instead of leaking\n // a host-specific runtime error to callers building value objects.\n throw new InvariantViolationException(\n `makeImmutable requires a structured-cloneable value: ${\n error instanceof Error ? error.message : String(error)\n }`,\n );\n }\n\n return deepFreeze(snapshot) as DeepReadonly<T>;\n}\n\nexport { deepFreeze, makeImmutable, type DeepReadonly };\n"],"mappings":";;AAMA,MAAM,4BAA4B;AAClC,MAAM,2BAA2B;AAEjC,SAAS,QACL,iBACF;CACE,IAAI,CAAC,yBAAyB,KAAK,eAAe,GAC9C,MAAM,IAAI,UACN,6BAA6B,gBAAgB,yBACjD;CAGJ,QAAQ,WAAkC;EACtC,OAAO,eAAe,QAAQ,2BAA2B;GACrD,OAAO;GACP,UAAU;GACV,cAAc;GACd,YAAY;EAChB,CAAC;CACL;AACJ;;;;;;;;;;;ACTA,SAAS,WAAc,OAAa;CAChC,OAAO,mBAAmB,uBAAO,IAAI,QAAgB,CAAC;AAC1D;AAEA,SAAS,mBAAsB,OAAU,MAA0B;CAO/D,IAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,iBAAiB,MAChE,OAAO;CAKX,IAAI,KAAK,IAAI,KAAK,GACd,OAAO;CAEX,KAAK,IAAI,KAAK;CAEd,IAAI,MAAM,QAAQ,KAAK,GAAG;EACtB,KAAK,MAAM,QAAQ,OACf,mBAAmB,MAAM,IAAI;EAGjC,OAAO,OAAO,OAAO,KAAK;CAC9B;CAEA,MAAM,cAAc;CAEpB,KAAK,MAAM,eAAe,QAAQ,QAAQ,WAAW,GACjD,mBAAmB,YAAY,cAAc,IAAI;CAGrD,OAAO,OAAO,OAAO,KAAK;AAC9B;AAEA,SAAS,cAAiB,OAA2B;CACjD,IAAI,OAAO,UAAU,YAAY,UAAU,MACvC,OAAO;CAGX,IAAI;CACJ,IAAI;EACA,WAAW,gBAAgB,KAAK;CACpC,SAAS,OAAO;EAIZ,MAAM,IAAI,4BACN,wDACI,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,GAE7D;CACJ;CAEA,OAAO,WAAW,QAAQ;AAC9B"}
package/dist/index.cjs ADDED
@@ -0,0 +1,163 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_unexpected_error = require("./unexpected-error.cjs");
3
+ const require_validation_error = require("./validation-error.cjs");
4
+ const require_not_found_error = require("./not-found-error.cjs");
5
+ const require_hashing = require("./hashing.cjs");
6
+ const require_validation_code = require("./validation-code.cjs");
7
+ const require_validation_field = require("./validation-field.cjs");
8
+ const require_domain_exception = require("./domain-exception.cjs");
9
+ const require_invalid_state_transition_exception = require("./invalid-state-transition-exception.cjs");
10
+ const require_invariant_violation_exception = require("./invariant-violation-exception.cjs");
11
+ const require_validation_exception = require("./validation-exception.cjs");
12
+ const require_immutable = require("./immutable.cjs");
13
+ const require_use_case = require("./use-case.cjs");
14
+ const require_temporal_use_case = require("./temporal-use-case.cjs");
15
+ const require_value_object = require("./value-object.cjs");
16
+ const require_plugin = require("./plugin.cjs");
17
+ const require_uuid_identifier = require("./uuid-identifier.cjs");
18
+ const require_ruleset_registry = require("./ruleset-registry.cjs");
19
+ const require_domain_event_contracts = require("./domain-event-contracts.cjs");
20
+ const require_gate_v1_payload_schema = require("./gate-v1-payload.schema.cjs");
21
+ const require_result = require("./result.cjs");
22
+ const require_outcome = require("./outcome.cjs");
23
+ const require_policy_service = require("./policy-service.cjs");
24
+ const require_gate_engine_registry = require("./gate-engine-registry.cjs");
25
+ //#region src/version.ts
26
+ const version$1 = "1.3.0";
27
+ //#endregion
28
+ //#region src/index.ts
29
+ const ERP_CORE_NAME = "erp-core";
30
+ const ERP_CORE_VERSION = version$1;
31
+ const erpCoreRelease = {
32
+ name: ERP_CORE_NAME,
33
+ version: ERP_CORE_VERSION
34
+ };
35
+ //#endregion
36
+ exports.AlreadyExistsError = require_validation_error.AlreadyExistsError;
37
+ exports.AppError = require_unexpected_error.AppError;
38
+ exports.AuthenticationError = require_validation_error.AuthenticationError;
39
+ exports.AuthorizationError = require_validation_error.AuthorizationError;
40
+ exports.BusinessRuleViolationError = require_not_found_error.BusinessRuleViolationError;
41
+ exports.BusinessRuleViolationException = require_invalid_state_transition_exception.BusinessRuleViolationException;
42
+ exports.CONTRACT_VERSION_PROPERTY = require_immutable.CONTRACT_VERSION_PROPERTY;
43
+ Object.defineProperty(exports, "Command", {
44
+ enumerable: true,
45
+ get: function() {
46
+ return require_temporal_use_case.Command;
47
+ }
48
+ });
49
+ exports.ComputeEngineRegistry = require_gate_engine_registry.ComputeEngineRegistry;
50
+ exports.ComputeEvaluatorRegistry = require_gate_engine_registry.ComputeEvaluatorRegistry;
51
+ exports.ComputePayloadParserRegistry = require_gate_engine_registry.ComputePayloadParserRegistry;
52
+ exports.ComputePayloadParsers = require_gate_engine_registry.ComputePayloadParsers;
53
+ exports.ComputeRegistry = require_gate_engine_registry.ComputeRegistry;
54
+ exports.ConflictError = require_validation_error.ConflictError;
55
+ exports.ContextResolverRegistry = require_policy_service.ContextResolverRegistry;
56
+ exports.ContextSeedValidator = require_policy_service.ContextSeedValidator;
57
+ exports.CoreConfig = require_gate_v1_payload_schema.CoreConfig;
58
+ exports.DeserializationError = require_validation_error.SerializationInError;
59
+ exports.DomainException = require_domain_exception.DomainException;
60
+ exports.DuplicateError = require_validation_error.DuplicateError;
61
+ exports.ERP_CORE_NAME = ERP_CORE_NAME;
62
+ exports.ERP_CORE_VERSION = ERP_CORE_VERSION;
63
+ Object.defineProperty(exports, "Entity", {
64
+ enumerable: true,
65
+ get: function() {
66
+ return require_value_object.Entity;
67
+ }
68
+ });
69
+ exports.EntityNotFoundException = require_invalid_state_transition_exception.EntityNotFoundException;
70
+ exports.Err = require_result.Err;
71
+ exports.ErrorCodes = require_unexpected_error.ErrorCodes;
72
+ exports.ExpiredError = require_validation_error.ExpiredError;
73
+ exports.GateEngineRegistry = require_gate_engine_registry.GateEngineRegistry;
74
+ exports.GatePayloadParsers = require_gate_engine_registry.GatePayloadParsers;
75
+ exports.IdempotencyError = require_validation_error.IdempotencyError;
76
+ exports.IdempotencyInProgressError = require_validation_error.IdempotencyInProgressError;
77
+ exports.IdempotencyKeyMissingError = require_validation_error.IdempotencyKeyMissingError;
78
+ exports.IdempotencyPayloadMismatchError = require_validation_error.IdempotencyPayloadMismatchError;
79
+ exports.IdempotencyReplayNotSupportedError = require_validation_error.IdempotencyReplayNotSupportedError;
80
+ exports.InMemoryPolicyDefinitionRepository = require_policy_service.InMemoryPolicyDefinitionRepository;
81
+ exports.IntegrationError = require_validation_error.IntegrationError;
82
+ exports.InvalidStateTransitionException = require_invalid_state_transition_exception.InvalidStateTransitionException;
83
+ exports.InvalidValueException = require_validation_exception.InvalidValueException;
84
+ exports.InvariantViolationException = require_invariant_violation_exception.InvariantViolationException;
85
+ exports.LegacyIncompatibleError = require_validation_error.LegacyIncompatibleError;
86
+ exports.MultipleValidationException = require_validation_exception.MultipleValidationException;
87
+ exports.NotFoundError = require_not_found_error.NotFoundError;
88
+ exports.NotYetValidError = require_validation_error.NotYetValidError;
89
+ exports.Ok = require_result.Ok;
90
+ exports.Outcome = require_outcome.Outcome;
91
+ exports.PluginManager = require_plugin.PluginManager;
92
+ exports.PolicyAsOfResolver = require_policy_service.PolicyAsOfResolver;
93
+ exports.PolicyCatalog = require_policy_service.PolicyCatalog;
94
+ exports.PolicyCatalogFactory = require_policy_service.PolicyCatalogFactory;
95
+ exports.PolicyContextBuilder = require_policy_service.PolicyContextBuilder;
96
+ exports.PolicyContextPath = require_gate_v1_payload_schema.PolicyContextPath;
97
+ exports.PolicyDefinition = require_policy_service.PolicyDefinition;
98
+ exports.PolicyEvaluationErrors = require_policy_service.PolicyEvaluationErrors;
99
+ exports.PolicyHashing = require_policy_service.PolicyHashing;
100
+ exports.PolicyKey = require_policy_service.PolicyKey;
101
+ exports.PolicyResolver = require_policy_service.PolicyResolver;
102
+ exports.PolicyScopeMatcher = require_policy_service.PolicyScopeMatcher;
103
+ exports.PolicyService = require_policy_service.PolicyService;
104
+ Object.defineProperty(exports, "Query", {
105
+ enumerable: true,
106
+ get: function() {
107
+ return require_temporal_use_case.Query;
108
+ }
109
+ });
110
+ exports.RequestedBy = require_temporal_use_case.RequestedBy;
111
+ exports.Result = require_result.Result;
112
+ exports.RulesetRegistry = require_ruleset_registry.RulesetRegistry;
113
+ exports.SerializationCodes = require_validation_error.SerializationCodes;
114
+ exports.SerializationError = require_validation_error.SerializationError;
115
+ exports.SerializationInError = require_validation_error.SerializationInError;
116
+ exports.SerializationMessages = require_validation_error.SerializationMessages;
117
+ exports.SerializationOutError = require_validation_error.SerializationOutError;
118
+ exports.TemporalError = require_validation_error.TemporalError;
119
+ exports.TemporalUseCase = require_temporal_use_case.TemporalUseCase;
120
+ exports.UnexpectedError = require_unexpected_error.UnexpectedError;
121
+ exports.UniqueConstraintViolationError = require_validation_error.UniqueConstraintViolationError;
122
+ Object.defineProperty(exports, "UseCase", {
123
+ enumerable: true,
124
+ get: function() {
125
+ return require_use_case.UseCase;
126
+ }
127
+ });
128
+ exports.UuidIdentifier = require_uuid_identifier.UuidIdentifier;
129
+ exports.ValidationCode = require_validation_code.ValidationCode;
130
+ exports.ValidationError = require_validation_error.ValidationError;
131
+ exports.ValidationException = require_validation_exception.ValidationException;
132
+ exports.ValidationField = require_validation_field.ValidationField;
133
+ Object.defineProperty(exports, "ValueObject", {
134
+ enumerable: true,
135
+ get: function() {
136
+ return require_value_object.ValueObject;
137
+ }
138
+ });
139
+ exports.asPolicyDecisionId = require_policy_service.asPolicyDecisionId;
140
+ exports.asPolicyDefinitionId = require_policy_service.asPolicyDefinitionId;
141
+ exports.asSchoolId = require_policy_service.asSchoolId;
142
+ exports.asTenantId = require_policy_service.asTenantId;
143
+ exports.assertJsonSafeMetadata = require_unexpected_error.assertJsonSafeMetadata;
144
+ exports.assertTemporalContext = require_temporal_use_case.assertTemporalContext;
145
+ exports.buildDomainEventContractVersions = require_domain_event_contracts.buildDomainEventContractVersions;
146
+ exports.contextResolverRegistry = require_policy_service.contextResolverRegistry;
147
+ exports.coreConfig = require_gate_v1_payload_schema.coreConfig;
148
+ exports.createDomainEventEnvelope = require_domain_event_contracts.createDomainEventEnvelope;
149
+ exports.createTemporalContext = require_temporal_use_case.createTemporalContext;
150
+ exports.erpCoreRelease = erpCoreRelease;
151
+ exports.evaluateTemporalWindow = require_validation_error.evaluateTemporalWindow;
152
+ exports.mapPolicyEvaluationError = require_temporal_use_case.mapPolicyEvaluationError;
153
+ exports.payloadHash = require_hashing.payloadHash;
154
+ exports.registerNamespacedContextResolvers = require_policy_service.registerNamespacedContextResolvers;
155
+ exports.registerNamespacedContextResolversIn = require_policy_service.registerNamespacedContextResolversIn;
156
+ exports.safePreview = require_validation_error.safePreview;
157
+ exports.serializationErrorCode = require_unexpected_error.serializationErrorCode;
158
+ exports.sha256Hex = require_hashing.sha256Hex;
159
+ exports.stableStringify = require_hashing.stableStringify;
160
+ exports.translateUniqueViolationToDuplicate = require_validation_error.translateUniqueViolationToDuplicate;
161
+ exports.version = require_immutable.version;
162
+
163
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":["version","version"],"sources":["../src/version.ts","../src/index.ts"],"sourcesContent":["// Versao do kit, sincronizada com package.json por scripts/sync-kit-version.mjs.\n// Nao edite a mao: rode `npm run sync-kit-version` (ou e regenerado no release).\n//\n// Mantemos a versao aqui, dentro de src/, para que a copia full-control seja\n// auto-contida: ao copiar so o conteudo de src/, o entry nao depende de um\n// `../package.json` que deixaria de existir no projeto consumidor.\nexport const version = \"1.3.0\";\n","import { version } from \"./version.js\";\n\nexport * from \"./core/index.js\";\n\nexport const ERP_CORE_NAME = \"erp-core\";\nexport const ERP_CORE_VERSION = version;\n\nexport const erpCoreRelease = {\n name: ERP_CORE_NAME,\n version: ERP_CORE_VERSION,\n} as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAaA,YAAU;;;ACFvB,MAAa,gBAAgB;AAC7B,MAAa,mBAAmBC;AAEhC,MAAa,iBAAiB;CAC1B,MAAM;CACN,SAAS;AACb"}
@@ -0,0 +1,30 @@
1
+ import { i as version, n as ContractVersion, r as VersionedTarget, t as CONTRACT_VERSION_PROPERTY } from "./version.cjs";
2
+ import { a as Result, i as Ok, n as Outcome, r as Err, t as CommonOutcomeStatus } from "./outcome.cjs";
3
+ import { A as MetricLabels, C as RequestedByKind, D as TraceAttributeValue, E as UseCaseObservability, M as LogPayload, N as LoggerPort, O as TraceSpan, S as RequestedBy, T as UseCase, _ as PolicyEvaluationOutput, a as TemporalContext, b as Command, c as CacheStrategy, d as mapPolicyEvaluationError, f as TemporalHistory, g as PolicyEvaluationInput, h as ResultRepository, i as CreateTemporalContextInput, j as MetricsPort, k as TracerPort, l as Page, m as Repository, n as TemporalUseCaseInput, o as assertTemporalContext, p as TemporalRepository, r as TemporalizedContextSeed, s as createTemporalContext, t as TemporalUseCase, u as Query, v as PolicyPort, w as MaybePromise, x as CommandInput, y as PolicyPortError } from "./temporal-use-case.cjs";
4
+ import { a as JsonSafeRecord, i as JsonSafePrimitive, n as AppErrorOptions, o as JsonSafeValue, r as ErrorSeverity, t as AppError } from "./app-error.cjs";
5
+ import { $ as serializationErrorCode, A as IdempotencyPayloadMismatchError, B as UniqueConstraintViolation, C as IntegrationErrorMetadata, D as IdempotencyFailureKind, E as IdempotencyErrorMetadata, F as AlreadyExistsError, G as AuthorizationErrorMetadata, H as translateUniqueViolationToDuplicate, I as ConflictError, J as AuthenticationError, K as AuthorizationErrorReason, L as ConflictErrorMetadata, M as payloadHash, N as sha256Hex, O as IdempotencyInProgressError, P as stableStringify, Q as ErrorCodes, R as ConflictKind, S as IntegrationError, T as IdempotencyError, U as BusinessRuleViolationError, V as UniqueConstraintViolationError, W as AuthorizationError, X as AuthenticationErrorReason, Y as AuthenticationErrorMetadata, Z as assertJsonSafeMetadata, _ as SerializationMessages, a as TemporalError, b as NotFoundError, c as TemporalPrecision, d as SerializationCodes, f as SerializationDirection, g as SerializationInError, h as SerializationFailureCategory, i as NotYetValidError, j as IdempotencyReplayNotSupportedError, k as IdempotencyKeyMissingError, l as evaluateTemporalWindow, m as SerializationErrorMetadata, n as UnexpectedError, o as TemporalErrorMetadata, p as SerializationError, q as AuthorizationRequirement, r as ExpiredError, s as TemporalKind, t as ValidationError, u as SerializationBoundary, v as SerializationOutError, w as IntegrationErrorReason, x as LegacyIncompatibleError, y as safePreview, z as DuplicateError } from "./validation-error.cjs";
6
+ import { t as ValidationCode } from "./validation-code.cjs";
7
+ import { t as ValidationField } from "./validation-field.cjs";
8
+ import { A as ConditionEvaluationReportTag, C as asPolicyDefinitionId, D as ConditionEvaluationOptions, E as ConditionEvaluationCause, O as ConditionEvaluationReport, S as asPolicyDecisionId, T as asTenantId, a as GateTraceNodeSnapshot, b as SchoolId, c as PolicyViolation, g as CoreObservabilityConfig, h as CoreConfigOptions, i as GateTraceLeafSnapshot, j as ConditionEvaluatorReporter, k as ConditionEvaluationReportLevel, l as VersionedGateEngine, m as CoreConfig, n as GateOutcomeData, o as GateViolationTrace, r as GateStatus, s as PolicyContext, t as GateOutcome, u as GatePayload, v as PolicyDecisionId, w as asSchoolId, x as TenantId, y as PolicyDefinitionId } from "./gate-types.cjs";
9
+ import { a as PolicyPackage, c as coreConfig, i as PolicyCatalogFactory, n as contextResolverRegistry, o as InMemoryPolicyDefinitionRepository, r as registerNamespacedContextResolvers, s as PolicyHashing, t as PolicyContextPath } from "./path.cjs";
10
+ import { A as PolicyScope, C as BasePolicyDefinitionProps, D as PolicyDefinition, E as GatePolicyDefinitionProps, F as PolicyKey, I as AsOfSource, L as PolicyKind, M as ScopeChain, N as PolicyCatalog, O as PolicyDefinitionProps, P as PolicyCatalogEntryProps, R as PolicyOwner, T as FindCandidatesParams, _ as ContextResolverResilienceOptions, a as PolicyServiceOptions, b as ContextSeed, c as PolicyEvaluationErrors, d as PolicyAsOfResolver, f as PolicyContextBuilder, g as ContextResolverCircuitBreakerOptions, h as registerNamespacedContextResolversIn, i as PolicyService, j as PolicyScopeMatcher, k as PolicyDefinitionStatus, l as PolicyResolver, m as ContextResolverRegistry, n as PolicyDecision, o as PolicyServiceParams, p as PolicyContextBuilderOptions, r as PolicyEvaluationResult, s as PolicyEvaluationError, t as EvaluateInput, u as DeriveAsOfOptions, v as ContextResolverRetryOptions, w as ComputePolicyDefinitionProps, x as ContextSeedValidator, y as ContextValueResolver, z as PolicyScopeLevel } from "./policy-service.cjs";
11
+ import { a as ComputeOutcome, c as VersionedComputeEngine, i as ComputeEvaluatorRegistration, n as ComputeRegistry, o as ComputeOutcomeData, r as ComputeEvaluator, s as ComputeStatus, t as GateEngineRegistry } from "./gate-engine-registry.cjs";
12
+ import { a as ComputePayloadParserRegistry, c as ComputeEvaluatorRegistry, o as ComputePayloadParsers, r as GatePayloadParsers, s as ComputeEngineRegistry } from "./parse-gate-payload.cjs";
13
+ import { t as DeepReadonly } from "./immutable.cjs";
14
+ import { a as EntityState, i as Entity, n as ValueObject, r as ValueObjectPluginContract, t as UuidIdentifier } from "./uuid-identifier.cjs";
15
+ import { a as PluginContract, i as PipelineReducer, n as BasePlugin, r as InvokeOptions, t as PluginManager } from "./plugin.cjs";
16
+ import { t as DomainException } from "./domain-exception.cjs";
17
+ import { a as InvariantViolationException, c as BusinessRuleViolationException, i as ValidationViolation, n as MultipleValidationException, o as InvalidStateTransitionException, r as ValidationException, s as EntityNotFoundException, t as InvalidValueException } from "./validation-exception.cjs";
18
+ import { a as Ruleset, i as InvariantRuleset, n as RulesetRegistry, o as RulesetId, r as CreationRuleset, t as ValueObjectRuleset } from "./value-object-ruleset.contracts.cjs";
19
+ import { a as buildDomainEventContractVersions, i as DomainEventEnvelope, n as DomainEventContractSelection, o as createDomainEventEnvelope, r as DomainEventContractVersions, t as CreateDomainEventEnvelopeInput } from "./domain-event-contracts.cjs";
20
+
21
+ //#region src/index.d.ts
22
+ declare const ERP_CORE_NAME = "erp-core";
23
+ declare const ERP_CORE_VERSION = "1.3.0";
24
+ declare const erpCoreRelease: {
25
+ readonly name: "erp-core";
26
+ readonly version: "1.3.0";
27
+ };
28
+ //#endregion
29
+ export { AlreadyExistsError, AppError, AppErrorOptions, AsOfSource, AuthenticationError, AuthenticationErrorMetadata, AuthenticationErrorReason, AuthorizationError, AuthorizationErrorMetadata, AuthorizationErrorReason, AuthorizationRequirement, BasePlugin, BasePolicyDefinitionProps, BusinessRuleViolationError, BusinessRuleViolationException, CONTRACT_VERSION_PROPERTY, CacheStrategy, Command, CommandInput, CommonOutcomeStatus, ComputeEngineRegistry, ComputeEvaluator, ComputeEvaluatorRegistration, ComputeEvaluatorRegistry, ComputeOutcome, ComputeOutcomeData, ComputePayloadParserRegistry, ComputePayloadParsers, ComputePolicyDefinitionProps, ComputeRegistry, ComputeStatus, ConditionEvaluationCause, ConditionEvaluationOptions, ConditionEvaluationReport, ConditionEvaluationReportLevel, ConditionEvaluationReportTag, ConditionEvaluatorReporter, ConflictError, ConflictErrorMetadata, ConflictKind, ContextResolverCircuitBreakerOptions, ContextResolverRegistry, ContextResolverResilienceOptions, ContextResolverRetryOptions, ContextSeed, ContextSeedValidator, ContextValueResolver, ContractVersion, CoreConfig, CoreConfigOptions, CoreObservabilityConfig, CreateDomainEventEnvelopeInput, CreateTemporalContextInput, CreationRuleset, DeepReadonly, DeriveAsOfOptions, SerializationInError as DeserializationError, SerializationInError, DomainEventContractSelection, DomainEventContractVersions, DomainEventEnvelope, DomainException, DuplicateError, ERP_CORE_NAME, ERP_CORE_VERSION, Entity, EntityNotFoundException, EntityState, Err, ErrorCodes, ErrorSeverity, EvaluateInput, ExpiredError, TemporalErrorMetadata as ExpiredErrorMetadata, TemporalErrorMetadata, TemporalPrecision as ExpiredErrorPrecision, TemporalPrecision, FindCandidatesParams, GateEngineRegistry, GateOutcome, GateOutcomeData, GatePayload, GatePayloadParsers, GatePolicyDefinitionProps, GateStatus, GateTraceLeafSnapshot, GateTraceNodeSnapshot, GateViolationTrace, IdempotencyError, IdempotencyErrorMetadata, IdempotencyFailureKind, IdempotencyInProgressError, IdempotencyKeyMissingError, IdempotencyPayloadMismatchError, IdempotencyReplayNotSupportedError, InMemoryPolicyDefinitionRepository, IntegrationError, IntegrationErrorMetadata, IntegrationErrorReason, InvalidStateTransitionException, InvalidValueException, InvariantRuleset, InvariantViolationException, InvokeOptions, JsonSafePrimitive, JsonSafeRecord, JsonSafeValue, LegacyIncompatibleError, LogPayload, LoggerPort, MaybePromise, MetricLabels, MetricsPort, MultipleValidationException, NotFoundError, NotYetValidError, Ok, Outcome, Page, PipelineReducer, PluginContract, PluginManager, PolicyAsOfResolver, PolicyCatalog, PolicyCatalogEntryProps, PolicyCatalogFactory, PolicyContext, PolicyContextBuilder, PolicyContextBuilderOptions, PolicyContextPath, PolicyDecision, PolicyDecisionId, PolicyDefinition, PolicyDefinitionId, PolicyDefinitionProps, PolicyDefinitionStatus, PolicyEvaluationError, PolicyEvaluationErrors, PolicyEvaluationInput, PolicyEvaluationOutput, PolicyEvaluationResult, PolicyHashing, PolicyKey, PolicyKind, PolicyOwner, PolicyPackage, PolicyPort, PolicyPortError, PolicyResolver, PolicyScope, PolicyScopeLevel, PolicyScopeMatcher, PolicyService, PolicyServiceOptions, PolicyServiceParams, PolicyViolation, Query, Repository, RequestedBy, RequestedByKind, Result, ResultRepository, Ruleset, RulesetId, RulesetRegistry, SchoolId, ScopeChain, SerializationBoundary, SerializationCodes, SerializationDirection, SerializationError, SerializationErrorMetadata, SerializationFailureCategory, SerializationMessages, SerializationOutError, TemporalContext, TemporalError, TemporalHistory, TemporalKind, TemporalRepository, TemporalUseCase, TemporalUseCaseInput, TemporalizedContextSeed, TenantId, TraceAttributeValue, TraceSpan, TracerPort, UnexpectedError, UniqueConstraintViolation, UniqueConstraintViolationError, UseCase, UseCaseObservability, UuidIdentifier, ValidationCode, ValidationError, ValidationException, ValidationField, ValidationViolation, ValueObject, ValueObjectPluginContract, ValueObjectRuleset, VersionedComputeEngine, VersionedGateEngine, VersionedTarget, asPolicyDecisionId, asPolicyDefinitionId, asSchoolId, asTenantId, assertJsonSafeMetadata, assertTemporalContext, buildDomainEventContractVersions, contextResolverRegistry, coreConfig, createDomainEventEnvelope, createTemporalContext, erpCoreRelease, evaluateTemporalWindow, mapPolicyEvaluationError, payloadHash, registerNamespacedContextResolvers, registerNamespacedContextResolversIn, safePreview, serializationErrorCode, sha256Hex, stableStringify, translateUniqueViolationToDuplicate, version };
30
+ //# sourceMappingURL=index.d.cts.map
package/dist/index.d.ts CHANGED
@@ -1,175 +1,30 @@
1
- import { A as TracerPort, C as RequestedBy, D as UseCaseObservability, E as UseCase, F as ContractVersion, M as MetricsPort, N as LogPayload, O as TraceAttributeValue, P as LoggerPort, S as CommandInput, T as MaybePromise, _ as PolicyEvaluationInput, a as TemporalContext, b as PolicyPortError, c as CacheStrategy, d as mapPolicyEvaluationError, f as TemporalHistory, g as ResultRepository, h as Repository, i as CreateTemporalContextInput, j as MetricLabels, k as TraceSpan, l as Page, m as DeepReadonly, n as TemporalUseCaseInput, o as assertTemporalContext, p as TemporalRepository, r as TemporalizedContextSeed, s as createTemporalContext, t as TemporalUseCase, u as Query, v as PolicyEvaluationOutput, w as RequestedByKind, x as Command, y as PolicyPort } from "./temporal-use-case.js";
2
- import { A as ConditionEvaluationReport, C as TenantId, D as asTenantId, E as asSchoolId, F as Ok, I as Result, M as ConditionEvaluationReportTag, N as ConditionEvaluatorReporter, O as ConditionEvaluationCause, P as Err, S as SchoolId, T as asPolicyDefinitionId, _ as CoreConfigOptions, a as GateTraceNodeSnapshot, b as PolicyDecisionId, c as PolicyViolation, g as CoreConfig, h as Outcome, i as GateTraceLeafSnapshot, j as ConditionEvaluationReportLevel, k as ConditionEvaluationOptions, l as VersionedGateEngine, m as CommonOutcomeStatus, n as GateOutcomeData, o as GateViolationTrace, r as GateStatus, s as PolicyContext, t as GateOutcome, u as GatePayload, v as CoreObservabilityConfig, w as asPolicyDecisionId, x as PolicyDefinitionId } from "./gate-types.js";
1
+ import { i as version, n as ContractVersion, r as VersionedTarget, t as CONTRACT_VERSION_PROPERTY } from "./version.js";
2
+ import { a as Result, i as Ok, n as Outcome, r as Err, t as CommonOutcomeStatus } from "./outcome.js";
3
+ import { A as MetricLabels, C as RequestedByKind, D as TraceAttributeValue, E as UseCaseObservability, M as LogPayload, N as LoggerPort, O as TraceSpan, S as RequestedBy, T as UseCase, _ as PolicyEvaluationOutput, a as TemporalContext, b as Command, c as CacheStrategy, d as mapPolicyEvaluationError, f as TemporalHistory, g as PolicyEvaluationInput, h as ResultRepository, i as CreateTemporalContextInput, j as MetricsPort, k as TracerPort, l as Page, m as Repository, n as TemporalUseCaseInput, o as assertTemporalContext, p as TemporalRepository, r as TemporalizedContextSeed, s as createTemporalContext, t as TemporalUseCase, u as Query, v as PolicyPort, w as MaybePromise, x as CommandInput, y as PolicyPortError } from "./temporal-use-case.js";
3
4
  import { a as JsonSafeRecord, i as JsonSafePrimitive, n as AppErrorOptions, o as JsonSafeValue, r as ErrorSeverity, t as AppError } from "./app-error.js";
4
5
  import { $ as serializationErrorCode, A as IdempotencyPayloadMismatchError, B as UniqueConstraintViolation, C as IntegrationErrorMetadata, D as IdempotencyFailureKind, E as IdempotencyErrorMetadata, F as AlreadyExistsError, G as AuthorizationErrorMetadata, H as translateUniqueViolationToDuplicate, I as ConflictError, J as AuthenticationError, K as AuthorizationErrorReason, L as ConflictErrorMetadata, M as payloadHash, N as sha256Hex, O as IdempotencyInProgressError, P as stableStringify, Q as ErrorCodes, R as ConflictKind, S as IntegrationError, T as IdempotencyError, U as BusinessRuleViolationError, V as UniqueConstraintViolationError, W as AuthorizationError, X as AuthenticationErrorReason, Y as AuthenticationErrorMetadata, Z as assertJsonSafeMetadata, _ as SerializationMessages, a as TemporalError, b as NotFoundError, c as TemporalPrecision, d as SerializationCodes, f as SerializationDirection, g as SerializationInError, h as SerializationFailureCategory, i as NotYetValidError, j as IdempotencyReplayNotSupportedError, k as IdempotencyKeyMissingError, l as evaluateTemporalWindow, m as SerializationErrorMetadata, n as UnexpectedError, o as TemporalErrorMetadata, p as SerializationError, q as AuthorizationRequirement, r as ExpiredError, s as TemporalKind, t as ValidationError, u as SerializationBoundary, v as SerializationOutError, w as IntegrationErrorReason, x as LegacyIncompatibleError, y as safePreview, z as DuplicateError } from "./validation-error.js";
6
+ import { t as ValidationCode } from "./validation-code.js";
5
7
  import { t as ValidationField } from "./validation-field.js";
8
+ import { A as ConditionEvaluationReportTag, C as asPolicyDefinitionId, D as ConditionEvaluationOptions, E as ConditionEvaluationCause, O as ConditionEvaluationReport, S as asPolicyDecisionId, T as asTenantId, a as GateTraceNodeSnapshot, b as SchoolId, c as PolicyViolation, g as CoreObservabilityConfig, h as CoreConfigOptions, i as GateTraceLeafSnapshot, j as ConditionEvaluatorReporter, k as ConditionEvaluationReportLevel, l as VersionedGateEngine, m as CoreConfig, n as GateOutcomeData, o as GateViolationTrace, r as GateStatus, s as PolicyContext, t as GateOutcome, u as GatePayload, v as PolicyDecisionId, w as asSchoolId, x as TenantId, y as PolicyDefinitionId } from "./gate-types.js";
6
9
  import { a as PolicyPackage, c as coreConfig, i as PolicyCatalogFactory, n as contextResolverRegistry, o as InMemoryPolicyDefinitionRepository, r as registerNamespacedContextResolvers, s as PolicyHashing, t as PolicyContextPath } from "./path.js";
7
10
  import { A as PolicyScope, C as BasePolicyDefinitionProps, D as PolicyDefinition, E as GatePolicyDefinitionProps, F as PolicyKey, I as AsOfSource, L as PolicyKind, M as ScopeChain, N as PolicyCatalog, O as PolicyDefinitionProps, P as PolicyCatalogEntryProps, R as PolicyOwner, T as FindCandidatesParams, _ as ContextResolverResilienceOptions, a as PolicyServiceOptions, b as ContextSeed, c as PolicyEvaluationErrors, d as PolicyAsOfResolver, f as PolicyContextBuilder, g as ContextResolverCircuitBreakerOptions, h as registerNamespacedContextResolversIn, i as PolicyService, j as PolicyScopeMatcher, k as PolicyDefinitionStatus, l as PolicyResolver, m as ContextResolverRegistry, n as PolicyDecision, o as PolicyServiceParams, p as PolicyContextBuilderOptions, r as PolicyEvaluationResult, s as PolicyEvaluationError, t as EvaluateInput, u as DeriveAsOfOptions, v as ContextResolverRetryOptions, w as ComputePolicyDefinitionProps, x as ContextSeedValidator, y as ContextValueResolver, z as PolicyScopeLevel } from "./policy-service.js";
8
11
  import { a as ComputeOutcome, c as VersionedComputeEngine, i as ComputeEvaluatorRegistration, n as ComputeRegistry, o as ComputeOutcomeData, r as ComputeEvaluator, s as ComputeStatus, t as GateEngineRegistry } from "./gate-engine-registry.js";
9
12
  import { a as ComputePayloadParserRegistry, c as ComputeEvaluatorRegistry, o as ComputePayloadParsers, r as GatePayloadParsers, s as ComputeEngineRegistry } from "./parse-gate-payload.js";
13
+ import { t as DeepReadonly } from "./immutable.js";
14
+ import { a as EntityState, i as Entity, n as ValueObject, r as ValueObjectPluginContract, t as UuidIdentifier } from "./uuid-identifier.js";
15
+ import { a as PluginContract, i as PipelineReducer, n as BasePlugin, r as InvokeOptions, t as PluginManager } from "./plugin.js";
16
+ import { t as DomainException } from "./domain-exception.js";
17
+ import { a as InvariantViolationException, c as BusinessRuleViolationException, i as ValidationViolation, n as MultipleValidationException, o as InvalidStateTransitionException, r as ValidationException, s as EntityNotFoundException, t as InvalidValueException } from "./validation-exception.js";
18
+ import { a as Ruleset, i as InvariantRuleset, n as RulesetRegistry, o as RulesetId, r as CreationRuleset, t as ValueObjectRuleset } from "./value-object-ruleset.contracts.js";
19
+ import { a as buildDomainEventContractVersions, i as DomainEventEnvelope, n as DomainEventContractSelection, o as createDomainEventEnvelope, r as DomainEventContractVersions, t as CreateDomainEventEnvelopeInput } from "./domain-event-contracts.js";
10
20
 
11
- //#region src/core/domain/entity.d.ts
12
- /**
13
- * The minimal persisted shape needed to reconstitute an {@link Entity}.
14
- *
15
- * This is the contract between storage and the domain: a repository maps a row
16
- * (or document) onto these four fields and hands them to a subclass constructor.
17
- * `aggregateVersion` travels with the state so optimistic-concurrency checks
18
- * survive a round-trip through the database.
19
- */
20
- interface EntityState<TIdentifier> {
21
- readonly id: TIdentifier;
22
- readonly createdAt: Date;
23
- readonly updatedAt: Date;
24
- readonly aggregateVersion: number;
25
- }
26
- /**
27
- * Base class for domain entities — objects defined by a stable identity rather
28
- * than by their attributes. Two entities are "the same" when their `id`
29
- * matches, even if every other field differs; this is the opposite of a
30
- * {@link ValueObject}, which is defined entirely by its contents.
31
- *
32
- * The class owns the bookkeeping common to every aggregate root: a creation
33
- * timestamp that never changes, a last-modified timestamp, and an
34
- * `aggregateVersion` counter used for optimistic concurrency control. All three
35
- * are validated on construction and the dates are defensively cloned, so an
36
- * entity can never be built into — or leak — an inconsistent temporal state.
37
- *
38
- * @typeParam TIdentifier - The identity type (e.g. a branded string id or a VO).
39
- */
40
- declare abstract class Entity<TIdentifier> {
41
- static readonly CONTRACT_VERSION: ContractVersion;
42
- private readonly _id;
43
- private readonly _createdAt;
44
- private _updatedAt;
45
- private _aggregateVersion;
46
- /**
47
- * Reconstitutes an entity from its persisted {@link EntityState}.
48
- *
49
- * Validates the temporal invariants up front so an invalid entity is
50
- * impossible to construct: both dates must be valid, the aggregate version
51
- * must be a non-negative integer, and `updatedAt` may not predate
52
- * `createdAt`. Both dates are cloned on the way in so a later mutation of
53
- * the caller's `Date` objects cannot reach into the entity's internal state.
54
- *
55
- * Declared `protected` because entities are reconstituted through a
56
- * subclass factory, never instantiated directly by application code.
57
- *
58
- * @throws {InvariantViolationException} When `updatedAt` is earlier than `createdAt`.
59
- */
60
- protected constructor(state: EntityState<TIdentifier>);
61
- /** The entity's stable identity — the basis for equality between entities. */
62
- get id(): TIdentifier;
63
- /**
64
- * When the entity was first created.
65
- *
66
- * Returns a clone so callers cannot mutate the entity's internal `Date`;
67
- * the value is fixed at construction and never changes thereafter.
68
- */
69
- get createdAt(): Date;
70
- /**
71
- * When the entity was last modified.
72
- *
73
- * Returns a clone for the same encapsulation reason as {@link createdAt};
74
- * the underlying value advances only through {@link markAsModified}.
75
- */
76
- get updatedAt(): Date;
77
- /**
78
- * Monotonic counter incremented on every mutation, used for optimistic
79
- * concurrency control: a writer reads this value, and the persistence layer
80
- * rejects the write if the stored version has moved on in the meantime.
81
- */
82
- get aggregateVersion(): number;
83
- /**
84
- * The schema/contract version stamped on this entity type by the
85
- * `@version` decorator — used to detect and migrate state persisted under
86
- * an older shape.
87
- */
88
- get contractVersion(): ContractVersion;
89
- /**
90
- * The single seam through which an entity records a mutation: it advances
91
- * `updatedAt` and bumps {@link aggregateVersion} by one. Subclasses must
92
- * call this from every state-changing method so the version counter stays
93
- * an accurate optimistic-lock token.
94
- *
95
- * @param updatedAt - The modification instant; defaults to now. Validated
96
- * and required not to predate `createdAt`, preserving the same invariant
97
- * the constructor enforces.
98
- * @returns The new aggregate version after the increment.
99
- * @throws {InvariantViolationException} When `updatedAt` is earlier than `createdAt`.
100
- */
101
- protected markAsModified(updatedAt?: Date): number;
102
- }
103
- //#endregion
104
- //#region src/core/domain/value-object.d.ts
105
- /**
106
- * Base class for value objects — domain concepts defined entirely by their
107
- * contents, with no identity of their own. Two value objects are
108
- * interchangeable when they hold equal data, which is the opposite of an
109
- * {@link Entity} (compared by id). Money, a CPF, a date range: replacing one
110
- * instance with an equal one changes nothing about the model.
111
- *
112
- * Immutability is the defining guarantee here. The wrapped `value` is
113
- * deep-frozen on construction, so a value object can be shared freely without
114
- * any risk of a consumer mutating shared state. Subclasses seal the instance
115
- * itself with {@link finalize} once their own fields are set.
116
- *
117
- * @typeParam T - The shape of the wrapped data.
118
- * @typeParam P - The primitive form produced by {@link toPrimitive} / {@link toJSON}.
119
- */
120
- declare abstract class ValueObject<T, P> {
121
- static readonly CONTRACT_VERSION: ContractVersion;
122
- /** The wrapped data, deep-frozen so it can never be mutated after construction. */
123
- readonly value: DeepReadonly<T>;
124
- /**
125
- * Wraps `value`, deep-freezing it so the value object is immutable from the
126
- * moment it exists. Declared `protected` because value objects are built
127
- * through a validating subclass factory, never instantiated directly.
128
- */
129
- protected constructor(value: T);
130
- /**
131
- * The schema/contract version stamped on this value-object type by the
132
- * `@version` decorator — used to detect state persisted under an older shape.
133
- */
134
- get contractVersion(): ContractVersion;
135
- /**
136
- * Freezes the instance shell, blocking reassignment of any own field.
137
- *
138
- * `value` is already deep-frozen by the constructor, so the wrapped data is
139
- * immutable regardless. The instance itself is NOT frozen automatically
140
- * because a subclass may still need to assign its own fields after
141
- * `super(value)` runs. Call `finalize()` at the very end of the subclass
142
- * constructor (after all fields are set) to make the whole value object
143
- * immutable.
144
- */
145
- protected finalize(): void;
146
- /**
147
- * Hook for `JSON.stringify`. Delegates to {@link toPrimitive} so a value
148
- * object serializes to its primitive form rather than exposing the internal
149
- * `value` wrapper.
150
- */
151
- toJSON(): P;
152
- /**
153
- * Compares this value object with another by content. Because value objects
154
- * carry no identity, subclasses implement equality over the wrapped data
155
- * (typically the primitive form), so two independently constructed instances
156
- * holding the same data are considered equal.
157
- */
158
- abstract equals(other: this): boolean;
159
- /**
160
- * Projects the value object down to a plain, serializable primitive form —
161
- * the representation suitable for persistence, transport, or comparison.
162
- */
163
- abstract toPrimitive(): P;
164
- }
165
- //#endregion
166
21
  //#region src/index.d.ts
167
22
  declare const ERP_CORE_NAME = "erp-core";
168
- declare const ERP_CORE_VERSION = "1.1.0";
23
+ declare const ERP_CORE_VERSION = "1.3.0";
169
24
  declare const erpCoreRelease: {
170
25
  readonly name: "erp-core";
171
- readonly version: "1.1.0";
26
+ readonly version: "1.3.0";
172
27
  };
173
28
  //#endregion
174
- export { AlreadyExistsError, AppError, AppErrorOptions, AsOfSource, AuthenticationError, AuthenticationErrorMetadata, AuthenticationErrorReason, AuthorizationError, AuthorizationErrorMetadata, AuthorizationErrorReason, AuthorizationRequirement, BasePolicyDefinitionProps, BusinessRuleViolationError, CacheStrategy, Command, CommandInput, CommonOutcomeStatus, ComputeEngineRegistry, ComputeEvaluator, ComputeEvaluatorRegistration, ComputeEvaluatorRegistry, ComputeOutcome, ComputeOutcomeData, ComputePayloadParserRegistry, ComputePayloadParsers, ComputePolicyDefinitionProps, ComputeRegistry, ComputeStatus, ConditionEvaluationCause, ConditionEvaluationOptions, ConditionEvaluationReport, ConditionEvaluationReportLevel, ConditionEvaluationReportTag, ConditionEvaluatorReporter, ConflictError, ConflictErrorMetadata, ConflictKind, ContextResolverCircuitBreakerOptions, ContextResolverRegistry, ContextResolverResilienceOptions, ContextResolverRetryOptions, ContextSeed, ContextSeedValidator, ContextValueResolver, CoreConfig, CoreConfigOptions, CoreObservabilityConfig, CreateTemporalContextInput, type DeepReadonly, DeriveAsOfOptions, SerializationInError as DeserializationError, SerializationInError, DuplicateError, ERP_CORE_NAME, ERP_CORE_VERSION, Entity, type EntityState, Err, ErrorCodes, ErrorSeverity, EvaluateInput, ExpiredError, TemporalErrorMetadata as ExpiredErrorMetadata, TemporalErrorMetadata, TemporalPrecision as ExpiredErrorPrecision, TemporalPrecision, FindCandidatesParams, GateEngineRegistry, GateOutcome, GateOutcomeData, GatePayload, GatePayloadParsers, GatePolicyDefinitionProps, GateStatus, GateTraceLeafSnapshot, GateTraceNodeSnapshot, GateViolationTrace, IdempotencyError, IdempotencyErrorMetadata, IdempotencyFailureKind, IdempotencyInProgressError, IdempotencyKeyMissingError, IdempotencyPayloadMismatchError, IdempotencyReplayNotSupportedError, InMemoryPolicyDefinitionRepository, IntegrationError, IntegrationErrorMetadata, IntegrationErrorReason, JsonSafePrimitive, JsonSafeRecord, JsonSafeValue, LegacyIncompatibleError, LogPayload, LoggerPort, MaybePromise, MetricLabels, MetricsPort, NotFoundError, NotYetValidError, Ok, Outcome, Page, PolicyAsOfResolver, PolicyCatalog, PolicyCatalogEntryProps, PolicyCatalogFactory, PolicyContext, PolicyContextBuilder, PolicyContextBuilderOptions, PolicyContextPath, PolicyDecision, PolicyDecisionId, PolicyDefinition, PolicyDefinitionId, PolicyDefinitionProps, PolicyDefinitionStatus, PolicyEvaluationError, PolicyEvaluationErrors, PolicyEvaluationInput, PolicyEvaluationOutput, PolicyEvaluationResult, PolicyHashing, PolicyKey, PolicyKind, PolicyOwner, PolicyPackage, PolicyPort, PolicyPortError, PolicyResolver, PolicyScope, PolicyScopeLevel, PolicyScopeMatcher, PolicyService, PolicyServiceOptions, PolicyServiceParams, PolicyViolation, Query, Repository, RequestedBy, RequestedByKind, Result, ResultRepository, SchoolId, ScopeChain, SerializationBoundary, SerializationCodes, SerializationDirection, SerializationError, SerializationErrorMetadata, SerializationFailureCategory, SerializationMessages, SerializationOutError, TemporalContext, TemporalError, TemporalHistory, TemporalKind, TemporalRepository, TemporalUseCase, TemporalUseCaseInput, TemporalizedContextSeed, TenantId, TraceAttributeValue, TraceSpan, TracerPort, UnexpectedError, UniqueConstraintViolation, UniqueConstraintViolationError, UseCase, UseCaseObservability, ValidationError, ValidationField, ValueObject, VersionedComputeEngine, VersionedGateEngine, asPolicyDecisionId, asPolicyDefinitionId, asSchoolId, asTenantId, assertJsonSafeMetadata, assertTemporalContext, contextResolverRegistry, coreConfig, createTemporalContext, erpCoreRelease, evaluateTemporalWindow, mapPolicyEvaluationError, payloadHash, registerNamespacedContextResolvers, registerNamespacedContextResolversIn, safePreview, serializationErrorCode, sha256Hex, stableStringify, translateUniqueViolationToDuplicate };
29
+ export { AlreadyExistsError, AppError, AppErrorOptions, AsOfSource, AuthenticationError, AuthenticationErrorMetadata, AuthenticationErrorReason, AuthorizationError, AuthorizationErrorMetadata, AuthorizationErrorReason, AuthorizationRequirement, BasePlugin, BasePolicyDefinitionProps, BusinessRuleViolationError, BusinessRuleViolationException, CONTRACT_VERSION_PROPERTY, CacheStrategy, Command, CommandInput, CommonOutcomeStatus, ComputeEngineRegistry, ComputeEvaluator, ComputeEvaluatorRegistration, ComputeEvaluatorRegistry, ComputeOutcome, ComputeOutcomeData, ComputePayloadParserRegistry, ComputePayloadParsers, ComputePolicyDefinitionProps, ComputeRegistry, ComputeStatus, ConditionEvaluationCause, ConditionEvaluationOptions, ConditionEvaluationReport, ConditionEvaluationReportLevel, ConditionEvaluationReportTag, ConditionEvaluatorReporter, ConflictError, ConflictErrorMetadata, ConflictKind, ContextResolverCircuitBreakerOptions, ContextResolverRegistry, ContextResolverResilienceOptions, ContextResolverRetryOptions, ContextSeed, ContextSeedValidator, ContextValueResolver, ContractVersion, CoreConfig, CoreConfigOptions, CoreObservabilityConfig, CreateDomainEventEnvelopeInput, CreateTemporalContextInput, CreationRuleset, DeepReadonly, DeriveAsOfOptions, SerializationInError as DeserializationError, SerializationInError, DomainEventContractSelection, DomainEventContractVersions, DomainEventEnvelope, DomainException, DuplicateError, ERP_CORE_NAME, ERP_CORE_VERSION, Entity, EntityNotFoundException, EntityState, Err, ErrorCodes, ErrorSeverity, EvaluateInput, ExpiredError, TemporalErrorMetadata as ExpiredErrorMetadata, TemporalErrorMetadata, TemporalPrecision as ExpiredErrorPrecision, TemporalPrecision, FindCandidatesParams, GateEngineRegistry, GateOutcome, GateOutcomeData, GatePayload, GatePayloadParsers, GatePolicyDefinitionProps, GateStatus, GateTraceLeafSnapshot, GateTraceNodeSnapshot, GateViolationTrace, IdempotencyError, IdempotencyErrorMetadata, IdempotencyFailureKind, IdempotencyInProgressError, IdempotencyKeyMissingError, IdempotencyPayloadMismatchError, IdempotencyReplayNotSupportedError, InMemoryPolicyDefinitionRepository, IntegrationError, IntegrationErrorMetadata, IntegrationErrorReason, InvalidStateTransitionException, InvalidValueException, InvariantRuleset, InvariantViolationException, InvokeOptions, JsonSafePrimitive, JsonSafeRecord, JsonSafeValue, LegacyIncompatibleError, LogPayload, LoggerPort, MaybePromise, MetricLabels, MetricsPort, MultipleValidationException, NotFoundError, NotYetValidError, Ok, Outcome, Page, PipelineReducer, PluginContract, PluginManager, PolicyAsOfResolver, PolicyCatalog, PolicyCatalogEntryProps, PolicyCatalogFactory, PolicyContext, PolicyContextBuilder, PolicyContextBuilderOptions, PolicyContextPath, PolicyDecision, PolicyDecisionId, PolicyDefinition, PolicyDefinitionId, PolicyDefinitionProps, PolicyDefinitionStatus, PolicyEvaluationError, PolicyEvaluationErrors, PolicyEvaluationInput, PolicyEvaluationOutput, PolicyEvaluationResult, PolicyHashing, PolicyKey, PolicyKind, PolicyOwner, PolicyPackage, PolicyPort, PolicyPortError, PolicyResolver, PolicyScope, PolicyScopeLevel, PolicyScopeMatcher, PolicyService, PolicyServiceOptions, PolicyServiceParams, PolicyViolation, Query, Repository, RequestedBy, RequestedByKind, Result, ResultRepository, Ruleset, RulesetId, RulesetRegistry, SchoolId, ScopeChain, SerializationBoundary, SerializationCodes, SerializationDirection, SerializationError, SerializationErrorMetadata, SerializationFailureCategory, SerializationMessages, SerializationOutError, TemporalContext, TemporalError, TemporalHistory, TemporalKind, TemporalRepository, TemporalUseCase, TemporalUseCaseInput, TemporalizedContextSeed, TenantId, TraceAttributeValue, TraceSpan, TracerPort, UnexpectedError, UniqueConstraintViolation, UniqueConstraintViolationError, UseCase, UseCaseObservability, UuidIdentifier, ValidationCode, ValidationError, ValidationException, ValidationField, ValidationViolation, ValueObject, ValueObjectPluginContract, ValueObjectRuleset, VersionedComputeEngine, VersionedGateEngine, VersionedTarget, asPolicyDecisionId, asPolicyDefinitionId, asSchoolId, asTenantId, assertJsonSafeMetadata, assertTemporalContext, buildDomainEventContractVersions, contextResolverRegistry, coreConfig, createDomainEventEnvelope, createTemporalContext, erpCoreRelease, evaluateTemporalWindow, mapPolicyEvaluationError, payloadHash, registerNamespacedContextResolvers, registerNamespacedContextResolversIn, safePreview, serializationErrorCode, sha256Hex, stableStringify, translateUniqueViolationToDuplicate, version };
175
30
  //# sourceMappingURL=index.d.ts.map