@cullet/erp-core 1.4.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/KIT_CONTEXT.md +7 -1
- package/dist/abac/index.d.cts +2 -2
- package/dist/abac/index.d.ts +2 -2
- package/dist/aggregate-version.cjs +14 -0
- package/dist/aggregate-version.cjs.map +1 -0
- package/dist/aggregate-version.js +9 -0
- package/dist/aggregate-version.js.map +1 -0
- package/dist/app-error.cjs +21 -6
- package/dist/app-error.cjs.map +1 -1
- package/dist/app-error.js +21 -6
- package/dist/app-error.js.map +1 -1
- package/dist/application/index.cjs +8 -4
- package/dist/application/index.d.cts +2 -2
- package/dist/application/index.d.ts +2 -2
- package/dist/application/index.js +1 -2
- package/dist/authorization-error.cjs +67 -17
- package/dist/authorization-error.cjs.map +1 -1
- package/dist/authorization-error.d.cts +6 -2
- package/dist/authorization-error.d.ts +6 -2
- package/dist/authorization-error.js +50 -18
- package/dist/authorization-error.js.map +1 -1
- package/dist/authorizer.port.d.cts +18 -3
- package/dist/authorizer.port.d.ts +18 -3
- package/dist/composite-authorizer.d.cts +63 -10
- package/dist/composite-authorizer.d.ts +63 -10
- package/dist/condition-evaluator.cjs +117 -172
- package/dist/condition-evaluator.cjs.map +1 -1
- package/dist/condition-evaluator.js +118 -167
- package/dist/condition-evaluator.js.map +1 -1
- package/dist/core-config.d.cts +53 -6
- package/dist/core-config.d.ts +53 -6
- package/dist/decorate.cjs +14 -0
- package/dist/decorate.js +9 -0
- package/dist/domain/index.cjs +107 -2
- package/dist/domain/index.cjs.map +1 -0
- package/dist/domain/index.d.cts +25 -1
- package/dist/domain/index.d.ts +25 -1
- package/dist/domain/index.js +99 -3
- package/dist/domain/index.js.map +1 -0
- package/dist/domain-event-contracts.cjs +12 -8
- package/dist/domain-event-contracts.cjs.map +1 -1
- package/dist/domain-event-contracts.d.cts +29 -4
- package/dist/domain-event-contracts.d.ts +29 -4
- package/dist/domain-event-contracts.js +11 -7
- package/dist/domain-event-contracts.js.map +1 -1
- package/dist/domain-exception.cjs +2 -1
- package/dist/domain-exception.cjs.map +1 -1
- package/dist/domain-exception.js +2 -1
- package/dist/domain-exception.js.map +1 -1
- package/dist/errors/index.cjs +3 -2
- package/dist/errors/index.d.cts +1 -1
- package/dist/errors/index.d.ts +1 -1
- package/dist/errors/index.js +3 -2
- package/dist/exceptions/index.cjs +2 -2
- package/dist/exceptions/index.d.cts +1 -2
- package/dist/exceptions/index.d.ts +1 -2
- package/dist/exceptions/index.js +2 -2
- package/dist/gate-engine-registry.cjs.map +1 -1
- package/dist/gate-engine-registry.d.cts +1 -1
- package/dist/gate-engine-registry.d.ts +1 -1
- package/dist/gate-engine-registry.js.map +1 -1
- package/dist/gate-v1-payload.schema.cjs +11 -6
- package/dist/gate-v1-payload.schema.cjs.map +1 -1
- package/dist/gate-v1-payload.schema.js +11 -6
- package/dist/gate-v1-payload.schema.js.map +1 -1
- package/dist/hashing.cjs +2 -44
- package/dist/hashing.cjs.map +1 -1
- package/dist/hashing.js +3 -39
- package/dist/hashing.js.map +1 -1
- package/dist/immutable.cjs +25 -12
- package/dist/immutable.cjs.map +1 -1
- package/dist/immutable.js +24 -11
- package/dist/immutable.js.map +1 -1
- package/dist/index.cjs +15 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -10
- package/dist/index.d.ts +9 -10
- package/dist/index.js +8 -9
- package/dist/index.js.map +1 -1
- package/dist/invalid-state-transition-exception.cjs +6 -6
- package/dist/invalid-state-transition-exception.cjs.map +1 -1
- package/dist/invalid-state-transition-exception.js +6 -6
- package/dist/invalid-state-transition-exception.js.map +1 -1
- package/dist/invariant-violation-exception.cjs +2 -2
- package/dist/invariant-violation-exception.cjs.map +1 -1
- package/dist/invariant-violation-exception.js +2 -2
- package/dist/invariant-violation-exception.js.map +1 -1
- package/dist/not-found-error.cjs +6 -4
- package/dist/not-found-error.cjs.map +1 -1
- package/dist/not-found-error.js +6 -4
- package/dist/not-found-error.js.map +1 -1
- package/dist/outcome.cjs +5 -5
- package/dist/outcome.cjs.map +1 -1
- package/dist/outcome.js +5 -5
- package/dist/outcome.js.map +1 -1
- package/dist/parse-gate-payload.d.cts +1 -1
- package/dist/parse-gate-payload.d.ts +1 -1
- package/dist/path.d.cts +2 -2
- package/dist/path.d.ts +2 -2
- package/dist/plugin.cjs +23 -13
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.cts +22 -8
- package/dist/plugin.d.ts +22 -8
- package/dist/plugin.js +23 -13
- package/dist/plugin.js.map +1 -1
- package/dist/policies/engines/index.d.cts +1 -1
- package/dist/policies/engines/index.d.ts +1 -1
- package/dist/policies/engines/v1/gate/index.d.cts +3 -13
- package/dist/policies/engines/v1/gate/index.d.ts +3 -13
- package/dist/policies/index.d.cts +1 -1
- package/dist/policies/index.d.ts +1 -1
- package/dist/policy-bridge.cjs +30 -2
- package/dist/policy-bridge.cjs.map +1 -1
- package/dist/policy-bridge.d.cts +18 -0
- package/dist/policy-bridge.d.ts +18 -0
- package/dist/policy-bridge.js +30 -2
- package/dist/policy-bridge.js.map +1 -1
- package/dist/policy-service.cjs +41 -46
- package/dist/policy-service.cjs.map +1 -1
- package/dist/policy-service.d.cts +72 -9
- package/dist/policy-service.d.ts +72 -9
- package/dist/policy-service.js +43 -48
- package/dist/policy-service.js.map +1 -1
- package/dist/requested-by.cjs +4 -4
- package/dist/requested-by.cjs.map +1 -1
- package/dist/requested-by.js +2 -2
- package/dist/requested-by.js.map +1 -1
- package/dist/result.cjs +29 -1
- package/dist/result.cjs.map +1 -1
- package/dist/result.d.cts +12 -0
- package/dist/result.d.ts +12 -0
- package/dist/result.js +29 -1
- package/dist/result.js.map +1 -1
- package/dist/rule.cjs +94 -24
- package/dist/rule.cjs.map +1 -1
- package/dist/rule.js +94 -24
- package/dist/rule.js.map +1 -1
- package/dist/ruleset-registry.cjs +19 -0
- package/dist/ruleset-registry.cjs.map +1 -1
- package/dist/ruleset-registry.js +19 -0
- package/dist/ruleset-registry.js.map +1 -1
- package/dist/stable-stringify.cjs +87 -0
- package/dist/stable-stringify.cjs.map +1 -0
- package/dist/stable-stringify.js +76 -0
- package/dist/stable-stringify.js.map +1 -0
- package/dist/temporal-snapshot.d.cts +87 -0
- package/dist/temporal-snapshot.d.ts +87 -0
- package/dist/temporal-use-case.cjs +174 -16
- package/dist/temporal-use-case.cjs.map +1 -1
- package/dist/temporal-use-case.d.cts +82 -44
- package/dist/temporal-use-case.d.ts +82 -44
- package/dist/temporal-use-case.js +167 -15
- package/dist/temporal-use-case.js.map +1 -1
- package/dist/unexpected-error.cjs +4 -2
- package/dist/unexpected-error.cjs.map +1 -1
- package/dist/unexpected-error.js +4 -2
- package/dist/unexpected-error.js.map +1 -1
- package/dist/uuid-identifier.cjs +141 -8
- package/dist/uuid-identifier.cjs.map +1 -1
- package/dist/uuid-identifier.d.cts +26 -7
- package/dist/uuid-identifier.d.ts +26 -7
- package/dist/uuid-identifier.js +135 -8
- package/dist/uuid-identifier.js.map +1 -1
- package/dist/uuid.cjs +23 -0
- package/dist/uuid.cjs.map +1 -0
- package/dist/uuid.js +18 -0
- package/dist/uuid.js.map +1 -0
- package/dist/validation-code.cjs +9 -0
- package/dist/validation-code.cjs.map +1 -1
- package/dist/validation-code.d.cts +3 -0
- package/dist/validation-code.d.ts +3 -0
- package/dist/validation-code.js +9 -0
- package/dist/validation-code.js.map +1 -1
- package/dist/validation-error.cjs +42 -67
- package/dist/validation-error.cjs.map +1 -1
- package/dist/validation-error.d.cts +29 -8
- package/dist/validation-error.d.ts +29 -8
- package/dist/validation-error.js +41 -66
- package/dist/validation-error.js.map +1 -1
- package/dist/validation-exception.cjs +17 -6
- package/dist/validation-exception.cjs.map +1 -1
- package/dist/validation-exception.d.cts +33 -9
- package/dist/validation-exception.d.ts +33 -9
- package/dist/validation-exception.js +17 -6
- package/dist/validation-exception.js.map +1 -1
- package/dist/validation-field.cjs +3 -0
- package/dist/validation-field.cjs.map +1 -1
- package/dist/validation-field.d.cts +1 -0
- package/dist/validation-field.d.ts +1 -0
- package/dist/validation-field.js +3 -0
- package/dist/validation-field.js.map +1 -1
- package/dist/value-object-ruleset.contracts.d.cts +10 -0
- package/dist/value-object-ruleset.contracts.d.ts +10 -0
- package/dist/value-object.cjs +23 -4
- package/dist/value-object.cjs.map +1 -1
- package/dist/value-object.d.cts +25 -1
- package/dist/value-object.d.ts +25 -1
- package/dist/value-object.js +23 -4
- package/dist/value-object.js.map +1 -1
- package/dist/version.d.cts +27 -0
- package/dist/version.d.ts +27 -0
- package/dist/versioning/index.d.cts +2 -2
- package/dist/versioning/index.d.ts +2 -2
- package/meta.json +5 -2
- package/package.json +1 -1
- package/src/core/abac/authorizer.ts +60 -10
- package/src/core/abac/domain/policy-set.ts +52 -5
- package/src/core/abac/domain/rule.ts +28 -16
- package/src/core/abac/index.ts +7 -1
- package/src/core/application/commands/command.ts +14 -1
- package/src/core/application/commands/requested-by.ts +13 -5
- package/src/core/application/index.ts +2 -1
- package/src/core/application/policy-error-mapper.ts +6 -0
- package/src/core/application/ports/index.ts +7 -0
- package/src/core/application/ports/temporal-repository.port.ts +35 -2
- package/src/core/application/queries/index.ts +1 -1
- package/src/core/application/queries/query.ts +25 -3
- package/src/core/application/temporal/temporal-use-case.ts +31 -4
- package/src/core/application/use-case.ts +45 -8
- package/src/core/config/core-config.ts +46 -25
- package/src/core/config/index.ts +1 -0
- package/src/core/config/policy-reporter.ts +32 -1
- package/src/core/domain/entity.ts +51 -8
- package/src/core/domain/rulesets/entity-ruleset.contracts.ts +0 -2
- package/src/core/domain/rulesets/ruleset-registry.ts +24 -0
- package/src/core/domain/rulesets/value-object-ruleset.contracts.ts +1 -7
- package/src/core/domain/temporal/half-open-interval.ts +34 -0
- package/src/core/domain/temporal/temporal-snapshot.ts +13 -2
- package/src/core/domain/temporal/transaction-time.ts +19 -15
- package/src/core/domain/temporal/valid-time.ts +20 -15
- package/src/core/domain/uuid-identifier.ts +6 -11
- package/src/core/domain/value-object.ts +29 -3
- package/src/core/errors/authentication-error.ts +5 -31
- package/src/core/errors/authorization-error.ts +12 -20
- package/src/core/errors/business-rule-violation-error.ts +4 -1
- package/src/core/errors/idempotency-error.ts +5 -2
- package/src/core/errors/index.ts +4 -0
- package/src/core/errors/integration-error.ts +4 -24
- package/src/core/errors/legacy-incompatible-error.ts +1 -0
- package/src/core/errors/not-found-error.ts +4 -1
- package/src/core/errors/temporal-error.ts +22 -20
- package/src/core/errors/unexpected-error.ts +5 -1
- package/src/core/errors/utils/factory-helpers.ts +70 -0
- package/src/core/errors/utils/index.ts +5 -0
- package/src/core/errors/utils/json-safe.ts +35 -12
- package/src/core/errors/validation-error.ts +4 -1
- package/src/core/exceptions/business-rule-violation-exception.ts +2 -1
- package/src/core/exceptions/domain-exception.ts +9 -1
- package/src/core/exceptions/entity-not-found-exception.ts +5 -1
- package/src/core/exceptions/invalid-state-transition-exception.ts +5 -2
- package/src/core/exceptions/invariant-violation-exception.ts +2 -2
- package/src/core/exceptions/validation-code.ts +14 -0
- package/src/core/exceptions/validation-exception.ts +44 -5
- package/src/core/exceptions/validation-field.ts +11 -1
- package/src/core/plugins/plugin.ts +25 -15
- package/src/core/plugins/types.ts +4 -2
- package/src/core/policies/asof/asof.ts +12 -0
- package/src/core/policies/catalog/policy-catalog-entry.ts +3 -1
- package/src/core/policies/catalog/policy-catalog.ts +5 -1
- package/src/core/policies/context/context-builder.ts +20 -0
- package/src/core/policies/context/context-resolver.ts +5 -0
- package/src/core/policies/context/context-seed.ts +11 -0
- package/src/core/policies/defs/in-memory-policy-definition-repo.ts +0 -2
- package/src/core/policies/engines/parse-gate-payload.ts +9 -0
- package/src/core/policies/engines/v1/condition-date-operands.ts +112 -0
- package/src/core/policies/engines/v1/condition-evaluator.ts +120 -291
- package/src/core/policies/engines/v1/condition-schema.ts +23 -19
- package/src/core/policies/engines/v1/condition-types.ts +18 -11
- package/src/core/policies/index.ts +4 -6
- package/src/core/policies/service/policy-service.ts +46 -35
- package/src/core/policies/utils/hash.ts +5 -69
- package/src/core/policies/utils/result.ts +1 -1
- package/src/core/rbac/access-request.ts +12 -2
- package/src/core/rbac/authorizer.ts +8 -1
- package/src/core/rbac/domain/role.ts +20 -0
- package/src/core/rbac/domain/scope.ts +6 -1
- package/src/core/result/index.ts +5 -0
- package/src/core/result/outcome.ts +5 -7
- package/src/core/result/result.ts +34 -1
- package/src/core/shared/hashing.ts +6 -57
- package/src/core/shared/immutable.ts +22 -4
- package/src/core/shared/stable-stringify.ts +144 -0
- package/src/core/shared/uuid.ts +16 -0
- package/src/core/versioning/domain-event-contracts.ts +43 -15
- package/src/core/versioning/index.ts +1 -0
- package/src/core/versioning/version.ts +30 -1
- package/src/domain/index.ts +5 -0
- package/src/examples/rulesets/entity/order-creation-rules-v1.ts +1 -1
- package/src/examples/rulesets/entity/order-invariants-v1.ts +2 -4
- package/src/examples/rulesets/entity/order-invariants-v2.ts +2 -4
- package/src/examples/rulesets/value-object/cpf-rules-v1.ts +2 -4
- package/src/examples/rulesets/value-object/cpf-rules-v2.ts +2 -4
- package/src/examples/rulesets/value-object/person-name-rules-v1.ts +2 -4
- package/src/examples/rulesets/value-object/person-name-rules-v2.ts +2 -4
- package/src/result/index.ts +7 -2
- package/src/version.ts +1 -1
- package/dist/domain-exception.d.cts +0 -7
- package/dist/domain-exception.d.ts +0 -7
- package/dist/entity.cjs +0 -126
- package/dist/entity.cjs.map +0 -1
- package/dist/entity.js +0 -115
- package/dist/entity.js.map +0 -1
- package/dist/use-case.cjs +0 -96
- package/dist/use-case.cjs.map +0 -1
- package/dist/use-case.js +0 -91
- package/dist/use-case.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gate-v1-payload.schema.cjs","names":["z","z","Result"],"sources":["../src/core/policies/engines/v1/condition-schema.ts","../src/core/policies/engines/v1/gate/gate-v1-payload.schema.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport type { ConditionLeafNode, ConditionNode } from \"./condition-types.js\";\n\n// ─── Shared v1 condition Zod schemas ─────────────────────────────────────────\n// Extracted from gate/v1 so both gate/v1 and compute/v1 can validate\n// condition nodes without either engine depending on the other.\n\nconst conditionOpSchema = z.enum([\n \"eq\",\n \"neq\",\n \"gt\",\n \"gte\",\n \"lt\",\n \"lte\",\n \"in\",\n \"notIn\",\n \"isNull\",\n \"isNotNull\",\n]);\n\nexport const conditionLeafNodeSchema: z.ZodType<ConditionLeafNode> = z\n .object({\n field: z.string().min(1),\n op: conditionOpSchema,\n value: z.unknown(),\n allowNull: z.literal(true).optional(),\n })\n .strict() as z.ZodType<ConditionLeafNode>;\n\nexport const
|
|
1
|
+
{"version":3,"file":"gate-v1-payload.schema.cjs","names":["z","z","Result"],"sources":["../src/core/policies/engines/v1/condition-schema.ts","../src/core/policies/engines/v1/gate/gate-v1-payload.schema.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport type { ConditionLeafNode, ConditionNode } from \"./condition-types.js\";\n\n// ─── Shared v1 condition Zod schemas ─────────────────────────────────────────\n// Extracted from gate/v1 so both gate/v1 and compute/v1 can validate\n// condition nodes without either engine depending on the other.\n\nconst conditionOpSchema = z.enum([\n \"eq\",\n \"neq\",\n \"gt\",\n \"gte\",\n \"lt\",\n \"lte\",\n \"in\",\n \"notIn\",\n \"isNull\",\n \"isNotNull\",\n]);\n\nexport const conditionLeafNodeSchema: z.ZodType<ConditionLeafNode> = z\n .object({\n field: z.string().min(1),\n op: conditionOpSchema,\n value: z.unknown(),\n allowNull: z.literal(true).optional(),\n })\n .strict() as z.ZodType<ConditionLeafNode>;\n\n// Cap nesting depth so an adversarially deep payload fails validation instead\n// of overflowing the stack during parse: zod recurses once per level, and the\n// old `z.lazy` schema was unbounded. The schema is built to exactly this depth\n// (leaf-only past it), so a too-deep tree is rejected at the boundary without\n// deep recursion. 32 is far beyond any hand-written policy — raise it only with\n// a matching stack-safety review.\nexport const MAX_CONDITION_DEPTH = 32;\n\nfunction boundedConditionNodeSchema(depth: number): z.ZodType<ConditionNode> {\n if (depth <= 1) {\n return conditionLeafNodeSchema;\n }\n\n const child = boundedConditionNodeSchema(depth - 1);\n return z.union([\n conditionLeafNodeSchema,\n z.object({ and: z.array(child).min(1) }).strict(),\n z.object({ or: z.array(child).min(1) }).strict(),\n z.object({ not: child }).strict(),\n ]) as z.ZodType<ConditionNode>;\n}\n\nexport const conditionNodeSchema: z.ZodType<ConditionNode> =\n boundedConditionNodeSchema(MAX_CONDITION_DEPTH);\n","import { z } from \"zod\";\n\nimport { Result } from \"../../../../result/result.js\";\n\nimport type { GatePayloadV1 } from \"./gate-types-v1.js\";\nimport {\n conditionLeafNodeSchema,\n conditionNodeSchema,\n} from \"../condition-schema.js\";\n\n// Re-export so gate/v1 public API remains unchanged.\nexport { conditionLeafNodeSchema, conditionNodeSchema };\n\nexport class GatePayloadSchemaV1 {\n static readonly schema = z.union([\n z\n .object({\n condition: conditionNodeSchema,\n })\n .strict(),\n z\n .object({\n allowIf: conditionNodeSchema,\n defaultOutcome: z.enum([\"ALLOW\", \"DENY\"]),\n })\n .strict(),\n ]);\n\n static parse(payload: unknown): Result<GatePayloadV1, string> {\n const parsed = GatePayloadSchemaV1.schema.safeParse(payload);\n if (!parsed.success) {\n const details = parsed.error.issues\n .map((issue) => {\n const path = issue.path.join(\".\");\n return path.length > 0\n ? `${path}: ${issue.message}`\n : issue.message;\n })\n .join(\"; \");\n\n return Result.err(`Invalid gate payload: ${details}`);\n }\n\n return Result.ok(parsed.data as GatePayloadV1);\n }\n}\n\nexport const gatePayloadSchema = GatePayloadSchemaV1.schema;\n"],"mappings":";;;AAQA,MAAM,oBAAoBA,IAAAA,EAAE,KAAK;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACJ,CAAC;AAED,MAAa,0BAAwDA,IAAAA,EAChE,OAAO;CACJ,OAAOA,IAAAA,EAAE,OAAO,EAAE,IAAI,CAAC;CACvB,IAAI;CACJ,OAAOA,IAAAA,EAAE,QAAQ;CACjB,WAAWA,IAAAA,EAAE,QAAQ,IAAI,EAAE,SAAS;AACxC,CAAC,EACA,OAAO;AAUZ,SAAS,2BAA2B,OAAyC;CACzE,IAAI,SAAS,GACT,OAAO;CAGX,MAAM,QAAQ,2BAA2B,QAAQ,CAAC;CAClD,OAAOA,IAAAA,EAAE,MAAM;EACX;EACAA,IAAAA,EAAE,OAAO,EAAE,KAAKA,IAAAA,EAAE,MAAM,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,EAAE,OAAO;EAChDA,IAAAA,EAAE,OAAO,EAAE,IAAIA,IAAAA,EAAE,MAAM,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,EAAE,OAAO;EAC/CA,IAAAA,EAAE,OAAO,EAAE,KAAK,MAAM,CAAC,EAAE,OAAO;CACpC,CAAC;AACL;AAEA,MAAa,sBACT,2BAAA,EAA8C;;;ACxClD,IAAa,sBAAb,MAAa,oBAAoB;;gBACJC,IAAAA,EAAE,MAAM,CAC7BA,IAAAA,EACK,OAAO,EACJ,WAAW,oBACf,CAAC,EACA,OAAO,GACZA,IAAAA,EACK,OAAO;GACJ,SAAS;GACT,gBAAgBA,IAAAA,EAAE,KAAK,CAAC,SAAS,MAAM,CAAC;EAC5C,CAAC,EACA,OAAO,CAChB,CAAC;;CAED,OAAO,MAAM,SAAiD;EAC1D,MAAM,SAAS,oBAAoB,OAAO,UAAU,OAAO;EAC3D,IAAI,CAAC,OAAO,SAAS;GACjB,MAAM,UAAU,OAAO,MAAM,OACxB,KAAK,UAAU;IACZ,MAAM,OAAO,MAAM,KAAK,KAAK,GAAG;IAChC,OAAO,KAAK,SAAS,IACf,GAAG,KAAK,IAAI,MAAM,YAClB,MAAM;GAChB,CAAC,EACA,KAAK,IAAI;GAEd,OAAOC,eAAAA,OAAO,IAAI,yBAAyB,SAAS;EACxD;EAEA,OAAOA,eAAAA,OAAO,GAAG,OAAO,IAAqB;CACjD;AACJ;AAEA,MAAa,oBAAoB,oBAAoB"}
|
|
@@ -19,12 +19,17 @@ const conditionLeafNodeSchema = z.object({
|
|
|
19
19
|
value: z.unknown(),
|
|
20
20
|
allowNull: z.literal(true).optional()
|
|
21
21
|
}).strict();
|
|
22
|
-
|
|
23
|
-
conditionLeafNodeSchema
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
function boundedConditionNodeSchema(depth) {
|
|
23
|
+
if (depth <= 1) return conditionLeafNodeSchema;
|
|
24
|
+
const child = boundedConditionNodeSchema(depth - 1);
|
|
25
|
+
return z.union([
|
|
26
|
+
conditionLeafNodeSchema,
|
|
27
|
+
z.object({ and: z.array(child).min(1) }).strict(),
|
|
28
|
+
z.object({ or: z.array(child).min(1) }).strict(),
|
|
29
|
+
z.object({ not: child }).strict()
|
|
30
|
+
]);
|
|
31
|
+
}
|
|
32
|
+
const conditionNodeSchema = boundedConditionNodeSchema(32);
|
|
28
33
|
//#endregion
|
|
29
34
|
//#region src/core/policies/engines/v1/gate/gate-v1-payload.schema.ts
|
|
30
35
|
var GatePayloadSchemaV1 = class GatePayloadSchemaV1 {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gate-v1-payload.schema.js","names":[],"sources":["../src/core/policies/engines/v1/condition-schema.ts","../src/core/policies/engines/v1/gate/gate-v1-payload.schema.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport type { ConditionLeafNode, ConditionNode } from \"./condition-types.js\";\n\n// ─── Shared v1 condition Zod schemas ─────────────────────────────────────────\n// Extracted from gate/v1 so both gate/v1 and compute/v1 can validate\n// condition nodes without either engine depending on the other.\n\nconst conditionOpSchema = z.enum([\n \"eq\",\n \"neq\",\n \"gt\",\n \"gte\",\n \"lt\",\n \"lte\",\n \"in\",\n \"notIn\",\n \"isNull\",\n \"isNotNull\",\n]);\n\nexport const conditionLeafNodeSchema: z.ZodType<ConditionLeafNode> = z\n .object({\n field: z.string().min(1),\n op: conditionOpSchema,\n value: z.unknown(),\n allowNull: z.literal(true).optional(),\n })\n .strict() as z.ZodType<ConditionLeafNode>;\n\nexport const
|
|
1
|
+
{"version":3,"file":"gate-v1-payload.schema.js","names":[],"sources":["../src/core/policies/engines/v1/condition-schema.ts","../src/core/policies/engines/v1/gate/gate-v1-payload.schema.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport type { ConditionLeafNode, ConditionNode } from \"./condition-types.js\";\n\n// ─── Shared v1 condition Zod schemas ─────────────────────────────────────────\n// Extracted from gate/v1 so both gate/v1 and compute/v1 can validate\n// condition nodes without either engine depending on the other.\n\nconst conditionOpSchema = z.enum([\n \"eq\",\n \"neq\",\n \"gt\",\n \"gte\",\n \"lt\",\n \"lte\",\n \"in\",\n \"notIn\",\n \"isNull\",\n \"isNotNull\",\n]);\n\nexport const conditionLeafNodeSchema: z.ZodType<ConditionLeafNode> = z\n .object({\n field: z.string().min(1),\n op: conditionOpSchema,\n value: z.unknown(),\n allowNull: z.literal(true).optional(),\n })\n .strict() as z.ZodType<ConditionLeafNode>;\n\n// Cap nesting depth so an adversarially deep payload fails validation instead\n// of overflowing the stack during parse: zod recurses once per level, and the\n// old `z.lazy` schema was unbounded. The schema is built to exactly this depth\n// (leaf-only past it), so a too-deep tree is rejected at the boundary without\n// deep recursion. 32 is far beyond any hand-written policy — raise it only with\n// a matching stack-safety review.\nexport const MAX_CONDITION_DEPTH = 32;\n\nfunction boundedConditionNodeSchema(depth: number): z.ZodType<ConditionNode> {\n if (depth <= 1) {\n return conditionLeafNodeSchema;\n }\n\n const child = boundedConditionNodeSchema(depth - 1);\n return z.union([\n conditionLeafNodeSchema,\n z.object({ and: z.array(child).min(1) }).strict(),\n z.object({ or: z.array(child).min(1) }).strict(),\n z.object({ not: child }).strict(),\n ]) as z.ZodType<ConditionNode>;\n}\n\nexport const conditionNodeSchema: z.ZodType<ConditionNode> =\n boundedConditionNodeSchema(MAX_CONDITION_DEPTH);\n","import { z } from \"zod\";\n\nimport { Result } from \"../../../../result/result.js\";\n\nimport type { GatePayloadV1 } from \"./gate-types-v1.js\";\nimport {\n conditionLeafNodeSchema,\n conditionNodeSchema,\n} from \"../condition-schema.js\";\n\n// Re-export so gate/v1 public API remains unchanged.\nexport { conditionLeafNodeSchema, conditionNodeSchema };\n\nexport class GatePayloadSchemaV1 {\n static readonly schema = z.union([\n z\n .object({\n condition: conditionNodeSchema,\n })\n .strict(),\n z\n .object({\n allowIf: conditionNodeSchema,\n defaultOutcome: z.enum([\"ALLOW\", \"DENY\"]),\n })\n .strict(),\n ]);\n\n static parse(payload: unknown): Result<GatePayloadV1, string> {\n const parsed = GatePayloadSchemaV1.schema.safeParse(payload);\n if (!parsed.success) {\n const details = parsed.error.issues\n .map((issue) => {\n const path = issue.path.join(\".\");\n return path.length > 0\n ? `${path}: ${issue.message}`\n : issue.message;\n })\n .join(\"; \");\n\n return Result.err(`Invalid gate payload: ${details}`);\n }\n\n return Result.ok(parsed.data as GatePayloadV1);\n }\n}\n\nexport const gatePayloadSchema = GatePayloadSchemaV1.schema;\n"],"mappings":";;;AAQA,MAAM,oBAAoB,EAAE,KAAK;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACJ,CAAC;AAED,MAAa,0BAAwD,EAChE,OAAO;CACJ,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC;CACvB,IAAI;CACJ,OAAO,EAAE,QAAQ;CACjB,WAAW,EAAE,QAAQ,IAAI,EAAE,SAAS;AACxC,CAAC,EACA,OAAO;AAUZ,SAAS,2BAA2B,OAAyC;CACzE,IAAI,SAAS,GACT,OAAO;CAGX,MAAM,QAAQ,2BAA2B,QAAQ,CAAC;CAClD,OAAO,EAAE,MAAM;EACX;EACA,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,EAAE,OAAO;EAChD,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,EAAE,OAAO;EAC/C,EAAE,OAAO,EAAE,KAAK,MAAM,CAAC,EAAE,OAAO;CACpC,CAAC;AACL;AAEA,MAAa,sBACT,2BAAA,EAA8C;;;ACxClD,IAAa,sBAAb,MAAa,oBAAoB;;gBACJ,EAAE,MAAM,CAC7B,EACK,OAAO,EACJ,WAAW,oBACf,CAAC,EACA,OAAO,GACZ,EACK,OAAO;GACJ,SAAS;GACT,gBAAgB,EAAE,KAAK,CAAC,SAAS,MAAM,CAAC;EAC5C,CAAC,EACA,OAAO,CAChB,CAAC;;CAED,OAAO,MAAM,SAAiD;EAC1D,MAAM,SAAS,oBAAoB,OAAO,UAAU,OAAO;EAC3D,IAAI,CAAC,OAAO,SAAS;GACjB,MAAM,UAAU,OAAO,MAAM,OACxB,KAAK,UAAU;IACZ,MAAM,OAAO,MAAM,KAAK,KAAK,GAAG;IAChC,OAAO,KAAK,SAAS,IACf,GAAG,KAAK,IAAI,MAAM,YAClB,MAAM;GAChB,CAAC,EACA,KAAK,IAAI;GAEd,OAAO,OAAO,IAAI,yBAAyB,SAAS;EACxD;EAEA,OAAO,OAAO,GAAG,OAAO,IAAqB;CACjD;AACJ;AAEA,MAAa,oBAAoB,oBAAoB"}
|
package/dist/hashing.cjs
CHANGED
|
@@ -1,47 +1,11 @@
|
|
|
1
|
+
const require_stable_stringify = require("./stable-stringify.cjs");
|
|
1
2
|
let node_crypto = require("node:crypto");
|
|
2
3
|
//#region src/core/shared/hashing.ts
|
|
3
|
-
const CIRCULAR_STRUCTURE_MESSAGE = "Cannot stably stringify a circular structure";
|
|
4
4
|
function sha256Hex(value) {
|
|
5
5
|
return (0, node_crypto.createHash)("sha256").update(value, "utf8").digest("hex");
|
|
6
6
|
}
|
|
7
|
-
function sortKeysDeep(value, seen) {
|
|
8
|
-
if (Array.isArray(value)) {
|
|
9
|
-
if (seen.has(value)) throw new TypeError(CIRCULAR_STRUCTURE_MESSAGE);
|
|
10
|
-
seen.add(value);
|
|
11
|
-
const mapped = value.map((item) => sortKeysDeep(item, seen));
|
|
12
|
-
seen.delete(value);
|
|
13
|
-
return mapped;
|
|
14
|
-
}
|
|
15
|
-
if (value instanceof Date) return value;
|
|
16
|
-
if (value && typeof value === "object") {
|
|
17
|
-
if (seen.has(value)) throw new TypeError(CIRCULAR_STRUCTURE_MESSAGE);
|
|
18
|
-
seen.add(value);
|
|
19
|
-
const record = value;
|
|
20
|
-
const ordered = Object.create(null);
|
|
21
|
-
for (const key of Object.keys(record).sort()) ordered[key] = sortKeysDeep(record[key], seen);
|
|
22
|
-
seen.delete(value);
|
|
23
|
-
return ordered;
|
|
24
|
-
}
|
|
25
|
-
return value;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Deterministic JSON string with object keys sorted recursively, so key order
|
|
29
|
-
* does not affect the output.
|
|
30
|
-
*
|
|
31
|
-
* Follows `JSON.stringify` semantics for the values it serializes: `undefined`,
|
|
32
|
-
* functions and symbols are dropped, non-finite numbers become `null`, `bigint`
|
|
33
|
-
* throws, and `Map`/`Set` serialize as `{}`. Distinct payloads can therefore
|
|
34
|
-
* collapse to the same string — for collision-resistant hashing use
|
|
35
|
-
* `PolicyHashing.canonicalJson` (policies/utils), which rejects those values
|
|
36
|
-
* up front.
|
|
37
|
-
*
|
|
38
|
-
* @throws {TypeError} On circular references (mirroring `JSON.stringify`).
|
|
39
|
-
*/
|
|
40
|
-
function stableStringify(value) {
|
|
41
|
-
return JSON.stringify(sortKeysDeep(value, /* @__PURE__ */ new WeakSet()));
|
|
42
|
-
}
|
|
43
7
|
function payloadHash(value) {
|
|
44
|
-
return sha256Hex(
|
|
8
|
+
return sha256Hex(require_stable_stringify.canonicalStringify(value));
|
|
45
9
|
}
|
|
46
10
|
//#endregion
|
|
47
11
|
Object.defineProperty(exports, "payloadHash", {
|
|
@@ -56,11 +20,5 @@ Object.defineProperty(exports, "sha256Hex", {
|
|
|
56
20
|
return sha256Hex;
|
|
57
21
|
}
|
|
58
22
|
});
|
|
59
|
-
Object.defineProperty(exports, "stableStringify", {
|
|
60
|
-
enumerable: true,
|
|
61
|
-
get: function() {
|
|
62
|
-
return stableStringify;
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
23
|
|
|
66
24
|
//# sourceMappingURL=hashing.cjs.map
|
package/dist/hashing.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hashing.cjs","names":[],"sources":["../src/core/shared/hashing.ts"],"sourcesContent":["import { createHash } from \"node:crypto\";\n\
|
|
1
|
+
{"version":3,"file":"hashing.cjs","names":["canonicalStringify"],"sources":["../src/core/shared/hashing.ts"],"sourcesContent":["import { createHash } from \"node:crypto\";\n\nimport { canonicalStringify } from \"./stable-stringify.js\";\n\nfunction sha256Hex(value: string): string {\n return createHash(\"sha256\").update(value, \"utf8\").digest(\"hex\");\n}\n\n// Strict by design: hashes the collision-resistant canonical form, so payloads\n// that differ only in values `JSON.stringify` would drop (undefined, NaN, …)\n// produce distinct digests instead of silently colliding.\nfunction payloadHash(value: unknown): string {\n return sha256Hex(canonicalStringify(value));\n}\n\nexport { payloadHash, sha256Hex };\n"],"mappings":";;;AAIA,SAAS,UAAU,OAAuB;CACtC,QAAA,GAAA,YAAA,YAAkB,QAAQ,EAAE,OAAO,OAAO,MAAM,EAAE,OAAO,KAAK;AAClE;AAKA,SAAS,YAAY,OAAwB;CACzC,OAAO,UAAUA,yBAAAA,mBAAmB,KAAK,CAAC;AAC9C"}
|
package/dist/hashing.js
CHANGED
|
@@ -1,49 +1,13 @@
|
|
|
1
|
+
import { t as canonicalStringify } from "./stable-stringify.js";
|
|
1
2
|
import { createHash } from "node:crypto";
|
|
2
3
|
//#region src/core/shared/hashing.ts
|
|
3
|
-
const CIRCULAR_STRUCTURE_MESSAGE = "Cannot stably stringify a circular structure";
|
|
4
4
|
function sha256Hex(value) {
|
|
5
5
|
return createHash("sha256").update(value, "utf8").digest("hex");
|
|
6
6
|
}
|
|
7
|
-
function sortKeysDeep(value, seen) {
|
|
8
|
-
if (Array.isArray(value)) {
|
|
9
|
-
if (seen.has(value)) throw new TypeError(CIRCULAR_STRUCTURE_MESSAGE);
|
|
10
|
-
seen.add(value);
|
|
11
|
-
const mapped = value.map((item) => sortKeysDeep(item, seen));
|
|
12
|
-
seen.delete(value);
|
|
13
|
-
return mapped;
|
|
14
|
-
}
|
|
15
|
-
if (value instanceof Date) return value;
|
|
16
|
-
if (value && typeof value === "object") {
|
|
17
|
-
if (seen.has(value)) throw new TypeError(CIRCULAR_STRUCTURE_MESSAGE);
|
|
18
|
-
seen.add(value);
|
|
19
|
-
const record = value;
|
|
20
|
-
const ordered = Object.create(null);
|
|
21
|
-
for (const key of Object.keys(record).sort()) ordered[key] = sortKeysDeep(record[key], seen);
|
|
22
|
-
seen.delete(value);
|
|
23
|
-
return ordered;
|
|
24
|
-
}
|
|
25
|
-
return value;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Deterministic JSON string with object keys sorted recursively, so key order
|
|
29
|
-
* does not affect the output.
|
|
30
|
-
*
|
|
31
|
-
* Follows `JSON.stringify` semantics for the values it serializes: `undefined`,
|
|
32
|
-
* functions and symbols are dropped, non-finite numbers become `null`, `bigint`
|
|
33
|
-
* throws, and `Map`/`Set` serialize as `{}`. Distinct payloads can therefore
|
|
34
|
-
* collapse to the same string — for collision-resistant hashing use
|
|
35
|
-
* `PolicyHashing.canonicalJson` (policies/utils), which rejects those values
|
|
36
|
-
* up front.
|
|
37
|
-
*
|
|
38
|
-
* @throws {TypeError} On circular references (mirroring `JSON.stringify`).
|
|
39
|
-
*/
|
|
40
|
-
function stableStringify(value) {
|
|
41
|
-
return JSON.stringify(sortKeysDeep(value, /* @__PURE__ */ new WeakSet()));
|
|
42
|
-
}
|
|
43
7
|
function payloadHash(value) {
|
|
44
|
-
return sha256Hex(
|
|
8
|
+
return sha256Hex(canonicalStringify(value));
|
|
45
9
|
}
|
|
46
10
|
//#endregion
|
|
47
|
-
export { sha256Hex as n,
|
|
11
|
+
export { sha256Hex as n, payloadHash as t };
|
|
48
12
|
|
|
49
13
|
//# sourceMappingURL=hashing.js.map
|
package/dist/hashing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hashing.js","names":[],"sources":["../src/core/shared/hashing.ts"],"sourcesContent":["import { createHash } from \"node:crypto\";\n\
|
|
1
|
+
{"version":3,"file":"hashing.js","names":[],"sources":["../src/core/shared/hashing.ts"],"sourcesContent":["import { createHash } from \"node:crypto\";\n\nimport { canonicalStringify } from \"./stable-stringify.js\";\n\nfunction sha256Hex(value: string): string {\n return createHash(\"sha256\").update(value, \"utf8\").digest(\"hex\");\n}\n\n// Strict by design: hashes the collision-resistant canonical form, so payloads\n// that differ only in values `JSON.stringify` would drop (undefined, NaN, …)\n// produce distinct digests instead of silently colliding.\nfunction payloadHash(value: unknown): string {\n return sha256Hex(canonicalStringify(value));\n}\n\nexport { payloadHash, sha256Hex };\n"],"mappings":";;;AAIA,SAAS,UAAU,OAAuB;CACtC,OAAO,WAAW,QAAQ,EAAE,OAAO,OAAO,MAAM,EAAE,OAAO,KAAK;AAClE;AAKA,SAAS,YAAY,OAAwB;CACzC,OAAO,UAAU,mBAAmB,KAAK,CAAC;AAC9C"}
|
package/dist/immutable.cjs
CHANGED
|
@@ -2,8 +2,26 @@ const require_invariant_violation_exception = require("./invariant-violation-exc
|
|
|
2
2
|
//#region src/core/versioning/version.ts
|
|
3
3
|
const CONTRACT_VERSION_PROPERTY = "CONTRACT_VERSION";
|
|
4
4
|
const CONTRACT_VERSION_PATTERN = /^\d+\.\d+$/;
|
|
5
|
+
/**
|
|
6
|
+
* Class decorator that stamps a `MAJOR.MINOR` structural contract version onto
|
|
7
|
+
* the class as a static `CONTRACT_VERSION` property.
|
|
8
|
+
*
|
|
9
|
+
* The property is defined **non-writable, non-configurable and non-enumerable**
|
|
10
|
+
* on purpose: it must not be reassigned or redefined (tampering with a contract
|
|
11
|
+
* version silently corrupts migration decisions), and keeping it off enumeration
|
|
12
|
+
* excludes it from `JSON.stringify`/`for..in`. A consequence of
|
|
13
|
+
* `configurable: false` is that decorating the same class twice throws
|
|
14
|
+
* `TypeError: Cannot redefine property` — a deliberate fail-fast.
|
|
15
|
+
*
|
|
16
|
+
* Note on inheritance: a subclass that is not re-decorated inherits its base's
|
|
17
|
+
* `CONTRACT_VERSION` through the static prototype chain. Re-decorate any
|
|
18
|
+
* subclass whose persisted shape diverges from its base.
|
|
19
|
+
*
|
|
20
|
+
* @throws {InvariantViolationException} When `contractVersion` is not
|
|
21
|
+
* `MAJOR.MINOR` (validated at module-load time, when the decorator runs).
|
|
22
|
+
*/
|
|
5
23
|
function version(contractVersion) {
|
|
6
|
-
if (!CONTRACT_VERSION_PATTERN.test(contractVersion)) throw new
|
|
24
|
+
if (!CONTRACT_VERSION_PATTERN.test(contractVersion)) throw new require_invariant_violation_exception.InvariantViolationException(`Invalid contract version "${contractVersion}". Expected MAJOR.MINOR.`);
|
|
7
25
|
return (target) => {
|
|
8
26
|
Object.defineProperty(target, CONTRACT_VERSION_PROPERTY, {
|
|
9
27
|
value: contractVersion,
|
|
@@ -14,14 +32,6 @@ function version(contractVersion) {
|
|
|
14
32
|
};
|
|
15
33
|
}
|
|
16
34
|
//#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
35
|
//#region src/core/shared/immutable.ts
|
|
26
36
|
function deepFreeze(value) {
|
|
27
37
|
return deepFreezeInternal(value, /* @__PURE__ */ new WeakSet());
|
|
@@ -35,7 +45,10 @@ function deepFreezeInternal(value, seen) {
|
|
|
35
45
|
return Object.freeze(value);
|
|
36
46
|
}
|
|
37
47
|
const objectValue = value;
|
|
38
|
-
for (const propertyKey of Reflect.ownKeys(objectValue))
|
|
48
|
+
for (const propertyKey of Reflect.ownKeys(objectValue)) {
|
|
49
|
+
const descriptor = Object.getOwnPropertyDescriptor(objectValue, propertyKey);
|
|
50
|
+
if (descriptor && "value" in descriptor) deepFreezeInternal(descriptor.value, seen);
|
|
51
|
+
}
|
|
39
52
|
return Object.freeze(value);
|
|
40
53
|
}
|
|
41
54
|
function makeImmutable(value) {
|
|
@@ -55,10 +68,10 @@ Object.defineProperty(exports, "CONTRACT_VERSION_PROPERTY", {
|
|
|
55
68
|
return CONTRACT_VERSION_PROPERTY;
|
|
56
69
|
}
|
|
57
70
|
});
|
|
58
|
-
Object.defineProperty(exports, "
|
|
71
|
+
Object.defineProperty(exports, "deepFreeze", {
|
|
59
72
|
enumerable: true,
|
|
60
73
|
get: function() {
|
|
61
|
-
return
|
|
74
|
+
return deepFreeze;
|
|
62
75
|
}
|
|
63
76
|
});
|
|
64
77
|
Object.defineProperty(exports, "makeImmutable", {
|
package/dist/immutable.cjs.map
CHANGED
|
@@ -1 +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
|
|
1
|
+
{"version":3,"file":"immutable.cjs","names":["InvariantViolationException","InvariantViolationException"],"sources":["../src/core/versioning/version.ts","../src/core/shared/immutable.ts"],"sourcesContent":["import { InvariantViolationException } from \"../exceptions/invariant-violation-exception.js\";\n\n/**\n * A structural contract version in `MAJOR.MINOR` form (e.g. `\"1.0\"`, `\"2.5\"`).\n *\n * The template-literal type is intentionally loose — it also accepts strings\n * the module rejects at runtime (e.g. `\"1.0.0\"` matches as `1` · `.` · `0.0`).\n * The runtime regex in {@link version} is the real guard; the type is only a\n * light hint.\n */\ntype ContractVersion = `${number}.${number}`;\n\n/** Anything a class decorator can stamp a static property onto. */\ntype VersionedTarget = {\n readonly prototype: object;\n};\n\nconst CONTRACT_VERSION_PROPERTY = \"CONTRACT_VERSION\" as const;\nconst CONTRACT_VERSION_PATTERN = /^\\d+\\.\\d+$/;\n\n/**\n * Class decorator that stamps a `MAJOR.MINOR` structural contract version onto\n * the class as a static `CONTRACT_VERSION` property.\n *\n * The property is defined **non-writable, non-configurable and non-enumerable**\n * on purpose: it must not be reassigned or redefined (tampering with a contract\n * version silently corrupts migration decisions), and keeping it off enumeration\n * excludes it from `JSON.stringify`/`for..in`. A consequence of\n * `configurable: false` is that decorating the same class twice throws\n * `TypeError: Cannot redefine property` — a deliberate fail-fast.\n *\n * Note on inheritance: a subclass that is not re-decorated inherits its base's\n * `CONTRACT_VERSION` through the static prototype chain. Re-decorate any\n * subclass whose persisted shape diverges from its base.\n *\n * @throws {InvariantViolationException} When `contractVersion` is not\n * `MAJOR.MINOR` (validated at module-load time, when the decorator runs).\n */\nfunction version<const TVersion extends ContractVersion>(\n contractVersion: TVersion,\n) {\n if (!CONTRACT_VERSION_PATTERN.test(contractVersion)) {\n throw new InvariantViolationException(\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 //\n // The same no-op caveat applies to `Map`/`Set`: `Object.freeze` locks the\n // wrapper's own properties but not `.set`/`.delete`/`.clear`, which mutate\n // internal slots. A frozen Map is still mutable through its methods. We do\n // not neuter those methods here (no value object wraps a Map today); if one\n // ever does, its immutability guarantee would be false — handle it there.\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 // Read through the descriptor rather than `objectValue[propertyKey]` so\n // accessor properties are not invoked — a getter could have side effects\n // or throw, and its computed result can't be frozen anyway. Only data\n // properties hold a nested value worth recursing into.\n const descriptor = Object.getOwnPropertyDescriptor(\n objectValue,\n propertyKey,\n );\n if (descriptor && \"value\" in descriptor) {\n deepFreezeInternal(descriptor.value, seen);\n }\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 and symbols.\n // (Class instances do NOT throw — they are silently flattened to plain\n // objects, prototype lost.) Surface the error as a domain invariant\n // instead of leaking a host-specific runtime error to callers building\n // 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":";;AAiBA,MAAM,4BAA4B;AAClC,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;AAoBjC,SAAS,QACL,iBACF;CACE,IAAI,CAAC,yBAAyB,KAAK,eAAe,GAC9C,MAAM,IAAIA,sCAAAA,4BACN,6BAA6B,gBAAgB,yBACjD;CAGJ,QAAQ,WAAkC;EACtC,OAAO,eAAe,QAAQ,2BAA2B;GACrD,OAAO;GACP,UAAU;GACV,cAAc;GACd,YAAY;EAChB,CAAC;CACL;AACJ;;;ACtCA,SAAS,WAAc,OAAa;CAChC,OAAO,mBAAmB,uBAAO,IAAI,QAAgB,CAAC;AAC1D;AAEA,SAAS,mBAAsB,OAAU,MAA0B;CAa/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,GAAG;EAKpD,MAAM,aAAa,OAAO,yBACtB,aACA,WACJ;EACA,IAAI,cAAc,WAAW,YACzB,mBAAmB,WAAW,OAAO,IAAI;CAEjD;CAEA,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;EAMZ,MAAM,IAAIC,sCAAAA,4BACN,wDACI,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,GAE7D;CACJ;CAEA,OAAO,WAAW,QAAQ;AAC9B"}
|
package/dist/immutable.js
CHANGED
|
@@ -2,8 +2,26 @@ import { t as InvariantViolationException } from "./invariant-violation-exceptio
|
|
|
2
2
|
//#region src/core/versioning/version.ts
|
|
3
3
|
const CONTRACT_VERSION_PROPERTY = "CONTRACT_VERSION";
|
|
4
4
|
const CONTRACT_VERSION_PATTERN = /^\d+\.\d+$/;
|
|
5
|
+
/**
|
|
6
|
+
* Class decorator that stamps a `MAJOR.MINOR` structural contract version onto
|
|
7
|
+
* the class as a static `CONTRACT_VERSION` property.
|
|
8
|
+
*
|
|
9
|
+
* The property is defined **non-writable, non-configurable and non-enumerable**
|
|
10
|
+
* on purpose: it must not be reassigned or redefined (tampering with a contract
|
|
11
|
+
* version silently corrupts migration decisions), and keeping it off enumeration
|
|
12
|
+
* excludes it from `JSON.stringify`/`for..in`. A consequence of
|
|
13
|
+
* `configurable: false` is that decorating the same class twice throws
|
|
14
|
+
* `TypeError: Cannot redefine property` — a deliberate fail-fast.
|
|
15
|
+
*
|
|
16
|
+
* Note on inheritance: a subclass that is not re-decorated inherits its base's
|
|
17
|
+
* `CONTRACT_VERSION` through the static prototype chain. Re-decorate any
|
|
18
|
+
* subclass whose persisted shape diverges from its base.
|
|
19
|
+
*
|
|
20
|
+
* @throws {InvariantViolationException} When `contractVersion` is not
|
|
21
|
+
* `MAJOR.MINOR` (validated at module-load time, when the decorator runs).
|
|
22
|
+
*/
|
|
5
23
|
function version(contractVersion) {
|
|
6
|
-
if (!CONTRACT_VERSION_PATTERN.test(contractVersion)) throw new
|
|
24
|
+
if (!CONTRACT_VERSION_PATTERN.test(contractVersion)) throw new InvariantViolationException(`Invalid contract version "${contractVersion}". Expected MAJOR.MINOR.`);
|
|
7
25
|
return (target) => {
|
|
8
26
|
Object.defineProperty(target, CONTRACT_VERSION_PROPERTY, {
|
|
9
27
|
value: contractVersion,
|
|
@@ -14,14 +32,6 @@ function version(contractVersion) {
|
|
|
14
32
|
};
|
|
15
33
|
}
|
|
16
34
|
//#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
35
|
//#region src/core/shared/immutable.ts
|
|
26
36
|
function deepFreeze(value) {
|
|
27
37
|
return deepFreezeInternal(value, /* @__PURE__ */ new WeakSet());
|
|
@@ -35,7 +45,10 @@ function deepFreezeInternal(value, seen) {
|
|
|
35
45
|
return Object.freeze(value);
|
|
36
46
|
}
|
|
37
47
|
const objectValue = value;
|
|
38
|
-
for (const propertyKey of Reflect.ownKeys(objectValue))
|
|
48
|
+
for (const propertyKey of Reflect.ownKeys(objectValue)) {
|
|
49
|
+
const descriptor = Object.getOwnPropertyDescriptor(objectValue, propertyKey);
|
|
50
|
+
if (descriptor && "value" in descriptor) deepFreezeInternal(descriptor.value, seen);
|
|
51
|
+
}
|
|
39
52
|
return Object.freeze(value);
|
|
40
53
|
}
|
|
41
54
|
function makeImmutable(value) {
|
|
@@ -49,6 +62,6 @@ function makeImmutable(value) {
|
|
|
49
62
|
return deepFreeze(snapshot);
|
|
50
63
|
}
|
|
51
64
|
//#endregion
|
|
52
|
-
export { version as i,
|
|
65
|
+
export { version as i, makeImmutable as n, CONTRACT_VERSION_PROPERTY as r, deepFreeze as t };
|
|
53
66
|
|
|
54
67
|
//# sourceMappingURL=immutable.js.map
|
package/dist/immutable.js.map
CHANGED
|
@@ -1 +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
|
|
1
|
+
{"version":3,"file":"immutable.js","names":[],"sources":["../src/core/versioning/version.ts","../src/core/shared/immutable.ts"],"sourcesContent":["import { InvariantViolationException } from \"../exceptions/invariant-violation-exception.js\";\n\n/**\n * A structural contract version in `MAJOR.MINOR` form (e.g. `\"1.0\"`, `\"2.5\"`).\n *\n * The template-literal type is intentionally loose — it also accepts strings\n * the module rejects at runtime (e.g. `\"1.0.0\"` matches as `1` · `.` · `0.0`).\n * The runtime regex in {@link version} is the real guard; the type is only a\n * light hint.\n */\ntype ContractVersion = `${number}.${number}`;\n\n/** Anything a class decorator can stamp a static property onto. */\ntype VersionedTarget = {\n readonly prototype: object;\n};\n\nconst CONTRACT_VERSION_PROPERTY = \"CONTRACT_VERSION\" as const;\nconst CONTRACT_VERSION_PATTERN = /^\\d+\\.\\d+$/;\n\n/**\n * Class decorator that stamps a `MAJOR.MINOR` structural contract version onto\n * the class as a static `CONTRACT_VERSION` property.\n *\n * The property is defined **non-writable, non-configurable and non-enumerable**\n * on purpose: it must not be reassigned or redefined (tampering with a contract\n * version silently corrupts migration decisions), and keeping it off enumeration\n * excludes it from `JSON.stringify`/`for..in`. A consequence of\n * `configurable: false` is that decorating the same class twice throws\n * `TypeError: Cannot redefine property` — a deliberate fail-fast.\n *\n * Note on inheritance: a subclass that is not re-decorated inherits its base's\n * `CONTRACT_VERSION` through the static prototype chain. Re-decorate any\n * subclass whose persisted shape diverges from its base.\n *\n * @throws {InvariantViolationException} When `contractVersion` is not\n * `MAJOR.MINOR` (validated at module-load time, when the decorator runs).\n */\nfunction version<const TVersion extends ContractVersion>(\n contractVersion: TVersion,\n) {\n if (!CONTRACT_VERSION_PATTERN.test(contractVersion)) {\n throw new InvariantViolationException(\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 //\n // The same no-op caveat applies to `Map`/`Set`: `Object.freeze` locks the\n // wrapper's own properties but not `.set`/`.delete`/`.clear`, which mutate\n // internal slots. A frozen Map is still mutable through its methods. We do\n // not neuter those methods here (no value object wraps a Map today); if one\n // ever does, its immutability guarantee would be false — handle it there.\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 // Read through the descriptor rather than `objectValue[propertyKey]` so\n // accessor properties are not invoked — a getter could have side effects\n // or throw, and its computed result can't be frozen anyway. Only data\n // properties hold a nested value worth recursing into.\n const descriptor = Object.getOwnPropertyDescriptor(\n objectValue,\n propertyKey,\n );\n if (descriptor && \"value\" in descriptor) {\n deepFreezeInternal(descriptor.value, seen);\n }\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 and symbols.\n // (Class instances do NOT throw — they are silently flattened to plain\n // objects, prototype lost.) Surface the error as a domain invariant\n // instead of leaking a host-specific runtime error to callers building\n // 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":";;AAiBA,MAAM,4BAA4B;AAClC,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;AAoBjC,SAAS,QACL,iBACF;CACE,IAAI,CAAC,yBAAyB,KAAK,eAAe,GAC9C,MAAM,IAAI,4BACN,6BAA6B,gBAAgB,yBACjD;CAGJ,QAAQ,WAAkC;EACtC,OAAO,eAAe,QAAQ,2BAA2B;GACrD,OAAO;GACP,UAAU;GACV,cAAc;GACd,YAAY;EAChB,CAAC;CACL;AACJ;;;ACtCA,SAAS,WAAc,OAAa;CAChC,OAAO,mBAAmB,uBAAO,IAAI,QAAgB,CAAC;AAC1D;AAEA,SAAS,mBAAsB,OAAU,MAA0B;CAa/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,GAAG;EAKpD,MAAM,aAAa,OAAO,yBACtB,aACA,WACJ;EACA,IAAI,cAAc,WAAW,YACzB,mBAAmB,WAAW,OAAO,IAAI;CAEjD;CAEA,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;EAMZ,MAAM,IAAI,4BACN,wDACI,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,GAE7D;CACJ;CAEA,OAAO,WAAW,QAAQ;AAC9B"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_app_error = require("./app-error.cjs");
|
|
3
|
-
const require_validation_error = require("./validation-error.cjs");
|
|
4
3
|
const require_authorization_error = require("./authorization-error.cjs");
|
|
4
|
+
const require_validation_error = require("./validation-error.cjs");
|
|
5
5
|
const require_not_found_error = require("./not-found-error.cjs");
|
|
6
|
+
const require_domain_exception = require("./domain-exception.cjs");
|
|
7
|
+
const require_invariant_violation_exception = require("./invariant-violation-exception.cjs");
|
|
8
|
+
const require_stable_stringify = require("./stable-stringify.cjs");
|
|
6
9
|
const require_hashing = require("./hashing.cjs");
|
|
7
10
|
const require_unexpected_error = require("./unexpected-error.cjs");
|
|
8
11
|
const require_validation_code = require("./validation-code.cjs");
|
|
9
12
|
const require_validation_field = require("./validation-field.cjs");
|
|
10
|
-
const require_domain_exception = require("./domain-exception.cjs");
|
|
11
13
|
const require_invalid_state_transition_exception = require("./invalid-state-transition-exception.cjs");
|
|
12
|
-
const require_invariant_violation_exception = require("./invariant-violation-exception.cjs");
|
|
13
14
|
const require_validation_exception = require("./validation-exception.cjs");
|
|
14
15
|
const require_immutable = require("./immutable.cjs");
|
|
15
|
-
const require_use_case = require("./use-case.cjs");
|
|
16
|
-
const require_requested_by = require("./requested-by.cjs");
|
|
17
16
|
const require_temporal_use_case = require("./temporal-use-case.cjs");
|
|
18
|
-
const
|
|
17
|
+
const require_requested_by = require("./requested-by.cjs");
|
|
19
18
|
const require_plugin = require("./plugin.cjs");
|
|
20
19
|
const require_value_object = require("./value-object.cjs");
|
|
21
20
|
const require_uuid_identifier = require("./uuid-identifier.cjs");
|
|
@@ -29,7 +28,7 @@ const require_domain_event_contracts = require("./domain-event-contracts.cjs");
|
|
|
29
28
|
const require_outcome = require("./outcome.cjs");
|
|
30
29
|
const require_gate_engine_registry = require("./gate-engine-registry.cjs");
|
|
31
30
|
//#region src/version.ts
|
|
32
|
-
const version$1 = "
|
|
31
|
+
const version$1 = "2.0.0";
|
|
33
32
|
//#endregion
|
|
34
33
|
//#region src/index.ts
|
|
35
34
|
const ERP_CORE_NAME = "erp-core";
|
|
@@ -73,7 +72,7 @@ exports.ERP_CORE_VERSION = ERP_CORE_VERSION;
|
|
|
73
72
|
Object.defineProperty(exports, "Entity", {
|
|
74
73
|
enumerable: true,
|
|
75
74
|
get: function() {
|
|
76
|
-
return
|
|
75
|
+
return require_uuid_identifier.Entity;
|
|
77
76
|
}
|
|
78
77
|
});
|
|
79
78
|
exports.EntityNotFoundException = require_invalid_state_transition_exception.EntityNotFoundException;
|
|
@@ -132,13 +131,18 @@ exports.SerializationInError = require_validation_error.SerializationInError;
|
|
|
132
131
|
exports.SerializationMessages = require_validation_error.SerializationMessages;
|
|
133
132
|
exports.SerializationOutError = require_validation_error.SerializationOutError;
|
|
134
133
|
exports.TemporalError = require_validation_error.TemporalError;
|
|
135
|
-
exports
|
|
134
|
+
Object.defineProperty(exports, "TemporalUseCase", {
|
|
135
|
+
enumerable: true,
|
|
136
|
+
get: function() {
|
|
137
|
+
return require_temporal_use_case.TemporalUseCase;
|
|
138
|
+
}
|
|
139
|
+
});
|
|
136
140
|
exports.UnexpectedError = require_unexpected_error.UnexpectedError;
|
|
137
141
|
exports.UniqueConstraintViolationError = require_validation_error.UniqueConstraintViolationError;
|
|
138
142
|
Object.defineProperty(exports, "UseCase", {
|
|
139
143
|
enumerable: true,
|
|
140
144
|
get: function() {
|
|
141
|
-
return
|
|
145
|
+
return require_temporal_use_case.UseCase;
|
|
142
146
|
}
|
|
143
147
|
});
|
|
144
148
|
exports.UuidIdentifier = require_uuid_identifier.UuidIdentifier;
|
|
@@ -174,7 +178,7 @@ exports.registerNamespacedContextResolversIn = require_policy_service.registerNa
|
|
|
174
178
|
exports.safePreview = require_validation_error.safePreview;
|
|
175
179
|
exports.serializationErrorCode = require_app_error.serializationErrorCode;
|
|
176
180
|
exports.sha256Hex = require_hashing.sha256Hex;
|
|
177
|
-
exports.stableStringify =
|
|
181
|
+
exports.stableStringify = require_stable_stringify.stableStringify;
|
|
178
182
|
exports.translateUniqueViolationToDuplicate = require_validation_error.translateUniqueViolationToDuplicate;
|
|
179
183
|
exports.version = require_immutable.version;
|
|
180
184
|
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +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
|
+
{"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 = \"2.0.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"}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,37 +1,36 @@
|
|
|
1
1
|
import { n as RequestedByKind, t as RequestedBy } from "./requested-by.cjs";
|
|
2
|
-
import { a as AbacPolicySet, c as
|
|
2
|
+
import { a as AbacPolicySet, c as AbacRule, d as abacContext, f as AbacAuthorizerPort, i as AbacDecision, l as AbacRuleProps, m as AbacRequest, n as CompositeAuthorizer, o as OnEvaluationError, p as AbacAttributes, r as AbacAuthorizer, s as CombiningAlgorithm, t as CompositeAccessRequest, u as RuleEffect } from "./composite-authorizer.cjs";
|
|
3
3
|
import { a as JsonSafeRecord, i as JsonSafePrimitive, n as AppErrorOptions, o as JsonSafeValue, r as ErrorSeverity, t as AppError } from "./app-error.cjs";
|
|
4
4
|
import { i as AuthorizationRequirement, n as AuthorizationErrorMetadata, r as AuthorizationErrorReason, t as AuthorizationError } from "./authorization-error.cjs";
|
|
5
5
|
import { n as Ok, r as Result, t as Err } from "./result.cjs";
|
|
6
6
|
import { n as Outcome, t as CommonOutcomeStatus } from "./outcome.cjs";
|
|
7
|
-
import { C as
|
|
7
|
+
import { C as GateViolationTrace, D as GatePayload, E as VersionedGateEngine, S as GateTraceNodeSnapshot, T as PolicyViolation, _ as ConditionEvaluatorReporter, a as PolicyDefinitionId, b as GateStatus, c as asPolicyDecisionId, d as asTenantId, f as ConditionEvaluationCause, g as ConditionEvaluationReportTag, h as ConditionEvaluationReportLevel, i as PolicyDecisionId, l as asPolicyDefinitionId, m as ConditionEvaluationReport, n as CoreConfigOptions, o as SchoolId, p as ConditionEvaluationOptions, r as CoreObservabilityConfig, s as TenantId, t as CoreConfig, u as asSchoolId, v as GateOutcome, w as PolicyContext, x as GateTraceLeafSnapshot, y as GateOutcomeData } from "./core-config.cjs";
|
|
8
8
|
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";
|
|
9
9
|
import { a as PluginContract, i as PipelineReducer, n as BasePlugin, r as InvokeOptions, t as PluginManager } from "./plugin.cjs";
|
|
10
10
|
import { t as DeepReadonly } from "./immutable.cjs";
|
|
11
11
|
import { i as version, n as ContractVersion, r as VersionedTarget, t as CONTRACT_VERSION_PROPERTY } from "./version.cjs";
|
|
12
12
|
import { n as ValueObjectPluginContract, t as ValueObject } from "./value-object.cjs";
|
|
13
13
|
import { a as Permission, i as ScopeProps, n as AccessRequest, o as PermissionProps, r as Scope, t as AuthorizerPort } from "./authorizer.port.cjs";
|
|
14
|
-
import { A as
|
|
15
|
-
import { A as IdempotencyPayloadMismatchError, B as UniqueConstraintViolation, C as IntegrationErrorMetadata, D as IdempotencyFailureKind, E as IdempotencyErrorMetadata, F as AlreadyExistsError, G as AuthenticationErrorMetadata, H as translateUniqueViolationToDuplicate, I as ConflictError, J as ErrorCodes, K as AuthenticationErrorReason, L as ConflictErrorMetadata, M as
|
|
14
|
+
import { A as MetricLabels, C as CommandInput, D as TraceAttributeValue, E as UseCaseObservability, M as LogPayload, N as LoggerPort, O as TraceSpan, S as Command, T as UseCase, _ as ResultRepository, a as TemporalContext, b as PolicyPort, c as CacheStrategy, d as QueryOutput, f as mapPolicyEvaluationError, g as Repository, h as TemporalRepository, i as CreateTemporalContextInput, j as MetricsPort, k as TracerPort, l as Page, m as TemporalHistory, n as TemporalUseCaseInput, o as assertTemporalContext, p as ResultTemporalRepository, r as TemporalizedContextSeed, s as createTemporalContext, t as TemporalUseCase, u as Query, v as PolicyEvaluationInput, w as MaybePromise, x as PolicyPortError, y as PolicyEvaluationOutput } from "./temporal-use-case.cjs";
|
|
15
|
+
import { A as IdempotencyPayloadMismatchError, B as UniqueConstraintViolation, C as IntegrationErrorMetadata, D as IdempotencyFailureKind, E as IdempotencyErrorMetadata, F as AlreadyExistsError, G as AuthenticationErrorMetadata, H as translateUniqueViolationToDuplicate, I as ConflictError, J as ErrorCodes, K as AuthenticationErrorReason, L as ConflictErrorMetadata, M as stableStringify, N as payloadHash, O as IdempotencyInProgressError, P as sha256Hex, R as ConflictKind, S as IntegrationError, T as IdempotencyError, U as BusinessRuleViolationError, V as UniqueConstraintViolationError, W as AuthenticationError, Y as serializationErrorCode, _ 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 assertJsonSafeMetadata, 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";
|
|
16
16
|
import { t as ValidationCode } from "./validation-code.cjs";
|
|
17
17
|
import { t as ValidationField } from "./validation-field.cjs";
|
|
18
18
|
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";
|
|
19
19
|
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";
|
|
20
20
|
import { a as ComputePayloadParserRegistry, c as ComputeEvaluatorRegistry, o as ComputePayloadParsers, r as GatePayloadParsers, s as ComputeEngineRegistry } from "./parse-gate-payload.cjs";
|
|
21
21
|
import { n as Entity, r as EntityState, t as UuidIdentifier } from "./uuid-identifier.cjs";
|
|
22
|
-
import {
|
|
23
|
-
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";
|
|
22
|
+
import { a as InvariantViolationException, c as BusinessRuleViolationException, i as ValidationViolation, l as DomainException, n as MultipleValidationException, o as InvalidStateTransitionException, r as ValidationException, s as EntityNotFoundException, t as InvalidValueException } from "./validation-exception.cjs";
|
|
24
23
|
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";
|
|
25
24
|
import { a as GrantProps, i as Grant, n as PermissionSet, o as Role, r as RbacAuthorizer, s as RoleProps, t as rbacContextFields } from "./policy-bridge.cjs";
|
|
26
|
-
import { a as
|
|
25
|
+
import { a as DomainEventEnvelope, i as DomainEventContractVersions, n as CreateDomainEventEnvelopeInput, o as buildDomainEventContractVersions, r as DomainEventContractSelection, s as createDomainEventEnvelope, t as ContractVersioned } from "./domain-event-contracts.cjs";
|
|
27
26
|
|
|
28
27
|
//#region src/index.d.ts
|
|
29
28
|
declare const ERP_CORE_NAME = "erp-core";
|
|
30
|
-
declare const ERP_CORE_VERSION = "
|
|
29
|
+
declare const ERP_CORE_VERSION = "2.0.0";
|
|
31
30
|
declare const erpCoreRelease: {
|
|
32
31
|
readonly name: "erp-core";
|
|
33
|
-
readonly version: "
|
|
32
|
+
readonly version: "2.0.0";
|
|
34
33
|
};
|
|
35
34
|
//#endregion
|
|
36
|
-
export { AbacAttributes, AbacAuthorizer, AbacAuthorizerPort, AbacDecision, AbacPolicySet, AbacRequest, AbacRule, AbacRuleProps, AccessRequest, AlreadyExistsError, AppError, AppErrorOptions, AsOfSource, AuthenticationError, AuthenticationErrorMetadata, AuthenticationErrorReason, AuthorizationError, AuthorizationErrorMetadata, AuthorizationErrorReason, AuthorizationRequirement, AuthorizerPort, BasePlugin, BasePolicyDefinitionProps, BusinessRuleViolationError, BusinessRuleViolationException, CONTRACT_VERSION_PROPERTY, CacheStrategy, CombiningAlgorithm, Command, CommandInput, CommonOutcomeStatus, CompositeAccessRequest, CompositeAuthorizer, 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, Grant, GrantProps, 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, Permission, PermissionProps, PermissionSet, 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, RbacAuthorizer, Repository, RequestedBy, RequestedByKind, Result, ResultRepository, Role, RoleProps, RuleEffect, Ruleset, RulesetId, RulesetRegistry, SchoolId, Scope, ScopeChain, ScopeProps, 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, abacContext, asPolicyDecisionId, asPolicyDefinitionId, asSchoolId, asTenantId, assertJsonSafeMetadata, assertTemporalContext, buildDomainEventContractVersions, contextResolverRegistry, coreConfig, createDomainEventEnvelope, createTemporalContext, erpCoreRelease, evaluateTemporalWindow, mapPolicyEvaluationError, payloadHash, rbacContextFields, registerNamespacedContextResolvers, registerNamespacedContextResolversIn, safePreview, serializationErrorCode, sha256Hex, stableStringify, translateUniqueViolationToDuplicate, version };
|
|
35
|
+
export { AbacAttributes, AbacAuthorizer, AbacAuthorizerPort, AbacDecision, AbacPolicySet, AbacRequest, AbacRule, AbacRuleProps, AccessRequest, AlreadyExistsError, AppError, AppErrorOptions, AsOfSource, AuthenticationError, AuthenticationErrorMetadata, AuthenticationErrorReason, AuthorizationError, AuthorizationErrorMetadata, AuthorizationErrorReason, AuthorizationRequirement, AuthorizerPort, BasePlugin, BasePolicyDefinitionProps, BusinessRuleViolationError, BusinessRuleViolationException, CONTRACT_VERSION_PROPERTY, CacheStrategy, CombiningAlgorithm, Command, CommandInput, CommonOutcomeStatus, CompositeAccessRequest, CompositeAuthorizer, 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, ContractVersioned, 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, Grant, GrantProps, 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, OnEvaluationError, Outcome, Page, Permission, PermissionProps, PermissionSet, 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, QueryOutput, RbacAuthorizer, Repository, RequestedBy, RequestedByKind, Result, ResultRepository, ResultTemporalRepository, Role, RoleProps, RuleEffect, Ruleset, RulesetId, RulesetRegistry, SchoolId, Scope, ScopeChain, ScopeProps, 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, abacContext, asPolicyDecisionId, asPolicyDefinitionId, asSchoolId, asTenantId, assertJsonSafeMetadata, assertTemporalContext, buildDomainEventContractVersions, contextResolverRegistry, coreConfig, createDomainEventEnvelope, createTemporalContext, erpCoreRelease, evaluateTemporalWindow, mapPolicyEvaluationError, payloadHash, rbacContextFields, registerNamespacedContextResolvers, registerNamespacedContextResolversIn, safePreview, serializationErrorCode, sha256Hex, stableStringify, translateUniqueViolationToDuplicate, version };
|
|
37
36
|
//# sourceMappingURL=index.d.cts.map
|