@cullet/erp-core 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gate-engine-registry.js.map +1 -1
- package/dist/gate-v1-payload.schema.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/outcome.js.map +1 -1
- package/dist/policies/engines/v1/gate/index.js.map +1 -1
- package/dist/policy-service.js.map +1 -1
- package/dist/validation-code.js.map +1 -1
- package/dist/validation-error.js.map +1 -1
- package/meta.json +2 -2
- package/package.json +1 -1
- package/src/core/application/commands/command.ts +4 -4
- package/src/core/application/commands/index.ts +2 -2
- package/src/core/application/commands/requested-by.ts +3 -3
- package/src/core/application/index.ts +8 -8
- package/src/core/application/policy-error-mapper.ts +2 -2
- package/src/core/application/ports/index.ts +10 -6
- package/src/core/application/ports/policy-port.ts +6 -3
- package/src/core/application/ports/temporal-repository.port.ts +2 -2
- package/src/core/application/queries/index.ts +2 -2
- package/src/core/application/queries/query.ts +4 -4
- package/src/core/application/temporal/index.ts +2 -2
- package/src/core/application/temporal/temporal-context.ts +2 -2
- package/src/core/application/temporal/temporal-use-case.ts +4 -4
- package/src/core/application/use-case.ts +3 -3
- package/src/core/config/core-config.instance.ts +2 -2
- package/src/core/config/core-config.ts +3 -3
- package/src/core/config/index.ts +8 -5
- package/src/core/config/policy-reporter.ts +3 -3
- package/src/core/config/silent-policy-reporter.ts +1 -1
- package/src/core/domain/entity.ts +5 -5
- package/src/core/domain/rulesets/entity-ruleset.contracts.ts +2 -2
- package/src/core/domain/rulesets/ruleset-registry.ts +2 -2
- package/src/core/domain/rulesets/value-object-ruleset.contracts.ts +2 -2
- package/src/core/domain/temporal/index.ts +4 -4
- package/src/core/domain/temporal/temporal-range.ts +2 -2
- package/src/core/domain/temporal/temporal-snapshot.ts +3 -3
- package/src/core/domain/temporal/transaction-time.ts +3 -3
- package/src/core/domain/temporal/valid-time.ts +3 -3
- package/src/core/domain/value-object.ts +3 -3
- package/src/core/errors/app-error.ts +6 -2
- package/src/core/errors/authentication-error.ts +3 -3
- package/src/core/errors/authorization-error.ts +3 -3
- package/src/core/errors/business-rule-violation-error.ts +3 -3
- package/src/core/errors/conflict-error.ts +3 -3
- package/src/core/errors/idempotency-error.ts +3 -3
- package/src/core/errors/index.ts +23 -23
- package/src/core/errors/integration-error.ts +3 -3
- package/src/core/errors/legacy-incompatible-error.ts +3 -3
- package/src/core/errors/not-found-error.ts +3 -3
- package/src/core/errors/serialization-error.ts +3 -3
- package/src/core/errors/temporal-error.ts +3 -3
- package/src/core/errors/unexpected-error.ts +3 -3
- package/src/core/errors/utils/index.ts +1 -1
- package/src/core/errors/utils/json-safe.ts +1 -1
- package/src/core/errors/validation-error.ts +5 -5
- package/src/core/exceptions/business-rule-violation-exception.ts +1 -1
- package/src/core/exceptions/entity-not-found-exception.ts +1 -1
- package/src/core/exceptions/invalid-state-transition-exception.ts +1 -1
- package/src/core/exceptions/invariant-violation-exception.ts +1 -1
- package/src/core/exceptions/validation-exception.ts +3 -3
- package/src/core/index.ts +7 -7
- package/src/core/policies/asof/asof.ts +4 -4
- package/src/core/policies/asof/index.ts +2 -2
- package/src/core/policies/catalog/catalog.instance.ts +3 -3
- package/src/core/policies/catalog/index.ts +6 -6
- package/src/core/policies/catalog/policy-catalog-entry.ts +3 -3
- package/src/core/policies/catalog/policy-catalog.ts +3 -3
- package/src/core/policies/catalog/policy-key.ts +1 -1
- package/src/core/policies/context/context-builder.ts +5 -5
- package/src/core/policies/context/context-registry.instance.ts +3 -3
- package/src/core/policies/context/context-registry.ts +2 -2
- package/src/core/policies/context/context-resolver.ts +2 -2
- package/src/core/policies/context/context-seed.ts +2 -2
- package/src/core/policies/context/index.ts +9 -9
- package/src/core/policies/context/path.ts +1 -1
- package/src/core/policies/defs/in-memory-policy-definition-repo.ts +3 -3
- package/src/core/policies/defs/index.ts +8 -8
- package/src/core/policies/defs/policy-definition-repository.ts +1 -1
- package/src/core/policies/defs/policy-definition.ts +6 -6
- package/src/core/policies/defs/policy-payload.contracts.ts +1 -1
- package/src/core/policies/defs/policy-scope.ts +2 -2
- package/src/core/policies/engines/compute-engine-registry.ts +9 -6
- package/src/core/policies/engines/compute-evaluator-registry.ts +1 -1
- package/src/core/policies/engines/compute-payload.ts +1 -1
- package/src/core/policies/engines/compute-registry.ts +7 -7
- package/src/core/policies/engines/compute-types.ts +4 -4
- package/src/core/policies/engines/gate-engine-registry.ts +3 -3
- package/src/core/policies/engines/gate-payload.ts +1 -1
- package/src/core/policies/engines/gate-types.ts +3 -3
- package/src/core/policies/engines/index.ts +14 -14
- package/src/core/policies/engines/parse-compute-payload.ts +4 -4
- package/src/core/policies/engines/parse-gate-payload.ts +4 -4
- package/src/core/policies/engines/v1/compute/compute-engine-v1.ts +6 -6
- package/src/core/policies/engines/v1/compute/compute-payload.schema.ts +3 -3
- package/src/core/policies/engines/v1/compute/index.ts +4 -4
- package/src/core/policies/engines/v1/compute/resolve-decision-table-v1.ts +4 -4
- package/src/core/policies/engines/v1/condition-evaluator.ts +6 -6
- package/src/core/policies/engines/v1/condition-schema.ts +1 -1
- package/src/core/policies/engines/v1/gate/gate-engine-v1.ts +7 -7
- package/src/core/policies/engines/v1/gate/gate-types-v1.ts +1 -1
- package/src/core/policies/engines/v1/gate/gate-v1-payload.schema.ts +3 -3
- package/src/core/policies/engines/v1/gate/index.ts +4 -4
- package/src/core/policies/engines/v1/index.ts +3 -3
- package/src/core/policies/index.ts +30 -23
- package/src/core/policies/package/policy-package.ts +3 -3
- package/src/core/policies/policy-ids.ts +3 -3
- package/src/core/policies/resolver/index.ts +1 -1
- package/src/core/policies/resolver/policy-resolver.ts +4 -4
- package/src/core/policies/service/index.ts +3 -3
- package/src/core/policies/service/policy-evaluation-error.ts +1 -1
- package/src/core/policies/service/policy-service.ts +21 -14
- package/src/core/policies/utils/date.ts +1 -1
- package/src/core/policies/utils/hash.ts +2 -2
- package/src/core/policies/utils/index.ts +3 -3
- package/src/core/policies/utils/result.ts +1 -1
- package/src/core/result/outcome.ts +1 -1
- package/src/core/shared/aggregate-version.ts +1 -1
- package/src/core/shared/temporal-guards.ts +1 -1
- package/src/core/versioning/domain-event-contracts.ts +5 -5
- package/src/examples/rulesets/entity/order-creation-rules-v1.ts +2 -2
- package/src/examples/rulesets/entity/order-invariants-v1.ts +2 -2
- package/src/examples/rulesets/entity/order-invariants-v2.ts +3 -3
- package/src/examples/rulesets/entity/order.ts +1 -1
- package/src/examples/rulesets/value-object/cpf-rules-v1.ts +1 -1
- package/src/examples/rulesets/value-object/cpf-rules-v2.ts +2 -2
- package/src/examples/rulesets/value-object/cpf.ts +1 -1
- package/src/examples/rulesets/value-object/customer.ts +3 -3
- package/src/examples/rulesets/value-object/person-name-rules-v1.ts +1 -1
- package/src/examples/rulesets/value-object/person-name-rules-v2.ts +2 -2
- package/src/examples/rulesets/value-object/person-name.ts +1 -1
- package/src/version.ts +1 -1
package/src/core/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./errors";
|
|
2
|
-
export * from "./exceptions/validation-field";
|
|
1
|
+
export * from "./errors/index.js";
|
|
2
|
+
export * from "./exceptions/validation-field.js";
|
|
3
3
|
export type {
|
|
4
4
|
LogPayload,
|
|
5
5
|
LoggerPort,
|
|
@@ -8,8 +8,8 @@ export type {
|
|
|
8
8
|
TraceAttributeValue,
|
|
9
9
|
TraceSpan,
|
|
10
10
|
TracerPort,
|
|
11
|
-
} from "./application";
|
|
12
|
-
export { mapPolicyEvaluationError } from "./application/policy-error-mapper";
|
|
13
|
-
export { Entity, type EntityState } from "./domain/entity";
|
|
14
|
-
export { ValueObject, type DeepReadonly } from "./domain/value-object";
|
|
15
|
-
export * from "./policies";
|
|
11
|
+
} from "./application/index.js";
|
|
12
|
+
export { mapPolicyEvaluationError } from "./application/policy-error-mapper.js";
|
|
13
|
+
export { Entity, type EntityState } from "./domain/entity.js";
|
|
14
|
+
export { ValueObject, type DeepReadonly } from "./domain/value-object.js";
|
|
15
|
+
export * from "./policies/index.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { AsOfSource } from "../catalog";
|
|
2
|
-
import type { ContextSeed } from "../context";
|
|
3
|
-
import { Result } from "../../result/result";
|
|
4
|
-
import { isValidDate } from "../../shared/temporal-guards";
|
|
1
|
+
import type { AsOfSource } from "../catalog/index.js";
|
|
2
|
+
import type { ContextSeed } from "../context/index.js";
|
|
3
|
+
import { Result } from "../../result/result.js";
|
|
4
|
+
import { isValidDate } from "../../shared/temporal-guards.js";
|
|
5
5
|
|
|
6
6
|
const DEFAULT_MAX_AS_OF_FUTURE_YEARS = 10;
|
|
7
7
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { PolicyAsOfResolver } from "./asof";
|
|
2
|
-
export type { DeriveAsOfOptions } from "./asof";
|
|
1
|
+
export { PolicyAsOfResolver } from "./asof.js";
|
|
2
|
+
export type { DeriveAsOfOptions } from "./asof.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { PolicyPackage } from "../package/policy-package";
|
|
1
|
+
import type { PolicyPackage } from "../package/policy-package.js";
|
|
2
2
|
|
|
3
|
-
import { PolicyCatalog } from "./policy-catalog";
|
|
4
|
-
import { PolicyCatalogEntry } from "./policy-catalog-entry";
|
|
3
|
+
import { PolicyCatalog } from "./policy-catalog.js";
|
|
4
|
+
import { PolicyCatalogEntry } from "./policy-catalog-entry.js";
|
|
5
5
|
|
|
6
6
|
// ─── Factory ────────────────────────────────────────────────────────────────
|
|
7
7
|
|
|
@@ -3,9 +3,9 @@ export type {
|
|
|
3
3
|
PolicyKind,
|
|
4
4
|
PolicyOwner,
|
|
5
5
|
PolicyScopeLevel,
|
|
6
|
-
} from "./catalog-types";
|
|
7
|
-
export type { PolicyCatalogEntryProps } from "./policy-catalog-entry";
|
|
8
|
-
export { PolicyCatalogEntry } from "./policy-catalog-entry";
|
|
9
|
-
export { PolicyCatalog } from "./policy-catalog";
|
|
10
|
-
export { PolicyCatalogFactory } from "./catalog.instance";
|
|
11
|
-
export { PolicyKey } from "./policy-key";
|
|
6
|
+
} from "./catalog-types.js";
|
|
7
|
+
export type { PolicyCatalogEntryProps } from "./policy-catalog-entry.js";
|
|
8
|
+
export { PolicyCatalogEntry } from "./policy-catalog-entry.js";
|
|
9
|
+
export { PolicyCatalog } from "./policy-catalog.js";
|
|
10
|
+
export { PolicyCatalogFactory } from "./catalog.instance.js";
|
|
11
|
+
export { PolicyKey } from "./policy-key.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { UnexpectedError } from "../../errors";
|
|
1
|
+
import { UnexpectedError } from "../../errors/index.js";
|
|
2
2
|
|
|
3
3
|
import type {
|
|
4
4
|
AsOfSource,
|
|
5
5
|
PolicyKind,
|
|
6
6
|
PolicyOwner,
|
|
7
7
|
PolicyScopeLevel,
|
|
8
|
-
} from "./catalog-types";
|
|
9
|
-
import type { PolicyKey } from "./policy-key";
|
|
8
|
+
} from "./catalog-types.js";
|
|
9
|
+
import type { PolicyKey } from "./policy-key.js";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Properties for creating a PolicyCatalogEntry.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { UnexpectedError } from "../../errors";
|
|
2
|
-
import { Result } from "../../result/result";
|
|
1
|
+
import { UnexpectedError } from "../../errors/index.js";
|
|
2
|
+
import { Result } from "../../result/result.js";
|
|
3
3
|
|
|
4
|
-
import { PolicyCatalogEntry } from "./policy-catalog-entry";
|
|
4
|
+
import { PolicyCatalogEntry } from "./policy-catalog-entry.js";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* In-code catalog of all known policies.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Result } from "../../result/result";
|
|
1
|
+
import { Result } from "../../result/result.js";
|
|
2
2
|
|
|
3
|
-
import type { ContextResolverRegistry } from "./context-registry";
|
|
3
|
+
import type { ContextResolverRegistry } from "./context-registry.js";
|
|
4
4
|
import type {
|
|
5
5
|
ContextResolverResilienceOptions,
|
|
6
6
|
ContextResolverRetryOptions,
|
|
7
7
|
ContextValueResolver,
|
|
8
|
-
} from "./context-resolver";
|
|
9
|
-
import type { ContextSeed } from "./context-seed";
|
|
10
|
-
import { PolicyContextPath } from "./path";
|
|
8
|
+
} from "./context-resolver.js";
|
|
9
|
+
import type { ContextSeed } from "./context-seed.js";
|
|
10
|
+
import { PolicyContextPath } from "./path.js";
|
|
11
11
|
|
|
12
12
|
interface NormalizedContextResolverRetryOptions {
|
|
13
13
|
readonly maxAttempts: number;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Result } from "../../result/result";
|
|
1
|
+
import { Result } from "../../result/result.js";
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
ContextResolverRegistry,
|
|
5
5
|
registerNamespacedContextResolversIn,
|
|
6
|
-
} from "./context-registry";
|
|
6
|
+
} from "./context-registry.js";
|
|
7
7
|
|
|
8
|
-
import type { ContextValueResolver } from "./context-resolver";
|
|
8
|
+
import type { ContextValueResolver } from "./context-resolver.js";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Official instance of the ContextResolverRegistry.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Result } from "../../result/result";
|
|
1
|
+
import { Result } from "../../result/result.js";
|
|
2
2
|
|
|
3
|
-
import type { ContextValueResolver } from "./context-resolver";
|
|
3
|
+
import type { ContextValueResolver } from "./context-resolver.js";
|
|
4
4
|
|
|
5
5
|
export interface ContextResolverRegistrationOptions {
|
|
6
6
|
readonly namespace?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Result } from "../../result/result";
|
|
1
|
+
import { Result } from "../../result/result.js";
|
|
2
2
|
|
|
3
|
-
import type { ContextSeed } from "./context-seed";
|
|
3
|
+
import type { ContextSeed } from "./context-seed.js";
|
|
4
4
|
|
|
5
5
|
export interface ContextResolverRetryOptions {
|
|
6
6
|
readonly maxAttempts?: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Result } from "../../result/result";
|
|
1
|
+
import { Result } from "../../result/result.js";
|
|
2
2
|
|
|
3
|
-
import type { SchoolId, TenantId } from "../policy-ids";
|
|
3
|
+
import type { SchoolId, TenantId } from "../policy-ids.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Seed data provided by the use case / caller.
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export { PolicyContextBuilder } from "./context-builder";
|
|
1
|
+
export { PolicyContextBuilder } from "./context-builder.js";
|
|
2
2
|
export {
|
|
3
3
|
ContextResolverRegistry,
|
|
4
4
|
DEFAULT_CONTEXT_RESOLVER_NAMESPACE,
|
|
5
5
|
registerNamespacedContextResolversIn,
|
|
6
|
-
} from "./context-registry";
|
|
6
|
+
} from "./context-registry.js";
|
|
7
7
|
export {
|
|
8
8
|
contextResolverRegistry,
|
|
9
9
|
registerNamespacedContextResolvers,
|
|
10
|
-
} from "./context-registry.instance";
|
|
11
|
-
export type { ContextResolverRegistrationOptions } from "./context-registry";
|
|
10
|
+
} from "./context-registry.instance.js";
|
|
11
|
+
export type { ContextResolverRegistrationOptions } from "./context-registry.js";
|
|
12
12
|
export type {
|
|
13
13
|
ContextResolverCircuitBreakerOptions,
|
|
14
14
|
ContextResolverResilienceOptions,
|
|
15
15
|
ContextResolverRetryOptions,
|
|
16
16
|
ContextValueResolver,
|
|
17
|
-
} from "./context-resolver";
|
|
18
|
-
export type { PolicyContextBuilderOptions } from "./context-builder";
|
|
19
|
-
export { ContextSeedValidator } from "./context-seed";
|
|
20
|
-
export type { ContextSeed } from "./context-seed";
|
|
21
|
-
export { PolicyContextPath } from "./path";
|
|
17
|
+
} from "./context-resolver.js";
|
|
18
|
+
export type { PolicyContextBuilderOptions } from "./context-builder.js";
|
|
19
|
+
export { ContextSeedValidator } from "./context-seed.js";
|
|
20
|
+
export type { ContextSeed } from "./context-seed.js";
|
|
21
|
+
export { PolicyContextPath } from "./path.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
FindCandidatesParams,
|
|
3
3
|
PolicyDefinition,
|
|
4
|
-
} from "./policy-definition";
|
|
5
|
-
import type { PolicyDefinitionRepository } from "./policy-definition-repository";
|
|
6
|
-
import { PolicyScopeMatcher } from "./policy-scope";
|
|
4
|
+
} from "./policy-definition.js";
|
|
5
|
+
import type { PolicyDefinitionRepository } from "./policy-definition-repository.js";
|
|
6
|
+
import { PolicyScopeMatcher } from "./policy-scope.js";
|
|
7
7
|
|
|
8
8
|
export class InMemoryPolicyDefinitionRepository implements PolicyDefinitionRepository {
|
|
9
9
|
private readonly definitions: readonly PolicyDefinition[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { InMemoryPolicyDefinitionRepository } from "./in-memory-policy-definition-repo";
|
|
1
|
+
export { InMemoryPolicyDefinitionRepository } from "./in-memory-policy-definition-repo.js";
|
|
2
2
|
export type {
|
|
3
3
|
BasePolicyDefinitionProps,
|
|
4
4
|
ComputePolicyDefinitionInput,
|
|
@@ -8,13 +8,13 @@ export type {
|
|
|
8
8
|
GatePolicyDefinitionProps,
|
|
9
9
|
PolicyDefinitionProps,
|
|
10
10
|
PolicyDefinitionStatus,
|
|
11
|
-
} from "./policy-definition";
|
|
12
|
-
export { PolicyDefinition } from "./policy-definition";
|
|
13
|
-
export type { PolicyDefinitionRepository } from "./policy-definition-repository";
|
|
11
|
+
} from "./policy-definition.js";
|
|
12
|
+
export { PolicyDefinition } from "./policy-definition.js";
|
|
13
|
+
export type { PolicyDefinitionRepository } from "./policy-definition-repository.js";
|
|
14
14
|
export type {
|
|
15
15
|
AnyPolicyPayload,
|
|
16
16
|
PayloadForKey,
|
|
17
|
-
} from "./policy-payload.contracts";
|
|
18
|
-
export { comparePolicySemver, POLICY_SEMVER_PATTERN } from "./policy-semver";
|
|
19
|
-
export type { PolicyScope, ScopeChain } from "./policy-scope";
|
|
20
|
-
export { PolicyScopeMatcher } from "./policy-scope";
|
|
17
|
+
} from "./policy-payload.contracts.js";
|
|
18
|
+
export { comparePolicySemver, POLICY_SEMVER_PATTERN } from "./policy-semver.js";
|
|
19
|
+
export type { PolicyScope, ScopeChain } from "./policy-scope.js";
|
|
20
|
+
export { PolicyScopeMatcher } from "./policy-scope.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { InvariantViolationException } from "../../exceptions/invariant-violation-exception";
|
|
2
|
-
import type { PolicyKind } from "../catalog";
|
|
3
|
-
import type { PolicyDefinitionId } from "../policy-ids";
|
|
1
|
+
import { InvariantViolationException } from "../../exceptions/invariant-violation-exception.js";
|
|
2
|
+
import type { PolicyKind } from "../catalog/index.js";
|
|
3
|
+
import type { PolicyDefinitionId } from "../policy-ids.js";
|
|
4
4
|
|
|
5
|
-
import type { AnyPolicyPayload } from "./policy-payload.contracts";
|
|
6
|
-
import type { PolicyScope } from "./policy-scope";
|
|
7
|
-
import { POLICY_SEMVER_PATTERN } from "./policy-semver";
|
|
5
|
+
import type { AnyPolicyPayload } from "./policy-payload.contracts.js";
|
|
6
|
+
import type { PolicyScope } from "./policy-scope.js";
|
|
7
|
+
import { POLICY_SEMVER_PATTERN } from "./policy-semver.js";
|
|
8
8
|
|
|
9
9
|
// ─── Status ────────────────────────────────────────────────────────────────
|
|
10
10
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PolicyScopeLevel } from "../catalog";
|
|
2
|
-
import type { SchoolId, TenantId } from "../policy-ids";
|
|
1
|
+
import type { PolicyScopeLevel } from "../catalog/index.js";
|
|
2
|
+
import type { SchoolId, TenantId } from "../policy-ids.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Scope attached to a PolicyDefinition — defines where it applies.
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { Result } from "../../result/result";
|
|
2
|
-
|
|
3
|
-
import type { PolicyContext } from "./gate-types";
|
|
4
|
-
import { ComputePayloadParsers } from "./parse-compute-payload";
|
|
5
|
-
import type { ComputeEvaluatorRegistry } from "./compute-evaluator-registry";
|
|
6
|
-
import type {
|
|
1
|
+
import { Result } from "../../result/result.js";
|
|
2
|
+
|
|
3
|
+
import type { PolicyContext } from "./gate-types.js";
|
|
4
|
+
import { ComputePayloadParsers } from "./parse-compute-payload.js";
|
|
5
|
+
import type { ComputeEvaluatorRegistry } from "./compute-evaluator-registry.js";
|
|
6
|
+
import type {
|
|
7
|
+
ComputeOutcome,
|
|
8
|
+
VersionedComputeEngine,
|
|
9
|
+
} from "./compute-types.js";
|
|
7
10
|
|
|
8
11
|
export class ComputeEngineRegistry {
|
|
9
12
|
private readonly engines = new Map<number, VersionedComputeEngine>();
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { type CoreConfig, coreConfig } from "../../config";
|
|
2
|
-
import type { Result } from "../../result/result";
|
|
1
|
+
import { type CoreConfig, coreConfig } from "../../config/index.js";
|
|
2
|
+
import type { Result } from "../../result/result.js";
|
|
3
3
|
|
|
4
|
-
import { ComputeEngineRegistry } from "./compute-engine-registry";
|
|
5
|
-
import { ComputeEvaluatorRegistry } from "./compute-evaluator-registry";
|
|
6
|
-
import type { PolicyContext } from "./gate-types";
|
|
4
|
+
import { ComputeEngineRegistry } from "./compute-engine-registry.js";
|
|
5
|
+
import { ComputeEvaluatorRegistry } from "./compute-evaluator-registry.js";
|
|
6
|
+
import type { PolicyContext } from "./gate-types.js";
|
|
7
7
|
import type {
|
|
8
8
|
ComputeEvaluator,
|
|
9
9
|
ComputeEvaluatorRegistration,
|
|
10
10
|
ComputeOutcome,
|
|
11
11
|
VersionedComputeEngine,
|
|
12
|
-
} from "./compute-types";
|
|
13
|
-
import { ComputeEngineV1 } from "./v1/compute";
|
|
12
|
+
} from "./compute-types.js";
|
|
13
|
+
import { ComputeEngineV1 } from "./v1/compute/index.js";
|
|
14
14
|
|
|
15
15
|
export interface ComputeRegistryOptions {
|
|
16
16
|
readonly coreConfig?: CoreConfig;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Outcome } from "../../result/outcome";
|
|
2
|
-
import type { Result } from "../../result/result";
|
|
1
|
+
import type { Outcome } from "../../result/outcome.js";
|
|
2
|
+
import type { Result } from "../../result/result.js";
|
|
3
3
|
|
|
4
|
-
import type { ComputePayload } from "./compute-payload";
|
|
5
|
-
import type { PolicyContext, PolicyViolation } from "./gate-types";
|
|
4
|
+
import type { ComputePayload } from "./compute-payload.js";
|
|
5
|
+
import type { PolicyContext, PolicyViolation } from "./gate-types.js";
|
|
6
6
|
|
|
7
7
|
// ─── Compute outcome (business decision) ────────────────────────────────────
|
|
8
8
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Result } from "../../result/result";
|
|
1
|
+
import { Result } from "../../result/result.js";
|
|
2
2
|
|
|
3
3
|
import type {
|
|
4
4
|
GateOutcome,
|
|
5
5
|
PolicyContext,
|
|
6
6
|
VersionedGateEngine,
|
|
7
|
-
} from "./gate-types";
|
|
8
|
-
import { GatePayloadParsers } from "./parse-gate-payload";
|
|
7
|
+
} from "./gate-types.js";
|
|
8
|
+
import { GatePayloadParsers } from "./parse-gate-payload.js";
|
|
9
9
|
|
|
10
10
|
export class GateEngineRegistry {
|
|
11
11
|
private readonly engines = new Map<number, VersionedGateEngine>();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Outcome } from "../../result/outcome";
|
|
2
|
-
import type { Result } from "../../result/result";
|
|
1
|
+
import type { Outcome } from "../../result/outcome.js";
|
|
2
|
+
import type { Result } from "../../result/result.js";
|
|
3
3
|
|
|
4
|
-
import type { GatePayload } from "./gate-payload";
|
|
4
|
+
import type { GatePayload } from "./gate-payload.js";
|
|
5
5
|
|
|
6
6
|
// ─── Shared gate types (version-agnostic) ───────────────────────────────────
|
|
7
7
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { ComputePayload, ComputePayloadV1 } from "./compute-payload";
|
|
1
|
+
export type { ComputePayload, ComputePayloadV1 } from "./compute-payload.js";
|
|
2
2
|
export type {
|
|
3
3
|
ComputeEvaluator,
|
|
4
4
|
ComputeEvaluatorRegistration,
|
|
@@ -6,7 +6,7 @@ export type {
|
|
|
6
6
|
ComputeOutcomeData,
|
|
7
7
|
ComputeStatus,
|
|
8
8
|
VersionedComputeEngine,
|
|
9
|
-
} from "./compute-types";
|
|
9
|
+
} from "./compute-types.js";
|
|
10
10
|
export type {
|
|
11
11
|
ConditionEvaluationCause,
|
|
12
12
|
ConditionEvaluationOptions,
|
|
@@ -14,12 +14,12 @@ export type {
|
|
|
14
14
|
ConditionEvaluationReportLevel,
|
|
15
15
|
ConditionEvaluationReportTag,
|
|
16
16
|
ConditionEvaluatorReporter,
|
|
17
|
-
} from "./condition-evaluator-reporter";
|
|
18
|
-
export { ComputeEngineRegistry } from "./compute-engine-registry";
|
|
19
|
-
export { ComputeEvaluatorRegistry } from "./compute-evaluator-registry";
|
|
20
|
-
export { ComputeRegistry } from "./compute-registry";
|
|
21
|
-
export { GateEngineRegistry } from "./gate-engine-registry";
|
|
22
|
-
export type { GatePayload, GatePayloadV1 } from "./gate-payload";
|
|
17
|
+
} from "./condition-evaluator-reporter.js";
|
|
18
|
+
export { ComputeEngineRegistry } from "./compute-engine-registry.js";
|
|
19
|
+
export { ComputeEvaluatorRegistry } from "./compute-evaluator-registry.js";
|
|
20
|
+
export { ComputeRegistry } from "./compute-registry.js";
|
|
21
|
+
export { GateEngineRegistry } from "./gate-engine-registry.js";
|
|
22
|
+
export type { GatePayload, GatePayloadV1 } from "./gate-payload.js";
|
|
23
23
|
export type {
|
|
24
24
|
GateOutcome,
|
|
25
25
|
GateOutcomeData,
|
|
@@ -30,19 +30,19 @@ export type {
|
|
|
30
30
|
PolicyContext,
|
|
31
31
|
PolicyViolation,
|
|
32
32
|
VersionedGateEngine,
|
|
33
|
-
} from "./gate-types";
|
|
33
|
+
} from "./gate-types.js";
|
|
34
34
|
export {
|
|
35
35
|
ComputePayloadParsers,
|
|
36
36
|
ComputePayloadParserRegistry,
|
|
37
|
-
} from "./parse-compute-payload";
|
|
38
|
-
export type { ComputePayloadParser } from "./parse-compute-payload";
|
|
37
|
+
} from "./parse-compute-payload.js";
|
|
38
|
+
export type { ComputePayloadParser } from "./parse-compute-payload.js";
|
|
39
39
|
export {
|
|
40
40
|
GatePayloadParsers,
|
|
41
41
|
GatePayloadParserRegistry,
|
|
42
|
-
} from "./parse-gate-payload";
|
|
43
|
-
export type { GatePayloadParser } from "./parse-gate-payload";
|
|
42
|
+
} from "./parse-gate-payload.js";
|
|
43
|
+
export type { GatePayloadParser } from "./parse-gate-payload.js";
|
|
44
44
|
export type {
|
|
45
45
|
ComputeDecisionTablePayload,
|
|
46
46
|
ComputeDecisionTableRule,
|
|
47
47
|
ComputeParamsPayload,
|
|
48
|
-
} from "./v1/compute";
|
|
48
|
+
} from "./v1/compute/index.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Result as ResultType } from "../../result/result";
|
|
2
|
-
import { Result } from "../../result/result";
|
|
1
|
+
import type { Result as ResultType } from "../../result/result.js";
|
|
2
|
+
import { Result } from "../../result/result.js";
|
|
3
3
|
|
|
4
|
-
import type { ComputePayload } from "./compute-payload";
|
|
5
|
-
import { ComputePayloadSchemaV1 } from "./v1/compute/compute-payload.schema";
|
|
4
|
+
import type { ComputePayload } from "./compute-payload.js";
|
|
5
|
+
import { ComputePayloadSchemaV1 } from "./v1/compute/compute-payload.schema.js";
|
|
6
6
|
|
|
7
7
|
export type ComputePayloadParser = (
|
|
8
8
|
payload: unknown,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Result as ResultType } from "../../result/result";
|
|
2
|
-
import { Result } from "../../result/result";
|
|
1
|
+
import type { Result as ResultType } from "../../result/result.js";
|
|
2
|
+
import { Result } from "../../result/result.js";
|
|
3
3
|
|
|
4
|
-
import type { GatePayload } from "./gate-payload";
|
|
5
|
-
import { GatePayloadSchemaV1 } from "./v1/gate/gate-v1-payload.schema";
|
|
4
|
+
import type { GatePayload } from "./gate-payload.js";
|
|
5
|
+
import { GatePayloadSchemaV1 } from "./v1/gate/gate-v1-payload.schema.js";
|
|
6
6
|
|
|
7
7
|
export type GatePayloadParser = (
|
|
8
8
|
payload: unknown,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { type CoreConfig, coreConfig } from "../../../../config";
|
|
2
|
-
import { Result } from "../../../../result/result";
|
|
1
|
+
import { type CoreConfig, coreConfig } from "../../../../config/index.js";
|
|
2
|
+
import { Result } from "../../../../result/result.js";
|
|
3
3
|
|
|
4
|
-
import type { ComputePayloadV1 as ComputePayload } from "./compute-payload.schema";
|
|
5
|
-
import { DecisionTableResolverV1 } from "./resolve-decision-table-v1";
|
|
4
|
+
import type { ComputePayloadV1 as ComputePayload } from "./compute-payload.schema.js";
|
|
5
|
+
import { DecisionTableResolverV1 } from "./resolve-decision-table-v1.js";
|
|
6
6
|
import type {
|
|
7
7
|
ComputeEvaluator,
|
|
8
8
|
ComputeOutcome,
|
|
9
9
|
VersionedComputeEngine,
|
|
10
|
-
} from "../../compute-types";
|
|
11
|
-
import type { PolicyContext } from "../../gate-types";
|
|
10
|
+
} from "../../compute-types.js";
|
|
11
|
+
import type { PolicyContext } from "../../gate-types.js";
|
|
12
12
|
|
|
13
13
|
// ─── Compute engine v1 ───────────────────────────────────────────────────────
|
|
14
14
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
|
-
import { Result } from "../../../../result/result";
|
|
3
|
+
import { Result } from "../../../../result/result.js";
|
|
4
4
|
|
|
5
|
-
import { conditionNodeSchema } from "../condition-schema";
|
|
6
|
-
import type { ConditionNode } from "../condition-types";
|
|
5
|
+
import { conditionNodeSchema } from "../condition-schema.js";
|
|
6
|
+
import type { ConditionNode } from "../condition-types.js";
|
|
7
7
|
|
|
8
8
|
// ─── Pattern 1: Params ──────────────────────────────────────────────────────
|
|
9
9
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { ComputeEngineV1 } from "./compute-engine-v1";
|
|
1
|
+
export { ComputeEngineV1 } from "./compute-engine-v1.js";
|
|
2
2
|
export type {
|
|
3
3
|
ComputeDecisionTablePayload,
|
|
4
4
|
ComputeDecisionTableRule,
|
|
5
5
|
ComputeParamsPayload,
|
|
6
6
|
ComputePayloadV1,
|
|
7
|
-
} from "./compute-payload.schema";
|
|
7
|
+
} from "./compute-payload.schema.js";
|
|
8
8
|
export {
|
|
9
9
|
computePayloadSchema,
|
|
10
10
|
ComputePayloadSchemaV1,
|
|
11
|
-
} from "./compute-payload.schema";
|
|
12
|
-
export { DecisionTableResolverV1 } from "./resolve-decision-table-v1";
|
|
11
|
+
} from "./compute-payload.schema.js";
|
|
12
|
+
export { DecisionTableResolverV1 } from "./resolve-decision-table-v1.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Result } from "../../../../result/result";
|
|
1
|
+
import { Result } from "../../../../result/result.js";
|
|
2
2
|
|
|
3
|
-
import type { ConditionEvaluationOptions } from "../../condition-evaluator-reporter";
|
|
3
|
+
import type { ConditionEvaluationOptions } from "../../condition-evaluator-reporter.js";
|
|
4
4
|
|
|
5
|
-
import { ConditionEvaluatorV1 } from "../condition-evaluator";
|
|
6
|
-
import type { ComputeDecisionTablePayload } from "./compute-payload.schema";
|
|
5
|
+
import { ConditionEvaluatorV1 } from "../condition-evaluator.js";
|
|
6
|
+
import type { ComputeDecisionTablePayload } from "./compute-payload.schema.js";
|
|
7
7
|
|
|
8
8
|
const COMPUTE_CONDITION_EVAL_FAILED_TAG = "COMPUTE_CONDITION_EVAL_FAILED";
|
|
9
9
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PolicyContextPath } from "../../context";
|
|
2
|
-
import { PolicyDateUtils } from "../../utils";
|
|
3
|
-
import { Result } from "../../../result/result";
|
|
1
|
+
import { PolicyContextPath } from "../../context/index.js";
|
|
2
|
+
import { PolicyDateUtils } from "../../utils/index.js";
|
|
3
|
+
import { Result } from "../../../result/result.js";
|
|
4
4
|
|
|
5
5
|
import type {
|
|
6
6
|
ConditionAndNode,
|
|
@@ -9,12 +9,12 @@ import type {
|
|
|
9
9
|
ConditionNotNode,
|
|
10
10
|
ConditionOp,
|
|
11
11
|
ConditionOrNode,
|
|
12
|
-
} from "./condition-types";
|
|
12
|
+
} from "./condition-types.js";
|
|
13
13
|
import type {
|
|
14
14
|
ConditionEvaluationOptions,
|
|
15
15
|
ConditionEvaluationReport,
|
|
16
|
-
} from "../condition-evaluator-reporter";
|
|
17
|
-
import type { PolicyContext } from "../gate-types";
|
|
16
|
+
} from "../condition-evaluator-reporter.js";
|
|
17
|
+
import type { PolicyContext } from "../gate-types.js";
|
|
18
18
|
|
|
19
19
|
const CONDITION_EVAL_THROWN_TAG = "CONDITION_EVAL_THREW";
|
|
20
20
|
const NULLISH_NUMERIC_OPERAND_NOT_ALLOWED_TAG =
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
|
-
import type { ConditionLeafNode, ConditionNode } from "./condition-types";
|
|
3
|
+
import type { ConditionLeafNode, ConditionNode } from "./condition-types.js";
|
|
4
4
|
|
|
5
5
|
// ─── Shared v1 condition Zod schemas ─────────────────────────────────────────
|
|
6
6
|
// Extracted from gate/v1 so both gate/v1 and compute/v1 can validate
|