@zveltio/sdk 3.0.0-beta.127 → 3.0.0-beta.133
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/dist/client.d.ts.map +1 -1
- package/dist/client.js +10 -3
- package/dist/extension/index.d.ts +3 -3
- package/dist/extension/reserved-paths.d.ts +5 -1
- package/dist/extension/reserved-paths.d.ts.map +1 -1
- package/dist/extension/reserved-paths.js +8 -1
- package/dist/sync-manager.d.ts +5 -0
- package/dist/sync-manager.d.ts.map +1 -1
- package/dist/sync-manager.js +23 -4
- package/dist/tests/client.test.js +19 -0
- package/dist/tests/reserved-paths.test.js +4 -1
- package/dist/tests/sync-manager.test.js +42 -0
- package/dist/tests/validate-manifest-routes.test.js +5 -0
- package/dist/tests/validate-sdui-data-endpoints.test.js +19 -3
- package/dist/tests/view-runtime.test.js +36 -2
- package/dist/tests/view.test.js +122 -3
- package/dist/validate/index.d.ts.map +1 -1
- package/dist/validate/index.js +165 -23
- package/dist/view/index.d.ts +17 -0
- package/dist/view/index.d.ts.map +1 -1
- package/dist/view/index.js +110 -1
- package/dist/view/runtime.d.ts +26 -0
- package/dist/view/runtime.d.ts.map +1 -1
- package/dist/view/runtime.js +60 -6
- package/dist/view/schema.d.ts.map +1 -1
- package/dist/view/schema.js +29 -5
- package/dist/view/types.generated.d.ts +17 -3
- package/dist/view/types.generated.d.ts.map +1 -1
- package/package.json +3 -2
- package/schemas/view-2.schema.json +73 -3
package/dist/view/schema.js
CHANGED
|
@@ -203,6 +203,11 @@ const defs = {
|
|
|
203
203
|
tone: ref('Tone'),
|
|
204
204
|
input: ref('Input'),
|
|
205
205
|
prompt: { ...arrayOf(ref('Name'), 1), description: 'Input fields to ask for.' },
|
|
206
|
+
pick: {
|
|
207
|
+
type: 'object',
|
|
208
|
+
description: 'Inputs drawn as a picker of the records of a collection of the extension (`prompt` names each); the id is the value.',
|
|
209
|
+
additionalProperties: ref('Name'),
|
|
210
|
+
},
|
|
206
211
|
confirm: ref('Text'),
|
|
207
212
|
when: ref('Conditions'),
|
|
208
213
|
busyWhen: {
|
|
@@ -221,17 +226,22 @@ const defs = {
|
|
|
221
226
|
],
|
|
222
227
|
},
|
|
223
228
|
Buttons: arrayOf(ref('Button'), 1),
|
|
224
|
-
FileHandoff: closed(
|
|
229
|
+
FileHandoff: closed('Stored files the caller hands the action, or its job (`$files`, ADR 0032 and 0052).', {
|
|
225
230
|
read: {
|
|
226
231
|
...ref('Value'),
|
|
227
232
|
description: "File ids the job may read, or a `file` field's value (its files' ids).",
|
|
228
233
|
},
|
|
234
|
+
prompt: closed('Asks the caller for one file: the front end uploads it as the caller and hands its id with `read` and as the input `input`.', { input: ref('Name'), label: ref('Text') }, ['input']),
|
|
229
235
|
write: closed('The one file the job may store.', { name: ref('Value'), maxBytes: ref('Value') }, ['name']),
|
|
230
236
|
}),
|
|
231
237
|
ListView: kind('list', 'Rows of a collection.', {
|
|
232
238
|
collection: ref('Name'),
|
|
233
239
|
fields: ref('Fields'),
|
|
234
240
|
filter: ref('Conditions'),
|
|
241
|
+
facets: {
|
|
242
|
+
...arrayOf(ref('Name'), 1),
|
|
243
|
+
description: 'Fields drawn as quick filters: "all" and one per declared choice (true and false for a boolean), one value per field at a time. Not persisted.',
|
|
244
|
+
},
|
|
235
245
|
sort: ref('Sort'),
|
|
236
246
|
search: { type: 'boolean' },
|
|
237
247
|
present: { enum: ['table', 'cards', 'feed'] },
|
|
@@ -257,7 +267,15 @@ const defs = {
|
|
|
257
267
|
},
|
|
258
268
|
...formProps,
|
|
259
269
|
}, ['collection']),
|
|
260
|
-
kind('form', "Fill an action's input; submitting runs the action.", {
|
|
270
|
+
kind('form', "Fill an action's input; submitting runs the action.", {
|
|
271
|
+
action: ref('ActionName'),
|
|
272
|
+
pick: {
|
|
273
|
+
type: 'object',
|
|
274
|
+
description: 'Inputs drawn as a picker of the records of a collection of the extension; the id is the value.',
|
|
275
|
+
additionalProperties: ref('Name'),
|
|
276
|
+
},
|
|
277
|
+
...formProps,
|
|
278
|
+
}, ['action']),
|
|
261
279
|
],
|
|
262
280
|
},
|
|
263
281
|
DetailView: kind('detail', 'One record, in panels.', {
|
|
@@ -322,7 +340,7 @@ const defs = {
|
|
|
322
340
|
TabsView: kind('tabs', 'Views as tabs.', { items: arrayOf(ref('View'), 1) }, ['items']),
|
|
323
341
|
View: { anyOf: VIEW_KINDS.map(ref) },
|
|
324
342
|
ActionResult: {
|
|
325
|
-
description: 'What an action returns, as a front end reads it (ADR 0042 decision 4). An object with `view`, `file` or `
|
|
343
|
+
description: 'What an action returns, as a front end reads it (ADR 0042 decision 4). An object with `view`, `file`, `reveal` or `redirect` is one of the closed forms; anything else is values.',
|
|
326
344
|
anyOf: [
|
|
327
345
|
closed('Opens a view (a navigation).', {
|
|
328
346
|
view: ref('ViewId'),
|
|
@@ -337,17 +355,23 @@ const defs = {
|
|
|
337
355
|
'file',
|
|
338
356
|
]),
|
|
339
357
|
closed('Shows a value once (a key, a secret).', { reveal: { type: 'string', minLength: 1 } }, ['reveal']),
|
|
358
|
+
closed('Sends the browser, top-level, to an https URL on a host the operator named for the extension (ADR 0061); the engine refuses any other.', { redirect: { type: 'string', pattern: '^https://' } }, ['redirect']),
|
|
340
359
|
ref('ActionValues'),
|
|
341
360
|
],
|
|
342
361
|
},
|
|
343
362
|
ActionValues: {
|
|
344
|
-
description: 'Values: a scalar, a list, or an object without `view`, `file` or `
|
|
363
|
+
description: 'Values: a scalar, a list, or an object without `view`, `file`, `reveal` or `redirect` (a form `recalc` merges an object of them).',
|
|
345
364
|
anyOf: [
|
|
346
365
|
{ type: ['string', 'number', 'boolean', 'null'] },
|
|
347
366
|
{ type: 'array', items: {} },
|
|
348
367
|
{
|
|
349
368
|
type: 'object',
|
|
350
|
-
properties: {
|
|
369
|
+
properties: {
|
|
370
|
+
view: { not: {} },
|
|
371
|
+
file: { not: {} },
|
|
372
|
+
reveal: { not: {} },
|
|
373
|
+
redirect: { not: {} },
|
|
374
|
+
},
|
|
351
375
|
},
|
|
352
376
|
],
|
|
353
377
|
},
|
|
@@ -71,6 +71,8 @@ export type Button = {
|
|
|
71
71
|
input?: Input;
|
|
72
72
|
/** Input fields to ask for. */
|
|
73
73
|
prompt?: Name[];
|
|
74
|
+
/** Inputs drawn as a picker of the records of a collection of the extension (`prompt` names each); the id is the value. */
|
|
75
|
+
pick?: Record<string, Name>;
|
|
74
76
|
confirm?: Text;
|
|
75
77
|
when?: Conditions;
|
|
76
78
|
/** While the record meets these, the work the action started is under way: the button is busy, and the front end reads the record again until it no longer does. */
|
|
@@ -86,10 +88,15 @@ export type Button = {
|
|
|
86
88
|
label?: Text;
|
|
87
89
|
};
|
|
88
90
|
export type Buttons = Button[];
|
|
89
|
-
/** Stored files the caller hands the action
|
|
91
|
+
/** Stored files the caller hands the action, or its job (`$files`, ADR 0032 and 0052). */
|
|
90
92
|
export type FileHandoff = {
|
|
91
93
|
/** File ids the job may read, or a `file` field's value (its files' ids). */
|
|
92
94
|
read?: Value;
|
|
95
|
+
/** Asks the caller for one file: the front end uploads it as the caller and hands its id with `read` and as the input `input`. */
|
|
96
|
+
prompt?: {
|
|
97
|
+
input: Name;
|
|
98
|
+
label?: Text;
|
|
99
|
+
};
|
|
93
100
|
/** The one file the job may store. */
|
|
94
101
|
write?: {
|
|
95
102
|
name: Value;
|
|
@@ -108,6 +115,8 @@ export type ListView = {
|
|
|
108
115
|
collection: Name;
|
|
109
116
|
fields?: Fields;
|
|
110
117
|
filter?: Conditions;
|
|
118
|
+
/** Fields drawn as quick filters: "all" and one per declared choice (true and false for a boolean), one value per field at a time. Not persisted. */
|
|
119
|
+
facets?: Name[];
|
|
111
120
|
sort?: Sort;
|
|
112
121
|
search?: boolean;
|
|
113
122
|
present?: 'table' | 'cards' | 'feed';
|
|
@@ -163,6 +172,8 @@ export type FormView = {
|
|
|
163
172
|
/** What a front end that does not know this view kind draws instead. */
|
|
164
173
|
fallback?: View;
|
|
165
174
|
action: ActionName;
|
|
175
|
+
/** Inputs drawn as a picker of the records of a collection of the extension; the id is the value. */
|
|
176
|
+
pick?: Record<string, Name>;
|
|
166
177
|
fields?: Fields;
|
|
167
178
|
sections?: Array<{
|
|
168
179
|
title?: Text;
|
|
@@ -317,7 +328,7 @@ export type TabsView = {
|
|
|
317
328
|
items: View[];
|
|
318
329
|
};
|
|
319
330
|
export type View = ListView | FormView | DetailView | BoardView | TimelineView | TreeView | MatrixView | MapView | StatView | SplitView | TabsView;
|
|
320
|
-
/** What an action returns, as a front end reads it (ADR 0042 decision 4). An object with `view`, `file` or `
|
|
331
|
+
/** What an action returns, as a front end reads it (ADR 0042 decision 4). An object with `view`, `file`, `reveal` or `redirect` is one of the closed forms; anything else is values. */
|
|
321
332
|
export type ActionResult = {
|
|
322
333
|
view: ViewId;
|
|
323
334
|
/** The parameters it is opened with (`$param`). */
|
|
@@ -328,12 +339,15 @@ export type ActionResult = {
|
|
|
328
339
|
file: string;
|
|
329
340
|
} | {
|
|
330
341
|
reveal: string;
|
|
342
|
+
} | {
|
|
343
|
+
redirect: string;
|
|
331
344
|
} | ActionValues;
|
|
332
|
-
/** Values: a scalar, a list, or an object without `view`, `file` or `
|
|
345
|
+
/** Values: a scalar, a list, or an object without `view`, `file`, `reveal` or `redirect` (a form `recalc` merges an object of them). */
|
|
333
346
|
export type ActionValues = string | number | boolean | null | unknown[] | {
|
|
334
347
|
view?: never;
|
|
335
348
|
file?: never;
|
|
336
349
|
reveal?: never;
|
|
350
|
+
redirect?: never;
|
|
337
351
|
[key: string]: unknown;
|
|
338
352
|
};
|
|
339
353
|
//# sourceMappingURL=types.generated.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.generated.d.ts","sourceRoot":"","sources":["../../src/view/types.generated.ts"],"names":[],"mappings":"AAEA,kCAAkC;AAClC,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC;AAE1B,iGAAiG;AACjG,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAEhC,6CAA6C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1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zveltio/sdk",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "3.0.0-beta.
|
|
4
|
+
"version": "3.0.0-beta.133",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -71,7 +71,8 @@
|
|
|
71
71
|
"dependencies": {
|
|
72
72
|
"hono": "^4.13.18",
|
|
73
73
|
"idb": "^8.0.3",
|
|
74
|
-
"kysely": "^0.29.9"
|
|
74
|
+
"kysely": "^0.29.9",
|
|
75
|
+
"zod": "^4.6.7"
|
|
75
76
|
},
|
|
76
77
|
"devDependencies": {
|
|
77
78
|
"@testcontainers/postgresql": "^11.14.0",
|
|
@@ -38,6 +38,14 @@
|
|
|
38
38
|
"filter": {
|
|
39
39
|
"$ref": "#/$defs/Conditions"
|
|
40
40
|
},
|
|
41
|
+
"facets": {
|
|
42
|
+
"type": "array",
|
|
43
|
+
"items": {
|
|
44
|
+
"$ref": "#/$defs/Name"
|
|
45
|
+
},
|
|
46
|
+
"minItems": 1,
|
|
47
|
+
"description": "Fields drawn as quick filters: \"all\" and one per declared choice (true and false for a boolean), one value per field at a time. Not persisted."
|
|
48
|
+
},
|
|
41
49
|
"sort": {
|
|
42
50
|
"$ref": "#/$defs/Sort"
|
|
43
51
|
},
|
|
@@ -229,6 +237,13 @@
|
|
|
229
237
|
"action": {
|
|
230
238
|
"$ref": "#/$defs/ActionName"
|
|
231
239
|
},
|
|
240
|
+
"pick": {
|
|
241
|
+
"type": "object",
|
|
242
|
+
"description": "Inputs drawn as a picker of the records of a collection of the extension; the id is the value.",
|
|
243
|
+
"additionalProperties": {
|
|
244
|
+
"$ref": "#/$defs/Name"
|
|
245
|
+
}
|
|
246
|
+
},
|
|
232
247
|
"fields": {
|
|
233
248
|
"$ref": "#/$defs/Fields"
|
|
234
249
|
},
|
|
@@ -1173,6 +1188,13 @@
|
|
|
1173
1188
|
"minItems": 1,
|
|
1174
1189
|
"description": "Input fields to ask for."
|
|
1175
1190
|
},
|
|
1191
|
+
"pick": {
|
|
1192
|
+
"type": "object",
|
|
1193
|
+
"description": "Inputs drawn as a picker of the records of a collection of the extension (`prompt` names each); the id is the value.",
|
|
1194
|
+
"additionalProperties": {
|
|
1195
|
+
"$ref": "#/$defs/Name"
|
|
1196
|
+
}
|
|
1197
|
+
},
|
|
1176
1198
|
"confirm": {
|
|
1177
1199
|
"$ref": "#/$defs/Text"
|
|
1178
1200
|
},
|
|
@@ -1241,12 +1263,28 @@
|
|
|
1241
1263
|
},
|
|
1242
1264
|
"FileHandoff": {
|
|
1243
1265
|
"type": "object",
|
|
1244
|
-
"description": "Stored files the caller hands the action
|
|
1266
|
+
"description": "Stored files the caller hands the action, or its job (`$files`, ADR 0032 and 0052).",
|
|
1245
1267
|
"properties": {
|
|
1246
1268
|
"read": {
|
|
1247
1269
|
"$ref": "#/$defs/Value",
|
|
1248
1270
|
"description": "File ids the job may read, or a `file` field's value (its files' ids)."
|
|
1249
1271
|
},
|
|
1272
|
+
"prompt": {
|
|
1273
|
+
"type": "object",
|
|
1274
|
+
"description": "Asks the caller for one file: the front end uploads it as the caller and hands its id with `read` and as the input `input`.",
|
|
1275
|
+
"properties": {
|
|
1276
|
+
"input": {
|
|
1277
|
+
"$ref": "#/$defs/Name"
|
|
1278
|
+
},
|
|
1279
|
+
"label": {
|
|
1280
|
+
"$ref": "#/$defs/Text"
|
|
1281
|
+
}
|
|
1282
|
+
},
|
|
1283
|
+
"required": [
|
|
1284
|
+
"input"
|
|
1285
|
+
],
|
|
1286
|
+
"additionalProperties": false
|
|
1287
|
+
},
|
|
1250
1288
|
"write": {
|
|
1251
1289
|
"type": "object",
|
|
1252
1290
|
"description": "The one file the job may store.",
|
|
@@ -1296,6 +1334,14 @@
|
|
|
1296
1334
|
"filter": {
|
|
1297
1335
|
"$ref": "#/$defs/Conditions"
|
|
1298
1336
|
},
|
|
1337
|
+
"facets": {
|
|
1338
|
+
"type": "array",
|
|
1339
|
+
"items": {
|
|
1340
|
+
"$ref": "#/$defs/Name"
|
|
1341
|
+
},
|
|
1342
|
+
"minItems": 1,
|
|
1343
|
+
"description": "Fields drawn as quick filters: \"all\" and one per declared choice (true and false for a boolean), one value per field at a time. Not persisted."
|
|
1344
|
+
},
|
|
1299
1345
|
"sort": {
|
|
1300
1346
|
"$ref": "#/$defs/Sort"
|
|
1301
1347
|
},
|
|
@@ -1477,6 +1523,13 @@
|
|
|
1477
1523
|
"action": {
|
|
1478
1524
|
"$ref": "#/$defs/ActionName"
|
|
1479
1525
|
},
|
|
1526
|
+
"pick": {
|
|
1527
|
+
"type": "object",
|
|
1528
|
+
"description": "Inputs drawn as a picker of the records of a collection of the extension; the id is the value.",
|
|
1529
|
+
"additionalProperties": {
|
|
1530
|
+
"$ref": "#/$defs/Name"
|
|
1531
|
+
}
|
|
1532
|
+
},
|
|
1480
1533
|
"fields": {
|
|
1481
1534
|
"$ref": "#/$defs/Fields"
|
|
1482
1535
|
},
|
|
@@ -2020,7 +2073,7 @@
|
|
|
2020
2073
|
]
|
|
2021
2074
|
},
|
|
2022
2075
|
"ActionResult": {
|
|
2023
|
-
"description": "What an action returns, as a front end reads it (ADR 0042 decision 4). An object with `view`, `file` or `
|
|
2076
|
+
"description": "What an action returns, as a front end reads it (ADR 0042 decision 4). An object with `view`, `file`, `reveal` or `redirect` is one of the closed forms; anything else is values.",
|
|
2024
2077
|
"anyOf": [
|
|
2025
2078
|
{
|
|
2026
2079
|
"type": "object",
|
|
@@ -2083,13 +2136,27 @@
|
|
|
2083
2136
|
],
|
|
2084
2137
|
"additionalProperties": false
|
|
2085
2138
|
},
|
|
2139
|
+
{
|
|
2140
|
+
"type": "object",
|
|
2141
|
+
"description": "Sends the browser, top-level, to an https URL on a host the operator named for the extension (ADR 0061); the engine refuses any other.",
|
|
2142
|
+
"properties": {
|
|
2143
|
+
"redirect": {
|
|
2144
|
+
"type": "string",
|
|
2145
|
+
"pattern": "^https://"
|
|
2146
|
+
}
|
|
2147
|
+
},
|
|
2148
|
+
"required": [
|
|
2149
|
+
"redirect"
|
|
2150
|
+
],
|
|
2151
|
+
"additionalProperties": false
|
|
2152
|
+
},
|
|
2086
2153
|
{
|
|
2087
2154
|
"$ref": "#/$defs/ActionValues"
|
|
2088
2155
|
}
|
|
2089
2156
|
]
|
|
2090
2157
|
},
|
|
2091
2158
|
"ActionValues": {
|
|
2092
|
-
"description": "Values: a scalar, a list, or an object without `view`, `file` or `
|
|
2159
|
+
"description": "Values: a scalar, a list, or an object without `view`, `file`, `reveal` or `redirect` (a form `recalc` merges an object of them).",
|
|
2093
2160
|
"anyOf": [
|
|
2094
2161
|
{
|
|
2095
2162
|
"type": [
|
|
@@ -2114,6 +2181,9 @@
|
|
|
2114
2181
|
},
|
|
2115
2182
|
"reveal": {
|
|
2116
2183
|
"not": {}
|
|
2184
|
+
},
|
|
2185
|
+
"redirect": {
|
|
2186
|
+
"not": {}
|
|
2117
2187
|
}
|
|
2118
2188
|
}
|
|
2119
2189
|
}
|