@aventara/client 1.0.0-rc.0 → 1.0.0-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +651 -0
- package/README.md +195 -141
- package/dist/cli/command.parser.d.ts +7 -6
- package/dist/cli/command.parser.js +13 -13
- package/dist/cli/generation-failure.renderer.d.ts +2 -1
- package/dist/cli/generation-failure.renderer.js +24 -24
- package/dist/cli/generation-success.renderer.d.ts +2 -1
- package/dist/cli/step.reporter.d.ts +2 -1
- package/dist/cli/terminal.prompter.d.ts +2 -1
- package/dist/config/client-config.interface.d.ts +24 -7
- package/dist/config/config.loader.d.ts +12 -7
- package/dist/config/config.loader.js +26 -8
- package/dist/config/config.resolver.d.ts +16 -9
- package/dist/config/config.resolver.js +40 -12
- package/dist/config/env.cascade.d.ts +4 -8
- package/dist/config/env.cascade.js +7 -7
- package/dist/config/module-style.resolver.d.ts +4 -7
- package/dist/config/module-style.resolver.js +4 -4
- package/dist/config/tsconfig.locator.d.ts +3 -2
- package/dist/config/tsconfig.locator.js +16 -4
- package/dist/contract/contract.acceptance.d.ts +4 -5
- package/dist/contract/contract.acceptance.js +5 -5
- package/dist/contract/contract.fetcher.d.ts +5 -4
- package/dist/contract/contract.fetcher.js +6 -6
- package/dist/contract/contract.loader.d.ts +9 -8
- package/dist/contract/contract.loader.js +2 -2
- package/dist/emit/access.emitter.d.ts +12 -0
- package/dist/emit/access.emitter.js +263 -0
- package/dist/emit/banner.emitter.d.ts +6 -1
- package/dist/emit/banner.emitter.js +12 -8
- package/dist/emit/client-surface.emitter.d.ts +2 -2
- package/dist/emit/client-surface.emitter.js +136 -41
- package/dist/emit/client-tree.emitter.d.ts +11 -4
- package/dist/emit/client-tree.emitter.js +51 -17
- package/dist/emit/contract-carrier.emitter.d.ts +3 -3
- package/dist/emit/derivation.emitter.d.ts +3 -3
- package/dist/emit/derivation.emitter.js +7 -3
- package/dist/emit/descriptor.emitter.d.ts +2 -2
- package/dist/emit/descriptor.emitter.js +1 -1
- package/dist/emit/emitted-tree.interface.d.ts +1 -1
- package/dist/emit/enum.emitter.d.ts +2 -2
- package/dist/emit/field-check.emitter.d.ts +22 -0
- package/dist/emit/field-check.emitter.js +592 -0
- package/dist/emit/json-shape.emitter.d.ts +2 -2
- package/dist/emit/module-specifier.scanner.d.ts +2 -1
- package/dist/emit/name.deriver.d.ts +8 -9
- package/dist/emit/name.deriver.js +18 -15
- package/dist/emit/named-type.emitter.d.ts +2 -2
- package/dist/emit/named-type.emitter.js +12 -2
- package/dist/emit/runtime.emitter.d.ts +6 -5
- package/dist/emit/runtime.emitter.js +215 -116
- package/dist/emit/scalar.codec.d.ts +1 -1
- package/dist/emit/scalar.codec.js +246 -29
- package/dist/emit/transaction.emitter.js +30 -14
- package/dist/generate.d.ts +5 -4
- package/dist/generate.js +3 -3
- package/dist/hydration/hydration-tag.format.d.ts +11 -0
- package/dist/hydration/hydration-tag.format.js +6 -0
- package/dist/index.d.ts +1 -1
- package/dist/init/client-init.errors.d.ts +4 -4
- package/dist/init/client-init.errors.js +4 -4
- package/dist/init/client-init.orchestrator.js +7 -7
- package/dist/init/client-init.planner.d.ts +3 -2
- package/dist/init/client-init.questions.d.ts +5 -16
- package/dist/init/client-init.questions.js +12 -12
- package/dist/init/client-project.inspector.d.ts +2 -2
- package/dist/init/client-project.inspector.js +3 -3
- package/dist/internal.d.ts +25 -0
- package/dist/internal.js +11 -0
- package/dist/output/output.validator.d.ts +3 -4
- package/dist/output/output.validator.js +2 -2
- package/dist/output/output.writer.d.ts +8 -7
- package/dist/output/output.writer.js +12 -12
- package/package.json +9 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,656 @@
|
|
|
1
1
|
# @aventara/client
|
|
2
2
|
|
|
3
|
+
## 1.0.0-rc.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7ee547b: A ClientContract whose `access` section states Aventara Access's `kiosk` verbs gives the generated client
|
|
8
|
+
`$access.switchUser`, `lock`, `setPin`, `enrollDevice` and `revokeDevice`, each a `POST` to Access's own route with its
|
|
9
|
+
arguments typed from the section's schema and its answer projected onto the result schema (`lock`, `setPin` and
|
|
10
|
+
`revokeDevice` resolve nothing). A section without them emits no member for them.
|
|
11
|
+
- d7e7369: A ClientContract with the `access` section gives the generated client `$access`: `can(questions)` (one request to
|
|
12
|
+
`/_access/can`), and exactly the Aventara Access verbs the section states (`me` with `GET` and `cache: "no-store"`,
|
|
13
|
+
`signIn`, `signUp`, `signOut`, `resetPassword`), each result projected onto the section's schema. `AvAccessMe` is
|
|
14
|
+
`me`'s result type and `AvAccessError` what a non-2xx Access answer throws. A client without the section is emitted
|
|
15
|
+
byte for byte as before. A ClientContract whose Access URL is on another origin than the
|
|
16
|
+
entrypoint's is refused unless `framework.client.ts` lists that origin in the new `accessOrigins`.
|
|
17
|
+
- 9d423f9: `avclient generate`'s reference step (a solution-style `tsconfig.json`) matches `${configDir}` entries of `files`,
|
|
18
|
+
`include` and `exclude`. `get-tsconfig` 4.10.0 makes them absolute and its file matcher joined them under the config's
|
|
19
|
+
directory again, so a referenced project including the client through `${configDir}` was passed over.
|
|
20
|
+
- 04bb39a: `engines.node` is now `^22.23.4 || >=24.22.1`, the Node security releases of 2026-10-20 (CVE-2026-105481,
|
|
21
|
+
CVE-2026-105482, CVE-2026-105483, CVE-2026-106069, CVE-2026-106072, CVE-2026-106073, CVE-2026-106074,
|
|
22
|
+
CVE-2026-111497). The bins refuse an older Node in one sentence naming that range.
|
|
23
|
+
- 88263a1: A value projected onto an `access` verb's result schema is refused with the projector's own `TypeError` when the schema
|
|
24
|
+
is outside the forms a Client Contract states (a free-form object or list, a tuple read past its length), whatever the
|
|
25
|
+
value, an empty one included. A Client Contract that passed its structure check never holds such a schema.
|
|
26
|
+
- Updated dependencies [587dd01]
|
|
27
|
+
- Updated dependencies [d7e7369]
|
|
28
|
+
- Updated dependencies [7ee547b]
|
|
29
|
+
- Updated dependencies [f52c499]
|
|
30
|
+
- Updated dependencies [2907484]
|
|
31
|
+
- Updated dependencies [a6bbdf0]
|
|
32
|
+
- Updated dependencies [3e26549]
|
|
33
|
+
- Updated dependencies [a6bbdf0]
|
|
34
|
+
- Updated dependencies [6f3f6f6]
|
|
35
|
+
- Updated dependencies [04bb39a]
|
|
36
|
+
- Updated dependencies [3fb3333]
|
|
37
|
+
- Updated dependencies [827ccb6]
|
|
38
|
+
- Updated dependencies [7f5abc3]
|
|
39
|
+
- Updated dependencies [88263a1]
|
|
40
|
+
- Updated dependencies [10341d5]
|
|
41
|
+
- Updated dependencies [8129844]
|
|
42
|
+
- Updated dependencies [88263a1]
|
|
43
|
+
- Updated dependencies [3020b5c]
|
|
44
|
+
- Updated dependencies [88263a1]
|
|
45
|
+
- Updated dependencies [88263a1]
|
|
46
|
+
- @aventara/core@1.0.0-rc.10
|
|
47
|
+
|
|
48
|
+
## 1.0.0-rc.9
|
|
49
|
+
|
|
50
|
+
### Patch Changes
|
|
51
|
+
|
|
52
|
+
- 99278e4: `aventara-build` reads a Next.js project's files from `src/aventara/` and, with `--client`, writes its browser client.
|
|
53
|
+
|
|
54
|
+
- A project whose `package.json` depends on `@aventara/next` keeps its configuration and adapter in
|
|
55
|
+
`src/aventara/config.ts` and `src/aventara/adapter.ts`; the build runs them there, and a configuration that imports no
|
|
56
|
+
Resource tree has its generated files in `src/aventara/generated/`. Every other project keeps
|
|
57
|
+
`src/aventara.config.ts` and `src/aventara.adapter.ts`, unchanged. A missing file is named with where the project's
|
|
58
|
+
host keeps it, and a project depending on both `@aventara/nest` and `@aventara/next` is refused in one sentence.
|
|
59
|
+
- `aventara-build --client` also writes the browser client from the ClientContract it has just compiled, with no
|
|
60
|
+
running server: `src/aventara/client.ts` and the client's modules under `src/aventara/generated/`, the same modules
|
|
61
|
+
`avclient generate` writes for that ClientContract except that the entrypoint is the app's own `api` on the page's
|
|
62
|
+
origin (`/api`) and the regenerate instructions. Its imports are spelled as the project's `tsconfig.json` says, and nothing it writes imports
|
|
63
|
+
`@aventara/client`.
|
|
64
|
+
- `src/aventara/client.ts` exports `avClient` and `avHydrate`, and re-exports every name `avclient generate`'s
|
|
65
|
+
`AvClient.ts` exports besides its default (`AvClient`, the Resource types, the enums, `AvDecimal`, the error
|
|
66
|
+
classes), so `import { AvDecimal } from "@/aventara/client"` works. The generated files and the contract-mismatch
|
|
67
|
+
error say to regenerate with `aventara-build --client` (the project's `aventara:prepare` script). `avClient` calls the API from the browser; a call made
|
|
68
|
+
on the server (a Client Component rendering there) rejects with one sentence pointing to `@/aventara/server` and
|
|
69
|
+
`@/aventara/universal`, and sends nothing. `avHydrate` revives data `avDehydrate` sends from the server: tagged
|
|
70
|
+
dates, `bigint`s, byte arrays and decimals become `Date`, `bigint`, `Uint8Array` and the client's own `AvDecimal`,
|
|
71
|
+
for TanStack Query's `deserializeData` or an SWR `fallback`.
|
|
72
|
+
- `aventara-build --check --client` checks those files too: a missing or stale one, or one an earlier ClientContract's
|
|
73
|
+
client left, exits 1 naming it. `--client` is refused in a NestJS project, whose frontends keep using
|
|
74
|
+
`avclient generate`, which is unchanged.
|
|
75
|
+
- `@aventara/client` gains an `@aventara/client/internal` entry, which `@aventara/build` reads the generator through.
|
|
76
|
+
It is not public API.
|
|
77
|
+
|
|
78
|
+
- Updated dependencies [205a379]
|
|
79
|
+
- Updated dependencies [a0bb05e]
|
|
80
|
+
- Updated dependencies [86ab319]
|
|
81
|
+
- Updated dependencies [fdf52e6]
|
|
82
|
+
- @aventara/core@1.0.0-rc.9
|
|
83
|
+
|
|
84
|
+
## 1.0.0-rc.8
|
|
85
|
+
|
|
86
|
+
1.0.0-rc.5, rc.6 and rc.7 were tagged but never published; 1.0.0-rc.8 contains everything listed under them and the changes below.
|
|
87
|
+
|
|
88
|
+
### Patch Changes
|
|
89
|
+
|
|
90
|
+
- A generated client's results read as their value types in an editor: `body: string | null`, `published: boolean`,
|
|
91
|
+
`publishedAt: Date | null`, where a nullable, enum or `boolean` field was shown as `AvScalarValueType<…>` with the
|
|
92
|
+
client's Contract as its argument, and a result as `ProjectedFields<…>`. Run `avclient generate` again to pick it up.
|
|
93
|
+
What the client accepts and returns is unchanged.
|
|
94
|
+
- Updated dependencies [1c8e4ee]
|
|
95
|
+
- @aventara/core@1.0.0-rc.8
|
|
96
|
+
|
|
97
|
+
## 1.0.0-rc.7
|
|
98
|
+
|
|
99
|
+
1.0.0-rc.5 and 1.0.0-rc.6 were tagged but never published; 1.0.0-rc.7 contains everything listed under them and the changes below.
|
|
100
|
+
|
|
101
|
+
### Patch Changes
|
|
102
|
+
|
|
103
|
+
- Updated dependencies [f917c1c]
|
|
104
|
+
- @aventara/core@1.0.0-rc.7
|
|
105
|
+
|
|
106
|
+
## 1.0.0-rc.6
|
|
107
|
+
|
|
108
|
+
1.0.0-rc.5 was tagged but never published. 1.0.0-rc.6 contains everything listed under 1.0.0-rc.5 and the fix below.
|
|
109
|
+
|
|
110
|
+
### Patch Changes
|
|
111
|
+
|
|
112
|
+
- Updated dependencies [1cf72e0]
|
|
113
|
+
- @aventara/core@1.0.0-rc.6
|
|
114
|
+
|
|
115
|
+
## 1.0.0-rc.5
|
|
116
|
+
|
|
117
|
+
### Patch Changes
|
|
118
|
+
|
|
119
|
+
- Updated dependencies [4795ff1]
|
|
120
|
+
- Updated dependencies [9e178ca]
|
|
121
|
+
- @aventara/core@1.0.0-rc.5
|
|
122
|
+
|
|
123
|
+
## 1.0.0-rc.4
|
|
124
|
+
|
|
125
|
+
### Patch Changes
|
|
126
|
+
|
|
127
|
+
- Updated dependencies [e3d03a7]
|
|
128
|
+
- Updated dependencies [d10639a]
|
|
129
|
+
- Updated dependencies [f67e68c]
|
|
130
|
+
- Updated dependencies [708556c]
|
|
131
|
+
- Updated dependencies [3a0dfca]
|
|
132
|
+
- Updated dependencies [99169d2]
|
|
133
|
+
- Updated dependencies [0fd2608]
|
|
134
|
+
- Updated dependencies [154e440]
|
|
135
|
+
- Updated dependencies [2fcffdb]
|
|
136
|
+
- @aventara/core@1.0.0-rc.4
|
|
137
|
+
|
|
138
|
+
## 1.0.0-rc.3
|
|
139
|
+
|
|
140
|
+
### Patch Changes
|
|
141
|
+
|
|
142
|
+
- Updated dependencies [b38034d]
|
|
143
|
+
- Updated dependencies [b38034d]
|
|
144
|
+
- Updated dependencies [b38034d]
|
|
145
|
+
- Updated dependencies [b38034d]
|
|
146
|
+
- Updated dependencies [b38034d]
|
|
147
|
+
- Updated dependencies [b38034d]
|
|
148
|
+
- @aventara/core@1.0.0-rc.3
|
|
149
|
+
|
|
150
|
+
## 1.0.0-rc.2
|
|
151
|
+
|
|
152
|
+
### Patch Changes
|
|
153
|
+
|
|
154
|
+
- The optional `typescript` peer range is `>=5.7.0` (it was `>=5.5.0`), the lowest TypeScript Aventara's types
|
|
155
|
+
compile under. `avclient generate` type-checks the client with TypeScript 5.7 or later; under an older one it parses
|
|
156
|
+
the output with Node's TypeScript parser (`checked: syntax`) and says so in one warning, as it did below 5.5.
|
|
157
|
+
- A generated client sends an `undefined` array element (or a hole) as `null`, as `JSON.stringify` writes it, and its
|
|
158
|
+
`json` codec leaves out a key holding `undefined` and writes such an element as `null`. A `json` value
|
|
159
|
+
`{ a: undefined, b: [undefined] }` is sent as `{"b":[null]}`, the value the server stores when an in-process caller
|
|
160
|
+
passes it. In rc.1 the client refused the array element with a `TypeError` before sending. Regenerate the client.
|
|
161
|
+
- A generated client's `json` values admit a key holding `undefined` in their type, as core's `AvJsonValue` now does,
|
|
162
|
+
so an object with optional properties can be passed where a `json` value is taken; the key is not sent. In rc.1 it
|
|
163
|
+
was a compile error. Regenerate the client.
|
|
164
|
+
- A generated client refuses at compile time a filter `mode` or `path` that qualifies no operator: one alone, or one
|
|
165
|
+
whose only neighbour is a `not` holding operators (`{ mode: "insensitive", not: { contains: "x" } }`). Write it
|
|
166
|
+
inside the `not`. The server refuses the same filters (`A2004`, `V1001`). Regenerate the client.
|
|
167
|
+
- A generated client types a filter's `mode` by the field: `"default"` always, and `"sensitive"` or `"insensitive"`
|
|
168
|
+
only where the ClientContract's `filterModes` lists them; any other mode is a compile error. On a `json` field an
|
|
169
|
+
operator object that names `path` takes the modes `pathFilterModes` lists instead, so on Postgres
|
|
170
|
+
`where: { meta: { stringContains: "x", mode: "insensitive" } }` is a compile error and
|
|
171
|
+
`where: { meta: { path: ["label"], stringContains: "x", mode: "insensitive" } }` compiles. `isEmpty` is typed as a boolean, `path` as an array of strings and a `json` field's `string*`
|
|
172
|
+
operand as a string. The server refuses the same values (`A2004`), so the client adds no runtime check of its own.
|
|
173
|
+
Regenerate the client: the Contract hash changes.
|
|
174
|
+
- The generated client refuses an `undefined` value in a filter before anything is sent. JSON drops `undefined`, so
|
|
175
|
+
`avClient.Post.update.many({ where: { id: undefined }, data })` reached the server as `where: {}` and updated every
|
|
176
|
+
row; the same went for `find`, `count`, `delete` and a transaction step. Now an `undefined` anywhere inside a
|
|
177
|
+
`where` (`AND`, `OR`, `NOT`, relation filters, operator objects such as `{ equals: undefined }` or
|
|
178
|
+
`{ isEmpty: undefined }`, `in` lists), a `cursor`, a unique selector, the `where` or `cursor` of a relation in
|
|
179
|
+
`select` or `include`, or a nested write's selectors (`$connect`, `$disconnect`, `$set`, `$delete`, the `where` of
|
|
180
|
+
`$update`, `$upsert` and `$connectOrCreate`) throws `AvValidationError` (`A2004`) with a `V1001` issue at the path
|
|
181
|
+
the server uses (`["arguments", "where", "id"]`, or `["operations", 0, "args", "where", "id"]` with the step's
|
|
182
|
+
`operation` for a transaction), and no request is made. A `where`, `cursor`, `limit` or `offset` that is itself
|
|
183
|
+
`undefined` is refused the same way, with the server's code (`V1001`; `V1007` for a unique selector, `V1009` for a
|
|
184
|
+
cursor), at the top level, in a relation under `select` or `include`, and in a nested write's `where`. Leave the
|
|
185
|
+
key out to mean no filter. Write data is unchanged: an `undefined` field there is not sent. Regenerate the client
|
|
186
|
+
to get the check.
|
|
187
|
+
- `avclient generate` in a directory with no config names the extensions it looks for as the docs list them:
|
|
188
|
+
`no framework.client.ts, .mts, .cts, .js, .mjs or .cjs in <directory>; …`. In rc.1 it read
|
|
189
|
+
`no framework.client.{js,ts,mjs,cjs,mts,cts} in <directory>`. `avclient --help` and `avclient generate --help` list
|
|
190
|
+
them in the same order: `framework.client.ts (or .mts, .cts, .js, .mjs, .cjs)`. Which files are read is unchanged.
|
|
191
|
+
- Updated dependencies [9366e16]
|
|
192
|
+
- Updated dependencies [9366e16]
|
|
193
|
+
- Updated dependencies [9366e16]
|
|
194
|
+
- Updated dependencies [9366e16]
|
|
195
|
+
- @aventara/core@1.0.0-rc.2
|
|
196
|
+
|
|
197
|
+
## 1.0.0-rc.1
|
|
198
|
+
|
|
199
|
+
### Patch Changes
|
|
200
|
+
|
|
201
|
+
- 8bb1d6a: Breaking: public type and class names take the `Av` prefix. Every public type and class is now `Av` plus what
|
|
202
|
+
it is, with a namespace only where the bare name would be ambiguous: configuration types are `AvConfig…`
|
|
203
|
+
(`AvConfig`, `AvConfigLayer`, `AvConfigResource`, …) and the three Contracts are `AvContract…` (`AvContractCore`,
|
|
204
|
+
`AvContractApplication`, `AvContractClient`). Functions keep their names (`createFramework`, `createFakeAdapter`,
|
|
205
|
+
`createPrismaAdapter`, `defineClientConfig`, `env`), and so do the names that already started with `Av`,
|
|
206
|
+
`AventaraModule`, `AventaraModuleOptions` and `AventaraModuleAsyncOptions`. There are no
|
|
207
|
+
aliases: replace each old name with the new one.
|
|
208
|
+
|
|
209
|
+
Three names merged or left:
|
|
210
|
+
|
|
211
|
+
- `PipelineContext` and `ComputeContext` (which was the same type) are one name, `AvContext`. A compute stage
|
|
212
|
+
now gets its own read-only ctx, `AvComputeContext` (see the ctx entry in `@aventara/core`'s changelog).
|
|
213
|
+
- `ComputedRead` is `AvComputeRead`, the one name of a read compute stage: a function, or `{ compute, dependsOn }`.
|
|
214
|
+
`ComputeOnRead`, the bare function type, is no longer exported; `AvComputeRead` accepts the function as it is.
|
|
215
|
+
- `defineFields` and `FrameworkFieldsShape` are removed; `defineResource` replaces them (below).
|
|
216
|
+
|
|
217
|
+
`defineResource` replaces `defineFields`. A Resource's configuration, its root block and its overlay blocks, can
|
|
218
|
+
live in its own module and be spread into each layer's `resources` tree:
|
|
219
|
+
|
|
220
|
+
```ts
|
|
221
|
+
export const submission = defineResource<Model>()(
|
|
222
|
+
"Submission",
|
|
223
|
+
{
|
|
224
|
+
pipelines: { guards: [signedIn] },
|
|
225
|
+
fields: { title: { pipelines: { pipes: [trim] } } },
|
|
226
|
+
},
|
|
227
|
+
{ client: { fields: { title: { pipelines: { validators: [AvZ.maxLength(80)] } } } } },
|
|
228
|
+
);
|
|
229
|
+
|
|
230
|
+
// aventara.config.ts
|
|
231
|
+
resources: { ...submission.root, ...payment.root },
|
|
232
|
+
client: { resources: { ...submission.client } },
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
It returns `{ root, application?, client? }`, each `{ Submission: block }`; a layer given no block is left out. The
|
|
236
|
+
root block is typed exactly as `resources.Submission` is typed in place: field definitions are checked against what
|
|
237
|
+
the adapter discovered, stages are typed for the Resource, and a key no level admits is a type error at the key.
|
|
238
|
+
Each overlay block is typed as `application.resources.Submission` or `client.resources.Submission` is in place,
|
|
239
|
+
against the root block: it may name a field the root block defines, and a `definition` in it is a type error (and
|
|
240
|
+
`CONFIG_FORBIDDEN_IN_OVERLAY` at startup). Spread, the configuration is the inline one: the same Contracts and
|
|
241
|
+
ClientContract hash. A field `definition` that `defineFields` returned now sits at
|
|
242
|
+
`fields.<field>.definition` inside the block.
|
|
243
|
+
|
|
244
|
+
The generated client's names follow the same rule. Regenerate with `avclient generate`; then rename the
|
|
245
|
+
imports from `AvClient.ts`:
|
|
246
|
+
|
|
247
|
+
| Before | After |
|
|
248
|
+
| ----------------------- | ------------------------- |
|
|
249
|
+
| `AuthError` | `AvAuthError` |
|
|
250
|
+
| `CallOptions` | `AvCallOptions` |
|
|
251
|
+
| `Cause` | `AvCause` |
|
|
252
|
+
| `ConflictError` | `AvConflictError` |
|
|
253
|
+
| `ContractMismatchError` | `AvContractMismatchError` |
|
|
254
|
+
| `Decimal` | `AvDecimal` |
|
|
255
|
+
| `Fetch` | `AvFetch` |
|
|
256
|
+
| `FrameworkError` | `AvError` |
|
|
257
|
+
| `InternalError` | `AvInternalError` |
|
|
258
|
+
| `NotFoundError` | `AvNotFoundError` |
|
|
259
|
+
| `Operation<T>` | `AvOperation<T>` |
|
|
260
|
+
| `OperationCode` | `AvOperationCode` |
|
|
261
|
+
| `ProtocolError` | `AvProtocolError` |
|
|
262
|
+
| `TransportError` | `AvTransportError` |
|
|
263
|
+
| `ValidationCode` | `AvValidationCode` |
|
|
264
|
+
| `ValidationError` | `AvValidationError` |
|
|
265
|
+
| `ValidationIssue` | `AvValidationIssue` |
|
|
266
|
+
|
|
267
|
+
An enum whose name is one of these now walks the rename ladder (`AvDecimal` → `AvDecimalEnum`); an enum named
|
|
268
|
+
`Decimal` is emitted as `Decimal`.
|
|
269
|
+
|
|
270
|
+
`@aventara/core`, every renamed export:
|
|
271
|
+
|
|
272
|
+
| Before | After |
|
|
273
|
+
| ------------------------------------- | ---------------------------------- |
|
|
274
|
+
| `Adapter` | `AvAdapter` |
|
|
275
|
+
| `AdapterDiscoveryDiagnostic` | `AvAdapterDiscoveryDiagnostic` |
|
|
276
|
+
| `AdapterDiscoveryDiagnosticCode` | `AvAdapterDiscoveryDiagnosticCode` |
|
|
277
|
+
| `AdapterModel` | `AvAdapterModel` |
|
|
278
|
+
| `AddedFieldDefinition` | `AvConfigAddedFieldDefinition` |
|
|
279
|
+
| `AfterHook` | `AvAfterHook` |
|
|
280
|
+
| `AnyFrameworkConfig` | `AvConfigAny` |
|
|
281
|
+
| `AnyLayerConfig` | `AvConfigLayerAny` |
|
|
282
|
+
| `AnyResourcesBlock` | `AvConfigResourcesAny` |
|
|
283
|
+
| `ApplicationContract` | `AvContractApplication` |
|
|
284
|
+
| `ApplicationScalarForms` | `AvApplicationScalarForms` |
|
|
285
|
+
| `BeforeHook` | `AvBeforeHook` |
|
|
286
|
+
| `BuiltInScalar` | `AvBuiltInScalar` |
|
|
287
|
+
| `Cause` | `AvCause` |
|
|
288
|
+
| `ClientContract` | `AvContractClient` |
|
|
289
|
+
| `ClientContractProtocol` | `AvContractClientProtocol` |
|
|
290
|
+
| `ComputedRead` | `AvComputeRead` |
|
|
291
|
+
| `ComputeOnCreate` | `AvComputeCreate` |
|
|
292
|
+
| `ComputeOnUpdate` | `AvComputeUpdate` |
|
|
293
|
+
| `ConfigDiagnostic` | `AvConfigDiagnostic` |
|
|
294
|
+
| `ConfigDiagnosticCode` | `AvConfigDiagnosticCode` |
|
|
295
|
+
| `ConfigFieldKey` | `AvConfigFieldKey` |
|
|
296
|
+
| `ConfigLayer` | `AvConfigLayerName` |
|
|
297
|
+
| `Contract` | `AvContract` |
|
|
298
|
+
| `ContractCompilerDiagnostic` | `AvContractCompilerDiagnostic` |
|
|
299
|
+
| `ContractCompilerDiagnosticCode` | `AvContractCompilerDiagnosticCode` |
|
|
300
|
+
| `ContractHash` | `AvContractHash` |
|
|
301
|
+
| `ContractLimits` | `AvContractLimits` |
|
|
302
|
+
| `ContractProtocol` | `AvContractProtocol` |
|
|
303
|
+
| `CoreContract` | `AvContractCore` |
|
|
304
|
+
| `CreateDataInput` | `AvCreateDataInput` |
|
|
305
|
+
| `CursorInput` | `AvCursorInput` |
|
|
306
|
+
| `Decimal` | `AvDecimal` |
|
|
307
|
+
| `DeferredOperationCall` | `AvDeferredOperationCall` |
|
|
308
|
+
| `EffectiveFieldKey` | `AvEffectiveFieldKey` |
|
|
309
|
+
| `EnumDefinition` | `AvEnumDefinition` |
|
|
310
|
+
| `ExactFrameworkConfig` | `AvConfigExact` |
|
|
311
|
+
| `ExecutionOptions` | `AvExecutionOptions` |
|
|
312
|
+
| `Field` | `AvField` |
|
|
313
|
+
| `FieldComputeConfig` | `AvFieldCompute` |
|
|
314
|
+
| `FieldKey` | `AvFieldKey` |
|
|
315
|
+
| `FieldPipe` | `AvFieldPipe` |
|
|
316
|
+
| `FieldWriteGuard` | `AvFieldGuard` |
|
|
317
|
+
| `Filter` | `AvFilter` |
|
|
318
|
+
| `Framework` | `AvFramework` |
|
|
319
|
+
| `FrameworkConfig` | `AvConfig` |
|
|
320
|
+
| `FrameworkConstructionDiagnostic` | `AvConstructionDiagnostic` |
|
|
321
|
+
| `FrameworkConstructionError` | `AvConstructionError` |
|
|
322
|
+
| `FrameworkConstructionStage` | `AvConstructionStage` |
|
|
323
|
+
| `FrameworkContracts` | `AvContracts` |
|
|
324
|
+
| `FrameworkDiagnostic` | `AvDiagnostic` |
|
|
325
|
+
| `FrameworkDiagnosticsSink` | `AvDiagnosticsSink` |
|
|
326
|
+
| `FrameworkError` | `AvError` |
|
|
327
|
+
| `FrameworkExemptionsConfig` | `AvConfigExemptions` |
|
|
328
|
+
| `FrameworkFamilyConfig` | `AvConfigFamily` |
|
|
329
|
+
| `FrameworkFieldDefinition` | `AvConfigFieldDefinition` |
|
|
330
|
+
| `FrameworkFieldLifecycleTrait` | `AvConfigFieldLifecycleTrait` |
|
|
331
|
+
| `FrameworkLayerConfig` | `AvConfigLayer` |
|
|
332
|
+
| `FrameworkLayerKind` | `AvConfigLayerKind` |
|
|
333
|
+
| `FrameworkLimitsConfig` | `AvConfigLimits` |
|
|
334
|
+
| `FrameworkMisuseEvent` | `AvMisuseEvent` |
|
|
335
|
+
| `FrameworkMisuseSink` | `AvMisuseSink` |
|
|
336
|
+
| `FrameworkOperationsConfig` | `AvConfigOperations` |
|
|
337
|
+
| `FrameworkOperationsExemption` | `AvConfigOperationsExemption` |
|
|
338
|
+
| `FrameworkOverlayFieldConfig` | `AvConfigOverlayField` |
|
|
339
|
+
| `FrameworkRelationFieldExemption` | `AvConfigRelationFieldExemption` |
|
|
340
|
+
| `FrameworkResourceConfig` | `AvConfigResource` |
|
|
341
|
+
| `FrameworkResourceExemption` | `AvConfigResourceExemption` |
|
|
342
|
+
| `FrameworkResourceFieldsConfig` | `AvConfigResourceFields` |
|
|
343
|
+
| `FrameworkResourceKey` | `AvConfigResourceKey` |
|
|
344
|
+
| `FrameworkResourcesConfig` | `AvConfigResources` |
|
|
345
|
+
| `FrameworkResourceTransactionsConfig` | `AvConfigResourceTransactions` |
|
|
346
|
+
| `FrameworkRootFieldConfig` | `AvConfigRootField` |
|
|
347
|
+
| `FrameworkScalarFieldExemption` | `AvConfigScalarFieldExemption` |
|
|
348
|
+
| `FrameworkScalarTypeRef` | `AvConfigScalarTypeRef` |
|
|
349
|
+
| `FrameworkVariantConfig` | `AvConfigVariant` |
|
|
350
|
+
| `Guard` | `AvGuard` |
|
|
351
|
+
| `Identifier` | `AvIdentifier` |
|
|
352
|
+
| `IncludeInput` | `AvIncludeInput` |
|
|
353
|
+
| `Interceptor` | `AvInterceptor` |
|
|
354
|
+
| `JsonValue` | `AvJsonValue` |
|
|
355
|
+
| `KnownFieldDefinition` | `AvConfigKnownFieldDefinition` |
|
|
356
|
+
| `LifecycleTrait` | `AvLifecycleTrait` |
|
|
357
|
+
| `NullsOrder` | `AvNullsOrder` |
|
|
358
|
+
| `Operation` | `AvOperation` |
|
|
359
|
+
| `OperationArgumentMap` | `AvOperationArgumentMap` |
|
|
360
|
+
| `OperationArgumentsFor` | `AvOperationArgumentsFor` |
|
|
361
|
+
| `OperationAvailability` | `AvOperationAvailability` |
|
|
362
|
+
| `OperationCall` | `AvOperationCall` |
|
|
363
|
+
| `OperationCode` | `AvOperationCode` |
|
|
364
|
+
| `OperationDiagnostic` | `AvOperationDiagnostic` |
|
|
365
|
+
| `OperationErrorCode` | `AvOperationErrorCode` |
|
|
366
|
+
| `OperationFailureResponse` | `AvOperationFailureResponse` |
|
|
367
|
+
| `OperationFamily` | `AvOperationFamily` |
|
|
368
|
+
| `OperationGrammar` | `AvOperationGrammar` |
|
|
369
|
+
| `OperationIdentity` | `AvOperationIdentity` |
|
|
370
|
+
| `OperationNoMatchResponse` | `AvOperationNoMatchResponse` |
|
|
371
|
+
| `OperationReferenceSurface` | `AvOperationReferenceSurface` |
|
|
372
|
+
| `OperationResponse` | `AvOperationResponse` |
|
|
373
|
+
| `OperationResultFor` | `AvOperationResultFor` |
|
|
374
|
+
| `OperationSlot` | `AvOperationSlot` |
|
|
375
|
+
| `OperationSuccessCode` | `AvOperationSuccessCode` |
|
|
376
|
+
| `OperationSuccessDataCode` | `AvOperationSuccessDataCode` |
|
|
377
|
+
| `OperationSuccessResponse` | `AvOperationSuccessResponse` |
|
|
378
|
+
| `OperationVariant` | `AvOperationVariant` |
|
|
379
|
+
| `OperationVariantScopes` | `AvOperationVariantScopes` |
|
|
380
|
+
| `OrderByEntry` | `AvOrderByEntry` |
|
|
381
|
+
| `OrderByInput` | `AvOrderByInput` |
|
|
382
|
+
| `PaginationCapability` | `AvPaginationCapability` |
|
|
383
|
+
| `Pipe` | `AvPipe` |
|
|
384
|
+
| `PipelineConfig` | `AvPipeline` |
|
|
385
|
+
| `PipelineContext` | `AvContext` |
|
|
386
|
+
| `PipelineTransportContext` | `AvTransportContext` |
|
|
387
|
+
| `ProjectionEntry` | `AvProjectionEntry` |
|
|
388
|
+
| `ProjectionScope` | `AvProjectionScope` |
|
|
389
|
+
| `ProjectionScopes` | `AvProjectionScopes` |
|
|
390
|
+
| `ReferenceableField` | `AvReferenceableField` |
|
|
391
|
+
| `ReferenceBuilder` | `AvReferenceBuilder` |
|
|
392
|
+
| `RelationField` | `AvRelationField` |
|
|
393
|
+
| `RelationFieldCapabilities` | `AvRelationFieldCapabilities` |
|
|
394
|
+
| `RelationFieldCapabilityName` | `AvRelationFieldCapabilityName` |
|
|
395
|
+
| `RelationFieldPipelineConfig` | `AvRelationFieldPipeline` |
|
|
396
|
+
| `RelationFilterCapability` | `AvRelationFilterCapability` |
|
|
397
|
+
| `RelationMutationCapability` | `AvRelationMutationCapability` |
|
|
398
|
+
| `RelationMutationDirective` | `AvRelationMutationDirective` |
|
|
399
|
+
| `RelationProjectionCapability` | `AvRelationProjectionCapability` |
|
|
400
|
+
| `RelationProjectionInput` | `AvRelationProjectionInput` |
|
|
401
|
+
| `RelationReducer` | `AvRelationReducer` |
|
|
402
|
+
| `RelationReducerCapability` | `AvRelationReducerCapability` |
|
|
403
|
+
| `RequestOrigin` | `AvRequestOrigin` |
|
|
404
|
+
| `Resource` | `AvResource` |
|
|
405
|
+
| `ResourceFieldMap` | `AvResourceFieldMap` |
|
|
406
|
+
| `ResourceKey` | `AvResourceKey` |
|
|
407
|
+
| `ResourceOperations` | `AvResourceOperations` |
|
|
408
|
+
| `ScalarDefinition` | `AvScalarDefinition` |
|
|
409
|
+
| `ScalarField` | `AvScalarField` |
|
|
410
|
+
| `ScalarFieldCapabilities` | `AvScalarFieldCapabilities` |
|
|
411
|
+
| `ScalarFieldCapabilityName` | `AvScalarFieldCapabilityName` |
|
|
412
|
+
| `ScalarFieldKey` | `AvScalarFieldKey` |
|
|
413
|
+
| `ScalarFieldPipelineConfig` | `AvScalarFieldPipeline` |
|
|
414
|
+
| `ScalarFilterOperator` | `AvScalarFilterOperator` |
|
|
415
|
+
| `ScalarFormat` | `AvScalarFormat` |
|
|
416
|
+
| `ScalarMutationDirective` | `AvScalarMutationDirective` |
|
|
417
|
+
| `ScalarOrderInput` | `AvScalarOrderInput` |
|
|
418
|
+
| `ScalarRegistry` | `AvScalarRegistry` |
|
|
419
|
+
| `ScalarValueType` | `AvScalarValueType` |
|
|
420
|
+
| `ScopedRelationMutations` | `AvScopedRelationMutations` |
|
|
421
|
+
| `ScopedRelationReducers` | `AvScopedRelationReducers` |
|
|
422
|
+
| `SelectInput` | `AvSelectInput` |
|
|
423
|
+
| `SingleRowResult` | `AvSingleRowResult` |
|
|
424
|
+
| `SortDirection` | `AvSortDirection` |
|
|
425
|
+
| `TransactionAfterHook` | `AvTransactionAfterHook` |
|
|
426
|
+
| `TransactionBeforeHook` | `AvTransactionBeforeHook` |
|
|
427
|
+
| `TransactionCapability` | `AvTransactionCapability` |
|
|
428
|
+
| `TransactionCommittedResponse` | `AvTransactionCommittedResponse` |
|
|
429
|
+
| `TransactionDiagnostic` | `AvTransactionDiagnostic` |
|
|
430
|
+
| `TransactionFilter` | `AvTransactionFilter` |
|
|
431
|
+
| `TransactionGuard` | `AvTransactionGuard` |
|
|
432
|
+
| `TransactionIntegrityError` | `AvTransactionIntegrityError` |
|
|
433
|
+
| `TransactionIntegrityViolation` | `AvTransactionIntegrityViolation` |
|
|
434
|
+
| `TransactionInterceptor` | `AvTransactionInterceptor` |
|
|
435
|
+
| `TransactionPipe` | `AvTransactionPipe` |
|
|
436
|
+
| `TransactionPipelineConfig` | `AvTransactionPipeline` |
|
|
437
|
+
| `TransactionPipelineContext` | `AvTransactionContext` |
|
|
438
|
+
| `TransactionReference` | `AvTransactionReference` |
|
|
439
|
+
| `TransactionResponse` | `AvTransactionResponse` |
|
|
440
|
+
| `TransactionResults` | `AvTransactionResults` |
|
|
441
|
+
| `TransactionRunner` | `AvTransactionRunner` |
|
|
442
|
+
| `TransactionSlotPathError` | `AvTransactionSlotPathError` |
|
|
443
|
+
| `TransactionSlotPathViolation` | `AvTransactionSlotPathViolation` |
|
|
444
|
+
| `UniqueWhereInput` | `AvUniqueWhereInput` |
|
|
445
|
+
| `UpdateDataInput` | `AvUpdateDataInput` |
|
|
446
|
+
| `ValidationCode` | `AvValidationCode` |
|
|
447
|
+
| `ValidationIssue` | `AvValidationIssue` |
|
|
448
|
+
| `WhereInput` | `AvWhereInput` |
|
|
449
|
+
| `WireScalarForms` | `AvWireScalarForms` |
|
|
450
|
+
| `WriteScope` | `AvWriteScope` |
|
|
451
|
+
| `WriteScopes` | `AvWriteScopes` |
|
|
452
|
+
|
|
453
|
+
Error classes whose `name` a log or a test may read:
|
|
454
|
+
|
|
455
|
+
| Before | After |
|
|
456
|
+
| ------------------------ | -------------------------- |
|
|
457
|
+
| `CallerDataError` | `AvCallerDataError` |
|
|
458
|
+
| `ClientConfigError` | `AvClientConfigError` |
|
|
459
|
+
| `ComputedValueError` | `AvComputedValueError` |
|
|
460
|
+
| `ContractProtocolError` | `AvContractProtocolError` |
|
|
461
|
+
| `ContractTransportError` | `AvContractTransportError` |
|
|
462
|
+
| `EnvFileError` | `AvEnvFileError` |
|
|
463
|
+
| `OutputValidationError` | `AvOutputValidationError` |
|
|
464
|
+
| `OutputWriteError` | `AvOutputWriteError` |
|
|
465
|
+
| `PipeOutputError` | `AvPipeOutputError` |
|
|
466
|
+
| `UnmountedRouteError` | `AvUnmountedRouteError` |
|
|
467
|
+
|
|
468
|
+
`@aventara/testing`:
|
|
469
|
+
|
|
470
|
+
| Before | After |
|
|
471
|
+
| ------------------------ | -------------------------- |
|
|
472
|
+
| `AdapterFactory` | `AvAdapterFactory` |
|
|
473
|
+
| `FakeAdapter` | `AvFakeAdapter` |
|
|
474
|
+
| `FakeAdapterExecute` | `AvFakeAdapterExecute` |
|
|
475
|
+
| `FakeAdapterOptions` | `AvFakeAdapterOptions` |
|
|
476
|
+
| `FakeAdapterRollback` | `AvFakeAdapterRollback` |
|
|
477
|
+
| `FakeTransactionOutcome` | `AvFakeTransactionOutcome` |
|
|
478
|
+
| `FakeTransactionTrace` | `AvFakeTransactionTrace` |
|
|
479
|
+
|
|
480
|
+
`@aventara/client` (the `framework.client.ts` config types):
|
|
481
|
+
|
|
482
|
+
| Before | After |
|
|
483
|
+
| ------------------- | --------------------- |
|
|
484
|
+
| `ClientConfigInput` | `AvClientConfigInput` |
|
|
485
|
+
| `ConfigValue` | `AvClientConfigValue` |
|
|
486
|
+
| `EnvReference` | `AvEnvReference` |
|
|
487
|
+
|
|
488
|
+
`@aventara/prisma7-adapter`: its public types and error classes (`createPrismaAdapter` keeps its name):
|
|
489
|
+
|
|
490
|
+
| Before | After |
|
|
491
|
+
| ---------------------------------- | ------------------------------------ |
|
|
492
|
+
| `PrismaAdapterModel` | `AvPrismaAdapterModel` |
|
|
493
|
+
| `PrismaAdapterOptions` | `AvPrismaAdapterOptions` |
|
|
494
|
+
| `PrismaDelegate` | `AvPrismaDelegate` |
|
|
495
|
+
| `PrismaDelegateHost` | `AvPrismaDelegateHost` |
|
|
496
|
+
| `PrismaDelegateIndex` | `AvPrismaDelegateIndex` |
|
|
497
|
+
| `PrismaDiscoveryArtifact` | `AvPrismaDiscoveryArtifact` |
|
|
498
|
+
| `PrismaDriver` | `AvPrismaDriver` |
|
|
499
|
+
| `PrismaIsolationLevel` | `AvPrismaIsolationLevel` |
|
|
500
|
+
| `PrismaProvider` | `AvPrismaProvider` |
|
|
501
|
+
| `PrismaProviderProfile` | `AvPrismaProviderProfile` |
|
|
502
|
+
| `PrismaReferentialAction` | `AvPrismaReferentialAction` |
|
|
503
|
+
| `PrismaReferentialActionTable` | `AvPrismaReferentialActionTable` |
|
|
504
|
+
| `PrismaReferentialEdge` | `AvPrismaReferentialEdge` |
|
|
505
|
+
| `PrismaResourceReferentialActions` | `AvPrismaResourceReferentialActions` |
|
|
506
|
+
| `PrismaTransactionOptions` | `AvPrismaTransactionOptions` |
|
|
507
|
+
| `PrismaCapabilityDerivationError` | `AvPrismaCapabilityDerivationError` |
|
|
508
|
+
| `PrismaDiscoveryArtifactError` | `AvPrismaDiscoveryArtifactError` |
|
|
509
|
+
| `PrismaEmulationError` | `AvPrismaEmulationError` |
|
|
510
|
+
| `PrismaExecutionError` | `AvPrismaExecutionError` |
|
|
511
|
+
| `PrismaExistenceGateError` | `AvPrismaExistenceGateError` |
|
|
512
|
+
| `PrismaFieldProjectionError` | `AvPrismaFieldProjectionError` |
|
|
513
|
+
| `PrismaGenerateCliError` | `AvPrismaGenerateCliError` |
|
|
514
|
+
| `PrismaGenerateStepError` | `AvPrismaGenerateStepError` |
|
|
515
|
+
| `PrismaModelCompositionError` | `AvPrismaModelCompositionError` |
|
|
516
|
+
| `PrismaMutationTranslationError` | `AvPrismaMutationTranslationError` |
|
|
517
|
+
| `PrismaOperationTranslationError` | `AvPrismaOperationTranslationError` |
|
|
518
|
+
| `PrismaOrderTranslationError` | `AvPrismaOrderTranslationError` |
|
|
519
|
+
| `PrismaProjectionTranslationError` | `AvPrismaProjectionTranslationError` |
|
|
520
|
+
| `PrismaResultShapeError` | `AvPrismaResultShapeError` |
|
|
521
|
+
| `PrismaScalarConversionError` | `AvPrismaScalarConversionError` |
|
|
522
|
+
| `PrismaSchemaReaderError` | `AvPrismaSchemaReaderError` |
|
|
523
|
+
| `PrismaTypesReaderError` | `AvPrismaTypesReaderError` |
|
|
524
|
+
| `PrismaWhereTranslationError` | `AvPrismaWhereTranslationError` |
|
|
525
|
+
|
|
526
|
+
- 68d4395: New: the generated client checks field validators before it sends. When the ClientContract carries a field's
|
|
527
|
+
`validators` or a Json Shape's checks, `avclient generate` emits them into the client with the check code that runs
|
|
528
|
+
them, and every call and every transaction checks the values it holds first. A call that breaks a check rejects with
|
|
529
|
+
the same `AvValidationError` the server would answer, `A2004` with the same issues (`code`, `path`, `check`,
|
|
530
|
+
`params`, `message`), and no request is sent:
|
|
531
|
+
|
|
532
|
+
```ts
|
|
533
|
+
try {
|
|
534
|
+
await avClient.projects.create.one({ data: { id: "p1", name: "no" } });
|
|
535
|
+
} catch (error) {
|
|
536
|
+
// error instanceof AvValidationError, error.code === "A2004", nothing was sent:
|
|
537
|
+
// error.cause.issues[0] → { code: "V1004", path: ["arguments", "data", "name"],
|
|
538
|
+
// message: "Value must be at least 3 characters long.", check: "min_length", params: { minimum: 3 } }
|
|
539
|
+
}
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
- The server checks every value again. The client checks a value as the caller wrote it and the server checks it
|
|
543
|
+
after its field pipes, so a field pipe that normalizes a value (trims it, lower-cases it) must not turn a value the
|
|
544
|
+
client accepted into one the server refuses.
|
|
545
|
+
- A transaction is checked whole before it is sent: a bad literal value in any step rejects with the server's answer,
|
|
546
|
+
`cause.operation` naming the step. A `$ref` value is checked by the server, at its step.
|
|
547
|
+
- Nested write data, list fields (each entry and the list's length), `$push` entries and Json Shape checks are all
|
|
548
|
+
checked, a Json Shape's checks with the other validators in the order the call wrote the fields, and a plan step
|
|
549
|
+
by step, as the server does. A Json value that does not match its shape is sent, and the server answers it.
|
|
550
|
+
- The check code is `@aventara/core`'s own, copied into the generated output; the client still imports nothing from
|
|
551
|
+
`@aventara/*` or zod at runtime. A contract with no checks generates the same files as before.
|
|
552
|
+
- `AvValidationIssue` declares `check` and `params`, and the client keeps them on the issues a server sends (they
|
|
553
|
+
were dropped before).
|
|
554
|
+
- The server lists validator issues in the order the call wrote the fields (it used the model's field order), and a
|
|
555
|
+
Json Shape's issues in the order of its keys as the Contract lists them, so the client can list the same issues in
|
|
556
|
+
the same order. An issue inside a nested write whose operand is one entry rather than a list no longer names an
|
|
557
|
+
index the request does not have (`[…, "$update", "data", …]`, not `[…, "$update", 0, "data", …]`).
|
|
558
|
+
|
|
559
|
+
- 7a0cab9: A `where` now offers each field only the filter operators that field allows. The types of `framework.client`,
|
|
560
|
+
`framework.application`, `framework.clientTx`, `framework.appTx` and a generated client read the operators from the
|
|
561
|
+
field's effective `filter` capability, so an operator the server would refuse with `V1006` is now a type error
|
|
562
|
+
instead. That covers an operator the adapter does not offer for the field's type (no `contains` on an Int), an
|
|
563
|
+
operator a layer's exemptions removed (the client layer narrowing `email` to `equals` is refused on
|
|
564
|
+
`framework.client` and still allowed on `framework.application`), and operators inside a nested `not`. A plain
|
|
565
|
+
value, `null` or `$ref` as shorthand is equality, so it is only accepted where the field allows `equals`, and a field
|
|
566
|
+
narrowed to no operators at all can no longer be named in a `where`. Runtime behavior is unchanged.
|
|
567
|
+
|
|
568
|
+
A generated client picks this up when it is regenerated with this version of `@aventara/client`.
|
|
569
|
+
|
|
570
|
+
- c6e5010: Breaking: one stage order, and hooks now run inside interceptors. Every operation runs
|
|
571
|
+
|
|
572
|
+
```
|
|
573
|
+
guards → pipes → validators → interceptors (before) → hooks.before → operation → hooks.after → interceptors (after) → filters
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
Each stage runs over every level, outer to inner, before the next starts, so every interceptor wraps every hook: all
|
|
577
|
+
interceptors enter, then every `before` hook runs, then the operation, then every `after` hook (inner to outer), then
|
|
578
|
+
the interceptors unwind (inner to outer). In rc.0 every `before` hook ran ahead of every interceptor, every `after`
|
|
579
|
+
hook after every interceptor had unwound, and the overlay's `after` hooks after the root's; now the overlay's run
|
|
580
|
+
before the root's. Filters run inner to outer, and the first filter that handles an error wins. A call that a guard,
|
|
581
|
+
a pipe's output or a validator refuses runs no interceptor and no hook; the filters still see a thrown error. Inside
|
|
582
|
+
a transaction, a step's error its own filters leave unhandled continues to the Resource transaction filters (the
|
|
583
|
+
transaction's outer layer) before it is answered.
|
|
584
|
+
|
|
585
|
+
New: stages at every level of `resources`. `resources.<R>.pipelines`, `resources.<R>.operations.<family>.pipelines`
|
|
586
|
+
and `resources.<R>.operations.<family>.<variant>.pipelines` run now, in both layers, level by level: root layer,
|
|
587
|
+
overlay layer, root Resource, overlay Resource, root family, overlay family, root variant, overlay variant. Nothing
|
|
588
|
+
below removes a stage above. A stage is told the level it sits at: a Resource's `ctx.$operation.resource` is its name, a
|
|
589
|
+
family's `ctx.$operation.family` too, a variant's `ctx.$operation.variant` as well.
|
|
590
|
+
|
|
591
|
+
- Field pipes (`resources.<R>.fields.<f>.pipelines.pipes`) are pure: value in, value out, no `ctx`. They run on
|
|
592
|
+
each value the caller sent in top-level create, update or upsert data, right after the operation's pipes, root's
|
|
593
|
+
then overlay's; guards see the value as sent. In a transaction they run on every step's literal values before the
|
|
594
|
+
transaction opens, and on a `$ref` value when it is resolved at its step. A value a field pipe returns is held to the server's rules
|
|
595
|
+
(`A3004`). A relation field takes no field pipes (`COMPILER_RELATION_FIELD_CONFIG_UNSUPPORTED`).
|
|
596
|
+
- Field write guards (`resources.<R>.fields.<f>.pipelines.guards`) refuse with `A4001` when the caller sends
|
|
597
|
+
the field in create, update or upsert data, a relation field's `$connect` included. They run right after the
|
|
598
|
+
operation's guards, last among the guards.
|
|
599
|
+
- Transactions: every step's guards, pipes and validators run before the transaction opens, in plan order; an
|
|
600
|
+
operation pipe sees a `$ref` as the reference it is. A refused step opens nothing. Then BEGIN, and at each step
|
|
601
|
+
its `$ref`s are resolved, their field pipes and validators run, then the step's interceptors and hooks around its
|
|
602
|
+
adapter call. A forced call runs the same way. A step's guards and pipes no longer run inside the transaction, so
|
|
603
|
+
their ctx calls do not join it.
|
|
604
|
+
- Resource transaction stages (`resources.<R>.transactions.pipelines`) run once per transaction with a
|
|
605
|
+
top-level step on the Resource, inside it: guards and pipes see the whole plan (`ctx.$args`, `$ref`s unresolved),
|
|
606
|
+
interceptors and hooks wrap every step, and the `after` hooks see every step's result before the commit, so a
|
|
607
|
+
throw rolls everything back. Touched Resources run in the order their first step appears; a SQL step touches
|
|
608
|
+
nothing. A transaction pipe may change a step's arguments; they are held to the server's rules and their
|
|
609
|
+
validators at the step.
|
|
610
|
+
- `forceTransaction` on a family or a variant runs a plain call of that operation as a one-step transaction,
|
|
611
|
+
so its after hooks commit with the write or not at all, and the Resource's transaction stages run. It holds when
|
|
612
|
+
any layer sets it. As a step of a plan it is just a step. Under an effective `transactionsStyle: "none"` it is a
|
|
613
|
+
startup error (`CONFIG_INVALID_VALUE`).
|
|
614
|
+
|
|
615
|
+
Breaking: a transaction has one origin. `framework.transaction` refuses a list that mixes `appTx` and
|
|
616
|
+
`clientTx` handles: `A2004` with one new `V1020` issue, "Transaction mixes application and client steps.", at the
|
|
617
|
+
first step of the other origin, before anything runs. An `appTx.$sql` step is application-origin. Run each
|
|
618
|
+
origin's steps as its own transaction. The generated client's error codes include `V1020`.
|
|
619
|
+
|
|
620
|
+
- Generated clients changed. Regenerate with `avclient generate` after upgrading. `AvOperationCall` lost its
|
|
621
|
+
`Settlement` parameter, because every direct call now resolves its data. The generated tree no longer copies two
|
|
622
|
+
declaration files, `derivation/runtime/operation-response.d.ts` and `derivation/transactions/transaction-response.d.ts`,
|
|
623
|
+
since nothing in it uses them now. And core's in-process calls (`framework.application`, `framework.client`,
|
|
624
|
+
`framework.transaction`) now throw the same `AvError` subclasses the generated client throws, chosen by the same
|
|
625
|
+
code-to-class table, so the server and the client classify every failure the same way.
|
|
626
|
+
|
|
627
|
+
- Generated clients type required create fields. The ClientContract now states each Resource's create requirements
|
|
628
|
+
(`createRequirements`), and a generated client's create payloads require them: leaving out a required field, or
|
|
629
|
+
writing a required relation neither way or both ways (`author` and `authorId`), is a type error. A nested create
|
|
630
|
+
gets the relation it is created through from its parent. The Client Contract's hash changes; regenerate with
|
|
631
|
+
`avclient generate`. The generated tree copies one more declaration file, `derivation/contracts/create-requirements.d.ts`.
|
|
632
|
+
|
|
633
|
+
- Updated dependencies [800123b]
|
|
634
|
+
- Updated dependencies [8bb1d6a]
|
|
635
|
+
- Updated dependencies [68d4395]
|
|
636
|
+
- Updated dependencies [7e3d06f]
|
|
637
|
+
- Updated dependencies [1b5d3c0]
|
|
638
|
+
- Updated dependencies [6317811]
|
|
639
|
+
- Updated dependencies [6d0e5d6]
|
|
640
|
+
- Updated dependencies [7a0cab9]
|
|
641
|
+
- Updated dependencies [eb2a718]
|
|
642
|
+
- Updated dependencies [03312c5]
|
|
643
|
+
- Updated dependencies [123f6dc]
|
|
644
|
+
- Updated dependencies [b65df2e]
|
|
645
|
+
- Updated dependencies [c6e5010]
|
|
646
|
+
- Updated dependencies [c1f9389]
|
|
647
|
+
- Updated dependencies [9c52482]
|
|
648
|
+
- Updated dependencies [8396148]
|
|
649
|
+
- Updated dependencies [e8fbb02]
|
|
650
|
+
- Updated dependencies [916e5f6]
|
|
651
|
+
- Updated dependencies [6cbd158]
|
|
652
|
+
- @aventara/core@1.0.0-rc.1
|
|
653
|
+
|
|
3
654
|
## 1.0.0-rc.0
|
|
4
655
|
|
|
5
656
|
### Major Changes
|