@zveltio/sdk 3.0.0-beta.108 → 3.0.0-beta.113
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 +12 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +9 -2
- package/dist/core.d.ts +2 -5
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +1 -4
- package/dist/ddl/index.d.ts +0 -4
- package/dist/ddl/index.d.ts.map +1 -1
- package/dist/extension/capabilities.d.ts +0 -2
- package/dist/extension/capabilities.d.ts.map +1 -1
- package/dist/extension/capabilities.js +0 -2
- package/dist/extension/index.d.ts +211 -30
- package/dist/extension/index.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/realtime.d.ts +17 -1
- package/dist/realtime.d.ts.map +1 -1
- package/dist/realtime.js +5 -4
- package/dist/sync-manager.js +4 -4
- package/dist/tests/client.test.js +10 -0
- package/dist/tests/sync-manager.test.js +11 -3
- package/dist/tests/validate-manifest-actions.test.js +10 -0
- package/dist/tests/validate-manifest-routes.test.d.ts +2 -0
- package/dist/tests/validate-manifest-routes.test.d.ts.map +1 -0
- package/dist/tests/validate-manifest-routes.test.js +76 -0
- package/dist/tests/view-runtime.test.d.ts +2 -0
- package/dist/tests/view-runtime.test.d.ts.map +1 -0
- package/dist/tests/view-runtime.test.js +158 -0
- package/dist/tests/view.test.d.ts +2 -0
- package/dist/tests/view.test.d.ts.map +1 -0
- package/dist/tests/view.test.js +200 -0
- package/dist/validate/index.d.ts.map +1 -1
- package/dist/validate/index.js +94 -8
- package/dist/view/index.d.ts +172 -0
- package/dist/view/index.d.ts.map +1 -0
- package/dist/view/index.js +367 -0
- package/dist/view/runtime.d.ts +71 -0
- package/dist/view/runtime.d.ts.map +1 -0
- package/dist/view/runtime.js +185 -0
- package/dist/view/schema.d.ts +20 -0
- package/dist/view/schema.d.ts.map +1 -0
- package/dist/view/schema.js +357 -0
- package/dist/view/types.generated.d.ts +318 -0
- package/dist/view/types.generated.d.ts.map +1 -0
- package/dist/view/types.generated.js +2 -0
- package/package.json +7 -1
- package/schemas/view-2.schema.json +2047 -0
package/dist/validate/index.js
CHANGED
|
@@ -62,6 +62,8 @@ const KNOWN_CATEGORIES = new Set([
|
|
|
62
62
|
// rejected at install time.
|
|
63
63
|
const SAFE_PACKAGE_NAME = /^(@[a-z0-9-_]+\/)?[a-z0-9-_.]+$/;
|
|
64
64
|
const SAFE_VERSION_RANGE = /^[\d.*^~>=<| -]+$/;
|
|
65
|
+
/** ADR 0039: one route, `/` or literal and `:param` segments (the engine's `ROUTE_PATH`). */
|
|
66
|
+
const ROUTE_PATH = /^\/$|^(\/([A-Za-z0-9._~-]+|:[A-Za-z_][A-Za-z0-9_]*))+$/;
|
|
65
67
|
function err(code, message, file) {
|
|
66
68
|
return file ? { code, message, file } : { code, message };
|
|
67
69
|
}
|
|
@@ -169,6 +171,67 @@ export function validateManifest(input) {
|
|
|
169
171
|
return true;
|
|
170
172
|
});
|
|
171
173
|
};
|
|
174
|
+
// Declared routes (ADR 0039), as the engine's manifest schema takes them.
|
|
175
|
+
const declaredRoutes = Array.isArray(obj.routes) ? obj.routes : [];
|
|
176
|
+
if (obj.routes !== undefined && !Array.isArray(obj.routes)) {
|
|
177
|
+
out.push(err('MANIFEST_BAD_ROUTE', '"routes" must be an array'));
|
|
178
|
+
}
|
|
179
|
+
const seenRoutes = new Set();
|
|
180
|
+
declaredRoutes.forEach((r, i) => {
|
|
181
|
+
const ok = isObject(r) &&
|
|
182
|
+
Object.keys(r).every((k) => ['method', 'path', 'access', 'handler'].includes(k)) &&
|
|
183
|
+
['GET', 'POST', 'PUT', 'PATCH', 'DELETE'].includes(r.method) &&
|
|
184
|
+
typeof r.path === 'string' &&
|
|
185
|
+
ROUTE_PATH.test(r.path) &&
|
|
186
|
+
!(r.path === '/actions' || r.path.startsWith('/actions/')) &&
|
|
187
|
+
(r.access === 'public' || r.access === 'caller') &&
|
|
188
|
+
typeof r.handler === 'string' &&
|
|
189
|
+
NAME.test(r.handler);
|
|
190
|
+
if (!ok) {
|
|
191
|
+
out.push(err('MANIFEST_BAD_ROUTE', `routes[${i}] needs method (GET|POST|PUT|PATCH|DELETE), a path of literal and :param segments outside /actions, access (public|caller) and a camelCase handler`));
|
|
192
|
+
}
|
|
193
|
+
else if (seenRoutes.has(`${r.method} ${r.path}`)) {
|
|
194
|
+
out.push(err('MANIFEST_BAD_ROUTE', `route ${r.method} ${r.path} is declared twice`));
|
|
195
|
+
}
|
|
196
|
+
if (isObject(r))
|
|
197
|
+
seenRoutes.add(`${r.method} ${r.path}`);
|
|
198
|
+
});
|
|
199
|
+
// Sign-in providers (ADR 0039 decision 8), each started by a declared public
|
|
200
|
+
// route: `POST` for `credentials`, `GET` for `redirect`, without parameters.
|
|
201
|
+
if (obj.signInProviders !== undefined && !Array.isArray(obj.signInProviders)) {
|
|
202
|
+
out.push(err('MANIFEST_BAD_SIGN_IN_PROVIDER', '"signInProviders" must be an array'));
|
|
203
|
+
}
|
|
204
|
+
const providerIds = new Set();
|
|
205
|
+
(Array.isArray(obj.signInProviders) ? obj.signInProviders : []).forEach((p, i) => {
|
|
206
|
+
const method = isObject(p) && p.kind === 'credentials' ? 'POST' : 'GET';
|
|
207
|
+
const ok = isObject(p) &&
|
|
208
|
+
Object.keys(p).every((k) => ['id', 'label', 'kind', 'route'].includes(k)) &&
|
|
209
|
+
typeof p.id === 'string' &&
|
|
210
|
+
/^[a-z][a-z0-9-]{0,63}$/.test(p.id) &&
|
|
211
|
+
typeof p.label === 'string' &&
|
|
212
|
+
p.label.length > 0 &&
|
|
213
|
+
p.label.length <= 100 &&
|
|
214
|
+
(p.kind === 'credentials' || p.kind === 'redirect') &&
|
|
215
|
+
declaredRoutes.some((r) => isObject(r) &&
|
|
216
|
+
r.method === method &&
|
|
217
|
+
r.path === p.route &&
|
|
218
|
+
r.access === 'public' &&
|
|
219
|
+
!String(p.route).includes(':'));
|
|
220
|
+
if (!ok) {
|
|
221
|
+
out.push(err('MANIFEST_BAD_SIGN_IN_PROVIDER', `signInProviders[${i}] needs an id, a label, kind (credentials|redirect) and the route of a declared public route without parameters that starts it (POST for credentials, GET for redirect)`));
|
|
222
|
+
}
|
|
223
|
+
else if (providerIds.has(p.id)) {
|
|
224
|
+
out.push(err('MANIFEST_BAD_SIGN_IN_PROVIDER', `sign-in provider "${p.id}" is declared twice`));
|
|
225
|
+
}
|
|
226
|
+
if (isObject(p) && typeof p.id === 'string')
|
|
227
|
+
providerIds.add(p.id);
|
|
228
|
+
});
|
|
229
|
+
// `publicRoutes` (deprecated) and the declared public routes: what a job or
|
|
230
|
+
// `forwardCredentials` may name.
|
|
231
|
+
const publicPaths = [
|
|
232
|
+
...(Array.isArray(obj.publicRoutes) ? obj.publicRoutes : []),
|
|
233
|
+
...declaredRoutes.filter((r) => isObject(r) && r.access === 'public').map((r) => r.path),
|
|
234
|
+
];
|
|
172
235
|
// Declared collections (ADR 0012): names; the CLI checks each one's schema file.
|
|
173
236
|
if (obj.collections !== undefined) {
|
|
174
237
|
const names = Array.isArray(obj.collections) ? obj.collections : [];
|
|
@@ -214,14 +277,15 @@ export function validateManifest(input) {
|
|
|
214
277
|
}
|
|
215
278
|
}
|
|
216
279
|
}
|
|
280
|
+
// One binding per slot name serves every job: so is its kind.
|
|
281
|
+
const slotKinds = new Map();
|
|
217
282
|
for (const j of jobs) {
|
|
218
283
|
// ADR 0018: a route that enqueues it is one the manifest declares public.
|
|
219
|
-
const publicRoutes = Array.isArray(obj.publicRoutes) ? obj.publicRoutes : [];
|
|
220
284
|
for (const route of Array.isArray(j.fromPublicRoutes) ? j.fromPublicRoutes : []) {
|
|
221
285
|
if (typeof route === 'string' && route.includes('*')) {
|
|
222
286
|
out.push(err('MANIFEST_BAD_JOB', `job "${j.name}" names "${route}" in fromPublicRoutes; name one route, without "*"`));
|
|
223
287
|
}
|
|
224
|
-
else if (!
|
|
288
|
+
else if (!publicPaths.includes(route)) {
|
|
225
289
|
out.push(err('MANIFEST_BAD_JOB', `job "${j.name}" names "${route}" in fromPublicRoutes, which is not a publicRoutes entry`));
|
|
226
290
|
}
|
|
227
291
|
}
|
|
@@ -246,14 +310,37 @@ export function validateManifest(input) {
|
|
|
246
310
|
if (!egressOk) {
|
|
247
311
|
out.push(err('MANIFEST_BAD_JOB', `job "${j.name}": "egress" lists lower-case host names or host:port, no scheme, path or wildcard`));
|
|
248
312
|
}
|
|
249
|
-
// ADR 0026: slots an operator binds; the manifest names only the slot.
|
|
313
|
+
// ADR 0026: slots an operator binds; the manifest names only the slot. An
|
|
314
|
+
// entry is a name (an HTTP slot) or { name, kind: "http" | "tcp" }.
|
|
250
315
|
const slots = j.egressSlots;
|
|
316
|
+
const slotName = (s) => {
|
|
317
|
+
if (typeof s === 'string')
|
|
318
|
+
return s;
|
|
319
|
+
if (s === null || typeof s !== 'object' || Array.isArray(s))
|
|
320
|
+
return null;
|
|
321
|
+
const o = s;
|
|
322
|
+
const keysOk = Object.keys(o).every((k) => k === 'name' || k === 'kind');
|
|
323
|
+
const kindOk = o.kind === undefined || o.kind === 'http' || o.kind === 'tcp';
|
|
324
|
+
return keysOk && kindOk && typeof o.name === 'string' ? o.name : null;
|
|
325
|
+
};
|
|
326
|
+
const names = Array.isArray(slots) ? slots.map(slotName) : [];
|
|
251
327
|
const slotsOk = slots === undefined ||
|
|
252
328
|
(Array.isArray(slots) &&
|
|
253
|
-
new Set(
|
|
254
|
-
|
|
329
|
+
new Set(names).size === names.length &&
|
|
330
|
+
names.every((n) => n !== null && /^[a-z][a-z0-9_]*$/.test(n)));
|
|
255
331
|
if (!slotsOk) {
|
|
256
|
-
out.push(err('MANIFEST_BAD_JOB', `job "${j.name}": "egressSlots" lists distinct
|
|
332
|
+
out.push(err('MANIFEST_BAD_JOB', `job "${j.name}": "egressSlots" lists distinct slots, each a name [a-z][a-z0-9_]* or { name, kind: "http" | "tcp" }`));
|
|
333
|
+
}
|
|
334
|
+
else {
|
|
335
|
+
for (const s of (slots ?? [])) {
|
|
336
|
+
const name = slotName(s);
|
|
337
|
+
const kind = typeof s === 'string' ? 'http' : (s.kind ?? 'http');
|
|
338
|
+
const seen = slotKinds.get(name);
|
|
339
|
+
if (seen !== undefined && seen !== kind) {
|
|
340
|
+
out.push(err('MANIFEST_BAD_JOB', `job "${j.name}": slot "${name}" is declared both "${seen}" and "${kind}"`));
|
|
341
|
+
}
|
|
342
|
+
slotKinds.set(name, kind);
|
|
343
|
+
}
|
|
257
344
|
}
|
|
258
345
|
const hasEgress = (Array.isArray(egress) && egress.length > 0) || (Array.isArray(slots) && slots.length > 0);
|
|
259
346
|
if (!int(j.timeoutSeconds, 1, hasEgress ? 900 : 60)) {
|
|
@@ -263,13 +350,12 @@ export function validateManifest(input) {
|
|
|
263
350
|
// The host strips these from a worker's request; a public route may ask for some back.
|
|
264
351
|
if (obj.forwardCredentials !== undefined) {
|
|
265
352
|
const fwd = obj.forwardCredentials;
|
|
266
|
-
const publicRoutes = Array.isArray(obj.publicRoutes) ? obj.publicRoutes : [];
|
|
267
353
|
if (!fwd || typeof fwd !== 'object' || Array.isArray(fwd)) {
|
|
268
354
|
out.push(err('MANIFEST_BAD_FORWARD_CREDENTIALS', '"forwardCredentials" must map a route to headers'));
|
|
269
355
|
}
|
|
270
356
|
else {
|
|
271
357
|
for (const [route, names] of Object.entries(fwd)) {
|
|
272
|
-
if (!
|
|
358
|
+
if (!publicPaths.includes(route)) {
|
|
273
359
|
out.push(err('MANIFEST_BAD_FORWARD_CREDENTIALS', `forwardCredentials names "${route}", which is not a publicRoutes entry`));
|
|
274
360
|
}
|
|
275
361
|
if (!Array.isArray(names)) {
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@zveltio/sdk/view` — the `zveltio.view/2` specification (ADR 0042).
|
|
3
|
+
*
|
|
4
|
+
* - `VIEW_SCHEMA`: the JSON Schema (also published as
|
|
5
|
+
* `@zveltio/sdk/view/schema.json`), the single source of the types below.
|
|
6
|
+
* - `validateView`: what `zveltio extension validate` and `pack` run; the
|
|
7
|
+
* engine checks the same schema when it loads an extension.
|
|
8
|
+
* - `viewNameIssues`: a view names only its extension's collections and
|
|
9
|
+
* actions, and a dependency's action.
|
|
10
|
+
* - `view`, `$`: a typed builder that emits the JSON.
|
|
11
|
+
* - `readActionResult`: an action's result, checked against `ActionResult`.
|
|
12
|
+
* - `resolveValue`, `toFilter`, `matches`, `defaultView`, ...: what every
|
|
13
|
+
* renderer does the same way (`runtime.ts`).
|
|
14
|
+
*
|
|
15
|
+
* Dependency-free: the validator interprets the subset of JSON Schema that
|
|
16
|
+
* `VIEW_SCHEMA` uses, so a front end can validate in the browser.
|
|
17
|
+
*/
|
|
18
|
+
import { VIEW_SPEC } from './schema.js';
|
|
19
|
+
import type { Condition, Ref, Value, View, ViewId } from './types.generated.js';
|
|
20
|
+
export { VIEW_SCHEMA, VIEW_SPEC } from './schema.js';
|
|
21
|
+
export * from './runtime.js';
|
|
22
|
+
export type * from './types.generated.js';
|
|
23
|
+
/** A view file: a view with `spec` set at its top, and its `id` a `ViewId`. */
|
|
24
|
+
export type ViewDocument = View & {
|
|
25
|
+
spec: typeof VIEW_SPEC;
|
|
26
|
+
id?: ViewId;
|
|
27
|
+
};
|
|
28
|
+
export interface ViewIssue {
|
|
29
|
+
/** JSON Pointer to the offending value, `''` for the document. */
|
|
30
|
+
path: string;
|
|
31
|
+
message: string;
|
|
32
|
+
}
|
|
33
|
+
export type ViewValidation = {
|
|
34
|
+
ok: true;
|
|
35
|
+
view: ViewDocument;
|
|
36
|
+
} | {
|
|
37
|
+
ok: false;
|
|
38
|
+
issues: ViewIssue[];
|
|
39
|
+
};
|
|
40
|
+
/** A `view/2` file declares itself; anything else (a `view/1` schema) is not one. */
|
|
41
|
+
export declare function isViewDocument(input: unknown): boolean;
|
|
42
|
+
export declare function validateView(input: unknown): ViewValidation;
|
|
43
|
+
/**
|
|
44
|
+
* How a front end reads an action's `result` (`ActionResult`, ADR 0042
|
|
45
|
+
* decision 4): `{ view: "<id>", params? }` opens that view, `{ view: {...} }`
|
|
46
|
+
* draws it, `{ file }` hands over a stored file, `{ reveal }` shows a value
|
|
47
|
+
* once, anything else is values. An object with `view`, `file` or `reveal` that
|
|
48
|
+
* is none of those forms is `invalid`: a front end shows an error, never guesses.
|
|
49
|
+
*/
|
|
50
|
+
export type ActionOutcome = {
|
|
51
|
+
kind: 'navigate';
|
|
52
|
+
view: ViewId;
|
|
53
|
+
params: Record<string, unknown>;
|
|
54
|
+
} | {
|
|
55
|
+
kind: 'view';
|
|
56
|
+
view: View;
|
|
57
|
+
} | {
|
|
58
|
+
kind: 'file';
|
|
59
|
+
file: string;
|
|
60
|
+
} | {
|
|
61
|
+
kind: 'reveal';
|
|
62
|
+
value: string;
|
|
63
|
+
} | {
|
|
64
|
+
kind: 'values';
|
|
65
|
+
values: unknown;
|
|
66
|
+
} | {
|
|
67
|
+
kind: 'invalid';
|
|
68
|
+
issues: ViewIssue[];
|
|
69
|
+
};
|
|
70
|
+
export declare function readActionResult(result: unknown): ActionOutcome;
|
|
71
|
+
export interface ViewNames {
|
|
72
|
+
/** The collections the extension declares (manifest `collections`). */
|
|
73
|
+
collections: Iterable<string>;
|
|
74
|
+
/** The extension's own action names (manifest `actions[].name`). */
|
|
75
|
+
actions: Iterable<string>;
|
|
76
|
+
/** Its `dependencies` and `optionalDependencies`: their actions are `<dep>.<action>`. */
|
|
77
|
+
dependencies?: Iterable<string>;
|
|
78
|
+
/** The `id`s of the extension's view files; `navigate` and `open` name one. Omit to skip. */
|
|
79
|
+
views?: Iterable<string>;
|
|
80
|
+
/** The message keys a `Text` may name (its own `en.json` and the shared ones). Omit to skip. */
|
|
81
|
+
messageKeys?: Iterable<string>;
|
|
82
|
+
/**
|
|
83
|
+
* Each declared collection's field names, system columns included: a view
|
|
84
|
+
* bound to one of them may name only these. A collection absent here is not
|
|
85
|
+
* checked. Omit to skip.
|
|
86
|
+
*/
|
|
87
|
+
fields?: ReadonlyMap<string, Iterable<string>>;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* What the schema cannot see in a (valid) view: a collection or action its
|
|
91
|
+
* extension does not own, a `$selected` that names no earlier pane, a pane id
|
|
92
|
+
* used twice, a `navigate`/`open` to no view of the extension, a message key
|
|
93
|
+
* the extension does not ship, a field its collection does not have. (`fallback` is an inline view, not a reference.)
|
|
94
|
+
*/
|
|
95
|
+
export declare function viewNameIssues(view: unknown, names: ViewNames): ViewIssue[];
|
|
96
|
+
type Kind = View['type'];
|
|
97
|
+
type Of<K extends Kind> = Extract<View, {
|
|
98
|
+
type: K;
|
|
99
|
+
}>;
|
|
100
|
+
/**
|
|
101
|
+
* Typed constructors: `view.list({ collection: 'invoices', fields: ['number'] })`.
|
|
102
|
+
* `view.document(v)` stamps `spec` on the top-level view; `JSON.stringify` it
|
|
103
|
+
* into the file the manifest names.
|
|
104
|
+
*/
|
|
105
|
+
export declare const view: {
|
|
106
|
+
list: (props: Omit<import("./types.generated.js").ListView, "type">) => import("./types.generated.js").ListView;
|
|
107
|
+
form: (props: Omit<{
|
|
108
|
+
type: "form";
|
|
109
|
+
id?: import("./types.generated.js").PaneId;
|
|
110
|
+
title?: import("./types.generated.js").Text;
|
|
111
|
+
actions?: import("./types.generated.js").Buttons;
|
|
112
|
+
fallback?: View;
|
|
113
|
+
collection: import("./types.generated.js").Name;
|
|
114
|
+
record?: Ref | "singleton";
|
|
115
|
+
fields?: import("./types.generated.js").Fields;
|
|
116
|
+
sections?: Array<{
|
|
117
|
+
title?: import("./types.generated.js").Text;
|
|
118
|
+
fields: import("./types.generated.js").Fields;
|
|
119
|
+
}>;
|
|
120
|
+
lines?: {
|
|
121
|
+
collection: import("./types.generated.js").Name;
|
|
122
|
+
fk: import("./types.generated.js").Name;
|
|
123
|
+
fields?: import("./types.generated.js").Fields;
|
|
124
|
+
order?: import("./types.generated.js").Name;
|
|
125
|
+
};
|
|
126
|
+
submit?: import("./types.generated.js").Buttons;
|
|
127
|
+
recalc?: import("./types.generated.js").ActionCall;
|
|
128
|
+
autosave?: boolean;
|
|
129
|
+
}, "type"> | Omit<{
|
|
130
|
+
type: "form";
|
|
131
|
+
id?: import("./types.generated.js").PaneId;
|
|
132
|
+
title?: import("./types.generated.js").Text;
|
|
133
|
+
actions?: import("./types.generated.js").Buttons;
|
|
134
|
+
fallback?: View;
|
|
135
|
+
action: import("./types.generated.js").ActionName;
|
|
136
|
+
fields?: import("./types.generated.js").Fields;
|
|
137
|
+
sections?: Array<{
|
|
138
|
+
title?: import("./types.generated.js").Text;
|
|
139
|
+
fields: import("./types.generated.js").Fields;
|
|
140
|
+
}>;
|
|
141
|
+
lines?: {
|
|
142
|
+
collection: import("./types.generated.js").Name;
|
|
143
|
+
fk: import("./types.generated.js").Name;
|
|
144
|
+
fields?: import("./types.generated.js").Fields;
|
|
145
|
+
order?: import("./types.generated.js").Name;
|
|
146
|
+
};
|
|
147
|
+
submit?: import("./types.generated.js").Buttons;
|
|
148
|
+
recalc?: import("./types.generated.js").ActionCall;
|
|
149
|
+
autosave?: boolean;
|
|
150
|
+
}, "type">) => Of<"form">;
|
|
151
|
+
detail: (props: Omit<import("./types.generated.js").DetailView, "type">) => import("./types.generated.js").DetailView;
|
|
152
|
+
board: (props: Omit<import("./types.generated.js").BoardView, "type">) => import("./types.generated.js").BoardView;
|
|
153
|
+
timeline: (props: Omit<import("./types.generated.js").TimelineView, "type">) => import("./types.generated.js").TimelineView;
|
|
154
|
+
tree: (props: Omit<import("./types.generated.js").TreeView, "type">) => import("./types.generated.js").TreeView;
|
|
155
|
+
matrix: (props: Omit<import("./types.generated.js").MatrixView, "type">) => import("./types.generated.js").MatrixView;
|
|
156
|
+
map: (props: Omit<import("./types.generated.js").MapView, "type">) => import("./types.generated.js").MapView;
|
|
157
|
+
stat: (props: Omit<import("./types.generated.js").StatView, "type">) => import("./types.generated.js").StatView;
|
|
158
|
+
split: (props: Omit<import("./types.generated.js").SplitView, "type">) => import("./types.generated.js").SplitView;
|
|
159
|
+
tabs: (props: Omit<import("./types.generated.js").TabsView, "type">) => import("./types.generated.js").TabsView;
|
|
160
|
+
document: (v: View, id?: ViewId) => ViewDocument;
|
|
161
|
+
};
|
|
162
|
+
/** References and conditions: `$.record('id')`, `$.where('status', 'eq', 'open')`. */
|
|
163
|
+
export declare const $: {
|
|
164
|
+
record: (field: string) => Ref;
|
|
165
|
+
selected: (pane: string) => Ref;
|
|
166
|
+
selection: (field: string) => Ref;
|
|
167
|
+
param: (name: string) => Ref;
|
|
168
|
+
user: () => Ref;
|
|
169
|
+
today: () => Ref;
|
|
170
|
+
where: (field: string, op: Condition["op"], value?: Value) => Condition;
|
|
171
|
+
};
|
|
172
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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,EA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