@aventara/core 0.1.0-pilot.3 → 0.1.0-pilot.4
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/adapters/adapter-discovery-diagnostic.d.ts +2 -0
- package/dist/adapters/adapter-field.d.ts +3 -26
- package/dist/adapters/adapter-identifier.d.ts +1 -11
- package/dist/adapters/adapter-model.d.ts +4 -0
- package/dist/adapters/adapter-operation-executor.interface.d.ts +5 -1
- package/dist/adapters/adapter-resource.d.ts +7 -28
- package/dist/adapters/adapter.interface.d.ts +21 -26
- package/dist/compiler/contract-compiler-diagnostic.d.ts +2 -0
- package/dist/compiler/contract.compiler.d.ts +11 -22
- package/dist/config/any-framework-config.d.ts +5 -26
- package/dist/config/config-diagnostic.d.ts +2 -0
- package/dist/config/config-layer.d.ts +6 -19
- package/dist/config/config.resolver.d.ts +6 -14
- package/dist/config/config.validator.d.ts +6 -3
- package/dist/config/define-fields.d.ts +6 -46
- package/dist/config/effective-fields.d.ts +6 -29
- package/dist/config/entrypoint.normalizer.d.ts +6 -18
- package/dist/config/framework-behaviors-config.d.ts +11 -10
- package/dist/config/framework-config.d.ts +15 -15
- package/dist/config/framework-fields-config.d.ts +14 -7
- package/dist/config/framework-restrictions-config.d.ts +41 -61
- package/dist/config/pipeline-config.d.ts +7 -17
- package/dist/contracts/capability.d.ts +13 -49
- package/dist/contracts/client-contract-structure.validator.d.ts +7 -53
- package/dist/contracts/contract-canonicalizer.d.ts +4 -6
- package/dist/contracts/contract-hash.d.ts +3 -2
- package/dist/contracts/contract-limits.d.ts +7 -1
- package/dist/contracts/contract-protocol.d.ts +7 -8
- package/dist/contracts/contract.d.ts +13 -4
- package/dist/contracts/enum-definition.d.ts +2 -0
- package/dist/contracts/field.d.ts +30 -167
- package/dist/contracts/identifier.d.ts +1 -16
- package/dist/contracts/lifecycle-trait.d.ts +4 -3
- package/dist/contracts/resource-operations.d.ts +2 -62
- package/dist/contracts/resource.d.ts +2 -0
- package/dist/contracts/scalar-value-type.d.ts +16 -47
- package/dist/contracts/scalar.d.ts +4 -3
- package/dist/contracts/transaction-capability.d.ts +2 -0
- package/dist/contracts/wire-scalar-format.d.ts +6 -21
- package/dist/framework/contract-view.d.ts +30 -113
- package/dist/framework/framework-construction.error.d.ts +6 -1
- package/dist/framework/framework.d.ts +31 -46
- package/dist/framework/framework.factory.d.ts +3 -17
- package/dist/framework/operation-facade.d.ts +3 -7
- package/dist/operations/operation-arguments.d.ts +52 -207
- package/dist/operations/operation-call.d.ts +13 -15
- package/dist/operations/operation-identity.d.ts +4 -2
- package/dist/operations/operation-result.d.ts +15 -61
- package/dist/operations/operation-validator-core.d.ts +5 -4
- package/dist/operations/operation-validator.d.ts +5 -7
- package/dist/operations/projection-scope.resolver.d.ts +0 -10
- package/dist/operations/validation-code.d.ts +5 -17
- package/dist/operations/write-scope.resolver.d.ts +3 -28
- package/dist/protocol/absent-route.responder.d.ts +23 -38
- package/dist/protocol/av-protocol.d.ts +2 -8
- package/dist/protocol/contract-document.responder.d.ts +5 -18
- package/dist/protocol/http-request.decoder.d.ts +12 -59
- package/dist/protocol/http-request.reader.d.ts +5 -5
- package/dist/protocol/http-response.encoder.d.ts +14 -20
- package/dist/protocol/http-status.table.d.ts +0 -8
- package/dist/protocol/index.d.ts +2 -7
- package/dist/protocol/operation-response.guard.d.ts +0 -15
- package/dist/protocol/protocol-failure.d.ts +8 -27
- package/dist/protocol/protocol-headers.d.ts +15 -42
- package/dist/protocol/protocol-surface.d.ts +0 -22
- package/dist/protocol/protocol.binder.d.ts +16 -26
- package/dist/protocol/protocol.handler.d.ts +15 -23
- package/dist/runtime/decimal.d.ts +5 -3
- package/dist/runtime/diagnostics-reporter.d.ts +14 -34
- package/dist/runtime/error-boundary.d.ts +6 -10
- package/dist/runtime/execution-options.d.ts +3 -7
- package/dist/runtime/field-behavior.d.ts +12 -19
- package/dist/runtime/framework-error.d.ts +2 -2
- package/dist/runtime/json-value.d.ts +7 -15
- package/dist/runtime/mutation-planner.d.ts +6 -12
- package/dist/runtime/operation-request.d.ts +7 -0
- package/dist/runtime/operation-response.d.ts +18 -23
- package/dist/runtime/operation-runtime.d.ts +12 -27
- package/dist/runtime/pipeline.d.ts +14 -29
- package/dist/runtime/referential-action.d.ts +1 -26
- package/dist/runtime/request-id.d.ts +3 -10
- package/dist/runtime/scalar-runtime.d.ts +12 -12
- package/dist/transactions/deferred-operation.d.ts +10 -21
- package/dist/transactions/operation-arguments-encoder.d.ts +1 -0
- package/dist/transactions/operation-fingerprint.d.ts +3 -1
- package/dist/transactions/transaction-envelope.d.ts +2 -4
- package/dist/transactions/transaction-integrity-error.d.ts +4 -15
- package/dist/transactions/transaction-plan-assembler.d.ts +1 -0
- package/dist/transactions/transaction-plan-validator.d.ts +3 -17
- package/dist/transactions/transaction-reference-resolver.d.ts +9 -12
- package/dist/transactions/transaction-reference.d.ts +23 -28
- package/dist/transactions/transaction-request.d.ts +3 -5
- package/dist/transactions/transaction-response.d.ts +5 -7
- package/dist/transactions/transaction-runtime.d.ts +3 -3
- package/dist/transactions/transaction-slot-path-error.d.ts +5 -15
- package/dist/transactions/transaction-slot-writer.d.ts +3 -13
- package/package.json +1 -1
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
import type { ValidationIssue } from "../operations/validation-code.js";
|
|
2
|
+
/** Every outcome code, as a runtime list. */
|
|
2
3
|
export declare const OPERATION_CODES: readonly ["A1000", "A1001", "A1002", "A1003", "A1004", "A1005", "A1006", "A1007", "A1008", "A1009", "A2000", "A2001", "A2002", "A2003", "A2004", "A2005", "A2006", "A2007", "A2008", "A2009", "A2010", "A2011", "A2012", "A2013", "A2014", "A3000", "A3001", "A3002", "A3003", "A3004", "A4000", "A4001", "A4002"];
|
|
4
|
+
/**
|
|
5
|
+
* Every outcome code: `A1xxx` success, `A2xxx` caller error, `A3xxx` internal
|
|
6
|
+
* failure, `A4xxx` authentication or permission denial.
|
|
7
|
+
*/
|
|
3
8
|
export type OperationCode = (typeof OPERATION_CODES)[number];
|
|
9
|
+
/** The success codes, `A1xxx`. */
|
|
4
10
|
export type OperationSuccessCode = Extract<OperationCode, `A1${string}`>;
|
|
11
|
+
/** Every outcome code that is not a success. */
|
|
5
12
|
export type OperationErrorCode = Exclude<OperationCode, OperationSuccessCode>;
|
|
6
13
|
/** Internal-failure family: nothing in the cause is caller-actionable. */
|
|
7
14
|
export type OperationInternalErrorCode = Extract<OperationErrorCode, `A3${string}`>;
|
|
15
|
+
/** Why a request failed: a message, and the validation issues when there are any. */
|
|
8
16
|
export type Cause = {
|
|
9
17
|
readonly message: string;
|
|
10
18
|
readonly issues?: readonly ValidationIssue[];
|
|
11
19
|
readonly operation?: number;
|
|
12
20
|
};
|
|
13
|
-
/**
|
|
14
|
-
* The canonical wire envelope (spec section 13): a flat `{ data, code,
|
|
15
|
-
* cause }` shape. `OperationResponse<T>` below is a discriminated union
|
|
16
|
-
* derived from this one shape — every arm is a differently-constrained
|
|
17
|
-
* projection of the same three fields, never an independent structure.
|
|
18
|
-
*/
|
|
21
|
+
/** The response envelope: `{ data, code, cause }`. */
|
|
19
22
|
type OperationResponseEnvelope<TData, TCode extends OperationCode, TCause extends Cause | null> = {
|
|
20
23
|
readonly data: TData;
|
|
21
24
|
readonly code: TCode;
|
|
@@ -23,33 +26,25 @@ type OperationResponseEnvelope<TData, TCode extends OperationCode, TCause extend
|
|
|
23
26
|
};
|
|
24
27
|
/** Success codes that carry response data (every success code but A1001). */
|
|
25
28
|
export type OperationSuccessDataCode = Exclude<OperationSuccessCode, "A1001">;
|
|
26
|
-
/**
|
|
29
|
+
/** A success with data: `cause` is `null`. */
|
|
27
30
|
export type OperationSuccessResponse<T> = OperationResponseEnvelope<T, OperationSuccessDataCode, null>;
|
|
28
|
-
/**
|
|
31
|
+
/** A success with no matching row (`A1001`): `data` and `cause` are `null`. */
|
|
29
32
|
export type OperationNoMatchResponse = OperationResponseEnvelope<null, "A1001", null>;
|
|
30
|
-
/**
|
|
33
|
+
/** A failure: `data` is `null` and `cause` says why. */
|
|
31
34
|
export type OperationFailureResponse = OperationResponseEnvelope<null, OperationErrorCode, Cause>;
|
|
32
|
-
export type OperationResponse<T = unknown> = OperationSuccessResponse<T> | OperationNoMatchResponse | OperationFailureResponse;
|
|
33
35
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* still yields a well-typed {@link OperationSuccessResponse}.
|
|
36
|
+
* What an operation answers: success with data, a no-match success (`A1001`),
|
|
37
|
+
* or a failure with a cause.
|
|
37
38
|
*/
|
|
39
|
+
export type OperationResponse<T = unknown> = OperationSuccessResponse<T> | OperationNoMatchResponse | OperationFailureResponse;
|
|
40
|
+
/** Builds a success response with data. */
|
|
38
41
|
export declare function operationSuccess<T>(data: T, code: OperationSuccessDataCode): OperationSuccessResponse<T>;
|
|
39
42
|
/** Builds the no-match success arm (A1001). */
|
|
40
43
|
export declare function operationNoMatch(): OperationNoMatchResponse;
|
|
41
|
-
/**
|
|
42
|
-
* Builds the failure arm. The only sanctioned way to construct one: a
|
|
43
|
-
* runtime-computed error `code` still yields a well-typed
|
|
44
|
-
* {@link OperationFailureResponse}.
|
|
45
|
-
*/
|
|
44
|
+
/** Builds a failure response. */
|
|
46
45
|
export declare function operationFailure(code: OperationErrorCode, cause: Cause): OperationFailureResponse;
|
|
47
46
|
/** The one generic internal-failure text; every A3000 carries it. */
|
|
48
47
|
export declare const INTERNAL_FAILURE_MESSAGE = "Internal framework error.";
|
|
49
|
-
/**
|
|
50
|
-
* The generic internal-failure envelope. Nothing about an internal failure is
|
|
51
|
-
* caller-actionable, so every A3000 the framework emits is this exact value -
|
|
52
|
-
* one constant rather than one restatement per boundary.
|
|
53
|
-
*/
|
|
48
|
+
/** The response every internal failure (`A3000`) answers with. */
|
|
54
49
|
export declare function internalFailure(): OperationFailureResponse;
|
|
55
50
|
export {};
|
|
@@ -16,8 +16,8 @@ export type OperationRuntimeDependencies<M extends AdapterModel> = {
|
|
|
16
16
|
readonly config: ResolvedFrameworkConfig<M>;
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
|
-
* What a validated operation's pipeline needs: everything except the root Adapter.
|
|
20
|
-
*
|
|
19
|
+
* What a validated operation's pipeline needs: everything except the root Adapter. Its
|
|
20
|
+
* single Adapter call goes through the executor passed beside it, so inside a
|
|
21
21
|
* transaction plan the root Adapter is unreachable by type.
|
|
22
22
|
*/
|
|
23
23
|
export type OperationPipelineDependencies<M extends AdapterModel> = Omit<OperationRuntimeDependencies<M>, "adapter"> & {
|
|
@@ -31,18 +31,18 @@ export type OperationPipelineDependencies<M extends AdapterModel> = Omit<Operati
|
|
|
31
31
|
* function — reports through the same channel.
|
|
32
32
|
*/
|
|
33
33
|
export type FrameworkOperationExecutor = (request: FrameworkOperationRequest, report: DiagnosticsReporter) => Promise<OperationResponse>;
|
|
34
|
-
/** Selects the Contract of the request's execution scope
|
|
34
|
+
/** Selects the Contract of the request's execution scope. */
|
|
35
35
|
export declare function activeContract(contracts: FrameworkContracts, request: FrameworkOperationRequest | FrameworkTransactionRequest): Contract;
|
|
36
36
|
/** Creates the transport-independent operation executor owned by core. */
|
|
37
37
|
export declare function createOperationRuntime<M extends AdapterModel>(dependencies: OperationRuntimeDependencies<M>): FrameworkOperationExecutor;
|
|
38
|
-
/** Validates the request-level protocol identity
|
|
38
|
+
/** Validates the request-level protocol identity. */
|
|
39
39
|
export declare function validateProtocolIdentity(contracts: FrameworkContracts, request: FrameworkOperationRequest | FrameworkTransactionRequest): OperationFailureResponse | undefined;
|
|
40
40
|
/**
|
|
41
|
-
* The stale-client check on one client protocol identity: the protocol version
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* (`@aventara/core/protocol`) call it too, so a stale client hears the same
|
|
45
|
-
*
|
|
41
|
+
* The stale-client check on one client protocol identity: the protocol version first
|
|
42
|
+
* (`A2006`), then the ClientContract hash (`A2005`). Exact match only. The one
|
|
43
|
+
* implementation — the protocol's decoders and absence answers
|
|
44
|
+
* (`@aventara/core/protocol`) call it too, so a stale client hears the same envelope
|
|
45
|
+
* whichever layer answers.
|
|
46
46
|
*/
|
|
47
47
|
export declare function protocolIdentityFailure(contracts: FrameworkContracts, protocol: ClientProtocolIdentity): OperationFailureResponse | undefined;
|
|
48
48
|
export type ValidatedOperationArguments = {
|
|
@@ -52,26 +52,11 @@ export type ValidatedOperationArguments = {
|
|
|
52
52
|
readonly ok: false;
|
|
53
53
|
readonly response: OperationFailureResponse;
|
|
54
54
|
};
|
|
55
|
-
/**
|
|
55
|
+
/** Validates one operation's arguments through the Framework Validation Layer. */
|
|
56
56
|
export declare function validateOperationRequest(contract: Contract, request: FrameworkOperationRequest, options?: OperationValidationOptions): ValidatedOperationArguments;
|
|
57
57
|
/**
|
|
58
58
|
* Everything after the Framework Validation Layer: the developer/runtime path
|
|
59
|
-
* wrapped in the post-validation error boundary. Validation failures never
|
|
60
|
-
* this function, so developer filters never see them.
|
|
61
|
-
*
|
|
62
|
-
* `executor` is the operation's single Adapter call site: standalone execution
|
|
63
|
-
* passes the Adapter itself, a transaction plan passes the transaction-scoped
|
|
64
|
-
* executor its Adapter callback received. Every call owns one AdapterBoundary, so
|
|
65
|
-
* A3001/A3000 origin stays classified per operation.
|
|
66
|
-
*
|
|
67
|
-
* The parameter types keep two values out of reach: `dependencies` carries no root
|
|
68
|
-
* Adapter, so the executor is the only Adapter this function can call, and
|
|
69
|
-
* `request` carries no `arguments`, so no stage can read the unvalidated view
|
|
70
|
-
* instead of `validatedArguments`.
|
|
71
|
-
*
|
|
72
|
-
* `argumentsPath` is the framework's own address for these arguments —
|
|
73
|
-
* `["arguments"]` standalone, `["operations", i, "args"]` inside a plan. The
|
|
74
|
-
* response boundary needs it to decide whether a thrower-supplied issue path
|
|
75
|
-
* denotes the caller's own arguments or is unvouched text.
|
|
59
|
+
* wrapped in the post-validation error boundary. Validation failures never
|
|
60
|
+
* reach this function, so developer filters never see them.
|
|
76
61
|
*/
|
|
77
62
|
export declare function executeValidatedOperation<M extends AdapterModel>(dependencies: OperationPipelineDependencies<M>, request: OperationExecutionRequest, contract: Contract, validatedArguments: unknown, argumentsPath: readonly (string | number)[], executor: AdapterOperationExecutor<M>, report: DiagnosticsReporter): Promise<OperationResponse>;
|
|
@@ -5,40 +5,13 @@ import type { Contract } from "../contracts/contract.js";
|
|
|
5
5
|
import type { OperationFamily } from "../operations/operation-identity.js";
|
|
6
6
|
import type { FrameworkError } from "./framework-error.js";
|
|
7
7
|
/**
|
|
8
|
-
* What a pipeline is told about the HTTP request a client-origin operation arrived
|
|
9
|
-
* on — a **deliberate exception** to core's transport-agnosticism.
|
|
10
|
-
*
|
|
11
|
-
* Core never parses HTTP to fill it. `@aventara/core/protocol`'s decoders do, with
|
|
12
|
-
* header names **lower-cased** and a repeated header's values joined with `", "`
|
|
13
|
-
* (RFC 9110 §5.3), so a pipeline reads one spelling. An application-scope request
|
|
14
|
-
* carries none (`ClientOperationRequest.transport` is optional).
|
|
8
|
+
* What a pipeline is told about the HTTP request a client-origin operation arrived on.
|
|
15
9
|
*/
|
|
16
10
|
export type PipelineTransportContext = {
|
|
17
11
|
readonly method: "POST";
|
|
18
12
|
readonly headers: Readonly<Record<string, string>>;
|
|
19
13
|
};
|
|
20
|
-
/**
|
|
21
|
-
* What a pipeline callback is told about the operation it is wrapping.
|
|
22
|
-
*
|
|
23
|
-
* `resource` reads its key set from the **AdapterModel**, not from a `Contract`:
|
|
24
|
-
* `Contract["resources"]` is an open `Record<string, …>`, so the `C extends
|
|
25
|
-
* Contract` parameter this type used to take could never name the Resources an
|
|
26
|
-
* author actually has — it erased to `string`. `M` can name them, and
|
|
27
|
-
* configuration cannot add Resources, so `M` is the whole answer.
|
|
28
|
-
*
|
|
29
|
-
* A `Cfg` parameter here would be referenced nowhere — `biome` flags it
|
|
30
|
-
* (`lint/correctness/noUnusedVariables`) and it would encode no semantic
|
|
31
|
-
* dependency. `FrameworkScopeConfig` already has the precedent one line above
|
|
32
|
-
* `pipelines`: `fields` takes `M` only.
|
|
33
|
-
*
|
|
34
|
-
* `contract` stays the erased {@link Contract} deliberately: a compiled Contract
|
|
35
|
-
* is passive semantic data whose result "stays untyped by design". Threading
|
|
36
|
-
* configuration into it would rebuild the authoring-config-to-compiled-contract
|
|
37
|
-
* bridge this work bypasses.
|
|
38
|
-
*
|
|
39
|
-
* Under the default `M` the key set degenerates to `string`, so an unannotated
|
|
40
|
-
* `PipelineContext` is what it was before.
|
|
41
|
-
*/
|
|
14
|
+
/** What a pipeline callback is told about the operation it is wrapping. */
|
|
42
15
|
export type PipelineContext<M extends AdapterModel = AdapterModel> = {
|
|
43
16
|
readonly contract: Contract;
|
|
44
17
|
readonly scope: RequestOrigin;
|
|
@@ -49,9 +22,21 @@ export type PipelineContext<M extends AdapterModel = AdapterModel> = {
|
|
|
49
22
|
readonly requestId: string;
|
|
50
23
|
readonly transport?: PipelineTransportContext;
|
|
51
24
|
};
|
|
25
|
+
/** Allows or denies an operation; returning `false` answers `A4001`. */
|
|
52
26
|
export type Guard<M extends AdapterModel = AdapterModel> = (context: PipelineContext<M>) => boolean | undefined | Promise<boolean | undefined>;
|
|
27
|
+
/**
|
|
28
|
+
* Transforms the arguments before the operation runs; returning `undefined`
|
|
29
|
+
* keeps them as they are.
|
|
30
|
+
*/
|
|
53
31
|
export type Pipe<M extends AdapterModel = AdapterModel> = (args: unknown, context: PipelineContext<M>) => unknown | Promise<unknown>;
|
|
32
|
+
/** Runs just before the operation executes. */
|
|
54
33
|
export type BeforeHook<M extends AdapterModel = AdapterModel> = (context: PipelineContext<M>) => void | Promise<void>;
|
|
34
|
+
/** Runs after the operation succeeds, with its result. */
|
|
55
35
|
export type AfterHook<M extends AdapterModel = AdapterModel> = (result: unknown, context: PipelineContext<M>) => void | Promise<void>;
|
|
36
|
+
/** Wraps the operation's execution; call `next()` to run it and get its result. */
|
|
56
37
|
export type Interceptor<M extends AdapterModel = AdapterModel> = (context: PipelineContext<M>, next: () => Promise<unknown>) => Promise<unknown>;
|
|
38
|
+
/**
|
|
39
|
+
* Turns a thrown error into a {@link FrameworkError} to answer with; returning
|
|
40
|
+
* `undefined` passes the error on.
|
|
41
|
+
*/
|
|
57
42
|
export type Filter<M extends AdapterModel = AdapterModel> = (error: unknown, context: PipelineContext<M>) => FrameworkError | undefined | Promise<FrameworkError | undefined>;
|
|
@@ -1,33 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Core's referential-action vocabulary, and the transitive cascade closure the
|
|
3
3
|
* transaction planner reads.
|
|
4
|
-
*
|
|
5
|
-
* The facts are an Adapter's: which relation edges exist, and what deleting a
|
|
6
|
-
* referenced row does to the rows that reference it. So the words here are
|
|
7
|
-
* Aventara's, stated as the effect on the referencing rows, and an Adapter
|
|
8
|
-
* translates its own provider's vocabulary into them.
|
|
9
|
-
*
|
|
10
|
-
* None of this enters a Contract. It is not part of the semantic model a Contract
|
|
11
|
-
* is compiled from, so it moves no Contract value and no hash; it is a planning
|
|
12
|
-
* fact, read once when the Framework is constructed.
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
|
-
* What deleting a referenced row does to the rows that reference it.
|
|
16
|
-
*
|
|
17
|
-
* - `cascade` — they are deleted with it, and their own referencing rows in turn
|
|
18
|
-
* (SQL `ON DELETE CASCADE`).
|
|
19
|
-
* - `restrict` — the delete is refused while they reference it (`RESTRICT`).
|
|
20
|
-
* - `noAction` — the delete is refused while they reference it (`NO ACTION`).
|
|
21
|
-
* Measured identical to `restrict` on both pilot engines: neither declares the
|
|
22
|
-
* constraint `DEFERRABLE`, so the end-of-statement check answers one delete
|
|
23
|
-
* exactly as `RESTRICT` does. It stays a distinct word because it is a distinct
|
|
24
|
-
* schema fact.
|
|
25
|
-
* - `setNull` — they are kept, the reference set to null (`SET NULL`).
|
|
26
|
-
* - `setDefault` — they are kept, the reference set to its column default (`SET
|
|
27
|
-
* DEFAULT`).
|
|
28
|
-
*
|
|
29
|
-
* Only `cascade` takes rows away, so only `cascade` is followed by the closure.
|
|
30
4
|
*/
|
|
5
|
+
/** What deleting a referenced row does to the rows that reference it. */
|
|
31
6
|
export type ReferentialDeleteEffect = "cascade" | "restrict" | "noAction" | "setNull" | "setDefault";
|
|
32
7
|
/**
|
|
33
8
|
* One relation edge whose referencing side holds the reference.
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The request id of one
|
|
3
|
-
* `ExecutionOptions.requestId` when it is a non-empty string, otherwise a
|
|
4
|
-
* one.
|
|
5
|
-
* as absent, because it names nothing a log line or a diagnostic could be
|
|
6
|
-
* correlated by.
|
|
7
|
-
*
|
|
8
|
-
* Read as `unknown` because the façades are total for untyped callers too: a
|
|
9
|
-
* value the type refuses — a non-string id, a non-object options argument, a
|
|
10
|
-
* getter that throws — is ignored rather than carried into a `string` slot or
|
|
11
|
-
* thrown out of a call that must resolve.
|
|
2
|
+
* The request id of one call or transaction run: the caller's
|
|
3
|
+
* `ExecutionOptions.requestId` when it is a non-empty string, otherwise a new
|
|
4
|
+
* one. Any other value is ignored.
|
|
12
5
|
*/
|
|
13
6
|
export declare function requestIdOf(options: unknown): string;
|
|
@@ -21,12 +21,12 @@ export type ScalarValueNormalizationResult = {
|
|
|
21
21
|
type Path = readonly (string | number)[];
|
|
22
22
|
/**
|
|
23
23
|
* The one discriminant between an argument OBJECT and a VALUE wherever a position
|
|
24
|
-
* admits both — a filter position above all: a **plain** record is an operator
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
24
|
+
* admits both — a filter position above all: a **plain** record is an operator object,
|
|
25
|
+
* and anything else — a `Date`, a core `Decimal`, a `Uint8Array` — is a value, which
|
|
26
|
+
* equality shorthand then holds to the field's scalar. The validator (`operation-
|
|
27
|
+
* validator-core.ts`) reads a filter position through this same answer, and an
|
|
28
|
+
* adapter's filter translation is expected to, so a position cannot be operators to
|
|
29
|
+
* one reader and a value to another.
|
|
30
30
|
*/
|
|
31
31
|
export declare function isPlainRecord(value: unknown): value is Readonly<Record<string, unknown>>;
|
|
32
32
|
/**
|
|
@@ -36,12 +36,12 @@ export declare function isPlainRecord(value: unknown): value is Readonly<Record<
|
|
|
36
36
|
export declare function normalizeScalarFieldValue(contract: Contract, field: ScalarField<Contract>, value: unknown, scope: RequestOrigin | "runtime", path: Path): ScalarValueNormalizationResult;
|
|
37
37
|
/**
|
|
38
38
|
* Copies one validated runtime value of a scalar field into a value the framework
|
|
39
|
-
* owns, per scalar codec: `datetime` → a new `Date`, `bytes` → a sliced
|
|
40
|
-
* `
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
39
|
+
* owns, per scalar codec: `datetime` → a new `Date`, `bytes` → a sliced `Uint8Array`,
|
|
40
|
+
* `json` → a structured deep copy, and a list → a new array of copied items. `decimal`
|
|
41
|
+
* keeps its identity, and strings, numbers, booleans, bigints, enum members and `null`
|
|
42
|
+
* are immutable and returned unchanged. {@link SCALAR_ATOM_COPIERS} is exhaustive over
|
|
43
|
+
* {@link BuiltInScalar}, so a new codec cannot reach this function without declaring
|
|
44
|
+
* its copy.
|
|
45
45
|
*/
|
|
46
46
|
export declare function copyScalarFieldValue(field: ScalarField<Contract>, value: unknown): unknown;
|
|
47
47
|
/**
|
|
@@ -3,6 +3,7 @@ import type { ExecutionOptions } from "../runtime/execution-options.js";
|
|
|
3
3
|
import type { OperationFailureResponse } from "../runtime/operation-response.js";
|
|
4
4
|
import type { TransactionReference } from "./transaction-reference.js";
|
|
5
5
|
import type { TransactionCommittedResponse } from "./transaction-response.js";
|
|
6
|
+
/** An operation fingerprint: `fp1:` and a hash of the operation and its arguments. */
|
|
6
7
|
export type OperationFingerprint = `fp1:${string}`;
|
|
7
8
|
/** One serializable transaction-plan operation node. */
|
|
8
9
|
export type DeferredOperation = OperationIdentity & {
|
|
@@ -10,36 +11,28 @@ export type DeferredOperation = OperationIdentity & {
|
|
|
10
11
|
readonly args: unknown;
|
|
11
12
|
readonly fingerprint: OperationFingerprint;
|
|
12
13
|
};
|
|
14
|
+
/** A transaction plan: its operations, in the order they run. */
|
|
13
15
|
export type TransactionPlan = {
|
|
14
16
|
readonly operations: readonly DeferredOperation[];
|
|
15
17
|
};
|
|
16
18
|
declare const OPERATION_RESULT: unique symbol;
|
|
17
19
|
declare const OPERATION_HANDLE: unique symbol;
|
|
18
|
-
/**
|
|
19
|
-
* Standard-library shapes that are objects but never a projected result row.
|
|
20
|
-
* `ArrayBufferView` is TypeScript's shared structural base for every typed array
|
|
21
|
-
* and `DataView`, so no constructor is enumerated and the declaration stays
|
|
22
|
-
* portable ES2022 with no runtime dependency.
|
|
23
|
-
*/
|
|
20
|
+
/** Standard-library shapes that are objects but never a projected result row. */
|
|
24
21
|
export type BuiltinNonRow = Date | RegExp | ReadonlyMap<unknown, unknown> | ReadonlySet<unknown> | PromiseLike<unknown> | ArrayBufferView;
|
|
25
22
|
/**
|
|
26
|
-
* The single row behind a
|
|
27
|
-
*
|
|
28
|
-
* `BuiltinNonRow` shapes, non-objects, and objects without a string key are
|
|
29
|
-
* excluded without any `instanceof` test or `Record<string, unknown>` gate,
|
|
30
|
-
* which ordinary interfaces would fail.
|
|
23
|
+
* The single row behind a result type, or `never` when the result is not one
|
|
24
|
+
* referenceable row.
|
|
31
25
|
*/
|
|
32
26
|
export type SingleRowResult<T> = NonNullable<T> extends readonly unknown[] ? never : NonNullable<T> extends (...args: never[]) => unknown ? never : NonNullable<T> extends BuiltinNonRow ? never : NonNullable<T> extends object ? Extract<keyof NonNullable<T>, string> extends never ? never : NonNullable<T> : never;
|
|
33
27
|
/** The field names a result row can be referenced by. */
|
|
34
28
|
export type ReferenceableField<T> = Extract<keyof SingleRowResult<T>, string>;
|
|
29
|
+
/** Builds a `$ref` to one field of this handle's row, typed as that field. */
|
|
35
30
|
export type ReferenceBuilder<T> = <F extends ReferenceableField<T>>(field: F) => TransactionReference<SingleRowResult<T>[F]>;
|
|
36
31
|
/** Contributes `$ref` only where the result is a referenceable single row. */
|
|
37
32
|
export type OperationReferenceSurface<T> = [SingleRowResult<T>] extends [never] ? {} : {
|
|
38
33
|
readonly $ref: ReferenceBuilder<T>;
|
|
39
34
|
};
|
|
40
|
-
/**
|
|
41
|
-
* An opaque deferred-operation handle.
|
|
42
|
-
*/
|
|
35
|
+
/** An opaque deferred-operation handle. */
|
|
43
36
|
export type Operation<T> = {
|
|
44
37
|
readonly [OPERATION_HANDLE]: true;
|
|
45
38
|
readonly [OPERATION_RESULT]?: T;
|
|
@@ -49,13 +42,9 @@ export type TransactionResults<Ops extends readonly Operation<unknown>[]> = {
|
|
|
49
42
|
readonly [I in keyof Ops]: Ops[I] extends Operation<infer R> ? R : never;
|
|
50
43
|
};
|
|
51
44
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* plan order, or the failure response. Never the bare result tuple.
|
|
56
|
-
*
|
|
57
|
-
* The second argument is the run's `ExecutionOptions`: its `requestId` is every
|
|
58
|
-
* step's, under either origin. A handle takes none.
|
|
45
|
+
* `framework.transaction`'s type. It infers the handle tuple without `as const`
|
|
46
|
+
* and resolves the committed response (`A1009`) with each handle's result in
|
|
47
|
+
* plan order, or the failure response.
|
|
59
48
|
*/
|
|
60
49
|
export type TransactionRunner = <const Ops extends readonly Operation<unknown>[]>(operations: Ops, options?: ExecutionOptions) => Promise<TransactionCommittedResponse<TransactionResults<Ops>> | OperationFailureResponse>;
|
|
61
50
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Contract } from "../contracts/contract.js";
|
|
2
2
|
import type { OperationIdentity } from "../operations/operation-identity.js";
|
|
3
3
|
import type { SemanticOperationArguments } from "../operations/operation-validator.js";
|
|
4
|
+
/** Encodes validated application arguments into the wire scalar form. */
|
|
4
5
|
export declare function encodeOperationArgumentsForWire(contract: Contract, operation: OperationIdentity & {
|
|
5
6
|
readonly resource: string;
|
|
6
7
|
}, args: SemanticOperationArguments): unknown;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { OperationFingerprint } from "./deferred-operation.js";
|
|
2
|
+
/** What an operation fingerprint is computed from. */
|
|
2
3
|
export type OperationFingerprintNode = {
|
|
3
4
|
readonly resource: string;
|
|
4
5
|
readonly family: string;
|
|
5
6
|
readonly variant: string;
|
|
6
7
|
readonly args: unknown;
|
|
7
8
|
};
|
|
9
|
+
/** Whether `value` is an operation fingerprint (`fp1:…`). */
|
|
8
10
|
export declare function isOperationFingerprint(value: unknown): value is OperationFingerprint;
|
|
9
|
-
/** Computes
|
|
11
|
+
/** Computes an operation's fingerprint from its wire-form arguments. */
|
|
10
12
|
export declare function computeOperationFingerprint(node: OperationFingerprintNode): Promise<OperationFingerprint>;
|
|
@@ -28,10 +28,8 @@ export type TransactionOperationEntryInspection = {
|
|
|
28
28
|
readonly issue: ValidationIssue;
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* length and per-index inspector rather than `operations.length` or
|
|
34
|
-
* `operations[index]` directly.
|
|
31
|
+
* The caller uses the returned length and per-index inspector rather than
|
|
32
|
+
* `operations.length` or `operations[index]` directly.
|
|
35
33
|
*/
|
|
36
34
|
export declare function inspectTransactionOperations(value: unknown): TransactionOperationsInspection;
|
|
37
35
|
/** Reads one operations entry through its own data descriptor. */
|
|
@@ -1,22 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The ways an Adapter transaction can break the
|
|
3
|
-
*
|
|
4
|
-
* that tells them apart, so it is structured data rather than message text.
|
|
5
|
-
*
|
|
6
|
-
* - `transaction-unavailable`: the Adapter's `transaction` function is gone at
|
|
7
|
-
* execution time.
|
|
8
|
-
* - `resolved-after-abort`: the Adapter resolved although the framework threw its
|
|
9
|
-
* rollback request.
|
|
10
|
-
* - `resolved-incomplete`: the Adapter resolved before every plan operation ran,
|
|
11
|
-
* so no committed `A1009` array exists.
|
|
12
|
-
* - `foreign-abort`: the Adapter rejected with the framework's rollback request
|
|
13
|
-
* although this plan never made one.
|
|
2
|
+
* The ways an Adapter transaction can break the framework's transaction
|
|
3
|
+
* contract. Each is answered `A3002`.
|
|
14
4
|
*/
|
|
15
5
|
export type TransactionIntegrityViolation = "transaction-unavailable" | "resolved-after-abort" | "resolved-incomplete" | "foreign-abort";
|
|
16
6
|
/**
|
|
17
|
-
*
|
|
18
|
-
* transaction
|
|
19
|
-
* is always the constant `A3002` envelope.
|
|
7
|
+
* Reported to diagnostics when an Adapter transaction breaks the framework's
|
|
8
|
+
* transaction contract. The caller receives `A3002`.
|
|
20
9
|
*/
|
|
21
10
|
export declare class TransactionIntegrityError extends Error {
|
|
22
11
|
readonly violation: TransactionIntegrityViolation;
|
|
@@ -5,6 +5,7 @@ import type { ClientProtocolIdentity } from "../runtime/operation-request.js";
|
|
|
5
5
|
import type { OperationFailureResponse } from "../runtime/operation-response.js";
|
|
6
6
|
import type { Operation, OperationFingerprint } from "./deferred-operation.js";
|
|
7
7
|
import type { TransactionOperationOrigin } from "./transaction-request.js";
|
|
8
|
+
/** One wire node, exactly as the transaction runtime receives it. */
|
|
8
9
|
type WireOperationNode = {
|
|
9
10
|
readonly resource: string;
|
|
10
11
|
readonly family: string;
|
|
@@ -62,26 +62,12 @@ export type TransactionPlanValidationResult = {
|
|
|
62
62
|
readonly response: OperationFailureResponse;
|
|
63
63
|
};
|
|
64
64
|
/**
|
|
65
|
-
* The refusal of a plan on a Contract without transaction plans (`A2002`, one
|
|
66
|
-
*
|
|
67
|
-
*
|
|
65
|
+
* The refusal of a plan on a Contract without transaction plans (`A2002`, one `V1006`
|
|
66
|
+
* at `["operations"]`). The one spelling — the protocol's absence answer for
|
|
67
|
+
* `/_transactions` is this envelope too.
|
|
68
68
|
*/
|
|
69
69
|
export declare function transactionsUnavailableFailure(): OperationFailureResponse;
|
|
70
70
|
/**
|
|
71
71
|
* Whole-plan Framework Validation Layer for transaction structure and identity.
|
|
72
|
-
*
|
|
73
|
-
* `origins` states each operation's origin by index, for a plan whose steps do
|
|
74
|
-
* not all share the request's (the typed runner's mixed plans). Absent — the
|
|
75
|
-
* untyped seam — every operation takes the request's own origin. Each operation
|
|
76
|
-
* is validated against its own origin's Contract.
|
|
77
|
-
*
|
|
78
|
-
* A plan is also refused when a step depends on rows an earlier step's cascade
|
|
79
|
-
* removed (`V1019`, plan-scoped: a lone operation that cascades is not a
|
|
80
|
-
* defect, since nothing follows it). The analysis runs over every step whatever
|
|
81
|
-
* its origin — one plan runs in one Adapter transaction, so a client step's
|
|
82
|
-
* read sees an application step's cascade — and reads each step against its own
|
|
83
|
-
* origin's Contract. It is a planning answer, given before any provider statement
|
|
84
|
-
* is issued, and as conservative as the facts it has: a plan cannot know which
|
|
85
|
-
* rows a delete will match, so it refuses at the granularity of a Resource.
|
|
86
72
|
*/
|
|
87
73
|
export declare function validateTransactionPlan<M extends AdapterModel>(dependencies: TransactionPlanDependencies<M>, request: FrameworkTransactionRequest, origins?: readonly TransactionOperationOrigin[]): Promise<TransactionPlanValidationResult>;
|
|
@@ -10,17 +10,14 @@ export type ResolvedTransactionArguments = {
|
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
12
|
* Substitutes every validated `$ref` placeholder of one operation from the results
|
|
13
|
-
* ledger: each earlier operation's final `data`, exactly the value at its index in
|
|
14
|
-
*
|
|
15
|
-
* projected path and type, and none of that is re-run here; only what can change
|
|
16
|
-
*
|
|
17
|
-
* referenced own key, resolves to no value at the full reference path. The result
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* Reading final data runs developer-produced accessors; a throw from here is the
|
|
24
|
-
* framework's own per-operation failure, classified by the caller.
|
|
13
|
+
* ledger: each earlier operation's final `data`, exactly the value at its index in the
|
|
14
|
+
* `A1009` results array. Validation already proved index, source fingerprint,
|
|
15
|
+
* projected path and type, and none of that is re-run here; only what can change at
|
|
16
|
+
* runtime is checked. A `null` or non-record source, or a source lacking the
|
|
17
|
+
* referenced own key, resolves to no value at the full reference path. The result is a
|
|
18
|
+
* fresh argument graph: only the ancestors of substituted slots are cloned, so the
|
|
19
|
+
* validated plan is never mutated, and every substituted value is a framework-owned
|
|
20
|
+
* copy of the source's value, so a dependent operation mutating its arguments cannot
|
|
21
|
+
* alter the source's committed result.
|
|
25
22
|
*/
|
|
26
23
|
export declare function resolveTransactionReferences(operation: ValidatedTransactionOperation, results: readonly unknown[]): ResolvedTransactionArguments;
|
|
@@ -5,9 +5,14 @@ import type { CreateDataInput, OperationArgumentsFor, ResourceKey, UpdateDataInp
|
|
|
5
5
|
import type { OperationIdentity } from "../operations/operation-identity.js";
|
|
6
6
|
import type { OperationFingerprint } from "./deferred-operation.js";
|
|
7
7
|
declare const REFERENCE_VALUE: unique symbol;
|
|
8
|
+
/** Any object with a `$ref` key, before it is validated as a reference. */
|
|
8
9
|
export type TransactionReferenceCandidate = {
|
|
9
10
|
readonly $ref: unknown;
|
|
10
11
|
} & Readonly<Record<string, unknown>>;
|
|
12
|
+
/**
|
|
13
|
+
* A reference to a field of an earlier operation's result in the same
|
|
14
|
+
* transaction plan: `{ $ref: { operation, fingerprint, path } }`.
|
|
15
|
+
*/
|
|
11
16
|
export type TransactionReference<Value = unknown> = {
|
|
12
17
|
readonly $ref: {
|
|
13
18
|
readonly operation: number;
|
|
@@ -16,6 +21,7 @@ export type TransactionReference<Value = unknown> = {
|
|
|
16
21
|
};
|
|
17
22
|
readonly [REFERENCE_VALUE]?: Value;
|
|
18
23
|
};
|
|
24
|
+
/** Whether a value is an ordinary value or a `$ref` candidate. */
|
|
19
25
|
export type TransactionReferenceCandidateRoute = {
|
|
20
26
|
readonly kind: "ordinary";
|
|
21
27
|
} | {
|
|
@@ -27,15 +33,11 @@ export type TransactionReferenceCandidateRoute = {
|
|
|
27
33
|
readonly kind: "reflection-failure";
|
|
28
34
|
readonly candidate: unknown;
|
|
29
35
|
};
|
|
30
|
-
/**
|
|
31
|
-
* Total descriptor-only routing for a scalar value at a transaction-reference
|
|
32
|
-
* position.
|
|
33
|
-
*/
|
|
36
|
+
/** Whether a scalar value at a reference position is an ordinary value or a `$ref` candidate. */
|
|
34
37
|
export declare function routeTransactionReferenceCandidate(value: unknown): TransactionReferenceCandidateRoute;
|
|
38
|
+
/** Whether `value` is an object with a `$ref` key; it is not validated here. */
|
|
35
39
|
export declare function isTransactionReferenceCandidate(value: unknown): value is TransactionReferenceCandidate;
|
|
36
|
-
/**
|
|
37
|
-
* Narrows a structurally complete `$ref` object.
|
|
38
|
-
*/
|
|
40
|
+
/** Whether `value` is a complete `$ref` object. */
|
|
39
41
|
export declare function isTransactionReferenceObject(value: unknown): value is TransactionReference;
|
|
40
42
|
/**
|
|
41
43
|
* A scalar mutation value inside a plan: the value itself, or a reference to an
|
|
@@ -43,42 +45,35 @@ export declare function isTransactionReferenceObject(value: unknown): value is T
|
|
|
43
45
|
*/
|
|
44
46
|
export type TransactionScalarValue<Value> = Value | TransactionReference<Value>;
|
|
45
47
|
/**
|
|
46
|
-
* A
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* compatibility compares Contract field types, never their forms. Unstated, both
|
|
50
|
-
* are the same map and this is {@link TransactionScalarValue}.
|
|
48
|
+
* A scalar value inside a plan, or a `$ref` to a field of the same type. A
|
|
49
|
+
* reference is typed by the application form of its source field, because a
|
|
50
|
+
* source's final data is always in application forms.
|
|
51
51
|
*/
|
|
52
52
|
type ReferenceableValue<Value, ReferenceValue> = Value | TransactionReference<ReferenceValue>;
|
|
53
|
+
/** `Data`'s member `Key`, or `never` when it has none. */
|
|
53
54
|
type MemberOf<Data, Key> = Key extends keyof Data ? Data[Key] : never;
|
|
54
55
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
56
|
+
* Create data whose top-level scalar fields may hold a `$ref`, under stated
|
|
57
|
+
* scalar forms.
|
|
57
58
|
*/
|
|
58
59
|
export type ReferenceableCreateData<C extends Contract, K extends ResourceKey<C>, Scope extends WriteScope, Forms extends ScalarForms, ReferenceForms extends ScalarForms> = Readonly<{
|
|
59
60
|
[F in keyof CreateDataInput<C, K, Scope, Forms>]: F extends WritableRelationKey<C, K, "create", Scope> ? CreateDataInput<C, K, Scope, Forms>[F] : ReferenceableValue<CreateDataInput<C, K, Scope, Forms>[F], MemberOf<CreateDataInput<C, K, Scope, ReferenceForms>, F>>;
|
|
60
61
|
}>;
|
|
62
|
+
/**
|
|
63
|
+
* Update data whose top-level scalar fields may hold a `$ref`, under stated
|
|
64
|
+
* scalar forms.
|
|
65
|
+
*/
|
|
61
66
|
export type ReferenceableUpdateData<C extends Contract, K extends ResourceKey<C>, Scope extends WriteScope, Forms extends ScalarForms, ReferenceForms extends ScalarForms> = Readonly<{
|
|
62
67
|
[F in keyof UpdateDataInput<C, K, Scope, Forms>]: F extends WritableRelationKey<C, K, "update", Scope> ? UpdateDataInput<C, K, Scope, Forms>[F] : ReferenceableValue<UpdateDataInput<C, K, Scope, Forms>[F], MemberOf<UpdateDataInput<C, K, Scope, ReferenceForms>, F>>;
|
|
63
68
|
}>;
|
|
64
69
|
/**
|
|
65
|
-
* Only top-level scalar fields accept a `$ref`; a relation field keeps its
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
* The position is the standalone surface's, read the same way: both surfaces read
|
|
69
|
-
* one capability value and differ only in where they bind it, so a plan's flat
|
|
70
|
-
* bulk write refuses a nested-only relation exactly as `create.many` does outside
|
|
71
|
-
* a plan. The default is the unrestricted position, as on `CreateDataInput`.
|
|
70
|
+
* Only top-level scalar fields accept a `$ref`; a relation field keeps its relation
|
|
71
|
+
* mutation action, where a `$ref` is an ordinary invalid value.
|
|
72
72
|
*/
|
|
73
73
|
export type TransactionCreateDataInput<C extends Contract, K extends ResourceKey<C>, Scope extends WriteScope = "nested"> = ReferenceableCreateData<C, K, Scope, ScalarForms, ScalarForms>;
|
|
74
|
-
/**
|
|
75
|
-
* See {@link TransactionCreateDataInput}.
|
|
76
|
-
*/
|
|
74
|
+
/** See {@link TransactionCreateDataInput}. */
|
|
77
75
|
export type TransactionUpdateDataInput<C extends Contract, K extends ResourceKey<C>, Scope extends WriteScope = "nested"> = ReferenceableUpdateData<C, K, Scope, ScalarForms, ScalarForms>;
|
|
78
|
-
/**
|
|
79
|
-
* The typed builders read it with both forms stated; the exported {@link
|
|
80
|
-
* TransactionOperationArgumentsFor} is it with neither.
|
|
81
|
-
*/
|
|
76
|
+
/** Operation arguments inside a transaction plan, under stated scalar forms. */
|
|
82
77
|
export type ReferenceableArgumentsFor<C extends Contract, K extends ResourceKey<C>, I extends OperationIdentity, Forms extends ScalarForms, ReferenceForms extends ScalarForms> = I extends {
|
|
83
78
|
family: "create";
|
|
84
79
|
variant: "one";
|