@databricks/appkit-ui 0.72.0 → 0.74.0
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/CLAUDE.md +24 -0
- package/NOTICE.md +1 -0
- package/dist/cli/commands/agent/eval.js +85 -16
- package/dist/cli/commands/agent/eval.js.map +1 -1
- package/dist/react/ui/button.d.ts +1 -1
- package/docs/api/appkit/Class.AppKitError.md +1 -0
- package/docs/api/appkit/Class.DatabaseValidationError.md +191 -0
- package/docs/api/appkit/Function.defineEvalConfig.md +18 -0
- package/docs/api/appkit/Function.defineSchema.md +1 -1
- package/docs/api/appkit/Function.discoverEvalConfigs.md +18 -0
- package/docs/api/appkit/Function.formatResultsJUnit.md +18 -0
- package/docs/api/appkit/Function.formatResultsJson.md +18 -0
- package/docs/api/appkit/Function.readEvalDataset.md +21 -0
- package/docs/api/appkit/Function.resolveWorkspaceClient.md +18 -0
- package/docs/api/appkit/Function.runWithRetries.md +28 -0
- package/docs/api/appkit/Function.userTurns.md +20 -0
- package/docs/api/appkit/Interface.AssertionHandle.md +1 -1
- package/docs/api/appkit/Interface.DatabaseValidationIssue.md +21 -0
- package/docs/api/appkit/Interface.DatasetRow.md +21 -0
- package/docs/api/appkit/Interface.DiscoveredEvalConfig.md +25 -0
- package/docs/api/appkit/Interface.DriveResult.md +28 -0
- package/docs/api/appkit/Interface.EntityMutationHooks.md +173 -0
- package/docs/api/appkit/Interface.EvalDefinition.md +50 -0
- package/docs/api/appkit/Interface.EvalDriver.md +26 -5
- package/docs/api/appkit/Interface.EvalResult.md +11 -0
- package/docs/api/appkit/Interface.EvalSummary.md +11 -0
- package/docs/api/appkit/Interface.HookApp.md +12 -0
- package/docs/api/appkit/Interface.HookContext.md +21 -0
- package/docs/api/appkit/Interface.ReadEvalDatasetOptions.md +34 -0
- package/docs/api/appkit/Interface.ReadSerializerContext.md +21 -0
- package/docs/api/appkit/Interface.RunEvalOptions.md +22 -0
- package/docs/api/appkit/Interface.RunEvalsOptions.md +45 -1
- package/docs/api/appkit/Interface.TestContext.md +67 -8
- package/docs/api/appkit/TypeAlias.DatabaseApiConfig.md +53 -0
- package/docs/api/appkit/TypeAlias.DatabaseApiWriteOperation.md +8 -0
- package/docs/api/appkit/TypeAlias.DatabaseApiWritesConfig.md +49 -0
- package/docs/api/appkit/TypeAlias.DatabaseExports.md +3 -3
- package/docs/api/appkit/TypeAlias.EntityHooks.md +25 -0
- package/docs/api/appkit/TypeAlias.IDatabaseConfig.md +16 -5
- package/docs/api/appkit/TypeAlias.ReadSerializer.md +19 -0
- package/docs/api/appkit/TypeAlias.TransactionClient.md +19 -0
- package/docs/api/appkit.md +142 -119
- package/docs/plugins/database.md +144 -0
- package/llms.txt +24 -0
- package/package.json +1 -1
- package/sbom.cdx.json +1 -1
|
@@ -24,6 +24,17 @@ Stable id for the eval (e.g. its file path relative to the evals dir).
|
|
|
24
24
|
|
|
25
25
|
***
|
|
26
26
|
|
|
27
|
+
### row?[](#row "Direct link to row?")
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
optional row: DatasetRow;
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Dataset row bound to `t.input`/`t.expected` for dataset-driven evals.
|
|
35
|
+
|
|
36
|
+
***
|
|
37
|
+
|
|
27
38
|
### strict?[](#strict "Direct link to strict?")
|
|
28
39
|
|
|
29
40
|
```ts
|
|
@@ -32,3 +43,14 @@ optional strict: boolean;
|
|
|
32
43
|
```
|
|
33
44
|
|
|
34
45
|
When true, soft assertion failures also fail the eval.
|
|
46
|
+
|
|
47
|
+
***
|
|
48
|
+
|
|
49
|
+
### timeoutMs?[](#timeoutms "Direct link to timeoutMs?")
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
optional timeoutMs: number;
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Runner-level default per-eval timeout (ms). `def.timeoutMs` wins over this; when both are unset the eval runs unbounded (current behavior).
|
|
@@ -160,6 +160,17 @@ Progress callback, invoked as evals are discovered, started, and finished.
|
|
|
160
160
|
|
|
161
161
|
***
|
|
162
162
|
|
|
163
|
+
### retries?[](#retries "Direct link to retries?")
|
|
164
|
+
|
|
165
|
+
```ts
|
|
166
|
+
optional retries: number;
|
|
167
|
+
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Re-run an eval up to this many extra times when it fails on infrastructure — a thrown error/timeout (`result.error`) or a transport/agent turn failure (`result.infraFailure`). Assertion failures are never retried. Defaults to `0`.
|
|
171
|
+
|
|
172
|
+
***
|
|
173
|
+
|
|
163
174
|
### rootDir?[](#rootdir "Direct link to rootDir?")
|
|
164
175
|
|
|
165
176
|
```ts
|
|
@@ -182,6 +193,17 @@ Soft assertion failures also fail the eval.
|
|
|
182
193
|
|
|
183
194
|
***
|
|
184
195
|
|
|
196
|
+
### tags?[](#tags "Direct link to tags?")
|
|
197
|
+
|
|
198
|
+
```ts
|
|
199
|
+
optional tags: string[];
|
|
200
|
+
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Only run evals whose `tags` intersect this list. Empty/undefined runs all. Tags live on the eval def, so filtering happens after each file is loaded.
|
|
204
|
+
|
|
205
|
+
***
|
|
206
|
+
|
|
185
207
|
### timeoutMs?[](#timeoutms "Direct link to timeoutMs?")
|
|
186
208
|
|
|
187
209
|
```ts
|
|
@@ -189,4 +211,26 @@ optional timeoutMs: number;
|
|
|
189
211
|
|
|
190
212
|
```
|
|
191
213
|
|
|
192
|
-
|
|
214
|
+
Default per-eval timeout (ms): `runEval` races the whole test against it and it also caps each driver turn. A per-eval `def.timeoutMs` overrides it, and it wins over an agent's `evals.config.ts` `timeoutMs`. Unbounded when unset.
|
|
215
|
+
|
|
216
|
+
***
|
|
217
|
+
|
|
218
|
+
### warehouseId?[](#warehouseid "Direct link to warehouseId?")
|
|
219
|
+
|
|
220
|
+
```ts
|
|
221
|
+
optional warehouseId: string;
|
|
222
|
+
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
SQL warehouse id used to read managed evaluation datasets.
|
|
226
|
+
|
|
227
|
+
***
|
|
228
|
+
|
|
229
|
+
### workspaceClient?[](#workspaceclient "Direct link to workspaceClient?")
|
|
230
|
+
|
|
231
|
+
```ts
|
|
232
|
+
optional workspaceClient: WorkspaceClient;
|
|
233
|
+
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
Workspace client used to read managed evaluation datasets (for evals that declare `dataset`). Required alongside [warehouseId](#warehouseid) for those evals.
|
|
@@ -4,6 +4,28 @@ The `t` context passed to an eval's `test` function.
|
|
|
4
4
|
|
|
5
5
|
## Properties[](#properties "Direct link to Properties")
|
|
6
6
|
|
|
7
|
+
### expected[](#expected "Direct link to expected")
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
readonly expected: Record<string, unknown> | undefined;
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The current dataset row's `expectations` (ground truth / guidelines), or `undefined` when the row has none or the eval isn't dataset-driven.
|
|
15
|
+
|
|
16
|
+
***
|
|
17
|
+
|
|
18
|
+
### input[](#input "Direct link to input")
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
readonly input: Record<string, unknown>;
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The current dataset row's `inputs` when the eval is dataset-driven (see [EvalDefinition.dataset](./docs/api/appkit/Interface.EvalDefinition.md#dataset)); `{}` for a plain single-run eval.
|
|
26
|
+
|
|
27
|
+
***
|
|
28
|
+
|
|
7
29
|
### judge[](#judge "Direct link to judge")
|
|
8
30
|
|
|
9
31
|
```ts
|
|
@@ -15,7 +37,7 @@ judge: {
|
|
|
15
37
|
|
|
16
38
|
```
|
|
17
39
|
|
|
18
|
-
LLM-as-judge scoring of the last reply (via autoevals → a Databricks judge model). Each returns a scored
|
|
40
|
+
LLM-as-judge scoring of the last reply (via autoevals → a Databricks judge model). Each returns a scored assertion that gates by default (a miss fails the eval); chain `.atLeast(n)` to change the pass threshold or `.soft()` to demote to a tracked-only metric. Requires the judge to be configured (`--judge-model`).
|
|
19
41
|
|
|
20
42
|
#### closedQA()[](#closedqa "Direct link to closedQA()")
|
|
21
43
|
|
|
@@ -130,6 +152,28 @@ Assert a tool was called during the run (gate by default).
|
|
|
130
152
|
|
|
131
153
|
***
|
|
132
154
|
|
|
155
|
+
### calledToolWith()[](#calledtoolwith "Direct link to calledToolWith()")
|
|
156
|
+
|
|
157
|
+
```ts
|
|
158
|
+
calledToolWith(name: string, expected: Record<string, unknown>): AssertionHandle;
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Assert a tool was called with arguments that deep-contain `expected`: every key in `expected` must equal the actual argument (recursively for nested objects; arrays match element-for-element), so extra arguments are ignored. Gate by default.
|
|
163
|
+
|
|
164
|
+
#### Parameters[](#parameters-4 "Direct link to Parameters")
|
|
165
|
+
|
|
166
|
+
| Parameter | Type |
|
|
167
|
+
| ---------- | ----------------------------- |
|
|
168
|
+
| `name` | `string` |
|
|
169
|
+
| `expected` | `Record`<`string`, `unknown`> |
|
|
170
|
+
|
|
171
|
+
#### Returns[](#returns-4 "Direct link to Returns")
|
|
172
|
+
|
|
173
|
+
[`AssertionHandle`](./docs/api/appkit/Interface.AssertionHandle.md)
|
|
174
|
+
|
|
175
|
+
***
|
|
176
|
+
|
|
133
177
|
### check()[](#check "Direct link to check()")
|
|
134
178
|
|
|
135
179
|
```ts
|
|
@@ -139,19 +183,34 @@ check(value: string, matcher: Matcher): AssertionHandle;
|
|
|
139
183
|
|
|
140
184
|
Assert a value against a matcher, e.g. `t.check(t.reply, includes("Sunny"))`.
|
|
141
185
|
|
|
142
|
-
#### Parameters[](#parameters-
|
|
186
|
+
#### Parameters[](#parameters-5 "Direct link to Parameters")
|
|
143
187
|
|
|
144
188
|
| Parameter | Type |
|
|
145
189
|
| --------- | --------------------------------------------------------- |
|
|
146
190
|
| `value` | `string` |
|
|
147
191
|
| `matcher` | [`Matcher`](./docs/api/appkit/TypeAlias.Matcher.md) |
|
|
148
192
|
|
|
149
|
-
#### Returns[](#returns-
|
|
193
|
+
#### Returns[](#returns-5 "Direct link to Returns")
|
|
150
194
|
|
|
151
195
|
[`AssertionHandle`](./docs/api/appkit/Interface.AssertionHandle.md)
|
|
152
196
|
|
|
153
197
|
***
|
|
154
198
|
|
|
199
|
+
### reset()[](#reset "Direct link to reset()")
|
|
200
|
+
|
|
201
|
+
```ts
|
|
202
|
+
reset(): void;
|
|
203
|
+
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Start a fresh conversation: the next `send` opens a new thread with no history. Use to run several independent one-shot checks in one test. Consecutive `send`s (without a `reset`) stay in one multi-turn conversation.
|
|
207
|
+
|
|
208
|
+
#### Returns[](#returns-6 "Direct link to Returns")
|
|
209
|
+
|
|
210
|
+
`void`
|
|
211
|
+
|
|
212
|
+
***
|
|
213
|
+
|
|
155
214
|
### send()[](#send "Direct link to send()")
|
|
156
215
|
|
|
157
216
|
```ts
|
|
@@ -161,13 +220,13 @@ send(message: string): Promise<void>;
|
|
|
161
220
|
|
|
162
221
|
Send a user message to the agent and capture its response.
|
|
163
222
|
|
|
164
|
-
#### Parameters[](#parameters-
|
|
223
|
+
#### Parameters[](#parameters-6 "Direct link to Parameters")
|
|
165
224
|
|
|
166
225
|
| Parameter | Type |
|
|
167
226
|
| --------- | -------- |
|
|
168
227
|
| `message` | `string` |
|
|
169
228
|
|
|
170
|
-
#### Returns[](#returns-
|
|
229
|
+
#### Returns[](#returns-7 "Direct link to Returns")
|
|
171
230
|
|
|
172
231
|
`Promise`<`void`>
|
|
173
232
|
|
|
@@ -182,13 +241,13 @@ skip(reason?: string): never;
|
|
|
182
241
|
|
|
183
242
|
Skip this eval with an optional reason.
|
|
184
243
|
|
|
185
|
-
#### Parameters[](#parameters-
|
|
244
|
+
#### Parameters[](#parameters-7 "Direct link to Parameters")
|
|
186
245
|
|
|
187
246
|
| Parameter | Type |
|
|
188
247
|
| --------- | -------- |
|
|
189
248
|
| `reason?` | `string` |
|
|
190
249
|
|
|
191
|
-
#### Returns[](#returns-
|
|
250
|
+
#### Returns[](#returns-8 "Direct link to Returns")
|
|
192
251
|
|
|
193
252
|
`never`
|
|
194
253
|
|
|
@@ -203,6 +262,6 @@ succeeded(): AssertionHandle;
|
|
|
203
262
|
|
|
204
263
|
Assert the last turn completed successfully (gate by default).
|
|
205
264
|
|
|
206
|
-
#### Returns[](#returns-
|
|
265
|
+
#### Returns[](#returns-9 "Direct link to Returns")
|
|
207
266
|
|
|
208
267
|
[`AssertionHandle`](./docs/api/appkit/Interface.AssertionHandle.md)
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Type Alias: DatabaseApiConfig\<TSchema>
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
type DatabaseApiConfig<TSchema> =
|
|
5
|
+
| boolean
|
|
6
|
+
| {
|
|
7
|
+
tables?: readonly SchemaTableName<TSchema>[];
|
|
8
|
+
writes?: DatabaseApiWritesConfig<TSchema>;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Full generated CRUD for every declared table by default. Set false to disable all generated routes, or use an object to restrict tables and writes. Keyed routes require a public primary key; upsert stays programmatic. Route names must start with a letter, contain only letters, digits, `_`, or `-`, be at most 64 characters, and be unique ignoring case. Invalid names fail setup; exclude internal tables with `api.tables` or use `api: false`.
|
|
14
|
+
|
|
15
|
+
Routes run as the app's service principal and apply no per-user filter, so anyone the app admits receives every enabled operation. An exposed table also becomes includable from its neighbours; a relation whose target stays off cannot be included.
|
|
16
|
+
|
|
17
|
+
Text filters accept caller-supplied `like`/`ilike` patterns; a server-side `statement_timeout` cancels a pattern that would otherwise hold its pooled connection to completion.
|
|
18
|
+
|
|
19
|
+
## Type Parameters[](#type-parameters "Direct link to Type Parameters")
|
|
20
|
+
|
|
21
|
+
| Type Parameter |
|
|
22
|
+
| --------------------------------------------------------------------------- |
|
|
23
|
+
| `TSchema` *extends* [`Schema`](./docs/api/appkit/Interface.Schema.md) |
|
|
24
|
+
|
|
25
|
+
## Type Declaration[](#type-declaration "Direct link to Type Declaration")
|
|
26
|
+
|
|
27
|
+
`boolean`
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
{
|
|
31
|
+
tables?: readonly SchemaTableName<TSchema>[];
|
|
32
|
+
writes?: DatabaseApiWritesConfig<TSchema>;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### tables?[](#tables "Direct link to tables?")
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
readonly optional tables: readonly SchemaTableName<TSchema>[];
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Tables that remain exposed. Defaults to every declared table.
|
|
45
|
+
|
|
46
|
+
### writes?[](#writes "Direct link to writes?")
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
readonly optional writes: DatabaseApiWritesConfig<TSchema>;
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
All writes by default. Set false for read-only routes.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Type Alias: DatabaseApiWritesConfig\<TSchema>
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
type DatabaseApiWritesConfig<TSchema> =
|
|
5
|
+
| boolean
|
|
6
|
+
| {
|
|
7
|
+
operations?: readonly DatabaseApiWriteOperation[];
|
|
8
|
+
tables?: readonly SchemaTableName<TSchema>[];
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
All writes by default; false keeps reads only, and an object narrows writes.
|
|
14
|
+
|
|
15
|
+
## Type Parameters[](#type-parameters "Direct link to Type Parameters")
|
|
16
|
+
|
|
17
|
+
| Type Parameter |
|
|
18
|
+
| --------------------------------------------------------------------------- |
|
|
19
|
+
| `TSchema` *extends* [`Schema`](./docs/api/appkit/Interface.Schema.md) |
|
|
20
|
+
|
|
21
|
+
## Type Declaration[](#type-declaration "Direct link to Type Declaration")
|
|
22
|
+
|
|
23
|
+
`boolean`
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
{
|
|
27
|
+
operations?: readonly DatabaseApiWriteOperation[];
|
|
28
|
+
tables?: readonly SchemaTableName<TSchema>[];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### operations?[](#operations "Direct link to operations?")
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
readonly optional operations: readonly DatabaseApiWriteOperation[];
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Operations that remain enabled. Defaults to create, update, and delete.
|
|
41
|
+
|
|
42
|
+
### tables?[](#tables "Direct link to tables?")
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
readonly optional tables: readonly SchemaTableName<TSchema>[];
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Tables that remain writable. Defaults to every exposed table.
|
|
@@ -26,9 +26,9 @@ transaction<T>(callback: (tx: TransactionClient) => Promise<T>): Promise<T>;
|
|
|
26
26
|
|
|
27
27
|
#### Parameters[](#parameters "Direct link to Parameters")
|
|
28
28
|
|
|
29
|
-
| Parameter | Type
|
|
30
|
-
| ---------- |
|
|
31
|
-
| `callback` | (`tx`: `TransactionClient`) => `Promise`<`T`> |
|
|
29
|
+
| Parameter | Type |
|
|
30
|
+
| ---------- | ------------------------------------------------------------------------------------------------------- |
|
|
31
|
+
| `callback` | (`tx`: [`TransactionClient`](./docs/api/appkit/TypeAlias.TransactionClient.md)) => `Promise`<`T`> |
|
|
32
32
|
|
|
33
33
|
#### Returns[](#returns "Direct link to Returns")
|
|
34
34
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Type Alias: EntityHooks\<TTable>
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
type EntityHooks<TTable> = EntityMutationHooks<TTable> & {
|
|
5
|
+
serialize?: ReadSerializer;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Response shaping and mutation lifecycle declared for one table.
|
|
11
|
+
|
|
12
|
+
## Type Declaration[](#type-declaration "Direct link to Type Declaration")
|
|
13
|
+
|
|
14
|
+
### serialize?[](#serialize "Direct link to serialize?")
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
readonly optional serialize: ReadSerializer;
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Type Parameters[](#type-parameters "Direct link to Type Parameters")
|
|
22
|
+
|
|
23
|
+
| Type Parameter | Default type |
|
|
24
|
+
| --------------------------- | ------------ |
|
|
25
|
+
| `TTable` *extends* `string` | `string` |
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
```ts
|
|
4
4
|
type IDatabaseConfig<TSchema> = {
|
|
5
|
-
|
|
6
|
-
hooks?: { readonly [TTable in SchemaTableName<TSchema>]?:
|
|
5
|
+
api?: DatabaseApiConfig<TSchema>;
|
|
6
|
+
hooks?: { readonly [TTable in SchemaTableName<TSchema>]?: EntityHooks<TTable> };
|
|
7
7
|
schema: TSchema;
|
|
8
8
|
};
|
|
9
9
|
|
|
@@ -19,10 +19,21 @@ Configuration for one schema-bound DatabasePlugin instance.
|
|
|
19
19
|
|
|
20
20
|
## Properties[](#properties "Direct link to Properties")
|
|
21
21
|
|
|
22
|
-
###
|
|
22
|
+
### api?[](#api "Direct link to api?")
|
|
23
23
|
|
|
24
24
|
```ts
|
|
25
|
-
readonly optional
|
|
25
|
+
readonly optional api: DatabaseApiConfig<TSchema>;
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Generated HTTP CRUD is enabled for all tables by default, using the app's service principal. Every admitted caller receives the enabled operations; no per-user or per-row authorization is applied. This plugin does not support OBO. Use custom routes for application-specific authorization.
|
|
30
|
+
|
|
31
|
+
Set `false` to disable routes, `{ writes: false }` for reads only, or `{ tables: ["notes"] }` to expose only selected tables. To disable delete, use `{ writes: { operations: ["create", "update"] } }`.
|
|
32
|
+
|
|
33
|
+
#### Default Value[](#default-value "Direct link to Default Value")
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
true
|
|
26
37
|
|
|
27
38
|
```
|
|
28
39
|
|
|
@@ -31,7 +42,7 @@ readonly optional crudRoutes: CrudRoutesConfig<TSchema>;
|
|
|
31
42
|
### hooks?[](#hooks "Direct link to hooks?")
|
|
32
43
|
|
|
33
44
|
```ts
|
|
34
|
-
readonly optional hooks: { readonly [TTable in SchemaTableName<TSchema>]?:
|
|
45
|
+
readonly optional hooks: { readonly [TTable in SchemaTableName<TSchema>]?: EntityHooks<TTable> };
|
|
35
46
|
|
|
36
47
|
```
|
|
37
48
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Type Alias: ReadSerializer()
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
type ReadSerializer = (row: Record<string, unknown>, context: ReadSerializerContext) => Record<string, unknown>;
|
|
5
|
+
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
Shape one already private-safe row before it reaches the wire. A `Promise` is not assignable to the return type, so an async callback fails to compile: serializers run inside the response path and must not add latency there.
|
|
9
|
+
|
|
10
|
+
## Parameters[](#parameters "Direct link to Parameters")
|
|
11
|
+
|
|
12
|
+
| Parameter | Type |
|
|
13
|
+
| --------- | ------------------------------------------------------------------------------------- |
|
|
14
|
+
| `row` | `Record`<`string`, `unknown`> |
|
|
15
|
+
| `context` | [`ReadSerializerContext`](./docs/api/appkit/Interface.ReadSerializerContext.md) |
|
|
16
|
+
|
|
17
|
+
## Returns[](#returns "Direct link to Returns")
|
|
18
|
+
|
|
19
|
+
`Record`<`string`, `unknown`>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Type Alias: TransactionClient
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
type TransactionClient = { readonly [K in EntityName]: TypedEntityClient<K> } & {
|
|
5
|
+
sql: SqlTag;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Entity and SQL capabilities bound to one transaction.
|
|
11
|
+
|
|
12
|
+
## Type Declaration[](#type-declaration "Direct link to Type Declaration")
|
|
13
|
+
|
|
14
|
+
### sql[](#sql "Direct link to sql")
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
readonly sql: SqlTag;
|
|
18
|
+
|
|
19
|
+
```
|