@adminiumjs/manifest 0.3.78 → 0.3.80
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/change-guards.d.ts +2 -0
- package/dist/change-guards.d.ts.map +1 -1
- package/dist/change-guards.js +7 -2
- package/dist/change-guards.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/expiry-notice.d.ts +68 -0
- package/dist/expiry-notice.d.ts.map +1 -0
- package/dist/expiry-notice.js +75 -0
- package/dist/expiry-notice.js.map +1 -0
- package/dist/from-template.d.ts +52 -0
- package/dist/from-template.d.ts.map +1 -0
- package/dist/from-template.js +89 -0
- package/dist/from-template.js.map +1 -0
- package/dist/index.d.ts +11 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/dist/instance.d.ts +2 -1
- package/dist/instance.d.ts.map +1 -1
- package/dist/instance.js +1 -0
- package/dist/instance.js.map +1 -1
- package/dist/leave/away.d.ts +67 -0
- package/dist/leave/away.d.ts.map +1 -0
- package/dist/leave/away.js +74 -0
- package/dist/leave/away.js.map +1 -0
- package/dist/leave/civil.d.ts +35 -0
- package/dist/leave/civil.d.ts.map +1 -0
- package/dist/leave/civil.js +75 -0
- package/dist/leave/civil.js.map +1 -0
- package/dist/leave/close-line.d.ts +91 -0
- package/dist/leave/close-line.d.ts.map +1 -0
- package/dist/leave/close-line.js +90 -0
- package/dist/leave/close-line.js.map +1 -0
- package/dist/leave/count.d.ts +82 -0
- package/dist/leave/count.d.ts.map +1 -0
- package/dist/leave/count.js +129 -0
- package/dist/leave/count.js.map +1 -0
- package/dist/leave/deciders.d.ts +81 -0
- package/dist/leave/deciders.d.ts.map +1 -0
- package/dist/leave/deciders.js +158 -0
- package/dist/leave/deciders.js.map +1 -0
- package/dist/leave/entitlement.d.ts +104 -0
- package/dist/leave/entitlement.d.ts.map +1 -0
- package/dist/leave/entitlement.js +59 -0
- package/dist/leave/entitlement.js.map +1 -0
- package/dist/leave/floors.d.ts +27 -0
- package/dist/leave/floors.d.ts.map +1 -0
- package/dist/leave/floors.js +37 -0
- package/dist/leave/floors.js.map +1 -0
- package/dist/leave/index.d.ts +22 -0
- package/dist/leave/index.d.ts.map +1 -0
- package/dist/leave/index.js +23 -0
- package/dist/leave/index.js.map +1 -0
- package/dist/leave/notice-gate.d.ts +41 -0
- package/dist/leave/notice-gate.d.ts.map +1 -0
- package/dist/leave/notice-gate.js +27 -0
- package/dist/leave/notice-gate.js.map +1 -0
- package/dist/leave/preset-england-wales.d.ts +10 -0
- package/dist/leave/preset-england-wales.d.ts.map +1 -0
- package/dist/leave/preset-england-wales.js +67 -0
- package/dist/leave/preset-england-wales.js.map +1 -0
- package/dist/leave/preset-germany.d.ts +30 -0
- package/dist/leave/preset-germany.d.ts.map +1 -0
- package/dist/leave/preset-germany.js +92 -0
- package/dist/leave/preset-germany.js.map +1 -0
- package/dist/leave/preset-us.d.ts +8 -0
- package/dist/leave/preset-us.d.ts.map +1 -0
- package/dist/leave/preset-us.js +48 -0
- package/dist/leave/preset-us.js.map +1 -0
- package/dist/leave/replay.d.ts +126 -0
- package/dist/leave/replay.d.ts.map +1 -0
- package/dist/leave/replay.js +158 -0
- package/dist/leave/replay.js.map +1 -0
- package/dist/leave/state.d.ts +64 -0
- package/dist/leave/state.d.ts.map +1 -0
- package/dist/leave/state.js +74 -0
- package/dist/leave/state.js.map +1 -0
- package/dist/leave/told.d.ts +32 -0
- package/dist/leave/told.d.ts.map +1 -0
- package/dist/leave/told.js +32 -0
- package/dist/leave/told.js.map +1 -0
- package/dist/leave/units.d.ts +21 -0
- package/dist/leave/units.d.ts.map +1 -0
- package/dist/leave/units.js +21 -0
- package/dist/leave/units.js.map +1 -0
- package/dist/leave-shape.d.ts +324 -0
- package/dist/leave-shape.d.ts.map +1 -0
- package/dist/leave-shape.js +164 -0
- package/dist/leave-shape.js.map +1 -0
- package/dist/leave-word.d.ts +86 -0
- package/dist/leave-word.d.ts.map +1 -0
- package/dist/leave-word.js +235 -0
- package/dist/leave-word.js.map +1 -0
- package/dist/outbox.d.ts +2 -0
- package/dist/outbox.d.ts.map +1 -1
- package/dist/outbox.js +5 -0
- package/dist/outbox.js.map +1 -1
- package/dist/person-import.d.ts +98 -0
- package/dist/person-import.d.ts.map +1 -0
- package/dist/person-import.js +270 -0
- package/dist/person-import.js.map +1 -0
- package/dist/public-access.d.ts +5 -0
- package/dist/public-access.d.ts.map +1 -1
- package/dist/public-access.js +68 -0
- package/dist/public-access.js.map +1 -1
- package/dist/record-classes.d.ts +99 -0
- package/dist/record-classes.d.ts.map +1 -0
- package/dist/record-classes.js +123 -0
- package/dist/record-classes.js.map +1 -0
- package/dist/removal.d.ts +1 -0
- package/dist/removal.d.ts.map +1 -1
- package/dist/removal.js +2 -0
- package/dist/removal.js.map +1 -1
- package/dist/roles.d.ts +23 -1
- package/dist/roles.d.ts.map +1 -1
- package/dist/roles.js +34 -5
- package/dist/roles.js.map +1 -1
- package/dist/schema.d.ts +601 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +174 -14
- package/dist/schema.js.map +1 -1
- package/dist/staff-accounts.d.ts +102 -0
- package/dist/staff-accounts.d.ts.map +1 -0
- package/dist/staff-accounts.js +179 -0
- package/dist/staff-accounts.js.map +1 -0
- package/dist/validate.d.ts +10 -0
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +31 -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 +80 -0
- package/dist/words.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WHAT AN APP KEEPS, AND FOR HOW LONG (`recordClasses`).
|
|
3
|
+
*
|
|
4
|
+
* One top-level list. A class is a group of tables kept for one period and
|
|
5
|
+
* then dealt with one way:
|
|
6
|
+
* - `tables`, and `person`: for each table, the column linking a row to its
|
|
7
|
+
* person, so a hold on somebody keeps their rows;
|
|
8
|
+
* - `keep`: `n` days, months or years from `from`. `from` is a path of links
|
|
9
|
+
* ending on a date column, read from a row. An empty value on it means the
|
|
10
|
+
* row is never due;
|
|
11
|
+
* - `then`: `delete`, `empty` (blank the `empties` columns and keep the row),
|
|
12
|
+
* or `bundle` (the app's leave year, deleted whole by the leave engine's own
|
|
13
|
+
* step). The owner may change the period, never this;
|
|
14
|
+
* - `law`: the law keeps these rows, so an erasure leaves them until the
|
|
15
|
+
* period ends.
|
|
16
|
+
*
|
|
17
|
+
* A `delete` or `empty` class is swept table by table, so `from` must resolve
|
|
18
|
+
* on each of its tables. A `bundle` is decided as one unit, so it resolves on
|
|
19
|
+
* the first.
|
|
20
|
+
*/
|
|
21
|
+
import { z } from 'zod';
|
|
22
|
+
import { type ReferenceIssue } from './refs.js';
|
|
23
|
+
/** The most classes one app declares, and tables one class holds. */
|
|
24
|
+
export declare const RECORD_CLASSES_MAX = 32;
|
|
25
|
+
export declare const RECORD_CLASS_TABLES_MAX = 24;
|
|
26
|
+
export declare const RECORD_CLASS_UNITS: readonly ["days", "months", "years"];
|
|
27
|
+
export declare const RECORD_CLASS_THEN: readonly ["delete", "empty", "bundle"];
|
|
28
|
+
export declare const recordClassSchema: z.ZodObject<{
|
|
29
|
+
key: z.ZodString;
|
|
30
|
+
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
31
|
+
what: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
32
|
+
tables: z.ZodArray<z.ZodString>;
|
|
33
|
+
person: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
34
|
+
keep: z.ZodObject<{
|
|
35
|
+
n: z.ZodNumber;
|
|
36
|
+
unit: z.ZodEnum<{
|
|
37
|
+
days: "days";
|
|
38
|
+
years: "years";
|
|
39
|
+
months: "months";
|
|
40
|
+
}>;
|
|
41
|
+
from: z.ZodArray<z.ZodString>;
|
|
42
|
+
}, z.core.$strict>;
|
|
43
|
+
then: z.ZodEnum<{
|
|
44
|
+
delete: "delete";
|
|
45
|
+
empty: "empty";
|
|
46
|
+
bundle: "bundle";
|
|
47
|
+
}>;
|
|
48
|
+
empties: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
49
|
+
law: z.ZodOptional<z.ZodEnum<{
|
|
50
|
+
tax: "tax";
|
|
51
|
+
health: "health";
|
|
52
|
+
contract: "contract";
|
|
53
|
+
safety: "safety";
|
|
54
|
+
}>>;
|
|
55
|
+
}, z.core.$strict>;
|
|
56
|
+
export type RecordClass = z.infer<typeof recordClassSchema>;
|
|
57
|
+
export declare const recordClassesSchema: z.ZodArray<z.ZodObject<{
|
|
58
|
+
key: z.ZodString;
|
|
59
|
+
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
60
|
+
what: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
61
|
+
tables: z.ZodArray<z.ZodString>;
|
|
62
|
+
person: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
63
|
+
keep: z.ZodObject<{
|
|
64
|
+
n: z.ZodNumber;
|
|
65
|
+
unit: z.ZodEnum<{
|
|
66
|
+
days: "days";
|
|
67
|
+
years: "years";
|
|
68
|
+
months: "months";
|
|
69
|
+
}>;
|
|
70
|
+
from: z.ZodArray<z.ZodString>;
|
|
71
|
+
}, z.core.$strict>;
|
|
72
|
+
then: z.ZodEnum<{
|
|
73
|
+
delete: "delete";
|
|
74
|
+
empty: "empty";
|
|
75
|
+
bundle: "bundle";
|
|
76
|
+
}>;
|
|
77
|
+
empties: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
78
|
+
law: z.ZodOptional<z.ZodEnum<{
|
|
79
|
+
tax: "tax";
|
|
80
|
+
health: "health";
|
|
81
|
+
contract: "contract";
|
|
82
|
+
safety: "safety";
|
|
83
|
+
}>>;
|
|
84
|
+
}, z.core.$strict>>;
|
|
85
|
+
interface ColumnShape {
|
|
86
|
+
ref: string;
|
|
87
|
+
type?: string | undefined;
|
|
88
|
+
references?: string | undefined;
|
|
89
|
+
nullable?: boolean | undefined;
|
|
90
|
+
role?: string | undefined;
|
|
91
|
+
}
|
|
92
|
+
interface TableShape {
|
|
93
|
+
ref: string;
|
|
94
|
+
columns: readonly ColumnShape[];
|
|
95
|
+
}
|
|
96
|
+
/** Every problem of the app's record classes, each at its place. */
|
|
97
|
+
export declare function recordClassIssues(classes: readonly RecordClass[] | undefined, schemaTables: readonly TableShape[]): ReferenceIssue[];
|
|
98
|
+
export {};
|
|
99
|
+
//# sourceMappingURL=record-classes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-classes.d.ts","sourceRoot":"","sources":["../src/record-classes.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAA2B,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAEzE,qEAAqE;AACrE,eAAO,MAAM,kBAAkB,KAAK,CAAC;AACrC,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAE1C,eAAO,MAAM,kBAAkB,sCAAuC,CAAC;AACvE,eAAO,MAAM,iBAAiB,wCAAyC,CAAC;AAExE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAkBnB,CAAC;AACZ,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAA4D,CAAC;AAE7F,UAAU,WAAW;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B;AACD,UAAU,UAAU;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,SAAS,WAAW,EAAE,CAAC;CACjC;AAkBD,oEAAoE;AACpE,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,GAAG,SAAS,EAAE,YAAY,EAAE,SAAS,UAAU,EAAE,GAAG,cAAc,EAAE,CA4CpI"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
/**
|
|
3
|
+
* WHAT AN APP KEEPS, AND FOR HOW LONG (`recordClasses`).
|
|
4
|
+
*
|
|
5
|
+
* One top-level list. A class is a group of tables kept for one period and
|
|
6
|
+
* then dealt with one way:
|
|
7
|
+
* - `tables`, and `person`: for each table, the column linking a row to its
|
|
8
|
+
* person, so a hold on somebody keeps their rows;
|
|
9
|
+
* - `keep`: `n` days, months or years from `from`. `from` is a path of links
|
|
10
|
+
* ending on a date column, read from a row. An empty value on it means the
|
|
11
|
+
* row is never due;
|
|
12
|
+
* - `then`: `delete`, `empty` (blank the `empties` columns and keep the row),
|
|
13
|
+
* or `bundle` (the app's leave year, deleted whole by the leave engine's own
|
|
14
|
+
* step). The owner may change the period, never this;
|
|
15
|
+
* - `law`: the law keeps these rows, so an erasure leaves them until the
|
|
16
|
+
* period ends.
|
|
17
|
+
*
|
|
18
|
+
* A `delete` or `empty` class is swept table by table, so `from` must resolve
|
|
19
|
+
* on each of its tables. A `bundle` is decided as one unit, so it resolves on
|
|
20
|
+
* the first.
|
|
21
|
+
*/
|
|
22
|
+
import { z } from 'zod';
|
|
23
|
+
import { KEPT_BY_LAW_REASONS } from './people.js';
|
|
24
|
+
import { labelsSchema, refSchema } from './refs.js';
|
|
25
|
+
/** The most classes one app declares, and tables one class holds. */
|
|
26
|
+
export const RECORD_CLASSES_MAX = 32;
|
|
27
|
+
export const RECORD_CLASS_TABLES_MAX = 24;
|
|
28
|
+
export const RECORD_CLASS_UNITS = ['days', 'months', 'years'];
|
|
29
|
+
export const RECORD_CLASS_THEN = ['delete', 'empty', 'bundle'];
|
|
30
|
+
export const recordClassSchema = z
|
|
31
|
+
.object({
|
|
32
|
+
key: z.string().regex(/^[a-z][a-z0-9-]*$/, 'a class key is lower-case words joined by hyphens').max(60),
|
|
33
|
+
label: labelsSchema,
|
|
34
|
+
what: labelsSchema.optional(),
|
|
35
|
+
tables: z.array(refSchema).min(1).max(RECORD_CLASS_TABLES_MAX),
|
|
36
|
+
person: z.record(refSchema, refSchema),
|
|
37
|
+
keep: z
|
|
38
|
+
.object({
|
|
39
|
+
n: z.number().int().min(1).max(1200),
|
|
40
|
+
unit: z.enum(RECORD_CLASS_UNITS),
|
|
41
|
+
from: z.array(refSchema).min(1).max(4),
|
|
42
|
+
})
|
|
43
|
+
.strict(),
|
|
44
|
+
then: z.enum(RECORD_CLASS_THEN),
|
|
45
|
+
empties: z.array(refSchema).min(1).max(64).optional(),
|
|
46
|
+
law: z.enum(KEPT_BY_LAW_REASONS).optional(),
|
|
47
|
+
})
|
|
48
|
+
.strict();
|
|
49
|
+
export const recordClassesSchema = z.array(recordClassSchema).min(1).max(RECORD_CLASSES_MAX);
|
|
50
|
+
const DATE_TYPES = new Set(['date', 'timestamptz']);
|
|
51
|
+
/** Why `from` does not resolve on `start`, or null: every step but the last a link, and the last a date. */
|
|
52
|
+
function pathIssue(tables, start, from) {
|
|
53
|
+
let here = tables.get(start);
|
|
54
|
+
for (const [i, step] of from.entries()) {
|
|
55
|
+
if (here === undefined)
|
|
56
|
+
return `"${from[i - 1] ?? start}" leads to no table of this app`;
|
|
57
|
+
const column = here.columns.find((candidate) => candidate.ref === step);
|
|
58
|
+
if (column === undefined)
|
|
59
|
+
return `"${here.ref}" has no column "${step}"`;
|
|
60
|
+
if (i === from.length - 1)
|
|
61
|
+
return DATE_TYPES.has(column.type ?? '') ? null : `"${here.ref}.${step}" is not a date`;
|
|
62
|
+
if (column.type !== 'fk' || column.references === undefined)
|
|
63
|
+
return `"${here.ref}.${step}" is not a link`;
|
|
64
|
+
here = tables.get(column.references);
|
|
65
|
+
}
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
/** Every problem of the app's record classes, each at its place. */
|
|
69
|
+
export function recordClassIssues(classes, schemaTables) {
|
|
70
|
+
if (classes === undefined)
|
|
71
|
+
return [];
|
|
72
|
+
const out = [];
|
|
73
|
+
const tables = new Map(schemaTables.map((table) => [table.ref, table]));
|
|
74
|
+
const keys = new Set();
|
|
75
|
+
const classOf = new Map();
|
|
76
|
+
classes.forEach((entry, c) => {
|
|
77
|
+
const at = (...rest) => ['recordClasses', c, ...rest];
|
|
78
|
+
if (keys.has(entry.key))
|
|
79
|
+
out.push({ path: at('key'), message: `the class "${entry.key}" is declared twice` });
|
|
80
|
+
keys.add(entry.key);
|
|
81
|
+
entry.tables.forEach((ref, t) => {
|
|
82
|
+
const table = tables.get(ref);
|
|
83
|
+
if (table === undefined) {
|
|
84
|
+
out.push({ path: at('tables', t), message: `"${ref}" is not a table of this app` });
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const other = classOf.get(ref);
|
|
88
|
+
if (other !== undefined)
|
|
89
|
+
out.push({ path: at('tables', t), message: `"${ref}" is already in the class "${other}": a table is kept for one period` });
|
|
90
|
+
classOf.set(ref, entry.key);
|
|
91
|
+
const link = entry.person[ref];
|
|
92
|
+
if (link === undefined)
|
|
93
|
+
out.push({ path: at('person'), message: `say which column of "${ref}" links a row to its person` });
|
|
94
|
+
else if (!table.columns.some((column) => column.ref === link))
|
|
95
|
+
out.push({ path: at('person', ref), message: `"${ref}" has no column "${link}"` });
|
|
96
|
+
});
|
|
97
|
+
for (const ref of Object.keys(entry.person)) {
|
|
98
|
+
if (!entry.tables.includes(ref))
|
|
99
|
+
out.push({ path: at('person', ref), message: `"${ref}" is not one of this class's tables` });
|
|
100
|
+
}
|
|
101
|
+
const starts = entry.then === 'bundle' ? entry.tables.slice(0, 1) : entry.tables;
|
|
102
|
+
for (const start of starts) {
|
|
103
|
+
if (!tables.has(start))
|
|
104
|
+
continue;
|
|
105
|
+
const issue = pathIssue(tables, start, entry.keep.from);
|
|
106
|
+
if (issue !== null)
|
|
107
|
+
out.push({ path: at('keep', 'from'), message: `from "${start}": ${issue}` });
|
|
108
|
+
}
|
|
109
|
+
if (entry.then === 'empty' && entry.empties === undefined)
|
|
110
|
+
out.push({ path: at('empties'), message: 'a class that empties its rows says which columns' });
|
|
111
|
+
if (entry.then !== 'empty' && entry.empties !== undefined)
|
|
112
|
+
out.push({ path: at('empties'), message: `only a class whose "then" is "empty" names columns to empty` });
|
|
113
|
+
(entry.empties ?? []).forEach((ref, e) => {
|
|
114
|
+
const holders = entry.tables.flatMap((name) => tables.get(name)?.columns.filter((column) => column.ref === ref) ?? []);
|
|
115
|
+
if (holders.length === 0)
|
|
116
|
+
out.push({ path: at('empties', e), message: `no table of this class has a column "${ref}"` });
|
|
117
|
+
else if (holders.some((column) => column.nullable !== true || column.role === 'pk'))
|
|
118
|
+
out.push({ path: at('empties', e), message: `"${ref}" cannot be emptied: it must allow no value on every table of this class` });
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
return out;
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=record-classes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-classes.js","sourceRoot":"","sources":["../src/record-classes.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,SAAS,EAAuB,MAAM,WAAW,CAAC;AAEzE,qEAAqE;AACrE,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AACrC,MAAM,CAAC,MAAM,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C,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,UAAU,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE;YAAE,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;YAAC,MAAM,CAAC,EAAE,OAAO,CAAA;SAAE,GAAG,SAAS,CAAA;KAAE,EAAE,CAAC;CAC7K;AAED,4FAA4F;AAC5F,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,iBAAiB,EAAE,GAAG;IAAE,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAAE,CAmBpH;AAED,4EAA4E;AAC5E,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAE,SAAS,CAAC,GAAG,MAAM,EAAE,CAEpF"}
|
package/dist/removal.js
CHANGED
|
@@ -38,6 +38,8 @@ export function removalIssues(tables) {
|
|
|
38
38
|
tables.forEach((table, t) => {
|
|
39
39
|
const at = (...rest) => ['requiredSchema', 'tables', t, ...rest];
|
|
40
40
|
if (table.removal?.history === true) {
|
|
41
|
+
if (table.readLog !== undefined)
|
|
42
|
+
out.push({ path: at('removal', 'history'), message: 'a read-logged table\'s rows are opened through a logged door: its removed rows are kept for nobody' });
|
|
41
43
|
if (table.private === true)
|
|
42
44
|
out.push({ path: at('removal', 'history'), message: 'a private table\'s rows are read by their own people only: its removed rows are kept for nobody' });
|
|
43
45
|
// Read through a row it linked to: a table with no link has no such row.
|
package/dist/removal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"removal.js","sourceRoot":"","sources":["../src/removal.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC;KAC3B,MAAM,CA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H,CAAC;QACD,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAClC,IAAI,MAAM,CAAC,KAAK,EAAE,OAAO,KAAK,SAAS;gBAAE,OAAO;YAChD,iEAAiE;YACjE,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI;gBAAE,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,mFAAmF,EAAE,CAAC,CAAC;QACnL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,OAAO,GAAG,CAAC;AACb,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,gBAAgB,CAAC,KAAyC;IACxE,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AACzG,CAAC"}
|
package/dist/roles.d.ts
CHANGED
|
@@ -302,6 +302,10 @@ export type ListingWhile = z.infer<typeof listingWhileSchema>;
|
|
|
302
302
|
* some values, or while it is empty or not (`isNull`): a member row whose
|
|
303
303
|
* `ended_at` is set lists nobody;
|
|
304
304
|
* - `via`: whoever belongs to the row this link points at (a quote's deal).
|
|
305
|
+
*
|
|
306
|
+
* A `column` way marked `identity` says the column is WHO THE ROW IS ABOUT, not
|
|
307
|
+
* who looks after it: a leaver's leave days stay theirs, so a hand-over neither
|
|
308
|
+
* counts nor moves it. It holds the person directly and is never set by a writer.
|
|
305
309
|
*/
|
|
306
310
|
export declare const belongsWaySchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
307
311
|
column: z.ZodString;
|
|
@@ -311,6 +315,7 @@ export declare const belongsWaySchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
311
315
|
team: "team";
|
|
312
316
|
anyone: "anyone";
|
|
313
317
|
}>>;
|
|
318
|
+
identity: z.ZodOptional<z.ZodLiteral<true>>;
|
|
314
319
|
}, z.core.$strict>, z.ZodObject<{
|
|
315
320
|
through: z.ZodObject<{
|
|
316
321
|
table: z.ZodString;
|
|
@@ -341,6 +346,7 @@ export declare const belongsSchema: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<
|
|
|
341
346
|
team: "team";
|
|
342
347
|
anyone: "anyone";
|
|
343
348
|
}>>;
|
|
349
|
+
identity: z.ZodOptional<z.ZodLiteral<true>>;
|
|
344
350
|
}, z.core.$strict>, z.ZodObject<{
|
|
345
351
|
through: z.ZodObject<{
|
|
346
352
|
table: z.ZodString;
|
|
@@ -874,6 +880,7 @@ export declare function roleAddOnTableIssues(roles: readonly {
|
|
|
874
880
|
export declare function privateShapeIssues(tables: readonly {
|
|
875
881
|
ref: string;
|
|
876
882
|
private?: true | undefined;
|
|
883
|
+
readLog?: unknown;
|
|
877
884
|
belongs?: readonly unknown[] | undefined;
|
|
878
885
|
states?: {
|
|
879
886
|
timed?: unknown;
|
|
@@ -908,6 +915,21 @@ export declare function privateShapeIssues(tables: readonly {
|
|
|
908
915
|
} | undefined;
|
|
909
916
|
}[];
|
|
910
917
|
}[]): ReferenceIssue[];
|
|
918
|
+
/**
|
|
919
|
+
* NAMED ACCESS AND THE READ LOG. A read log says whose record was opened, so
|
|
920
|
+
* it needs a real column to say it with, and it only means something on a
|
|
921
|
+
* table no wildcard reaches: `readLog` requires `access: 'named'`.
|
|
922
|
+
*/
|
|
923
|
+
export declare function namedAccessIssues(tables: readonly {
|
|
924
|
+
ref: string;
|
|
925
|
+
access?: 'named' | undefined;
|
|
926
|
+
readLog?: {
|
|
927
|
+
subject: string;
|
|
928
|
+
} | undefined;
|
|
929
|
+
columns: readonly {
|
|
930
|
+
ref: string;
|
|
931
|
+
}[];
|
|
932
|
+
}[]): ReferenceIssue[];
|
|
911
933
|
/**
|
|
912
934
|
* A STORED TOTAL IS EVERY ROW'S. A `rollup` column is written whole — a count
|
|
913
935
|
* or a sum over every child row, whoever reads it. Beside a list of those
|
|
@@ -950,5 +972,5 @@ export declare function storedTotalIssues(tables: readonly {
|
|
|
950
972
|
* one is refused where it is written. Reads the plain document: a block it
|
|
951
973
|
* does not know the shape of is walked all the same.
|
|
952
974
|
*/
|
|
953
|
-
export declare function privateTableIssues(document: Readonly<Record<string, unknown>>, privateTables: readonly string[]): ReferenceIssue[];
|
|
975
|
+
export declare function privateTableIssues(document: Readonly<Record<string, unknown>>, privateTables: readonly string[], why?: string): ReferenceIssue[];
|
|
954
976
|
//# sourceMappingURL=roles.d.ts.map
|
package/dist/roles.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../src/roles.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuGG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAsC,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvH,+GAA+G;AAC/G,eAAO,MAAM,WAAW,iCAAkC,CAAC;AAE3D,wDAAwD;AACxD,eAAO,MAAM,eAAe,IAAI,CAAC;AAEjC;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,aAAsI,CAAC;AAEpK;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAUvH;AAED,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;kBAqCqK,CAAC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const listingWhileSchema = z.union([
|
|
|
214
214
|
* some values, or while it is empty or not (`isNull`): a member row whose
|
|
215
215
|
* `ended_at` is set lists nobody;
|
|
216
216
|
* - `via`: whoever belongs to the row this link points at (a quote's deal).
|
|
217
|
+
*
|
|
218
|
+
* A `column` way marked `identity` says the column is WHO THE ROW IS ABOUT, not
|
|
219
|
+
* who looks after it: a leaver's leave days stay theirs, so a hand-over neither
|
|
220
|
+
* counts nor moves it. It holds the person directly and is never set by a writer.
|
|
217
221
|
*/
|
|
218
222
|
export const belongsWaySchema = z.union([
|
|
219
|
-
z.object({ column: refSchema, person: refSchema.optional(), set: z.enum(STAFF_SET_RULES).optional() }).strict(),
|
|
223
|
+
z.object({ column: refSchema, person: refSchema.optional(), set: z.enum(STAFF_SET_RULES).optional(), identity: z.literal(true).optional() }).strict(),
|
|
220
224
|
z
|
|
221
225
|
.object({
|
|
222
226
|
through: z
|
|
@@ -524,6 +528,10 @@ export function belongsIssues(tables, index, isStaff) {
|
|
|
524
528
|
person(table.ref, way.column, way.person, at, 'column');
|
|
525
529
|
if (table.private === true && way.person !== undefined)
|
|
526
530
|
out.push({ path: [...at, 'person'], message: 'a private table is reached by its own staff columns only' });
|
|
531
|
+
if (way.identity === true && way.person !== undefined)
|
|
532
|
+
out.push({ path: [...at, 'identity'], message: 'an identity column holds the person itself: not a link to a row that names them' });
|
|
533
|
+
if (way.identity === true && way.set !== undefined)
|
|
534
|
+
out.push({ path: [...at, 'identity'], message: 'an identity column says who the row is about, so no writer picks it: remove "set"' });
|
|
527
535
|
return;
|
|
528
536
|
}
|
|
529
537
|
if (table.private === true) {
|
|
@@ -719,11 +727,13 @@ export function roleAddOnTableIssues(roles, named) {
|
|
|
719
727
|
* runs on them.
|
|
720
728
|
*/
|
|
721
729
|
export function privateShapeIssues(tables) {
|
|
722
|
-
|
|
730
|
+
// A read-logged table takes the same refusals: whatever reads it for somebody else would read it unlogged.
|
|
731
|
+
const held = new Set(tables.filter((table) => table.private === true || table.readLog !== undefined).map((table) => table.ref));
|
|
723
732
|
if (held.size === 0)
|
|
724
733
|
return [];
|
|
734
|
+
const logged = new Set(tables.filter((table) => table.private !== true && table.readLog !== undefined).map((table) => table.ref));
|
|
725
735
|
const out = [];
|
|
726
|
-
const said = (ref, what) => `"${ref}" is private: only the people its rows belong to read it, so ${what}`;
|
|
736
|
+
const said = (ref, what) => logged.has(ref) ? `"${ref}" is read-logged: every open of it is logged, so ${what}` : `"${ref}" is private: only the people its rows belong to read it, so ${what}`;
|
|
727
737
|
/** The staff columns that say whose a private table's row is: its own `belongs` columns. */
|
|
728
738
|
const ownPeople = (ref) => new Set((tables.find((table) => table.ref === ref)?.belongs ?? []).flatMap((way) => {
|
|
729
739
|
const own = way;
|
|
@@ -794,6 +804,25 @@ export function privateShapeIssues(tables) {
|
|
|
794
804
|
});
|
|
795
805
|
return out;
|
|
796
806
|
}
|
|
807
|
+
/**
|
|
808
|
+
* NAMED ACCESS AND THE READ LOG. A read log says whose record was opened, so
|
|
809
|
+
* it needs a real column to say it with, and it only means something on a
|
|
810
|
+
* table no wildcard reaches: `readLog` requires `access: 'named'`.
|
|
811
|
+
*/
|
|
812
|
+
export function namedAccessIssues(tables) {
|
|
813
|
+
const out = [];
|
|
814
|
+
tables.forEach((table, t) => {
|
|
815
|
+
if (table.readLog === undefined)
|
|
816
|
+
return;
|
|
817
|
+
const at = ['requiredSchema', 'tables', t, 'readLog'];
|
|
818
|
+
if (table.access !== 'named')
|
|
819
|
+
out.push({ path: at, message: `"${table.ref}" is read-logged: give it "access": "named", or a wildcard grant would read it` });
|
|
820
|
+
if (!table.columns.some((column) => column.ref === table.readLog?.subject)) {
|
|
821
|
+
out.push({ path: [...at, 'subject'], message: `"${table.readLog.subject}" is not a column of "${table.ref}": the read log's subject names whose record a row is` });
|
|
822
|
+
}
|
|
823
|
+
});
|
|
824
|
+
return out;
|
|
825
|
+
}
|
|
797
826
|
/**
|
|
798
827
|
* A STORED TOTAL IS EVERY ROW'S. A `rollup` column is written whole — a count
|
|
799
828
|
* or a sum over every child row, whoever reads it. Beside a list of those
|
|
@@ -846,7 +875,7 @@ const BLOCKS_THAT_READ_FOR_OTHERS = ['publicAccess', 'documents', 'outbox', 'ema
|
|
|
846
875
|
* one is refused where it is written. Reads the plain document: a block it
|
|
847
876
|
* does not know the shape of is walked all the same.
|
|
848
877
|
*/
|
|
849
|
-
export function privateTableIssues(document, privateTables) {
|
|
878
|
+
export function privateTableIssues(document, privateTables, why = 'private: only the people its rows belong to read it') {
|
|
850
879
|
if (privateTables.length === 0)
|
|
851
880
|
return [];
|
|
852
881
|
const held = new Set(privateTables);
|
|
@@ -860,7 +889,7 @@ export function privateTableIssues(document, privateTables) {
|
|
|
860
889
|
return;
|
|
861
890
|
for (const [key, inner] of Object.entries(value)) {
|
|
862
891
|
if (key === 'table' && typeof inner === 'string' && held.has(inner)) {
|
|
863
|
-
out.push({ path: [...path, key], message: `"${inner}" is
|
|
892
|
+
out.push({ path: [...path, key], message: `"${inner}" is ${why}, so no ${String(path[0])} entry names it` });
|
|
864
893
|
}
|
|
865
894
|
else
|
|
866
895
|
walk(inner, [...path, key]);
|