@cullet/erp-core 1.1.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/KIT_CONTEXT.md +1 -67
- package/dist/app-error.d.cts +108 -0
- package/dist/application/index.cjs +26 -0
- package/dist/application/index.d.cts +2 -0
- package/dist/application/index.d.ts +1 -1
- package/dist/application/index.js +2 -1
- package/dist/domain/index.cjs +16 -0
- package/dist/domain/index.d.cts +3 -0
- package/dist/domain/index.d.ts +3 -0
- package/dist/domain/index.js +3 -0
- package/dist/domain-event-contracts.cjs +33 -0
- package/dist/domain-event-contracts.cjs.map +1 -0
- package/dist/domain-event-contracts.d.cts +27 -0
- package/dist/domain-event-contracts.d.ts +27 -0
- package/dist/domain-event-contracts.js +22 -0
- package/dist/domain-event-contracts.js.map +1 -0
- package/dist/domain-exception.cjs +17 -0
- package/dist/domain-exception.cjs.map +1 -0
- package/dist/domain-exception.d.cts +7 -0
- package/dist/domain-exception.d.ts +7 -0
- package/dist/domain-exception.js +12 -0
- package/dist/domain-exception.js.map +1 -0
- package/dist/errors/index.cjs +41 -0
- package/dist/errors/index.d.cts +3 -0
- package/dist/errors/index.js +1 -1
- package/dist/exceptions/index.cjs +17 -0
- package/dist/exceptions/index.d.cts +5 -0
- package/dist/exceptions/index.d.ts +5 -0
- package/dist/exceptions/index.js +7 -0
- package/dist/exceptions/validation-field.cjs +3 -0
- package/dist/exceptions/validation-field.d.cts +2 -0
- package/dist/gate-engine-registry.cjs +308 -0
- package/dist/gate-engine-registry.cjs.map +1 -0
- package/dist/gate-engine-registry.d.cts +81 -0
- package/dist/gate-engine-registry.d.ts +2 -1
- package/dist/gate-engine-registry.js +2 -1
- package/dist/gate-engine-registry.js.map +1 -1
- package/dist/gate-types.d.cts +171 -0
- package/dist/gate-types.d.ts +3 -139
- package/dist/gate-v1-payload.schema.cjs +638 -0
- package/dist/gate-v1-payload.schema.cjs.map +1 -0
- package/dist/gate-v1-payload.schema.js +2 -116
- package/dist/gate-v1-payload.schema.js.map +1 -1
- package/dist/hashing.cjs +66 -0
- package/dist/hashing.cjs.map +1 -0
- package/dist/immutable.cjs +77 -0
- package/dist/immutable.cjs.map +1 -0
- package/dist/immutable.d.cts +6 -0
- package/dist/immutable.d.ts +6 -0
- package/dist/immutable.js +54 -0
- package/dist/immutable.js.map +1 -0
- package/dist/index.cjs +163 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +30 -0
- package/dist/index.d.ts +15 -160
- package/dist/index.js +19 -176
- package/dist/index.js.map +1 -1
- package/dist/invalid-state-transition-exception.cjs +47 -0
- package/dist/invalid-state-transition-exception.cjs.map +1 -0
- package/dist/invalid-state-transition-exception.js +30 -0
- package/dist/invalid-state-transition-exception.js.map +1 -0
- package/dist/invariant-violation-exception.cjs +16 -0
- package/dist/invariant-violation-exception.cjs.map +1 -0
- package/dist/invariant-violation-exception.js +11 -0
- package/dist/invariant-violation-exception.js.map +1 -0
- package/dist/not-found-error.cjs +65 -0
- package/dist/not-found-error.cjs.map +1 -0
- package/dist/not-found-error.js +1 -1
- package/dist/outcome.cjs +97 -0
- package/dist/outcome.cjs.map +1 -0
- package/dist/outcome.d.cts +140 -0
- package/dist/outcome.d.ts +140 -0
- package/dist/outcome.js +1 -1
- package/dist/parse-gate-payload.d.cts +62 -0
- package/dist/parse-gate-payload.d.ts +2 -1
- package/dist/path.d.cts +90 -0
- package/dist/path.d.ts +2 -1
- package/dist/plugin.cjs +79 -0
- package/dist/plugin.cjs.map +1 -0
- package/dist/plugin.d.cts +85 -0
- package/dist/plugin.d.ts +85 -0
- package/dist/plugin.js +74 -0
- package/dist/plugin.js.map +1 -0
- package/dist/plugins/index.cjs +3 -0
- package/dist/plugins/index.d.cts +2 -0
- package/dist/plugins/index.d.ts +2 -0
- package/dist/plugins/index.js +2 -0
- package/dist/policies/engines/index.cjs +10 -0
- package/dist/policies/engines/index.d.cts +4 -0
- package/dist/policies/engines/index.d.ts +1 -1
- package/dist/policies/engines/v1/gate/index.cjs +91 -0
- package/dist/policies/engines/v1/gate/index.cjs.map +1 -0
- package/dist/policies/engines/v1/gate/index.d.cts +121 -0
- package/dist/policies/engines/v1/gate/index.d.ts +2 -1
- package/dist/policies/engines/v1/gate/index.js +2 -1
- package/dist/policies/engines/v1/gate/index.js.map +1 -1
- package/dist/policies/index.cjs +41 -0
- package/dist/policies/index.d.cts +7 -0
- package/dist/policies/index.d.ts +2 -1
- package/dist/policies/index.js +2 -1
- package/dist/policy-service.cjs +1190 -0
- package/dist/policy-service.cjs.map +1 -0
- package/dist/policy-service.d.cts +559 -0
- package/dist/policy-service.d.ts +2 -1
- package/dist/policy-service.js +6 -3
- package/dist/policy-service.js.map +1 -1
- package/dist/result/index.cjs +7 -0
- package/dist/result/index.d.cts +2 -0
- package/dist/result/index.d.ts +2 -0
- package/dist/result/index.js +3 -0
- package/dist/result.cjs +135 -0
- package/dist/result.cjs.map +1 -0
- package/dist/result.js +118 -0
- package/dist/result.js.map +1 -0
- package/dist/ruleset-registry.cjs +47 -0
- package/dist/ruleset-registry.cjs.map +1 -0
- package/dist/ruleset-registry.js +42 -0
- package/dist/ruleset-registry.js.map +1 -0
- package/dist/rulesets/index.cjs +3 -0
- package/dist/rulesets/index.d.cts +2 -0
- package/dist/rulesets/index.d.ts +2 -0
- package/dist/rulesets/index.js +2 -0
- package/dist/temporal-guards.cjs +32 -0
- package/dist/temporal-guards.cjs.map +1 -0
- package/dist/temporal-guards.js +2 -17
- package/dist/temporal-guards.js.map +1 -1
- package/dist/temporal-use-case.cjs +191 -0
- package/dist/temporal-use-case.cjs.map +1 -0
- package/dist/temporal-use-case.d.cts +304 -0
- package/dist/temporal-use-case.d.ts +4 -9
- package/dist/temporal-use-case.js +6 -140
- package/dist/temporal-use-case.js.map +1 -1
- package/dist/unexpected-error.cjs +208 -0
- package/dist/unexpected-error.cjs.map +1 -0
- package/dist/unexpected-error.js +179 -0
- package/dist/unexpected-error.js.map +1 -0
- package/dist/use-case.cjs +96 -0
- package/dist/use-case.cjs.map +1 -0
- package/dist/use-case.js +91 -0
- package/dist/use-case.js.map +1 -0
- package/dist/uuid-identifier.cjs +65 -0
- package/dist/uuid-identifier.cjs.map +1 -0
- package/dist/uuid-identifier.d.cts +230 -0
- package/dist/uuid-identifier.d.ts +230 -0
- package/dist/uuid-identifier.js +60 -0
- package/dist/uuid-identifier.js.map +1 -0
- package/dist/validation-code.cjs +60 -0
- package/dist/validation-code.cjs.map +1 -0
- package/dist/validation-code.d.cts +23 -0
- package/dist/validation-code.d.ts +23 -0
- package/dist/validation-code.js +1 -177
- package/dist/validation-code.js.map +1 -1
- package/dist/validation-error.cjs +1020 -0
- package/dist/validation-error.cjs.map +1 -0
- package/dist/validation-error.d.cts +777 -0
- package/dist/validation-error.d.ts +1 -21
- package/dist/validation-error.js +1 -1
- package/dist/validation-exception.cjs +41 -0
- package/dist/validation-exception.cjs.map +1 -0
- package/dist/validation-exception.d.cts +50 -0
- package/dist/validation-exception.d.ts +50 -0
- package/dist/validation-exception.js +8 -2
- package/dist/validation-exception.js.map +1 -1
- package/dist/validation-field.cjs +28 -0
- package/dist/validation-field.cjs.map +1 -0
- package/dist/validation-field.d.cts +12 -0
- package/dist/value-object-ruleset.contracts.d.cts +36 -0
- package/dist/value-object-ruleset.contracts.d.ts +36 -0
- package/dist/value-object.cjs +208 -0
- package/dist/value-object.cjs.map +1 -0
- package/dist/value-object.js +191 -0
- package/dist/value-object.js.map +1 -0
- package/dist/version.d.cts +10 -0
- package/dist/version.d.ts +10 -0
- package/dist/versioning/index.cjs +7 -0
- package/dist/versioning/index.d.cts +3 -0
- package/dist/versioning/index.d.ts +3 -0
- package/dist/versioning/index.js +3 -0
- package/meta.json +18 -3
- package/package.json +165 -17
- package/src/core/domain/rulesets/index.ts +7 -0
- package/src/core/domain/uuid-identifier.ts +72 -0
- package/src/core/domain/value-object.ts +37 -5
- package/src/core/exceptions/index.ts +13 -0
- package/src/core/index.ts +14 -2
- package/src/core/plugins/index.ts +7 -0
- package/src/core/plugins/plugin.ts +99 -0
- package/src/core/plugins/types.ts +53 -0
- package/src/core/versioning/index.ts +14 -0
- package/src/domain/index.ts +7 -0
- package/src/exceptions/index.ts +1 -0
- package/src/plugins/index.ts +1 -0
- package/src/result/index.ts +2 -0
- package/src/rulesets/index.ts +1 -0
- package/src/version.ts +1 -1
- package/src/versioning/index.ts +1 -0
package/KIT_CONTEXT.md
CHANGED
|
@@ -22,73 +22,7 @@ Núcleo arquitetural para sistemas ERP (e domínios transacionais com temporalid
|
|
|
22
22
|
- **Policies como dados**, não como if-statements: avaliáveis, compostas, serializáveis.
|
|
23
23
|
- **Policies permitem disable sem remover código**: `PolicyDefinition` aceita `enabled: false` e o repositório ignora definições desabilitadas.
|
|
24
24
|
- **Composição isolada é de primeira classe**: use `new CoreConfig()`, `new ContextResolverRegistry()` e `registerNamespacedContextResolversIn(...)` quando precisar evitar singletons compartilhados.
|
|
25
|
-
|
|
26
|
-
## [example] Exemplo end-to-end (Command + Repository + PolicyPort)
|
|
27
|
-
|
|
28
|
-
Um `Command` carrega o agregado por um `ResultRepository`, consulta um
|
|
29
|
-
`PolicyPort` (gate `ALLOW`/`DENY`) e persiste. Falhas recuperáveis voltam como
|
|
30
|
-
`Result.err`, nunca como exceção.
|
|
31
|
-
|
|
32
|
-
```ts
|
|
33
|
-
class CancelOrder extends Command<
|
|
34
|
-
CancelOrderInput,
|
|
35
|
-
Result<Order, CancelOrderError>
|
|
36
|
-
> {
|
|
37
|
-
constructor(
|
|
38
|
-
private readonly orders: ResultRepository<
|
|
39
|
-
Order,
|
|
40
|
-
string,
|
|
41
|
-
CancelOrderError
|
|
42
|
-
>,
|
|
43
|
-
private readonly policies: PolicyPort,
|
|
44
|
-
) {
|
|
45
|
-
super();
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
protected async execute(input: CancelOrderInput) {
|
|
49
|
-
const found = await this.orders.findById(input.orderId);
|
|
50
|
-
if (found.isErr()) return found;
|
|
51
|
-
const order = found.getOrThrow();
|
|
52
|
-
if (!order)
|
|
53
|
-
return Result.err(
|
|
54
|
-
new NotFoundError("Order", { id: input.orderId }),
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
const evaluated = await this.policies.evaluate({
|
|
58
|
-
decisionId: asPolicyDecisionId(input.orderId),
|
|
59
|
-
policyKey: "order.cancel",
|
|
60
|
-
scopeChain: [],
|
|
61
|
-
contextVersion: 1,
|
|
62
|
-
seed: {
|
|
63
|
-
tenantId: asTenantId(input.tenantId),
|
|
64
|
-
schoolId: asSchoolId(input.schoolId),
|
|
65
|
-
fields: { orderStatus: order.status },
|
|
66
|
-
},
|
|
67
|
-
});
|
|
68
|
-
if (evaluated.isErr()) return evaluated;
|
|
69
|
-
|
|
70
|
-
const result = evaluated.getOrThrow();
|
|
71
|
-
if (result.kind === "GATE" && result.decision.status === "DENY") {
|
|
72
|
-
return Result.err(
|
|
73
|
-
AuthorizationError.policyDenied({
|
|
74
|
-
action: "order.cancel",
|
|
75
|
-
policyId: result.ref.definitionId,
|
|
76
|
-
policyVersion: Number(result.ref.policyVersion),
|
|
77
|
-
evaluatedAtIso: result.evaluatedAt.toISOString(),
|
|
78
|
-
}),
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const saved = await this.orders.save({ ...order, status: "CANCELLED" });
|
|
83
|
-
if (saved.isErr()) return saved;
|
|
84
|
-
return Result.ok({ ...order, status: "CANCELLED" });
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
- **Imports**: tudo do root `@cullet/erp-core`.
|
|
90
|
-
- **`Repository` vs `ResultRepository`**: `Repository` (`save`/`delete` → `Promise<void>`) é o estilo imperativo; `ResultRepository` devolve `Result` para sinalizar not-found / concorrência otimista sem quebrar o fluxo.
|
|
91
|
-
- **Referência compilada/testada**: `src/examples/application/cancel-order.example.ts` (+ `.spec.ts`).
|
|
25
|
+
- **`Repository` vs `ResultRepository`**: `Repository` (`save`/`delete` → `Promise<void>`) é o estilo imperativo; `ResultRepository` devolve `Result` para sinalizar not-found / concorrência otimista sem quebrar o fluxo. Exemplo end-to-end (Command + ResultRepository + PolicyPort) compilado e testado em `src/examples/application/cancel-order.example.ts` (+ `.spec.ts`).
|
|
92
26
|
|
|
93
27
|
## [extension-points] Pontos de extensão
|
|
94
28
|
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
//#region src/core/errors/types.d.ts
|
|
2
|
+
type ErrorSeverity = "low" | "medium" | "high" | "critical";
|
|
3
|
+
type JsonSafePrimitive = string | number | boolean | null;
|
|
4
|
+
type JsonSafeValue = JsonSafePrimitive | JsonSafeValue[] | {
|
|
5
|
+
[key: string]: JsonSafeValue;
|
|
6
|
+
};
|
|
7
|
+
type JsonSafeRecord = Record<string, JsonSafeValue>;
|
|
8
|
+
/**
|
|
9
|
+
* Options accepted by the AppError constructor.
|
|
10
|
+
* Subclasses can extend or pick from this type.
|
|
11
|
+
*/
|
|
12
|
+
type AppErrorOptions = {
|
|
13
|
+
/** Original error or exception that caused this error. */
|
|
14
|
+
cause?: unknown;
|
|
15
|
+
/** Arbitrary key-value metadata (will be sanitized to JSON-safe values). */
|
|
16
|
+
metadata?: Record<string, unknown>;
|
|
17
|
+
/** Error category/type for grouping (e.g., "authentication", "validation"). */
|
|
18
|
+
type?: string;
|
|
19
|
+
/** severity level for alerting/logging prioritization. */
|
|
20
|
+
severity?: ErrorSeverity;
|
|
21
|
+
/**
|
|
22
|
+
* Identifies a single execution "story" in the system. All operations
|
|
23
|
+
* related to the same logical flow must share the same correlationId.
|
|
24
|
+
*/
|
|
25
|
+
correlationId?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Identifies a specific technical request attempt (each retry may produce
|
|
28
|
+
* a new requestId), even when the correlationId stays the same.
|
|
29
|
+
*/
|
|
30
|
+
requestId?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Identifies a unique business intent (idempotency key); stays the same
|
|
33
|
+
* across technical retries and multiple requests that represent the same intent.
|
|
34
|
+
*/
|
|
35
|
+
commandId?: string;
|
|
36
|
+
/** ISO timestamp of when the error was created (defaults to now). */
|
|
37
|
+
createdAtIso?: string;
|
|
38
|
+
/** Safe message that can be exposed to end users (no internal details). */
|
|
39
|
+
publicMessage?: string;
|
|
40
|
+
};
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/core/errors/app-error.d.ts
|
|
43
|
+
/**
|
|
44
|
+
* Root of the application/domain error hierarchy. Every error the system raises
|
|
45
|
+
* on purpose extends `AppError`, which gives callers a single `instanceof` to
|
|
46
|
+
* catch and a uniform, serializable shape to log and transport.
|
|
47
|
+
*
|
|
48
|
+
* Beyond the native `Error` message it carries a stable `code` (the contract the
|
|
49
|
+
* outside world matches on), an optional non-leaking `publicMessage`, a
|
|
50
|
+
* severity, JSON-safe `metadata`, and the correlation/request/command ids that
|
|
51
|
+
* stitch an error back to the request that produced it. The metadata is
|
|
52
|
+
* validated as JSON-safe on construction, so a logger can serialize any
|
|
53
|
+
* `AppError` without hitting a circular reference or a non-serializable value.
|
|
54
|
+
*
|
|
55
|
+
* Abstract on purpose: callers should throw a specific subclass (e.g.
|
|
56
|
+
* {@link ValidationError}, {@link NotFoundError}) so the `code` and shape are
|
|
57
|
+
* meaningful, never a bare `AppError`.
|
|
58
|
+
*/
|
|
59
|
+
declare abstract class AppError extends Error {
|
|
60
|
+
readonly code: string;
|
|
61
|
+
readonly cause?: unknown;
|
|
62
|
+
readonly metadata?: JsonSafeRecord;
|
|
63
|
+
readonly type?: string;
|
|
64
|
+
readonly severity?: ErrorSeverity;
|
|
65
|
+
readonly createdAtIso: string;
|
|
66
|
+
readonly publicMessage?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Identifies a single execution "story" in the system. All operations
|
|
69
|
+
* related to the same logical flow must share the same correlationId.
|
|
70
|
+
*/
|
|
71
|
+
readonly correlationId?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Identifies a specific technical request attempt (each retry may produce
|
|
74
|
+
* a new requestId), even when the correlationId stays the same.
|
|
75
|
+
*/
|
|
76
|
+
readonly requestId?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Marks the business intent / idempotency key; stays the same across
|
|
79
|
+
* technical retries and multiple requests that represent the same intent.
|
|
80
|
+
*/
|
|
81
|
+
readonly commandId?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Builds the common error envelope shared by every subclass.
|
|
84
|
+
*
|
|
85
|
+
* `name` is taken from `new.target` so the thrown instance reports its
|
|
86
|
+
* concrete subclass name (not `"AppError"`), and the prototype is re-pinned
|
|
87
|
+
* via `setPrototypeOf` so `instanceof` keeps working after transpilation to
|
|
88
|
+
* older targets where extending built-ins breaks the chain. `createdAtIso`
|
|
89
|
+
* defaults to now, and `metadata` is validated as JSON-safe so the error is
|
|
90
|
+
* always serializable.
|
|
91
|
+
*
|
|
92
|
+
* Declared `protected`: instantiate a concrete subclass, never `AppError`.
|
|
93
|
+
*
|
|
94
|
+
* @param message - The internal, developer-facing message.
|
|
95
|
+
* @param code - The stable machine-readable code callers match on.
|
|
96
|
+
* @param options - Optional cause, metadata, severity, and correlation ids.
|
|
97
|
+
* @throws When `options.metadata` contains a value that is not JSON-safe.
|
|
98
|
+
*/
|
|
99
|
+
protected constructor(message: string, code: string, options?: AppErrorOptions);
|
|
100
|
+
/**
|
|
101
|
+
* Returns a JSON-safe representation of the error.
|
|
102
|
+
* Does NOT include `cause` by default (to avoid leaking internal details).
|
|
103
|
+
*/
|
|
104
|
+
toJSON(): Record<string, unknown>;
|
|
105
|
+
}
|
|
106
|
+
//#endregion
|
|
107
|
+
export { JsonSafeRecord as a, JsonSafePrimitive as i, AppErrorOptions as n, JsonSafeValue as o, ErrorSeverity as r, AppError as t };
|
|
108
|
+
//# sourceMappingURL=app-error.d.cts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_use_case = require("../use-case.cjs");
|
|
3
|
+
const require_temporal_use_case = require("../temporal-use-case.cjs");
|
|
4
|
+
Object.defineProperty(exports, "Command", {
|
|
5
|
+
enumerable: true,
|
|
6
|
+
get: function() {
|
|
7
|
+
return require_temporal_use_case.Command;
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
Object.defineProperty(exports, "Query", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function() {
|
|
13
|
+
return require_temporal_use_case.Query;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
exports.RequestedBy = require_temporal_use_case.RequestedBy;
|
|
17
|
+
exports.TemporalUseCase = require_temporal_use_case.TemporalUseCase;
|
|
18
|
+
Object.defineProperty(exports, "UseCase", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function() {
|
|
21
|
+
return require_use_case.UseCase;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
exports.assertTemporalContext = require_temporal_use_case.assertTemporalContext;
|
|
25
|
+
exports.createTemporalContext = require_temporal_use_case.createTemporalContext;
|
|
26
|
+
exports.mapPolicyEvaluationError = require_temporal_use_case.mapPolicyEvaluationError;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { A as MetricLabels, C as RequestedByKind, D as TraceAttributeValue, E as UseCaseObservability, M as LogPayload, N as LoggerPort, O as TraceSpan, S as RequestedBy, T as UseCase, _ as PolicyEvaluationOutput, a as TemporalContext, b as Command, c as CacheStrategy, d as mapPolicyEvaluationError, f as TemporalHistory, g as PolicyEvaluationInput, h as ResultRepository, i as CreateTemporalContextInput, j as MetricsPort, k as TracerPort, l as Page, m as Repository, n as TemporalUseCaseInput, o as assertTemporalContext, p as TemporalRepository, r as TemporalizedContextSeed, s as createTemporalContext, t as TemporalUseCase, u as Query, v as PolicyPort, w as MaybePromise, x as CommandInput, y as PolicyPortError } from "../temporal-use-case.cjs";
|
|
2
|
+
export { CacheStrategy, Command, CommandInput, CreateTemporalContextInput, LogPayload, LoggerPort, MaybePromise, MetricLabels, MetricsPort, Page, PolicyEvaluationInput, PolicyEvaluationOutput, PolicyPort, PolicyPortError, Query, Repository, RequestedBy, RequestedByKind, ResultRepository, TemporalContext, TemporalHistory, TemporalRepository, TemporalUseCase, TemporalUseCaseInput, TemporalizedContextSeed, TraceAttributeValue, TraceSpan, TracerPort, UseCase, UseCaseObservability, assertTemporalContext, createTemporalContext, mapPolicyEvaluationError };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as MetricLabels, C as RequestedByKind, D as TraceAttributeValue, E as UseCaseObservability, M as LogPayload, N as LoggerPort, O as TraceSpan, S as RequestedBy, T as UseCase, _ as PolicyEvaluationOutput, a as TemporalContext, b as Command, c as CacheStrategy, d as mapPolicyEvaluationError, f as TemporalHistory, g as PolicyEvaluationInput, h as ResultRepository, i as CreateTemporalContextInput, j as MetricsPort, k as TracerPort, l as Page, m as Repository, n as TemporalUseCaseInput, o as assertTemporalContext, p as TemporalRepository, r as TemporalizedContextSeed, s as createTemporalContext, t as TemporalUseCase, u as Query, v as PolicyPort, w as MaybePromise, x as CommandInput, y as PolicyPortError } from "../temporal-use-case.js";
|
|
2
2
|
export { CacheStrategy, Command, CommandInput, CreateTemporalContextInput, LogPayload, LoggerPort, MaybePromise, MetricLabels, MetricsPort, Page, PolicyEvaluationInput, PolicyEvaluationOutput, PolicyPort, PolicyPortError, Query, Repository, RequestedBy, RequestedByKind, ResultRepository, TemporalContext, TemporalHistory, TemporalRepository, TemporalUseCase, TemporalUseCaseInput, TemporalizedContextSeed, TraceAttributeValue, TraceSpan, TracerPort, UseCase, UseCaseObservability, assertTemporalContext, createTemporalContext, mapPolicyEvaluationError };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as UseCase } from "../use-case.js";
|
|
2
|
+
import { a as mapPolicyEvaluationError, i as Query, n as assertTemporalContext, o as Command, r as createTemporalContext, s as RequestedBy, t as TemporalUseCase } from "../temporal-use-case.js";
|
|
2
3
|
export { Command, Query, RequestedBy, TemporalUseCase, UseCase, assertTemporalContext, createTemporalContext, mapPolicyEvaluationError };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_value_object = require("../value-object.cjs");
|
|
3
|
+
const require_uuid_identifier = require("../uuid-identifier.cjs");
|
|
4
|
+
Object.defineProperty(exports, "Entity", {
|
|
5
|
+
enumerable: true,
|
|
6
|
+
get: function() {
|
|
7
|
+
return require_value_object.Entity;
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
exports.UuidIdentifier = require_uuid_identifier.UuidIdentifier;
|
|
11
|
+
Object.defineProperty(exports, "ValueObject", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function() {
|
|
14
|
+
return require_value_object.ValueObject;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { t as DeepReadonly } from "../immutable.cjs";
|
|
2
|
+
import { a as EntityState, i as Entity, n as ValueObject, r as ValueObjectPluginContract, t as UuidIdentifier } from "../uuid-identifier.cjs";
|
|
3
|
+
export { type DeepReadonly, Entity, type EntityState, UuidIdentifier, ValueObject, type ValueObjectPluginContract };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { t as DeepReadonly } from "../immutable.js";
|
|
2
|
+
import { a as EntityState, i as Entity, n as ValueObject, r as ValueObjectPluginContract, t as UuidIdentifier } from "../uuid-identifier.js";
|
|
3
|
+
export { type DeepReadonly, Entity, type EntityState, UuidIdentifier, ValueObject, type ValueObjectPluginContract };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const require_use_case = require("./use-case.cjs");
|
|
2
|
+
const require_value_object = require("./value-object.cjs");
|
|
3
|
+
//#region src/core/versioning/domain-event-contracts.ts
|
|
4
|
+
function buildDomainEventContractVersions(selection) {
|
|
5
|
+
const contractVersions = {};
|
|
6
|
+
if (selection.entity) contractVersions.entity_contract = require_value_object.Entity.CONTRACT_VERSION;
|
|
7
|
+
if (selection.valueObject) contractVersions.value_object_contract = require_value_object.ValueObject.CONTRACT_VERSION;
|
|
8
|
+
if (selection.useCase) contractVersions.use_case_contract = require_use_case.UseCase.CONTRACT_VERSION;
|
|
9
|
+
return Object.freeze(contractVersions);
|
|
10
|
+
}
|
|
11
|
+
function createDomainEventEnvelope(input) {
|
|
12
|
+
require_value_object.assertValidAggregateVersion(input.aggregateVersion);
|
|
13
|
+
return Object.freeze({
|
|
14
|
+
aggregate_version: input.aggregateVersion,
|
|
15
|
+
payload: input.payload,
|
|
16
|
+
...buildDomainEventContractVersions(input.contracts)
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
Object.defineProperty(exports, "buildDomainEventContractVersions", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function() {
|
|
23
|
+
return buildDomainEventContractVersions;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
Object.defineProperty(exports, "createDomainEventEnvelope", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function() {
|
|
29
|
+
return createDomainEventEnvelope;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=domain-event-contracts.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain-event-contracts.cjs","names":["Entity","ValueObject","UseCase"],"sources":["../src/core/versioning/domain-event-contracts.ts"],"sourcesContent":["import { UseCase } from \"../application/use-case.js\";\nimport { Entity } from \"../domain/entity.js\";\nimport { ValueObject } from \"../domain/value-object.js\";\nimport { assertValidAggregateVersion } from \"../shared/aggregate-version.js\";\nimport { type ContractVersion } from \"./version.js\";\n\ninterface DomainEventContractSelection {\n readonly entity?: boolean;\n readonly valueObject?: boolean;\n readonly useCase?: boolean;\n}\n\ninterface DomainEventContractVersions {\n readonly entity_contract?: ContractVersion;\n readonly value_object_contract?: ContractVersion;\n readonly use_case_contract?: ContractVersion;\n}\n\ninterface CreateDomainEventEnvelopeInput<TPayload> {\n readonly aggregateVersion: number;\n readonly payload: TPayload;\n readonly contracts: DomainEventContractSelection;\n}\n\ninterface DomainEventEnvelope<TPayload> extends DomainEventContractVersions {\n readonly aggregate_version: number;\n readonly payload: TPayload;\n}\n\nfunction buildDomainEventContractVersions(\n selection: DomainEventContractSelection,\n): DomainEventContractVersions {\n const contractVersions: {\n entity_contract?: ContractVersion;\n value_object_contract?: ContractVersion;\n use_case_contract?: ContractVersion;\n } = {};\n\n if (selection.entity) {\n contractVersions.entity_contract = Entity.CONTRACT_VERSION;\n }\n\n if (selection.valueObject) {\n contractVersions.value_object_contract = ValueObject.CONTRACT_VERSION;\n }\n\n if (selection.useCase) {\n contractVersions.use_case_contract = UseCase.CONTRACT_VERSION;\n }\n\n return Object.freeze(contractVersions);\n}\n\nfunction createDomainEventEnvelope<TPayload>(\n input: CreateDomainEventEnvelopeInput<TPayload>,\n): DomainEventEnvelope<TPayload> {\n assertValidAggregateVersion(input.aggregateVersion);\n\n return Object.freeze({\n aggregate_version: input.aggregateVersion,\n payload: input.payload,\n ...buildDomainEventContractVersions(input.contracts),\n });\n}\n\nexport {\n buildDomainEventContractVersions,\n createDomainEventEnvelope,\n type CreateDomainEventEnvelopeInput,\n type DomainEventContractSelection,\n type DomainEventContractVersions,\n type DomainEventEnvelope,\n};\n"],"mappings":";;;AA6BA,SAAS,iCACL,WAC2B;CAC3B,MAAM,mBAIF,CAAC;CAEL,IAAI,UAAU,QACV,iBAAiB,kBAAkBA,qBAAAA,OAAO;CAG9C,IAAI,UAAU,aACV,iBAAiB,wBAAwBC,qBAAAA,YAAY;CAGzD,IAAI,UAAU,SACV,iBAAiB,oBAAoBC,iBAAAA,QAAQ;CAGjD,OAAO,OAAO,OAAO,gBAAgB;AACzC;AAEA,SAAS,0BACL,OAC6B;CAC7B,qBAAA,4BAA4B,MAAM,gBAAgB;CAElD,OAAO,OAAO,OAAO;EACjB,mBAAmB,MAAM;EACzB,SAAS,MAAM;EACf,GAAG,iCAAiC,MAAM,SAAS;CACvD,CAAC;AACL"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { n as ContractVersion } from "./version.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/core/versioning/domain-event-contracts.d.ts
|
|
4
|
+
interface DomainEventContractSelection {
|
|
5
|
+
readonly entity?: boolean;
|
|
6
|
+
readonly valueObject?: boolean;
|
|
7
|
+
readonly useCase?: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface DomainEventContractVersions {
|
|
10
|
+
readonly entity_contract?: ContractVersion;
|
|
11
|
+
readonly value_object_contract?: ContractVersion;
|
|
12
|
+
readonly use_case_contract?: ContractVersion;
|
|
13
|
+
}
|
|
14
|
+
interface CreateDomainEventEnvelopeInput<TPayload> {
|
|
15
|
+
readonly aggregateVersion: number;
|
|
16
|
+
readonly payload: TPayload;
|
|
17
|
+
readonly contracts: DomainEventContractSelection;
|
|
18
|
+
}
|
|
19
|
+
interface DomainEventEnvelope<TPayload> extends DomainEventContractVersions {
|
|
20
|
+
readonly aggregate_version: number;
|
|
21
|
+
readonly payload: TPayload;
|
|
22
|
+
}
|
|
23
|
+
declare function buildDomainEventContractVersions(selection: DomainEventContractSelection): DomainEventContractVersions;
|
|
24
|
+
declare function createDomainEventEnvelope<TPayload>(input: CreateDomainEventEnvelopeInput<TPayload>): DomainEventEnvelope<TPayload>;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { buildDomainEventContractVersions as a, DomainEventEnvelope as i, DomainEventContractSelection as n, createDomainEventEnvelope as o, DomainEventContractVersions as r, CreateDomainEventEnvelopeInput as t };
|
|
27
|
+
//# sourceMappingURL=domain-event-contracts.d.cts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { n as ContractVersion } from "./version.js";
|
|
2
|
+
|
|
3
|
+
//#region src/core/versioning/domain-event-contracts.d.ts
|
|
4
|
+
interface DomainEventContractSelection {
|
|
5
|
+
readonly entity?: boolean;
|
|
6
|
+
readonly valueObject?: boolean;
|
|
7
|
+
readonly useCase?: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface DomainEventContractVersions {
|
|
10
|
+
readonly entity_contract?: ContractVersion;
|
|
11
|
+
readonly value_object_contract?: ContractVersion;
|
|
12
|
+
readonly use_case_contract?: ContractVersion;
|
|
13
|
+
}
|
|
14
|
+
interface CreateDomainEventEnvelopeInput<TPayload> {
|
|
15
|
+
readonly aggregateVersion: number;
|
|
16
|
+
readonly payload: TPayload;
|
|
17
|
+
readonly contracts: DomainEventContractSelection;
|
|
18
|
+
}
|
|
19
|
+
interface DomainEventEnvelope<TPayload> extends DomainEventContractVersions {
|
|
20
|
+
readonly aggregate_version: number;
|
|
21
|
+
readonly payload: TPayload;
|
|
22
|
+
}
|
|
23
|
+
declare function buildDomainEventContractVersions(selection: DomainEventContractSelection): DomainEventContractVersions;
|
|
24
|
+
declare function createDomainEventEnvelope<TPayload>(input: CreateDomainEventEnvelopeInput<TPayload>): DomainEventEnvelope<TPayload>;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { buildDomainEventContractVersions as a, DomainEventEnvelope as i, DomainEventContractSelection as n, createDomainEventEnvelope as o, DomainEventContractVersions as r, CreateDomainEventEnvelopeInput as t };
|
|
27
|
+
//# sourceMappingURL=domain-event-contracts.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { t as UseCase } from "./use-case.js";
|
|
2
|
+
import { n as Entity, r as assertValidAggregateVersion, t as ValueObject } from "./value-object.js";
|
|
3
|
+
//#region src/core/versioning/domain-event-contracts.ts
|
|
4
|
+
function buildDomainEventContractVersions(selection) {
|
|
5
|
+
const contractVersions = {};
|
|
6
|
+
if (selection.entity) contractVersions.entity_contract = Entity.CONTRACT_VERSION;
|
|
7
|
+
if (selection.valueObject) contractVersions.value_object_contract = ValueObject.CONTRACT_VERSION;
|
|
8
|
+
if (selection.useCase) contractVersions.use_case_contract = UseCase.CONTRACT_VERSION;
|
|
9
|
+
return Object.freeze(contractVersions);
|
|
10
|
+
}
|
|
11
|
+
function createDomainEventEnvelope(input) {
|
|
12
|
+
assertValidAggregateVersion(input.aggregateVersion);
|
|
13
|
+
return Object.freeze({
|
|
14
|
+
aggregate_version: input.aggregateVersion,
|
|
15
|
+
payload: input.payload,
|
|
16
|
+
...buildDomainEventContractVersions(input.contracts)
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { createDomainEventEnvelope as n, buildDomainEventContractVersions as t };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=domain-event-contracts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain-event-contracts.js","names":[],"sources":["../src/core/versioning/domain-event-contracts.ts"],"sourcesContent":["import { UseCase } from \"../application/use-case.js\";\nimport { Entity } from \"../domain/entity.js\";\nimport { ValueObject } from \"../domain/value-object.js\";\nimport { assertValidAggregateVersion } from \"../shared/aggregate-version.js\";\nimport { type ContractVersion } from \"./version.js\";\n\ninterface DomainEventContractSelection {\n readonly entity?: boolean;\n readonly valueObject?: boolean;\n readonly useCase?: boolean;\n}\n\ninterface DomainEventContractVersions {\n readonly entity_contract?: ContractVersion;\n readonly value_object_contract?: ContractVersion;\n readonly use_case_contract?: ContractVersion;\n}\n\ninterface CreateDomainEventEnvelopeInput<TPayload> {\n readonly aggregateVersion: number;\n readonly payload: TPayload;\n readonly contracts: DomainEventContractSelection;\n}\n\ninterface DomainEventEnvelope<TPayload> extends DomainEventContractVersions {\n readonly aggregate_version: number;\n readonly payload: TPayload;\n}\n\nfunction buildDomainEventContractVersions(\n selection: DomainEventContractSelection,\n): DomainEventContractVersions {\n const contractVersions: {\n entity_contract?: ContractVersion;\n value_object_contract?: ContractVersion;\n use_case_contract?: ContractVersion;\n } = {};\n\n if (selection.entity) {\n contractVersions.entity_contract = Entity.CONTRACT_VERSION;\n }\n\n if (selection.valueObject) {\n contractVersions.value_object_contract = ValueObject.CONTRACT_VERSION;\n }\n\n if (selection.useCase) {\n contractVersions.use_case_contract = UseCase.CONTRACT_VERSION;\n }\n\n return Object.freeze(contractVersions);\n}\n\nfunction createDomainEventEnvelope<TPayload>(\n input: CreateDomainEventEnvelopeInput<TPayload>,\n): DomainEventEnvelope<TPayload> {\n assertValidAggregateVersion(input.aggregateVersion);\n\n return Object.freeze({\n aggregate_version: input.aggregateVersion,\n payload: input.payload,\n ...buildDomainEventContractVersions(input.contracts),\n });\n}\n\nexport {\n buildDomainEventContractVersions,\n createDomainEventEnvelope,\n type CreateDomainEventEnvelopeInput,\n type DomainEventContractSelection,\n type DomainEventContractVersions,\n type DomainEventEnvelope,\n};\n"],"mappings":";;;AA6BA,SAAS,iCACL,WAC2B;CAC3B,MAAM,mBAIF,CAAC;CAEL,IAAI,UAAU,QACV,iBAAiB,kBAAkB,OAAO;CAG9C,IAAI,UAAU,aACV,iBAAiB,wBAAwB,YAAY;CAGzD,IAAI,UAAU,SACV,iBAAiB,oBAAoB,QAAQ;CAGjD,OAAO,OAAO,OAAO,gBAAgB;AACzC;AAEA,SAAS,0BACL,OAC6B;CAC7B,4BAA4B,MAAM,gBAAgB;CAElD,OAAO,OAAO,OAAO;EACjB,mBAAmB,MAAM;EACzB,SAAS,MAAM;EACf,GAAG,iCAAiC,MAAM,SAAS;CACvD,CAAC;AACL"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/core/exceptions/domain-exception.ts
|
|
2
|
+
var DomainException = class extends Error {
|
|
3
|
+
constructor(message) {
|
|
4
|
+
super(message);
|
|
5
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
6
|
+
this.name = new.target.name;
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
Object.defineProperty(exports, "DomainException", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function() {
|
|
13
|
+
return DomainException;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=domain-exception.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain-exception.cjs","names":[],"sources":["../src/core/exceptions/domain-exception.ts"],"sourcesContent":["abstract class DomainException extends Error {\n constructor(message: string) {\n super(message);\n Object.setPrototypeOf(this, new.target.prototype);\n this.name = new.target.name;\n }\n}\n\nexport { DomainException };\n"],"mappings":";AAAA,IAAe,kBAAf,cAAuC,MAAM;CACzC,YAAY,SAAiB;EACzB,MAAM,OAAO;EACb,OAAO,eAAe,MAAM,IAAI,OAAO,SAAS;EAChD,KAAK,OAAO,IAAI,OAAO;CAC3B;AACJ"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/core/exceptions/domain-exception.ts
|
|
2
|
+
var DomainException = class extends Error {
|
|
3
|
+
constructor(message) {
|
|
4
|
+
super(message);
|
|
5
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
6
|
+
this.name = new.target.name;
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { DomainException as t };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=domain-exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain-exception.js","names":[],"sources":["../src/core/exceptions/domain-exception.ts"],"sourcesContent":["abstract class DomainException extends Error {\n constructor(message: string) {\n super(message);\n Object.setPrototypeOf(this, new.target.prototype);\n this.name = new.target.name;\n }\n}\n\nexport { DomainException };\n"],"mappings":";AAAA,IAAe,kBAAf,cAAuC,MAAM;CACzC,YAAY,SAAiB;EACzB,MAAM,OAAO;EACb,OAAO,eAAe,MAAM,IAAI,OAAO,SAAS;EAChD,KAAK,OAAO,IAAI,OAAO;CAC3B;AACJ"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_unexpected_error = require("../unexpected-error.cjs");
|
|
3
|
+
const require_validation_error = require("../validation-error.cjs");
|
|
4
|
+
const require_not_found_error = require("../not-found-error.cjs");
|
|
5
|
+
const require_hashing = require("../hashing.cjs");
|
|
6
|
+
exports.AlreadyExistsError = require_validation_error.AlreadyExistsError;
|
|
7
|
+
exports.AppError = require_unexpected_error.AppError;
|
|
8
|
+
exports.AuthenticationError = require_validation_error.AuthenticationError;
|
|
9
|
+
exports.AuthorizationError = require_validation_error.AuthorizationError;
|
|
10
|
+
exports.BusinessRuleViolationError = require_not_found_error.BusinessRuleViolationError;
|
|
11
|
+
exports.ConflictError = require_validation_error.ConflictError;
|
|
12
|
+
exports.DeserializationError = require_validation_error.SerializationInError;
|
|
13
|
+
exports.DuplicateError = require_validation_error.DuplicateError;
|
|
14
|
+
exports.ErrorCodes = require_unexpected_error.ErrorCodes;
|
|
15
|
+
exports.ExpiredError = require_validation_error.ExpiredError;
|
|
16
|
+
exports.IdempotencyError = require_validation_error.IdempotencyError;
|
|
17
|
+
exports.IdempotencyInProgressError = require_validation_error.IdempotencyInProgressError;
|
|
18
|
+
exports.IdempotencyKeyMissingError = require_validation_error.IdempotencyKeyMissingError;
|
|
19
|
+
exports.IdempotencyPayloadMismatchError = require_validation_error.IdempotencyPayloadMismatchError;
|
|
20
|
+
exports.IdempotencyReplayNotSupportedError = require_validation_error.IdempotencyReplayNotSupportedError;
|
|
21
|
+
exports.IntegrationError = require_validation_error.IntegrationError;
|
|
22
|
+
exports.LegacyIncompatibleError = require_validation_error.LegacyIncompatibleError;
|
|
23
|
+
exports.NotFoundError = require_not_found_error.NotFoundError;
|
|
24
|
+
exports.NotYetValidError = require_validation_error.NotYetValidError;
|
|
25
|
+
exports.SerializationCodes = require_validation_error.SerializationCodes;
|
|
26
|
+
exports.SerializationError = require_validation_error.SerializationError;
|
|
27
|
+
exports.SerializationInError = require_validation_error.SerializationInError;
|
|
28
|
+
exports.SerializationMessages = require_validation_error.SerializationMessages;
|
|
29
|
+
exports.SerializationOutError = require_validation_error.SerializationOutError;
|
|
30
|
+
exports.TemporalError = require_validation_error.TemporalError;
|
|
31
|
+
exports.UnexpectedError = require_unexpected_error.UnexpectedError;
|
|
32
|
+
exports.UniqueConstraintViolationError = require_validation_error.UniqueConstraintViolationError;
|
|
33
|
+
exports.ValidationError = require_validation_error.ValidationError;
|
|
34
|
+
exports.assertJsonSafeMetadata = require_unexpected_error.assertJsonSafeMetadata;
|
|
35
|
+
exports.evaluateTemporalWindow = require_validation_error.evaluateTemporalWindow;
|
|
36
|
+
exports.payloadHash = require_hashing.payloadHash;
|
|
37
|
+
exports.safePreview = require_validation_error.safePreview;
|
|
38
|
+
exports.serializationErrorCode = require_unexpected_error.serializationErrorCode;
|
|
39
|
+
exports.sha256Hex = require_hashing.sha256Hex;
|
|
40
|
+
exports.stableStringify = require_hashing.stableStringify;
|
|
41
|
+
exports.translateUniqueViolationToDuplicate = require_validation_error.translateUniqueViolationToDuplicate;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { a as JsonSafeRecord, i as JsonSafePrimitive, n as AppErrorOptions, o as JsonSafeValue, r as ErrorSeverity, t as AppError } from "../app-error.cjs";
|
|
2
|
+
import { $ as serializationErrorCode, A as IdempotencyPayloadMismatchError, B as UniqueConstraintViolation, C as IntegrationErrorMetadata, D as IdempotencyFailureKind, E as IdempotencyErrorMetadata, F as AlreadyExistsError, G as AuthorizationErrorMetadata, H as translateUniqueViolationToDuplicate, I as ConflictError, J as AuthenticationError, K as AuthorizationErrorReason, L as ConflictErrorMetadata, M as payloadHash, N as sha256Hex, O as IdempotencyInProgressError, P as stableStringify, Q as ErrorCodes, R as ConflictKind, S as IntegrationError, T as IdempotencyError, U as BusinessRuleViolationError, V as UniqueConstraintViolationError, W as AuthorizationError, X as AuthenticationErrorReason, Y as AuthenticationErrorMetadata, Z as assertJsonSafeMetadata, _ as SerializationMessages, a as TemporalError, b as NotFoundError, c as TemporalPrecision, d as SerializationCodes, f as SerializationDirection, g as SerializationInError, h as SerializationFailureCategory, i as NotYetValidError, j as IdempotencyReplayNotSupportedError, k as IdempotencyKeyMissingError, l as evaluateTemporalWindow, m as SerializationErrorMetadata, n as UnexpectedError, o as TemporalErrorMetadata, p as SerializationError, q as AuthorizationRequirement, r as ExpiredError, s as TemporalKind, t as ValidationError, u as SerializationBoundary, v as SerializationOutError, w as IntegrationErrorReason, x as LegacyIncompatibleError, y as safePreview, z as DuplicateError } from "../validation-error.cjs";
|
|
3
|
+
export { AlreadyExistsError, AppError, AppErrorOptions, AuthenticationError, AuthenticationErrorMetadata, AuthenticationErrorReason, AuthorizationError, AuthorizationErrorMetadata, AuthorizationErrorReason, AuthorizationRequirement, BusinessRuleViolationError, ConflictError, ConflictErrorMetadata, ConflictKind, SerializationInError as DeserializationError, SerializationInError, DuplicateError, ErrorCodes, ErrorSeverity, ExpiredError, TemporalErrorMetadata as ExpiredErrorMetadata, TemporalErrorMetadata, TemporalPrecision as ExpiredErrorPrecision, TemporalPrecision, IdempotencyError, IdempotencyErrorMetadata, IdempotencyFailureKind, IdempotencyInProgressError, IdempotencyKeyMissingError, IdempotencyPayloadMismatchError, IdempotencyReplayNotSupportedError, IntegrationError, IntegrationErrorMetadata, IntegrationErrorReason, JsonSafePrimitive, JsonSafeRecord, JsonSafeValue, LegacyIncompatibleError, NotFoundError, NotYetValidError, SerializationBoundary, SerializationCodes, SerializationDirection, SerializationError, SerializationErrorMetadata, SerializationFailureCategory, SerializationMessages, SerializationOutError, TemporalError, TemporalKind, UnexpectedError, UniqueConstraintViolation, UniqueConstraintViolationError, ValidationError, assertJsonSafeMetadata, evaluateTemporalWindow, payloadHash, safePreview, serializationErrorCode, sha256Hex, stableStringify, translateUniqueViolationToDuplicate };
|
package/dist/errors/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as serializationErrorCode, i as ErrorCodes, n as AppError, r as assertJsonSafeMetadata, t as UnexpectedError } from "../unexpected-error.js";
|
|
2
2
|
import { C as translateUniqueViolationToDuplicate, S as UniqueConstraintViolationError, T as AuthenticationError, _ as IdempotencyPayloadMismatchError, a as evaluateTemporalWindow, b as ConflictError, c as SerializationInError, d as safePreview, f as LegacyIncompatibleError, g as IdempotencyKeyMissingError, h as IdempotencyInProgressError, i as TemporalError, l as SerializationMessages, m as IdempotencyError, n as ExpiredError, o as SerializationCodes, p as IntegrationError, r as NotYetValidError, s as SerializationError, t as ValidationError, u as SerializationOutError, v as IdempotencyReplayNotSupportedError, w as AuthorizationError, x as DuplicateError, y as AlreadyExistsError } from "../validation-error.js";
|
|
3
3
|
import { n as BusinessRuleViolationError, t as NotFoundError } from "../not-found-error.js";
|
|
4
4
|
import { n as sha256Hex, r as stableStringify, t as payloadHash } from "../hashing.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_validation_code = require("../validation-code.cjs");
|
|
3
|
+
const require_validation_field = require("../validation-field.cjs");
|
|
4
|
+
const require_domain_exception = require("../domain-exception.cjs");
|
|
5
|
+
const require_invalid_state_transition_exception = require("../invalid-state-transition-exception.cjs");
|
|
6
|
+
const require_invariant_violation_exception = require("../invariant-violation-exception.cjs");
|
|
7
|
+
const require_validation_exception = require("../validation-exception.cjs");
|
|
8
|
+
exports.BusinessRuleViolationException = require_invalid_state_transition_exception.BusinessRuleViolationException;
|
|
9
|
+
exports.DomainException = require_domain_exception.DomainException;
|
|
10
|
+
exports.EntityNotFoundException = require_invalid_state_transition_exception.EntityNotFoundException;
|
|
11
|
+
exports.InvalidStateTransitionException = require_invalid_state_transition_exception.InvalidStateTransitionException;
|
|
12
|
+
exports.InvalidValueException = require_validation_exception.InvalidValueException;
|
|
13
|
+
exports.InvariantViolationException = require_invariant_violation_exception.InvariantViolationException;
|
|
14
|
+
exports.MultipleValidationException = require_validation_exception.MultipleValidationException;
|
|
15
|
+
exports.ValidationCode = require_validation_code.ValidationCode;
|
|
16
|
+
exports.ValidationException = require_validation_exception.ValidationException;
|
|
17
|
+
exports.ValidationField = require_validation_field.ValidationField;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { t as ValidationCode } from "../validation-code.cjs";
|
|
2
|
+
import { t as ValidationField } from "../validation-field.cjs";
|
|
3
|
+
import { t as DomainException } from "../domain-exception.cjs";
|
|
4
|
+
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";
|
|
5
|
+
export { BusinessRuleViolationException, DomainException, EntityNotFoundException, InvalidStateTransitionException, InvalidValueException, InvariantViolationException, MultipleValidationException, ValidationCode, ValidationException, ValidationField, ValidationViolation };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { t as ValidationCode } from "../validation-code.js";
|
|
2
|
+
import { t as ValidationField } from "../validation-field.js";
|
|
3
|
+
import { t as DomainException } from "../domain-exception.js";
|
|
4
|
+
import { a as InvariantViolationException, c as BusinessRuleViolationException, i as ValidationViolation, n as MultipleValidationException, o as InvalidStateTransitionException, r as ValidationException, s as EntityNotFoundException, t as InvalidValueException } from "../validation-exception.js";
|
|
5
|
+
export { BusinessRuleViolationException, DomainException, EntityNotFoundException, InvalidStateTransitionException, InvalidValueException, InvariantViolationException, MultipleValidationException, ValidationCode, ValidationException, ValidationField, ValidationViolation };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { t as ValidationCode } from "../validation-code.js";
|
|
2
|
+
import { t as ValidationField } from "../validation-field.js";
|
|
3
|
+
import { t as DomainException } from "../domain-exception.js";
|
|
4
|
+
import { n as EntityNotFoundException, r as BusinessRuleViolationException, t as InvalidStateTransitionException } from "../invalid-state-transition-exception.js";
|
|
5
|
+
import { t as InvariantViolationException } from "../invariant-violation-exception.js";
|
|
6
|
+
import { n as MultipleValidationException, r as ValidationException, t as InvalidValueException } from "../validation-exception.js";
|
|
7
|
+
export { BusinessRuleViolationException, DomainException, EntityNotFoundException, InvalidStateTransitionException, InvalidValueException, InvariantViolationException, MultipleValidationException, ValidationCode, ValidationException, ValidationField };
|