@zveltio/sdk 3.0.0-beta.124 → 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/LICENSE +21 -0
- package/dist/build/index.d.ts.map +1 -1
- package/dist/build/index.js +9 -4
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +10 -3
- package/dist/extension/index.d.ts +15 -3
- package/dist/extension/index.d.ts.map +1 -1
- 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/runtime-deps.test.d.ts +2 -0
- package/dist/tests/runtime-deps.test.d.ts.map +1 -0
- package/dist/tests/runtime-deps.test.js +41 -0
- package/dist/tests/sync-manager.test.js +42 -0
- package/dist/tests/validate-manifest-actions.test.js +12 -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 +178 -6
- 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 +7 -4
- package/schemas/extension-manifest.schema.json +588 -0
- package/schemas/view-2.schema.json +73 -3
|
@@ -69,6 +69,11 @@ describe('manifest signInProviders (ADR 0039 decision 8)', () => {
|
|
|
69
69
|
expect(codes({ routes: [{ ...login, access: 'caller' }], signInProviders: [dir] })).toEqual([
|
|
70
70
|
'MANIFEST_BAD_SIGN_IN_PROVIDER',
|
|
71
71
|
]);
|
|
72
|
+
// A route with a parameter cannot start a sign-in: there is nothing to fill it.
|
|
73
|
+
const param = { ...login, path: '/login/:realm' };
|
|
74
|
+
expect(codes({ routes: [param], signInProviders: [{ ...dir, route: param.path }] })).toEqual([
|
|
75
|
+
'MANIFEST_BAD_SIGN_IN_PROVIDER',
|
|
76
|
+
]);
|
|
72
77
|
expect(codes({ routes: [login], signInProviders: [dir, dir] })).toEqual([
|
|
73
78
|
'MANIFEST_BAD_SIGN_IN_PROVIDER',
|
|
74
79
|
]);
|
|
@@ -25,17 +25,33 @@ describe('SDUI data API endpoints', () => {
|
|
|
25
25
|
expect(foreign('/api/data/invoices', ['projects'])).toEqual(['/api/data/invoices']);
|
|
26
26
|
expect(foreign('/api/data/projects')).toEqual(['/api/data/projects']);
|
|
27
27
|
});
|
|
28
|
-
it('refuses every other path, a deeper one
|
|
28
|
+
it('refuses every other path, a deeper one included', () => {
|
|
29
29
|
for (const e of [
|
|
30
30
|
'/api/users',
|
|
31
31
|
'/api/data',
|
|
32
32
|
'/api/data/projects/{id}/history',
|
|
33
|
-
'/api/data/projects/../users',
|
|
34
|
-
'/api/data/projects/..',
|
|
35
33
|
'/api/collections/projects',
|
|
36
34
|
'/api/data/Projects',
|
|
37
35
|
]) {
|
|
38
36
|
expect(foreign(e, ['projects'])).toEqual([e]);
|
|
39
37
|
}
|
|
40
38
|
});
|
|
39
|
+
it('refuses a dot segment, raw or percent-encoded, even under a dependency mount', () => {
|
|
40
|
+
const dot = (endpoint) => validateSduiSchema({
|
|
41
|
+
schema: { title: 't', resources: [{ name: 'r', dataSource: endpoint }] },
|
|
42
|
+
extName: 'projects/management',
|
|
43
|
+
dependencies: ['dep'],
|
|
44
|
+
collections: ['projects'],
|
|
45
|
+
}).map((e) => e.code);
|
|
46
|
+
for (const e of [
|
|
47
|
+
'/ext/dep/../../api/admin/users',
|
|
48
|
+
'/ext/dep/%2E%2e/%2e./api/admin/users',
|
|
49
|
+
'/ext/dep/./x',
|
|
50
|
+
'/api/data/projects/../users',
|
|
51
|
+
'/api/data/projects/..',
|
|
52
|
+
]) {
|
|
53
|
+
expect(dot(e)).toEqual(['SDUI_ENDPOINT_DOT_SEGMENT']);
|
|
54
|
+
}
|
|
55
|
+
expect(dot('/ext/dep/a..b?x=../y')).toEqual([]);
|
|
56
|
+
});
|
|
41
57
|
});
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { describe, expect, it } from 'bun:test';
|
|
4
4
|
import { readFileSync } from 'node:fs';
|
|
5
5
|
import { join } from 'node:path';
|
|
6
|
-
import { $, actionPath, defaultView, fallbackFor, isBound, isEditable, matches, fileIds, readActionResult, resolveFiles, resolveInput, toFilter, toSort, validateView, } from '../view/index.js';
|
|
6
|
+
import { $, actionPath, defaultView, fallbackFor, isBound, isEditable, matches, fileIds, readActionResult, resolveFiles, resolveInput, resolveValue, toFilter, toSort, validateView, } from '../view/index.js';
|
|
7
7
|
const scope = {
|
|
8
8
|
record: { id: 'r1', status: 'open', total: 5 },
|
|
9
9
|
selected: { folders: 'f9' },
|
|
@@ -37,6 +37,28 @@ describe('references', () => {
|
|
|
37
37
|
expect(toFilter([$.where('folder_id', 'eq', $.selected('other'))], scope)).toBeNull();
|
|
38
38
|
});
|
|
39
39
|
});
|
|
40
|
+
describe('a name an object inherits', () => {
|
|
41
|
+
// A Name may be `constructor`; `{}.constructor` is `Object`, so a record
|
|
42
|
+
// without that field read as bound and a `notnull` on it held.
|
|
43
|
+
const empty = { record: {}, params: {}, selected: {}, selection: [{}] };
|
|
44
|
+
for (const name of ['constructor', 'toString', 'hasOwnProperty']) {
|
|
45
|
+
it(`reads \`${name}\` as missing on a record that lacks it`, () => {
|
|
46
|
+
expect(resolveValue({ $record: name }, empty)).toBeUndefined();
|
|
47
|
+
expect(resolveValue({ $param: name }, empty)).toBeUndefined();
|
|
48
|
+
expect(resolveValue({ $selected: name }, empty)).toBeUndefined();
|
|
49
|
+
expect(resolveValue({ $selection: name }, empty)).toEqual([undefined]);
|
|
50
|
+
expect(isBound({ action: 'a', input: { x: { $record: name } } }, empty)).toBe(false);
|
|
51
|
+
expect(resolveInput({ x: { $record: name } }, empty)).toBeNull();
|
|
52
|
+
expect(matches([{ field: name, op: 'not_null' }], {}, empty)).toBe(false);
|
|
53
|
+
expect(matches([{ field: name, op: 'null' }], {}, empty)).toBe(true);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
it('still reads an own field named `constructor`', () => {
|
|
57
|
+
const s = { record: { constructor: 'c1' } };
|
|
58
|
+
expect(resolveValue({ $record: 'constructor' }, s)).toBe('c1');
|
|
59
|
+
expect(matches([{ field: 'constructor', op: 'eq', value: 'c1' }], s.record, s)).toBe(true);
|
|
60
|
+
});
|
|
61
|
+
});
|
|
40
62
|
describe('a button whose reference has no value yet', () => {
|
|
41
63
|
const none = { ...scope, selected: {} };
|
|
42
64
|
it('is not bound while the pane it names has no selection, and is once it has', () => {
|
|
@@ -94,6 +116,12 @@ describe('cross-key checks', () => {
|
|
|
94
116
|
}));
|
|
95
117
|
expect(r.ok ? [] : r.issues.map((i) => i.path)).toEqual(['/rowActions/0/prompt/0']);
|
|
96
118
|
});
|
|
119
|
+
it('refuses a file prompt whose input the button binds', () => {
|
|
120
|
+
const button = (input) => doc({ rowActions: [{ action: 'load', input, files: { prompt: { input: 'file' } } }] });
|
|
121
|
+
const r = validateView(button({ file: $.record('id') }));
|
|
122
|
+
expect(r.ok ? [] : r.issues.map((i) => i.path)).toEqual(['/rowActions/0/files/prompt/input']);
|
|
123
|
+
expect(validateView(button({ id: $.record('id') })).ok).toBe(true);
|
|
124
|
+
});
|
|
97
125
|
});
|
|
98
126
|
describe('matches', () => {
|
|
99
127
|
it('checks a row against conditions', () => {
|
|
@@ -158,7 +186,7 @@ describe('actions', () => {
|
|
|
158
186
|
expect(() => actionPath(ext, action)).toThrow();
|
|
159
187
|
}
|
|
160
188
|
});
|
|
161
|
-
it('reads a result as navigation, view, file, reveal or values', () => {
|
|
189
|
+
it('reads a result as navigation, view, file, reveal, redirect or values', () => {
|
|
162
190
|
expect(readActionResult({ view: 'mail.compose', params: { draft_id: 'd' } })).toEqual({
|
|
163
191
|
kind: 'navigate',
|
|
164
192
|
view: 'mail.compose',
|
|
@@ -167,6 +195,12 @@ describe('actions', () => {
|
|
|
167
195
|
expect(readActionResult({ view: { type: 'list', collection: 'x' } }).kind).toBe('view');
|
|
168
196
|
expect(readActionResult({ file: 'f1' })).toEqual({ kind: 'file', file: 'f1' });
|
|
169
197
|
expect(readActionResult({ reveal: 'k' })).toEqual({ kind: 'reveal', value: 'k' });
|
|
198
|
+
expect(readActionResult({ redirect: 'https://a.example/x' })).toEqual({
|
|
199
|
+
kind: 'redirect',
|
|
200
|
+
url: 'https://a.example/x',
|
|
201
|
+
});
|
|
202
|
+
// Only https: anything else is invalid, never a navigation.
|
|
203
|
+
expect(readActionResult({ redirect: 'javascript:alert(1)' }).kind).toBe('invalid');
|
|
170
204
|
expect(readActionResult({ total: 3 })).toEqual({ kind: 'values', values: { total: 3 } });
|
|
171
205
|
expect(readActionResult(null)).toEqual({ kind: 'values', values: null });
|
|
172
206
|
// A tagged object that is none of the closed forms is not values: no guessing.
|
package/dist/tests/view.test.js
CHANGED
|
@@ -5,10 +5,9 @@
|
|
|
5
5
|
import { describe, expect, it } from 'bun:test';
|
|
6
6
|
import { readFileSync } from 'node:fs';
|
|
7
7
|
import { join } from 'node:path';
|
|
8
|
-
import { $, isViewDocument, VIEW_SPEC, validateView, view, viewNameIssues } from '../view/index.js';
|
|
8
|
+
import { $, facetOptions, isViewDocument, pickIssues, VIEW_SPEC, validateView, view, viewNameIssues, withFacets, } from '../view/index.js';
|
|
9
9
|
// Parsed, not imported: an import would turn the `__proto__` key into a prototype.
|
|
10
10
|
// Resolved through src/ so the copy tsc compiles into dist/tests finds it too.
|
|
11
|
-
// Parsed, not imported: an import would turn the `__proto__` key into a prototype.
|
|
12
11
|
const fixtures = JSON.parse(readFileSync(join(import.meta.dir, '../../src/tests/fixtures/view-2.json'), 'utf8'));
|
|
13
12
|
const issues = (input) => {
|
|
14
13
|
const r = validateView(input);
|
|
@@ -85,7 +84,8 @@ describe('viewNameIssues', () => {
|
|
|
85
84
|
});
|
|
86
85
|
it('a $selected names an earlier pane of an enclosing split; pane ids are unique', () => {
|
|
87
86
|
const v = view.document(view.split({
|
|
88
|
-
|
|
87
|
+
// An input is values, but a reference in it is still checked.
|
|
88
|
+
actions: [{ action: 'sync', input: { a: $.selected('second'), b: $.selected('nowhere') } }],
|
|
89
89
|
panes: [
|
|
90
90
|
view.list({
|
|
91
91
|
id: 'first',
|
|
@@ -104,6 +104,7 @@ describe('viewNameIssues', () => {
|
|
|
104
104
|
'/panes/0/filter/0/value/$selected',
|
|
105
105
|
'/panes/2/id',
|
|
106
106
|
'/panes/2/record/$selected',
|
|
107
|
+
'/actions/0/input/b/$selected',
|
|
107
108
|
]);
|
|
108
109
|
});
|
|
109
110
|
it('navigate and open name a view of the extension; a message key must be shipped', () => {
|
|
@@ -210,3 +211,121 @@ describe('builder', () => {
|
|
|
210
211
|
expect(issues(built)).toEqual([]);
|
|
211
212
|
});
|
|
212
213
|
});
|
|
214
|
+
describe('pick and facets (DR-45)', () => {
|
|
215
|
+
const button = (extra) => ({
|
|
216
|
+
spec: VIEW_SPEC,
|
|
217
|
+
type: 'list',
|
|
218
|
+
collection: 'deals',
|
|
219
|
+
rowActions: [{ action: 'assign', ...extra }],
|
|
220
|
+
});
|
|
221
|
+
const names = {
|
|
222
|
+
collections: ['deals', 'people'],
|
|
223
|
+
actions: ['assign'],
|
|
224
|
+
fields: new Map([['deals', ['id', 'stage', 'won', 'notes']]]),
|
|
225
|
+
facetFields: new Map([['deals', ['stage', 'won']]]),
|
|
226
|
+
};
|
|
227
|
+
it('a button `pick` must be an input it asks for (`prompt`) and does not set (`input`)', () => {
|
|
228
|
+
expect(issues(button({ prompt: ['owner'], pick: { owner: 'people' } }))).toEqual([]);
|
|
229
|
+
expect(paths(button({ pick: { owner: 'people' } }))).toEqual(['/rowActions/0/pick/owner']);
|
|
230
|
+
expect(paths(button({ prompt: ['owner'], input: { owner: 'x' }, pick: { owner: 'people' } }))).toContain('/rowActions/0/pick/owner');
|
|
231
|
+
});
|
|
232
|
+
it('an action form `pick` is accepted; a collection form takes none', () => {
|
|
233
|
+
expect(issues({ spec: VIEW_SPEC, type: 'form', action: 'assign', pick: { owner: 'people' } })).toEqual([]);
|
|
234
|
+
expect(paths({ spec: VIEW_SPEC, type: 'form', collection: 'deals', pick: { owner: 'people' } })).toEqual(['/pick']);
|
|
235
|
+
});
|
|
236
|
+
it('a `pick` collection must be one the extension owns', () => {
|
|
237
|
+
const v = button({ prompt: ['owner'], pick: { owner: 'contacts' } });
|
|
238
|
+
expect(viewNameIssues(v, names).map((i) => i.path)).toEqual(['/rowActions/0/pick/owner']);
|
|
239
|
+
expect(viewNameIssues(button({ prompt: ['owner'], pick: { owner: 'people' } }), names)).toEqual([]);
|
|
240
|
+
// The input name is the caller's: a key named `action` or `collection` is no reference.
|
|
241
|
+
const odd = { spec: VIEW_SPEC, type: 'form', action: 'assign', pick: { action: 'people' } };
|
|
242
|
+
expect(viewNameIssues(odd, names)).toEqual([]);
|
|
243
|
+
});
|
|
244
|
+
it('a `pick` input must be a string property of its action input', () => {
|
|
245
|
+
const inputs = new Map([
|
|
246
|
+
[
|
|
247
|
+
'assign',
|
|
248
|
+
{
|
|
249
|
+
properties: {
|
|
250
|
+
owner: { type: 'string' },
|
|
251
|
+
maybe: { type: ['string', 'null'] },
|
|
252
|
+
n: { type: 'integer' },
|
|
253
|
+
kind: { type: 'string', enum: ['a'] },
|
|
254
|
+
many: { type: 'array', items: { type: 'string' } },
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
],
|
|
258
|
+
]);
|
|
259
|
+
const v = (pick) => button({ prompt: Object.keys(pick), pick });
|
|
260
|
+
expect(pickIssues(v({ owner: 'people', maybe: 'people' }), inputs)).toEqual([]);
|
|
261
|
+
expect(pickIssues(v({ n: 'people', kind: 'people', many: 'people', ghost: 'people' }), inputs).map((i) => i.path)).toEqual([
|
|
262
|
+
'/rowActions/0/pick/n',
|
|
263
|
+
'/rowActions/0/pick/kind',
|
|
264
|
+
'/rowActions/0/pick/many',
|
|
265
|
+
'/rowActions/0/pick/ghost',
|
|
266
|
+
]);
|
|
267
|
+
// An action with no known schema (a dependency's) is not checked.
|
|
268
|
+
expect(pickIssues(v({ n: 'people' }), new Map())).toEqual([]);
|
|
269
|
+
});
|
|
270
|
+
const facets = (extra) => ({
|
|
271
|
+
spec: VIEW_SPEC,
|
|
272
|
+
type: 'list',
|
|
273
|
+
collection: 'deals',
|
|
274
|
+
...extra,
|
|
275
|
+
});
|
|
276
|
+
it('a facet on a field the view `filter` constrains is refused', () => {
|
|
277
|
+
expect(issues(facets({ facets: ['stage'] }))).toEqual([]);
|
|
278
|
+
expect(paths(facets({ facets: ['stage', 'won'], filter: [{ field: 'won', op: 'eq', value: true }] }))).toEqual(['/facets/1']);
|
|
279
|
+
});
|
|
280
|
+
it('a facet must be a field of the collection with choices, or a boolean', () => {
|
|
281
|
+
expect(viewNameIssues(facets({ facets: ['stage', 'won'] }), names)).toEqual([]);
|
|
282
|
+
expect(viewNameIssues(facets({ facets: ['notes', 'ghost'] }), names).map((i) => [i.path, i.message])).toEqual([
|
|
283
|
+
['/facets/1', 'field "ghost" is not a field of "deals"'],
|
|
284
|
+
[
|
|
285
|
+
'/facets/0',
|
|
286
|
+
'field "notes" is neither a boolean nor a single-value field with declared choices',
|
|
287
|
+
],
|
|
288
|
+
]);
|
|
289
|
+
});
|
|
290
|
+
it('a facet field listed twice is refused', () => {
|
|
291
|
+
expect(paths(facets({ facets: ['stage', 'won', 'stage'] }))).toEqual(['/facets/2']);
|
|
292
|
+
});
|
|
293
|
+
it("facetOptions reads the engine's enum declaration (`options.values`)", () => {
|
|
294
|
+
// The shape every extension collection file and Studio's field editor write.
|
|
295
|
+
expect(facetOptions({ name: 'status', type: 'enum', options: { values: ['draft', 'sent'] } })).toEqual([
|
|
296
|
+
{ value: 'draft', label: 'draft' },
|
|
297
|
+
{ value: 'sent', label: 'sent' },
|
|
298
|
+
]);
|
|
299
|
+
});
|
|
300
|
+
it('facetOptions keeps a choice typed; a multi-value select offers none', () => {
|
|
301
|
+
expect(facetOptions({
|
|
302
|
+
name: 'n',
|
|
303
|
+
type: 'select',
|
|
304
|
+
options: { choices: [1, { value: 2, label: 'Two' }, true] },
|
|
305
|
+
})).toEqual([
|
|
306
|
+
{ value: 1, label: '1' },
|
|
307
|
+
{ value: 2, label: 'Two' },
|
|
308
|
+
{ value: true, label: 'true' },
|
|
309
|
+
]);
|
|
310
|
+
expect(facetOptions({ name: 'm', type: 'select', options: { multiple: true, choices: ['a'] } })).toEqual([]);
|
|
311
|
+
});
|
|
312
|
+
it('facetOptions: choices, or true and false for a boolean; withFacets keeps the view filter', () => {
|
|
313
|
+
expect(facetOptions({
|
|
314
|
+
name: 's',
|
|
315
|
+
type: 'select',
|
|
316
|
+
options: { choices: ['a', { value: 'b', label: 'B' }] },
|
|
317
|
+
})).toEqual([
|
|
318
|
+
{ value: 'a', label: 'a' },
|
|
319
|
+
{ value: 'b', label: 'B' },
|
|
320
|
+
]);
|
|
321
|
+
expect(facetOptions({ name: 'w', type: 'boolean' }).map((o) => o.value)).toEqual([true, false]);
|
|
322
|
+
expect(facetOptions({ name: 't', type: 'text' })).toEqual([]);
|
|
323
|
+
const own = [{ field: 'a', op: 'eq', value: 1 }];
|
|
324
|
+
expect(withFacets(own, { b: 'x', w: false, gone: undefined })).toEqual([
|
|
325
|
+
{ field: 'a', op: 'eq', value: 1 },
|
|
326
|
+
{ field: 'b', op: 'eq', value: 'x' },
|
|
327
|
+
{ field: 'w', op: 'eq', value: false },
|
|
328
|
+
]);
|
|
329
|
+
expect(withFacets(own, { a: 'x' })).toBe(own);
|
|
330
|
+
});
|
|
331
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validate/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validate/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAMH,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAK/D,MAAM,WAAW,eAAe;IAC9B,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,+BAA+B;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,+EAA+E;IAC/E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,oDAAoD;IACpD,KAAK,EAAE;QACL,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAsDD,MAAM,WAAW,uBAAuB;IACtC,+DAA+D;IAC/D,QAAQ,EAAE,OAAO,CAAC;IAClB,0EAA0E;IAC1E,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,uBAAuB,GAAG,eAAe,EAAE,CAgelF;AAID,MAAM,WAAW,uBAAuB;IACtC,wEAAwE;IACxE,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IACrD,iFAAiF;IACjF,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACtC;AAED,wBAAgB,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B;;mEAE+D;IAC/D,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC/B,uBAAuB;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,mBAAmB,GAAG,eAAe,EAAE,CAsGhF;AAsBD;;;;;;;;;;eAUe;AACf,wBAAgB,mBAAmB,CAAC,iBAAiB,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAoBzE;AAID,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,uBAAuB,CAAC;IAClC,QAAQ,EAAE,uBAAuB,CAAC;IAClC,UAAU,EAAE,yBAAyB,CAAC;IACtC,YAAY,EAAE,iBAAiB,CAAC;IAChC,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,qEAAqE;IACrE,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/C;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,gBAAgB,CAkBjF"}
|
package/dist/validate/index.js
CHANGED
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
* - Building the Studio bundle. Too slow; pair with `zveltio extension build`
|
|
24
24
|
* which can call validate as a sub-step.
|
|
25
25
|
*/
|
|
26
|
+
import { z } from 'zod';
|
|
26
27
|
import { parseMigrationSql } from './migration-parse.js';
|
|
27
28
|
export { SHARED_MESSAGE_KEYS } from './shared-message-keys.js';
|
|
28
29
|
/** Headers the engine keeps from a worker-isolated extension unless `forwardCredentials` names them. */
|
|
@@ -140,8 +141,7 @@ export function validateManifest(input) {
|
|
|
140
141
|
}
|
|
141
142
|
}
|
|
142
143
|
// Actions and jobs: the engine's manifest schema refuses the whole extension
|
|
143
|
-
// on any of these
|
|
144
|
-
// that one is left to the engine.
|
|
144
|
+
// on any of these (parity: engine tests/unit/manifest-validate-parity.test.ts).
|
|
145
145
|
const NAME = /^[a-z][a-zA-Z0-9]*$/;
|
|
146
146
|
const strings = (v) => v === undefined || (Array.isArray(v) && v.every((s) => typeof s === 'string'));
|
|
147
147
|
const isObject = (v) => !!v && typeof v === 'object' && !Array.isArray(v);
|
|
@@ -164,6 +164,8 @@ export function validateManifest(input) {
|
|
|
164
164
|
seen.add(e.name);
|
|
165
165
|
if (!isObject(e.input))
|
|
166
166
|
out.push(err(code, `"${e.name}": "input" must be a JSON Schema object`));
|
|
167
|
+
else if (!compileInput(e.input))
|
|
168
|
+
out.push(err(code, `"${e.name}": "input" is not a JSON Schema the engine can compile`));
|
|
167
169
|
for (const k of ['reads', 'writes', 'enqueues', 'calls', 'fromPublicRoutes']) {
|
|
168
170
|
if (!strings(e[k]))
|
|
169
171
|
out.push(err(code, `"${e.name}": "${k}" must be an array of names`));
|
|
@@ -316,8 +318,7 @@ export function validateManifest(input) {
|
|
|
316
318
|
}
|
|
317
319
|
const egress = j.egress;
|
|
318
320
|
const egressOk = egress === undefined ||
|
|
319
|
-
(Array.isArray(egress) &&
|
|
320
|
-
egress.every((e) => typeof e === 'string' && /^[a-z0-9.\-[\]:]+$/.test(e)));
|
|
321
|
+
(Array.isArray(egress) && egress.every((e) => typeof e === 'string' && isEgressEntry(e)));
|
|
321
322
|
if (!egressOk) {
|
|
322
323
|
out.push(err('MANIFEST_BAD_JOB', `job "${j.name}": "egress" lists lower-case host names or host:port, no scheme, path or wildcard`));
|
|
323
324
|
}
|
|
@@ -353,6 +354,18 @@ export function validateManifest(input) {
|
|
|
353
354
|
slotKinds.set(name, kind);
|
|
354
355
|
}
|
|
355
356
|
}
|
|
357
|
+
// ADR 0048 d1: a clock that enqueues the job, five cron fields in UTC, as the engine reads them.
|
|
358
|
+
if (j.schedule !== undefined) {
|
|
359
|
+
if (typeof j.schedule !== 'string' || !cronFires(j.schedule)) {
|
|
360
|
+
out.push(err('MANIFEST_BAD_JOB', `job "${j.name}": schedule "${String(j.schedule)}" is not a five-field cron expression that fires (minute hour day-of-month month day-of-week; *, n, a-b, a,b and /step; in UTC)`));
|
|
361
|
+
}
|
|
362
|
+
else if (!(Array.isArray(obj.permissions) && obj.permissions.includes('data:system'))) {
|
|
363
|
+
out.push(err('MANIFEST_BAD_JOB', `job "${j.name}": a scheduled job runs with no caller, which needs the data:system capability`));
|
|
364
|
+
}
|
|
365
|
+
else if (compileInput(j.input)?.safeParse({}).success === false) {
|
|
366
|
+
out.push(err('MANIFEST_BAD_JOB', `job "${j.name}": a scheduled job is enqueued with input {}, which its input schema must accept`));
|
|
367
|
+
}
|
|
368
|
+
}
|
|
356
369
|
const hasEgress = (Array.isArray(egress) && egress.length > 0) || (Array.isArray(slots) && slots.length > 0);
|
|
357
370
|
if (!int(j.timeoutSeconds, 1, hasEgress ? 900 : 60)) {
|
|
358
371
|
out.push(err('MANIFEST_BAD_JOB', `job "${j.name}": "timeoutSeconds" is an integer, 1-${hasEgress ? 900 : 60} (above 60 needs egress)`));
|
|
@@ -531,8 +544,84 @@ function columnLevelUniqueColumns(sql) {
|
|
|
531
544
|
}
|
|
532
545
|
return out;
|
|
533
546
|
}
|
|
547
|
+
/**
|
|
548
|
+
* The SQL that runs: comments become a space and every string literal `''`, in
|
|
549
|
+
* one left-to-right pass. Chained regexes get the order wrong (`'--'` opens a
|
|
550
|
+
* "comment", a quote inside a block comment a "string") and miss `E'\''`, so a quoted `DROP COLUMN tenant_id` read as a real one.
|
|
551
|
+
* Quoted identifiers stay; a `$$…$$` body is scanned on its own (`DO $$ … $$` runs).
|
|
552
|
+
*/
|
|
553
|
+
// PostgreSQL's dolq_start / dolq_cont: ASCII letters, `_`, digits after the
|
|
554
|
+
// first, and any non-ASCII character.
|
|
555
|
+
const DOLLAR_TAG = /^\$(?:[A-Za-z_\u0080-\u{10FFFF}][A-Za-z0-9_\u0080-\u{10FFFF}]*)?\$/u;
|
|
556
|
+
function sqlCode(sql) {
|
|
557
|
+
let out = '';
|
|
558
|
+
let i = 0;
|
|
559
|
+
while (i < sql.length) {
|
|
560
|
+
const c = sql[i];
|
|
561
|
+
const dollar = c === '$' && !/[\w$]/.test(sql[i - 1] ?? '') && DOLLAR_TAG.exec(sql.slice(i));
|
|
562
|
+
if (dollar) {
|
|
563
|
+
// A `$$…$$` body may run (`DO $$ … $$`), so it is scanned on its own: a
|
|
564
|
+
// quote or `--` inside it must not swallow the SQL around it.
|
|
565
|
+
const tag = dollar[0];
|
|
566
|
+
const end = sql.indexOf(tag, i + tag.length);
|
|
567
|
+
const stop = end < 0 ? sql.length : end;
|
|
568
|
+
out += ` ${sqlCode(sql.slice(i + tag.length, stop))} `;
|
|
569
|
+
i = end < 0 ? sql.length : end + tag.length;
|
|
570
|
+
}
|
|
571
|
+
else if (sql.startsWith('--', i)) {
|
|
572
|
+
const end = sql.indexOf('\n', i);
|
|
573
|
+
i = end < 0 ? sql.length : end;
|
|
574
|
+
out += ' ';
|
|
575
|
+
}
|
|
576
|
+
else if (sql.startsWith('/*', i)) {
|
|
577
|
+
let depth = 1;
|
|
578
|
+
i += 2;
|
|
579
|
+
while (i < sql.length && depth > 0) {
|
|
580
|
+
if (sql.startsWith('/*', i)) {
|
|
581
|
+
depth++;
|
|
582
|
+
i += 2;
|
|
583
|
+
}
|
|
584
|
+
else if (sql.startsWith('*/', i)) {
|
|
585
|
+
depth--;
|
|
586
|
+
i += 2;
|
|
587
|
+
}
|
|
588
|
+
else
|
|
589
|
+
i++;
|
|
590
|
+
}
|
|
591
|
+
out += ' ';
|
|
592
|
+
}
|
|
593
|
+
else if (c === "'" ||
|
|
594
|
+
((c === 'E' || c === 'e') && sql[i + 1] === "'" && !/\w/.test(sql[i - 1] ?? ''))) {
|
|
595
|
+
const escapes = c !== "'";
|
|
596
|
+
i += escapes ? 2 : 1;
|
|
597
|
+
while (i < sql.length) {
|
|
598
|
+
if (escapes && sql[i] === '\\')
|
|
599
|
+
i += 2;
|
|
600
|
+
else if (sql[i] === "'" && sql[i + 1] === "'")
|
|
601
|
+
i += 2;
|
|
602
|
+
else if (sql[i] === "'")
|
|
603
|
+
break;
|
|
604
|
+
else
|
|
605
|
+
i++;
|
|
606
|
+
}
|
|
607
|
+
i++;
|
|
608
|
+
out += "''";
|
|
609
|
+
}
|
|
610
|
+
else if (c === '"') {
|
|
611
|
+
const end = sql.indexOf('"', i + 1);
|
|
612
|
+
const stop = end < 0 ? sql.length : end + 1;
|
|
613
|
+
out += sql.slice(i, stop);
|
|
614
|
+
i = stop;
|
|
615
|
+
}
|
|
616
|
+
else {
|
|
617
|
+
out += c;
|
|
618
|
+
i++;
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
return out;
|
|
622
|
+
}
|
|
534
623
|
function keyColumnSets(upSql) {
|
|
535
|
-
const s = upSql
|
|
624
|
+
const s = sqlCode(upSql);
|
|
536
625
|
const sets = [];
|
|
537
626
|
const add = (cols, table) => {
|
|
538
627
|
const key = cols
|
|
@@ -567,7 +656,9 @@ const bareTable = (t) => t.replace(/"/g, '').split('.').pop().toLowerCase();
|
|
|
567
656
|
* 004): a key on it is instance-wide and needs no tenant column.
|
|
568
657
|
*/
|
|
569
658
|
function tenantColumnChanges(upSql) {
|
|
570
|
-
|
|
659
|
+
// A drop that is commented out or quoted (`COMMENT ON TABLE … IS '… DROP
|
|
660
|
+
// COLUMN tenant_id'`) takes nothing out of tenancy.
|
|
661
|
+
const s = sqlCode(upSql);
|
|
571
662
|
const out = [];
|
|
572
663
|
for (const m of s.matchAll(/ALTER\s+TABLE\s+(?:IF\s+EXISTS\s+)?(?:ONLY\s+)?([\w."]+)\s[^;]*?\b(ADD|DROP)\s+COLUMN\s+(?:IF\s+(?:NOT\s+)?EXISTS\s+)?"?tenant_id"?\b/gi))
|
|
573
664
|
out.push([bareTable(m[1]), m[2].toUpperCase() === 'DROP']);
|
|
@@ -889,6 +980,12 @@ export function validateSduiSchema(input) {
|
|
|
889
980
|
collectEndpoints(schema, endpoints);
|
|
890
981
|
for (const raw of endpoints) {
|
|
891
982
|
const bare = raw.split('?')[0];
|
|
983
|
+
// A browser resolves `.` and `..` before it sends the request, so
|
|
984
|
+
// `/ext/dep/../../api/admin/users` is a call to `/api/admin/users`.
|
|
985
|
+
if (/(?:^|\/)(?:\.|%2e){1,2}(?:\/|$)/i.test(raw.split(/[?#]/)[0])) {
|
|
986
|
+
out.push(err('SDUI_ENDPOINT_DOT_SEGMENT', `endpoint "${raw}" has a "." or ".." path segment, which a browser resolves to another path. Name the route itself.`, file));
|
|
987
|
+
continue;
|
|
988
|
+
}
|
|
892
989
|
if (SDUI_SHARED_READ_ALLOWLIST.has(bare))
|
|
893
990
|
continue;
|
|
894
991
|
// A dependency's namespace is allowed (relation pickers etc.).
|
|
@@ -1007,3 +1104,78 @@ export function validateExtension(input) {
|
|
|
1007
1104
|
},
|
|
1008
1105
|
};
|
|
1009
1106
|
}
|
|
1107
|
+
/** The engine's `inputSchemaIssue`: the compiled schema, or null when Zod cannot compile it. */
|
|
1108
|
+
function compileInput(input) {
|
|
1109
|
+
if (!input || typeof input !== 'object' || Array.isArray(input))
|
|
1110
|
+
return null;
|
|
1111
|
+
try {
|
|
1112
|
+
return z.fromJSONSchema(input);
|
|
1113
|
+
}
|
|
1114
|
+
catch {
|
|
1115
|
+
return null;
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
/**
|
|
1119
|
+
* The engine's `parseEgress`: a host or host:port, written the way the URL
|
|
1120
|
+
* parser writes it back, or it could never match a request.
|
|
1121
|
+
*/
|
|
1122
|
+
function isEgressEntry(e) {
|
|
1123
|
+
if (!/^(\[[0-9a-f:.]+\]|[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*)(:\d{1,5})?$/.test(e))
|
|
1124
|
+
return false;
|
|
1125
|
+
try {
|
|
1126
|
+
return new URL(`http://${e}`).hostname === e.replace(/:\d{1,5}$/, '');
|
|
1127
|
+
}
|
|
1128
|
+
catch {
|
|
1129
|
+
return false;
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
/** One cron field as the set it matches (the engine's `parseField`), or null. */
|
|
1133
|
+
function cronField(raw, min, max) {
|
|
1134
|
+
const out = new Set();
|
|
1135
|
+
for (const part of raw.split(',')) {
|
|
1136
|
+
const m = /^(\*|(\d+)(?:-(\d+))?)(?:\/(\d+))?$/.exec(part);
|
|
1137
|
+
if (!m)
|
|
1138
|
+
return null;
|
|
1139
|
+
const step = m[4] === undefined ? 1 : Number(m[4]);
|
|
1140
|
+
const lo = m[2] === undefined ? min : Number(m[2]);
|
|
1141
|
+
// A bare number with a step runs to the end of the range.
|
|
1142
|
+
const hi = m[3] !== undefined ? Number(m[3]) : m[2] === undefined || m[4] ? max : lo;
|
|
1143
|
+
if (step < 1 || lo < min || hi > max || lo > hi)
|
|
1144
|
+
return null;
|
|
1145
|
+
for (let v = lo; v <= hi; v += step)
|
|
1146
|
+
out.add(v);
|
|
1147
|
+
}
|
|
1148
|
+
return out;
|
|
1149
|
+
}
|
|
1150
|
+
/**
|
|
1151
|
+
* Five cron fields that fire within four years, as the engine's `nextCronRun`
|
|
1152
|
+
* reads them: day-of-month and day-of-week OR when both are restricted (do not
|
|
1153
|
+
* start with `*`), AND otherwise; 7 is Sunday.
|
|
1154
|
+
*/
|
|
1155
|
+
function cronFires(expr) {
|
|
1156
|
+
const p = expr.trim().split(/\s+/);
|
|
1157
|
+
if (p.length !== 5)
|
|
1158
|
+
return false;
|
|
1159
|
+
const [minute, hour, dom, month, dow] = [
|
|
1160
|
+
[0, 59],
|
|
1161
|
+
[0, 23],
|
|
1162
|
+
[1, 31],
|
|
1163
|
+
[1, 12],
|
|
1164
|
+
[0, 7],
|
|
1165
|
+
].map(([lo, hi], i) => cronField(p[i], lo, hi));
|
|
1166
|
+
if (!minute || !hour || !dom || !month || !dow)
|
|
1167
|
+
return false;
|
|
1168
|
+
if (dow.delete(7))
|
|
1169
|
+
dow.add(0);
|
|
1170
|
+
const either = !p[2].startsWith('*') && !p[4].startsWith('*');
|
|
1171
|
+
const day = new Date();
|
|
1172
|
+
for (let i = 0; i < 366 * 4; i++, day.setUTCDate(day.getUTCDate() + 1)) {
|
|
1173
|
+
if (!month.has(day.getUTCMonth() + 1))
|
|
1174
|
+
continue;
|
|
1175
|
+
const d = dom.has(day.getUTCDate());
|
|
1176
|
+
const w = dow.has(day.getUTCDay());
|
|
1177
|
+
if (either ? d || w : d && w)
|
|
1178
|
+
return true;
|
|
1179
|
+
}
|
|
1180
|
+
return false;
|
|
1181
|
+
}
|
package/dist/view/index.d.ts
CHANGED
|
@@ -60,6 +60,9 @@ export type ActionOutcome = {
|
|
|
60
60
|
} | {
|
|
61
61
|
kind: 'reveal';
|
|
62
62
|
value: string;
|
|
63
|
+
} | {
|
|
64
|
+
kind: 'redirect';
|
|
65
|
+
url: string;
|
|
63
66
|
} | {
|
|
64
67
|
kind: 'values';
|
|
65
68
|
values: unknown;
|
|
@@ -85,6 +88,12 @@ export interface ViewNames {
|
|
|
85
88
|
* checked. Omit to skip.
|
|
86
89
|
*/
|
|
87
90
|
fields?: ReadonlyMap<string, Iterable<string>>;
|
|
91
|
+
/**
|
|
92
|
+
* Each declared collection's fields a list may use as a `facets` entry: a
|
|
93
|
+
* boolean, or one with declared choices. A collection absent here is not
|
|
94
|
+
* checked. Omit to skip.
|
|
95
|
+
*/
|
|
96
|
+
facetFields?: ReadonlyMap<string, Iterable<string>>;
|
|
88
97
|
}
|
|
89
98
|
/**
|
|
90
99
|
* What the schema cannot see in a (valid) view: a collection or action its
|
|
@@ -93,6 +102,13 @@ export interface ViewNames {
|
|
|
93
102
|
* the extension does not ship, a field its collection does not have. (`fallback` is an inline view, not a reference.)
|
|
94
103
|
*/
|
|
95
104
|
export declare function viewNameIssues(view: unknown, names: ViewNames): ViewIssue[];
|
|
105
|
+
/**
|
|
106
|
+
* A `pick` names an input the action declares as a plain string (the record's
|
|
107
|
+
* id is a string): not a number, a list, an object or a fixed set of choices.
|
|
108
|
+
* `inputs`: each own action's declared input JSON Schema, by name; an action
|
|
109
|
+
* absent from it (a dependency's, or one with no schema) is not checked.
|
|
110
|
+
*/
|
|
111
|
+
export declare function pickIssues(view: unknown, inputs: ReadonlyMap<string, unknown>): ViewIssue[];
|
|
96
112
|
type Kind = View['type'];
|
|
97
113
|
type Of<K extends Kind> = Extract<View, {
|
|
98
114
|
type: K;
|
|
@@ -133,6 +149,7 @@ export declare const view: {
|
|
|
133
149
|
actions?: import("./types.generated.js").Buttons;
|
|
134
150
|
fallback?: View;
|
|
135
151
|
action: import("./types.generated.js").ActionName;
|
|
152
|
+
pick?: Record<string, import("./types.generated.js").Name>;
|
|
136
153
|
fields?: import("./types.generated.js").Fields;
|
|
137
154
|
sections?: Array<{
|
|
138
155
|
title?: import("./types.generated.js").Text;
|
package/dist/view/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/view/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAe,SAAS,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EAAgB,SAAS,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9F,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACrD,cAAc,cAAc,CAAC;AAC7B,mBAAmB,sBAAsB,CAAC;AAE1C,+EAA+E;AAC/E,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG;IAAE,IAAI,EAAE,OAAO,SAAS,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1E,MAAM,WAAW,SAAS;IACxB,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,cAAc,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,YAAY,CAAA;CAAE,GAAG;IAAE,EAAE,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