@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,72 +1,204 @@
|
|
|
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 {
|
|
10
|
-
import type {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import type { AvAdapterModel } from "../adapters/adapter-model.js";
|
|
2
|
+
import type { AvContract } from "../contracts/contract.js";
|
|
3
|
+
import type { AvApplicationScalarForms, AvWireScalarForms } from "../contracts/scalar-value-type.js";
|
|
4
|
+
import type { AvOperationArgumentsFor, AvResourceKey } from "../operations/operation-arguments.js";
|
|
5
|
+
import type { AvOperationCall, AvOperationGrammar, DeferredArguments, DeferredPlainCall, DeferredProjectingCall, PlainCall, ProjectingCall } from "../operations/operation-call.js";
|
|
6
|
+
import type { AvOperationIdentity } from "../operations/operation-identity.js";
|
|
7
|
+
import { type PolicyCaller } from "../policy/policy-request.js";
|
|
8
|
+
import type { AvExecutionOptions } from "../runtime/execution-options.js";
|
|
9
|
+
import type { AvOperationRequest } from "../runtime/operation-request.js";
|
|
10
|
+
import type { AvOperationResponse } from "../runtime/operation-response.js";
|
|
11
|
+
import type { AvState } from "../runtime/request-state.js";
|
|
12
|
+
import type { AvSqlStatementBuilder } from "../transactions/sql-statement.js";
|
|
13
|
+
import type { AvTransactionResponse } from "../transactions/transaction-response.js";
|
|
14
|
+
import type { AccessProviderOf, ServerClientAccess } from "./access-facade.js";
|
|
15
|
+
import type { AvContractApplicationView, ClientContractView } from "./contract-view.js";
|
|
16
|
+
/**
|
|
17
|
+
* A model whose Resource names are not literal — the abstract `AvAdapterModel` behind
|
|
18
|
+
* the default `AvFramework` — has no Contract to type a call against, so a surface over
|
|
14
19
|
* it is typed as the opaque object it is, and such a caller uses `execute`.
|
|
15
20
|
*/
|
|
16
21
|
type OpaqueSurface = {
|
|
17
22
|
readonly [resource: string]: unknown;
|
|
18
23
|
};
|
|
24
|
+
/** The typed surfaces of an `AvFramework`, named by the member that holds each. */
|
|
25
|
+
type FacadeSurface = "application" | "client" | "serverClient" | "appTx" | "clientTx" | "serverClientTx";
|
|
26
|
+
/** `framework.application.<Resource>.<family>.<variant>` when the variant takes a `select` or `include`. */
|
|
27
|
+
export type AvApplicationProjectingCall<in out C extends AvContract, in out R extends AvResourceKey<C>, in out I extends AvOperationIdentity> = ProjectingCall<C, R, I, AvOperationArgumentsFor<C, R, I, AvApplicationScalarForms>, AvApplicationScalarForms, AvExecutionOptions>;
|
|
28
|
+
/** `framework.application.<Resource>.<family>.<variant>` when it does not (the `count` variants). */
|
|
29
|
+
export type AvApplicationPlainCall<in out C extends AvContract, in out R extends AvResourceKey<C>, in out I extends AvOperationIdentity> = PlainCall<C, R, I, AvOperationArgumentsFor<C, R, I, AvApplicationScalarForms>, AvApplicationScalarForms, AvExecutionOptions>;
|
|
30
|
+
/** `framework.client.<Resource>.<family>.<variant>` when the variant takes a `select` or `include`: wire forms in. */
|
|
31
|
+
export type AvClientProjectingCall<in out C extends AvContract, in out R extends AvResourceKey<C>, in out I extends AvOperationIdentity> = ProjectingCall<C, R, I, AvOperationArgumentsFor<C, R, I, AvWireScalarForms>, AvApplicationScalarForms, AvExecutionOptions>;
|
|
32
|
+
/** `framework.client.<Resource>.<family>.<variant>` when it does not. */
|
|
33
|
+
export type AvClientPlainCall<in out C extends AvContract, in out R extends AvResourceKey<C>, in out I extends AvOperationIdentity> = PlainCall<C, R, I, AvOperationArgumentsFor<C, R, I, AvWireScalarForms>, AvApplicationScalarForms, AvExecutionOptions>;
|
|
34
|
+
/** `framework.appTx.<Resource>.<family>.<variant>` when the variant takes a `select` or `include`. */
|
|
35
|
+
export type AvAppTxProjectingCall<in out C extends AvContract, in out R extends AvResourceKey<C>, in out I extends AvOperationIdentity> = DeferredProjectingCall<C, R, I, DeferredArguments<C, R, I, AvApplicationScalarForms, AvApplicationScalarForms>, AvApplicationScalarForms, "application">;
|
|
36
|
+
/** `framework.appTx.<Resource>.<family>.<variant>` when it does not. */
|
|
37
|
+
export type AvAppTxPlainCall<in out C extends AvContract, in out R extends AvResourceKey<C>, in out I extends AvOperationIdentity> = DeferredPlainCall<C, R, I, DeferredArguments<C, R, I, AvApplicationScalarForms, AvApplicationScalarForms>, AvApplicationScalarForms, "application">;
|
|
38
|
+
/** `framework.clientTx.<Resource>.<family>.<variant>` when the variant takes a `select` or `include`: wire forms in. */
|
|
39
|
+
export type AvClientTxProjectingCall<in out C extends AvContract, in out R extends AvResourceKey<C>, in out I extends AvOperationIdentity> = DeferredProjectingCall<C, R, I, DeferredArguments<C, R, I, AvWireScalarForms, AvApplicationScalarForms>, AvApplicationScalarForms, "client">;
|
|
40
|
+
/** `framework.clientTx.<Resource>.<family>.<variant>` when it does not. */
|
|
41
|
+
export type AvClientTxPlainCall<in out C extends AvContract, in out R extends AvResourceKey<C>, in out I extends AvOperationIdentity> = DeferredPlainCall<C, R, I, DeferredArguments<C, R, I, AvWireScalarForms, AvApplicationScalarForms>, AvApplicationScalarForms, "client">;
|
|
19
42
|
/**
|
|
20
|
-
* `framework.
|
|
21
|
-
*
|
|
43
|
+
* `framework.serverClient.<Resource>.<family>.<variant>` when the variant takes a `select` or `include`:
|
|
44
|
+
* the Client Contract's view, application forms in.
|
|
22
45
|
*/
|
|
23
|
-
export type
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
readonly [F in keyof OperationGrammar<C>[R]]: {
|
|
27
|
-
readonly [V in keyof OperationGrammar<C>[R][F]]: OperationCall<C, R, OperationGrammar<C>[R][F][V] & OperationIdentity, ApplicationScalarForms, ApplicationScalarForms, "response", ExecutionOptions>;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
} : never;
|
|
46
|
+
export type AvServerClientProjectingCall<in out C extends AvContract, in out R extends AvResourceKey<C>, in out I extends AvOperationIdentity> = ProjectingCall<C, R, I, AvOperationArgumentsFor<C, R, I, AvApplicationScalarForms>, AvApplicationScalarForms, AvExecutionOptions>;
|
|
47
|
+
/** `framework.serverClient.<Resource>.<family>.<variant>` when it does not. */
|
|
48
|
+
export type AvServerClientPlainCall<in out C extends AvContract, in out R extends AvResourceKey<C>, in out I extends AvOperationIdentity> = PlainCall<C, R, I, AvOperationArgumentsFor<C, R, I, AvApplicationScalarForms>, AvApplicationScalarForms, AvExecutionOptions>;
|
|
31
49
|
/**
|
|
32
|
-
* `framework.
|
|
33
|
-
* the
|
|
50
|
+
* `framework.serverClientTx.<Resource>.<family>.<variant>` when the variant takes a `select` or `include`:
|
|
51
|
+
* the Client Contract's view, application forms in, a client-origin handle out.
|
|
34
52
|
*/
|
|
35
|
-
export type
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
53
|
+
export type AvServerClientTxProjectingCall<in out C extends AvContract, in out R extends AvResourceKey<C>, in out I extends AvOperationIdentity> = DeferredProjectingCall<C, R, I, DeferredArguments<C, R, I, AvApplicationScalarForms, AvApplicationScalarForms>, AvApplicationScalarForms, "client">;
|
|
54
|
+
/** `framework.serverClientTx.<Resource>.<family>.<variant>` when it does not. */
|
|
55
|
+
export type AvServerClientTxPlainCall<in out C extends AvContract, in out R extends AvResourceKey<C>, in out I extends AvOperationIdentity> = DeferredPlainCall<C, R, I, DeferredArguments<C, R, I, AvApplicationScalarForms, AvApplicationScalarForms>, AvApplicationScalarForms, "client">;
|
|
56
|
+
/**
|
|
57
|
+
* One variant on a surface: a direct call (application or wire forms), or a
|
|
58
|
+
* deferred one for a transaction (`appTx`, `clientTx`, `serverClientTx`),
|
|
59
|
+
* projecting when its arguments carry a `select` (as `AvOperationCall` and
|
|
60
|
+
* `AvDeferredOperationCall` decide it). `serverClient` and `serverClientTx` take
|
|
61
|
+
* the application forms over the Client Contract's view.
|
|
62
|
+
*/
|
|
63
|
+
type SurfaceCall<C extends AvContract, R extends AvResourceKey<C>, I extends AvOperationIdentity, S extends FacadeSurface> = S extends "application" ? "select" extends keyof AvOperationArgumentsFor<C, R, I, AvApplicationScalarForms> ? AvApplicationProjectingCall<C, R, I> : AvApplicationPlainCall<C, R, I> : S extends "client" ? "select" extends keyof AvOperationArgumentsFor<C, R, I, AvWireScalarForms> ? AvClientProjectingCall<C, R, I> : AvClientPlainCall<C, R, I> : S extends "serverClient" ? "select" extends keyof AvOperationArgumentsFor<C, R, I, AvApplicationScalarForms> ? AvServerClientProjectingCall<C, R, I> : AvServerClientPlainCall<C, R, I> : S extends "appTx" ? "select" extends keyof DeferredArguments<C, R, I, AvApplicationScalarForms, AvApplicationScalarForms> ? AvAppTxProjectingCall<C, R, I> : AvAppTxPlainCall<C, R, I> : S extends "clientTx" ? "select" extends keyof DeferredArguments<C, R, I, AvWireScalarForms, AvApplicationScalarForms> ? AvClientTxProjectingCall<C, R, I> : AvClientTxPlainCall<C, R, I> : "select" extends keyof DeferredArguments<C, R, I, AvApplicationScalarForms, AvApplicationScalarForms> ? AvServerClientTxProjectingCall<C, R, I> : AvServerClientTxPlainCall<C, R, I>;
|
|
64
|
+
/** The families view `C` advertises on Resource `R`. */
|
|
65
|
+
type FamilyKey<C extends AvContract, R extends AvResourceKey<C>> = keyof AvOperationGrammar<C>[R];
|
|
66
|
+
/** One family node of surface `S`; the public names below are its four instances. */
|
|
67
|
+
type FamilyNode<C extends AvContract, S extends FacadeSurface, R extends AvResourceKey<C>, F extends FamilyKey<C, R>> = {
|
|
68
|
+
readonly [V in keyof AvOperationGrammar<C>[R][F]]: SurfaceCall<C, R, AvOperationGrammar<C>[R][F][V] & AvOperationIdentity, S>;
|
|
69
|
+
};
|
|
70
|
+
/** `framework.application.<Resource>.<family>`: one direct call per variant, application forms. */
|
|
71
|
+
export type AvApplicationFamilyFacade<in out C extends AvContract, in out R extends AvResourceKey<C>, in out F extends FamilyKey<C, R>> = FamilyNode<C, "application", R, F>;
|
|
72
|
+
/** `framework.client.<Resource>.<family>`: one direct call per variant, wire forms. */
|
|
73
|
+
export type AvClientFamilyFacade<in out C extends AvContract, in out R extends AvResourceKey<C>, in out F extends FamilyKey<C, R>> = FamilyNode<C, "client", R, F>;
|
|
74
|
+
/** `framework.serverClient.<Resource>.<family>`: one direct call per variant, application forms. */
|
|
75
|
+
export type AvServerClientFamilyFacade<in out C extends AvContract, in out R extends AvResourceKey<C>, in out F extends FamilyKey<C, R>> = FamilyNode<C, "serverClient", R, F>;
|
|
76
|
+
/** `framework.appTx.<Resource>.<family>`: one deferred operation per variant. */
|
|
77
|
+
export type AvAppTxFamilyFacade<in out C extends AvContract, in out R extends AvResourceKey<C>, in out F extends FamilyKey<C, R>> = FamilyNode<C, "appTx", R, F>;
|
|
78
|
+
/** `framework.clientTx.<Resource>.<family>`: one deferred operation per variant. */
|
|
79
|
+
export type AvClientTxFamilyFacade<in out C extends AvContract, in out R extends AvResourceKey<C>, in out F extends FamilyKey<C, R>> = FamilyNode<C, "clientTx", R, F>;
|
|
80
|
+
/** `framework.serverClientTx.<Resource>.<family>`: one deferred operation per variant, application forms. */
|
|
81
|
+
export type AvServerClientTxFamilyFacade<in out C extends AvContract, in out R extends AvResourceKey<C>, in out F extends FamilyKey<C, R>> = FamilyNode<C, "serverClientTx", R, F>;
|
|
82
|
+
/** `framework.application.<Resource>`: one {@link AvApplicationFamilyFacade} per family. */
|
|
83
|
+
export type AvApplicationResourceFacade<in out C extends AvContract, in out R extends AvResourceKey<C>> = {
|
|
84
|
+
readonly [F in FamilyKey<C, R>]: AvApplicationFamilyFacade<C, R, F>;
|
|
85
|
+
};
|
|
86
|
+
/** `framework.client.<Resource>`: one {@link AvClientFamilyFacade} per family. */
|
|
87
|
+
export type AvClientResourceFacade<in out C extends AvContract, in out R extends AvResourceKey<C>> = {
|
|
88
|
+
readonly [F in FamilyKey<C, R>]: AvClientFamilyFacade<C, R, F>;
|
|
89
|
+
};
|
|
90
|
+
/** `framework.serverClient.<Resource>`: one {@link AvServerClientFamilyFacade} per family. */
|
|
91
|
+
export type AvServerClientResourceFacade<in out C extends AvContract, in out R extends AvResourceKey<C>> = {
|
|
92
|
+
readonly [F in FamilyKey<C, R>]: AvServerClientFamilyFacade<C, R, F>;
|
|
93
|
+
};
|
|
94
|
+
/** `framework.appTx.<Resource>`: one {@link AvAppTxFamilyFacade} per family. */
|
|
95
|
+
export type AvAppTxResourceFacade<in out C extends AvContract, in out R extends AvResourceKey<C>> = {
|
|
96
|
+
readonly [F in FamilyKey<C, R>]: AvAppTxFamilyFacade<C, R, F>;
|
|
97
|
+
};
|
|
98
|
+
/** `framework.clientTx.<Resource>`: one {@link AvClientTxFamilyFacade} per family. */
|
|
99
|
+
export type AvClientTxResourceFacade<in out C extends AvContract, in out R extends AvResourceKey<C>> = {
|
|
100
|
+
readonly [F in FamilyKey<C, R>]: AvClientTxFamilyFacade<C, R, F>;
|
|
101
|
+
};
|
|
102
|
+
/** `framework.serverClientTx.<Resource>`: one {@link AvServerClientTxFamilyFacade} per family. */
|
|
103
|
+
export type AvServerClientTxResourceFacade<in out C extends AvContract, in out R extends AvResourceKey<C>> = {
|
|
104
|
+
readonly [F in FamilyKey<C, R>]: AvServerClientTxFamilyFacade<C, R, F>;
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* `framework.application`: one {@link AvApplicationResourceFacade} per Resource
|
|
108
|
+
* of `C`, the Application Contract's view.
|
|
109
|
+
*/
|
|
110
|
+
export type AvApplicationFacade<C extends AvContract> = {
|
|
111
|
+
readonly [R in AvResourceKey<C>]: AvApplicationResourceFacade<C, R>;
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* `framework.client`: one {@link AvClientResourceFacade} per Resource of `C`,
|
|
115
|
+
* the Client Contract's view.
|
|
116
|
+
*/
|
|
117
|
+
export type AvClientFacade<C extends AvContract> = {
|
|
118
|
+
readonly [R in AvResourceKey<C>]: AvClientResourceFacade<C, R>;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* `framework.serverClient`: one {@link AvServerClientResourceFacade} per Resource
|
|
122
|
+
* of `C`, the Client Contract's view, taking application forms.
|
|
123
|
+
*/
|
|
124
|
+
export type AvServerClientFacade<C extends AvContract> = {
|
|
125
|
+
readonly [R in AvResourceKey<C>]: AvServerClientResourceFacade<C, R>;
|
|
126
|
+
};
|
|
127
|
+
/** `framework.appTx.$sql`: the developer SQL step only an application transaction has. */
|
|
128
|
+
type ApplicationSqlStep = {
|
|
129
|
+
/**
|
|
130
|
+
* A developer SQL step, written only as a tagged template:
|
|
131
|
+
* ``framework.appTx.$sql<Row>`select … ${value}` ``. Every interpolated value
|
|
132
|
+
* is bound as a parameter. See {@link AvSqlStatementBuilder}.
|
|
133
|
+
*/
|
|
134
|
+
readonly $sql: AvSqlStatementBuilder;
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* `framework.appTx`: one {@link AvAppTxResourceFacade} per Resource of `C`, the
|
|
138
|
+
* Application Contract's view, and `$sql`.
|
|
139
|
+
*/
|
|
140
|
+
export type AvAppTxFacade<C extends AvContract> = {
|
|
141
|
+
readonly [R in AvResourceKey<C>]: AvAppTxResourceFacade<C, R>;
|
|
142
|
+
} & ApplicationSqlStep;
|
|
43
143
|
/**
|
|
44
|
-
* `framework.
|
|
45
|
-
* Contract's view
|
|
144
|
+
* `framework.clientTx`: one {@link AvClientTxResourceFacade} per Resource of
|
|
145
|
+
* `C`, the Client Contract's view.
|
|
46
146
|
*/
|
|
47
|
-
export type
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
147
|
+
export type AvClientTxFacade<C extends AvContract> = {
|
|
148
|
+
readonly [R in AvResourceKey<C>]: AvClientTxResourceFacade<C, R>;
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* `framework.serverClientTx`: one {@link AvServerClientTxResourceFacade} per
|
|
152
|
+
* Resource of `C`, the Client Contract's view, taking application forms.
|
|
153
|
+
*/
|
|
154
|
+
export type AvServerClientTxFacade<C extends AvContract> = {
|
|
155
|
+
readonly [R in AvResourceKey<C>]: AvServerClientTxResourceFacade<C, R>;
|
|
156
|
+
};
|
|
157
|
+
type ApplicationSurface<C> = C extends AvContract ? string extends AvResourceKey<C> ? OpaqueSurface : AvApplicationFacade<C> : never;
|
|
158
|
+
type ClientSurface<C> = C extends AvContract ? string extends AvResourceKey<C> ? OpaqueSurface : AvClientFacade<C> : never;
|
|
159
|
+
type ServerClientSurface<C> = C extends AvContract ? string extends AvResourceKey<C> ? OpaqueSurface : AvServerClientFacade<C> : never;
|
|
160
|
+
type ApplicationDeferredSurface<C> = C extends AvContract ? string extends AvResourceKey<C> ? OpaqueSurface & ApplicationSqlStep : AvAppTxFacade<C> : never;
|
|
161
|
+
type ClientDeferredSurface<C> = C extends AvContract ? string extends AvResourceKey<C> ? OpaqueSurface : AvClientTxFacade<C> : never;
|
|
162
|
+
type ServerClientDeferredSurface<C> = C extends AvContract ? string extends AvResourceKey<C> ? OpaqueSurface : AvServerClientTxFacade<C> : never;
|
|
163
|
+
/** `framework.application`'s type: {@link AvApplicationFacade}, or opaque. */
|
|
164
|
+
export type ApplicationOperations<M extends AvAdapterModel, Cfg> = ApplicationSurface<AvContractApplicationView<M, Cfg>>;
|
|
165
|
+
/** `framework.client`'s type: {@link AvClientFacade}, or opaque. */
|
|
166
|
+
export type ClientOperations<M extends AvAdapterModel, Cfg> = ClientSurface<ClientContractView<M, Cfg>>;
|
|
167
|
+
/** `framework.serverClient`'s type: {@link AvServerClientFacade}, or opaque, and `$access`. */
|
|
168
|
+
export type ServerClientOperations<M extends AvAdapterModel, Cfg> = ServerClientSurface<ClientContractView<M, Cfg>> & ServerClientAccess<ClientContractView<M, Cfg>, AccessProviderOf<Cfg>>;
|
|
169
|
+
/** `framework.appTx`'s type: {@link AvAppTxFacade}, or opaque with `$sql`. */
|
|
170
|
+
export type ApplicationTransactionBuilders<M extends AvAdapterModel, Cfg> = ApplicationDeferredSurface<AvContractApplicationView<M, Cfg>>;
|
|
171
|
+
/** `framework.clientTx`'s type: {@link AvClientTxFacade}, or opaque. */
|
|
172
|
+
export type ClientTransactionBuilders<M extends AvAdapterModel, Cfg> = ClientDeferredSurface<ClientContractView<M, Cfg>>;
|
|
173
|
+
/** `framework.serverClientTx`'s type: {@link AvServerClientTxFacade}, or opaque. */
|
|
174
|
+
export type ServerClientTransactionBuilders<M extends AvAdapterModel, Cfg> = ServerClientDeferredSurface<ClientContractView<M, Cfg>>;
|
|
175
|
+
/**
|
|
176
|
+
* The Resources of a pipeline ctx: `ctx.<Resource>.<family>.<variant>(args)`,
|
|
177
|
+
* application-origin, resolving the operation's data.
|
|
178
|
+
*/
|
|
179
|
+
export type AvContextOperations<M extends AvAdapterModel> = ContextFacade<AvContractApplicationView<M>>;
|
|
180
|
+
type ContextFacade<C> = C extends AvContract ? string extends AvResourceKey<C> ? unknown : {
|
|
181
|
+
readonly [R in AvResourceKey<C>]: {
|
|
182
|
+
readonly [F in keyof AvOperationGrammar<C>[R]]: {
|
|
183
|
+
readonly [V in keyof AvOperationGrammar<C>[R][F]]: AvOperationCall<C, R, AvOperationGrammar<C>[R][F][V] & AvOperationIdentity, AvApplicationScalarForms, AvApplicationScalarForms, never>;
|
|
52
184
|
};
|
|
53
185
|
};
|
|
54
186
|
} : never;
|
|
55
187
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
188
|
+
* The Resources of compute's read-only ctx: `ctx.<Resource>.find.<variant>(args)`
|
|
189
|
+
* only (`find.count` included).
|
|
58
190
|
*/
|
|
59
|
-
export type
|
|
60
|
-
type
|
|
61
|
-
readonly [R in
|
|
62
|
-
readonly [F in keyof
|
|
63
|
-
readonly [V in keyof
|
|
191
|
+
export type AvComputeReads<M extends AvAdapterModel> = ComputeReadFacade<AvContractApplicationView<M>>;
|
|
192
|
+
type ComputeReadFacade<C> = C extends AvContract ? string extends AvResourceKey<C> ? unknown : {
|
|
193
|
+
readonly [R in AvResourceKey<C>]: {
|
|
194
|
+
readonly [F in Extract<keyof AvOperationGrammar<C>[R], "find">]: {
|
|
195
|
+
readonly [V in keyof AvOperationGrammar<C>[R][F]]: AvOperationCall<C, R, AvOperationGrammar<C>[R][F][V] & AvOperationIdentity, AvApplicationScalarForms, AvApplicationScalarForms, never>;
|
|
64
196
|
};
|
|
65
197
|
};
|
|
66
198
|
} : never;
|
|
67
|
-
/** Builds the request one façade call hands to `execute`, under its request id. */
|
|
68
|
-
export type FacadeRequest = (resource: string, identity:
|
|
69
|
-
type FacadeExecutor = (request:
|
|
199
|
+
/** Builds the request one façade call hands to `execute`, under its request id and state. */
|
|
200
|
+
export type FacadeRequest = (resource: string, identity: AvOperationIdentity, args: unknown, requestId: string, state: AvState | undefined) => AvOperationRequest;
|
|
201
|
+
type FacadeExecutor = (request: AvOperationRequest, caller: PolicyCaller | undefined) => Promise<AvOperationResponse>;
|
|
70
202
|
/**
|
|
71
203
|
* Builds a façade over `model`, the same object its types are read from, so a
|
|
72
204
|
* call that type-checks always reaches `execute`: a Resource, variant or field
|
|
@@ -74,20 +206,26 @@ type FacadeExecutor = (request: FrameworkOperationRequest) => Promise<OperationR
|
|
|
74
206
|
* validation layer answers it.
|
|
75
207
|
*
|
|
76
208
|
* Each call's request is `request`'s — its origin — under the caller's
|
|
77
|
-
* `
|
|
209
|
+
* `AvExecutionOptions.requestId`, or a freshly minted id when there is none, and
|
|
210
|
+
* with the caller's `AvExecutionOptions.state` when it gives one; an
|
|
78
211
|
* omitted argument is the empty argument object, which the type admits only
|
|
79
212
|
* when every member is optional.
|
|
80
213
|
*/
|
|
81
|
-
export declare function createOperationFacade<Facade>(model:
|
|
214
|
+
export declare function createOperationFacade<Facade>(model: AvAdapterModel, request: FacadeRequest, execute: FacadeExecutor): Facade;
|
|
215
|
+
/**
|
|
216
|
+
* An in-process call's settlement (a façade call or `framework.transaction`):
|
|
217
|
+
* the response's data, or its failure thrown.
|
|
218
|
+
*/
|
|
219
|
+
export declare function settleOperation(response: AvOperationResponse | AvTransactionResponse): unknown;
|
|
82
220
|
/**
|
|
83
221
|
* One leaf of an operation tree: the callable for one advertised variant. The
|
|
84
222
|
* second parameter is a façade call's options; a builder leaf ignores it.
|
|
85
223
|
*/
|
|
86
|
-
|
|
224
|
+
type OperationLeaf = (resource: string, identity: AvOperationIdentity) => (args?: unknown, options?: unknown) => unknown;
|
|
87
225
|
/**
|
|
88
226
|
* The runtime shape every façade and builder shares: one frozen property per
|
|
89
227
|
* Resource of `model`, one per family under it, one leaf per variant the model
|
|
90
228
|
* advertises in the standard grammar.
|
|
91
229
|
*/
|
|
92
|
-
export declare function createOperationTree<Tree>(model:
|
|
230
|
+
export declare function createOperationTree<Tree>(model: AvAdapterModel, leaf: OperationLeaf): Tree;
|
|
93
231
|
export {};
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import { isOperationVariantAvailable } from "../contracts/resource-operations.js";
|
|
2
2
|
import { parseOperationIdentity } from "../operations/operation-identity.js";
|
|
3
|
+
import { callerOf } from "../policy/policy-request.js";
|
|
4
|
+
import { thrownFailure } from "../runtime/framework-error.factory.js";
|
|
3
5
|
import { requestIdOf } from "../runtime/request-id.js";
|
|
6
|
+
import { stateOptionOf } from "../runtime/request-state.resolver.js";
|
|
4
7
|
export function createOperationFacade(model, request, execute) {
|
|
5
|
-
return createOperationTree(model, (resource, identity) => (args, options) => execute(request(resource, identity, args === undefined ? {} : args, requestIdOf(options))));
|
|
8
|
+
return createOperationTree(model, (resource, identity) => async (args, options) => settleOperation(await execute(request(resource, identity, args === undefined ? {} : args, requestIdOf(options), stateOptionOf(options)), callerOf(options))));
|
|
9
|
+
}
|
|
10
|
+
export function settleOperation(response) {
|
|
11
|
+
if (response.cause !== null) {
|
|
12
|
+
throw thrownFailure(response);
|
|
13
|
+
}
|
|
14
|
+
return response.data;
|
|
6
15
|
}
|
|
7
16
|
export function createOperationTree(model, leaf) {
|
|
8
17
|
const resources = Object.entries(model.resources).map(([resource, { operations }]) => {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,51 +1,68 @@
|
|
|
1
|
-
export type {
|
|
2
|
-
export type {
|
|
3
|
-
export type {
|
|
4
|
-
export type {
|
|
5
|
-
export type {
|
|
6
|
-
export type {
|
|
7
|
-
export type {
|
|
8
|
-
export type {
|
|
9
|
-
export {
|
|
10
|
-
export type
|
|
11
|
-
export type {
|
|
12
|
-
export type {
|
|
13
|
-
export type {
|
|
14
|
-
export type {
|
|
15
|
-
export type {
|
|
16
|
-
export type {
|
|
17
|
-
export type {
|
|
18
|
-
export type {
|
|
19
|
-
export type {
|
|
20
|
-
export type {
|
|
21
|
-
export type {
|
|
22
|
-
export type {
|
|
23
|
-
export type {
|
|
24
|
-
export type {
|
|
25
|
-
export type {
|
|
26
|
-
export type {
|
|
1
|
+
export type { AvAdapter } from "./adapters/adapter.interface.js";
|
|
2
|
+
export type { AvAdapterDiscoveryDiagnostic, AvAdapterDiscoveryDiagnosticCode, } from "./adapters/adapter-discovery-diagnostic.js";
|
|
3
|
+
export type { AvAdapterModel } from "./adapters/adapter-model.js";
|
|
4
|
+
export type { AvContracts } from "./compiler/contract.compiler.js";
|
|
5
|
+
export type { AvContractCompilerDiagnostic, AvContractCompilerDiagnosticCode, } from "./compiler/contract-compiler-diagnostic.js";
|
|
6
|
+
export type { AvConfigComputedFields } from "./config/computed-fields.js";
|
|
7
|
+
export type { AvMcpEndpoint } from "./config/config.resolver.js";
|
|
8
|
+
export type { AvConfigDiagnostic, AvConfigDiagnosticCode, } from "./config/config-diagnostic.js";
|
|
9
|
+
export type { AvConfigLayerName, AvRequestOrigin, } from "./config/config-layer.js";
|
|
10
|
+
export { type AvDefinedResource, defineResource, } from "./config/define-resource.js";
|
|
11
|
+
export type { AvConfigFieldKey, AvEffectiveFieldKey, } from "./config/effective-fields.js";
|
|
12
|
+
export type { AvConfigExact } from "./config/exact-framework-config.js";
|
|
13
|
+
export type { AvConfig, AvConfigAddedFieldDefinition, AvConfigAgentLayer, AvConfigAny, AvConfigExemptions, AvConfigFamily, AvConfigFieldDefinition, AvConfigFieldLifecycleTrait, AvConfigKnownFieldDefinition, AvConfigLayer, AvConfigLayerAny, AvConfigLayerKind, AvConfigLimits, AvConfigMcp, AvConfigOperations, AvConfigOperationsExemption, AvConfigOverlayField, AvConfigRelationFieldExemption, AvConfigResource, AvConfigResourceExemption, AvConfigResourceFields, AvConfigResourceKey, AvConfigResources, AvConfigResourcesAny, AvConfigResourceTransactions, AvConfigRootField, AvConfigScalarFieldExemption, AvConfigScalarTypeRef, AvConfigVariant, AvFieldCompute, AvRelationFieldCapabilityName, AvRelationFieldPipeline, AvScalarFieldCapabilityName, AvScalarFieldPipeline, AvZCheck, AvZFormat, } from "./config/framework-config.js";
|
|
14
|
+
export type { AvPipeline, AvTransactionPipeline, } from "./config/pipeline-config.js";
|
|
15
|
+
export type { AvPaginationCapability, AvProjectionScope, AvRelationFilterCapability, AvRelationMutationDirective, AvRelationReducer, AvScalarFilterOperator, AvScalarMutationDirective, AvWriteScope, } from "./contracts/capability.js";
|
|
16
|
+
export type { AvContract, AvContractAgent, AvContractApplication, AvContractClient, AvContractCore, AvCoreResource, } from "./contracts/contract.js";
|
|
17
|
+
export type { AvContractClientAccess } from "./contracts/contract-access.js";
|
|
18
|
+
export type { AvContractLimits } from "./contracts/contract-limits.js";
|
|
19
|
+
export type { AvContractClientProtocol, AvContractHash, AvContractProtocol, } from "./contracts/contract-protocol.js";
|
|
20
|
+
export type { AvCreateRequirementGroup, AvCreateRequirements, } from "./contracts/create-requirements.js";
|
|
21
|
+
export type { AvEnumDefinition } from "./contracts/enum-definition.js";
|
|
22
|
+
export type { AvCoreField, AvCoreRelationField, AvField, AvProjectionScopes, AvRelationField, AvRelationFieldCapabilities, AvRelationMutationCapability, AvRelationProjectionCapability, AvRelationReducerCapability, AvScalarField, AvScalarFieldCapabilities, AvScalarFormat, AvScopedRelationMutations, AvScopedRelationReducers, AvWriteScopes, } from "./contracts/field.js";
|
|
23
|
+
export type { AvFieldCheck } from "./contracts/field-check.js";
|
|
24
|
+
export type { AvIdentifier, AvScalarFieldKey } from "./contracts/identifier.js";
|
|
25
|
+
export type { AvLifecycleTrait } from "./contracts/lifecycle-trait.js";
|
|
26
|
+
export type { AvResource, AvResourceFieldMap } from "./contracts/resource.js";
|
|
27
|
+
export type { AvOperationAvailability, AvOperationVariantScopes, AvResourceOperations, } from "./contracts/resource-operations.js";
|
|
28
|
+
export type { AvBuiltInScalar, AvScalarDefinition, AvScalarRegistry, } from "./contracts/scalar.js";
|
|
29
|
+
export type { AvApplicationScalarForms, AvScalarValueType, AvWireScalarForms, } from "./contracts/scalar-value-type.js";
|
|
30
|
+
export type { AvTransactionCapability } from "./contracts/transaction-capability.js";
|
|
31
|
+
export type { AvContractView, AvManagedContractView, } from "./framework/contract-view.js";
|
|
27
32
|
export { createFramework } from "./framework/framework.factory.js";
|
|
28
|
-
export type {
|
|
29
|
-
export type {
|
|
30
|
-
export {
|
|
31
|
-
export type {
|
|
32
|
-
export type {
|
|
33
|
-
export type {
|
|
34
|
-
export type {
|
|
35
|
-
export type {
|
|
36
|
-
export {
|
|
37
|
-
export type {
|
|
38
|
-
export type {
|
|
39
|
-
export type {
|
|
40
|
-
export {
|
|
41
|
-
export type {
|
|
42
|
-
export
|
|
43
|
-
export type {
|
|
44
|
-
export
|
|
45
|
-
export type {
|
|
46
|
-
export type {
|
|
47
|
-
export {
|
|
48
|
-
export type {
|
|
49
|
-
export type {
|
|
50
|
-
export type {
|
|
51
|
-
export {
|
|
33
|
+
export type { AvFramework } from "./framework/framework.js";
|
|
34
|
+
export type { AvConstructionDiagnostic, AvConstructionStage, } from "./framework/framework-construction.error.js";
|
|
35
|
+
export { AvConstructionError } from "./framework/framework-construction.error.js";
|
|
36
|
+
export type { AvApplicationFacade, AvApplicationFamilyFacade, AvApplicationPlainCall, AvApplicationProjectingCall, AvApplicationResourceFacade, AvAppTxFacade, AvAppTxFamilyFacade, AvAppTxPlainCall, AvAppTxProjectingCall, AvAppTxResourceFacade, AvClientFacade, AvClientFamilyFacade, AvClientPlainCall, AvClientProjectingCall, AvClientResourceFacade, AvClientTxFacade, AvClientTxFamilyFacade, AvClientTxPlainCall, AvClientTxProjectingCall, AvClientTxResourceFacade, AvServerClientFacade, AvServerClientFamilyFacade, AvServerClientPlainCall, AvServerClientProjectingCall, AvServerClientResourceFacade, AvServerClientTxFacade, AvServerClientTxFamilyFacade, AvServerClientTxPlainCall, AvServerClientTxProjectingCall, AvServerClientTxResourceFacade, } from "./framework/operation-facade.js";
|
|
37
|
+
export type { AvCreateDataInput, AvCursorInput, AvFieldKey, AvIncludeInput, AvNoAdvertisedMember, AvNullsOrder, AvOperationArgumentMap, AvOperationArgumentsFor, AvOrderByEntry, AvOrderByInput, AvProjectionEntry, AvRelationProjectionInput, AvResourceKey, AvScalarFilterOperands, AvScalarOrderInput, AvScalarWhereInput, AvSelectInput, AvSortDirection, AvUniqueWhereInput, AvUpdateDataInput, AvWhereInput, } from "./operations/operation-arguments.js";
|
|
38
|
+
export type { AvDeferredOperationCall, AvOperationCall, AvOperationGrammar, AvOperationSlot, } from "./operations/operation-call.js";
|
|
39
|
+
export type { AvOperationFamily, AvOperationIdentity, AvOperationVariant, } from "./operations/operation-identity.js";
|
|
40
|
+
export type { AvOperationResultFor } from "./operations/operation-result.js";
|
|
41
|
+
export type { AvValidationCode, AvValidationIssue, } from "./operations/validation-code.js";
|
|
42
|
+
export type { AvAccessProvider } from "./policy/access-provider.interface.js";
|
|
43
|
+
export type { AvAccessQuestion } from "./policy/access-question.js";
|
|
44
|
+
export type { AvAccessVerbs } from "./policy/access-verbs.js";
|
|
45
|
+
export type { AvPolicyEngine, AvPolicyWhere, } from "./policy/policy-engine.js";
|
|
46
|
+
export type { AvPrebuiltContracts } from "./prebuilt/prebuilt-contracts.js";
|
|
47
|
+
export { AvDecimal } from "./runtime/decimal.js";
|
|
48
|
+
export type { AvCanDiagnostic, AvDiagnostic, AvDiagnosticsSink, AvMcpDiagnostic, AvOperationDiagnostic, AvTransactionDiagnostic, } from "./runtime/diagnostics-reporter.js";
|
|
49
|
+
export { AvErrorCatalog, type AvErrorCatalogCode, type AvErrorCatalogEntry, type AvErrorKind, } from "./runtime/error.catalog.js";
|
|
50
|
+
export type { AvExecutionOptions } from "./runtime/execution-options.js";
|
|
51
|
+
export type { AvComputeContext, AvComputeCreate, AvComputeRead, AvComputeUpdate, } from "./runtime/field-compute.js";
|
|
52
|
+
export { AvAuthError, AvConflictError, AvContractMismatchError, AvError, AvInternalError, AvNotFoundError, AvProtocolError, AvValidationError, } from "./runtime/framework-error.js";
|
|
53
|
+
export type { AvJsonValue } from "./runtime/json-value.js";
|
|
54
|
+
export type { AvMisuseEvent, AvMisuseSink, } from "./runtime/misuse-reporter.js";
|
|
55
|
+
export type { AvAgentOperationRequest, AvApplicationOperationRequest, AvClientOperationRequest, AvOperationRequest, AvRequestProtocol, } from "./runtime/operation-request.js";
|
|
56
|
+
export type { AvCause, AvOperationCode, AvOperationErrorCode, AvOperationFailureResponse, AvOperationNoMatchResponse, AvOperationResponse, AvOperationSuccessCode, AvOperationSuccessDataCode, AvOperationSuccessResponse, } from "./runtime/operation-response.js";
|
|
57
|
+
export type { AvAfterHook, AvBeforeHook, AvContext, AvFieldGuard, AvFieldPipe, AvFilter, AvGuard, AvInterceptor, AvPipe, AvTransactionAfterHook, AvTransactionBeforeHook, AvTransactionContext, AvTransactionFilter, AvTransactionGuard, AvTransactionInterceptor, AvTransactionPipe, AvTransactionStep, AvTransportContext, } from "./runtime/pipeline.js";
|
|
58
|
+
export type { AvDeepReadonly } from "./runtime/readonly-value.js";
|
|
59
|
+
export type { AvState } from "./runtime/request-state.js";
|
|
60
|
+
export type { AvOperation, AvOperationHandle, AvOperationReferenceSurface, AvReferenceableField, AvReferenceBuilder, AvSingleRowResult, AvTransactionResults, AvTransactionRunner, } from "./transactions/deferred-operation.js";
|
|
61
|
+
export type { AvSqlStatementBuilder, AvSqlStatementValue, } from "./transactions/sql-statement.js";
|
|
62
|
+
export type { AvTransactionIntegrityViolation } from "./transactions/transaction-integrity-error.js";
|
|
63
|
+
export { AvTransactionIntegrityError } from "./transactions/transaction-integrity-error.js";
|
|
64
|
+
export type { AvTransactionReference } from "./transactions/transaction-reference.js";
|
|
65
|
+
export type { AvAgentTransactionRequest, AvApplicationTransactionRequest, AvClientTransactionRequest, AvTransactionRequest, } from "./transactions/transaction-request.js";
|
|
66
|
+
export type { AvTransactionCommittedResponse, AvTransactionResponse, } from "./transactions/transaction-response.js";
|
|
67
|
+
export type { AvTransactionSlotPathViolation } from "./transactions/transaction-slot-path-error.js";
|
|
68
|
+
export { AvTransactionSlotPathError } from "./transactions/transaction-slot-path-error.js";
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { defineResource, } from "./config/define-resource.js";
|
|
2
2
|
export { createFramework } from "./framework/framework.factory.js";
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
3
|
+
export { AvConstructionError } from "./framework/framework-construction.error.js";
|
|
4
|
+
export { AvDecimal } from "./runtime/decimal.js";
|
|
5
|
+
export { AvErrorCatalog, } from "./runtime/error.catalog.js";
|
|
6
|
+
export { AvAuthError, AvConflictError, AvContractMismatchError, AvError, AvInternalError, AvNotFoundError, AvProtocolError, AvValidationError, } from "./runtime/framework-error.js";
|
|
7
|
+
export { AvTransactionIntegrityError } from "./transactions/transaction-integrity-error.js";
|
|
8
|
+
export { AvTransactionSlotPathError } from "./transactions/transaction-slot-path-error.js";
|
package/dist/internal.d.ts
CHANGED
|
@@ -6,30 +6,40 @@
|
|
|
6
6
|
* stability promise: any export here may change or disappear in any release,
|
|
7
7
|
* including a patch release. Applications import from `@aventara/core`.
|
|
8
8
|
*/
|
|
9
|
-
export type {
|
|
10
|
-
export type {
|
|
11
|
-
export type {
|
|
12
|
-
export type {
|
|
13
|
-
export type {
|
|
9
|
+
export type { AvAdapterField, AvAdapterLifecycleTrait, AvAdapterRelationField, AvAdapterScalarField, } from "./adapters/adapter-field.js";
|
|
10
|
+
export type { AvAdapterIdentifier, AvAdapterScalarFieldKey, } from "./adapters/adapter-identifier.js";
|
|
11
|
+
export type { AvAdapterOperation } from "./adapters/adapter-operation.js";
|
|
12
|
+
export type { AvAdapterOperationExecutor } from "./adapters/adapter-operation-executor.interface.js";
|
|
13
|
+
export type { AvAdapterFieldKey, AvAdapterFieldMap, AvAdapterResource, } from "./adapters/adapter-resource.js";
|
|
14
|
+
export type { AvAdapterSqlStatement, AvAdapterSqlValue, } from "./adapters/adapter-sql-statement.js";
|
|
15
|
+
export type { AvAdapterTransactionExecutor } from "./adapters/adapter-transaction-executor.interface.js";
|
|
14
16
|
export { compileContracts } from "./compiler/contract.compiler.js";
|
|
15
17
|
export { resolveFrameworkConfig } from "./config/config.resolver.js";
|
|
16
18
|
export { PROJECTION_SCOPES, WRITE_SCOPES } from "./contracts/capability.js";
|
|
17
19
|
export { validateClientContractStructure } from "./contracts/client-contract-structure.validator.js";
|
|
18
|
-
export {
|
|
19
|
-
export type {
|
|
20
|
+
export { AvCanonicalJsonError, canonicalizeContract, canonicalizeJson, } from "./contracts/contract-canonicalizer.js";
|
|
21
|
+
export type { AvContractClientHashInput } from "./contracts/contract-hash.js";
|
|
20
22
|
export { computeClientContractHash, verifyClientContractHash, } from "./contracts/contract-hash.js";
|
|
21
23
|
export { DEFAULT_CONTRACT_LIMITS } from "./contracts/contract-limits.js";
|
|
22
24
|
export { AVENTARA_PROTOCOL_VERSION } from "./contracts/contract-protocol.js";
|
|
23
25
|
export { advertisedDirectives, advertisedReducers } from "./contracts/field.js";
|
|
26
|
+
export { projectJsonValue } from "./contracts/json-schema.projector.js";
|
|
24
27
|
export { LIFECYCLE_TRAITS } from "./contracts/lifecycle-trait.js";
|
|
25
28
|
export { isOperationVariantAvailable, projectionScopeOf, writeScopeOf, } from "./contracts/resource-operations.js";
|
|
26
29
|
export { BUILT_IN_SCALARS } from "./contracts/scalar.js";
|
|
27
30
|
export { TRANSACTION_CAPABILITIES } from "./contracts/transaction-capability.js";
|
|
28
|
-
export type {
|
|
31
|
+
export type { AvContractApplicationView } from "./framework/contract-view.js";
|
|
32
|
+
export type { AvDatabaseRefusal } from "./operations/database-refusal.js";
|
|
33
|
+
export { DATABASE_REFUSALS } from "./operations/database-refusal.js";
|
|
29
34
|
export type { SemanticOperationArguments } from "./operations/operation-validator.js";
|
|
30
35
|
export { VALIDATION_CODES } from "./operations/validation-code.js";
|
|
31
|
-
export
|
|
36
|
+
export { accessProviderOf } from "./policy/access-provider.registry.js";
|
|
37
|
+
export { ACCESS_VERB_NAMES, ACCESS_VERBS, providerVerb, } from "./policy/access-verb.table.js";
|
|
38
|
+
export { prebuiltFileChanges } from "./prebuilt/prebuilt-changes.js";
|
|
39
|
+
export { emitPrebuiltContracts, prebuiltContractsOf, } from "./prebuilt/prebuilt-contracts.emitter.js";
|
|
40
|
+
export { mcpFailureReporterOf } from "./runtime/diagnostics-reporter.js";
|
|
41
|
+
export type { AvErrorClassName } from "./runtime/framework-error-class.table.js";
|
|
42
|
+
export { FRAMEWORK_ERROR_CLASS_OF } from "./runtime/framework-error-class.table.js";
|
|
32
43
|
export { OPERATION_CODES } from "./runtime/operation-response.js";
|
|
33
44
|
export type { BuiltinNonRow, OperationFingerprint, } from "./transactions/deferred-operation.js";
|
|
34
45
|
export { computeOperationFingerprint } from "./transactions/operation-fingerprint.js";
|
|
35
|
-
export type { ApplicationTransactionRequest, ClientTransactionRequest, FrameworkTransactionRequest, } from "./transactions/transaction-request.js";
|
package/dist/internal.js
CHANGED
|
@@ -2,15 +2,23 @@ export { compileContracts } from "./compiler/contract.compiler.js";
|
|
|
2
2
|
export { resolveFrameworkConfig } from "./config/config.resolver.js";
|
|
3
3
|
export { PROJECTION_SCOPES, WRITE_SCOPES } from "./contracts/capability.js";
|
|
4
4
|
export { validateClientContractStructure } from "./contracts/client-contract-structure.validator.js";
|
|
5
|
-
export {
|
|
5
|
+
export { AvCanonicalJsonError, canonicalizeContract, canonicalizeJson, } from "./contracts/contract-canonicalizer.js";
|
|
6
6
|
export { computeClientContractHash, verifyClientContractHash, } from "./contracts/contract-hash.js";
|
|
7
7
|
export { DEFAULT_CONTRACT_LIMITS } from "./contracts/contract-limits.js";
|
|
8
8
|
export { AVENTARA_PROTOCOL_VERSION } from "./contracts/contract-protocol.js";
|
|
9
9
|
export { advertisedDirectives, advertisedReducers } from "./contracts/field.js";
|
|
10
|
+
export { projectJsonValue } from "./contracts/json-schema.projector.js";
|
|
10
11
|
export { LIFECYCLE_TRAITS } from "./contracts/lifecycle-trait.js";
|
|
11
12
|
export { isOperationVariantAvailable, projectionScopeOf, writeScopeOf, } from "./contracts/resource-operations.js";
|
|
12
13
|
export { BUILT_IN_SCALARS } from "./contracts/scalar.js";
|
|
13
14
|
export { TRANSACTION_CAPABILITIES } from "./contracts/transaction-capability.js";
|
|
15
|
+
export { DATABASE_REFUSALS } from "./operations/database-refusal.js";
|
|
14
16
|
export { VALIDATION_CODES } from "./operations/validation-code.js";
|
|
17
|
+
export { accessProviderOf } from "./policy/access-provider.registry.js";
|
|
18
|
+
export { ACCESS_VERB_NAMES, ACCESS_VERBS, providerVerb, } from "./policy/access-verb.table.js";
|
|
19
|
+
export { prebuiltFileChanges } from "./prebuilt/prebuilt-changes.js";
|
|
20
|
+
export { emitPrebuiltContracts, prebuiltContractsOf, } from "./prebuilt/prebuilt-contracts.emitter.js";
|
|
21
|
+
export { mcpFailureReporterOf } from "./runtime/diagnostics-reporter.js";
|
|
22
|
+
export { FRAMEWORK_ERROR_CLASS_OF } from "./runtime/framework-error-class.table.js";
|
|
15
23
|
export { OPERATION_CODES } from "./runtime/operation-response.js";
|
|
16
24
|
export { computeOperationFingerprint } from "./transactions/operation-fingerprint.js";
|