@aventara/core 1.0.0-rc.0 → 1.0.0-rc.1
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/CHANGELOG.md +1140 -0
- package/README.md +224 -57
- package/dist/adapters/adapter-discovery-diagnostic.d.ts +4 -4
- package/dist/adapters/adapter-field.d.ts +11 -11
- package/dist/adapters/adapter-identifier.d.ts +6 -6
- package/dist/adapters/adapter-model.d.ts +9 -9
- package/dist/adapters/adapter-operation-executor.interface.d.ts +4 -4
- package/dist/adapters/adapter-operation.d.ts +3 -3
- package/dist/adapters/adapter-resource.d.ts +18 -9
- package/dist/adapters/adapter-sql-statement.d.ts +19 -0
- package/dist/adapters/adapter-transaction-executor.interface.d.ts +19 -0
- package/dist/adapters/adapter.interface.d.ts +49 -29
- package/dist/avz/avz-check.factory.d.ts +83 -0
- package/dist/avz/avz-check.factory.js +116 -0
- package/dist/avz/avz-check.registry.d.ts +35 -0
- package/dist/avz/avz-check.registry.js +9 -0
- package/dist/avz/avz.d.ts +203 -0
- package/dist/{json → avz}/avz.js +150 -8
- package/dist/{json → avz}/index.d.ts +2 -1
- package/dist/{json → avz}/json-shape.registry.d.ts +7 -7
- package/dist/{json → avz}/zod-issue.translator.d.ts +8 -2
- package/dist/{json → avz}/zod-issue.translator.js +7 -0
- package/dist/compiler/contract-compiler-diagnostic.d.ts +31 -5
- package/dist/compiler/contract.compiler.d.ts +18 -18
- package/dist/compiler/contract.compiler.js +548 -441
- package/dist/compiler/create-requirements.projector.d.ts +49 -0
- package/dist/compiler/create-requirements.projector.js +423 -0
- package/dist/compiler/field-validator.compiler.d.ts +47 -0
- package/dist/compiler/field-validator.compiler.js +238 -0
- package/dist/config/any-framework-config.d.ts +19 -12
- package/dist/config/config-diagnostic.d.ts +11 -4
- package/dist/config/config-layer.d.ts +15 -6
- package/dist/config/config.resolver.d.ts +74 -31
- package/dist/config/config.resolver.js +108 -44
- package/dist/config/config.validator.d.ts +7 -7
- package/dist/config/config.validator.js +581 -72
- package/dist/config/define-resource.d.ts +57 -0
- package/dist/config/define-resource.js +14 -0
- package/dist/config/effective-fields.d.ts +19 -23
- package/dist/config/entrypoint.normalizer.d.ts +1 -1
- package/dist/config/exact-framework-config.d.ts +280 -0
- package/dist/config/field-compute.resolver.d.ts +19 -0
- package/dist/config/field-compute.resolver.js +115 -0
- package/dist/config/field-pipeline-config.d.ts +47 -0
- package/dist/config/forced-operation.validator.d.ts +10 -0
- package/dist/config/forced-operation.validator.js +66 -0
- package/dist/config/framework-config.d.ts +110 -39
- package/dist/config/framework-exemptions-config.d.ts +91 -0
- package/dist/config/framework-exemptions-config.js +1 -0
- package/dist/config/framework-field-definition.d.ts +78 -0
- package/dist/config/framework-field-definition.js +28 -0
- package/dist/config/framework-resources-config.d.ts +116 -0
- package/dist/config/framework-resources-config.js +1 -0
- package/dist/config/pipeline-config.d.ts +56 -20
- package/dist/config/pipeline-tree.resolver.d.ts +79 -0
- package/dist/config/pipeline-tree.resolver.js +220 -0
- package/dist/config/stage-type.eraser.d.ts +65 -0
- package/dist/config/stage-type.eraser.js +1 -0
- package/dist/contracts/capability.d.ts +11 -11
- package/dist/contracts/client-contract-structure.validator.d.ts +323 -28
- package/dist/contracts/client-contract-structure.validator.js +152 -8
- package/dist/contracts/contract-canonicalizer.d.ts +19 -3
- package/dist/contracts/contract-canonicalizer.js +141 -28
- package/dist/contracts/contract-hash.d.ts +12 -7
- package/dist/contracts/contract-hash.js +3 -2
- package/dist/contracts/contract-limits.d.ts +4 -1
- package/dist/contracts/contract-limits.js +1 -0
- package/dist/contracts/contract-lookup.d.ts +5 -5
- package/dist/contracts/contract-protocol.d.ts +4 -4
- package/dist/contracts/contract.d.ts +24 -16
- package/dist/contracts/create-requirements.d.ts +35 -0
- package/dist/contracts/create-requirements.js +1 -0
- package/dist/contracts/enum-definition.d.ts +1 -1
- package/dist/contracts/field-check.d.ts +101 -0
- package/dist/contracts/field-check.js +1 -0
- package/dist/contracts/field.d.ts +52 -42
- package/dist/contracts/identifier.d.ts +4 -4
- package/dist/contracts/json-shape.d.ts +12 -1
- package/dist/contracts/lifecycle-trait.d.ts +2 -2
- package/dist/contracts/resource-operations.d.ts +28 -28
- package/dist/contracts/resource.d.ts +15 -9
- package/dist/contracts/scalar-value-type.d.ts +15 -15
- package/dist/contracts/scalar.d.ts +3 -3
- package/dist/contracts/transaction-capability.d.ts +1 -1
- package/dist/contracts/wire-scalar-format.d.ts +4 -4
- package/dist/framework/contract-view.d.ts +213 -147
- package/dist/framework/framework-construction.error.d.ts +10 -10
- package/dist/framework/framework-construction.error.js +2 -2
- package/dist/framework/framework.d.ts +47 -23
- package/dist/framework/framework.factory.d.ts +8 -6
- package/dist/framework/framework.factory.js +40 -20
- package/dist/framework/operation-facade.d.ts +123 -52
- package/dist/framework/operation-facade.js +9 -1
- package/dist/index.d.ts +55 -50
- package/dist/index.js +6 -6
- package/dist/internal.d.ts +15 -10
- package/dist/internal.js +3 -1
- package/dist/operations/operation-arguments.d.ts +267 -202
- package/dist/operations/operation-call.d.ts +27 -28
- package/dist/operations/operation-identity.d.ts +10 -10
- package/dist/operations/operation-result.d.ts +21 -21
- package/dist/operations/operation-validator-core.d.ts +6 -6
- package/dist/operations/operation-validator-core.js +13 -2
- package/dist/operations/operation-validator.d.ts +9 -9
- package/dist/operations/projection-scope.resolver.d.ts +6 -6
- package/dist/operations/structural-limits.walker.d.ts +6 -6
- package/dist/operations/structural-limits.walker.js +145 -0
- package/dist/operations/validation-code.d.ts +11 -6
- package/dist/operations/validation-code.js +4 -0
- package/dist/operations/write-scope.resolver.d.ts +6 -6
- package/dist/protocol/absent-route.responder.d.ts +13 -12
- package/dist/protocol/absent-route.responder.js +19 -19
- package/dist/protocol/contract-document.responder.d.ts +3 -3
- package/dist/protocol/contract-document.responder.js +2 -2
- package/dist/protocol/http-request.decoder.d.ts +17 -13
- package/dist/protocol/http-request.decoder.js +10 -10
- package/dist/protocol/http-request.reader.d.ts +3 -3
- package/dist/protocol/http-response.encoder.d.ts +4 -4
- package/dist/protocol/http-response.encoder.js +94 -55
- package/dist/protocol/http-status.table.d.ts +2 -2
- package/dist/protocol/operation-response.guard.d.ts +2 -2
- package/dist/protocol/protocol-surface.d.ts +4 -4
- package/dist/protocol/protocol.binder.d.ts +50 -27
- package/dist/protocol/protocol.binder.js +12 -9
- package/dist/protocol/protocol.handler.d.ts +22 -13
- package/dist/protocol/protocol.handler.js +44 -9
- package/dist/protocol/unmounted-route.error.d.ts +4 -4
- package/dist/protocol/unmounted-route.error.js +2 -2
- package/dist/runtime/caller-data.copier.d.ts +5 -5
- package/dist/runtime/caller-data.copier.js +13 -13
- package/dist/runtime/caller-data.door.d.ts +6 -6
- package/dist/runtime/caller-data.door.js +6 -4
- package/dist/runtime/computed-read-runtime.d.ts +7 -6
- package/dist/runtime/computed-read-runtime.js +61 -48
- package/dist/runtime/computed-value.error.d.ts +6 -6
- package/dist/runtime/computed-value.error.js +3 -3
- package/dist/runtime/context-executor.runtime.d.ts +59 -0
- package/dist/runtime/context-executor.runtime.js +275 -0
- package/dist/runtime/create-requirement.d.ts +10 -81
- package/dist/runtime/create-requirement.js +80 -57
- package/dist/runtime/decimal.d.ts +2 -2
- package/dist/runtime/decimal.js +1 -1
- package/dist/runtime/diagnostics-reporter.d.ts +53 -27
- package/dist/runtime/diagnostics-reporter.js +24 -0
- package/dist/runtime/error-boundary.d.ts +65 -8
- package/dist/runtime/error-boundary.js +45 -19
- package/dist/runtime/execution-options.d.ts +10 -2
- package/dist/runtime/field-check.evaluator.d.ts +29 -0
- package/dist/runtime/field-check.evaluator.js +521 -0
- package/dist/runtime/field-compute.d.ts +64 -0
- package/dist/runtime/field-compute.js +1 -0
- package/dist/runtime/field-stage.plan.d.ts +15 -0
- package/dist/runtime/field-stage.plan.js +27 -0
- package/dist/runtime/field-stage.runtime.d.ts +35 -0
- package/dist/runtime/field-stage.runtime.js +143 -0
- package/dist/runtime/field-validator.runtime.d.ts +11 -0
- package/dist/runtime/field-validator.runtime.js +87 -0
- package/dist/runtime/framework-error-class.table.d.ts +33 -0
- package/dist/runtime/framework-error-class.table.js +25 -0
- package/dist/runtime/framework-error.d.ts +68 -8
- package/dist/runtime/framework-error.factory.d.ts +4 -0
- package/dist/runtime/framework-error.factory.js +15 -0
- package/dist/runtime/framework-error.js +23 -2
- package/dist/runtime/interceptor-next.error.d.ts +5 -0
- package/dist/runtime/interceptor-next.error.js +6 -0
- package/dist/runtime/json-value.d.ts +3 -3
- package/dist/runtime/level-lifecycle.runtime.d.ts +25 -0
- package/dist/runtime/level-lifecycle.runtime.js +42 -0
- package/dist/runtime/misuse-reporter.d.ts +12 -12
- package/dist/runtime/mutation-planner.d.ts +19 -10
- package/dist/runtime/mutation-planner.js +54 -30
- package/dist/runtime/nested-write.walker.d.ts +32 -0
- package/dist/runtime/nested-write.walker.js +73 -0
- package/dist/runtime/operation-request.d.ts +33 -6
- package/dist/runtime/operation-response.d.ts +17 -17
- package/dist/runtime/operation-runtime.d.ts +113 -25
- package/dist/runtime/operation-runtime.js +395 -74
- package/dist/runtime/outcome-mapper.d.ts +16 -5
- package/dist/runtime/outcome-mapper.js +23 -6
- package/dist/runtime/output-validator.d.ts +10 -10
- package/dist/runtime/output-validator.js +3 -3
- package/dist/runtime/owned-execution.registry.d.ts +6 -6
- package/dist/runtime/pipe-output.validator.d.ts +33 -18
- package/dist/runtime/pipe-output.validator.js +12 -12
- package/dist/runtime/pipeline.d.ts +196 -34
- package/dist/runtime/readonly-value.d.ts +32 -0
- package/dist/runtime/readonly-value.js +141 -0
- package/dist/runtime/request-envelope.validator.d.ts +3 -3
- package/dist/runtime/request-envelope.validator.js +12 -7
- package/dist/runtime/request-id.d.ts +1 -1
- package/dist/runtime/request-state.d.ts +14 -0
- package/dist/runtime/request-state.js +1 -0
- package/dist/runtime/request-state.resolver.d.ts +12 -0
- package/dist/runtime/request-state.resolver.js +20 -0
- package/dist/runtime/scalar-runtime.d.ts +31 -16
- package/dist/runtime/scalar-runtime.js +16 -18
- package/dist/transactions/deferred-operation.d.ts +35 -20
- package/dist/transactions/operation-arguments-encoder.d.ts +3 -3
- package/dist/transactions/operation-arguments-encoder.js +2 -2
- package/dist/transactions/sql-statement.d.ts +77 -0
- package/dist/transactions/sql-statement.js +47 -0
- package/dist/transactions/sql-statement.validator.d.ts +44 -0
- package/dist/transactions/sql-statement.validator.js +134 -0
- package/dist/transactions/transaction-envelope.d.ts +4 -4
- package/dist/transactions/transaction-integrity-error.d.ts +6 -6
- package/dist/transactions/transaction-integrity-error.js +5 -2
- package/dist/transactions/transaction-plan-assembler.d.ts +21 -11
- package/dist/transactions/transaction-plan-assembler.js +148 -34
- package/dist/transactions/transaction-plan-validator.d.ts +29 -20
- package/dist/transactions/transaction-plan-validator.js +70 -38
- package/dist/transactions/transaction-reference-collector.d.ts +5 -5
- package/dist/transactions/transaction-reference-resolver.d.ts +19 -2
- package/dist/transactions/transaction-reference-resolver.js +26 -14
- package/dist/transactions/transaction-reference-validator.d.ts +34 -4
- package/dist/transactions/transaction-reference-validator.js +58 -26
- package/dist/transactions/transaction-reference.d.ts +13 -13
- package/dist/transactions/transaction-request.d.ts +18 -5
- package/dist/transactions/transaction-response.d.ts +6 -6
- package/dist/transactions/transaction-runtime.d.ts +8 -7
- package/dist/transactions/transaction-runtime.js +166 -50
- package/dist/transactions/transaction-settlement.runtime.d.ts +51 -0
- package/dist/transactions/transaction-settlement.runtime.js +120 -0
- package/dist/transactions/transaction-slot-path-error.d.ts +4 -4
- package/dist/transactions/transaction-slot-path-error.js +2 -2
- package/dist/transactions/transaction-slot-writer.js +2 -2
- package/dist/transactions/transaction-stage.runtime.d.ts +81 -0
- package/dist/transactions/transaction-stage.runtime.js +123 -0
- package/package.json +6 -5
- package/src/runtime/field-check.evaluator.ts +720 -0
- package/dist/config/define-fields.d.ts +0 -42
- package/dist/config/define-fields.js +0 -3
- package/dist/config/framework-behaviors-config.d.ts +0 -30
- package/dist/config/framework-fields-config.d.ts +0 -42
- package/dist/config/framework-restrictions-config.d.ts +0 -142
- package/dist/json/avz.d.ts +0 -96
- package/dist/runtime/field-behavior.d.ts +0 -48
- /package/dist/{config/framework-behaviors-config.js → adapters/adapter-sql-statement.js} +0 -0
- /package/dist/{config/framework-fields-config.js → adapters/adapter-transaction-executor.interface.js} +0 -0
- /package/dist/{json → avz}/index.js +0 -0
- /package/dist/{json → avz}/json-shape.registry.js +0 -0
- /package/dist/config/{framework-restrictions-config.js → exact-framework-config.js} +0 -0
- /package/dist/{runtime/field-behavior.js → config/field-pipeline-config.js} +0 -0
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
1
|
+
import type { AvAdapter } from "../adapters/adapter.interface.js";
|
|
2
|
+
import type { AvAdapterModel } from "../adapters/adapter-model.js";
|
|
3
|
+
import type { AvAdapterOperationExecutor } from "../adapters/adapter-operation-executor.interface.js";
|
|
4
|
+
import type { AvAdapterTransactionExecutor } from "../adapters/adapter-transaction-executor.interface.js";
|
|
5
|
+
import type { AvContracts } from "../compiler/contract.compiler.js";
|
|
5
6
|
import type { ResolvedFrameworkConfig } from "../config/config.resolver.js";
|
|
6
|
-
import type {
|
|
7
|
+
import type { AvRequestOrigin, RemoteRequestOrigin } from "../config/config-layer.js";
|
|
8
|
+
import type { AvContract } from "../contracts/contract.js";
|
|
7
9
|
import type { OperationValidationOptions, SemanticOperationArguments } from "../operations/operation-validator.js";
|
|
8
10
|
import type { FrameworkTransactionRequest } from "../transactions/transaction-request.js";
|
|
9
11
|
import { type ArgumentsSource } from "./caller-data.door.js";
|
|
12
|
+
import { type ContextExecutor, type ExecutorScope } from "./context-executor.runtime.js";
|
|
10
13
|
import { type RecordWriteFacts } from "./create-requirement.js";
|
|
11
|
-
import type
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
+
import { type DiagnosticsReporter } from "./diagnostics-reporter.js";
|
|
15
|
+
import { type OuterFailureLayer } from "./error-boundary.js";
|
|
16
|
+
import { type FieldStagePlan } from "./field-stage.plan.js";
|
|
17
|
+
import type { ClientProtocolIdentity, FrameworkOperationRequest, StatefulOperationRequest } from "./operation-request.js";
|
|
18
|
+
import type { AvOperationFailureResponse, AvOperationResponse } from "./operation-response.js";
|
|
19
|
+
import type { AvState } from "./request-state.js";
|
|
14
20
|
import { type NormalizationWrite } from "./scalar-runtime.js";
|
|
15
|
-
export type OperationRuntimeDependencies<M extends
|
|
16
|
-
readonly adapter:
|
|
17
|
-
readonly contracts:
|
|
21
|
+
export type OperationRuntimeDependencies<M extends AvAdapterModel> = {
|
|
22
|
+
readonly adapter: AvAdapter<M>;
|
|
23
|
+
readonly contracts: AvContracts;
|
|
18
24
|
readonly config: ResolvedFrameworkConfig<M>;
|
|
19
25
|
};
|
|
20
26
|
/**
|
|
@@ -22,13 +28,49 @@ export type OperationRuntimeDependencies<M extends AdapterModel> = {
|
|
|
22
28
|
* single Adapter call goes through the executor passed beside it, so inside a
|
|
23
29
|
* transaction plan the root Adapter is unreachable by type.
|
|
24
30
|
*/
|
|
25
|
-
export type OperationPipelineDependencies<M extends
|
|
31
|
+
export type OperationPipelineDependencies<M extends AvAdapterModel> = Omit<OperationRuntimeDependencies<M>, "adapter"> & {
|
|
26
32
|
/**
|
|
27
33
|
* The Adapter's create requirements and referential edges, read once at
|
|
28
34
|
* construction.
|
|
29
35
|
*/
|
|
30
36
|
readonly recordWrites: RecordWriteFacts;
|
|
37
|
+
/** Builds every stage's ctx: its `$` facts and the executor. */
|
|
38
|
+
readonly contexts: ContextExecutor<M>;
|
|
39
|
+
/** Each origin's field-stage dispatch, planned at construction. */
|
|
40
|
+
readonly fieldStages: {
|
|
41
|
+
readonly [O in AvRequestOrigin]: FieldStagePlan;
|
|
42
|
+
};
|
|
31
43
|
};
|
|
44
|
+
/**
|
|
45
|
+
* Where one operation's Adapter call runs: standalone, through the Adapter, or
|
|
46
|
+
* inside an open transaction, through its executor.
|
|
47
|
+
*/
|
|
48
|
+
export type OperationBinding<M extends AvAdapterModel> = {
|
|
49
|
+
readonly kind: "standalone";
|
|
50
|
+
readonly executor: AvAdapterOperationExecutor<M>;
|
|
51
|
+
} | {
|
|
52
|
+
readonly kind: "transaction";
|
|
53
|
+
readonly executor: AvAdapterTransactionExecutor<M>;
|
|
54
|
+
/**
|
|
55
|
+
* A plan step's (or a forced call's) Resource transaction filters: the
|
|
56
|
+
* outer layer an error the step's own filters leave unhandled is handed
|
|
57
|
+
* to, answered once the transaction interceptors have unwound (the rc.1
|
|
58
|
+
* follow-up ruling; the independent re-check). Absent for a ctx call.
|
|
59
|
+
*/
|
|
60
|
+
readonly outer?: OuterFailureLayer;
|
|
61
|
+
};
|
|
62
|
+
/** `request` with its state settled. */
|
|
63
|
+
export declare function withRequestState<Request extends {
|
|
64
|
+
readonly state?: AvState;
|
|
65
|
+
}>(request: Request): Request & {
|
|
66
|
+
readonly state: AvState;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Builds what every operation's pipeline shares, the ctx executor included: its
|
|
70
|
+
* raw calls run the application's operation path with every developer stage
|
|
71
|
+
* removed.
|
|
72
|
+
*/
|
|
73
|
+
export declare function createPipelineDependencies<M extends AvAdapterModel>(dependencies: OperationRuntimeDependencies<M>, model: M): OperationPipelineDependencies<M>;
|
|
32
74
|
/**
|
|
33
75
|
* The executor core owns no diagnostics channel: the framework factory owns
|
|
34
76
|
* it and hands in one reporter already bound to this request, so every
|
|
@@ -37,33 +79,79 @@ export type OperationPipelineDependencies<M extends AdapterModel> = Omit<Operati
|
|
|
37
79
|
* request's arguments are the caller's own objects, copied at the door, or data
|
|
38
80
|
* no caller holds (see {@link ArgumentsSource}).
|
|
39
81
|
*/
|
|
40
|
-
export type FrameworkOperationExecutor = (request: FrameworkOperationRequest, report: DiagnosticsReporter, source: ArgumentsSource) => Promise<
|
|
82
|
+
export type FrameworkOperationExecutor = (request: FrameworkOperationRequest, report: DiagnosticsReporter, source: ArgumentsSource) => Promise<AvOperationResponse>;
|
|
41
83
|
/** Selects the Contract of the request's origin. */
|
|
42
|
-
export declare function activeContract(contracts:
|
|
84
|
+
export declare function activeContract(contracts: AvContracts, request: FrameworkOperationRequest | FrameworkTransactionRequest): AvContract;
|
|
43
85
|
/** Creates the transport-independent operation executor owned by core. */
|
|
44
|
-
export declare function createOperationRuntime<M extends
|
|
86
|
+
export declare function createOperationRuntime<M extends AvAdapterModel>(dependencies: OperationRuntimeDependencies<M>, pipelineDependencies: OperationPipelineDependencies<M>): FrameworkOperationExecutor;
|
|
45
87
|
/** Validates the request-level protocol identity. */
|
|
46
|
-
export declare function validateProtocolIdentity(contracts:
|
|
88
|
+
export declare function validateProtocolIdentity(contracts: AvContracts, request: FrameworkOperationRequest | FrameworkTransactionRequest): AvOperationFailureResponse | undefined;
|
|
47
89
|
/**
|
|
48
|
-
* The stale-client check on one
|
|
49
|
-
* (`A2006`), then the
|
|
90
|
+
* The stale-client check on one remote protocol identity: the protocol version first
|
|
91
|
+
* (`A2006`), then the hash of the origin's Contract (`A2005`): the ClientContract's
|
|
92
|
+
* for a client, the Agent Contract's for an agent. Exact match only. The one
|
|
50
93
|
* implementation — the protocol's decoders and absence answers
|
|
51
94
|
* (`@aventara/core/protocol`) call it too, so a stale client hears the same envelope
|
|
52
95
|
* whichever layer answers.
|
|
53
96
|
*/
|
|
54
|
-
export declare function protocolIdentityFailure(contracts:
|
|
97
|
+
export declare function protocolIdentityFailure(contracts: AvContracts, protocol: ClientProtocolIdentity, origin: RemoteRequestOrigin): AvOperationFailureResponse | undefined;
|
|
55
98
|
export type ValidatedOperationArguments = {
|
|
56
99
|
readonly ok: true;
|
|
57
100
|
readonly arguments: SemanticOperationArguments;
|
|
58
101
|
} | {
|
|
59
102
|
readonly ok: false;
|
|
60
|
-
readonly response:
|
|
103
|
+
readonly response: AvOperationFailureResponse;
|
|
61
104
|
};
|
|
62
105
|
/** Validates one operation's arguments through the Framework Validation Layer. */
|
|
63
|
-
export declare function validateOperationRequest(contract:
|
|
106
|
+
export declare function validateOperationRequest(contract: AvContract, request: FrameworkOperationRequest, options?: OperationValidationOptions, write?: NormalizationWrite): ValidatedOperationArguments;
|
|
107
|
+
/** Every sent field's path: a single call's arguments hold no `$ref`. */
|
|
108
|
+
export declare const EVERY_FIELD: () => boolean;
|
|
109
|
+
/**
|
|
110
|
+
* What admission leaves: the deep-frozen arguments every later stage reads, and
|
|
111
|
+
* whether a pipe or a field pipe changed them; or the answer that refused the
|
|
112
|
+
* operation.
|
|
113
|
+
*/
|
|
114
|
+
export type AdmittedOperation = {
|
|
115
|
+
readonly ok: true;
|
|
116
|
+
readonly args: unknown;
|
|
117
|
+
readonly piped: boolean;
|
|
118
|
+
} | {
|
|
119
|
+
readonly ok: false;
|
|
120
|
+
readonly response: AvOperationFailureResponse;
|
|
121
|
+
};
|
|
122
|
+
/** Which sent values an operation's field stages and validators take, and how its pipe output is checked. */
|
|
123
|
+
export type AdmissionScope = {
|
|
124
|
+
/**
|
|
125
|
+
* The sent values the field pipes and validators take: every one for a single
|
|
126
|
+
* call, a plan step's literal values before BEGIN, its resolved `$ref` values
|
|
127
|
+
* at the step.
|
|
128
|
+
*/
|
|
129
|
+
readonly select: (path: readonly (string | number)[]) => boolean;
|
|
130
|
+
/** Before BEGIN a plan step's `$ref` slots are unresolved: these admit them. */
|
|
131
|
+
readonly validation?: OperationValidationOptions;
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Runs an operation's admission — its guards, pipes and validators — and answers
|
|
135
|
+
* the deep-frozen arguments the rest of the operation reads, or the refusal.
|
|
136
|
+
*/
|
|
137
|
+
export declare function admitOperation<M extends AvAdapterModel>(dependencies: OperationPipelineDependencies<M>, request: StatefulOperationRequest, contract: AvContract, args: unknown, argumentsPath: readonly (string | number)[], report: DiagnosticsReporter, scope: ExecutorScope<M>, admission?: AdmissionScope): Promise<AdmittedOperation>;
|
|
138
|
+
/** How a plan step's arguments were changed between their admission and the step. */
|
|
139
|
+
export type StepChanges = {
|
|
140
|
+
/** The sent `$ref` values written at this step: their field stages run now. */
|
|
141
|
+
readonly written: (path: readonly (string | number)[]) => boolean;
|
|
142
|
+
/** A transaction pipe changed the step: every value is judged again. */
|
|
143
|
+
readonly transactionPiped: boolean;
|
|
144
|
+
/** An operation pipe ran before BEGIN on a step with `$ref`s: the resolved arguments are checked again. */
|
|
145
|
+
readonly pipedAroundReferences: boolean;
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* A plan step's (or a forced call's) arguments at the step: resolved values
|
|
149
|
+
* through their field stages, and re-checked when a stage changed them.
|
|
150
|
+
*/
|
|
151
|
+
export declare function prepareStep<M extends AvAdapterModel>(dependencies: OperationPipelineDependencies<M>, request: StatefulOperationRequest, contract: AvContract, args: unknown, argumentsPath: readonly (string | number)[], report: DiagnosticsReporter, executor: AvAdapterTransactionExecutor<M>, changes: StepChanges, outer: OuterFailureLayer): Promise<AdmittedOperation>;
|
|
64
152
|
/**
|
|
65
|
-
* Everything after
|
|
66
|
-
* wrapped in the post-validation error boundary. Validation
|
|
67
|
-
* reach this function, so developer filters never see them.
|
|
153
|
+
* Everything after admission: write compute and the lifecycle around the
|
|
154
|
+
* Adapter call, wrapped in the post-validation error boundary. Validation
|
|
155
|
+
* failures never reach this function, so developer filters never see them.
|
|
68
156
|
*/
|
|
69
|
-
export declare function
|
|
157
|
+
export declare function executeAdmittedOperation<M extends AvAdapterModel>(dependencies: OperationPipelineDependencies<M>, request: StatefulOperationRequest, contract: AvContract, admittedArguments: unknown, argumentsPath: readonly (string | number)[], binding: OperationBinding<M>, report: DiagnosticsReporter): Promise<AvOperationResponse>;
|