@aventara/testing 0.1.0-pilot.4 → 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 ADDED
@@ -0,0 +1,588 @@
1
+ # @aventara/testing
2
+
3
+ ## 1.0.0-rc.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 8bb1d6a: Breaking: public type and class names take the `Av` prefix. Every public type and class is now `Av` plus what
8
+ it is, with a namespace only where the bare name would be ambiguous: configuration types are `AvConfig…`
9
+ (`AvConfig`, `AvConfigLayer`, `AvConfigResource`, …) and the three Contracts are `AvContract…` (`AvContractCore`,
10
+ `AvContractApplication`, `AvContractClient`). Functions keep their names (`createFramework`, `createFakeAdapter`,
11
+ `createPrismaAdapter`, `defineClientConfig`, `env`), and so do the names that already started with `Av`,
12
+ `AventaraModule`, `AventaraModuleOptions` and `AventaraModuleAsyncOptions`. There are no
13
+ aliases: replace each old name with the new one.
14
+
15
+ Three names merged or left:
16
+
17
+ - `PipelineContext` and `ComputeContext` (which was the same type) are one name, `AvContext`. A compute stage
18
+ now gets its own read-only ctx, `AvComputeContext` (see the ctx entry below).
19
+ - `ComputedRead` is `AvComputeRead`, the one name of a read compute stage: a function, or `{ compute, dependsOn }`.
20
+ `ComputeOnRead`, the bare function type, is no longer exported; `AvComputeRead` accepts the function as it is.
21
+ - `defineFields` and `FrameworkFieldsShape` are removed; `defineResource` replaces them (below).
22
+
23
+ `defineResource` replaces `defineFields`. A Resource's configuration, its root block and its overlay blocks, can
24
+ live in its own module and be spread into each layer's `resources` tree:
25
+
26
+ ```ts
27
+ export const submission = defineResource<Model>()(
28
+ "Submission",
29
+ {
30
+ pipelines: { guards: [signedIn] },
31
+ fields: { title: { pipelines: { pipes: [trim] } } },
32
+ },
33
+ { client: { fields: { title: { pipelines: { validators: [AvZ.maxLength(80)] } } } } },
34
+ );
35
+
36
+ // aventara.config.ts
37
+ resources: { ...submission.root, ...payment.root },
38
+ client: { resources: { ...submission.client } },
39
+ ```
40
+
41
+ It returns `{ root, application?, client? }`, each `{ Submission: block }`; a layer given no block is left out. The
42
+ root block is typed exactly as `resources.Submission` is typed in place: field definitions are checked against what
43
+ the adapter discovered, stages are typed for the Resource, and a key no level admits is a type error at the key.
44
+ Each overlay block is typed as `application.resources.Submission` or `client.resources.Submission` is in place,
45
+ against the root block: it may name a field the root block defines, and a `definition` in it is a type error (and
46
+ `CONFIG_FORBIDDEN_IN_OVERLAY` at startup). Spread, the configuration is the inline one: the same Contracts and
47
+ ClientContract hash. A field `definition` that `defineFields` returned now sits at
48
+ `fields.<field>.definition` inside the block.
49
+
50
+ The generated client's names follow the same rule. Regenerate with `avclient generate`; then rename the
51
+ imports from `AvClient.ts`:
52
+
53
+ | Before | After |
54
+ | ----------------------- | ------------------------- |
55
+ | `AuthError` | `AvAuthError` |
56
+ | `CallOptions` | `AvCallOptions` |
57
+ | `Cause` | `AvCause` |
58
+ | `ConflictError` | `AvConflictError` |
59
+ | `ContractMismatchError` | `AvContractMismatchError` |
60
+ | `Decimal` | `AvDecimal` |
61
+ | `Fetch` | `AvFetch` |
62
+ | `FrameworkError` | `AvError` |
63
+ | `InternalError` | `AvInternalError` |
64
+ | `NotFoundError` | `AvNotFoundError` |
65
+ | `Operation<T>` | `AvOperation<T>` |
66
+ | `OperationCode` | `AvOperationCode` |
67
+ | `ProtocolError` | `AvProtocolError` |
68
+ | `TransportError` | `AvTransportError` |
69
+ | `ValidationCode` | `AvValidationCode` |
70
+ | `ValidationError` | `AvValidationError` |
71
+ | `ValidationIssue` | `AvValidationIssue` |
72
+
73
+ An enum whose name is one of these now walks the rename ladder (`AvDecimal` → `AvDecimalEnum`); an enum named
74
+ `Decimal` is emitted as `Decimal`.
75
+
76
+ `@aventara/core`, every renamed export:
77
+
78
+ | Before | After |
79
+ | ------------------------------------- | ---------------------------------- |
80
+ | `Adapter` | `AvAdapter` |
81
+ | `AdapterDiscoveryDiagnostic` | `AvAdapterDiscoveryDiagnostic` |
82
+ | `AdapterDiscoveryDiagnosticCode` | `AvAdapterDiscoveryDiagnosticCode` |
83
+ | `AdapterModel` | `AvAdapterModel` |
84
+ | `AddedFieldDefinition` | `AvConfigAddedFieldDefinition` |
85
+ | `AfterHook` | `AvAfterHook` |
86
+ | `AnyFrameworkConfig` | `AvConfigAny` |
87
+ | `AnyLayerConfig` | `AvConfigLayerAny` |
88
+ | `AnyResourcesBlock` | `AvConfigResourcesAny` |
89
+ | `ApplicationContract` | `AvContractApplication` |
90
+ | `ApplicationScalarForms` | `AvApplicationScalarForms` |
91
+ | `BeforeHook` | `AvBeforeHook` |
92
+ | `BuiltInScalar` | `AvBuiltInScalar` |
93
+ | `Cause` | `AvCause` |
94
+ | `ClientContract` | `AvContractClient` |
95
+ | `ClientContractProtocol` | `AvContractClientProtocol` |
96
+ | `ComputedRead` | `AvComputeRead` |
97
+ | `ComputeOnCreate` | `AvComputeCreate` |
98
+ | `ComputeOnUpdate` | `AvComputeUpdate` |
99
+ | `ConfigDiagnostic` | `AvConfigDiagnostic` |
100
+ | `ConfigDiagnosticCode` | `AvConfigDiagnosticCode` |
101
+ | `ConfigFieldKey` | `AvConfigFieldKey` |
102
+ | `ConfigLayer` | `AvConfigLayerName` |
103
+ | `Contract` | `AvContract` |
104
+ | `ContractCompilerDiagnostic` | `AvContractCompilerDiagnostic` |
105
+ | `ContractCompilerDiagnosticCode` | `AvContractCompilerDiagnosticCode` |
106
+ | `ContractHash` | `AvContractHash` |
107
+ | `ContractLimits` | `AvContractLimits` |
108
+ | `ContractProtocol` | `AvContractProtocol` |
109
+ | `CoreContract` | `AvContractCore` |
110
+ | `CreateDataInput` | `AvCreateDataInput` |
111
+ | `CursorInput` | `AvCursorInput` |
112
+ | `Decimal` | `AvDecimal` |
113
+ | `DeferredOperationCall` | `AvDeferredOperationCall` |
114
+ | `EffectiveFieldKey` | `AvEffectiveFieldKey` |
115
+ | `EnumDefinition` | `AvEnumDefinition` |
116
+ | `ExactFrameworkConfig` | `AvConfigExact` |
117
+ | `ExecutionOptions` | `AvExecutionOptions` |
118
+ | `Field` | `AvField` |
119
+ | `FieldComputeConfig` | `AvFieldCompute` |
120
+ | `FieldKey` | `AvFieldKey` |
121
+ | `FieldPipe` | `AvFieldPipe` |
122
+ | `FieldWriteGuard` | `AvFieldGuard` |
123
+ | `Filter` | `AvFilter` |
124
+ | `Framework` | `AvFramework` |
125
+ | `FrameworkConfig` | `AvConfig` |
126
+ | `FrameworkConstructionDiagnostic` | `AvConstructionDiagnostic` |
127
+ | `FrameworkConstructionError` | `AvConstructionError` |
128
+ | `FrameworkConstructionStage` | `AvConstructionStage` |
129
+ | `FrameworkContracts` | `AvContracts` |
130
+ | `FrameworkDiagnostic` | `AvDiagnostic` |
131
+ | `FrameworkDiagnosticsSink` | `AvDiagnosticsSink` |
132
+ | `FrameworkError` | `AvError` |
133
+ | `FrameworkExemptionsConfig` | `AvConfigExemptions` |
134
+ | `FrameworkFamilyConfig` | `AvConfigFamily` |
135
+ | `FrameworkFieldDefinition` | `AvConfigFieldDefinition` |
136
+ | `FrameworkFieldLifecycleTrait` | `AvConfigFieldLifecycleTrait` |
137
+ | `FrameworkLayerConfig` | `AvConfigLayer` |
138
+ | `FrameworkLayerKind` | `AvConfigLayerKind` |
139
+ | `FrameworkLimitsConfig` | `AvConfigLimits` |
140
+ | `FrameworkMisuseEvent` | `AvMisuseEvent` |
141
+ | `FrameworkMisuseSink` | `AvMisuseSink` |
142
+ | `FrameworkOperationsConfig` | `AvConfigOperations` |
143
+ | `FrameworkOperationsExemption` | `AvConfigOperationsExemption` |
144
+ | `FrameworkOverlayFieldConfig` | `AvConfigOverlayField` |
145
+ | `FrameworkRelationFieldExemption` | `AvConfigRelationFieldExemption` |
146
+ | `FrameworkResourceConfig` | `AvConfigResource` |
147
+ | `FrameworkResourceExemption` | `AvConfigResourceExemption` |
148
+ | `FrameworkResourceFieldsConfig` | `AvConfigResourceFields` |
149
+ | `FrameworkResourceKey` | `AvConfigResourceKey` |
150
+ | `FrameworkResourcesConfig` | `AvConfigResources` |
151
+ | `FrameworkResourceTransactionsConfig` | `AvConfigResourceTransactions` |
152
+ | `FrameworkRootFieldConfig` | `AvConfigRootField` |
153
+ | `FrameworkScalarFieldExemption` | `AvConfigScalarFieldExemption` |
154
+ | `FrameworkScalarTypeRef` | `AvConfigScalarTypeRef` |
155
+ | `FrameworkVariantConfig` | `AvConfigVariant` |
156
+ | `Guard` | `AvGuard` |
157
+ | `Identifier` | `AvIdentifier` |
158
+ | `IncludeInput` | `AvIncludeInput` |
159
+ | `Interceptor` | `AvInterceptor` |
160
+ | `JsonValue` | `AvJsonValue` |
161
+ | `KnownFieldDefinition` | `AvConfigKnownFieldDefinition` |
162
+ | `LifecycleTrait` | `AvLifecycleTrait` |
163
+ | `NullsOrder` | `AvNullsOrder` |
164
+ | `Operation` | `AvOperation` |
165
+ | `OperationArgumentMap` | `AvOperationArgumentMap` |
166
+ | `OperationArgumentsFor` | `AvOperationArgumentsFor` |
167
+ | `OperationAvailability` | `AvOperationAvailability` |
168
+ | `OperationCall` | `AvOperationCall` |
169
+ | `OperationCode` | `AvOperationCode` |
170
+ | `OperationDiagnostic` | `AvOperationDiagnostic` |
171
+ | `OperationErrorCode` | `AvOperationErrorCode` |
172
+ | `OperationFailureResponse` | `AvOperationFailureResponse` |
173
+ | `OperationFamily` | `AvOperationFamily` |
174
+ | `OperationGrammar` | `AvOperationGrammar` |
175
+ | `OperationIdentity` | `AvOperationIdentity` |
176
+ | `OperationNoMatchResponse` | `AvOperationNoMatchResponse` |
177
+ | `OperationReferenceSurface` | `AvOperationReferenceSurface` |
178
+ | `OperationResponse` | `AvOperationResponse` |
179
+ | `OperationResultFor` | `AvOperationResultFor` |
180
+ | `OperationSlot` | `AvOperationSlot` |
181
+ | `OperationSuccessCode` | `AvOperationSuccessCode` |
182
+ | `OperationSuccessDataCode` | `AvOperationSuccessDataCode` |
183
+ | `OperationSuccessResponse` | `AvOperationSuccessResponse` |
184
+ | `OperationVariant` | `AvOperationVariant` |
185
+ | `OperationVariantScopes` | `AvOperationVariantScopes` |
186
+ | `OrderByEntry` | `AvOrderByEntry` |
187
+ | `OrderByInput` | `AvOrderByInput` |
188
+ | `PaginationCapability` | `AvPaginationCapability` |
189
+ | `Pipe` | `AvPipe` |
190
+ | `PipelineConfig` | `AvPipeline` |
191
+ | `PipelineContext` | `AvContext` |
192
+ | `PipelineTransportContext` | `AvTransportContext` |
193
+ | `ProjectionEntry` | `AvProjectionEntry` |
194
+ | `ProjectionScope` | `AvProjectionScope` |
195
+ | `ProjectionScopes` | `AvProjectionScopes` |
196
+ | `ReferenceableField` | `AvReferenceableField` |
197
+ | `ReferenceBuilder` | `AvReferenceBuilder` |
198
+ | `RelationField` | `AvRelationField` |
199
+ | `RelationFieldCapabilities` | `AvRelationFieldCapabilities` |
200
+ | `RelationFieldCapabilityName` | `AvRelationFieldCapabilityName` |
201
+ | `RelationFieldPipelineConfig` | `AvRelationFieldPipeline` |
202
+ | `RelationFilterCapability` | `AvRelationFilterCapability` |
203
+ | `RelationMutationCapability` | `AvRelationMutationCapability` |
204
+ | `RelationMutationDirective` | `AvRelationMutationDirective` |
205
+ | `RelationProjectionCapability` | `AvRelationProjectionCapability` |
206
+ | `RelationProjectionInput` | `AvRelationProjectionInput` |
207
+ | `RelationReducer` | `AvRelationReducer` |
208
+ | `RelationReducerCapability` | `AvRelationReducerCapability` |
209
+ | `RequestOrigin` | `AvRequestOrigin` |
210
+ | `Resource` | `AvResource` |
211
+ | `ResourceFieldMap` | `AvResourceFieldMap` |
212
+ | `ResourceKey` | `AvResourceKey` |
213
+ | `ResourceOperations` | `AvResourceOperations` |
214
+ | `ScalarDefinition` | `AvScalarDefinition` |
215
+ | `ScalarField` | `AvScalarField` |
216
+ | `ScalarFieldCapabilities` | `AvScalarFieldCapabilities` |
217
+ | `ScalarFieldCapabilityName` | `AvScalarFieldCapabilityName` |
218
+ | `ScalarFieldKey` | `AvScalarFieldKey` |
219
+ | `ScalarFieldPipelineConfig` | `AvScalarFieldPipeline` |
220
+ | `ScalarFilterOperator` | `AvScalarFilterOperator` |
221
+ | `ScalarFormat` | `AvScalarFormat` |
222
+ | `ScalarMutationDirective` | `AvScalarMutationDirective` |
223
+ | `ScalarOrderInput` | `AvScalarOrderInput` |
224
+ | `ScalarRegistry` | `AvScalarRegistry` |
225
+ | `ScalarValueType` | `AvScalarValueType` |
226
+ | `ScopedRelationMutations` | `AvScopedRelationMutations` |
227
+ | `ScopedRelationReducers` | `AvScopedRelationReducers` |
228
+ | `SelectInput` | `AvSelectInput` |
229
+ | `SingleRowResult` | `AvSingleRowResult` |
230
+ | `SortDirection` | `AvSortDirection` |
231
+ | `TransactionAfterHook` | `AvTransactionAfterHook` |
232
+ | `TransactionBeforeHook` | `AvTransactionBeforeHook` |
233
+ | `TransactionCapability` | `AvTransactionCapability` |
234
+ | `TransactionCommittedResponse` | `AvTransactionCommittedResponse` |
235
+ | `TransactionDiagnostic` | `AvTransactionDiagnostic` |
236
+ | `TransactionFilter` | `AvTransactionFilter` |
237
+ | `TransactionGuard` | `AvTransactionGuard` |
238
+ | `TransactionIntegrityError` | `AvTransactionIntegrityError` |
239
+ | `TransactionIntegrityViolation` | `AvTransactionIntegrityViolation` |
240
+ | `TransactionInterceptor` | `AvTransactionInterceptor` |
241
+ | `TransactionPipe` | `AvTransactionPipe` |
242
+ | `TransactionPipelineConfig` | `AvTransactionPipeline` |
243
+ | `TransactionPipelineContext` | `AvTransactionContext` |
244
+ | `TransactionReference` | `AvTransactionReference` |
245
+ | `TransactionResponse` | `AvTransactionResponse` |
246
+ | `TransactionResults` | `AvTransactionResults` |
247
+ | `TransactionRunner` | `AvTransactionRunner` |
248
+ | `TransactionSlotPathError` | `AvTransactionSlotPathError` |
249
+ | `TransactionSlotPathViolation` | `AvTransactionSlotPathViolation` |
250
+ | `UniqueWhereInput` | `AvUniqueWhereInput` |
251
+ | `UpdateDataInput` | `AvUpdateDataInput` |
252
+ | `ValidationCode` | `AvValidationCode` |
253
+ | `ValidationIssue` | `AvValidationIssue` |
254
+ | `WhereInput` | `AvWhereInput` |
255
+ | `WireScalarForms` | `AvWireScalarForms` |
256
+ | `WriteScope` | `AvWriteScope` |
257
+ | `WriteScopes` | `AvWriteScopes` |
258
+
259
+ Error classes whose `name` a log or a test may read:
260
+
261
+ | Before | After |
262
+ | ------------------------ | -------------------------- |
263
+ | `CallerDataError` | `AvCallerDataError` |
264
+ | `ClientConfigError` | `AvClientConfigError` |
265
+ | `ComputedValueError` | `AvComputedValueError` |
266
+ | `ContractProtocolError` | `AvContractProtocolError` |
267
+ | `ContractTransportError` | `AvContractTransportError` |
268
+ | `EnvFileError` | `AvEnvFileError` |
269
+ | `OutputValidationError` | `AvOutputValidationError` |
270
+ | `OutputWriteError` | `AvOutputWriteError` |
271
+ | `PipeOutputError` | `AvPipeOutputError` |
272
+ | `UnmountedRouteError` | `AvUnmountedRouteError` |
273
+
274
+ `@aventara/testing`:
275
+
276
+ | Before | After |
277
+ | ------------------------ | -------------------------- |
278
+ | `AdapterFactory` | `AvAdapterFactory` |
279
+ | `FakeAdapter` | `AvFakeAdapter` |
280
+ | `FakeAdapterExecute` | `AvFakeAdapterExecute` |
281
+ | `FakeAdapterOptions` | `AvFakeAdapterOptions` |
282
+ | `FakeAdapterRollback` | `AvFakeAdapterRollback` |
283
+ | `FakeTransactionOutcome` | `AvFakeTransactionOutcome` |
284
+ | `FakeTransactionTrace` | `AvFakeTransactionTrace` |
285
+
286
+ `@aventara/client` (the `framework.client.ts` config types):
287
+
288
+ | Before | After |
289
+ | ------------------- | --------------------- |
290
+ | `ClientConfigInput` | `AvClientConfigInput` |
291
+ | `ConfigValue` | `AvClientConfigValue` |
292
+ | `EnvReference` | `AvEnvReference` |
293
+
294
+ `@aventara/prisma7-adapter`: its public types and error classes (`createPrismaAdapter` keeps its name):
295
+
296
+ | Before | After |
297
+ | ---------------------------------- | ------------------------------------ |
298
+ | `PrismaAdapterModel` | `AvPrismaAdapterModel` |
299
+ | `PrismaAdapterOptions` | `AvPrismaAdapterOptions` |
300
+ | `PrismaDelegate` | `AvPrismaDelegate` |
301
+ | `PrismaDelegateHost` | `AvPrismaDelegateHost` |
302
+ | `PrismaDelegateIndex` | `AvPrismaDelegateIndex` |
303
+ | `PrismaDiscoveryArtifact` | `AvPrismaDiscoveryArtifact` |
304
+ | `PrismaDriver` | `AvPrismaDriver` |
305
+ | `PrismaIsolationLevel` | `AvPrismaIsolationLevel` |
306
+ | `PrismaProvider` | `AvPrismaProvider` |
307
+ | `PrismaProviderProfile` | `AvPrismaProviderProfile` |
308
+ | `PrismaReferentialAction` | `AvPrismaReferentialAction` |
309
+ | `PrismaReferentialActionTable` | `AvPrismaReferentialActionTable` |
310
+ | `PrismaReferentialEdge` | `AvPrismaReferentialEdge` |
311
+ | `PrismaResourceReferentialActions` | `AvPrismaResourceReferentialActions` |
312
+ | `PrismaTransactionOptions` | `AvPrismaTransactionOptions` |
313
+ | `PrismaCapabilityDerivationError` | `AvPrismaCapabilityDerivationError` |
314
+ | `PrismaDiscoveryArtifactError` | `AvPrismaDiscoveryArtifactError` |
315
+ | `PrismaEmulationError` | `AvPrismaEmulationError` |
316
+ | `PrismaExecutionError` | `AvPrismaExecutionError` |
317
+ | `PrismaExistenceGateError` | `AvPrismaExistenceGateError` |
318
+ | `PrismaFieldProjectionError` | `AvPrismaFieldProjectionError` |
319
+ | `PrismaGenerateCliError` | `AvPrismaGenerateCliError` |
320
+ | `PrismaGenerateStepError` | `AvPrismaGenerateStepError` |
321
+ | `PrismaModelCompositionError` | `AvPrismaModelCompositionError` |
322
+ | `PrismaMutationTranslationError` | `AvPrismaMutationTranslationError` |
323
+ | `PrismaOperationTranslationError` | `AvPrismaOperationTranslationError` |
324
+ | `PrismaOrderTranslationError` | `AvPrismaOrderTranslationError` |
325
+ | `PrismaProjectionTranslationError` | `AvPrismaProjectionTranslationError` |
326
+ | `PrismaResultShapeError` | `AvPrismaResultShapeError` |
327
+ | `PrismaScalarConversionError` | `AvPrismaScalarConversionError` |
328
+ | `PrismaSchemaReaderError` | `AvPrismaSchemaReaderError` |
329
+ | `PrismaTypesReaderError` | `AvPrismaTypesReaderError` |
330
+ | `PrismaWhereTranslationError` | `AvPrismaWhereTranslationError` |
331
+
332
+ - 1b5d3c0: Breaking: every framework member of a pipeline ctx is `$`-prefixed, and ctx is now the framework's executor.
333
+ The rest of ctx is your Resources: `ctx.<Resource>.<family>.<variant>(args)`, plus `ctx.$sql` and
334
+ `ctx.$transaction`. Because a Resource name can never start with `$` (`COMPILER_RESERVED_RESOURCE_NAME`), a Resource
335
+ never shadows a framework member. The old names are gone with no alias. Reading one is a type error; at runtime it
336
+ is `undefined`.
337
+
338
+ | rc.0 | rc.1 |
339
+ | --------------------------------------------------------- | --------------------------------------------------------------------------- |
340
+ | `ctx.resource`, `ctx.family`, `ctx.variant`, `ctx.nested` | `ctx.$operation.resource`, `.family`, `.variant`, `.nested` |
341
+ | `ctx.args` | `ctx.$args` (a transaction stage: the plan, `readonly AvTransactionStep[]`) |
342
+ | `ctx.origin` | `ctx.$origin` |
343
+ | `ctx.requestId` | `ctx.$requestId` |
344
+ | `ctx.transport` | `ctx.$transport` |
345
+ | `ctx.contract` | `ctx.$contract` |
346
+
347
+ A transaction stage's ctx has no `$operation`.
348
+
349
+ ```ts
350
+ hooks: {
351
+ after: [
352
+ async (post, ctx) => {
353
+ await ctx.User.update.unique({ where: { id: authorId }, data: { postCount: { $increment: 1 } } });
354
+ await ctx.$sql`insert into audit_events (actor, action) values (${actorId}, ${"post.create"})`;
355
+ },
356
+ ],
357
+ },
358
+ ```
359
+
360
+ - A ctx call is raw and application-origin. It runs the Framework Validation Layer against the
361
+ ApplicationContract, plus field pipes, field validators and compute. It runs no developer stage: no guards, pipes,
362
+ hooks, interceptors or filters at any level, no field write guards, no nested target guards, no Resource
363
+ transaction stages, and no `forceTransaction` wrapping. So a hook's call never re-enters the hook that made it.
364
+ The application layer's exposure limits it. The client's does not.
365
+ - A call resolves the operation's data directly (a row, a list, a count, or `null` for a first-style miss). A
366
+ failure throws the `AvError` subclass of its code's class (`AvNotFoundError`, `AvValidationError`, …; see the
367
+ in-process calls entry below) carrying the failure's `code` and `cause`.
368
+ - It joins the current transaction. That covers a plan step's stages, a forced call's stages, a Resource's
369
+ transaction stages and a `ctx.$transaction` callback. Outside a transaction each call runs on its own. Under
370
+ `forceTransaction`, an after hook's ctx writes commit with the operation or not at all (the outbox and
371
+ counter-on-another-Resource cases).
372
+ - `ctx.$sql` is the bound tagged template of `appTx.$sql`, run at once. It takes only the tagged-template form,
373
+ binds every value, needs the Adapter's `sqlStatements`, and accepts no `$ref`. It resolves the rows, typed by
374
+ `ctx.$sql<Row>`. Inside a transaction it runs on it; outside one it is a plain statement, with no transaction
375
+ opened around it, and `transactionsStyle: "none"` does not affect it (only `ctx.$transaction` is refused there).
376
+ - `ctx.$transaction(async (tx) => …)` runs the callback in one transaction, with `tx` the ctx bound to it, and
377
+ resolves what the callback returns. A throw rolls it back and is rethrown as it was. Inside an open transaction it
378
+ opens nothing and joins.
379
+ - The executor is typed from the adapter's model, with the application forms and the operation's data
380
+ as the result, like `framework.application`'s success data. A stage typed for any model (`AvGuard` with no model)
381
+ names no Resource.
382
+ - Compute gets a read-only ctx, `AvComputeContext` (new public name). It carries the `$` facts and
383
+ `ctx.<Resource>.find.*` (`find.count` included), and nothing that writes: no write families, no `$sql`, no
384
+ `$transaction`. This holds at runtime too: reaching one throws, and the operation answers `A3000`. A compute
385
+ stage's input is now `{ field, value, data, ctx }` (`{ field, value, record, ctx }` on read). rc.0's `origin`,
386
+ `resource` and `operation` members are gone: use `ctx.$origin`, `ctx.$operation`, and the stage's placement for
387
+ its Resource.
388
+ - A transaction pipe's returned plan is typed `readonly AvTransactionStep[]` (any model). The runtime holds it to
389
+ the plan it was given, as before.
390
+
391
+ - 9c52482: A `$connect` to a row that does not exist now answers `404 A2003` (not found), the same as reading a missing row.
392
+ Before, it answered `422 A2004`. This covers a to-one `$connect` in `create`, `update` and `upsert`, a to-many
393
+ `$connect`, and the same writes inside a transaction plan, where `cause.operation` names the step. The message is
394
+ unchanged: "The operation's arguments referenced a record that does not exist." On `update.first`, the same mistake
395
+ answered `A2014` before, as if the row had changed underneath; it now answers `A2003` too, and a duplicate unique value
396
+ written through `update.first` answers `409 A2008` instead of `A3001`.
397
+
398
+ Clearer top-level messages for an unknown Resource or operation. `A2001` now says "The requested Resource is not
399
+ available." and `A2002` says "The requested operation is not available on this Resource.", instead of "Operation
400
+ arguments failed framework validation.", which stays the message of `A2004`, `A2007` and `A2009`. A transaction step
401
+ whose operation is outside the standard grammar now carries the same issue message as a single call, naming the
402
+ operation and the Resource (for example `Operation "dance.one" is not available on Resource "posts".`), instead of
403
+ "Operation is not part of the standard operation grammar."
404
+
405
+ A `$ref` with no `fingerprint` is `V1000` (required value missing) and answers `422 A2004`. Before, it was `V1017`
406
+ (fingerprint mismatch) under `A2007`. A fingerprint that is present but wrong is still `V1017`.
407
+
408
+ `aventara init` and `aventara new` link to the documentation at https://aventara-framework.vercel.app. The old
409
+ address redirects, so links already written into projects keep working.
410
+
411
+ - Updated dependencies [800123b]
412
+ - Updated dependencies [8bb1d6a]
413
+ - Updated dependencies [68d4395]
414
+ - Updated dependencies [7e3d06f]
415
+ - Updated dependencies [1b5d3c0]
416
+ - Updated dependencies [6317811]
417
+ - Updated dependencies [6d0e5d6]
418
+ - Updated dependencies [7a0cab9]
419
+ - Updated dependencies [eb2a718]
420
+ - Updated dependencies [03312c5]
421
+ - Updated dependencies [123f6dc]
422
+ - Updated dependencies [b65df2e]
423
+ - Updated dependencies [c6e5010]
424
+ - Updated dependencies [c1f9389]
425
+ - Updated dependencies [9c52482]
426
+ - Updated dependencies [8396148]
427
+ - Updated dependencies [e8fbb02]
428
+ - Updated dependencies [916e5f6]
429
+ - Updated dependencies [6cbd158]
430
+ - @aventara/core@1.0.0-rc.1
431
+
432
+ ## 1.0.0-rc.0
433
+
434
+ ### Major Changes
435
+
436
+ - First release candidate of Aventara 1.0. The public API is now considered stable; changes before 1.0.0 are possible
437
+ based on feedback.
438
+
439
+ ### Minor Changes
440
+
441
+ - 24ffbab: The protocol fixtures gain two transaction rows: a committed plan whose unique `where` and filter reference an earlier
442
+ step's result (`200 A1009`), and a reference in a `where` to a step that does not exist (`422 A2007` / `V1016`).
443
+
444
+ ### Patch Changes
445
+
446
+ - 24ffbab: `@aventara/testing` loads from CommonJS: `require("@aventara/testing")` returns the same module `import` does (its
447
+ export gains a `default` condition, as core's and nest's have). The package stays ESM; Node's `require()` of an ES
448
+ module needs Node 22.18 or later, which the package already requires.
449
+ - 24ffbab: Each package ships its `CHANGELOG.md`, so the release notes are in the installed package beside the README.
450
+ - 24ffbab: New export `AvProtocolCorpus`: the protocol corpus's server side, for serving it through a client or host you are
451
+ writing. `await AvProtocolCorpus.framework()` gives a fresh corpus `Framework` (pass a row's `Aventara-Contract-Hash`
452
+ to get the contract that row targets), `AvProtocolCorpus.entrypoint` is where to mount it (`"/api"`, every row's path is
453
+ relative to it), and `AvProtocolCorpus.clientContractHash` is the hash a client generated against it sends. The README
454
+ has a section on serving the corpus through your own stack.
455
+ - 24ffbab: The protocol corpus now ships as plain JSON at `@aventara/testing/fixtures/protocol-v1.json`, for clients and hosts
456
+ written in any language: the protocol version, the entrypoint, each ClientContract the rows target (its hash and exact
457
+ `GET /_contract` bytes) and every row of `AvProtocolFixtures`. It is generated from the TypeScript corpus when the
458
+ package is built. The one body too large to write out (1 MiB + 1 byte) is a recipe: `prefix` + `repeat` × `times` +
459
+ `suffix`. The README describes the format.
460
+ - 384a50c: **Behaviour changes, transactions:** every issue about a transaction step's arguments now names where it is
461
+ in the plan, `["operations", i, "args", …]`, beside `cause.operation: i`. Before, the framework's own checks — a wrong
462
+ type, an unknown field or operator, a structural limit, a Json value out of its `AvZ` shape, a value that is not valid
463
+ JSON — answered `["arguments", …]` inside a plan while a bad `$ref`, a refused value and a step that depends on a
464
+ cascaded delete already answered `["operations", i, "args", …]`; now one plan uses one spelling, through
465
+ `framework.transaction`, `framework.executeTransaction` and `POST /_transactions` alike. A single call is unchanged
466
+ (`["arguments", …]`). If your code reads `issue.path` from a transaction's answer, drop the `"operations", i, "args"`
467
+ prefix to get the path inside that step's arguments. `@aventara/testing`'s protocol corpus row "a client-hidden
468
+ field — /_transactions" and `fixtures/protocol-v1.json` carry the new path.
469
+ - 032f792: **Behaviour changes, transactions:** an error about a transaction step itself — rather than its arguments — now
470
+ names the step too, so every path in a transaction's answer is a path through the request you sent: an unknown or
471
+ hidden Resource is at `["operations", i, "resource"]`, a fingerprint that does not match at
472
+ `["operations", i, "fingerprint"]`, a missing or unknown key on the step at `["operations", i, "<key>"]`, and a step
473
+ that is not an object at `["operations", i]`. An operation the step cannot run points at the key that is wrong:
474
+ `["operations", i, "family"]` when the family is not a string, not a standard family, or one the Resource offers no
475
+ variant of; `["operations", i, "variant"]` when the family is right and the variant is not (unknown, not offered or
476
+ restricted for it). Before, these answered `["resource"]`, `["operation"]`, `["fingerprint"]` and `["<key>"]`.
477
+ `cause.operation` and the outcome code are unchanged: an unknown Resource is still `A2001`, an unavailable operation
478
+ `A2002`. `framework.transaction([...])` refuses an entry that is not a handle, or one handle placed twice, at
479
+ `["operations", i]`. A single call is unchanged. `@aventara/testing`'s protocol corpus and `fixtures/protocol-v1.json`
480
+ carry the new paths.
481
+ - dbe6961: **Behaviour changes:** a single call to an operation a Resource does not offer now names the key of the
482
+ request that is wrong instead of `["operation"]`, which no request has: `["family"]` when the family is not a standard
483
+ one or the Resource offers none of its operations, `["variant"]` when the family is right and the variant is not. This
484
+ holds for `framework.execute` and for an HTTP route, whose `/_resources/:resource/:family/:variant` segments are named
485
+ by those same keys. The code is unchanged (`A2002` / `V1006`), and so is `["resource"]` for an unknown Resource.
486
+ `@aventara/testing`'s protocol corpus and `fixtures/protocol-v1.json` carry the new paths.
487
+ - Updated dependencies [24ffbab]
488
+ - Updated dependencies [24ffbab]
489
+ - Updated dependencies [24ffbab]
490
+ - Updated dependencies [24ffbab]
491
+ - Updated dependencies [24ffbab]
492
+ - Updated dependencies [24ffbab]
493
+ - Updated dependencies [24ffbab]
494
+ - Updated dependencies [24ffbab]
495
+ - Updated dependencies [24ffbab]
496
+ - Updated dependencies [24ffbab]
497
+ - Updated dependencies [24ffbab]
498
+ - Updated dependencies [24ffbab]
499
+ - Updated dependencies [a973e89]
500
+ - Updated dependencies [1e65e9a]
501
+ - Updated dependencies
502
+ - Updated dependencies [a973e89]
503
+ - Updated dependencies [a973e89]
504
+ - Updated dependencies [1e65e9a]
505
+ - Updated dependencies [1e65e9a]
506
+ - Updated dependencies [24ffbab]
507
+ - Updated dependencies [2d00ad7]
508
+ - Updated dependencies [384a50c]
509
+ - Updated dependencies [d43d1cc]
510
+ - Updated dependencies [3f98749]
511
+ - Updated dependencies [032f792]
512
+ - Updated dependencies [dbe6961]
513
+ - @aventara/core@1.0.0-rc.0
514
+
515
+ ## 0.1.0-pilot.4
516
+
517
+ ### Patch Changes
518
+
519
+ - f37dcd6: The documentation shipped with the package — the comments an editor shows on hover, and the README — now describes
520
+ what each export does, how to use it, what it returns and what it throws. Notes about how the package was built and
521
+ why are no longer part of what is published.
522
+ - Updated dependencies [f37dcd6]
523
+ - @aventara/core@0.1.0-pilot.4
524
+
525
+ ## 0.1.0-pilot.3
526
+
527
+ ### Patch Changes
528
+
529
+ - @aventara/core@0.1.0-pilot.3
530
+
531
+ ## 0.1.0-pilot.2
532
+
533
+ ### Patch Changes
534
+
535
+ - e69e88d: The published packages are written for the people who use them. The JavaScript ships without comments; the type
536
+ declarations keep their documentation, and it, the error messages, the protocol fixtures' labels and the comments in a
537
+ generated client no longer carry the project's internal development notes.
538
+ - ab58424: A pipe's output is checked against the server's own rules before it reaches the adapter. The request is validated
539
+ against the caller's Contract; after each pipe, the arguments are validated against the Core Contract (plus fields the
540
+ caller's scope adds), so a pipe may still write what the caller cannot — a field the client Contract hides, such as a
541
+ password hash — but not what the server cannot store. A refusal is the new internal code `A3004 PIPE_OUTPUT_INVALID` (HTTP
542
+ 500). The caller receives only the generic `A server pipeline produced invalid arguments.`, like every internal
543
+ failure; the pipe (`pipes[i]` and its function name), the operation, the offending field and its V-code go to the
544
+ diagnostics sink as a `PipeOutputError`, and `@aventara/nest` writes them into its error log line. Nothing reaches the
545
+ adapter. This holds for operations and transaction steps alike (a plan answers with `cause.operation`). Generated
546
+ clients map `A3004` to `InternalError`; the protocol fixtures in `@aventara/testing` include an `A3004` row.
547
+ - Updated dependencies [c2a3b7c]
548
+ - Updated dependencies [e69e88d]
549
+ - Updated dependencies [ab58424]
550
+ - Updated dependencies [23937f8]
551
+ - @aventara/core@0.1.0-pilot.2
552
+
553
+ ## 0.1.0-pilot.1
554
+
555
+ ### Patch Changes
556
+
557
+ - a45f8a8: The `400 A2000` for a request without its identity headers now says which one: `cause.message` is "The
558
+ Aventara-Contract-Hash header is missing." (or "The Aventara-Protocol-Version header is missing.", or both, naming both),
559
+ instead of the generic "The request is malformed and cannot be interpreted." It names headers only and echoes no value.
560
+ The code, status and every other `A2000` are unchanged. The protocol fixtures in `@aventara/testing` check the new messages, with a row
561
+ for a request with neither header.
562
+ - 799346e: The package READMEs (each package's npm page) are rewritten for the people who use the packages. The Prisma 7
563
+ adapter's README now states the actual behaviour of a to-many relation or `$count` projected on
564
+ `update.many`/`create.many`: a validation refusal, `A2004` with `V1008`, before any statement runs (it said `A3001`).
565
+ Every install or run command names the `@pilot` dist-tag.
566
+ - Updated dependencies [a45f8a8]
567
+ - Updated dependencies [799346e]
568
+ - @aventara/core@0.1.0-pilot.1
569
+
570
+ ## 0.1.0-pilot.0
571
+
572
+ ### Minor Changes
573
+
574
+ - First pilot release of `@aventara/testing`: tools for testing an Aventara application, an adapter or a host.
575
+
576
+ - `createFakeAdapter` — an in-memory adapter, so a Framework can be built and exercised without a database. Its
577
+ discovered model is `FakeAdapter.model`.
578
+ - `AvProtocolFixtures` (each one an `AvProtocolFixture`) — the HTTP protocol's conformance fixtures: every outcome
579
+ code and success status, contract discovery (`GET /_contract`), missing routes and a stale client, argument
580
+ validation, body, media-type and method refusals, transactions (including client-scope rules on `/_transactions`),
581
+ wire scalars and request ids.
582
+ - `AvProtocolDriver` and `runAvProtocolConformance(driver)` — run the fixtures against your own host: the driver
583
+ mounts the protocol for a Framework and answers requests, and each fixture's mismatches are reported.
584
+
585
+ ### Patch Changes
586
+
587
+ - Updated dependencies
588
+ - @aventara/core@0.1.0-pilot.0