@aventara/core 1.0.0-rc.0 → 1.0.0-rc.10
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 +2068 -1
- package/ERRORS.md +142 -0
- package/README.md +485 -60
- package/dist/adapters/adapter-discovery-diagnostic.d.ts +4 -4
- package/dist/adapters/adapter-discovery-diagnostic.guidance.d.ts +6 -0
- package/dist/adapters/adapter-discovery-diagnostic.guidance.js +7 -0
- package/dist/adapters/adapter-field.d.ts +33 -11
- package/dist/adapters/adapter-identifier.d.ts +15 -6
- package/dist/adapters/adapter-identifier.js +6 -1
- package/dist/adapters/adapter-model.d.ts +18 -9
- package/dist/adapters/adapter-operation-executor.interface.d.ts +4 -4
- package/dist/adapters/adapter-operation.d.ts +21 -6
- package/dist/adapters/adapter-resource.d.ts +23 -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 +59 -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 +9 -8
- 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-diagnostic.guidance.d.ts +6 -0
- package/dist/compiler/contract-compiler-diagnostic.guidance.js +97 -0
- package/dist/compiler/contract.compiler.d.ts +23 -17
- package/dist/compiler/contract.compiler.js +753 -443
- 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/compiler/managed-elsewhere.projector.d.ts +52 -0
- package/dist/compiler/managed-elsewhere.projector.js +179 -0
- package/dist/compiler/managed-elsewhere.validator.d.ts +9 -0
- package/dist/compiler/managed-elsewhere.validator.js +74 -0
- package/dist/config/any-framework-config.d.ts +19 -12
- package/dist/config/computed-fields.d.ts +62 -0
- package/dist/config/computed-fields.js +73 -0
- package/dist/config/config-diagnostic.d.ts +11 -4
- package/dist/config/config-diagnostic.guidance.d.ts +6 -0
- package/dist/config/config-diagnostic.guidance.js +32 -0
- package/dist/config/config-layer.d.ts +15 -6
- package/dist/config/config.resolver.d.ts +98 -31
- package/dist/config/config.resolver.js +173 -44
- package/dist/config/config.validator.d.ts +7 -7
- package/dist/config/config.validator.js +792 -69
- package/dist/config/define-resource.d.ts +53 -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 +4 -3
- package/dist/config/exact-framework-config.d.ts +325 -0
- package/dist/config/field-compute.resolver.d.ts +21 -0
- package/dist/config/field-compute.resolver.js +123 -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 +148 -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 +127 -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/access-route.rules.d.ts +10 -0
- package/dist/contracts/access-route.rules.js +45 -0
- package/dist/contracts/capability.d.ts +37 -12
- package/dist/contracts/capability.js +20 -0
- package/dist/contracts/client-contract-structure.validator.d.ts +621 -114
- package/dist/contracts/client-contract-structure.validator.js +189 -10
- package/dist/contracts/contract-access.d.ts +29 -0
- package/dist/contracts/contract-access.js +1 -0
- package/dist/contracts/contract-canonicalizer.d.ts +27 -3
- package/dist/contracts/contract-canonicalizer.js +168 -29
- package/dist/contracts/contract-hash.d.ts +11 -7
- package/dist/contracts/contract-hash.js +4 -3
- 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 +51 -17
- 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 +109 -42
- package/dist/contracts/identifier.d.ts +4 -4
- package/dist/contracts/json-schema.projector.d.ts +11 -0
- package/dist/contracts/json-schema.projector.js +78 -0
- 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 +17 -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/access-facade.d.ts +116 -0
- package/dist/framework/access-facade.js +120 -0
- package/dist/framework/contract-view.d.ts +315 -145
- package/dist/framework/framework-construction.error.d.ts +21 -11
- package/dist/framework/framework-construction.error.js +20 -4
- package/dist/framework/framework.d.ts +71 -26
- package/dist/framework/framework.factory.d.ts +8 -6
- package/dist/framework/framework.factory.js +150 -38
- package/dist/framework/operation-facade.d.ts +192 -54
- package/dist/framework/operation-facade.js +10 -1
- package/dist/index.d.ts +67 -50
- package/dist/index.js +7 -6
- package/dist/internal.d.ts +20 -10
- package/dist/internal.js +9 -1
- package/dist/operations/database-refusal.d.ts +51 -0
- package/dist/operations/database-refusal.js +45 -0
- package/dist/operations/operation-arguments.d.ts +381 -228
- package/dist/operations/operation-call.d.ts +31 -28
- package/dist/operations/operation-identity.d.ts +10 -10
- package/dist/operations/operation-result.d.ts +25 -23
- package/dist/operations/operation-validator-core.d.ts +6 -6
- package/dist/operations/operation-validator-core.js +172 -38
- package/dist/operations/operation-validator.d.ts +10 -10
- package/dist/operations/projection-scope.resolver.d.ts +6 -6
- package/dist/operations/structural-limits.walker.d.ts +7 -7
- package/dist/operations/structural-limits.walker.js +145 -0
- package/dist/operations/validation-code.d.ts +11 -6
- package/dist/operations/validation-code.guidance.d.ts +6 -0
- package/dist/operations/validation-code.guidance.js +90 -0
- package/dist/operations/validation-code.js +4 -0
- package/dist/operations/write-scope.resolver.d.ts +10 -6
- package/dist/operations/write-scope.resolver.js +2 -0
- package/dist/policy/access-provider.interface.d.ts +91 -0
- package/dist/policy/access-provider.interface.js +1 -0
- package/dist/policy/access-provider.registry.d.ts +17 -0
- package/dist/policy/access-provider.registry.js +15 -0
- package/dist/policy/access-question.d.ts +20 -0
- package/dist/policy/access-question.js +1 -0
- package/dist/policy/access-question.registry.d.ts +5 -0
- package/dist/policy/access-question.registry.js +19 -0
- package/dist/policy/access-question.runtime.d.ts +36 -0
- package/dist/policy/access-question.runtime.js +297 -0
- package/dist/policy/access-verb.table.d.ts +56 -0
- package/dist/policy/access-verb.table.js +21 -0
- package/dist/policy/access-verbs.d.ts +46 -0
- package/dist/policy/access-verbs.js +1 -0
- package/dist/policy/policy-admission.d.ts +20 -0
- package/dist/policy/policy-admission.js +409 -0
- package/dist/policy/policy-after-update.runtime.d.ts +79 -0
- package/dist/policy/policy-after-update.runtime.js +208 -0
- package/dist/policy/policy-condition.d.ts +15 -0
- package/dist/policy/policy-condition.js +36 -0
- package/dist/policy/policy-engine.d.ts +205 -0
- package/dist/policy/policy-engine.js +1 -0
- package/dist/policy/policy-named-rows.d.ts +18 -0
- package/dist/policy/policy-named-rows.js +51 -0
- package/dist/policy/policy-nested-write.runtime.d.ts +44 -0
- package/dist/policy/policy-nested-write.runtime.js +545 -0
- package/dist/policy/policy-read.runtime.d.ts +81 -0
- package/dist/policy/policy-read.runtime.js +503 -0
- package/dist/policy/policy-reference-write.runtime.d.ts +51 -0
- package/dist/policy/policy-reference-write.runtime.js +345 -0
- package/dist/policy/policy-request.d.ts +41 -0
- package/dist/policy/policy-request.js +63 -0
- package/dist/policy/policy-session.d.ts +106 -0
- package/dist/policy/policy-session.js +295 -0
- package/dist/policy/policy-startup.validator.d.ts +10 -0
- package/dist/policy/policy-startup.validator.js +112 -0
- package/dist/policy/policy-write.runtime.d.ts +39 -0
- package/dist/policy/policy-write.runtime.js +532 -0
- package/dist/prebuilt/core-version.generated.d.ts +2 -0
- package/dist/prebuilt/core-version.generated.js +1 -0
- package/dist/prebuilt/prebuilt-changes.d.ts +29 -0
- package/dist/prebuilt/prebuilt-changes.js +65 -0
- package/dist/prebuilt/prebuilt-contracts.d.ts +40 -0
- package/dist/prebuilt/prebuilt-contracts.emitter.d.ts +16 -0
- package/dist/prebuilt/prebuilt-contracts.emitter.js +50 -0
- package/dist/prebuilt/prebuilt-contracts.js +1 -0
- package/dist/prebuilt/prebuilt-contracts.loader.d.ts +19 -0
- package/dist/prebuilt/prebuilt-contracts.loader.js +77 -0
- package/dist/prebuilt/prebuilt-inputs.fingerprint.d.ts +16 -0
- package/dist/prebuilt/prebuilt-inputs.fingerprint.js +229 -0
- package/dist/protocol/absent-route.responder.d.ts +17 -34
- package/dist/protocol/absent-route.responder.js +53 -20
- package/dist/protocol/contract-document.responder.d.ts +5 -4
- package/dist/protocol/contract-document.responder.js +2 -2
- package/dist/protocol/http-request.decoder.d.ts +33 -13
- package/dist/protocol/http-request.decoder.js +34 -11
- package/dist/protocol/http-request.reader.d.ts +9 -6
- package/dist/protocol/http-request.reader.js +1 -0
- 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-headers.d.ts +3 -3
- package/dist/protocol/protocol-surface.d.ts +10 -5
- package/dist/protocol/protocol-surface.js +7 -0
- package/dist/protocol/protocol.binder.d.ts +66 -28
- package/dist/protocol/protocol.binder.js +16 -10
- package/dist/protocol/protocol.handler.d.ts +34 -14
- package/dist/protocol/protocol.handler.js +122 -18
- 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 +22 -7
- package/dist/runtime/caller-data.copier.js +30 -17
- package/dist/runtime/caller-data.door.d.ts +18 -11
- package/dist/runtime/caller-data.door.js +6 -4
- package/dist/runtime/computed-read-runtime.d.ts +12 -6
- package/dist/runtime/computed-read-runtime.js +271 -71
- package/dist/runtime/computed-value.error.d.ts +7 -6
- package/dist/runtime/computed-value.error.js +5 -4
- package/dist/runtime/context-executor.runtime.d.ts +60 -0
- package/dist/runtime/context-executor.runtime.js +277 -0
- package/dist/runtime/core-class.brand.d.ts +10 -0
- package/dist/runtime/core-class.brand.js +21 -0
- package/dist/runtime/create-requirement.d.ts +34 -79
- package/dist/runtime/create-requirement.js +205 -74
- package/dist/runtime/decimal.d.ts +16 -2
- package/dist/runtime/decimal.js +22 -1
- package/dist/runtime/diagnostics-reporter.d.ts +91 -30
- package/dist/runtime/diagnostics-reporter.js +37 -1
- package/dist/runtime/error-boundary.d.ts +73 -9
- package/dist/runtime/error-boundary.js +57 -19
- package/dist/runtime/error-guidance.d.ts +12 -0
- package/dist/runtime/error-guidance.js +1 -0
- package/dist/runtime/error.catalog.d.ts +49 -0
- package/dist/runtime/error.catalog.js +49 -0
- package/dist/runtime/execution-options.d.ts +18 -2
- package/dist/runtime/field-check.evaluator.d.ts +27 -0
- package/dist/runtime/field-check.evaluator.js +521 -0
- package/dist/runtime/field-compute.d.ts +65 -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 +37 -0
- package/dist/runtime/field-stage.runtime.js +147 -0
- package/dist/runtime/field-validator.runtime.d.ts +29 -0
- package/dist/runtime/field-validator.runtime.js +126 -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 +32 -2
- package/dist/runtime/framework-warning.emitter.d.ts +6 -0
- package/dist/runtime/framework-warning.emitter.js +8 -0
- 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 +11 -6
- package/dist/runtime/level-lifecycle.runtime.d.ts +26 -0
- package/dist/runtime/level-lifecycle.runtime.js +40 -0
- package/dist/runtime/misuse-reporter.d.ts +12 -12
- package/dist/runtime/mutation-planner.d.ts +20 -16
- package/dist/runtime/mutation-planner.js +48 -35
- package/dist/runtime/nested-write.walker.d.ts +32 -0
- package/dist/runtime/nested-write.walker.js +73 -0
- package/dist/runtime/operation-code.guidance.d.ts +6 -0
- package/dist/runtime/operation-code.guidance.js +167 -0
- package/dist/runtime/operation-request.d.ts +45 -11
- package/dist/runtime/operation-response.d.ts +17 -17
- package/dist/runtime/operation-runtime.d.ts +133 -27
- package/dist/runtime/operation-runtime.js +576 -84
- package/dist/runtime/outcome-mapper.d.ts +17 -5
- package/dist/runtime/outcome-mapper.js +23 -6
- package/dist/runtime/output-validator.d.ts +11 -11
- package/dist/runtime/output-validator.js +3 -3
- package/dist/runtime/owned-execution.registry.d.ts +16 -6
- package/dist/runtime/pipe-output.validator.d.ts +43 -18
- package/dist/runtime/pipe-output.validator.js +15 -13
- package/dist/runtime/pipeline.d.ts +221 -34
- package/dist/runtime/readonly-value.d.ts +47 -0
- package/dist/runtime/readonly-value.js +189 -0
- package/dist/runtime/referential-action.d.ts +1 -1
- 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 +33 -25
- package/dist/runtime/scalar-runtime.js +105 -38
- package/dist/runtime/unsent-value.normalizer.d.ts +15 -0
- package/dist/runtime/unsent-value.normalizer.js +128 -0
- 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 +8 -3
- package/dist/transactions/operation-fingerprint.js +2 -2
- package/dist/transactions/sql-statement.d.ts +85 -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 +167 -0
- package/dist/transactions/transaction-envelope.d.ts +9 -8
- package/dist/transactions/transaction-integrity-error.d.ts +6 -6
- package/dist/transactions/transaction-integrity-error.js +7 -2
- package/dist/transactions/transaction-plan-assembler.d.ts +30 -13
- package/dist/transactions/transaction-plan-assembler.js +184 -32
- package/dist/transactions/transaction-plan-validator.d.ts +50 -25
- package/dist/transactions/transaction-plan-validator.js +96 -38
- package/dist/transactions/transaction-reference-collector.d.ts +5 -5
- package/dist/transactions/transaction-reference-resolver.d.ts +21 -3
- package/dist/transactions/transaction-reference-resolver.js +26 -14
- package/dist/transactions/transaction-reference-validator.d.ts +74 -4
- package/dist/transactions/transaction-reference-validator.js +129 -71
- package/dist/transactions/transaction-reference.d.ts +14 -14
- package/dist/transactions/transaction-reference.js +5 -0
- package/dist/transactions/transaction-request.d.ts +22 -9
- package/dist/transactions/transaction-response.d.ts +6 -6
- package/dist/transactions/transaction-runtime.d.ts +12 -8
- package/dist/transactions/transaction-runtime.js +218 -50
- package/dist/transactions/transaction-settlement.runtime.d.ts +52 -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 +4 -2
- package/dist/transactions/transaction-slot-writer.js +2 -2
- package/dist/transactions/transaction-stage.runtime.d.ts +83 -0
- package/dist/transactions/transaction-stage.runtime.js +126 -0
- package/package.json +11 -9
- 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,28 +1,41 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
9
|
-
import type {
|
|
1
|
+
import type { AvAdapterModel } from "../adapters/adapter-model.js";
|
|
2
|
+
import type { AvContracts } from "../compiler/contract.compiler.js";
|
|
3
|
+
import type { AvConfigAny } from "../config/any-framework-config.js";
|
|
4
|
+
import type { AvMcpEndpoint } from "../config/config.resolver.js";
|
|
5
|
+
import type { AvOperationRequest } from "../runtime/operation-request.js";
|
|
6
|
+
import type { AvOperationResponse } from "../runtime/operation-response.js";
|
|
7
|
+
import type { AvTransactionRunner } from "../transactions/deferred-operation.js";
|
|
8
|
+
import type { AvTransactionRequest } from "../transactions/transaction-request.js";
|
|
9
|
+
import type { AvTransactionResponse } from "../transactions/transaction-response.js";
|
|
10
|
+
import type { ApplicationOperations, ApplicationTransactionBuilders, ClientOperations, ClientTransactionBuilders, ServerClientOperations, ServerClientTransactionBuilders } from "./operation-facade.js";
|
|
10
11
|
/**
|
|
11
12
|
* One Aventara instance, as returned by {@link createFramework}: its compiled
|
|
12
13
|
* Contracts, typed in-process operations, transaction builders and the
|
|
13
14
|
* untyped `execute` entry a transport calls.
|
|
14
15
|
*/
|
|
15
|
-
export type
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
export type AvFramework<M extends AvAdapterModel = AvAdapterModel, Cfg = AvConfigAny> = {
|
|
17
|
+
/**
|
|
18
|
+
* The protocol's mount path (`api`) in its canonical form: `""` at the
|
|
19
|
+
* root, otherwise `/seg(/seg)*`.
|
|
20
|
+
*/
|
|
21
|
+
readonly api: string;
|
|
22
|
+
/**
|
|
23
|
+
* The MCP endpoint `mcp` turns on — its canonical mount path and its
|
|
24
|
+
* authorization — for the host that serves it; `undefined` when MCP is off.
|
|
25
|
+
*/
|
|
26
|
+
readonly mcp: AvMcpEndpoint | undefined;
|
|
27
|
+
readonly contracts: AvContracts;
|
|
18
28
|
/**
|
|
19
29
|
* Typed in-process operations under the Application Contract:
|
|
20
30
|
* `framework.application.<resource>.<family>.<variant>(args, options?)`.
|
|
21
31
|
*
|
|
22
32
|
* Typed from the Application Contract as configured: what the application's
|
|
23
|
-
*
|
|
24
|
-
* validated like any other request.
|
|
25
|
-
*
|
|
33
|
+
* exposure hides, denies or turns off is absent from the types, and a call is
|
|
34
|
+
* validated like any other request. A call resolves the operation's data (a
|
|
35
|
+
* first-style miss is `null`) and throws every failure as the `AvError`
|
|
36
|
+
* subclass of its code's class (`AvValidationError`, `AvNotFoundError`, …).
|
|
37
|
+
* The optional second argument is
|
|
38
|
+
* {@link AvExecutionOptions}.
|
|
26
39
|
*/
|
|
27
40
|
readonly application: ApplicationOperations<M, Cfg>;
|
|
28
41
|
/**
|
|
@@ -33,25 +46,54 @@ export type Framework<M extends AdapterModel = AdapterModel, Cfg = AnyFrameworkC
|
|
|
33
46
|
* as from a generated client, and arguments are read in the wire
|
|
34
47
|
* forms a decoded request body carries, so a transport can pass `req.body` as
|
|
35
48
|
* it is. Each call runs the client pipelines and the same validation as a
|
|
36
|
-
* remote request
|
|
49
|
+
* remote request, and settles like an application call: the data, or the
|
|
50
|
+
* failure thrown.
|
|
37
51
|
*/
|
|
38
52
|
readonly client: ClientOperations<M, Cfg>;
|
|
53
|
+
/**
|
|
54
|
+
* The client layer for server code, taking application values:
|
|
55
|
+
* `framework.serverClient.<resource>.<family>.<variant>(args, options?)`.
|
|
56
|
+
*
|
|
57
|
+
* Typed and run exactly as {@link client} (the Client Contract's view, the
|
|
58
|
+
* client pipelines, validation, exposure and policy), but its arguments are
|
|
59
|
+
* the application forms: a `datetime` is a `Date`, a `bigint` a `bigint`, a
|
|
60
|
+
* `decimal` an `AvDecimal`, `bytes` a `Uint8Array`. Each call copies its
|
|
61
|
+
* arguments, encodes them into the wire forms `client` reads, and hands the
|
|
62
|
+
* same client-origin request to {@link execute}. Results are the same as
|
|
63
|
+
* `client`'s; the optional second argument is {@link AvExecutionOptions}.
|
|
64
|
+
*/
|
|
65
|
+
readonly serverClient: ServerClientOperations<M, Cfg>;
|
|
39
66
|
/**
|
|
40
67
|
* Transaction builders under application rules:
|
|
41
68
|
* `framework.appTx.<resource>.<family>.<variant>(args)` defers one operation
|
|
42
|
-
* into a handle typed `
|
|
69
|
+
* into a handle typed `AvOperation<AvOperationResultFor<…>>` from the Application
|
|
43
70
|
* Contract's view, and runs nothing. A handle exposes `$ref(field)` exactly
|
|
44
71
|
* where its result is one row; the reference is bound to the handle, and its
|
|
45
72
|
* index is bound when {@link transaction} runs the list it is in.
|
|
73
|
+
*
|
|
74
|
+
* `framework.appTx.$sql` defers a developer SQL step, written only as a tagged
|
|
75
|
+
* template whose every interpolated value is bound as a parameter (a `$ref`
|
|
76
|
+
* among them, resolved when the earlier steps have run). It runs in plan order
|
|
77
|
+
* in the same database transaction, with no pipelines around it; its entry in
|
|
78
|
+
* the committed data is its rows, typed by `appTx.$sql<Row>`. It exists only
|
|
79
|
+
* here: `clientTx`, the Client Contract and `/_transactions` have no SQL step.
|
|
46
80
|
*/
|
|
47
81
|
readonly appTx: ApplicationTransactionBuilders<M, Cfg>;
|
|
48
82
|
/**
|
|
49
83
|
* The same builders under ClientContract rules, taking wire-form arguments.
|
|
50
|
-
*
|
|
51
|
-
*
|
|
84
|
+
* A {@link transaction} has one origin: client and application handles never
|
|
85
|
+
* share one (`A2004`/`V1020` at the first step of the other origin).
|
|
52
86
|
*/
|
|
53
87
|
readonly clientTx: ClientTransactionBuilders<M, Cfg>;
|
|
54
|
-
|
|
88
|
+
/**
|
|
89
|
+
* The {@link clientTx} builders taking application values, as
|
|
90
|
+
* {@link serverClient} takes them: each handle's arguments are copied and
|
|
91
|
+
* encoded into the wire forms when it is built. Its handles are client-origin,
|
|
92
|
+
* so one {@link transaction} may hold them beside `clientTx` handles, never
|
|
93
|
+
* beside `appTx` ones.
|
|
94
|
+
*/
|
|
95
|
+
readonly serverClientTx: ServerClientTransactionBuilders<M, Cfg>;
|
|
96
|
+
execute(request: AvOperationRequest): Promise<AvOperationResponse>;
|
|
55
97
|
/**
|
|
56
98
|
* Validates a whole transaction plan, then runs its operations one after
|
|
57
99
|
* another inside one Adapter transaction. Answers `A1009` with each
|
|
@@ -62,15 +104,18 @@ export type Framework<M extends AdapterModel = AdapterModel, Cfg = AnyFrameworkC
|
|
|
62
104
|
* Guards, pipes, hooks and interceptors run while the transaction is open, so
|
|
63
105
|
* they should not perform network I/O or other slow work.
|
|
64
106
|
*/
|
|
65
|
-
executeTransaction(request:
|
|
107
|
+
executeTransaction(request: AvTransactionRequest): Promise<AvTransactionResponse>;
|
|
66
108
|
/**
|
|
67
109
|
* Runs handles from `appTx`/`clientTx` as one transaction:
|
|
68
|
-
* `framework.transaction([h1, h2, …], options?)`. Resolves
|
|
69
|
-
*
|
|
110
|
+
* `framework.transaction([h1, h2, …], options?)`. Resolves each handle's
|
|
111
|
+
* result in plan order, typed per position, once the transaction committed,
|
|
112
|
+
* or throws the failure as the `AvError` subclass of its code's class, with
|
|
113
|
+
* `cause.operation` naming the failing step.
|
|
70
114
|
*
|
|
71
115
|
* Refused before anything runs: an entry that is not one of this Framework's
|
|
72
|
-
* handles, or the same handle twice (`A2004`/`V1001`);
|
|
73
|
-
*
|
|
116
|
+
* handles, or the same handle twice (`A2004`/`V1001`); `appTx` and `clientTx`
|
|
117
|
+
* handles in one list (`A2004`/`V1020`); a `$ref` to a handle not in the list
|
|
118
|
+
* (`A2007`/`V1010`).
|
|
74
119
|
*/
|
|
75
|
-
readonly transaction:
|
|
120
|
+
readonly transaction: AvTransactionRunner;
|
|
76
121
|
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
1
|
+
import type { AvAdapterModel } from "../adapters/adapter-model.js";
|
|
2
|
+
import type { AvConfigAny } from "../config/any-framework-config.js";
|
|
3
|
+
import type { AvConfigExact } from "../config/exact-framework-config.js";
|
|
4
|
+
import type { AvConfig } from "../config/framework-config.js";
|
|
5
|
+
import type { ErasedConfig } from "../config/stage-type.eraser.js";
|
|
6
|
+
import type { AvFramework } from "./framework.js";
|
|
5
7
|
/**
|
|
6
8
|
* Creates a Framework: validates the configuration, reads the adapter's
|
|
7
9
|
* model and compiles the Contracts.
|
|
8
10
|
*
|
|
9
|
-
* @throws {@link
|
|
11
|
+
* @throws {@link AvConstructionError} when any of those steps fails.
|
|
10
12
|
*/
|
|
11
|
-
export declare function createFramework<M extends
|
|
13
|
+
export declare function createFramework<M extends AvAdapterModel, const Cfg = AvConfigAny>(config: Cfg & AvConfigExact<M, Cfg> & AvConfig<M, Cfg>): Promise<AvFramework<M, ErasedConfig<Cfg>>>;
|
|
@@ -1,28 +1,42 @@
|
|
|
1
|
-
import { compileContracts } from "../compiler/contract.compiler.js";
|
|
2
|
-
import {
|
|
1
|
+
import { compileContracts, } from "../compiler/contract.compiler.js";
|
|
2
|
+
import { validateManagedDeletes } from "../compiler/managed-elsewhere.validator.js";
|
|
3
|
+
import { computedFieldsOf, warnOnStaleComputedFields, } from "../config/computed-fields.js";
|
|
4
|
+
import { resolveFrameworkConfig, } from "../config/config.resolver.js";
|
|
3
5
|
import { validateFrameworkConfig } from "../config/config.validator.js";
|
|
6
|
+
import { validateForcedOperations } from "../config/forced-operation.validator.js";
|
|
4
7
|
import { AVENTARA_PROTOCOL_VERSION } from "../contracts/contract-protocol.js";
|
|
5
|
-
import {
|
|
8
|
+
import { recordAccessProvider } from "../policy/access-provider.registry.js";
|
|
9
|
+
import { recordAccessQuestions } from "../policy/access-question.registry.js";
|
|
10
|
+
import { createAccessQuestionAnswerer } from "../policy/access-question.runtime.js";
|
|
11
|
+
import { heldTargetsOf } from "../policy/policy-reference-write.runtime.js";
|
|
12
|
+
import { callerOf } from "../policy/policy-request.js";
|
|
13
|
+
import { policyStartupDiagnostics } from "../policy/policy-startup.validator.js";
|
|
14
|
+
import { loadPrebuiltContracts, warnStalePrebuilt, } from "../prebuilt/prebuilt-contracts.loader.js";
|
|
15
|
+
import { copyAtDoor, copyEnvelopeAtDoor, refuseCallerData, } from "../runtime/caller-data.door.js";
|
|
6
16
|
import { createDiagnosticsReporter, createTransactionDiagnosticsChannel, recordDiagnosticsSink, } from "../runtime/diagnostics-reporter.js";
|
|
7
17
|
import { createMisuseReporter, } from "../runtime/misuse-reporter.js";
|
|
8
18
|
import { internalFailure, operationFailure, } from "../runtime/operation-response.js";
|
|
9
|
-
import { createOperationRuntime } from "../runtime/operation-runtime.js";
|
|
19
|
+
import { createOperationRuntime, createPipelineDependencies, } from "../runtime/operation-runtime.js";
|
|
10
20
|
import { recordOwnedExecution } from "../runtime/owned-execution.registry.js";
|
|
11
21
|
import { validateOperationEnvelope, validateTransactionEnvelope, } from "../runtime/request-envelope.validator.js";
|
|
12
22
|
import { requestIdOf } from "../runtime/request-id.js";
|
|
23
|
+
import { stateOptionOf } from "../runtime/request-state.resolver.js";
|
|
24
|
+
import { encodeOperationArgumentsForWire } from "../transactions/operation-arguments-encoder.js";
|
|
13
25
|
import { createTransactionPlanAssembler } from "../transactions/transaction-plan-assembler.js";
|
|
14
26
|
import { createTransactionRuntime } from "../transactions/transaction-runtime.js";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
27
|
+
import { createServerClientAccess } from "./access-facade.js";
|
|
28
|
+
import { AvConstructionError } from "./framework-construction.error.js";
|
|
29
|
+
import { createOperationFacade, createOperationTree, settleOperation, } from "./operation-facade.js";
|
|
30
|
+
const APPLICATION_SQL_BUILDER = "$sql";
|
|
17
31
|
export async function createFramework(config) {
|
|
18
32
|
const configDiagnostics = validateFrameworkConfig(config);
|
|
19
33
|
if (configDiagnostics.length > 0) {
|
|
20
|
-
throw new
|
|
34
|
+
throw new AvConstructionError("configuration", configDiagnostics);
|
|
21
35
|
}
|
|
22
36
|
const model = config.adapter.model;
|
|
23
37
|
if (model.transactions === "interactive" &&
|
|
24
38
|
typeof config.adapter.transaction !== "function") {
|
|
25
|
-
throw new
|
|
39
|
+
throw new AvConstructionError("discovery", [
|
|
26
40
|
{
|
|
27
41
|
code: "DISCOVERY_TRANSACTION_CAPABILITY_MISMATCH",
|
|
28
42
|
path: "adapter.transactions",
|
|
@@ -31,62 +45,146 @@ export async function createFramework(config) {
|
|
|
31
45
|
]);
|
|
32
46
|
}
|
|
33
47
|
const resolvedConfig = resolveFrameworkConfig(config);
|
|
34
|
-
|
|
48
|
+
warnOnStaleComputedFields(config.adapter.computedFields, computedFieldsOf({
|
|
49
|
+
trees: resolvedConfig.trees,
|
|
50
|
+
agentExtends: resolvedConfig.agent.parent,
|
|
51
|
+
}));
|
|
52
|
+
const compilation = (config.prebuilt === undefined
|
|
53
|
+
? undefined
|
|
54
|
+
: await prebuiltCompilation(config.prebuilt, model, config, resolvedConfig)) ?? (await compileContracts(model, resolvedConfig));
|
|
35
55
|
if (!compilation.ok) {
|
|
36
|
-
throw new
|
|
56
|
+
throw new AvConstructionError("contract-compilation", compilation.diagnostics);
|
|
37
57
|
}
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
58
|
+
const forcing = validateForcedOperations(config, compilation.contracts);
|
|
59
|
+
if (forcing.length > 0) {
|
|
60
|
+
throw new AvConstructionError("configuration", forcing);
|
|
61
|
+
}
|
|
62
|
+
const managedDeletes = validateManagedDeletes(compilation.contracts, config.adapter.referentialActions);
|
|
63
|
+
if (managedDeletes.length > 0) {
|
|
64
|
+
throw new AvConstructionError("configuration", managedDeletes);
|
|
65
|
+
}
|
|
66
|
+
if (resolvedConfig.policy !== undefined) {
|
|
67
|
+
const policy = policyStartupDiagnostics(compilation.contracts.core, resolvedConfig.policy, model);
|
|
68
|
+
if (policy.length > 0) {
|
|
69
|
+
throw new AvConstructionError("configuration", policy);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
const runtimeDependencies = {
|
|
44
73
|
adapter: config.adapter,
|
|
45
74
|
contracts: compilation.contracts,
|
|
46
75
|
config: resolvedConfig,
|
|
47
|
-
}
|
|
76
|
+
};
|
|
77
|
+
const pipelineDependencies = createPipelineDependencies(runtimeDependencies, model);
|
|
78
|
+
const execute = createOperationRuntime(runtimeDependencies, pipelineDependencies);
|
|
79
|
+
const executeTransaction = createTransactionRuntime(runtimeDependencies, pipelineDependencies);
|
|
48
80
|
const misuse = createMisuseReporter(resolvedConfig.misuse);
|
|
49
|
-
const executeOperation = (request) => executeTotally(execute, request, resolvedConfig.diagnostics, "caller");
|
|
81
|
+
const executeOperation = (request, caller) => executeTotally(execute, request, resolvedConfig.diagnostics, "caller", caller);
|
|
82
|
+
const executeApplicationValues = (request, caller) => executeTotally(encodingApplicationValues(execute, compilation.contracts.client), request, resolvedConfig.diagnostics, "caller", caller);
|
|
50
83
|
const protocol = {
|
|
51
84
|
version: AVENTARA_PROTOCOL_VERSION,
|
|
52
85
|
hash: compilation.contracts.client.protocol.hash,
|
|
53
86
|
};
|
|
54
87
|
const assembler = createTransactionPlanAssembler(compilation.contracts, protocol, misuse);
|
|
88
|
+
const clientRequest = (resource, identity, args, requestId, state) => ({
|
|
89
|
+
...identity,
|
|
90
|
+
origin: "client",
|
|
91
|
+
protocol,
|
|
92
|
+
requestId,
|
|
93
|
+
...(state === undefined ? {} : { state }),
|
|
94
|
+
resource,
|
|
95
|
+
arguments: args,
|
|
96
|
+
});
|
|
97
|
+
const accessAnswerer = compilation.contracts.client.access === undefined
|
|
98
|
+
? undefined
|
|
99
|
+
: createAccessQuestionAnswerer({
|
|
100
|
+
contracts: compilation.contracts,
|
|
101
|
+
policy: resolvedConfig.policy,
|
|
102
|
+
adapter: config.adapter,
|
|
103
|
+
diagnostics: resolvedConfig.diagnostics,
|
|
104
|
+
misuse,
|
|
105
|
+
});
|
|
55
106
|
const framework = {
|
|
56
|
-
|
|
107
|
+
api: resolvedConfig.api,
|
|
108
|
+
mcp: resolvedConfig.mcp,
|
|
57
109
|
contracts: compilation.contracts,
|
|
58
|
-
application: createOperationFacade(model, (resource, identity, args, requestId) => ({
|
|
110
|
+
application: createOperationFacade(model, (resource, identity, args, requestId, state) => ({
|
|
59
111
|
...identity,
|
|
60
112
|
origin: "application",
|
|
61
113
|
requestId,
|
|
114
|
+
...(state === undefined ? {} : { state }),
|
|
62
115
|
resource,
|
|
63
116
|
arguments: args,
|
|
64
117
|
}), executeOperation),
|
|
65
|
-
client: createOperationFacade(model,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
118
|
+
client: createOperationFacade(model, clientRequest, executeOperation),
|
|
119
|
+
serverClient: withServerClientAccess(createOperationFacade(model, clientRequest, executeApplicationValues), accessAnswerer === undefined
|
|
120
|
+
? undefined
|
|
121
|
+
: createServerClientAccess({
|
|
122
|
+
contract: compilation.contracts.client,
|
|
123
|
+
answer: accessAnswerer,
|
|
124
|
+
client: config.access?.client,
|
|
125
|
+
state: (input) => config.access.state(input),
|
|
126
|
+
})),
|
|
127
|
+
appTx: Object.freeze({
|
|
128
|
+
...createOperationTree(model, (resource, identity) => (args) => assembler.defer("application", resource, identity, args === undefined ? {} : args)),
|
|
129
|
+
[APPLICATION_SQL_BUILDER]: (strings, ...values) => assembler.deferSql(strings, values),
|
|
130
|
+
}),
|
|
74
131
|
clientTx: createOperationTree(model, (resource, identity) => (args) => assembler.defer("client", resource, identity, args === undefined ? {} : args)),
|
|
132
|
+
serverClientTx: createOperationTree(model, (resource, identity) => (args) => assembler.defer("client", resource, identity, args === undefined ? {} : args, "application")),
|
|
75
133
|
execute: (request) => executeRequestTotally(execute, request, resolvedConfig.diagnostics, misuse),
|
|
76
134
|
executeTransaction: (request) => executeTransactionRequestTotally(executeTransaction, request, resolvedConfig.diagnostics, misuse),
|
|
77
|
-
transaction: ((operations, options) => runTransactionTotally(executeTransaction, assembler, operations, requestIdOf(options), resolvedConfig.diagnostics)),
|
|
135
|
+
transaction: (async (operations, options) => settleOperation(await runTransactionTotally(executeTransaction, assembler, operations, requestIdOf(options), stateOptionOf(options), resolvedConfig.diagnostics, callerOf(options)))),
|
|
78
136
|
};
|
|
79
137
|
recordDiagnosticsSink(framework, resolvedConfig.diagnostics);
|
|
138
|
+
recordAccessProvider(framework, config.access);
|
|
139
|
+
if (accessAnswerer !== undefined) {
|
|
140
|
+
recordAccessQuestions(framework, accessAnswerer);
|
|
141
|
+
}
|
|
80
142
|
recordOwnedExecution(framework, {
|
|
81
|
-
execute: (request) => executeTotally(execute, request, resolvedConfig.diagnostics, "owned"),
|
|
82
|
-
executeTransaction: (request) => executeTransactionTotally(executeTransaction, request, resolvedConfig.diagnostics, undefined,
|
|
143
|
+
execute: (request, refused) => executeTotally(execute, request, resolvedConfig.diagnostics, refused === undefined ? "owned" : { refused }),
|
|
144
|
+
executeTransaction: (request, refused) => executeTransactionTotally(executeTransaction, request, resolvedConfig.diagnostics, undefined, refused === undefined
|
|
145
|
+
? { source: "owned" }
|
|
146
|
+
: { source: "owned", refused }),
|
|
83
147
|
});
|
|
148
|
+
if (resolvedConfig.policy !== undefined) {
|
|
149
|
+
await resolvedConfig.policy.engine.hosted?.({
|
|
150
|
+
held: heldTargetsOf(compilation.contracts.core, resolvedConfig.policy.unheld),
|
|
151
|
+
});
|
|
152
|
+
}
|
|
84
153
|
return framework;
|
|
85
154
|
}
|
|
86
|
-
async function
|
|
155
|
+
async function prebuiltCompilation(prebuilt, model, config, resolved) {
|
|
156
|
+
let loaded;
|
|
157
|
+
try {
|
|
158
|
+
loaded = await loadPrebuiltContracts(prebuilt, model, config, resolved);
|
|
159
|
+
}
|
|
160
|
+
catch (error) {
|
|
161
|
+
loaded = {
|
|
162
|
+
ok: false,
|
|
163
|
+
reason: `it could not be read (${error instanceof Error ? error.message : String(error)})`,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
if (!loaded.ok) {
|
|
167
|
+
warnStalePrebuilt(loaded.reason);
|
|
168
|
+
return undefined;
|
|
169
|
+
}
|
|
170
|
+
return { ok: true, contracts: loaded.contracts };
|
|
171
|
+
}
|
|
172
|
+
function encodingApplicationValues(execute, contract) {
|
|
173
|
+
return (request, report, _source, caller) => {
|
|
174
|
+
const copy = copyAtDoor(request.arguments);
|
|
175
|
+
if (!copy.ok) {
|
|
176
|
+
return execute(request, report, { refused: copy.error }, caller);
|
|
177
|
+
}
|
|
178
|
+
return execute({
|
|
179
|
+
...request,
|
|
180
|
+
arguments: encodeOperationArgumentsForWire(contract, request, copy.value),
|
|
181
|
+
}, report, "owned", caller);
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
async function executeTotally(execute, request, diagnostics, source, caller) {
|
|
87
185
|
const report = createDiagnosticsReporter(diagnostics, request);
|
|
88
186
|
try {
|
|
89
|
-
return await execute(request, report, source);
|
|
187
|
+
return await execute(request, report, source, caller);
|
|
90
188
|
}
|
|
91
189
|
catch (error) {
|
|
92
190
|
report(error, "A3000");
|
|
@@ -127,18 +225,18 @@ function executeTransactionRequestTotally(execute, request, diagnostics, misuse)
|
|
|
127
225
|
}
|
|
128
226
|
return executeTransactionTotally(execute, envelope.value, diagnostics, undefined, { source: "caller" });
|
|
129
227
|
}
|
|
130
|
-
async function executeTransactionTotally(execute, request, diagnostics, origins, planArguments) {
|
|
228
|
+
async function executeTransactionTotally(execute, request, diagnostics, origins, planArguments, caller) {
|
|
131
229
|
const channel = createTransactionDiagnosticsChannel(diagnostics, request);
|
|
132
230
|
const report = channel.transaction();
|
|
133
231
|
try {
|
|
134
|
-
return await execute(request, channel, origins, planArguments);
|
|
232
|
+
return await execute(request, channel, origins, planArguments, caller);
|
|
135
233
|
}
|
|
136
234
|
catch (error) {
|
|
137
235
|
report(error, "A3000");
|
|
138
236
|
return internalFailure();
|
|
139
237
|
}
|
|
140
238
|
}
|
|
141
|
-
async function runTransactionTotally(execute, assembler, operations, requestId, diagnostics) {
|
|
239
|
+
async function runTransactionTotally(execute, assembler, operations, requestId, state, diagnostics, caller) {
|
|
142
240
|
let assembled;
|
|
143
241
|
try {
|
|
144
242
|
assembled = await assembler.assemble(operations);
|
|
@@ -154,5 +252,19 @@ async function runTransactionTotally(execute, assembler, operations, requestId,
|
|
|
154
252
|
if (!assembled.ok) {
|
|
155
253
|
return assembled.response;
|
|
156
254
|
}
|
|
157
|
-
return executeTransactionTotally(execute, {
|
|
255
|
+
return executeTransactionTotally(execute, {
|
|
256
|
+
origin: "application",
|
|
257
|
+
requestId,
|
|
258
|
+
...(state === undefined ? {} : { state }),
|
|
259
|
+
plan: assembled.plan,
|
|
260
|
+
}, diagnostics, assembled.origins, {
|
|
261
|
+
source: "owned",
|
|
262
|
+
refused: assembled.refused,
|
|
263
|
+
statements: assembled.statements,
|
|
264
|
+
}, caller);
|
|
265
|
+
}
|
|
266
|
+
function withServerClientAccess(facade, access) {
|
|
267
|
+
return access === undefined
|
|
268
|
+
? facade
|
|
269
|
+
: Object.freeze({ ...facade, $access: access });
|
|
158
270
|
}
|