@agentshouse/mdmodel 0.1.0-c5a71fe539a49 → 0.1.0-c60b1ddb74fcc
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/API.md +220 -164
- package/dist/blocks.d.ts.map +1 -1
- package/dist/blocks.js +31 -17
- package/dist/condition.d.ts +19 -7
- package/dist/condition.d.ts.map +1 -1
- package/dist/condition.js +223 -117
- package/dist/definition.d.ts +23 -0
- package/dist/definition.d.ts.map +1 -1
- package/dist/definition.js +266 -25
- package/dist/document.d.ts +7 -8
- package/dist/document.d.ts.map +1 -1
- package/dist/document.js +105 -49
- package/dist/fields.d.ts +2 -0
- package/dist/fields.d.ts.map +1 -1
- package/dist/fields.js +7 -0
- package/dist/index.d.ts +11 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -5
- package/dist/links.d.ts +1 -0
- package/dist/links.d.ts.map +1 -1
- package/dist/links.js +1 -1
- package/dist/paths.d.ts +1 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +92 -12
- package/dist/references.d.ts +2 -2
- package/dist/references.d.ts.map +1 -1
- package/dist/schema.js +2 -2
- package/dist/types.d.ts +32 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/validate.d.ts +6 -1
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +163 -109
- package/dist/yaml.d.ts +7 -3
- package/dist/yaml.d.ts.map +1 -1
- package/dist/yaml.js +72 -43
- package/fixtures/README.md +1 -1
- package/fixtures/cases/absent-link-dangles/context.json +1 -0
- package/fixtures/cases/absent-link-dangles/expected.json +1 -0
- package/fixtures/cases/absent-link-dangles/library/item.md +8 -0
- package/fixtures/cases/absent-link-dangles/schema.yaml +6 -0
- package/fixtures/cases/absolute-link/context.json +1 -0
- package/fixtures/cases/{missing-binary-image → absolute-link}/expected.json +1 -1
- package/fixtures/cases/absolute-link/library/item.md +8 -0
- package/fixtures/cases/absolute-link/schema.yaml +6 -0
- package/fixtures/cases/binary-image-dangles/expected.json +1 -0
- package/fixtures/cases/binary-link-dangles/expected.json +1 -0
- package/fixtures/cases/quoted-link-definition/library/notes/draft.md +1 -1
- package/fixtures/cases/shortcut-reference-link/library/item.md +1 -1
- package/fixtures/cases/truncated-link-definition/library/notes/draft.md +1 -1
- package/fixtures/cases/unresolved-link/library/item.md +1 -1
- package/package.json +4 -2
- package/fixtures/cases/missing-binary-link/expected.json +0 -5
- /package/fixtures/cases/{missing-binary-image → binary-image-dangles}/context.json +0 -0
- /package/fixtures/cases/{missing-binary-image → binary-image-dangles}/library/notes/draft.md +0 -0
- /package/fixtures/cases/{missing-binary-image → binary-image-dangles}/schema.yaml +0 -0
- /package/fixtures/cases/{missing-binary-link → binary-link-dangles}/context.json +0 -0
- /package/fixtures/cases/{missing-binary-link → binary-link-dangles}/library/notes/draft.md +0 -0
- /package/fixtures/cases/{missing-binary-link → binary-link-dangles}/schema.yaml +0 -0
package/dist/condition.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"condition.d.ts","sourceRoot":"","sources":["../src/condition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"condition.d.ts","sourceRoot":"","sources":["../src/condition.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,UAAU,EAChB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG1D,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAA;CAAE,CAAC;AAElF,MAAM,MAAM,aAAa,GACrB;IAAE,QAAQ,CAAC,GAAG,EAAE,SAAS,aAAa,EAAE,CAAA;CAAE,GAC1C;IAAE,QAAQ,CAAC,GAAG,EAAE,SAAS,aAAa,EAAE,CAAA;CAAE,GAC1C;IAAE,QAAQ,CAAC,GA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js';
|
|
1
2
|
import { target } from './paths.js';
|
|
2
|
-
import { isRecord } from './yaml.js';
|
|
3
|
+
import { isRecord, plain } from './yaml.js';
|
|
3
4
|
export const WRITE_DOORS = ['browser', 'agent', 'client'];
|
|
5
|
+
const PROSE = { kind: 'prose' };
|
|
6
|
+
const NULL = { kind: 'null' };
|
|
7
|
+
const UNREADABLE = { kind: 'unreadable' };
|
|
8
|
+
const UNREAD = { present: undefined, values: [undefined], items: [undefined] };
|
|
9
|
+
const NO_ITEM = { present: false, values: [], items: [] };
|
|
4
10
|
const DATE = /^\d{4}-\d{2}-\d{2}$/u;
|
|
5
11
|
const DATE_TIME = /^(\d{4})-(\d{2})-(\d{2})[Tt](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(?:[Zz]|([+-])(\d{2}):(\d{2}))$/u;
|
|
6
|
-
const ARRAY_INDEX = /^(?:0|[1-9][0-9]*)$/u;
|
|
7
12
|
export function factKind(facts) {
|
|
8
13
|
if (facts.reference !== undefined)
|
|
9
14
|
return 'reference';
|
|
@@ -21,9 +26,6 @@ export function factKind(facts) {
|
|
|
21
26
|
return 'time';
|
|
22
27
|
return 'string';
|
|
23
28
|
}
|
|
24
|
-
function referenced(model, facts) {
|
|
25
|
-
return (facts.reference ?? []).some((to) => Object.hasOwn(model.types, to) && model.types[to].memberDocument);
|
|
26
|
-
}
|
|
27
29
|
function fits(kind, facts, value) {
|
|
28
30
|
if (!scalar(value))
|
|
29
31
|
return false;
|
|
@@ -41,81 +43,156 @@ function fits(kind, facts, value) {
|
|
|
41
43
|
return instant(value) !== undefined;
|
|
42
44
|
return true;
|
|
43
45
|
}
|
|
44
|
-
function
|
|
45
|
-
if (
|
|
46
|
-
return
|
|
46
|
+
function factOf(value, declared, place) {
|
|
47
|
+
if (value === null)
|
|
48
|
+
return NULL;
|
|
49
|
+
if (Array.isArray(value)) {
|
|
50
|
+
if (declared?.type !== undefined && declared.type !== 'array')
|
|
51
|
+
return UNREADABLE;
|
|
52
|
+
return {
|
|
53
|
+
kind: 'list',
|
|
54
|
+
items: value.map((item, index) => factOf(item, declared === undefined ? undefined : itemFacts(declared, index), place)),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
if (plain(value)) {
|
|
58
|
+
if (declared?.type !== undefined && declared.type !== 'object')
|
|
59
|
+
return UNREADABLE;
|
|
60
|
+
const fields = Object.create(null);
|
|
61
|
+
for (const [key, held] of Object.entries(value))
|
|
62
|
+
fields[key] = factOf(held, declared === undefined ? undefined : memberFacts(declared, key), place);
|
|
63
|
+
return { kind: 'object', fields };
|
|
64
|
+
}
|
|
65
|
+
if (declared?.type === 'array' || declared?.type === 'object')
|
|
66
|
+
return UNREADABLE;
|
|
67
|
+
const kind = declared === undefined || declared.prose ? null : factKind(declared);
|
|
68
|
+
if (kind === null)
|
|
69
|
+
return PROSE;
|
|
70
|
+
if (!fits(kind, declared, value))
|
|
71
|
+
return UNREADABLE;
|
|
47
72
|
if (kind !== 'reference')
|
|
48
|
-
return { value };
|
|
49
|
-
const reached = target(path, value);
|
|
50
|
-
|
|
73
|
+
return { kind, value };
|
|
74
|
+
const reached = target(place.path, value);
|
|
75
|
+
const resolved = reached === null ? undefined : place.resolve(reached);
|
|
76
|
+
if (resolved === undefined)
|
|
77
|
+
return UNREADABLE;
|
|
78
|
+
return resolved.member === undefined
|
|
79
|
+
? { kind, value: resolved.id }
|
|
80
|
+
: { kind, value: resolved.id, member: resolved.member };
|
|
51
81
|
}
|
|
52
82
|
export function facts(document, at, model, resolve) {
|
|
53
83
|
const type = document.type ?? null;
|
|
54
84
|
const definition = type !== null && Object.hasOwn(model.types, type) ? model.types[type] : null;
|
|
55
|
-
const fields =
|
|
56
|
-
const
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
if (value === undefined || value === null)
|
|
62
|
-
continue;
|
|
63
|
-
const list = declared.type === 'array';
|
|
64
|
-
const facts = list ? declared.items : declared;
|
|
65
|
-
const kind = facts === undefined || facts.prose ? null : factKind(facts);
|
|
66
|
-
if (kind === null) {
|
|
67
|
-
prose.push(`/fields/${name}`);
|
|
68
|
-
continue;
|
|
69
|
-
}
|
|
70
|
-
const items = list ? value : [value];
|
|
71
|
-
const held = Array.isArray(items)
|
|
72
|
-
? items.map((item) => fitted(kind, facts, item, at.path, resolve))
|
|
73
|
-
: [undefined];
|
|
74
|
-
if (held.some((item) => item === undefined)) {
|
|
75
|
-
unreadable.push(`/fields/${name}`);
|
|
76
|
-
if (referenced(model, facts))
|
|
77
|
-
unreadable.push(`/members/${name}`);
|
|
78
|
-
continue;
|
|
79
|
-
}
|
|
80
|
-
const values = held.map((item) => ('id' in item ? item.id : item.value));
|
|
81
|
-
fields[name] = { kind, value: list ? values : values[0] };
|
|
82
|
-
if (!referenced(model, facts))
|
|
83
|
-
continue;
|
|
84
|
-
const bound = held.flatMap((item) => 'member' in item && item.member !== undefined ? [item.member] : []);
|
|
85
|
-
if (list)
|
|
86
|
-
members[name] = bound;
|
|
87
|
-
else if (bound[0] !== undefined)
|
|
88
|
-
members[name] = bound[0];
|
|
85
|
+
const fields = Object.create(null);
|
|
86
|
+
const place = { path: at.path, resolve };
|
|
87
|
+
for (const [name, value] of Object.entries(document.fields)) {
|
|
88
|
+
const declared = definition === null ? undefined : fieldFacts(definition, name);
|
|
89
|
+
if (declared !== undefined)
|
|
90
|
+
fields[name] = factOf(value, declared, place);
|
|
89
91
|
}
|
|
90
92
|
return {
|
|
91
93
|
id: at.id,
|
|
92
94
|
path: `/${at.path}`,
|
|
93
95
|
type,
|
|
94
96
|
fields,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
97
|
+
sections: Object.keys(document.sections).sort(),
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
function rootOf(facts, prefix) {
|
|
101
|
+
return { pointer: prefix, fact: { kind: 'object', fields: facts.fields } };
|
|
102
|
+
}
|
|
103
|
+
export function prosePaths(facts) {
|
|
104
|
+
const paths = facts.sections.map((heading) => `/sections/${heading}`);
|
|
105
|
+
const visit = ({ pointer, fact }) => {
|
|
106
|
+
if (fact.kind === 'prose')
|
|
107
|
+
paths.push(pointer);
|
|
108
|
+
if (fact.kind === 'list')
|
|
109
|
+
fact.items.forEach((item, index) => visit({ pointer: `${pointer}/${index}`, fact: item }));
|
|
110
|
+
if (fact.kind === 'object')
|
|
111
|
+
for (const [key, held] of Object.entries(fact.fields))
|
|
112
|
+
visit({ pointer: `${pointer}/${escapePointer(key)}`, fact: held });
|
|
113
|
+
};
|
|
114
|
+
visit(rootOf(facts, '/fields'));
|
|
115
|
+
return paths.sort();
|
|
116
|
+
}
|
|
117
|
+
function walked(start, pointer) {
|
|
118
|
+
let reached = [start];
|
|
119
|
+
let several = false;
|
|
120
|
+
let missing = false;
|
|
121
|
+
const each = (from, next) => from.flatMap((one) => {
|
|
122
|
+
const found = next(one);
|
|
123
|
+
if (found === null)
|
|
124
|
+
missing = true;
|
|
125
|
+
return found ?? [];
|
|
126
|
+
});
|
|
127
|
+
for (const token of pointerSegments(pointer)) {
|
|
128
|
+
const step = ({ pointer: at, fact }) => {
|
|
129
|
+
if (fact.kind === 'unreadable')
|
|
130
|
+
return [{ pointer: at, fact }];
|
|
131
|
+
if (fact.kind === 'object')
|
|
132
|
+
return Object.hasOwn(fact.fields, token)
|
|
133
|
+
? [{ pointer: `${at}/${escapePointer(token)}`, fact: fact.fields[token] }]
|
|
134
|
+
: null;
|
|
135
|
+
if (fact.kind !== 'list')
|
|
136
|
+
return null;
|
|
137
|
+
if (ARRAY_INDEX.test(token)) {
|
|
138
|
+
const item = fact.items[Number(token)];
|
|
139
|
+
return item === undefined ? null : [{ pointer: `${at}/${token}`, fact: item }];
|
|
140
|
+
}
|
|
141
|
+
several = true;
|
|
142
|
+
return each(fact.items.map((item, index) => ({ pointer: `${at}/${index}`, fact: item })), step);
|
|
143
|
+
};
|
|
144
|
+
reached = each(reached, step);
|
|
145
|
+
}
|
|
146
|
+
return { reached, several, missing };
|
|
147
|
+
}
|
|
148
|
+
function expand(fact) {
|
|
149
|
+
return fact.kind === 'list' ? fact.items.flatMap(expand) : [fact];
|
|
150
|
+
}
|
|
151
|
+
function fieldHeld(fact) {
|
|
152
|
+
if (fact.kind === 'unreadable')
|
|
153
|
+
return undefined;
|
|
154
|
+
if (fact.kind === 'null')
|
|
155
|
+
return { kind: 'null' };
|
|
156
|
+
return 'value' in fact ? { kind: fact.kind, value: fact.value } : { kind: 'prose' };
|
|
157
|
+
}
|
|
158
|
+
function memberHeld(fact) {
|
|
159
|
+
if (fact.kind === 'unreadable')
|
|
160
|
+
return undefined;
|
|
161
|
+
return fact.kind === 'reference' && fact.member !== undefined
|
|
162
|
+
? { kind: 'member', value: fact.member }
|
|
163
|
+
: null;
|
|
164
|
+
}
|
|
165
|
+
function single(held) {
|
|
166
|
+
return { present: true, values: [held], items: null };
|
|
167
|
+
}
|
|
168
|
+
function documentRead({ reached, several, missing }, held) {
|
|
169
|
+
if (reached.length === 0)
|
|
170
|
+
return missing ? undefined : NO_ITEM;
|
|
171
|
+
const facts = reached.map(({ fact }) => fact);
|
|
172
|
+
const kept = (all) => all.map(held).filter((value) => value !== null);
|
|
173
|
+
const unknown = missing ? [undefined] : [];
|
|
174
|
+
const values = kept(facts.filter((fact) => fact.kind !== 'list'));
|
|
175
|
+
const listed = several || facts.some((fact) => fact.kind === 'list');
|
|
176
|
+
const present = facts.some((fact) => fact.kind === 'list') || values.some(Boolean);
|
|
177
|
+
return {
|
|
178
|
+
present: present ? true : values.length > 0 ? undefined : false,
|
|
179
|
+
values: [...values, ...unknown],
|
|
180
|
+
items: listed ? [...kept(facts.flatMap(expand)), ...unknown] : null,
|
|
98
181
|
};
|
|
99
182
|
}
|
|
100
183
|
function readDocument(facts, path) {
|
|
101
184
|
if (path === '/path')
|
|
102
|
-
return { kind: 'path', value: facts.path };
|
|
185
|
+
return single({ kind: 'path', value: facts.path });
|
|
103
186
|
if (path === '/type')
|
|
104
|
-
return facts.type === null ? undefined : { kind: 'string', value: facts.type };
|
|
105
|
-
if (
|
|
106
|
-
return
|
|
107
|
-
|
|
108
|
-
return { kind: 'present' };
|
|
109
|
-
if (path.startsWith('/fields/')) {
|
|
110
|
-
const name = path.slice('/fields/'.length);
|
|
111
|
-
return Object.hasOwn(facts.fields, name) ? facts.fields[name] : undefined;
|
|
112
|
-
}
|
|
113
|
-
if (path.startsWith('/members/')) {
|
|
114
|
-
const name = path.slice('/members/'.length);
|
|
115
|
-
return Object.hasOwn(facts.members, name)
|
|
116
|
-
? { kind: 'member', value: facts.members[name] }
|
|
187
|
+
return facts.type === null ? undefined : single({ kind: 'string', value: facts.type });
|
|
188
|
+
if (path.startsWith('/sections/'))
|
|
189
|
+
return facts.sections.includes(path.slice('/sections/'.length))
|
|
190
|
+
? single({ kind: 'prose' })
|
|
117
191
|
: undefined;
|
|
118
|
-
|
|
192
|
+
if (path.startsWith('/fields/'))
|
|
193
|
+
return documentRead(walked(rootOf(facts, '/fields'), path.slice('/fields'.length)), fieldHeld);
|
|
194
|
+
if (path.startsWith('/members/'))
|
|
195
|
+
return documentRead(walked(rootOf(facts, '/members'), path.slice('/members'.length)), memberHeld);
|
|
119
196
|
return undefined;
|
|
120
197
|
}
|
|
121
198
|
function readActor(actor, path) {
|
|
@@ -126,13 +203,13 @@ function readActor(actor, path) {
|
|
|
126
203
|
: path === '/door'
|
|
127
204
|
? actor.door
|
|
128
205
|
: undefined;
|
|
129
|
-
return value === undefined ? undefined : { kind: 'actor', value };
|
|
206
|
+
return value === undefined ? undefined : single({ kind: 'actor', value });
|
|
130
207
|
}
|
|
131
|
-
function
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
208
|
+
export function datePointers(fields) {
|
|
209
|
+
return Object.entries(fields)
|
|
210
|
+
.filter(([, facts]) => facts.type === 'string' && facts.format === 'date')
|
|
211
|
+
.map(([name]) => `/fields/${name}`)
|
|
212
|
+
.sort();
|
|
136
213
|
}
|
|
137
214
|
export function dated(value) {
|
|
138
215
|
return (typeof value === 'string' && DATE.test(value) && instant(`${value}T00:00:00Z`) !== undefined);
|
|
@@ -187,8 +264,6 @@ function scalar(value) {
|
|
|
187
264
|
(typeof value === 'number' && Number.isFinite(value)));
|
|
188
265
|
}
|
|
189
266
|
function jsonHeld(value) {
|
|
190
|
-
if (value === undefined)
|
|
191
|
-
return undefined;
|
|
192
267
|
if (typeof value === 'string')
|
|
193
268
|
return {
|
|
194
269
|
kind: dated(value) ? 'date' : instant(value) === undefined ? 'string' : 'time',
|
|
@@ -196,44 +271,47 @@ function jsonHeld(value) {
|
|
|
196
271
|
};
|
|
197
272
|
if (typeof value === 'boolean')
|
|
198
273
|
return { kind: 'boolean', value };
|
|
274
|
+
return { kind: 'number', value };
|
|
275
|
+
}
|
|
276
|
+
function jsonRead(value) {
|
|
277
|
+
if (value === undefined)
|
|
278
|
+
return undefined;
|
|
199
279
|
if (scalar(value))
|
|
200
|
-
return
|
|
201
|
-
if (Array.isArray(value))
|
|
202
|
-
return { kind: '
|
|
203
|
-
return {
|
|
280
|
+
return single(jsonHeld(value));
|
|
281
|
+
if (!Array.isArray(value))
|
|
282
|
+
return single({ kind: 'prose' });
|
|
283
|
+
return { present: true, values: [], items: value.filter(scalar).map(jsonHeld), loose: true };
|
|
204
284
|
}
|
|
205
285
|
function readItem(item, path) {
|
|
206
286
|
if (path.startsWith('/json/')) {
|
|
207
287
|
if (item.json === null)
|
|
208
|
-
return
|
|
209
|
-
return
|
|
288
|
+
return UNREAD;
|
|
289
|
+
return jsonRead(pointed(item.json.value, path.slice('/json'.length)));
|
|
210
290
|
}
|
|
211
291
|
if (path.startsWith('/headers/')) {
|
|
212
292
|
const name = path.slice('/headers/'.length);
|
|
213
293
|
return Object.hasOwn(item.headers, name)
|
|
214
|
-
? { kind: 'string', value: item.headers[name] }
|
|
294
|
+
? single({ kind: 'string', value: item.headers[name] })
|
|
215
295
|
: undefined;
|
|
216
296
|
}
|
|
217
297
|
if (path === '/has_attachment')
|
|
218
|
-
return { kind: 'boolean', value: item.has_attachment };
|
|
298
|
+
return single({ kind: 'boolean', value: item.has_attachment });
|
|
219
299
|
const value = path === '/delivery'
|
|
220
300
|
? item.delivery
|
|
221
301
|
: path === '/source'
|
|
222
302
|
? item.source
|
|
223
|
-
: path === '/
|
|
224
|
-
? item.
|
|
225
|
-
: path === '/
|
|
226
|
-
? item.
|
|
227
|
-
:
|
|
228
|
-
|
|
229
|
-
: null;
|
|
230
|
-
return value === null ? undefined : { kind: 'string', value };
|
|
303
|
+
: path === '/container'
|
|
304
|
+
? item.container
|
|
305
|
+
: path === '/author'
|
|
306
|
+
? item.author
|
|
307
|
+
: null;
|
|
308
|
+
return value === null ? undefined : single({ kind: 'string', value });
|
|
231
309
|
}
|
|
232
310
|
function wanted(value, owner) {
|
|
233
311
|
return isRecord(value) && value.owner === true ? owner : value;
|
|
234
312
|
}
|
|
235
313
|
function equal(held, value, owner) {
|
|
236
|
-
if (
|
|
314
|
+
if (!('value' in held))
|
|
237
315
|
return undefined;
|
|
238
316
|
const expected = wanted(value, owner);
|
|
239
317
|
if (typeof expected !== typeof held.value)
|
|
@@ -248,7 +326,7 @@ function sign(left, right) {
|
|
|
248
326
|
return left < right ? -1 : left > right ? 1 : 0;
|
|
249
327
|
}
|
|
250
328
|
function ordered(held, value, compare) {
|
|
251
|
-
if (
|
|
329
|
+
if (!('value' in held))
|
|
252
330
|
return undefined;
|
|
253
331
|
if (held.kind === 'number') {
|
|
254
332
|
if (typeof value !== 'number' || typeof held.value !== 'number')
|
|
@@ -278,29 +356,13 @@ function allOf(truths) {
|
|
|
278
356
|
return false;
|
|
279
357
|
return truths.some((truth) => truth === undefined) ? undefined : true;
|
|
280
358
|
}
|
|
281
|
-
function
|
|
282
|
-
if (held?.kind === 'unreadable')
|
|
283
|
-
return undefined;
|
|
284
|
-
if ('exists' in test)
|
|
285
|
-
return (held !== undefined) === test.exists;
|
|
286
|
-
if (held === undefined)
|
|
287
|
-
return undefined;
|
|
359
|
+
function compared(test, held, owner) {
|
|
288
360
|
if ('eq' in test)
|
|
289
361
|
return equal(held, test.eq, owner);
|
|
290
362
|
if ('in' in test)
|
|
291
363
|
return anyOf(test.in.map((value) => equal(held, value, owner)));
|
|
292
|
-
if ('contains' in test) {
|
|
293
|
-
if (held.kind === 'present' || !Array.isArray(held.value))
|
|
294
|
-
return undefined;
|
|
295
|
-
const expected = wanted(test.contains, owner);
|
|
296
|
-
if (held.value.some((item) => item === expected))
|
|
297
|
-
return true;
|
|
298
|
-
if (held.kind === 'list')
|
|
299
|
-
return false;
|
|
300
|
-
return held.value.every((item) => typeof item === typeof expected) ? false : undefined;
|
|
301
|
-
}
|
|
302
364
|
if ('prefix' in test) {
|
|
303
|
-
if (
|
|
365
|
+
if (!('value' in held) || typeof held.value !== 'string')
|
|
304
366
|
return undefined;
|
|
305
367
|
if (held.kind === 'number' || held.kind === 'reference' || held.kind === 'member')
|
|
306
368
|
return undefined;
|
|
@@ -314,6 +376,23 @@ function leaf(test, held, owner) {
|
|
|
314
376
|
return ordered(held, test.lt, (sign) => sign < 0);
|
|
315
377
|
return ordered(held, test.lte, (sign) => sign <= 0);
|
|
316
378
|
}
|
|
379
|
+
function leaf(test, read, owner) {
|
|
380
|
+
if ('exists' in test) {
|
|
381
|
+
const present = read === undefined ? false : read.present;
|
|
382
|
+
return present === undefined ? undefined : present === test.exists;
|
|
383
|
+
}
|
|
384
|
+
if (read === undefined)
|
|
385
|
+
return undefined;
|
|
386
|
+
if ('contains' in test) {
|
|
387
|
+
if (read.items === null)
|
|
388
|
+
return undefined;
|
|
389
|
+
const truths = read.items.map((item) => item === undefined ? undefined : equal(item, test.contains, owner));
|
|
390
|
+
return read.loose === true && !truths.includes(true) ? false : anyOf(truths);
|
|
391
|
+
}
|
|
392
|
+
if (read.values.length === 0)
|
|
393
|
+
return read === NO_ITEM ? false : undefined;
|
|
394
|
+
return anyOf(read.values.map((value) => (value === undefined ? undefined : compared(test, value, owner))));
|
|
395
|
+
}
|
|
317
396
|
function evaluated(test, read, owner) {
|
|
318
397
|
if ('all' in test)
|
|
319
398
|
return allOf(test.all.map((part) => evaluated(part, read, owner)));
|
|
@@ -342,24 +421,51 @@ function matched(condition, test, document, owner) {
|
|
|
342
421
|
return false;
|
|
343
422
|
return test === undefined || holds(test, document, owner) === true;
|
|
344
423
|
}
|
|
345
|
-
function
|
|
346
|
-
|
|
424
|
+
function reachedAt(document, field) {
|
|
425
|
+
if (document === null)
|
|
426
|
+
return [];
|
|
427
|
+
if (field.startsWith('/sections/'))
|
|
428
|
+
return document.sections.includes(field.slice('/sections/'.length))
|
|
429
|
+
? [{ pointer: field, fact: PROSE }]
|
|
430
|
+
: [];
|
|
431
|
+
if (!field.startsWith('/fields/'))
|
|
432
|
+
return [];
|
|
433
|
+
return walked(rootOf(document, '/fields'), field.slice('/fields'.length)).reached;
|
|
434
|
+
}
|
|
435
|
+
function valueOf(fact) {
|
|
436
|
+
if (fact.kind === 'list')
|
|
437
|
+
return { kind: fact.kind, items: fact.items.map(valueOf) };
|
|
438
|
+
if (fact.kind === 'object')
|
|
439
|
+
return {
|
|
440
|
+
kind: fact.kind,
|
|
441
|
+
fields: Object.keys(fact.fields)
|
|
442
|
+
.sort()
|
|
443
|
+
.map((key) => [key, valueOf(fact.fields[key])]),
|
|
444
|
+
};
|
|
445
|
+
if (fact.kind === 'time') {
|
|
446
|
+
const at = instant(fact.value);
|
|
447
|
+
if (at !== undefined)
|
|
448
|
+
return { kind: fact.kind, at: String(at) };
|
|
449
|
+
}
|
|
450
|
+
return 'value' in fact ? { kind: fact.kind, value: fact.value } : fact;
|
|
451
|
+
}
|
|
452
|
+
function signature(reached) {
|
|
453
|
+
return JSON.stringify(reached.map(({ fact }) => valueOf(fact)));
|
|
347
454
|
}
|
|
348
455
|
function among(values, document, field, owner) {
|
|
349
456
|
return holds({ path: field, in: values }, document, owner) === true;
|
|
350
457
|
}
|
|
351
458
|
function fieldChanged(condition, event, owner) {
|
|
352
459
|
const { field, from, to } = condition;
|
|
353
|
-
|
|
460
|
+
const before = reachedAt(event.before, field);
|
|
461
|
+
const after = reachedAt(event.after, field);
|
|
462
|
+
const pointers = [field, ...[...before, ...after].map(({ pointer }) => pointer)];
|
|
463
|
+
const prose = event.changed.some((changed) => pointers.some((pointer) => changed === pointer || changed.startsWith(`${pointer}/`)));
|
|
464
|
+
if (from === undefined && to === undefined && prose)
|
|
354
465
|
return true;
|
|
355
|
-
if (
|
|
356
|
-
return false;
|
|
357
|
-
const name = field.slice('/fields/'.length);
|
|
358
|
-
const before = event.before?.fields[name];
|
|
359
|
-
const after = event.after?.fields[name];
|
|
360
|
-
if (before === undefined && after === undefined)
|
|
466
|
+
if (before.length === 0 && after.length === 0)
|
|
361
467
|
return false;
|
|
362
|
-
if (event.before !== null && event.after !== null &&
|
|
468
|
+
if (event.before !== null && event.after !== null && signature(before) === signature(after))
|
|
363
469
|
return false;
|
|
364
470
|
if (from === 'new'
|
|
365
471
|
? event.before !== null
|
package/dist/definition.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export type ValueFacts = {
|
|
|
6
6
|
readonly values?: readonly unknown[];
|
|
7
7
|
readonly reference?: readonly string[];
|
|
8
8
|
readonly prose: boolean;
|
|
9
|
+
readonly conditional?: true;
|
|
9
10
|
readonly prefix?: readonly ValueFacts[];
|
|
10
11
|
readonly items?: ValueFacts;
|
|
11
12
|
readonly properties?: Readonly<Record<string, ValueFacts>>;
|
|
@@ -28,12 +29,26 @@ export type Shape = {
|
|
|
28
29
|
readonly schema: Readonly<Record<string, unknown>>;
|
|
29
30
|
readonly defs: Readonly<Record<string, unknown>>;
|
|
30
31
|
};
|
|
32
|
+
export type RuleValue = string | number | boolean | null;
|
|
33
|
+
export type Transition = {
|
|
34
|
+
readonly from: RuleValue;
|
|
35
|
+
readonly to: RuleValue;
|
|
36
|
+
readonly roles?: readonly string[];
|
|
37
|
+
};
|
|
38
|
+
export type FieldRules = {
|
|
39
|
+
readonly changeRoles?: readonly string[];
|
|
40
|
+
readonly initialRoles?: readonly string[];
|
|
41
|
+
readonly transitions?: readonly Transition[];
|
|
42
|
+
};
|
|
31
43
|
export type Definition = {
|
|
32
44
|
readonly name: string;
|
|
33
45
|
readonly memberDocument: boolean;
|
|
34
46
|
readonly frontmatter: ValueFacts;
|
|
35
47
|
readonly fields: Readonly<Record<string, ValueFacts>>;
|
|
36
48
|
readonly sections: Readonly<Record<string, SectionSpec>>;
|
|
49
|
+
readonly rules: Readonly<Record<string, FieldRules>>;
|
|
50
|
+
readonly createRoles?: readonly string[];
|
|
51
|
+
readonly deleteRoles?: readonly string[];
|
|
37
52
|
readonly shape: Shape;
|
|
38
53
|
};
|
|
39
54
|
export type Failure = {
|
|
@@ -53,5 +68,13 @@ export declare function refTarget(reference: string, defs: Readonly<Record<strin
|
|
|
53
68
|
export declare function valueFacts(node: unknown, defs: Readonly<Record<string, unknown>>): ValueFacts;
|
|
54
69
|
export declare function itemFacts(facts: ValueFacts, index: number): ValueFacts | undefined;
|
|
55
70
|
export declare function memberFacts(facts: ValueFacts, key: string): ValueFacts | undefined;
|
|
71
|
+
export type PointerFacts = {
|
|
72
|
+
readonly facts: ValueFacts;
|
|
73
|
+
readonly through: boolean;
|
|
74
|
+
readonly conditional: boolean;
|
|
75
|
+
};
|
|
76
|
+
export declare function crossedFacts(facts: ValueFacts): ValueFacts[];
|
|
77
|
+
export declare function fieldFacts(definition: Definition, key: string): ValueFacts | undefined;
|
|
78
|
+
export declare function pointerFacts(definition: Definition, pointer: string): PointerFacts | undefined;
|
|
56
79
|
export declare function readSchema(text: string): VerifiedModel | Failure;
|
|
57
80
|
//# sourceMappingURL=definition.d.ts.map
|
package/dist/definition.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../src/definition.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,Q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