@aventara/core 1.0.0-rc.0 → 1.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1140 -0
- package/README.md +224 -57
- package/dist/adapters/adapter-discovery-diagnostic.d.ts +4 -4
- package/dist/adapters/adapter-field.d.ts +11 -11
- package/dist/adapters/adapter-identifier.d.ts +6 -6
- package/dist/adapters/adapter-model.d.ts +9 -9
- package/dist/adapters/adapter-operation-executor.interface.d.ts +4 -4
- package/dist/adapters/adapter-operation.d.ts +3 -3
- package/dist/adapters/adapter-resource.d.ts +18 -9
- package/dist/adapters/adapter-sql-statement.d.ts +19 -0
- package/dist/adapters/adapter-transaction-executor.interface.d.ts +19 -0
- package/dist/adapters/adapter.interface.d.ts +49 -29
- package/dist/avz/avz-check.factory.d.ts +83 -0
- package/dist/avz/avz-check.factory.js +116 -0
- package/dist/avz/avz-check.registry.d.ts +35 -0
- package/dist/avz/avz-check.registry.js +9 -0
- package/dist/avz/avz.d.ts +203 -0
- package/dist/{json → avz}/avz.js +150 -8
- package/dist/{json → avz}/index.d.ts +2 -1
- package/dist/{json → avz}/json-shape.registry.d.ts +7 -7
- package/dist/{json → avz}/zod-issue.translator.d.ts +8 -2
- package/dist/{json → avz}/zod-issue.translator.js +7 -0
- package/dist/compiler/contract-compiler-diagnostic.d.ts +31 -5
- package/dist/compiler/contract.compiler.d.ts +18 -18
- package/dist/compiler/contract.compiler.js +548 -441
- package/dist/compiler/create-requirements.projector.d.ts +49 -0
- package/dist/compiler/create-requirements.projector.js +423 -0
- package/dist/compiler/field-validator.compiler.d.ts +47 -0
- package/dist/compiler/field-validator.compiler.js +238 -0
- package/dist/config/any-framework-config.d.ts +19 -12
- package/dist/config/config-diagnostic.d.ts +11 -4
- package/dist/config/config-layer.d.ts +15 -6
- package/dist/config/config.resolver.d.ts +74 -31
- package/dist/config/config.resolver.js +108 -44
- package/dist/config/config.validator.d.ts +7 -7
- package/dist/config/config.validator.js +581 -72
- package/dist/config/define-resource.d.ts +57 -0
- package/dist/config/define-resource.js +14 -0
- package/dist/config/effective-fields.d.ts +19 -23
- package/dist/config/entrypoint.normalizer.d.ts +1 -1
- package/dist/config/exact-framework-config.d.ts +280 -0
- package/dist/config/field-compute.resolver.d.ts +19 -0
- package/dist/config/field-compute.resolver.js +115 -0
- package/dist/config/field-pipeline-config.d.ts +47 -0
- package/dist/config/forced-operation.validator.d.ts +10 -0
- package/dist/config/forced-operation.validator.js +66 -0
- package/dist/config/framework-config.d.ts +110 -39
- package/dist/config/framework-exemptions-config.d.ts +91 -0
- package/dist/config/framework-exemptions-config.js +1 -0
- package/dist/config/framework-field-definition.d.ts +78 -0
- package/dist/config/framework-field-definition.js +28 -0
- package/dist/config/framework-resources-config.d.ts +116 -0
- package/dist/config/framework-resources-config.js +1 -0
- package/dist/config/pipeline-config.d.ts +56 -20
- package/dist/config/pipeline-tree.resolver.d.ts +79 -0
- package/dist/config/pipeline-tree.resolver.js +220 -0
- package/dist/config/stage-type.eraser.d.ts +65 -0
- package/dist/config/stage-type.eraser.js +1 -0
- package/dist/contracts/capability.d.ts +11 -11
- package/dist/contracts/client-contract-structure.validator.d.ts +323 -28
- package/dist/contracts/client-contract-structure.validator.js +152 -8
- package/dist/contracts/contract-canonicalizer.d.ts +19 -3
- package/dist/contracts/contract-canonicalizer.js +141 -28
- package/dist/contracts/contract-hash.d.ts +12 -7
- package/dist/contracts/contract-hash.js +3 -2
- package/dist/contracts/contract-limits.d.ts +4 -1
- package/dist/contracts/contract-limits.js +1 -0
- package/dist/contracts/contract-lookup.d.ts +5 -5
- package/dist/contracts/contract-protocol.d.ts +4 -4
- package/dist/contracts/contract.d.ts +24 -16
- package/dist/contracts/create-requirements.d.ts +35 -0
- package/dist/contracts/create-requirements.js +1 -0
- package/dist/contracts/enum-definition.d.ts +1 -1
- package/dist/contracts/field-check.d.ts +101 -0
- package/dist/contracts/field-check.js +1 -0
- package/dist/contracts/field.d.ts +52 -42
- package/dist/contracts/identifier.d.ts +4 -4
- package/dist/contracts/json-shape.d.ts +12 -1
- package/dist/contracts/lifecycle-trait.d.ts +2 -2
- package/dist/contracts/resource-operations.d.ts +28 -28
- package/dist/contracts/resource.d.ts +15 -9
- package/dist/contracts/scalar-value-type.d.ts +15 -15
- package/dist/contracts/scalar.d.ts +3 -3
- package/dist/contracts/transaction-capability.d.ts +1 -1
- package/dist/contracts/wire-scalar-format.d.ts +4 -4
- package/dist/framework/contract-view.d.ts +213 -147
- package/dist/framework/framework-construction.error.d.ts +10 -10
- package/dist/framework/framework-construction.error.js +2 -2
- package/dist/framework/framework.d.ts +47 -23
- package/dist/framework/framework.factory.d.ts +8 -6
- package/dist/framework/framework.factory.js +40 -20
- package/dist/framework/operation-facade.d.ts +123 -52
- package/dist/framework/operation-facade.js +9 -1
- package/dist/index.d.ts +55 -50
- package/dist/index.js +6 -6
- package/dist/internal.d.ts +15 -10
- package/dist/internal.js +3 -1
- package/dist/operations/operation-arguments.d.ts +267 -202
- package/dist/operations/operation-call.d.ts +27 -28
- package/dist/operations/operation-identity.d.ts +10 -10
- package/dist/operations/operation-result.d.ts +21 -21
- package/dist/operations/operation-validator-core.d.ts +6 -6
- package/dist/operations/operation-validator-core.js +13 -2
- package/dist/operations/operation-validator.d.ts +9 -9
- package/dist/operations/projection-scope.resolver.d.ts +6 -6
- package/dist/operations/structural-limits.walker.d.ts +6 -6
- package/dist/operations/structural-limits.walker.js +145 -0
- package/dist/operations/validation-code.d.ts +11 -6
- package/dist/operations/validation-code.js +4 -0
- package/dist/operations/write-scope.resolver.d.ts +6 -6
- package/dist/protocol/absent-route.responder.d.ts +13 -12
- package/dist/protocol/absent-route.responder.js +19 -19
- package/dist/protocol/contract-document.responder.d.ts +3 -3
- package/dist/protocol/contract-document.responder.js +2 -2
- package/dist/protocol/http-request.decoder.d.ts +17 -13
- package/dist/protocol/http-request.decoder.js +10 -10
- package/dist/protocol/http-request.reader.d.ts +3 -3
- package/dist/protocol/http-response.encoder.d.ts +4 -4
- package/dist/protocol/http-response.encoder.js +94 -55
- package/dist/protocol/http-status.table.d.ts +2 -2
- package/dist/protocol/operation-response.guard.d.ts +2 -2
- package/dist/protocol/protocol-surface.d.ts +4 -4
- package/dist/protocol/protocol.binder.d.ts +50 -27
- package/dist/protocol/protocol.binder.js +12 -9
- package/dist/protocol/protocol.handler.d.ts +22 -13
- package/dist/protocol/protocol.handler.js +44 -9
- package/dist/protocol/unmounted-route.error.d.ts +4 -4
- package/dist/protocol/unmounted-route.error.js +2 -2
- package/dist/runtime/caller-data.copier.d.ts +5 -5
- package/dist/runtime/caller-data.copier.js +13 -13
- package/dist/runtime/caller-data.door.d.ts +6 -6
- package/dist/runtime/caller-data.door.js +6 -4
- package/dist/runtime/computed-read-runtime.d.ts +7 -6
- package/dist/runtime/computed-read-runtime.js +61 -48
- package/dist/runtime/computed-value.error.d.ts +6 -6
- package/dist/runtime/computed-value.error.js +3 -3
- package/dist/runtime/context-executor.runtime.d.ts +59 -0
- package/dist/runtime/context-executor.runtime.js +275 -0
- package/dist/runtime/create-requirement.d.ts +10 -81
- package/dist/runtime/create-requirement.js +80 -57
- package/dist/runtime/decimal.d.ts +2 -2
- package/dist/runtime/decimal.js +1 -1
- package/dist/runtime/diagnostics-reporter.d.ts +53 -27
- package/dist/runtime/diagnostics-reporter.js +24 -0
- package/dist/runtime/error-boundary.d.ts +65 -8
- package/dist/runtime/error-boundary.js +45 -19
- package/dist/runtime/execution-options.d.ts +10 -2
- package/dist/runtime/field-check.evaluator.d.ts +29 -0
- package/dist/runtime/field-check.evaluator.js +521 -0
- package/dist/runtime/field-compute.d.ts +64 -0
- package/dist/runtime/field-compute.js +1 -0
- package/dist/runtime/field-stage.plan.d.ts +15 -0
- package/dist/runtime/field-stage.plan.js +27 -0
- package/dist/runtime/field-stage.runtime.d.ts +35 -0
- package/dist/runtime/field-stage.runtime.js +143 -0
- package/dist/runtime/field-validator.runtime.d.ts +11 -0
- package/dist/runtime/field-validator.runtime.js +87 -0
- package/dist/runtime/framework-error-class.table.d.ts +33 -0
- package/dist/runtime/framework-error-class.table.js +25 -0
- package/dist/runtime/framework-error.d.ts +68 -8
- package/dist/runtime/framework-error.factory.d.ts +4 -0
- package/dist/runtime/framework-error.factory.js +15 -0
- package/dist/runtime/framework-error.js +23 -2
- package/dist/runtime/interceptor-next.error.d.ts +5 -0
- package/dist/runtime/interceptor-next.error.js +6 -0
- package/dist/runtime/json-value.d.ts +3 -3
- package/dist/runtime/level-lifecycle.runtime.d.ts +25 -0
- package/dist/runtime/level-lifecycle.runtime.js +42 -0
- package/dist/runtime/misuse-reporter.d.ts +12 -12
- package/dist/runtime/mutation-planner.d.ts +19 -10
- package/dist/runtime/mutation-planner.js +54 -30
- package/dist/runtime/nested-write.walker.d.ts +32 -0
- package/dist/runtime/nested-write.walker.js +73 -0
- package/dist/runtime/operation-request.d.ts +33 -6
- package/dist/runtime/operation-response.d.ts +17 -17
- package/dist/runtime/operation-runtime.d.ts +113 -25
- package/dist/runtime/operation-runtime.js +395 -74
- package/dist/runtime/outcome-mapper.d.ts +16 -5
- package/dist/runtime/outcome-mapper.js +23 -6
- package/dist/runtime/output-validator.d.ts +10 -10
- package/dist/runtime/output-validator.js +3 -3
- package/dist/runtime/owned-execution.registry.d.ts +6 -6
- package/dist/runtime/pipe-output.validator.d.ts +33 -18
- package/dist/runtime/pipe-output.validator.js +12 -12
- package/dist/runtime/pipeline.d.ts +196 -34
- package/dist/runtime/readonly-value.d.ts +32 -0
- package/dist/runtime/readonly-value.js +141 -0
- package/dist/runtime/request-envelope.validator.d.ts +3 -3
- package/dist/runtime/request-envelope.validator.js +12 -7
- package/dist/runtime/request-id.d.ts +1 -1
- package/dist/runtime/request-state.d.ts +14 -0
- package/dist/runtime/request-state.js +1 -0
- package/dist/runtime/request-state.resolver.d.ts +12 -0
- package/dist/runtime/request-state.resolver.js +20 -0
- package/dist/runtime/scalar-runtime.d.ts +31 -16
- package/dist/runtime/scalar-runtime.js +16 -18
- package/dist/transactions/deferred-operation.d.ts +35 -20
- package/dist/transactions/operation-arguments-encoder.d.ts +3 -3
- package/dist/transactions/operation-arguments-encoder.js +2 -2
- package/dist/transactions/sql-statement.d.ts +77 -0
- package/dist/transactions/sql-statement.js +47 -0
- package/dist/transactions/sql-statement.validator.d.ts +44 -0
- package/dist/transactions/sql-statement.validator.js +134 -0
- package/dist/transactions/transaction-envelope.d.ts +4 -4
- package/dist/transactions/transaction-integrity-error.d.ts +6 -6
- package/dist/transactions/transaction-integrity-error.js +5 -2
- package/dist/transactions/transaction-plan-assembler.d.ts +21 -11
- package/dist/transactions/transaction-plan-assembler.js +148 -34
- package/dist/transactions/transaction-plan-validator.d.ts +29 -20
- package/dist/transactions/transaction-plan-validator.js +70 -38
- package/dist/transactions/transaction-reference-collector.d.ts +5 -5
- package/dist/transactions/transaction-reference-resolver.d.ts +19 -2
- package/dist/transactions/transaction-reference-resolver.js +26 -14
- package/dist/transactions/transaction-reference-validator.d.ts +34 -4
- package/dist/transactions/transaction-reference-validator.js +58 -26
- package/dist/transactions/transaction-reference.d.ts +13 -13
- package/dist/transactions/transaction-request.d.ts +18 -5
- package/dist/transactions/transaction-response.d.ts +6 -6
- package/dist/transactions/transaction-runtime.d.ts +8 -7
- package/dist/transactions/transaction-runtime.js +166 -50
- package/dist/transactions/transaction-settlement.runtime.d.ts +51 -0
- package/dist/transactions/transaction-settlement.runtime.js +120 -0
- package/dist/transactions/transaction-slot-path-error.d.ts +4 -4
- package/dist/transactions/transaction-slot-path-error.js +2 -2
- package/dist/transactions/transaction-slot-writer.js +2 -2
- package/dist/transactions/transaction-stage.runtime.d.ts +81 -0
- package/dist/transactions/transaction-stage.runtime.js +123 -0
- package/package.json +6 -5
- package/src/runtime/field-check.evaluator.ts +720 -0
- package/dist/config/define-fields.d.ts +0 -42
- package/dist/config/define-fields.js +0 -3
- package/dist/config/framework-behaviors-config.d.ts +0 -30
- package/dist/config/framework-fields-config.d.ts +0 -42
- package/dist/config/framework-restrictions-config.d.ts +0 -142
- package/dist/json/avz.d.ts +0 -96
- package/dist/runtime/field-behavior.d.ts +0 -48
- /package/dist/{config/framework-behaviors-config.js → adapters/adapter-sql-statement.js} +0 -0
- /package/dist/{config/framework-fields-config.js → adapters/adapter-transaction-executor.interface.js} +0 -0
- /package/dist/{json → avz}/index.js +0 -0
- /package/dist/{json → avz}/json-shape.registry.js +0 -0
- /package/dist/config/{framework-restrictions-config.js → exact-framework-config.js} +0 -0
- /package/dist/{runtime/field-behavior.js → config/field-pipeline-config.js} +0 -0
|
@@ -1,28 +1,31 @@
|
|
|
1
1
|
import { compileContracts } from "../compiler/contract.compiler.js";
|
|
2
2
|
import { resolveFrameworkConfig } from "../config/config.resolver.js";
|
|
3
3
|
import { validateFrameworkConfig } from "../config/config.validator.js";
|
|
4
|
+
import { validateForcedOperations } from "../config/forced-operation.validator.js";
|
|
4
5
|
import { AVENTARA_PROTOCOL_VERSION } from "../contracts/contract-protocol.js";
|
|
5
6
|
import { copyEnvelopeAtDoor, refuseCallerData, } from "../runtime/caller-data.door.js";
|
|
6
7
|
import { createDiagnosticsReporter, createTransactionDiagnosticsChannel, recordDiagnosticsSink, } from "../runtime/diagnostics-reporter.js";
|
|
7
8
|
import { createMisuseReporter, } from "../runtime/misuse-reporter.js";
|
|
8
9
|
import { internalFailure, operationFailure, } from "../runtime/operation-response.js";
|
|
9
|
-
import { createOperationRuntime } from "../runtime/operation-runtime.js";
|
|
10
|
+
import { createOperationRuntime, createPipelineDependencies, } from "../runtime/operation-runtime.js";
|
|
10
11
|
import { recordOwnedExecution } from "../runtime/owned-execution.registry.js";
|
|
11
12
|
import { validateOperationEnvelope, validateTransactionEnvelope, } from "../runtime/request-envelope.validator.js";
|
|
12
13
|
import { requestIdOf } from "../runtime/request-id.js";
|
|
14
|
+
import { stateOptionOf } from "../runtime/request-state.resolver.js";
|
|
13
15
|
import { createTransactionPlanAssembler } from "../transactions/transaction-plan-assembler.js";
|
|
14
16
|
import { createTransactionRuntime } from "../transactions/transaction-runtime.js";
|
|
15
|
-
import {
|
|
16
|
-
import { createOperationFacade, createOperationTree, } from "./operation-facade.js";
|
|
17
|
+
import { AvConstructionError } from "./framework-construction.error.js";
|
|
18
|
+
import { createOperationFacade, createOperationTree, settleOperation, } from "./operation-facade.js";
|
|
19
|
+
const APPLICATION_SQL_BUILDER = "$sql";
|
|
17
20
|
export async function createFramework(config) {
|
|
18
21
|
const configDiagnostics = validateFrameworkConfig(config);
|
|
19
22
|
if (configDiagnostics.length > 0) {
|
|
20
|
-
throw new
|
|
23
|
+
throw new AvConstructionError("configuration", configDiagnostics);
|
|
21
24
|
}
|
|
22
25
|
const model = config.adapter.model;
|
|
23
26
|
if (model.transactions === "interactive" &&
|
|
24
27
|
typeof config.adapter.transaction !== "function") {
|
|
25
|
-
throw new
|
|
28
|
+
throw new AvConstructionError("discovery", [
|
|
26
29
|
{
|
|
27
30
|
code: "DISCOVERY_TRANSACTION_CAPABILITY_MISMATCH",
|
|
28
31
|
path: "adapter.transactions",
|
|
@@ -33,18 +36,20 @@ export async function createFramework(config) {
|
|
|
33
36
|
const resolvedConfig = resolveFrameworkConfig(config);
|
|
34
37
|
const compilation = await compileContracts(model, resolvedConfig);
|
|
35
38
|
if (!compilation.ok) {
|
|
36
|
-
throw new
|
|
39
|
+
throw new AvConstructionError("contract-compilation", compilation.diagnostics);
|
|
37
40
|
}
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const executeTransaction = createTransactionRuntime({
|
|
41
|
+
const forcing = validateForcedOperations(config, compilation.contracts);
|
|
42
|
+
if (forcing.length > 0) {
|
|
43
|
+
throw new AvConstructionError("configuration", forcing);
|
|
44
|
+
}
|
|
45
|
+
const runtimeDependencies = {
|
|
44
46
|
adapter: config.adapter,
|
|
45
47
|
contracts: compilation.contracts,
|
|
46
48
|
config: resolvedConfig,
|
|
47
|
-
}
|
|
49
|
+
};
|
|
50
|
+
const pipelineDependencies = createPipelineDependencies(runtimeDependencies, model);
|
|
51
|
+
const execute = createOperationRuntime(runtimeDependencies, pipelineDependencies);
|
|
52
|
+
const executeTransaction = createTransactionRuntime(runtimeDependencies, pipelineDependencies);
|
|
48
53
|
const misuse = createMisuseReporter(resolvedConfig.misuse);
|
|
49
54
|
const executeOperation = (request) => executeTotally(execute, request, resolvedConfig.diagnostics, "caller");
|
|
50
55
|
const protocol = {
|
|
@@ -53,28 +58,34 @@ export async function createFramework(config) {
|
|
|
53
58
|
};
|
|
54
59
|
const assembler = createTransactionPlanAssembler(compilation.contracts, protocol, misuse);
|
|
55
60
|
const framework = {
|
|
56
|
-
|
|
61
|
+
api: resolvedConfig.api,
|
|
62
|
+
mcp: resolvedConfig.mcp,
|
|
57
63
|
contracts: compilation.contracts,
|
|
58
|
-
application: createOperationFacade(model, (resource, identity, args, requestId) => ({
|
|
64
|
+
application: createOperationFacade(model, (resource, identity, args, requestId, state) => ({
|
|
59
65
|
...identity,
|
|
60
66
|
origin: "application",
|
|
61
67
|
requestId,
|
|
68
|
+
...(state === undefined ? {} : { state }),
|
|
62
69
|
resource,
|
|
63
70
|
arguments: args,
|
|
64
71
|
}), executeOperation),
|
|
65
|
-
client: createOperationFacade(model, (resource, identity, args, requestId) => ({
|
|
72
|
+
client: createOperationFacade(model, (resource, identity, args, requestId, state) => ({
|
|
66
73
|
...identity,
|
|
67
74
|
origin: "client",
|
|
68
75
|
protocol,
|
|
69
76
|
requestId,
|
|
77
|
+
...(state === undefined ? {} : { state }),
|
|
70
78
|
resource,
|
|
71
79
|
arguments: args,
|
|
72
80
|
}), executeOperation),
|
|
73
|
-
appTx:
|
|
81
|
+
appTx: Object.freeze({
|
|
82
|
+
...createOperationTree(model, (resource, identity) => (args) => assembler.defer("application", resource, identity, args === undefined ? {} : args)),
|
|
83
|
+
[APPLICATION_SQL_BUILDER]: (strings, ...values) => assembler.deferSql(strings, values),
|
|
84
|
+
}),
|
|
74
85
|
clientTx: createOperationTree(model, (resource, identity) => (args) => assembler.defer("client", resource, identity, args === undefined ? {} : args)),
|
|
75
86
|
execute: (request) => executeRequestTotally(execute, request, resolvedConfig.diagnostics, misuse),
|
|
76
87
|
executeTransaction: (request) => executeTransactionRequestTotally(executeTransaction, request, resolvedConfig.diagnostics, misuse),
|
|
77
|
-
transaction: ((operations, options) => runTransactionTotally(executeTransaction, assembler, operations, requestIdOf(options), resolvedConfig.diagnostics)),
|
|
88
|
+
transaction: (async (operations, options) => settleOperation(await runTransactionTotally(executeTransaction, assembler, operations, requestIdOf(options), stateOptionOf(options), resolvedConfig.diagnostics))),
|
|
78
89
|
};
|
|
79
90
|
recordDiagnosticsSink(framework, resolvedConfig.diagnostics);
|
|
80
91
|
recordOwnedExecution(framework, {
|
|
@@ -138,7 +149,7 @@ async function executeTransactionTotally(execute, request, diagnostics, origins,
|
|
|
138
149
|
return internalFailure();
|
|
139
150
|
}
|
|
140
151
|
}
|
|
141
|
-
async function runTransactionTotally(execute, assembler, operations, requestId, diagnostics) {
|
|
152
|
+
async function runTransactionTotally(execute, assembler, operations, requestId, state, diagnostics) {
|
|
142
153
|
let assembled;
|
|
143
154
|
try {
|
|
144
155
|
assembled = await assembler.assemble(operations);
|
|
@@ -154,5 +165,14 @@ async function runTransactionTotally(execute, assembler, operations, requestId,
|
|
|
154
165
|
if (!assembled.ok) {
|
|
155
166
|
return assembled.response;
|
|
156
167
|
}
|
|
157
|
-
return executeTransactionTotally(execute, {
|
|
168
|
+
return executeTransactionTotally(execute, {
|
|
169
|
+
origin: "application",
|
|
170
|
+
requestId,
|
|
171
|
+
...(state === undefined ? {} : { state }),
|
|
172
|
+
plan: assembled.plan,
|
|
173
|
+
}, diagnostics, assembled.origins, {
|
|
174
|
+
source: "owned",
|
|
175
|
+
refused: assembled.refused,
|
|
176
|
+
statements: assembled.statements,
|
|
177
|
+
});
|
|
158
178
|
}
|
|
@@ -1,72 +1,137 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
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 { AvResourceKey } from "../operations/operation-arguments.js";
|
|
5
|
+
import type { AvDeferredOperationCall, AvOperationCall, AvOperationGrammar } from "../operations/operation-call.js";
|
|
6
|
+
import type { AvOperationIdentity } from "../operations/operation-identity.js";
|
|
7
|
+
import type { AvExecutionOptions } from "../runtime/execution-options.js";
|
|
8
8
|
import type { FrameworkOperationRequest } from "../runtime/operation-request.js";
|
|
9
|
-
import type {
|
|
10
|
-
import type {
|
|
9
|
+
import type { AvOperationResponse } from "../runtime/operation-response.js";
|
|
10
|
+
import type { AvState } from "../runtime/request-state.js";
|
|
11
|
+
import type { SqlStatementBuilder } from "../transactions/sql-statement.js";
|
|
12
|
+
import type { AvTransactionResponse } from "../transactions/transaction-response.js";
|
|
13
|
+
import type { AvContractApplicationView, ClientContractView } from "./contract-view.js";
|
|
11
14
|
/**
|
|
12
|
-
* A model whose Resource names are not literal — the abstract `
|
|
13
|
-
* the default `
|
|
15
|
+
* A model whose Resource names are not literal — the abstract `AvAdapterModel` behind
|
|
16
|
+
* the default `AvFramework` — has no Contract to type a call against, so a surface over
|
|
14
17
|
* it is typed as the opaque object it is, and such a caller uses `execute`.
|
|
15
18
|
*/
|
|
16
19
|
type OpaqueSurface = {
|
|
17
20
|
readonly [resource: string]: unknown;
|
|
18
21
|
};
|
|
22
|
+
/** The four typed surfaces of an `AvFramework`, named by the member that holds each. */
|
|
23
|
+
type FacadeSurface = "application" | "client" | "appTx" | "clientTx";
|
|
19
24
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
25
|
+
* One variant on a surface: a direct call (application or wire forms), or a
|
|
26
|
+
* deferred one for a transaction (`appTx`, `clientTx`).
|
|
22
27
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
type SurfaceCall<C extends AvContract, R extends AvResourceKey<C>, I extends AvOperationIdentity, S extends FacadeSurface> = S extends "application" ? AvOperationCall<C, R, I, AvApplicationScalarForms, AvApplicationScalarForms, AvExecutionOptions> : S extends "client" ? AvOperationCall<C, R, I, AvWireScalarForms, AvApplicationScalarForms, AvExecutionOptions> : S extends "appTx" ? AvDeferredOperationCall<C, R, I, AvApplicationScalarForms, AvApplicationScalarForms, "application"> : AvDeferredOperationCall<C, R, I, AvWireScalarForms, AvApplicationScalarForms, "client">;
|
|
29
|
+
/** The families view `C` advertises on Resource `R`. */
|
|
30
|
+
type FamilyKey<C extends AvContract, R extends AvResourceKey<C>> = keyof AvOperationGrammar<C>[R];
|
|
31
|
+
/** One family node of surface `S`; the public names below are its four instances. */
|
|
32
|
+
type FamilyNode<C extends AvContract, S extends FacadeSurface, R extends AvResourceKey<C>, F extends FamilyKey<C, R>> = {
|
|
33
|
+
readonly [V in keyof AvOperationGrammar<C>[R][F]]: SurfaceCall<C, R, AvOperationGrammar<C>[R][F][V] & AvOperationIdentity, S>;
|
|
34
|
+
};
|
|
35
|
+
/** `framework.application.<Resource>.<family>`: one direct call per variant, application forms. */
|
|
36
|
+
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>;
|
|
37
|
+
/** `framework.client.<Resource>.<family>`: one direct call per variant, wire forms. */
|
|
38
|
+
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>;
|
|
39
|
+
/** `framework.appTx.<Resource>.<family>`: one deferred operation per variant. */
|
|
40
|
+
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>;
|
|
41
|
+
/** `framework.clientTx.<Resource>.<family>`: one deferred operation per variant. */
|
|
42
|
+
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>;
|
|
43
|
+
/** `framework.application.<Resource>`: one {@link AvApplicationFamilyFacade} per family. */
|
|
44
|
+
export type AvApplicationResourceFacade<in out C extends AvContract, in out R extends AvResourceKey<C>> = {
|
|
45
|
+
readonly [F in FamilyKey<C, R>]: AvApplicationFamilyFacade<C, R, F>;
|
|
46
|
+
};
|
|
47
|
+
/** `framework.client.<Resource>`: one {@link AvClientFamilyFacade} per family. */
|
|
48
|
+
export type AvClientResourceFacade<in out C extends AvContract, in out R extends AvResourceKey<C>> = {
|
|
49
|
+
readonly [F in FamilyKey<C, R>]: AvClientFamilyFacade<C, R, F>;
|
|
50
|
+
};
|
|
51
|
+
/** `framework.appTx.<Resource>`: one {@link AvAppTxFamilyFacade} per family. */
|
|
52
|
+
export type AvAppTxResourceFacade<in out C extends AvContract, in out R extends AvResourceKey<C>> = {
|
|
53
|
+
readonly [F in FamilyKey<C, R>]: AvAppTxFamilyFacade<C, R, F>;
|
|
54
|
+
};
|
|
55
|
+
/** `framework.clientTx.<Resource>`: one {@link AvClientTxFamilyFacade} per family. */
|
|
56
|
+
export type AvClientTxResourceFacade<in out C extends AvContract, in out R extends AvResourceKey<C>> = {
|
|
57
|
+
readonly [F in FamilyKey<C, R>]: AvClientTxFamilyFacade<C, R, F>;
|
|
58
|
+
};
|
|
31
59
|
/**
|
|
32
|
-
* `framework.
|
|
33
|
-
* the
|
|
60
|
+
* `framework.application`: one {@link AvApplicationResourceFacade} per Resource
|
|
61
|
+
* of `C`, the Application Contract's view.
|
|
34
62
|
*/
|
|
35
|
-
export type
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
readonly [F in keyof OperationGrammar<C>[R]]: {
|
|
39
|
-
readonly [V in keyof OperationGrammar<C>[R][F]]: OperationCall<C, R, OperationGrammar<C>[R][F][V] & OperationIdentity, WireScalarForms, ApplicationScalarForms, "response", ExecutionOptions>;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
} : never;
|
|
63
|
+
export type AvApplicationFacade<C extends AvContract> = {
|
|
64
|
+
readonly [R in AvResourceKey<C>]: AvApplicationResourceFacade<C, R>;
|
|
65
|
+
};
|
|
43
66
|
/**
|
|
44
|
-
* `framework.
|
|
45
|
-
* Contract's view
|
|
67
|
+
* `framework.client`: one {@link AvClientResourceFacade} per Resource of `C`,
|
|
68
|
+
* the Client Contract's view.
|
|
46
69
|
*/
|
|
47
|
-
export type
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
70
|
+
export type AvClientFacade<C extends AvContract> = {
|
|
71
|
+
readonly [R in AvResourceKey<C>]: AvClientResourceFacade<C, R>;
|
|
72
|
+
};
|
|
73
|
+
/** `framework.appTx.$sql`: the developer SQL step only an application transaction has. */
|
|
74
|
+
type ApplicationSqlStep = {
|
|
75
|
+
/**
|
|
76
|
+
* A developer SQL step, written only as a tagged template:
|
|
77
|
+
* ``framework.appTx.$sql<Row>`select … ${value}` ``. Every interpolated value
|
|
78
|
+
* is bound as a parameter. See {@link SqlStatementBuilder}.
|
|
79
|
+
*/
|
|
80
|
+
readonly $sql: SqlStatementBuilder;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* `framework.appTx`: one {@link AvAppTxResourceFacade} per Resource of `C`, the
|
|
84
|
+
* Application Contract's view, and `$sql`.
|
|
85
|
+
*/
|
|
86
|
+
export type AvAppTxFacade<C extends AvContract> = {
|
|
87
|
+
readonly [R in AvResourceKey<C>]: AvAppTxResourceFacade<C, R>;
|
|
88
|
+
} & ApplicationSqlStep;
|
|
89
|
+
/**
|
|
90
|
+
* `framework.clientTx`: one {@link AvClientTxResourceFacade} per Resource of
|
|
91
|
+
* `C`, the Client Contract's view.
|
|
92
|
+
*/
|
|
93
|
+
export type AvClientTxFacade<C extends AvContract> = {
|
|
94
|
+
readonly [R in AvResourceKey<C>]: AvClientTxResourceFacade<C, R>;
|
|
95
|
+
};
|
|
96
|
+
type ApplicationSurface<C> = C extends AvContract ? string extends AvResourceKey<C> ? OpaqueSurface : AvApplicationFacade<C> : never;
|
|
97
|
+
type ClientSurface<C> = C extends AvContract ? string extends AvResourceKey<C> ? OpaqueSurface : AvClientFacade<C> : never;
|
|
98
|
+
type ApplicationDeferredSurface<C> = C extends AvContract ? string extends AvResourceKey<C> ? OpaqueSurface & ApplicationSqlStep : AvAppTxFacade<C> : never;
|
|
99
|
+
type ClientDeferredSurface<C> = C extends AvContract ? string extends AvResourceKey<C> ? OpaqueSurface : AvClientTxFacade<C> : never;
|
|
100
|
+
/** `framework.application`'s type: {@link AvApplicationFacade}, or opaque. */
|
|
101
|
+
export type ApplicationOperations<M extends AvAdapterModel, Cfg> = ApplicationSurface<AvContractApplicationView<M, Cfg>>;
|
|
102
|
+
/** `framework.client`'s type: {@link AvClientFacade}, or opaque. */
|
|
103
|
+
export type ClientOperations<M extends AvAdapterModel, Cfg> = ClientSurface<ClientContractView<M, Cfg>>;
|
|
104
|
+
/** `framework.appTx`'s type: {@link AvAppTxFacade}, or opaque with `$sql`. */
|
|
105
|
+
export type ApplicationTransactionBuilders<M extends AvAdapterModel, Cfg> = ApplicationDeferredSurface<AvContractApplicationView<M, Cfg>>;
|
|
106
|
+
/** `framework.clientTx`'s type: {@link AvClientTxFacade}, or opaque. */
|
|
107
|
+
export type ClientTransactionBuilders<M extends AvAdapterModel, Cfg> = ClientDeferredSurface<ClientContractView<M, Cfg>>;
|
|
108
|
+
/**
|
|
109
|
+
* The Resources of a pipeline ctx: `ctx.<Resource>.<family>.<variant>(args)`,
|
|
110
|
+
* application-origin, resolving the operation's data.
|
|
111
|
+
*/
|
|
112
|
+
export type AvContextOperations<M extends AvAdapterModel> = ContextFacade<AvContractApplicationView<M>>;
|
|
113
|
+
type ContextFacade<C> = C extends AvContract ? string extends AvResourceKey<C> ? unknown : {
|
|
114
|
+
readonly [R in AvResourceKey<C>]: {
|
|
115
|
+
readonly [F in keyof AvOperationGrammar<C>[R]]: {
|
|
116
|
+
readonly [V in keyof AvOperationGrammar<C>[R][F]]: AvOperationCall<C, R, AvOperationGrammar<C>[R][F][V] & AvOperationIdentity, AvApplicationScalarForms, AvApplicationScalarForms, never>;
|
|
52
117
|
};
|
|
53
118
|
};
|
|
54
119
|
} : never;
|
|
55
120
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
121
|
+
* The Resources of compute's read-only ctx: `ctx.<Resource>.find.<variant>(args)`
|
|
122
|
+
* only (`find.count` included).
|
|
58
123
|
*/
|
|
59
|
-
export type
|
|
60
|
-
type
|
|
61
|
-
readonly [R in
|
|
62
|
-
readonly [F in keyof
|
|
63
|
-
readonly [V in keyof
|
|
124
|
+
export type AvComputeReads<M extends AvAdapterModel> = ComputeReadFacade<AvContractApplicationView<M>>;
|
|
125
|
+
type ComputeReadFacade<C> = C extends AvContract ? string extends AvResourceKey<C> ? unknown : {
|
|
126
|
+
readonly [R in AvResourceKey<C>]: {
|
|
127
|
+
readonly [F in Extract<keyof AvOperationGrammar<C>[R], "find">]: {
|
|
128
|
+
readonly [V in keyof AvOperationGrammar<C>[R][F]]: AvOperationCall<C, R, AvOperationGrammar<C>[R][F][V] & AvOperationIdentity, AvApplicationScalarForms, AvApplicationScalarForms, never>;
|
|
64
129
|
};
|
|
65
130
|
};
|
|
66
131
|
} : 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: FrameworkOperationRequest) => Promise<
|
|
132
|
+
/** Builds the request one façade call hands to `execute`, under its request id and state. */
|
|
133
|
+
export type FacadeRequest = (resource: string, identity: AvOperationIdentity, args: unknown, requestId: string, state: AvState | undefined) => FrameworkOperationRequest;
|
|
134
|
+
type FacadeExecutor = (request: FrameworkOperationRequest) => Promise<AvOperationResponse>;
|
|
70
135
|
/**
|
|
71
136
|
* Builds a façade over `model`, the same object its types are read from, so a
|
|
72
137
|
* call that type-checks always reaches `execute`: a Resource, variant or field
|
|
@@ -74,20 +139,26 @@ type FacadeExecutor = (request: FrameworkOperationRequest) => Promise<OperationR
|
|
|
74
139
|
* validation layer answers it.
|
|
75
140
|
*
|
|
76
141
|
* Each call's request is `request`'s — its origin — under the caller's
|
|
77
|
-
* `
|
|
142
|
+
* `AvExecutionOptions.requestId`, or a freshly minted id when there is none, and
|
|
143
|
+
* with the caller's `AvExecutionOptions.state` when it gives one; an
|
|
78
144
|
* omitted argument is the empty argument object, which the type admits only
|
|
79
145
|
* when every member is optional.
|
|
80
146
|
*/
|
|
81
|
-
export declare function createOperationFacade<Facade>(model:
|
|
147
|
+
export declare function createOperationFacade<Facade>(model: AvAdapterModel, request: FacadeRequest, execute: FacadeExecutor): Facade;
|
|
148
|
+
/**
|
|
149
|
+
* An in-process call's settlement (a façade call or `framework.transaction`):
|
|
150
|
+
* the response's data, or its failure thrown.
|
|
151
|
+
*/
|
|
152
|
+
export declare function settleOperation(response: AvOperationResponse | AvTransactionResponse): unknown;
|
|
82
153
|
/**
|
|
83
154
|
* One leaf of an operation tree: the callable for one advertised variant. The
|
|
84
155
|
* second parameter is a façade call's options; a builder leaf ignores it.
|
|
85
156
|
*/
|
|
86
|
-
export type OperationLeaf = (resource: string, identity:
|
|
157
|
+
export type OperationLeaf = (resource: string, identity: AvOperationIdentity) => (args?: unknown, options?: unknown) => unknown;
|
|
87
158
|
/**
|
|
88
159
|
* The runtime shape every façade and builder shares: one frozen property per
|
|
89
160
|
* Resource of `model`, one per family under it, one leaf per variant the model
|
|
90
161
|
* advertises in the standard grammar.
|
|
91
162
|
*/
|
|
92
|
-
export declare function createOperationTree<Tree>(model:
|
|
163
|
+
export declare function createOperationTree<Tree>(model: AvAdapterModel, leaf: OperationLeaf): Tree;
|
|
93
164
|
export {};
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import { isOperationVariantAvailable } from "../contracts/resource-operations.js";
|
|
2
2
|
import { parseOperationIdentity } from "../operations/operation-identity.js";
|
|
3
|
+
import { thrownFailure } from "../runtime/framework-error.factory.js";
|
|
3
4
|
import { requestIdOf } from "../runtime/request-id.js";
|
|
5
|
+
import { stateOptionOf } from "../runtime/request-state.resolver.js";
|
|
4
6
|
export function createOperationFacade(model, request, execute) {
|
|
5
|
-
return createOperationTree(model, (resource, identity) => (args, options) => execute(request(resource, identity, args === undefined ? {} : args, requestIdOf(options))));
|
|
7
|
+
return createOperationTree(model, (resource, identity) => async (args, options) => settleOperation(await execute(request(resource, identity, args === undefined ? {} : args, requestIdOf(options), stateOptionOf(options)))));
|
|
8
|
+
}
|
|
9
|
+
export function settleOperation(response) {
|
|
10
|
+
if (response.cause !== null) {
|
|
11
|
+
throw thrownFailure(response);
|
|
12
|
+
}
|
|
13
|
+
return response.data;
|
|
6
14
|
}
|
|
7
15
|
export function createOperationTree(model, leaf) {
|
|
8
16
|
const resources = Object.entries(model.resources).map(([resource, { operations }]) => {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,51 +1,56 @@
|
|
|
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 { AvMcpEndpoint } from "./config/config.resolver.js";
|
|
7
|
+
export type { AvConfigDiagnostic, AvConfigDiagnosticCode, } from "./config/config-diagnostic.js";
|
|
8
|
+
export type { AvConfigLayerName, AvRequestOrigin, } from "./config/config-layer.js";
|
|
9
|
+
export { type AvDefinedResource, defineResource, } from "./config/define-resource.js";
|
|
10
|
+
export type { AvConfigFieldKey, AvEffectiveFieldKey, } from "./config/effective-fields.js";
|
|
11
|
+
export type { AvConfigExact } from "./config/exact-framework-config.js";
|
|
12
|
+
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";
|
|
13
|
+
export type { AvPipeline, AvTransactionPipeline, } from "./config/pipeline-config.js";
|
|
14
|
+
export type { AvPaginationCapability, AvProjectionScope, AvRelationFilterCapability, AvRelationMutationDirective, AvRelationReducer, AvScalarFilterOperator, AvScalarMutationDirective, AvWriteScope, } from "./contracts/capability.js";
|
|
15
|
+
export type { AvContract, AvContractAgent, AvContractApplication, AvContractClient, AvContractCore, } from "./contracts/contract.js";
|
|
16
|
+
export type { AvContractLimits } from "./contracts/contract-limits.js";
|
|
17
|
+
export type { AvContractClientProtocol, AvContractHash, AvContractProtocol, } from "./contracts/contract-protocol.js";
|
|
18
|
+
export type { AvCreateRequirementGroup, AvCreateRequirements, } from "./contracts/create-requirements.js";
|
|
19
|
+
export type { AvEnumDefinition } from "./contracts/enum-definition.js";
|
|
20
|
+
export type { AvField, AvProjectionScopes, AvRelationField, AvRelationFieldCapabilities, AvRelationMutationCapability, AvRelationProjectionCapability, AvRelationReducerCapability, AvScalarField, AvScalarFieldCapabilities, AvScalarFormat, AvScopedRelationMutations, AvScopedRelationReducers, AvWriteScopes, } from "./contracts/field.js";
|
|
21
|
+
export type { AvFieldCheck } from "./contracts/field-check.js";
|
|
22
|
+
export type { AvIdentifier, AvScalarFieldKey } from "./contracts/identifier.js";
|
|
23
|
+
export type { AvLifecycleTrait } from "./contracts/lifecycle-trait.js";
|
|
24
|
+
export type { AvResource, AvResourceFieldMap } from "./contracts/resource.js";
|
|
25
|
+
export type { AvOperationAvailability, AvOperationVariantScopes, AvResourceOperations, } from "./contracts/resource-operations.js";
|
|
26
|
+
export type { AvBuiltInScalar, AvScalarDefinition, AvScalarRegistry, } from "./contracts/scalar.js";
|
|
27
|
+
export type { AvApplicationScalarForms, AvScalarValueType, AvWireScalarForms, } from "./contracts/scalar-value-type.js";
|
|
28
|
+
export type { AvTransactionCapability } from "./contracts/transaction-capability.js";
|
|
27
29
|
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
|
|
38
|
-
export type {
|
|
39
|
-
export type {
|
|
40
|
-
export {
|
|
41
|
-
export
|
|
42
|
-
export type {
|
|
43
|
-
export type {
|
|
44
|
-
export type {
|
|
45
|
-
export type {
|
|
46
|
-
export type {
|
|
47
|
-
export {
|
|
48
|
-
export type {
|
|
49
|
-
export type {
|
|
50
|
-
export
|
|
51
|
-
export {
|
|
30
|
+
export type { AvFramework } from "./framework/framework.js";
|
|
31
|
+
export type { AvConstructionDiagnostic, AvConstructionStage, } from "./framework/framework-construction.error.js";
|
|
32
|
+
export { AvConstructionError } from "./framework/framework-construction.error.js";
|
|
33
|
+
export type { AvApplicationFacade, AvApplicationFamilyFacade, AvApplicationResourceFacade, AvAppTxFacade, AvAppTxFamilyFacade, AvAppTxResourceFacade, AvClientFacade, AvClientFamilyFacade, AvClientResourceFacade, AvClientTxFacade, AvClientTxFamilyFacade, AvClientTxResourceFacade, } from "./framework/operation-facade.js";
|
|
34
|
+
export type { AvCreateDataInput, AvCursorInput, AvFieldKey, AvIncludeInput, AvNullsOrder, AvOperationArgumentMap, AvOperationArgumentsFor, AvOrderByEntry, AvOrderByInput, AvProjectionEntry, AvRelationProjectionInput, AvResourceKey, AvScalarOrderInput, AvSelectInput, AvSortDirection, AvUniqueWhereInput, AvUpdateDataInput, AvWhereInput, } from "./operations/operation-arguments.js";
|
|
35
|
+
export type { AvDeferredOperationCall, AvOperationCall, AvOperationGrammar, AvOperationSlot, } from "./operations/operation-call.js";
|
|
36
|
+
export type { AvOperationFamily, AvOperationIdentity, AvOperationVariant, } from "./operations/operation-identity.js";
|
|
37
|
+
export type { AvOperationResultFor } from "./operations/operation-result.js";
|
|
38
|
+
export type { AvValidationCode, AvValidationIssue, } from "./operations/validation-code.js";
|
|
39
|
+
export { AvDecimal } from "./runtime/decimal.js";
|
|
40
|
+
export type { AvDiagnostic, AvDiagnosticsSink, AvMcpDiagnostic, AvOperationDiagnostic, AvTransactionDiagnostic, } from "./runtime/diagnostics-reporter.js";
|
|
41
|
+
export type { AvExecutionOptions } from "./runtime/execution-options.js";
|
|
42
|
+
export type { AvComputeContext, AvComputeCreate, AvComputeRead, AvComputeUpdate, } from "./runtime/field-compute.js";
|
|
43
|
+
export { AvAuthError, AvConflictError, AvContractMismatchError, AvError, AvInternalError, AvNotFoundError, AvProtocolError, AvValidationError, } from "./runtime/framework-error.js";
|
|
44
|
+
export type { AvJsonValue } from "./runtime/json-value.js";
|
|
45
|
+
export type { AvMisuseEvent, AvMisuseSink, } from "./runtime/misuse-reporter.js";
|
|
46
|
+
export type { AvCause, AvOperationCode, AvOperationErrorCode, AvOperationFailureResponse, AvOperationNoMatchResponse, AvOperationResponse, AvOperationSuccessCode, AvOperationSuccessDataCode, AvOperationSuccessResponse, } from "./runtime/operation-response.js";
|
|
47
|
+
export type { AvAfterHook, AvBeforeHook, AvContext, AvFieldGuard, AvFieldPipe, AvFilter, AvGuard, AvInterceptor, AvPipe, AvTransactionAfterHook, AvTransactionBeforeHook, AvTransactionContext, AvTransactionFilter, AvTransactionGuard, AvTransactionInterceptor, AvTransactionPipe, AvTransactionStep, AvTransportContext, } from "./runtime/pipeline.js";
|
|
48
|
+
export type { AvDeepReadonly } from "./runtime/readonly-value.js";
|
|
49
|
+
export type { AvState } from "./runtime/request-state.js";
|
|
50
|
+
export type { AvOperation, AvOperationHandle, AvOperationReferenceSurface, AvReferenceableField, AvReferenceBuilder, AvSingleRowResult, AvTransactionResults, AvTransactionRunner, } from "./transactions/deferred-operation.js";
|
|
51
|
+
export type { AvTransactionIntegrityViolation } from "./transactions/transaction-integrity-error.js";
|
|
52
|
+
export { AvTransactionIntegrityError } from "./transactions/transaction-integrity-error.js";
|
|
53
|
+
export type { AvTransactionReference } from "./transactions/transaction-reference.js";
|
|
54
|
+
export type { AvTransactionCommittedResponse, AvTransactionResponse, } from "./transactions/transaction-response.js";
|
|
55
|
+
export type { AvTransactionSlotPathViolation } from "./transactions/transaction-slot-path-error.js";
|
|
56
|
+
export { AvTransactionSlotPathError } from "./transactions/transaction-slot-path-error.js";
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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 { AvAuthError, AvConflictError, AvContractMismatchError, AvError, AvInternalError, AvNotFoundError, AvProtocolError, AvValidationError, } from "./runtime/framework-error.js";
|
|
6
|
+
export { AvTransactionIntegrityError } from "./transactions/transaction-integrity-error.js";
|
|
7
|
+
export { AvTransactionSlotPathError } from "./transactions/transaction-slot-path-error.js";
|
package/dist/internal.d.ts
CHANGED
|
@@ -6,17 +6,19 @@
|
|
|
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";
|
|
@@ -25,11 +27,14 @@ export { LIFECYCLE_TRAITS } from "./contracts/lifecycle-trait.js";
|
|
|
25
27
|
export { isOperationVariantAvailable, projectionScopeOf, writeScopeOf, } from "./contracts/resource-operations.js";
|
|
26
28
|
export { BUILT_IN_SCALARS } from "./contracts/scalar.js";
|
|
27
29
|
export { TRANSACTION_CAPABILITIES } from "./contracts/transaction-capability.js";
|
|
28
|
-
export type {
|
|
30
|
+
export type { AvContractApplicationView } from "./framework/contract-view.js";
|
|
29
31
|
export type { SemanticOperationArguments } from "./operations/operation-validator.js";
|
|
30
32
|
export { VALIDATION_CODES } from "./operations/validation-code.js";
|
|
31
|
-
export
|
|
33
|
+
export { mcpFailureReporterOf } from "./runtime/diagnostics-reporter.js";
|
|
34
|
+
export type { AvErrorClassName } from "./runtime/framework-error-class.table.js";
|
|
35
|
+
export { FRAMEWORK_ERROR_CLASS_OF } from "./runtime/framework-error-class.table.js";
|
|
36
|
+
export type { AgentOperationRequest, ApplicationOperationRequest, ClientOperationRequest, ClientProtocolIdentity, FrameworkOperationRequest, } from "./runtime/operation-request.js";
|
|
32
37
|
export { OPERATION_CODES } from "./runtime/operation-response.js";
|
|
33
38
|
export type { BuiltinNonRow, OperationFingerprint, } from "./transactions/deferred-operation.js";
|
|
34
39
|
export { computeOperationFingerprint } from "./transactions/operation-fingerprint.js";
|
|
35
|
-
export type { ApplicationTransactionRequest, ClientTransactionRequest, FrameworkTransactionRequest, } from "./transactions/transaction-request.js";
|
|
40
|
+
export type { AgentTransactionRequest, ApplicationTransactionRequest, ClientTransactionRequest, FrameworkTransactionRequest, } from "./transactions/transaction-request.js";
|
package/dist/internal.js
CHANGED
|
@@ -2,7 +2,7 @@ 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";
|
|
@@ -12,5 +12,7 @@ export { isOperationVariantAvailable, projectionScopeOf, writeScopeOf, } from ".
|
|
|
12
12
|
export { BUILT_IN_SCALARS } from "./contracts/scalar.js";
|
|
13
13
|
export { TRANSACTION_CAPABILITIES } from "./contracts/transaction-capability.js";
|
|
14
14
|
export { VALIDATION_CODES } from "./operations/validation-code.js";
|
|
15
|
+
export { mcpFailureReporterOf } from "./runtime/diagnostics-reporter.js";
|
|
16
|
+
export { FRAMEWORK_ERROR_CLASS_OF } from "./runtime/framework-error-class.table.js";
|
|
15
17
|
export { OPERATION_CODES } from "./runtime/operation-response.js";
|
|
16
18
|
export { computeOperationFingerprint } from "./transactions/operation-fingerprint.js";
|