@aventara/core 1.0.0-rc.3 → 1.0.0-rc.8
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 +231 -1
- package/ERRORS.md +6 -6
- package/README.md +76 -12
- package/dist/adapters/adapter-field.d.ts +8 -0
- package/dist/adapters/adapter-identifier.d.ts +9 -0
- package/dist/adapters/adapter-identifier.js +6 -1
- package/dist/adapters/adapter-operation.d.ts +13 -0
- package/dist/compiler/contract.compiler.d.ts +6 -0
- package/dist/compiler/contract.compiler.js +99 -15
- package/dist/config/computed-fields.js +2 -9
- package/dist/config/config-diagnostic.guidance.js +3 -3
- package/dist/config/config.resolver.d.ts +14 -0
- package/dist/config/config.resolver.js +31 -0
- package/dist/config/config.validator.js +82 -0
- package/dist/config/exact-framework-config.d.ts +5 -0
- package/dist/config/framework-config.d.ts +30 -1
- package/dist/contracts/client-contract-structure.validator.d.ts +8 -0
- package/dist/contracts/client-contract-structure.validator.js +6 -1
- package/dist/contracts/contract.d.ts +15 -1
- package/dist/contracts/field.d.ts +28 -0
- package/dist/contracts/scalar-value-type.d.ts +3 -1
- package/dist/framework/contract-view.d.ts +41 -10
- package/dist/framework/framework-construction.error.d.ts +2 -1
- package/dist/framework/framework-construction.error.js +11 -1
- package/dist/framework/framework.d.ts +4 -4
- package/dist/framework/framework.factory.js +39 -11
- package/dist/framework/operation-facade.d.ts +29 -10
- package/dist/framework/operation-facade.js +2 -1
- package/dist/index.d.ts +10 -4
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +2 -0
- package/dist/operations/operation-arguments.d.ts +44 -28
- package/dist/operations/operation-call.d.ts +9 -5
- package/dist/operations/operation-result.d.ts +6 -4
- package/dist/operations/operation-validator-core.js +6 -0
- package/dist/policy/policy-admission.d.ts +22 -0
- package/dist/policy/policy-admission.js +409 -0
- package/dist/policy/policy-after-update.runtime.d.ts +29 -0
- package/dist/policy/policy-after-update.runtime.js +132 -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 +118 -0
- package/dist/policy/policy-engine.js +1 -0
- package/dist/policy/policy-nested-write.runtime.d.ts +38 -0
- package/dist/policy/policy-nested-write.runtime.js +453 -0
- package/dist/policy/policy-read.runtime.d.ts +81 -0
- package/dist/policy/policy-read.runtime.js +503 -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 +93 -0
- package/dist/policy/policy-session.js +235 -0
- package/dist/policy/policy-startup.validator.d.ts +8 -0
- package/dist/policy/policy-startup.validator.js +104 -0
- package/dist/policy/policy-write.runtime.d.ts +37 -0
- package/dist/policy/policy-write.runtime.js +409 -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 +28 -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 +21 -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 +192 -0
- package/dist/protocol/absent-route.responder.d.ts +4 -4
- package/dist/protocol/http-request.decoder.d.ts +2 -2
- package/dist/protocol/http-request.reader.d.ts +2 -2
- package/dist/protocol/protocol-headers.d.ts +3 -3
- package/dist/runtime/computed-read-runtime.d.ts +6 -1
- package/dist/runtime/computed-read-runtime.js +226 -52
- package/dist/runtime/context-executor.runtime.d.ts +2 -2
- package/dist/runtime/context-executor.runtime.js +4 -2
- package/dist/runtime/create-requirement.js +1 -1
- package/dist/runtime/diagnostics-reporter.d.ts +5 -5
- package/dist/runtime/execution-options.d.ts +8 -0
- package/dist/runtime/framework-warning.emitter.d.ts +6 -0
- package/dist/runtime/framework-warning.emitter.js +8 -0
- package/dist/runtime/level-lifecycle.runtime.js +3 -2
- package/dist/runtime/operation-code.guidance.js +3 -3
- package/dist/runtime/operation-request.d.ts +16 -9
- package/dist/runtime/operation-runtime.d.ts +15 -7
- package/dist/runtime/operation-runtime.js +139 -14
- package/dist/runtime/owned-execution.registry.d.ts +2 -2
- package/dist/runtime/readonly-value.d.ts +5 -1
- package/dist/runtime/readonly-value.js +67 -28
- package/dist/runtime/referential-action.d.ts +1 -1
- package/dist/transactions/sql-statement.d.ts +2 -2
- package/dist/transactions/transaction-plan-assembler.d.ts +2 -2
- package/dist/transactions/transaction-plan-validator.d.ts +5 -5
- package/dist/transactions/transaction-request.d.ts +8 -8
- package/dist/transactions/transaction-runtime.d.ts +5 -2
- package/dist/transactions/transaction-runtime.js +33 -6
- package/package.json +2 -2
|
@@ -17,6 +17,14 @@ type RootBlock<Cfg, Key extends PropertyKey> = LiteralRecord<(Cfg & {
|
|
|
17
17
|
})[Key]>;
|
|
18
18
|
/** The root's `resources` block, its stages erased. */
|
|
19
19
|
type ResourcesBlock<Cfg> = ErasedResources<RootBlock<Cfg, "resources">>;
|
|
20
|
+
/** A `resources` block reduced to the `fields` entries the view reads. */
|
|
21
|
+
type ViewBlock<Block> = [Block] extends [never] ? never : {
|
|
22
|
+
readonly [R in keyof Block as "fields" extends keyof NonNullable<Block[R]> ? R : never]: {
|
|
23
|
+
readonly fields: (NonNullable<Block[R]> & {
|
|
24
|
+
readonly fields?: unknown;
|
|
25
|
+
})["fields"];
|
|
26
|
+
};
|
|
27
|
+
};
|
|
20
28
|
/** An overlay's `resources` block, its stages erased (see {@link ResourcesBlock}). */
|
|
21
29
|
type OverlayResourcesBlock<Cfg, Layer extends AvRequestOrigin> = ErasedResources<LiteralRecord<(LiteralRecord<OverlayOf<Cfg, Layer>> & {
|
|
22
30
|
readonly resources?: unknown;
|
|
@@ -90,12 +98,33 @@ type DefinitionOf<FieldEntry> = EntryOf<FieldEntry, "definition">;
|
|
|
90
98
|
type LayeredFields<ModelFields, ResourceConfig> = {
|
|
91
99
|
readonly [F in keyof ModelFields | AddedFieldKey<ModelFields, ResourceConfig>]: F extends keyof ModelFields ? LayeredModelField<ModelFields[F], DefinitionOf<EntryOf<ResourceConfig, F>>> : AddedField<DefinitionOf<EntryOf<ResourceConfig, F>>>;
|
|
92
100
|
};
|
|
101
|
+
/** The configuration's `policy.engine`, read by indexed access (see {@link RootBlock}). */
|
|
102
|
+
type PolicyEngineOf<Cfg> = (NonNullable<(Cfg & {
|
|
103
|
+
readonly policy?: unknown;
|
|
104
|
+
})["policy"]> & {
|
|
105
|
+
readonly engine?: unknown;
|
|
106
|
+
})["engine"];
|
|
107
|
+
/** The configuration's policy engine's `governed` set, when its type states one. */
|
|
108
|
+
type GovernedBlock<Cfg> = LiteralRecord<(NonNullable<PolicyEngineOf<Cfg>> & {
|
|
109
|
+
readonly governed?: unknown;
|
|
110
|
+
})["governed"]>;
|
|
111
|
+
/** The names `Governed` lists for Resource `R`, or `never`. */
|
|
112
|
+
type GovernedNames<Governed, R> = [Governed] extends [never] ? never : R extends keyof Governed ? Governed[R] extends readonly (infer Name)[] ? Name : never : never;
|
|
113
|
+
/** The `governed: true` mark, added to a field: a key the field does not have. */
|
|
114
|
+
type GovernedMark = {
|
|
115
|
+
readonly governed: true;
|
|
116
|
+
};
|
|
117
|
+
/** A Resource's fields with each governed one marked. */
|
|
118
|
+
type GovernedFields<Fields, Governed> = [Governed] extends [never] ? Fields : {
|
|
119
|
+
readonly [F in keyof Fields]: F extends Governed ? Fields[F] & GovernedMark : Fields[F];
|
|
120
|
+
};
|
|
93
121
|
/**
|
|
94
122
|
* One Resource before exposure: the model's own, with its fields layered and
|
|
95
|
-
* its create requirements less what the layers'
|
|
123
|
+
* marked where governed, and its create requirements less what the layers'
|
|
124
|
+
* compute stages fill.
|
|
96
125
|
*/
|
|
97
|
-
type LayeredResource<in out Resource, in out ResourceConfig, in out OverlayConfig> = {
|
|
98
|
-
readonly [P in keyof Resource]: P extends "fields" ? LayeredFields<Resource[P], EntryOf<ResourceConfig, "fields"
|
|
126
|
+
type LayeredResource<in out Resource, in out ResourceConfig, in out OverlayConfig, in out Governed = never> = {
|
|
127
|
+
readonly [P in keyof Resource]: P extends "fields" ? GovernedFields<LayeredFields<Resource[P], EntryOf<ResourceConfig, "fields">>, Governed> : P extends "createRequirements" ? RequirementsLessComputed<Exclude<Resource[P], undefined>, ComputedOnCreateKey<EntryOf<ResourceConfig, "fields">> | ComputedOnCreateKey<EntryOf<OverlayConfig, "fields">>> : Resource[P];
|
|
99
128
|
};
|
|
100
129
|
/** The fields of a `fields` block with a `compute.create` stage. */
|
|
101
130
|
type ComputedOnCreateKey<FieldsBlock> = [FieldsBlock] extends [never] ? never : {
|
|
@@ -132,8 +161,8 @@ type GroupsLessComputed<Groups, Computed> = Groups extends readonly [
|
|
|
132
161
|
...GroupsLessComputed<Rest, Computed>
|
|
133
162
|
] : GroupsLessComputed<Rest, Computed> : readonly [];
|
|
134
163
|
/** The Resources before exposure: the model, with the root's definitions applied. */
|
|
135
|
-
type LayeredResources<Resources, Block, OverlayBlock> = {
|
|
136
|
-
readonly [R in keyof Resources]: LayeredResource<Resources[R], EntryOf<Block, R>, EntryOf<OverlayBlock, R>>;
|
|
164
|
+
type LayeredResources<Resources, Block, OverlayBlock, Governed = never> = {
|
|
165
|
+
readonly [R in keyof Resources]: LayeredResource<Resources[R], EntryOf<Block, R>, EntryOf<OverlayBlock, R>, GovernedNames<Governed, R>>;
|
|
137
166
|
};
|
|
138
167
|
/**
|
|
139
168
|
* The style a layer's `exposed` sets: `false` picks, `true` or absent omits, a
|
|
@@ -289,13 +318,15 @@ export type RootViewResources<M extends AvAdapterModel, Cfg> = ExposedResources<
|
|
|
289
318
|
/** The Resources of an overlay's final view: the root's view, narrowed by it. */
|
|
290
319
|
export type OverlayViewResources<M extends AvAdapterModel, Cfg, Layer extends "application" | "client"> = ExposedResources<ExposedResources<LayeredResources<M["resources"], ResourcesBlock<Cfg>, OverlayResourcesBlock<Cfg, Layer>>, ExposureStyleOf<ExposedOf<Cfg>>, ExemptionsOf<Cfg>>, ExposureStyleOf<ExposedOf<OverlayOf<Cfg, Layer>>>, ExemptionsOf<OverlayOf<Cfg, Layer>>>;
|
|
291
320
|
/**
|
|
292
|
-
* One derived Contract's type: the model, with the root's `
|
|
321
|
+
* One derived Contract's type: the model, with the root's `fields` entries
|
|
293
322
|
* applied, then the root's exposure, then the overlay's over the root's view.
|
|
323
|
+
* `framework.application`, `client`, `appTx` and `clientTx` are typed over it,
|
|
324
|
+
* and a declaration file names it when it writes one of their nodes.
|
|
294
325
|
*/
|
|
295
|
-
type
|
|
326
|
+
export type AvContractView<M extends AvAdapterModel, RootFields, RootStyle, RootExemptions, OverlayStyle, OverlayExemptions, OverlayFields, Governed = never> = {
|
|
296
327
|
readonly scalars: M["scalars"];
|
|
297
328
|
readonly enums: M["enums"];
|
|
298
|
-
readonly resources: ExposedResources<ExposedResources<LayeredResources<M["resources"],
|
|
329
|
+
readonly resources: ExposedResources<ExposedResources<LayeredResources<M["resources"], RootFields, OverlayFields, Governed>, RootStyle, RootExemptions>, OverlayStyle, OverlayExemptions>;
|
|
299
330
|
readonly limits: AvContractLimits;
|
|
300
331
|
readonly transactions: M["transactions"];
|
|
301
332
|
};
|
|
@@ -303,7 +334,7 @@ type DerivedContractView<M extends AvAdapterModel, FieldsBlock, RootStyle, RootE
|
|
|
303
334
|
* The Application Contract's type, derived from the adapter model and the
|
|
304
335
|
* configuration.
|
|
305
336
|
*/
|
|
306
|
-
export type AvContractApplicationView<M extends AvAdapterModel, Cfg = AvConfigAny> = [Cfg] extends [unknown] ?
|
|
337
|
+
export type AvContractApplicationView<M extends AvAdapterModel, Cfg = AvConfigAny> = [Cfg] extends [unknown] ? AvContractView<M, ViewBlock<ResourcesBlock<Cfg>>, ExposureStyleOf<ExposedOf<Cfg>>, ExemptionsOf<Cfg>, ExposureStyleOf<ExposedOf<OverlayOf<Cfg, "application">>>, ExemptionsOf<OverlayOf<Cfg, "application">>, ViewBlock<OverlayResourcesBlock<Cfg, "application">>, GovernedBlock<Cfg>> : never;
|
|
307
338
|
/**
|
|
308
339
|
* The Client Contract's type, derived from the adapter model and the
|
|
309
340
|
* configuration: what the client layer hides is absent. It types
|
|
@@ -311,5 +342,5 @@ export type AvContractApplicationView<M extends AvAdapterModel, Cfg = AvConfigAn
|
|
|
311
342
|
*/
|
|
312
343
|
export type ClientContractView<M extends AvAdapterModel, Cfg = AvConfigAny> = [
|
|
313
344
|
Cfg
|
|
314
|
-
] extends [unknown] ?
|
|
345
|
+
] extends [unknown] ? AvContractView<M, ViewBlock<ResourcesBlock<Cfg>>, ExposureStyleOf<ExposedOf<Cfg>>, ExemptionsOf<Cfg>, ExposureStyleOf<ExposedOf<OverlayOf<Cfg, "client">>>, ExemptionsOf<OverlayOf<Cfg, "client">>, ViewBlock<OverlayResourcesBlock<Cfg, "client">>, GovernedBlock<Cfg>> : never;
|
|
315
346
|
export {};
|
|
@@ -15,7 +15,8 @@ export type AvConstructionDiagnostic = ConstructionProblem & {
|
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
17
|
* Thrown by {@link createFramework} when construction fails: `stage` says
|
|
18
|
-
* where, and `diagnostics` lists every problem found there.
|
|
18
|
+
* where, and `diagnostics` lists every problem found there. The message names
|
|
19
|
+
* the first of them and how many more there are.
|
|
19
20
|
*/
|
|
20
21
|
export declare class AvConstructionError extends Error {
|
|
21
22
|
readonly stage: AvConstructionStage;
|
|
@@ -4,11 +4,21 @@ const FRAMEWORK_CONSTRUCTION_MESSAGES = {
|
|
|
4
4
|
discovery: "Aventara adapter discovery validation failed",
|
|
5
5
|
"contract-compilation": "Aventara contract compilation failed",
|
|
6
6
|
};
|
|
7
|
+
function constructionMessage(stage, diagnostics) {
|
|
8
|
+
const base = FRAMEWORK_CONSTRUCTION_MESSAGES[stage];
|
|
9
|
+
const [first] = diagnostics;
|
|
10
|
+
if (first === undefined) {
|
|
11
|
+
return base;
|
|
12
|
+
}
|
|
13
|
+
const where = first.path === "" ? "" : ` at ${first.path}`;
|
|
14
|
+
const more = diagnostics.length > 1 ? ` (+${diagnostics.length - 1} more)` : "";
|
|
15
|
+
return `${base}: ${first.code}${where}: ${first.message}${more}`;
|
|
16
|
+
}
|
|
7
17
|
export class AvConstructionError extends Error {
|
|
8
18
|
stage;
|
|
9
19
|
diagnostics;
|
|
10
20
|
constructor(stage, diagnostics) {
|
|
11
|
-
super(
|
|
21
|
+
super(constructionMessage(stage, diagnostics));
|
|
12
22
|
this.name = "AvConstructionError";
|
|
13
23
|
this.stage = stage;
|
|
14
24
|
this.diagnostics = diagnostics.map((diagnostic) => ({
|
|
@@ -2,10 +2,10 @@ import type { AvAdapterModel } from "../adapters/adapter-model.js";
|
|
|
2
2
|
import type { AvContracts } from "../compiler/contract.compiler.js";
|
|
3
3
|
import type { AvConfigAny } from "../config/any-framework-config.js";
|
|
4
4
|
import type { AvMcpEndpoint } from "../config/config.resolver.js";
|
|
5
|
-
import type {
|
|
5
|
+
import type { AvOperationRequest } from "../runtime/operation-request.js";
|
|
6
6
|
import type { AvOperationResponse } from "../runtime/operation-response.js";
|
|
7
7
|
import type { AvTransactionRunner } from "../transactions/deferred-operation.js";
|
|
8
|
-
import type {
|
|
8
|
+
import type { AvTransactionRequest } from "../transactions/transaction-request.js";
|
|
9
9
|
import type { AvTransactionResponse } from "../transactions/transaction-response.js";
|
|
10
10
|
import type { ApplicationOperations, ApplicationTransactionBuilders, ClientOperations, ClientTransactionBuilders } from "./operation-facade.js";
|
|
11
11
|
/**
|
|
@@ -72,7 +72,7 @@ export type AvFramework<M extends AvAdapterModel = AvAdapterModel, Cfg = AvConfi
|
|
|
72
72
|
* share one (`A2004`/`V1020` at the first step of the other origin).
|
|
73
73
|
*/
|
|
74
74
|
readonly clientTx: ClientTransactionBuilders<M, Cfg>;
|
|
75
|
-
execute(request:
|
|
75
|
+
execute(request: AvOperationRequest): Promise<AvOperationResponse>;
|
|
76
76
|
/**
|
|
77
77
|
* Validates a whole transaction plan, then runs its operations one after
|
|
78
78
|
* another inside one Adapter transaction. Answers `A1009` with each
|
|
@@ -83,7 +83,7 @@ export type AvFramework<M extends AvAdapterModel = AvAdapterModel, Cfg = AvConfi
|
|
|
83
83
|
* Guards, pipes, hooks and interceptors run while the transaction is open, so
|
|
84
84
|
* they should not perform network I/O or other slow work.
|
|
85
85
|
*/
|
|
86
|
-
executeTransaction(request:
|
|
86
|
+
executeTransaction(request: AvTransactionRequest): Promise<AvTransactionResponse>;
|
|
87
87
|
/**
|
|
88
88
|
* Runs handles from `appTx`/`clientTx` as one transaction:
|
|
89
89
|
* `framework.transaction([h1, h2, …], options?)`. Resolves each handle's
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { compileContracts } from "../compiler/contract.compiler.js";
|
|
1
|
+
import { compileContracts, } from "../compiler/contract.compiler.js";
|
|
2
2
|
import { computedFieldsOf, warnOnStaleComputedFields, } from "../config/computed-fields.js";
|
|
3
|
-
import { resolveFrameworkConfig } from "../config/config.resolver.js";
|
|
3
|
+
import { resolveFrameworkConfig, } from "../config/config.resolver.js";
|
|
4
4
|
import { validateFrameworkConfig } from "../config/config.validator.js";
|
|
5
5
|
import { validateForcedOperations } from "../config/forced-operation.validator.js";
|
|
6
6
|
import { AVENTARA_PROTOCOL_VERSION } from "../contracts/contract-protocol.js";
|
|
7
|
+
import { callerOf } from "../policy/policy-request.js";
|
|
8
|
+
import { policyStartupDiagnostics } from "../policy/policy-startup.validator.js";
|
|
9
|
+
import { loadPrebuiltContracts, warnStalePrebuilt, } from "../prebuilt/prebuilt-contracts.loader.js";
|
|
7
10
|
import { copyEnvelopeAtDoor, refuseCallerData, } from "../runtime/caller-data.door.js";
|
|
8
11
|
import { createDiagnosticsReporter, createTransactionDiagnosticsChannel, recordDiagnosticsSink, } from "../runtime/diagnostics-reporter.js";
|
|
9
12
|
import { createMisuseReporter, } from "../runtime/misuse-reporter.js";
|
|
@@ -39,7 +42,9 @@ export async function createFramework(config) {
|
|
|
39
42
|
trees: resolvedConfig.trees,
|
|
40
43
|
agentExtends: resolvedConfig.agent.parent,
|
|
41
44
|
}));
|
|
42
|
-
const compilation =
|
|
45
|
+
const compilation = (config.prebuilt === undefined
|
|
46
|
+
? undefined
|
|
47
|
+
: await prebuiltCompilation(config.prebuilt, model, config, resolvedConfig)) ?? (await compileContracts(model, resolvedConfig));
|
|
43
48
|
if (!compilation.ok) {
|
|
44
49
|
throw new AvConstructionError("contract-compilation", compilation.diagnostics);
|
|
45
50
|
}
|
|
@@ -47,6 +52,12 @@ export async function createFramework(config) {
|
|
|
47
52
|
if (forcing.length > 0) {
|
|
48
53
|
throw new AvConstructionError("configuration", forcing);
|
|
49
54
|
}
|
|
55
|
+
if (resolvedConfig.policy !== undefined) {
|
|
56
|
+
const policy = policyStartupDiagnostics(compilation.contracts.core, resolvedConfig.policy);
|
|
57
|
+
if (policy.length > 0) {
|
|
58
|
+
throw new AvConstructionError("configuration", policy);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
50
61
|
const runtimeDependencies = {
|
|
51
62
|
adapter: config.adapter,
|
|
52
63
|
contracts: compilation.contracts,
|
|
@@ -56,7 +67,7 @@ export async function createFramework(config) {
|
|
|
56
67
|
const execute = createOperationRuntime(runtimeDependencies, pipelineDependencies);
|
|
57
68
|
const executeTransaction = createTransactionRuntime(runtimeDependencies, pipelineDependencies);
|
|
58
69
|
const misuse = createMisuseReporter(resolvedConfig.misuse);
|
|
59
|
-
const executeOperation = (request) => executeTotally(execute, request, resolvedConfig.diagnostics, "caller");
|
|
70
|
+
const executeOperation = (request, caller) => executeTotally(execute, request, resolvedConfig.diagnostics, "caller", caller);
|
|
60
71
|
const protocol = {
|
|
61
72
|
version: AVENTARA_PROTOCOL_VERSION,
|
|
62
73
|
hash: compilation.contracts.client.protocol.hash,
|
|
@@ -90,7 +101,7 @@ export async function createFramework(config) {
|
|
|
90
101
|
clientTx: createOperationTree(model, (resource, identity) => (args) => assembler.defer("client", resource, identity, args === undefined ? {} : args)),
|
|
91
102
|
execute: (request) => executeRequestTotally(execute, request, resolvedConfig.diagnostics, misuse),
|
|
92
103
|
executeTransaction: (request) => executeTransactionRequestTotally(executeTransaction, request, resolvedConfig.diagnostics, misuse),
|
|
93
|
-
transaction: (async (operations, options) => settleOperation(await runTransactionTotally(executeTransaction, assembler, operations, requestIdOf(options), stateOptionOf(options), resolvedConfig.diagnostics))),
|
|
104
|
+
transaction: (async (operations, options) => settleOperation(await runTransactionTotally(executeTransaction, assembler, operations, requestIdOf(options), stateOptionOf(options), resolvedConfig.diagnostics, callerOf(options)))),
|
|
94
105
|
};
|
|
95
106
|
recordDiagnosticsSink(framework, resolvedConfig.diagnostics);
|
|
96
107
|
recordOwnedExecution(framework, {
|
|
@@ -101,10 +112,27 @@ export async function createFramework(config) {
|
|
|
101
112
|
});
|
|
102
113
|
return framework;
|
|
103
114
|
}
|
|
104
|
-
async function
|
|
115
|
+
async function prebuiltCompilation(prebuilt, model, config, resolved) {
|
|
116
|
+
let loaded;
|
|
117
|
+
try {
|
|
118
|
+
loaded = await loadPrebuiltContracts(prebuilt, model, config, resolved);
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
loaded = {
|
|
122
|
+
ok: false,
|
|
123
|
+
reason: `it could not be read (${error instanceof Error ? error.message : String(error)})`,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
if (!loaded.ok) {
|
|
127
|
+
warnStalePrebuilt(loaded.reason);
|
|
128
|
+
return undefined;
|
|
129
|
+
}
|
|
130
|
+
return { ok: true, contracts: loaded.contracts };
|
|
131
|
+
}
|
|
132
|
+
async function executeTotally(execute, request, diagnostics, source, caller) {
|
|
105
133
|
const report = createDiagnosticsReporter(diagnostics, request);
|
|
106
134
|
try {
|
|
107
|
-
return await execute(request, report, source);
|
|
135
|
+
return await execute(request, report, source, caller);
|
|
108
136
|
}
|
|
109
137
|
catch (error) {
|
|
110
138
|
report(error, "A3000");
|
|
@@ -145,18 +173,18 @@ function executeTransactionRequestTotally(execute, request, diagnostics, misuse)
|
|
|
145
173
|
}
|
|
146
174
|
return executeTransactionTotally(execute, envelope.value, diagnostics, undefined, { source: "caller" });
|
|
147
175
|
}
|
|
148
|
-
async function executeTransactionTotally(execute, request, diagnostics, origins, planArguments) {
|
|
176
|
+
async function executeTransactionTotally(execute, request, diagnostics, origins, planArguments, caller) {
|
|
149
177
|
const channel = createTransactionDiagnosticsChannel(diagnostics, request);
|
|
150
178
|
const report = channel.transaction();
|
|
151
179
|
try {
|
|
152
|
-
return await execute(request, channel, origins, planArguments);
|
|
180
|
+
return await execute(request, channel, origins, planArguments, caller);
|
|
153
181
|
}
|
|
154
182
|
catch (error) {
|
|
155
183
|
report(error, "A3000");
|
|
156
184
|
return internalFailure();
|
|
157
185
|
}
|
|
158
186
|
}
|
|
159
|
-
async function runTransactionTotally(execute, assembler, operations, requestId, state, diagnostics) {
|
|
187
|
+
async function runTransactionTotally(execute, assembler, operations, requestId, state, diagnostics, caller) {
|
|
160
188
|
let assembled;
|
|
161
189
|
try {
|
|
162
190
|
assembled = await assembler.assemble(operations);
|
|
@@ -181,5 +209,5 @@ async function runTransactionTotally(execute, assembler, operations, requestId,
|
|
|
181
209
|
source: "owned",
|
|
182
210
|
refused: assembled.refused,
|
|
183
211
|
statements: assembled.statements,
|
|
184
|
-
});
|
|
212
|
+
}, caller);
|
|
185
213
|
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import type { AvAdapterModel } from "../adapters/adapter-model.js";
|
|
2
2
|
import type { AvContract } from "../contracts/contract.js";
|
|
3
3
|
import type { AvApplicationScalarForms, AvWireScalarForms } from "../contracts/scalar-value-type.js";
|
|
4
|
-
import type { AvResourceKey } from "../operations/operation-arguments.js";
|
|
5
|
-
import type {
|
|
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
6
|
import type { AvOperationIdentity } from "../operations/operation-identity.js";
|
|
7
|
+
import { type PolicyCaller } from "../policy/policy-request.js";
|
|
7
8
|
import type { AvExecutionOptions } from "../runtime/execution-options.js";
|
|
8
|
-
import type {
|
|
9
|
+
import type { AvOperationRequest } from "../runtime/operation-request.js";
|
|
9
10
|
import type { AvOperationResponse } from "../runtime/operation-response.js";
|
|
10
11
|
import type { AvState } from "../runtime/request-state.js";
|
|
11
|
-
import type {
|
|
12
|
+
import type { AvSqlStatementBuilder } from "../transactions/sql-statement.js";
|
|
12
13
|
import type { AvTransactionResponse } from "../transactions/transaction-response.js";
|
|
13
14
|
import type { AvContractApplicationView, ClientContractView } from "./contract-view.js";
|
|
14
15
|
/**
|
|
@@ -21,11 +22,29 @@ type OpaqueSurface = {
|
|
|
21
22
|
};
|
|
22
23
|
/** The four typed surfaces of an `AvFramework`, named by the member that holds each. */
|
|
23
24
|
type FacadeSurface = "application" | "client" | "appTx" | "clientTx";
|
|
25
|
+
/** `framework.application.<Resource>.<family>.<variant>` when the variant takes a `select` or `include`. */
|
|
26
|
+
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>;
|
|
27
|
+
/** `framework.application.<Resource>.<family>.<variant>` when it does not (the `count` variants). */
|
|
28
|
+
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>;
|
|
29
|
+
/** `framework.client.<Resource>.<family>.<variant>` when the variant takes a `select` or `include`: wire forms in. */
|
|
30
|
+
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>;
|
|
31
|
+
/** `framework.client.<Resource>.<family>.<variant>` when it does not. */
|
|
32
|
+
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>;
|
|
33
|
+
/** `framework.appTx.<Resource>.<family>.<variant>` when the variant takes a `select` or `include`. */
|
|
34
|
+
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">;
|
|
35
|
+
/** `framework.appTx.<Resource>.<family>.<variant>` when it does not. */
|
|
36
|
+
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">;
|
|
37
|
+
/** `framework.clientTx.<Resource>.<family>.<variant>` when the variant takes a `select` or `include`: wire forms in. */
|
|
38
|
+
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">;
|
|
39
|
+
/** `framework.clientTx.<Resource>.<family>.<variant>` when it does not. */
|
|
40
|
+
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">;
|
|
24
41
|
/**
|
|
25
42
|
* One variant on a surface: a direct call (application or wire forms), or a
|
|
26
|
-
* deferred one for a transaction (`appTx`, `clientTx`)
|
|
43
|
+
* deferred one for a transaction (`appTx`, `clientTx`), projecting when its
|
|
44
|
+
* arguments carry a `select` (as `AvOperationCall` and `AvDeferredOperationCall`
|
|
45
|
+
* decide it).
|
|
27
46
|
*/
|
|
28
|
-
type SurfaceCall<C extends AvContract, R extends AvResourceKey<C>, I extends AvOperationIdentity, S extends FacadeSurface> = S extends "application" ?
|
|
47
|
+
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 "appTx" ? "select" extends keyof DeferredArguments<C, R, I, AvApplicationScalarForms, AvApplicationScalarForms> ? AvAppTxProjectingCall<C, R, I> : AvAppTxPlainCall<C, R, I> : "select" extends keyof DeferredArguments<C, R, I, AvWireScalarForms, AvApplicationScalarForms> ? AvClientTxProjectingCall<C, R, I> : AvClientTxPlainCall<C, R, I>;
|
|
29
48
|
/** The families view `C` advertises on Resource `R`. */
|
|
30
49
|
type FamilyKey<C extends AvContract, R extends AvResourceKey<C>> = keyof AvOperationGrammar<C>[R];
|
|
31
50
|
/** One family node of surface `S`; the public names below are its four instances. */
|
|
@@ -75,9 +94,9 @@ type ApplicationSqlStep = {
|
|
|
75
94
|
/**
|
|
76
95
|
* A developer SQL step, written only as a tagged template:
|
|
77
96
|
* ``framework.appTx.$sql<Row>`select … ${value}` ``. Every interpolated value
|
|
78
|
-
* is bound as a parameter. See {@link
|
|
97
|
+
* is bound as a parameter. See {@link AvSqlStatementBuilder}.
|
|
79
98
|
*/
|
|
80
|
-
readonly $sql:
|
|
99
|
+
readonly $sql: AvSqlStatementBuilder;
|
|
81
100
|
};
|
|
82
101
|
/**
|
|
83
102
|
* `framework.appTx`: one {@link AvAppTxResourceFacade} per Resource of `C`, the
|
|
@@ -130,8 +149,8 @@ type ComputeReadFacade<C> = C extends AvContract ? string extends AvResourceKey<
|
|
|
130
149
|
};
|
|
131
150
|
} : never;
|
|
132
151
|
/** 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) =>
|
|
134
|
-
type FacadeExecutor = (request:
|
|
152
|
+
export type FacadeRequest = (resource: string, identity: AvOperationIdentity, args: unknown, requestId: string, state: AvState | undefined) => AvOperationRequest;
|
|
153
|
+
type FacadeExecutor = (request: AvOperationRequest, caller: PolicyCaller | undefined) => Promise<AvOperationResponse>;
|
|
135
154
|
/**
|
|
136
155
|
* Builds a façade over `model`, the same object its types are read from, so a
|
|
137
156
|
* call that type-checks always reaches `execute`: a Resource, variant or field
|
|
@@ -1,10 +1,11 @@
|
|
|
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";
|
|
3
4
|
import { thrownFailure } from "../runtime/framework-error.factory.js";
|
|
4
5
|
import { requestIdOf } from "../runtime/request-id.js";
|
|
5
6
|
import { stateOptionOf } from "../runtime/request-state.resolver.js";
|
|
6
7
|
export function createOperationFacade(model, request, execute) {
|
|
7
|
-
return createOperationTree(model, (resource, identity) => async (args, options) => settleOperation(await execute(request(resource, identity, args === undefined ? {} : args, requestIdOf(options), stateOptionOf(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))));
|
|
8
9
|
}
|
|
9
10
|
export function settleOperation(response) {
|
|
10
11
|
if (response.cause !== null) {
|
package/dist/index.d.ts
CHANGED
|
@@ -13,12 +13,12 @@ export type { AvConfigExact } from "./config/exact-framework-config.js";
|
|
|
13
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
14
|
export type { AvPipeline, AvTransactionPipeline, } from "./config/pipeline-config.js";
|
|
15
15
|
export type { AvPaginationCapability, AvProjectionScope, AvRelationFilterCapability, AvRelationMutationDirective, AvRelationReducer, AvScalarFilterOperator, AvScalarMutationDirective, AvWriteScope, } from "./contracts/capability.js";
|
|
16
|
-
export type { AvContract, AvContractAgent, AvContractApplication, AvContractClient, AvContractCore, } from "./contracts/contract.js";
|
|
16
|
+
export type { AvContract, AvContractAgent, AvContractApplication, AvContractClient, AvContractCore, AvCoreResource, } from "./contracts/contract.js";
|
|
17
17
|
export type { AvContractLimits } from "./contracts/contract-limits.js";
|
|
18
18
|
export type { AvContractClientProtocol, AvContractHash, AvContractProtocol, } from "./contracts/contract-protocol.js";
|
|
19
19
|
export type { AvCreateRequirementGroup, AvCreateRequirements, } from "./contracts/create-requirements.js";
|
|
20
20
|
export type { AvEnumDefinition } from "./contracts/enum-definition.js";
|
|
21
|
-
export type { AvField, AvProjectionScopes, AvRelationField, AvRelationFieldCapabilities, AvRelationMutationCapability, AvRelationProjectionCapability, AvRelationReducerCapability, AvScalarField, AvScalarFieldCapabilities, AvScalarFormat, AvScopedRelationMutations, AvScopedRelationReducers, AvWriteScopes, } from "./contracts/field.js";
|
|
21
|
+
export type { AvCoreField, AvCoreRelationField, AvField, AvProjectionScopes, AvRelationField, AvRelationFieldCapabilities, AvRelationMutationCapability, AvRelationProjectionCapability, AvRelationReducerCapability, AvScalarField, AvScalarFieldCapabilities, AvScalarFormat, AvScopedRelationMutations, AvScopedRelationReducers, AvWriteScopes, } from "./contracts/field.js";
|
|
22
22
|
export type { AvFieldCheck } from "./contracts/field-check.js";
|
|
23
23
|
export type { AvIdentifier, AvScalarFieldKey } from "./contracts/identifier.js";
|
|
24
24
|
export type { AvLifecycleTrait } from "./contracts/lifecycle-trait.js";
|
|
@@ -27,16 +27,19 @@ export type { AvOperationAvailability, AvOperationVariantScopes, AvResourceOpera
|
|
|
27
27
|
export type { AvBuiltInScalar, AvScalarDefinition, AvScalarRegistry, } from "./contracts/scalar.js";
|
|
28
28
|
export type { AvApplicationScalarForms, AvScalarValueType, AvWireScalarForms, } from "./contracts/scalar-value-type.js";
|
|
29
29
|
export type { AvTransactionCapability } from "./contracts/transaction-capability.js";
|
|
30
|
+
export type { AvContractView } from "./framework/contract-view.js";
|
|
30
31
|
export { createFramework } from "./framework/framework.factory.js";
|
|
31
32
|
export type { AvFramework } from "./framework/framework.js";
|
|
32
33
|
export type { AvConstructionDiagnostic, AvConstructionStage, } from "./framework/framework-construction.error.js";
|
|
33
34
|
export { AvConstructionError } from "./framework/framework-construction.error.js";
|
|
34
|
-
export type { AvApplicationFacade, AvApplicationFamilyFacade, AvApplicationResourceFacade, AvAppTxFacade, AvAppTxFamilyFacade, AvAppTxResourceFacade, AvClientFacade, AvClientFamilyFacade, AvClientResourceFacade, AvClientTxFacade, AvClientTxFamilyFacade, AvClientTxResourceFacade, } from "./framework/operation-facade.js";
|
|
35
|
-
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 { AvApplicationFacade, AvApplicationFamilyFacade, AvApplicationPlainCall, AvApplicationProjectingCall, AvApplicationResourceFacade, AvAppTxFacade, AvAppTxFamilyFacade, AvAppTxPlainCall, AvAppTxProjectingCall, AvAppTxResourceFacade, AvClientFacade, AvClientFamilyFacade, AvClientPlainCall, AvClientProjectingCall, AvClientResourceFacade, AvClientTxFacade, AvClientTxFamilyFacade, AvClientTxPlainCall, AvClientTxProjectingCall, AvClientTxResourceFacade, } from "./framework/operation-facade.js";
|
|
36
|
+
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";
|
|
36
37
|
export type { AvDeferredOperationCall, AvOperationCall, AvOperationGrammar, AvOperationSlot, } from "./operations/operation-call.js";
|
|
37
38
|
export type { AvOperationFamily, AvOperationIdentity, AvOperationVariant, } from "./operations/operation-identity.js";
|
|
38
39
|
export type { AvOperationResultFor } from "./operations/operation-result.js";
|
|
39
40
|
export type { AvValidationCode, AvValidationIssue, } from "./operations/validation-code.js";
|
|
41
|
+
export type { AvPolicyEngine, AvPolicyWhere, } from "./policy/policy-engine.js";
|
|
42
|
+
export type { AvPrebuiltContracts } from "./prebuilt/prebuilt-contracts.js";
|
|
40
43
|
export { AvDecimal } from "./runtime/decimal.js";
|
|
41
44
|
export type { AvDiagnostic, AvDiagnosticsSink, AvMcpDiagnostic, AvOperationDiagnostic, AvTransactionDiagnostic, } from "./runtime/diagnostics-reporter.js";
|
|
42
45
|
export { AvErrorCatalog, type AvErrorCatalogCode, type AvErrorCatalogEntry, type AvErrorKind, } from "./runtime/error.catalog.js";
|
|
@@ -45,14 +48,17 @@ export type { AvComputeContext, AvComputeCreate, AvComputeRead, AvComputeUpdate,
|
|
|
45
48
|
export { AvAuthError, AvConflictError, AvContractMismatchError, AvError, AvInternalError, AvNotFoundError, AvProtocolError, AvValidationError, } from "./runtime/framework-error.js";
|
|
46
49
|
export type { AvJsonValue } from "./runtime/json-value.js";
|
|
47
50
|
export type { AvMisuseEvent, AvMisuseSink, } from "./runtime/misuse-reporter.js";
|
|
51
|
+
export type { AvAgentOperationRequest, AvApplicationOperationRequest, AvClientOperationRequest, AvOperationRequest, AvRequestProtocol, } from "./runtime/operation-request.js";
|
|
48
52
|
export type { AvCause, AvOperationCode, AvOperationErrorCode, AvOperationFailureResponse, AvOperationNoMatchResponse, AvOperationResponse, AvOperationSuccessCode, AvOperationSuccessDataCode, AvOperationSuccessResponse, } from "./runtime/operation-response.js";
|
|
49
53
|
export type { AvAfterHook, AvBeforeHook, AvContext, AvFieldGuard, AvFieldPipe, AvFilter, AvGuard, AvInterceptor, AvPipe, AvTransactionAfterHook, AvTransactionBeforeHook, AvTransactionContext, AvTransactionFilter, AvTransactionGuard, AvTransactionInterceptor, AvTransactionPipe, AvTransactionStep, AvTransportContext, } from "./runtime/pipeline.js";
|
|
50
54
|
export type { AvDeepReadonly } from "./runtime/readonly-value.js";
|
|
51
55
|
export type { AvState } from "./runtime/request-state.js";
|
|
52
56
|
export type { AvOperation, AvOperationHandle, AvOperationReferenceSurface, AvReferenceableField, AvReferenceBuilder, AvSingleRowResult, AvTransactionResults, AvTransactionRunner, } from "./transactions/deferred-operation.js";
|
|
57
|
+
export type { AvSqlStatementBuilder, AvSqlStatementValue, } from "./transactions/sql-statement.js";
|
|
53
58
|
export type { AvTransactionIntegrityViolation } from "./transactions/transaction-integrity-error.js";
|
|
54
59
|
export { AvTransactionIntegrityError } from "./transactions/transaction-integrity-error.js";
|
|
55
60
|
export type { AvTransactionReference } from "./transactions/transaction-reference.js";
|
|
61
|
+
export type { AvAgentTransactionRequest, AvApplicationTransactionRequest, AvClientTransactionRequest, AvTransactionRequest, } from "./transactions/transaction-request.js";
|
|
56
62
|
export type { AvTransactionCommittedResponse, AvTransactionResponse, } from "./transactions/transaction-response.js";
|
|
57
63
|
export type { AvTransactionSlotPathViolation } from "./transactions/transaction-slot-path-error.js";
|
|
58
64
|
export { AvTransactionSlotPathError } from "./transactions/transaction-slot-path-error.js";
|
package/dist/internal.d.ts
CHANGED
|
@@ -32,11 +32,11 @@ export type { AvDatabaseRefusal } from "./operations/database-refusal.js";
|
|
|
32
32
|
export { DATABASE_REFUSALS } from "./operations/database-refusal.js";
|
|
33
33
|
export type { SemanticOperationArguments } from "./operations/operation-validator.js";
|
|
34
34
|
export { VALIDATION_CODES } from "./operations/validation-code.js";
|
|
35
|
+
export { prebuiltFileChanges } from "./prebuilt/prebuilt-changes.js";
|
|
36
|
+
export { emitPrebuiltContracts, prebuiltContractsOf, } from "./prebuilt/prebuilt-contracts.emitter.js";
|
|
35
37
|
export { mcpFailureReporterOf } from "./runtime/diagnostics-reporter.js";
|
|
36
38
|
export type { AvErrorClassName } from "./runtime/framework-error-class.table.js";
|
|
37
39
|
export { FRAMEWORK_ERROR_CLASS_OF } from "./runtime/framework-error-class.table.js";
|
|
38
|
-
export type { AgentOperationRequest, ApplicationOperationRequest, ClientOperationRequest, ClientProtocolIdentity, FrameworkOperationRequest, } from "./runtime/operation-request.js";
|
|
39
40
|
export { OPERATION_CODES } from "./runtime/operation-response.js";
|
|
40
41
|
export type { BuiltinNonRow, OperationFingerprint, } from "./transactions/deferred-operation.js";
|
|
41
42
|
export { computeOperationFingerprint } from "./transactions/operation-fingerprint.js";
|
|
42
|
-
export type { AgentTransactionRequest, ApplicationTransactionRequest, ClientTransactionRequest, FrameworkTransactionRequest, } from "./transactions/transaction-request.js";
|
package/dist/internal.js
CHANGED
|
@@ -13,6 +13,8 @@ export { BUILT_IN_SCALARS } from "./contracts/scalar.js";
|
|
|
13
13
|
export { TRANSACTION_CAPABILITIES } from "./contracts/transaction-capability.js";
|
|
14
14
|
export { DATABASE_REFUSALS } from "./operations/database-refusal.js";
|
|
15
15
|
export { VALIDATION_CODES } from "./operations/validation-code.js";
|
|
16
|
+
export { prebuiltFileChanges } from "./prebuilt/prebuilt-changes.js";
|
|
17
|
+
export { emitPrebuiltContracts, prebuiltContractsOf, } from "./prebuilt/prebuilt-contracts.emitter.js";
|
|
16
18
|
export { mcpFailureReporterOf } from "./runtime/diagnostics-reporter.js";
|
|
17
19
|
export { FRAMEWORK_ERROR_CLASS_OF } from "./runtime/framework-error-class.table.js";
|
|
18
20
|
export { OPERATION_CODES } from "./runtime/operation-response.js";
|