@voltro/protocol 0.52.0 → 0.54.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/CHANGELOG.md +424 -0
- package/dist/index.d.ts +161 -2
- package/dist/index.js +526 -428
- package/dist/rest.d.ts +20 -0
- package/package.json +3 -3
package/dist/rest.d.ts
CHANGED
|
@@ -230,6 +230,8 @@ declare interface IdempotencyStore {
|
|
|
230
230
|
declare interface InsertTarget<Input = unknown, Row = unknown, Item = Record<string, unknown>> extends NestedTargetFields<Input> {
|
|
231
231
|
readonly table: string;
|
|
232
232
|
readonly op: 'insert';
|
|
233
|
+
/** Declared junction relations — see {@link TargetRelations}. */
|
|
234
|
+
readonly relations?: TargetRelations | undefined;
|
|
233
235
|
readonly order?: 'prepend' | 'append' | undefined;
|
|
234
236
|
/**
|
|
235
237
|
* Build the optimistic row from the mutation input. The framework
|
|
@@ -998,11 +1000,29 @@ declare type Subject = typeof Subject.Type;
|
|
|
998
1000
|
|
|
999
1001
|
declare type Target<Input = unknown, Row = unknown> = TargetSpec<Input, Row> | ReadonlyArray<TargetSpec<Input, Row>>;
|
|
1000
1002
|
|
|
1003
|
+
/**
|
|
1004
|
+
* Declared many-to-many RELATIONS of a write target: `{ inputField:
|
|
1005
|
+
* junctionTable }`. After the executor succeeds — inside the SAME
|
|
1006
|
+
* transaction — the framework reconciles the junction's links for the
|
|
1007
|
+
* written row against `input[inputField]` (an array of target ids) via the
|
|
1008
|
+
* diff-based `store.relationLinks`, so a form's multi-reference field saves
|
|
1009
|
+
* in one mutation with no hand-written junction code. The anchor column is
|
|
1010
|
+
* derived from the junction's `reference()` targets (a self-junction is
|
|
1011
|
+
* refused, never guessed).
|
|
1012
|
+
*
|
|
1013
|
+
* An ABSENT input field leaves the links untouched (absent ≠ empty — an
|
|
1014
|
+
* empty array is the explicit "clear them all"). The row id is the
|
|
1015
|
+
* executor's `output.id`, falling back to `input.id`.
|
|
1016
|
+
*/
|
|
1017
|
+
declare type TargetRelations = Readonly<Record<string, string>>;
|
|
1018
|
+
|
|
1001
1019
|
declare type TargetSpec<Input = unknown, Row = unknown> = InsertTarget<Input, Row> | UpdateTarget<Input, Row> | DeleteTarget<Input>;
|
|
1002
1020
|
|
|
1003
1021
|
declare interface UpdateTarget<Input = unknown, Row = unknown, Item = Record<string, unknown>> extends NestedTargetFields<Input> {
|
|
1004
1022
|
readonly table: string;
|
|
1005
1023
|
readonly op: 'update';
|
|
1024
|
+
/** Declared junction relations — see {@link TargetRelations}. */
|
|
1025
|
+
readonly relations?: TargetRelations | undefined;
|
|
1006
1026
|
/** Identify the row(s) to patch. Default: `input.id`. Return an ARRAY to patch
|
|
1007
1027
|
* MANY rows/items in one mutation (a bulk edit — where the per-item
|
|
1008
1028
|
* parallel-write race lived). */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voltro/protocol",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.54.0",
|
|
4
4
|
"description": "The Voltro wire + plugin contract — defineQuery/Mutation/Action/Stream, definePlugin, sessions / JWT / API-keys, and the RPC protocol.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"voltro",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@effect/sql": "^0.52.0",
|
|
57
|
-
"@voltro/database": "0.
|
|
58
|
-
"@voltro/logger": "0.
|
|
57
|
+
"@voltro/database": "0.54.0",
|
|
58
|
+
"@voltro/logger": "0.54.0",
|
|
59
59
|
"jose": "^6.2.8"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|