@adminiumjs/manifest 0.3.27 → 0.3.28
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/app-grants.d.ts +134 -0
- package/dist/app-grants.d.ts.map +1 -0
- package/dist/app-grants.js +263 -0
- package/dist/app-grants.js.map +1 -0
- package/dist/automations.d.ts +2172 -56
- package/dist/automations.d.ts.map +1 -1
- package/dist/automations.js +438 -25
- package/dist/automations.js.map +1 -1
- package/dist/compose.d.ts.map +1 -1
- package/dist/compose.js +3 -0
- package/dist/compose.js.map +1 -1
- package/dist/documents.d.ts +1 -0
- package/dist/documents.d.ts.map +1 -1
- package/dist/documents.js +2 -0
- package/dist/documents.js.map +1 -1
- package/dist/index.d.ts +11 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/ledgers.d.ts.map +1 -1
- package/dist/ledgers.js +2 -0
- package/dist/ledgers.js.map +1 -1
- package/dist/modules.d.ts +93 -0
- package/dist/modules.d.ts.map +1 -0
- package/dist/modules.js +489 -0
- package/dist/modules.js.map +1 -0
- package/dist/occupies.d.ts +50 -0
- package/dist/occupies.d.ts.map +1 -0
- package/dist/occupies.js +123 -0
- package/dist/occupies.js.map +1 -0
- package/dist/outbox.d.ts +223 -17
- package/dist/outbox.d.ts.map +1 -1
- package/dist/outbox.js +125 -13
- package/dist/outbox.js.map +1 -1
- package/dist/page-board.d.ts +144 -0
- package/dist/page-board.d.ts.map +1 -0
- package/dist/page-board.js +280 -0
- package/dist/page-board.js.map +1 -0
- package/dist/public-access.d.ts +6 -0
- package/dist/public-access.d.ts.map +1 -1
- package/dist/public-access.js +74 -0
- package/dist/public-access.js.map +1 -1
- package/dist/rail.d.ts +50 -0
- package/dist/rail.d.ts.map +1 -0
- package/dist/rail.js +122 -0
- package/dist/rail.js.map +1 -0
- package/dist/roles.d.ts +647 -1
- package/dist/roles.d.ts.map +1 -1
- package/dist/roles.js +459 -3
- package/dist/roles.js.map +1 -1
- package/dist/sample.d.ts +62 -0
- package/dist/sample.d.ts.map +1 -1
- package/dist/sample.js +203 -4
- package/dist/sample.js.map +1 -1
- package/dist/schema.d.ts +4277 -169
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +539 -40
- package/dist/schema.js.map +1 -1
- package/dist/shapes.d.ts +3 -2
- package/dist/shapes.d.ts.map +1 -1
- package/dist/shapes.js +76 -7
- package/dist/shapes.js.map +1 -1
- package/dist/state-actions.d.ts +4 -0
- package/dist/state-actions.d.ts.map +1 -1
- package/dist/state-actions.js +7 -0
- package/dist/state-actions.js.map +1 -1
- package/dist/states.d.ts +20 -1
- package/dist/states.d.ts.map +1 -1
- package/dist/states.js +47 -5
- package/dist/states.js.map +1 -1
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +41 -0
- package/dist/validate.js.map +1 -1
- package/dist/words.d.ts +1 -1
- package/dist/words.d.ts.map +1 -1
- package/dist/words.js +328 -1
- package/dist/words.js.map +1 -1
- package/package.json +2 -2
package/dist/modules.js
ADDED
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
/**
|
|
3
|
+
* `modules` — the parts of an app its owner switches on and off.
|
|
4
|
+
*
|
|
5
|
+
* ```json
|
|
6
|
+
* "modules": [
|
|
7
|
+
* { "id": "selling", "label": { "en-US": "Selling" }, "default": "always" },
|
|
8
|
+
* { "id": "jobs", "label": { "en-US": "Jobs on site" }, "default": "off" },
|
|
9
|
+
* { "id": "quotes", "label": { "en-US": "Quotes" }, "default": "on", "feature": "quotes" }
|
|
10
|
+
* ]
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* The screens say "parts"; the word here is `modules`, because `part`
|
|
14
|
+
* already names a piece of a shape. A table, a page, a rule, a document, an
|
|
15
|
+
* outbox producer and a public entry each name ONE module (`"module": "jobs"`);
|
|
16
|
+
* a role names several (`"modules": ["jobs", "fleet"]`) and is offered while
|
|
17
|
+
* any of them is on.
|
|
18
|
+
*
|
|
19
|
+
* WHAT "OFF" MEANS. The module's pages are not in the menu and are refused by
|
|
20
|
+
* address; its rules are not run, its documents not drawn, its emails not
|
|
21
|
+
* queued, its public entries closed. Its tables and rows stay. A role's grant
|
|
22
|
+
* on a table lapses while the table's module is off, when the role is itself
|
|
23
|
+
* of that module; a role of another module that is granted the table goes on
|
|
24
|
+
* reading it.
|
|
25
|
+
*
|
|
26
|
+
* `default` is what a new install starts with: `on`, `off` (both are ticks
|
|
27
|
+
* the installer may change), or `always` (never offered as a switch). A
|
|
28
|
+
* module that names a `feature` is also off while that feature's add-ons are
|
|
29
|
+
* not connected, whatever its switch says.
|
|
30
|
+
*
|
|
31
|
+
* A PART THAT IS LEFT OUT. A table built on an add-on's shape cannot be made
|
|
32
|
+
* without the add-on. Such a table makes its add-on required — unless it
|
|
33
|
+
* sits in a module whose feature needs that add-on. Then the app installs
|
|
34
|
+
* without the add-on and the whole module is left out: its tables are not
|
|
35
|
+
* made, and what names them elsewhere goes with them ({@link withoutModules}).
|
|
36
|
+
* When the add-on is connected later the module is put in. The manifest must
|
|
37
|
+
* still be valid with the module left out, which is checked with the rest.
|
|
38
|
+
*/
|
|
39
|
+
import { z } from 'zod';
|
|
40
|
+
import { bcp47TagSchema, labelsSchema } from './refs.js';
|
|
41
|
+
export const moduleIdSchema = z.string().regex(/^[a-z][a-z0-9-]{0,39}$/, 'a module id is kebab-case');
|
|
42
|
+
export const MODULE_DEFAULTS = ['on', 'off', 'always'];
|
|
43
|
+
export const modulesSchema = z
|
|
44
|
+
.array(z
|
|
45
|
+
.object({
|
|
46
|
+
id: moduleIdSchema,
|
|
47
|
+
label: labelsSchema,
|
|
48
|
+
default: z.enum(MODULE_DEFAULTS),
|
|
49
|
+
/** Also off while this feature's add-ons are not connected (see `addOns.features`). */
|
|
50
|
+
feature: z.string().regex(/^[a-z][a-z0-9-]{0,39}$/, 'a feature id').optional(),
|
|
51
|
+
})
|
|
52
|
+
.strict())
|
|
53
|
+
.min(1)
|
|
54
|
+
.max(16);
|
|
55
|
+
/** A role's name in other languages, keyed by BCP 47 tag; `name` stays the English. */
|
|
56
|
+
export const roleNamesSchema = z.record(bcp47TagSchema, z.string().min(1).max(80));
|
|
57
|
+
const isDoc = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
58
|
+
const list = (value) => (Array.isArray(value) ? value : []);
|
|
59
|
+
const text = (value) => (typeof value === 'string' ? value : undefined);
|
|
60
|
+
/** The blocks whose entries name one module, with the words an issue uses for an entry. */
|
|
61
|
+
const MODULE_BLOCKS = ['pages', 'automations', 'documents', 'publicAccess', 'navLinks'];
|
|
62
|
+
/** Module id → the add-ons its feature needs (none when it names no feature). */
|
|
63
|
+
function featureNeeds(document) {
|
|
64
|
+
const features = new Map();
|
|
65
|
+
for (const feature of list(isDoc(document['addOns']) ? document['addOns']['features'] : undefined)) {
|
|
66
|
+
if (isDoc(feature) && typeof feature['id'] === 'string')
|
|
67
|
+
features.set(feature['id'], list(feature['requires']).filter((key) => typeof key === 'string'));
|
|
68
|
+
}
|
|
69
|
+
const out = new Map();
|
|
70
|
+
for (const module of list(document['modules'])) {
|
|
71
|
+
if (!isDoc(module) || typeof module['id'] !== 'string')
|
|
72
|
+
continue;
|
|
73
|
+
out.set(module['id'], typeof module['feature'] === 'string' ? (features.get(module['feature']) ?? []) : []);
|
|
74
|
+
}
|
|
75
|
+
return out;
|
|
76
|
+
}
|
|
77
|
+
const tablesOf = (document) => list(isDoc(document['requiredSchema']) ? document['requiredSchema']['tables'] : undefined).filter(isDoc);
|
|
78
|
+
const shapeAddOn = (table) => text(table['builtOn'])?.split('/')[0];
|
|
79
|
+
/**
|
|
80
|
+
* Whether a table built on `addOn`'s shape may be made without the app
|
|
81
|
+
* requiring the add-on: it sits in a module whose feature needs that add-on.
|
|
82
|
+
*/
|
|
83
|
+
export function shapeIsOptional(document, table, addOn) {
|
|
84
|
+
if (!isDoc(document) || table.module === undefined)
|
|
85
|
+
return false;
|
|
86
|
+
return (featureNeeds(document).get(table.module) ?? []).includes(addOn);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* The add-ons the app can be installed without although a table is built on
|
|
90
|
+
* their shape, each with the modules that are left out while it is absent.
|
|
91
|
+
*/
|
|
92
|
+
export function optionalShapeAddOns(document) {
|
|
93
|
+
const out = new Map();
|
|
94
|
+
if (!isDoc(document))
|
|
95
|
+
return out;
|
|
96
|
+
const required = new Set(list(isDoc(document['addOns']) ? document['addOns']['requires'] : undefined).flatMap((need) => (isDoc(need) && typeof need['key'] === 'string' ? [need['key']] : [])));
|
|
97
|
+
const needs = featureNeeds(document);
|
|
98
|
+
for (const table of tablesOf(document)) {
|
|
99
|
+
const addOn = shapeAddOn(table);
|
|
100
|
+
const module = text(table['module']);
|
|
101
|
+
if (addOn === undefined || module === undefined || required.has(addOn))
|
|
102
|
+
continue;
|
|
103
|
+
if (!(needs.get(module) ?? []).includes(addOn))
|
|
104
|
+
continue;
|
|
105
|
+
const modules = out.get(addOn) ?? [];
|
|
106
|
+
if (!modules.includes(module))
|
|
107
|
+
modules.push(module);
|
|
108
|
+
out.set(addOn, modules);
|
|
109
|
+
}
|
|
110
|
+
return out;
|
|
111
|
+
}
|
|
112
|
+
/** The modules left out of an install where `has` says which add-ons are connected. */
|
|
113
|
+
export function modulesLeftOut(document, has) {
|
|
114
|
+
const out = [];
|
|
115
|
+
for (const [addOn, modules] of optionalShapeAddOns(document)) {
|
|
116
|
+
if (has(addOn))
|
|
117
|
+
continue;
|
|
118
|
+
for (const module of modules)
|
|
119
|
+
if (!out.includes(module))
|
|
120
|
+
out.push(module);
|
|
121
|
+
}
|
|
122
|
+
return out;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* The manifest with some modules left out: what is installed while the add-on
|
|
126
|
+
* a module's tables are built on is not connected.
|
|
127
|
+
*
|
|
128
|
+
* Gone with a module: its tables, pages, rules, documents, outbox producers
|
|
129
|
+
* and public entries — and a browser key (`publicKeys`) every entry of which
|
|
130
|
+
* went, so a share link's key is made only with the part it opens. Gone with its tables, wherever they are named: a link
|
|
131
|
+
* column into one (and an index or a way of belonging that reads the column),
|
|
132
|
+
* a kept total over one (the column stays, empty), a page bound to one, a
|
|
133
|
+
* role's grants and limits on one, a rule or a public entry on one, an
|
|
134
|
+
* outbox link and producer on one, a starting row for one. A role left with
|
|
135
|
+
* no module is gone too. The modules themselves stay declared: one that is
|
|
136
|
+
* left out is simply off.
|
|
137
|
+
*/
|
|
138
|
+
export function withoutModules(manifest, gone) {
|
|
139
|
+
if (!isDoc(manifest) || gone.length === 0)
|
|
140
|
+
return manifest;
|
|
141
|
+
const out = structuredClone(manifest);
|
|
142
|
+
const off = new Set(gone);
|
|
143
|
+
const inGone = (entry) => isDoc(entry) && typeof entry['module'] === 'string' && off.has(entry['module']);
|
|
144
|
+
const schema = isDoc(out['requiredSchema']) ? out['requiredSchema'] : undefined;
|
|
145
|
+
const goneTables = new Set(tablesOf(out).filter(inGone).flatMap((table) => (typeof table['ref'] === 'string' ? [table['ref']] : [])));
|
|
146
|
+
/** Table ref → the link columns it loses. */
|
|
147
|
+
const lostColumns = new Map();
|
|
148
|
+
if (schema !== undefined) {
|
|
149
|
+
schema['tables'] = tablesOf(out)
|
|
150
|
+
.filter((table) => !inGone(table))
|
|
151
|
+
.map((table) => {
|
|
152
|
+
const ref = text(table['ref']) ?? '';
|
|
153
|
+
const lost = new Set();
|
|
154
|
+
table['columns'] = list(table['columns']).filter((column) => {
|
|
155
|
+
if (!isDoc(column))
|
|
156
|
+
return true;
|
|
157
|
+
if (column['type'] === 'fk' && typeof column['references'] === 'string' && goneTables.has(column['references'])) {
|
|
158
|
+
if (typeof column['ref'] === 'string')
|
|
159
|
+
lost.add(column['ref']);
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
const rules = isDoc(column['rules']) ? column['rules'] : undefined;
|
|
163
|
+
if (rules !== undefined && isDoc(rules['rollup']) && typeof rules['rollup']['from'] === 'string' && goneTables.has(rules['rollup']['from'])) {
|
|
164
|
+
delete rules['rollup'];
|
|
165
|
+
if (Object.keys(rules).length === 0)
|
|
166
|
+
delete column['rules'];
|
|
167
|
+
}
|
|
168
|
+
return true;
|
|
169
|
+
});
|
|
170
|
+
if (lost.size > 0)
|
|
171
|
+
lostColumns.set(ref, lost);
|
|
172
|
+
for (const key of ['indexes', 'unique']) {
|
|
173
|
+
if (!Array.isArray(table[key]))
|
|
174
|
+
continue;
|
|
175
|
+
const kept = list(table[key]).filter((set) => !list(set).some((column) => typeof column === 'string' && lost.has(column)));
|
|
176
|
+
if (kept.length === 0)
|
|
177
|
+
delete table[key];
|
|
178
|
+
else
|
|
179
|
+
table[key] = kept;
|
|
180
|
+
}
|
|
181
|
+
if (Array.isArray(table['belongs'])) {
|
|
182
|
+
const kept = list(table['belongs']).filter((way) => {
|
|
183
|
+
if (!isDoc(way))
|
|
184
|
+
return true;
|
|
185
|
+
if (typeof way['via'] === 'string' && lost.has(way['via']))
|
|
186
|
+
return false;
|
|
187
|
+
if (isDoc(way['through']) && typeof way['through']['table'] === 'string' && goneTables.has(way['through']['table']))
|
|
188
|
+
return false;
|
|
189
|
+
return true;
|
|
190
|
+
});
|
|
191
|
+
if (kept.length === 0)
|
|
192
|
+
delete table['belongs'];
|
|
193
|
+
else
|
|
194
|
+
table['belongs'] = kept;
|
|
195
|
+
}
|
|
196
|
+
if (isDoc(table['states']) && isDoc(table['states']['children'])) {
|
|
197
|
+
for (const child of Object.keys(table['states']['children']))
|
|
198
|
+
if (goneTables.has(child))
|
|
199
|
+
delete table['states']['children'][child];
|
|
200
|
+
if (Object.keys(table['states']['children']).length === 0)
|
|
201
|
+
delete table['states']['children'];
|
|
202
|
+
}
|
|
203
|
+
return table;
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
const onGoneTable = (ref) => typeof ref === 'string' && goneTables.has(ref);
|
|
207
|
+
const gonePages = new Set();
|
|
208
|
+
if (Array.isArray(out['pages'])) {
|
|
209
|
+
out['pages'] = list(out['pages']).filter((page) => {
|
|
210
|
+
if (!isDoc(page))
|
|
211
|
+
return true;
|
|
212
|
+
const drop = inGone(page) || Object.values(isDoc(page['bindings']) ? page['bindings'] : {}).some(onGoneTable);
|
|
213
|
+
if (drop && typeof page['ref'] === 'string')
|
|
214
|
+
gonePages.add(page['ref']);
|
|
215
|
+
return !drop;
|
|
216
|
+
});
|
|
217
|
+
// A dashboard's card of a part left out goes with it, and so does one that reads a table that is not made.
|
|
218
|
+
for (const page of list(out['pages'])) {
|
|
219
|
+
const layout = isDoc(page) && isDoc(page['config']) && isDoc(page['config']['layout']) ? page['config']['layout'] : undefined;
|
|
220
|
+
if (layout === undefined || !Array.isArray(layout['items']))
|
|
221
|
+
continue;
|
|
222
|
+
layout['items'] = list(layout['items']).filter((item) => !(inGone(item) || (isDoc(item) && cardTables(item['config']).some(onGoneTable))));
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
// An entry of the section that belongs to a part goes with it; so does the address of a table that is not made.
|
|
226
|
+
if (Array.isArray(out['navLinks'])) {
|
|
227
|
+
const kept = list(out['navLinks']).filter((link) => !inGone(link));
|
|
228
|
+
if (kept.length === 0)
|
|
229
|
+
delete out['navLinks'];
|
|
230
|
+
else
|
|
231
|
+
out['navLinks'] = kept;
|
|
232
|
+
}
|
|
233
|
+
for (const frontend of list(out['frontends'])) {
|
|
234
|
+
if (!isDoc(frontend) || !isDoc(frontend['records']))
|
|
235
|
+
continue;
|
|
236
|
+
for (const ref of Object.keys(frontend['records']))
|
|
237
|
+
if (goneTables.has(ref))
|
|
238
|
+
delete frontend['records'][ref];
|
|
239
|
+
if (Object.keys(frontend['records']).length === 0)
|
|
240
|
+
delete frontend['records'];
|
|
241
|
+
}
|
|
242
|
+
if (Array.isArray(out['automations'])) {
|
|
243
|
+
const kept = list(out['automations']).filter((rule) => {
|
|
244
|
+
if (!isDoc(rule))
|
|
245
|
+
return true;
|
|
246
|
+
const trigger = isDoc(rule['trigger']) ? rule['trigger'] : {};
|
|
247
|
+
return !(inGone(rule) || onGoneTable(trigger['table']) || onGoneTable(isDoc(trigger['forEach']) ? trigger['forEach']['table'] : undefined));
|
|
248
|
+
});
|
|
249
|
+
out['automations'] = kept;
|
|
250
|
+
}
|
|
251
|
+
if (Array.isArray(out['documents'])) {
|
|
252
|
+
const kept = list(out['documents']).filter((entry) => !(inGone(entry) || (isDoc(entry) && onGoneTable(entry['table']))));
|
|
253
|
+
if (kept.length === 0)
|
|
254
|
+
delete out['documents'];
|
|
255
|
+
else
|
|
256
|
+
out['documents'] = kept;
|
|
257
|
+
}
|
|
258
|
+
if (Array.isArray(out['publicAccess'])) {
|
|
259
|
+
const served = (entries) => new Set(entries.flatMap((entry) => (isDoc(entry) && typeof entry['key'] === 'string' ? [entry['key']] : [])));
|
|
260
|
+
const before = served(list(out['publicAccess']));
|
|
261
|
+
const kept = list(out['publicAccess']).filter((entry) => !(inGone(entry) || (isDoc(entry) && onGoneTable(entry['table']))));
|
|
262
|
+
if (kept.length === 0)
|
|
263
|
+
delete out['publicAccess'];
|
|
264
|
+
else
|
|
265
|
+
out['publicAccess'] = kept;
|
|
266
|
+
// A key every entry of which went with a part goes with it: a key that serves nothing is no key of this install.
|
|
267
|
+
// One that served nothing to begin with stays, for the validator to name.
|
|
268
|
+
const after = served(kept);
|
|
269
|
+
if (isDoc(out['publicKeys'])) {
|
|
270
|
+
for (const name of Object.keys(out['publicKeys']))
|
|
271
|
+
if (name !== 'customer' && before.has(name) && !after.has(name))
|
|
272
|
+
delete out['publicKeys'][name];
|
|
273
|
+
if (Object.keys(out['publicKeys']).length === 0)
|
|
274
|
+
delete out['publicKeys'];
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
if (Array.isArray(out['seeds'])) {
|
|
278
|
+
const kept = list(out['seeds']).filter((seed) => !(isDoc(seed) && onGoneTable(seed['table'])));
|
|
279
|
+
if (kept.length === 0)
|
|
280
|
+
delete out['seeds'];
|
|
281
|
+
else
|
|
282
|
+
out['seeds'] = kept;
|
|
283
|
+
}
|
|
284
|
+
const outbox = isDoc(out['outbox']) ? out['outbox'] : undefined;
|
|
285
|
+
if (outbox !== undefined && onGoneTable(outbox['table'])) {
|
|
286
|
+
delete out['outbox'];
|
|
287
|
+
}
|
|
288
|
+
else if (outbox !== undefined) {
|
|
289
|
+
const lost = lostColumns.get(text(outbox['table']) ?? '') ?? new Set();
|
|
290
|
+
if (isDoc(outbox['links'])) {
|
|
291
|
+
for (const [name, column] of Object.entries(outbox['links']))
|
|
292
|
+
if (typeof column === 'string' && lost.has(column))
|
|
293
|
+
delete outbox['links'][name];
|
|
294
|
+
if (Object.keys(outbox['links']).length === 0)
|
|
295
|
+
delete outbox['links'];
|
|
296
|
+
}
|
|
297
|
+
if (Array.isArray(outbox['producers'])) {
|
|
298
|
+
outbox['producers'] = list(outbox['producers']).filter((producer) => {
|
|
299
|
+
if (!isDoc(producer))
|
|
300
|
+
return true;
|
|
301
|
+
if (inGone(producer))
|
|
302
|
+
return false;
|
|
303
|
+
if (typeof producer['link'] === 'string' && lost.has(producer['link']))
|
|
304
|
+
return false;
|
|
305
|
+
return !['onChange', 'onCreate', 'schedule', 'from'].some((key) => isDoc(producer[key]) && onGoneTable(producer[key]['table']));
|
|
306
|
+
});
|
|
307
|
+
const sent = new Set(list(outbox['producers']).flatMap((producer) => (isDoc(producer) && typeof producer['kind'] === 'string' ? [producer['kind']] : [])));
|
|
308
|
+
// A kind nothing queues any more is not a kind of this install; one sent by hand keeps its place.
|
|
309
|
+
const had = new Set(list((isDoc(manifest['outbox']) ? manifest['outbox']['producers'] : undefined)).flatMap((producer) => (isDoc(producer) && typeof producer['kind'] === 'string' ? [producer['kind']] : [])));
|
|
310
|
+
if (isDoc(outbox['kinds']))
|
|
311
|
+
for (const kind of Object.keys(outbox['kinds']))
|
|
312
|
+
if (had.has(kind) && !sent.has(kind))
|
|
313
|
+
delete outbox['kinds'][kind];
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
if (Array.isArray(out['roles'])) {
|
|
317
|
+
out['roles'] = list(out['roles']).filter((role) => {
|
|
318
|
+
if (!isDoc(role))
|
|
319
|
+
return true;
|
|
320
|
+
if (Array.isArray(role['modules'])) {
|
|
321
|
+
const kept = list(role['modules']).filter((id) => !(typeof id === 'string' && off.has(id)));
|
|
322
|
+
if (kept.length === 0)
|
|
323
|
+
return false;
|
|
324
|
+
role['modules'] = kept;
|
|
325
|
+
}
|
|
326
|
+
if (Array.isArray(role['permissions'])) {
|
|
327
|
+
role['permissions'] = list(role['permissions']).filter((grant) => {
|
|
328
|
+
if (typeof grant !== 'string')
|
|
329
|
+
return true;
|
|
330
|
+
const [kind, ref] = grant.split(':');
|
|
331
|
+
if (kind === 'table' && ref?.startsWith('@') === true)
|
|
332
|
+
return !goneTables.has(ref.slice(1));
|
|
333
|
+
if (kind === 'page' && ref?.startsWith('@') === true)
|
|
334
|
+
return !gonePages.has(ref.slice(1));
|
|
335
|
+
return true;
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
if (isDoc(role['limits'])) {
|
|
339
|
+
for (const ref of Object.keys(role['limits']))
|
|
340
|
+
if (goneTables.has(ref))
|
|
341
|
+
delete role['limits'][ref];
|
|
342
|
+
if (Object.keys(role['limits']).length === 0)
|
|
343
|
+
delete role['limits'];
|
|
344
|
+
}
|
|
345
|
+
return true;
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
// A role that copied the grants of one that went stands on its own.
|
|
349
|
+
if (Array.isArray(out['roles'])) {
|
|
350
|
+
const kept = new Set(list(out['roles']).flatMap((role) => (isDoc(role) && typeof role['key'] === 'string' ? [role['key']] : [])));
|
|
351
|
+
for (const role of list(out['roles']))
|
|
352
|
+
if (isDoc(role) && typeof role['cloneFrom'] === 'string' && !kept.has(role['cloneFrom']))
|
|
353
|
+
delete role['cloneFrom'];
|
|
354
|
+
}
|
|
355
|
+
return out;
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* The tables a dashboard card's queries read, as the manifest names them: a
|
|
359
|
+
* query's `source`, a list's `counts.table` and a team's `team.target.table`.
|
|
360
|
+
*/
|
|
361
|
+
function cardTables(value) {
|
|
362
|
+
const out = [];
|
|
363
|
+
const walk = (node) => {
|
|
364
|
+
if (Array.isArray(node))
|
|
365
|
+
return node.forEach(walk);
|
|
366
|
+
if (!isDoc(node))
|
|
367
|
+
return;
|
|
368
|
+
if (node['shape'] !== undefined && isDoc(node['source']) && typeof node['source']['name'] === 'string') {
|
|
369
|
+
out.push(node['source']['name']);
|
|
370
|
+
if (isDoc(node['counts']) && typeof node['counts']['table'] === 'string')
|
|
371
|
+
out.push(node['counts']['table']);
|
|
372
|
+
const target = isDoc(node['team']) && isDoc(node['team']['target']) ? node['team']['target'] : undefined;
|
|
373
|
+
if (typeof target?.['table'] === 'string')
|
|
374
|
+
out.push(target['table']);
|
|
375
|
+
}
|
|
376
|
+
Object.values(node).forEach(walk);
|
|
377
|
+
};
|
|
378
|
+
walk(value);
|
|
379
|
+
return out;
|
|
380
|
+
}
|
|
381
|
+
/** The refs of the tables `withoutModules(document, gone)` would not make. */
|
|
382
|
+
export function tablesLeftOut(document, gone) {
|
|
383
|
+
if (!isDoc(document))
|
|
384
|
+
return [];
|
|
385
|
+
const off = new Set(gone);
|
|
386
|
+
return tablesOf(document).flatMap((table) => (typeof table['module'] === 'string' && off.has(table['module']) && typeof table['ref'] === 'string' ? [table['ref']] : []));
|
|
387
|
+
}
|
|
388
|
+
/** The link columns `withoutModules(document, gone)` takes off the tables it keeps, by table ref. */
|
|
389
|
+
export function columnsLeftOut(document, gone) {
|
|
390
|
+
if (!isDoc(document))
|
|
391
|
+
return {};
|
|
392
|
+
const tables = new Set(tablesLeftOut(document, gone));
|
|
393
|
+
const out = {};
|
|
394
|
+
for (const table of tablesOf(document)) {
|
|
395
|
+
if (typeof table['ref'] !== 'string' || tables.has(table['ref']))
|
|
396
|
+
continue;
|
|
397
|
+
const lost = list(table['columns']).flatMap((column) => (isDoc(column) && column['type'] === 'fk' && typeof column['references'] === 'string' && tables.has(column['references']) && typeof column['ref'] === 'string' ? [column['ref']] : []));
|
|
398
|
+
if (lost.length > 0)
|
|
399
|
+
out[table['ref']] = lost;
|
|
400
|
+
}
|
|
401
|
+
return out;
|
|
402
|
+
}
|
|
403
|
+
/** Every dashboard card of the document's pages (`pages[].config.layout.items[]`), with where it is written. */
|
|
404
|
+
function cardsOf(document) {
|
|
405
|
+
return list(document['pages']).flatMap((page, p) => {
|
|
406
|
+
const layout = isDoc(page) && isDoc(page['config']) && isDoc(page['config']['layout']) ? page['config']['layout'] : undefined;
|
|
407
|
+
return list(layout?.['items']).flatMap((item, i) => (isDoc(item) ? [{ item, path: ['pages', p, 'config', 'layout', 'items', i] }] : []));
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
/** Everything wrong with an app's `modules` and the `module` keys that name them. */
|
|
411
|
+
export function moduleIssues(document) {
|
|
412
|
+
if (!isDoc(document))
|
|
413
|
+
return [];
|
|
414
|
+
const out = [];
|
|
415
|
+
const declared = new Set();
|
|
416
|
+
const features = new Set(list(isDoc(document['addOns']) ? document['addOns']['features'] : undefined).flatMap((feature) => (isDoc(feature) && typeof feature['id'] === 'string' ? [feature['id']] : [])));
|
|
417
|
+
list(document['modules']).forEach((module, i) => {
|
|
418
|
+
if (!isDoc(module) || typeof module['id'] !== 'string')
|
|
419
|
+
return;
|
|
420
|
+
if (declared.has(module['id']))
|
|
421
|
+
out.push({ path: ['modules', i, 'id'], message: `"${module['id']}" is declared twice` });
|
|
422
|
+
declared.add(module['id']);
|
|
423
|
+
if (typeof module['feature'] === 'string' && !features.has(module['feature'])) {
|
|
424
|
+
out.push({ path: ['modules', i, 'feature'], message: `"${module['feature']}" is not one of the app's addOns.features` });
|
|
425
|
+
}
|
|
426
|
+
});
|
|
427
|
+
const named = (id, path) => {
|
|
428
|
+
if (typeof id === 'string' && !declared.has(id))
|
|
429
|
+
out.push({ path, message: `"${id}" is not one of the app's modules` });
|
|
430
|
+
};
|
|
431
|
+
tablesOf(document).forEach((table, t) => named(table['module'], ['requiredSchema', 'tables', t, 'module']));
|
|
432
|
+
for (const block of MODULE_BLOCKS) {
|
|
433
|
+
list(document[block]).forEach((entry, e) => {
|
|
434
|
+
if (isDoc(entry))
|
|
435
|
+
named(entry['module'], [block, e, 'module']);
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
list(isDoc(document['outbox']) ? document['outbox']['producers'] : undefined).forEach((producer, p) => {
|
|
439
|
+
if (isDoc(producer))
|
|
440
|
+
named(producer['module'], ['outbox', 'producers', p, 'module']);
|
|
441
|
+
});
|
|
442
|
+
cardsOf(document).forEach(({ item, path }) => named(item['module'], [...path, 'module']));
|
|
443
|
+
list(document['roles']).forEach((role, r) => {
|
|
444
|
+
if (!isDoc(role) || role['modules'] === undefined)
|
|
445
|
+
return;
|
|
446
|
+
const seen = new Set();
|
|
447
|
+
list(role['modules']).forEach((id, k) => {
|
|
448
|
+
named(id, ['roles', r, 'modules', k]);
|
|
449
|
+
if (typeof id === 'string' && seen.has(id))
|
|
450
|
+
out.push({ path: ['roles', r, 'modules', k], message: `"${id}" is named twice` });
|
|
451
|
+
if (typeof id === 'string')
|
|
452
|
+
seen.add(id);
|
|
453
|
+
});
|
|
454
|
+
});
|
|
455
|
+
return out;
|
|
456
|
+
}
|
|
457
|
+
/** A `module`, a `modules` or a role's `names` in an add-on's manifest: an app's words only. */
|
|
458
|
+
export function addOnModuleIssues(document) {
|
|
459
|
+
if (!isDoc(document))
|
|
460
|
+
return [];
|
|
461
|
+
const out = [];
|
|
462
|
+
const refuse = (path) => {
|
|
463
|
+
out.push({ path, message: 'parts are an app’s: an add-on declares no module' });
|
|
464
|
+
};
|
|
465
|
+
tablesOf(document).forEach((table, t) => {
|
|
466
|
+
if (table['module'] !== undefined)
|
|
467
|
+
refuse(['requiredSchema', 'tables', t, 'module']);
|
|
468
|
+
});
|
|
469
|
+
for (const block of MODULE_BLOCKS) {
|
|
470
|
+
list(document[block]).forEach((entry, e) => {
|
|
471
|
+
if (isDoc(entry) && entry['module'] !== undefined)
|
|
472
|
+
refuse([block, e, 'module']);
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
list(isDoc(document['outbox']) ? document['outbox']['producers'] : undefined).forEach((producer, p) => {
|
|
476
|
+
if (isDoc(producer) && producer['module'] !== undefined)
|
|
477
|
+
refuse(['outbox', 'producers', p, 'module']);
|
|
478
|
+
});
|
|
479
|
+
cardsOf(document).forEach(({ item, path }) => {
|
|
480
|
+
if (item['module'] !== undefined)
|
|
481
|
+
refuse([...path, 'module']);
|
|
482
|
+
});
|
|
483
|
+
list(document['roles']).forEach((role, r) => {
|
|
484
|
+
if (isDoc(role) && role['modules'] !== undefined)
|
|
485
|
+
refuse(['roles', r, 'modules']);
|
|
486
|
+
});
|
|
487
|
+
return out;
|
|
488
|
+
}
|
|
489
|
+
//# sourceMappingURL=modules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modules.js","sourceRoot":"","sources":["../src/modules.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,YAAY,EAAuB,MAAM,WAAW,CAAC;AAE9E,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,wBAAwB,EAAE,2BAA2B,CAAC,CAAC;AAEtG,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAU,CAAC;AAGhE,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC;KAC3B,KAAK,CACJ,CAAC;KACE,MAAM,CAAC;IACN,EAAE,EAAE,cAAc;IAClB,KAAK,EAAE,YAAY;IACnB,OAAO,EAAE,CAAC,CAAC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AE,SAAS,CAAC,CAAC,CAAC;IACpF,CAAC,CAAC,CAAC;IACH,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `table.occupies` — a row takes a resource for a time: a room for an hour,
|
|
3
|
+
* a van for a morning, a crew for a day. The plain rule beside `booking`.
|
|
4
|
+
*
|
|
5
|
+
* `booking` books people for kinds of visit, with who does what, a grid of
|
|
6
|
+
* start times, a practice's hours and a window. This asks one thing or two:
|
|
7
|
+
*
|
|
8
|
+
* - no two counted rows of one resource overlap (left out with `shared`:
|
|
9
|
+
* a crew does several jobs a day);
|
|
10
|
+
* - with `hours`, the resource has hours that weekday, and a timed row lies
|
|
11
|
+
* inside them. A resource with no row for a weekday does not work it;
|
|
12
|
+
* one with no rows at all keeps no week and is held to none.
|
|
13
|
+
*
|
|
14
|
+
* The time is a start with its minutes or its end, or a whole `day`. A row
|
|
15
|
+
* with no resource, or no time yet, takes nothing and is not judged.
|
|
16
|
+
*
|
|
17
|
+
* A `day` with `until` is a span of whole days, both ends counted: a cover
|
|
18
|
+
* from the 10th until the 14th and one from the 14th on overlap. An empty
|
|
19
|
+
* `until` is a span with no end ("until further notice"). A span is judged
|
|
20
|
+
* for overlap alone, so it has no `hours` and is never `shared`.
|
|
21
|
+
*
|
|
22
|
+
* Every table the rule names sits under a key called `table`, so the
|
|
23
|
+
* installer maps it to the real table.
|
|
24
|
+
*/
|
|
25
|
+
import { z } from 'zod';
|
|
26
|
+
import { type ReferenceIssue, type TableIndex, type TableShape } from './refs.js';
|
|
27
|
+
export declare const occupiesSchema: z.ZodObject<{
|
|
28
|
+
resource: z.ZodString;
|
|
29
|
+
start: z.ZodOptional<z.ZodString>;
|
|
30
|
+
minutes: z.ZodOptional<z.ZodString>;
|
|
31
|
+
end: z.ZodOptional<z.ZodString>;
|
|
32
|
+
day: z.ZodOptional<z.ZodString>;
|
|
33
|
+
until: z.ZodOptional<z.ZodString>;
|
|
34
|
+
countWhere: z.ZodOptional<z.ZodObject<{
|
|
35
|
+
column: z.ZodString;
|
|
36
|
+
values: z.ZodArray<z.ZodString>;
|
|
37
|
+
}, z.core.$strict>>;
|
|
38
|
+
shared: z.ZodOptional<z.ZodLiteral<true>>;
|
|
39
|
+
hours: z.ZodOptional<z.ZodObject<{
|
|
40
|
+
table: z.ZodString;
|
|
41
|
+
resource: z.ZodString;
|
|
42
|
+
weekday: z.ZodString;
|
|
43
|
+
opens: z.ZodOptional<z.ZodString>;
|
|
44
|
+
closes: z.ZodOptional<z.ZodString>;
|
|
45
|
+
}, z.core.$strict>>;
|
|
46
|
+
}, z.core.$strict>;
|
|
47
|
+
export type OccupiesRule = z.infer<typeof occupiesSchema>;
|
|
48
|
+
/** Everything in a table's rule that names something the manifest does not declare, or a column of the wrong kind. */
|
|
49
|
+
export declare function occupiesIssues(table: TableShape, rule: OccupiesRule, index: TableIndex, at: (...rest: (string | number)[]) => (string | number)[]): ReferenceIssue[];
|
|
50
|
+
//# sourceMappingURL=occupies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"occupies.d.ts","sourceRoot":"","sources":["../src/occupies.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAA0C,KAAK,cAAc,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAE1H,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;kBA4B8K,CAAC;AAC1M,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE1D,sHAAsH;AACtH,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,cAAc,EAAE,CAkDpK"}
|