@lambdaorm/base 3.11.0 → 4.0.0
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/CHANGELOG.md +46 -0
- package/LICENSE +54 -5
- package/README.md +1 -1
- package/package.json +2 -2
- package/repository/domain/queryable.d.ts +22 -0
- package/repository/domain/queryable.d.ts.map +1 -1
- package/schema/application/index.d.ts +1 -0
- package/schema/application/index.d.ts.map +1 -1
- package/schema/application/index.js +1 -0
- package/schema/application/index.js.map +1 -1
- package/schema/application/services/config/viewConfigService.d.ts +5 -2
- package/schema/application/services/config/viewConfigService.d.ts.map +1 -1
- package/schema/application/services/config/viewConfigService.js +3 -1
- package/schema/application/services/config/viewConfigService.js.map +1 -1
- package/schema/application/services/config/viewsConfigService.d.ts +25 -7
- package/schema/application/services/config/viewsConfigService.d.ts.map +1 -1
- package/schema/application/services/config/viewsConfigService.js +69 -28
- package/schema/application/services/config/viewsConfigService.js.map +1 -1
- package/schema/application/services/nodeCode.d.ts +14 -7
- package/schema/application/services/nodeCode.d.ts.map +1 -1
- package/schema/application/services/nodeCode.js +23 -17
- package/schema/application/services/nodeCode.js.map +1 -1
- package/schema/application/services/schemaExtender.d.ts.map +1 -1
- package/schema/application/services/schemaExtender.js +2 -1
- package/schema/application/services/schemaExtender.js.map +1 -1
- package/schema/application/services/schemaService.d.ts.map +1 -1
- package/schema/application/services/schemaService.js +3 -1
- package/schema/application/services/schemaService.js.map +1 -1
- package/schema/application/services/viewDomainService.d.ts +7 -5
- package/schema/application/services/viewDomainService.d.ts.map +1 -1
- package/schema/application/services/viewDomainService.js +16 -22
- package/schema/application/services/viewDomainService.js.map +1 -1
- package/schema/application/services/viewResolver.d.ts +69 -0
- package/schema/application/services/viewResolver.d.ts.map +1 -0
- package/schema/application/services/viewResolver.js +386 -0
- package/schema/application/services/viewResolver.js.map +1 -0
- package/schema/application/services/viewValidator.d.ts +9 -4
- package/schema/application/services/viewValidator.d.ts.map +1 -1
- package/schema/application/services/viewValidator.js +106 -33
- package/schema/application/services/viewValidator.js.map +1 -1
- package/schema/application/state.d.ts +1 -0
- package/schema/application/state.d.ts.map +1 -1
- package/schema/application/state.js +3 -1
- package/schema/application/state.js.map +1 -1
- package/schema/application/useCases/create.d.ts.map +1 -1
- package/schema/application/useCases/create.js +2 -0
- package/schema/application/useCases/create.js.map +1 -1
- package/schema/application/useCases/initialize.d.ts.map +1 -1
- package/schema/application/useCases/initialize.js +7 -2
- package/schema/application/useCases/initialize.js.map +1 -1
- package/schema/application/useCases/load.d.ts.map +1 -1
- package/schema/application/useCases/load.js +10 -6
- package/schema/application/useCases/load.js.map +1 -1
- package/schema/domain/errors.d.ts +10 -0
- package/schema/domain/errors.d.ts.map +1 -1
- package/schema/domain/errors.js +15 -1
- package/schema/domain/errors.js.map +1 -1
- package/schema/domain/schema.d.ts +54 -3
- package/schema/domain/schema.d.ts.map +1 -1
- package/schema/domain/schema.js.map +1 -1
- package/sentence/domain/metadata.d.ts +1 -0
- package/sentence/domain/metadata.d.ts.map +1 -1
- package/sentence/domain/sentence.d.ts +2 -0
- package/sentence/domain/sentence.d.ts.map +1 -1
- package/sentence/domain/sentence.js.map +1 -1
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ViewResolver = exports.specificity = exports.matchNames = exports.patternOf = exports.isPattern = exports.defaultView = exports.OWNER_ROLE = exports.DEFAULT_VIEW = void 0;
|
|
4
|
+
const domain_1 = require("../../domain");
|
|
5
|
+
/** the view of a query without options.view, and its role (docs/VIEWS.md §1) */
|
|
6
|
+
exports.DEFAULT_VIEW = 'default';
|
|
7
|
+
exports.OWNER_ROLE = 'owner';
|
|
8
|
+
/** the view default as a schema is generated with it, and assumed when it doesn't have it (docs/VIEWS.md §1) */
|
|
9
|
+
const defaultView = () => ({
|
|
10
|
+
name: exports.DEFAULT_VIEW,
|
|
11
|
+
entities: [{ name: '*' }],
|
|
12
|
+
roles: [{ name: exports.OWNER_ROLE, entities: [{ name: '*', read: true, write: true }] }]
|
|
13
|
+
});
|
|
14
|
+
exports.defaultView = defaultView;
|
|
15
|
+
/** whether a name is a pattern (*) */
|
|
16
|
+
const isPattern = (name) => name.includes('*');
|
|
17
|
+
exports.isPattern = isPattern;
|
|
18
|
+
/** a pattern with * as a regular expression on the whole name */
|
|
19
|
+
const patternOf = (name) => new RegExp('^' + name.split('*').map(p => p.replace(/[.+?^${}()|[\]\\]/g, '\\$&')).join('.*') + '$');
|
|
20
|
+
exports.patternOf = patternOf;
|
|
21
|
+
const patterns = new Map();
|
|
22
|
+
/** the names a name or a pattern matches (the regular expression of a pattern, once) */
|
|
23
|
+
const matchNames = (name, names) => {
|
|
24
|
+
if (!(0, exports.isPattern)(name))
|
|
25
|
+
return names.includes(name) ? [name] : [];
|
|
26
|
+
let regex = patterns.get(name);
|
|
27
|
+
if (!regex) {
|
|
28
|
+
regex = (0, exports.patternOf)(name);
|
|
29
|
+
patterns.set(name, regex);
|
|
30
|
+
}
|
|
31
|
+
return names.filter(p => regex.test(p));
|
|
32
|
+
};
|
|
33
|
+
exports.matchNames = matchNames;
|
|
34
|
+
/** how specific an entry is: an exact name beats a pattern; between patterns, the longest (without *) */
|
|
35
|
+
const specificity = (name) => (0, exports.isPattern)(name) ? name.replace(/\*/g, '').length : Number.MAX_SAFE_INTEGER;
|
|
36
|
+
exports.specificity = specificity;
|
|
37
|
+
const and = (a, b) => a && b ? `(${a}) && (${b})` : a ?? b;
|
|
38
|
+
/**
|
|
39
|
+
* The views of a schema resolved for each of its roles (docs/VIEWS.md, docs/VIEWS_AUTHORIZATION.md), once when the schema
|
|
40
|
+
* is loaded: the entities a view includes (names, patterns, childs), its properties (inclusion), and for each role its
|
|
41
|
+
* entities, properties, permissions and filters. The result is a view in the form ViewDomainService derives a domain from
|
|
42
|
+
* (the entities that aren't, exclude: true), so the domain of view.role is calculated as the one of a view.
|
|
43
|
+
*/
|
|
44
|
+
class ViewResolver {
|
|
45
|
+
/**
|
|
46
|
+
* entities: the loaded ones (concrete, with what they inherit); hierarchy: also the abstract ones with their extends
|
|
47
|
+
* (a view can say something of an abstract entity for the ones that extend it)
|
|
48
|
+
*/
|
|
49
|
+
resolve(views, entities, hierarchy = entities) {
|
|
50
|
+
const errors = [];
|
|
51
|
+
const result = [];
|
|
52
|
+
const all = this.withDefault(views);
|
|
53
|
+
for (const view of all) {
|
|
54
|
+
if (!view?.name)
|
|
55
|
+
continue;
|
|
56
|
+
const included = this.included(view, entities, hierarchy, errors);
|
|
57
|
+
const viewEntities = this.viewEntities(view, included, entities, hierarchy);
|
|
58
|
+
if (!view.roles || view.roles.length === 0) {
|
|
59
|
+
result.push(this.result(view, undefined, entities, viewEntities, undefined));
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
const roles = new Map();
|
|
63
|
+
for (const role of view.roles) {
|
|
64
|
+
if (!role?.name)
|
|
65
|
+
continue;
|
|
66
|
+
const resolved = this.role(view, role, included, roles, errors, []);
|
|
67
|
+
if (resolved)
|
|
68
|
+
result.push(this.result(view, role.name, entities, viewEntities, resolved));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return { views: result, errors };
|
|
72
|
+
}
|
|
73
|
+
/** the views with default (assumed when it isn't, and with the role owner when it has no roles) */
|
|
74
|
+
withDefault(views = []) {
|
|
75
|
+
const list = (views ?? []).filter(p => p?.name);
|
|
76
|
+
const index = list.findIndex(p => p.name === exports.DEFAULT_VIEW);
|
|
77
|
+
if (index === -1)
|
|
78
|
+
return [(0, exports.defaultView)(), ...list];
|
|
79
|
+
const written = list[index];
|
|
80
|
+
if (!written.roles || written.roles.length === 0) {
|
|
81
|
+
const completed = { ...written, entities: (written.entities ?? []).length > 0 ? written.entities : [{ name: '*' }], roles: (0, exports.defaultView)().roles };
|
|
82
|
+
return list.map((p, i) => i === index ? completed : p);
|
|
83
|
+
}
|
|
84
|
+
return list;
|
|
85
|
+
}
|
|
86
|
+
/** the entities a view includes: its names and patterns, and their children when childs (docs/VIEWS.md §3) */
|
|
87
|
+
included(view, entities, hierarchy, errors = []) {
|
|
88
|
+
const names = entities.filter(p => !p.abstract).map(p => p.name);
|
|
89
|
+
const byName = new Map(entities.map(p => [p.name, p]));
|
|
90
|
+
const written = new Set(hierarchy.map(p => p.name));
|
|
91
|
+
const entries = (view.entities ?? []).length > 0 ? view.entities : [{ name: '*' }];
|
|
92
|
+
const included = new Set();
|
|
93
|
+
for (const entry of entries) {
|
|
94
|
+
if (!entry?.name)
|
|
95
|
+
continue;
|
|
96
|
+
const matched = (0, exports.matchNames)(entry.name, names);
|
|
97
|
+
// an abstract entity: what it says reaches the ones that extend it, it adds none
|
|
98
|
+
if (matched.length === 0 && !(written.has(entry.name) && !(0, exports.isPattern)(entry.name))) {
|
|
99
|
+
errors.push(`view ${view.name}: ${entry.name} matches no entity`);
|
|
100
|
+
}
|
|
101
|
+
for (const name of matched) {
|
|
102
|
+
included.add(name);
|
|
103
|
+
if (entry.childs)
|
|
104
|
+
this.childs(name, byName, included);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return included;
|
|
108
|
+
}
|
|
109
|
+
/** the children of an entity: its manyToOne relations, all the levels of the composite ones, one of the others */
|
|
110
|
+
childs(name, byName, included, seen = new Set()) {
|
|
111
|
+
if (seen.has(name))
|
|
112
|
+
return;
|
|
113
|
+
seen.add(name);
|
|
114
|
+
for (const relation of byName.get(name)?.relations ?? []) {
|
|
115
|
+
if (relation.type !== domain_1.RelationType.manyToOne || !byName.has(relation.entity))
|
|
116
|
+
continue;
|
|
117
|
+
included.add(relation.entity);
|
|
118
|
+
if (relation.composite)
|
|
119
|
+
this.childs(relation.entity, byName, included, seen);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
/** the entry of the view (or of the role) for an entity that has a key: the most specific one that has it */
|
|
123
|
+
entryOf(entries, name, has) {
|
|
124
|
+
let found;
|
|
125
|
+
for (const entry of entries) {
|
|
126
|
+
if (!entry?.name || !has(entry) || (0, exports.matchNames)(entry.name, [name]).length === 0)
|
|
127
|
+
continue;
|
|
128
|
+
if (!found || (0, exports.specificity)(entry.name) > (0, exports.specificity)(found.name))
|
|
129
|
+
found = entry;
|
|
130
|
+
}
|
|
131
|
+
return found;
|
|
132
|
+
}
|
|
133
|
+
/** the chain of an entity: the abstract (and not) ones it extends, the farthest first, and itself */
|
|
134
|
+
chain(name, hierarchy) {
|
|
135
|
+
const byName = new Map(hierarchy.map(p => [p.name, p]));
|
|
136
|
+
const chain = [];
|
|
137
|
+
const seen = new Set();
|
|
138
|
+
let current = name;
|
|
139
|
+
while (current && !seen.has(current)) {
|
|
140
|
+
seen.add(current);
|
|
141
|
+
chain.unshift(current);
|
|
142
|
+
current = byName.get(current)?.extends;
|
|
143
|
+
}
|
|
144
|
+
return chain;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Each entity the view includes, as the view sees it: its properties (inclusion, docs/VIEWS.md §4) as the property
|
|
148
|
+
* views of a resolved view (the ones it doesn't include, exclude: true), and the filter of its rows
|
|
149
|
+
*/
|
|
150
|
+
viewEntities(view, included, entities, hierarchy) {
|
|
151
|
+
const result = new Map();
|
|
152
|
+
const entries = view.entities ?? [];
|
|
153
|
+
for (const entity of entities) {
|
|
154
|
+
if (!included.has(entity.name))
|
|
155
|
+
continue;
|
|
156
|
+
const chain = this.chain(entity.name, hierarchy);
|
|
157
|
+
// what the entities it extends say of their properties (exact names), and then the one of the entity
|
|
158
|
+
const modifiers = new Map();
|
|
159
|
+
for (const name of chain.slice(0, -1)) {
|
|
160
|
+
for (const property of entries.find(p => p.name === name)?.properties ?? []) {
|
|
161
|
+
if (!(0, exports.isPattern)(property.name))
|
|
162
|
+
modifiers.set(property.name, property);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
const own = this.entryOf(entries, entity.name, p => (p.properties ?? []).length > 0);
|
|
166
|
+
let filter;
|
|
167
|
+
for (const name of [...chain].reverse()) {
|
|
168
|
+
const entry = name === entity.name ? this.entryOf(entries, name, p => !!p.filter) : entries.find(p => p.name === name && !!p.filter);
|
|
169
|
+
if (entry?.filter) {
|
|
170
|
+
filter = entry.filter;
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
const domainNames = (entity.properties ?? []).map(p => p.name);
|
|
175
|
+
let names;
|
|
176
|
+
if (own) {
|
|
177
|
+
names = new Set();
|
|
178
|
+
for (const property of own.properties ?? []) {
|
|
179
|
+
if (!(0, exports.isPattern)(property.name))
|
|
180
|
+
modifiers.set(property.name, property);
|
|
181
|
+
if (property.exclude === true)
|
|
182
|
+
continue;
|
|
183
|
+
for (const name of (0, exports.matchNames)(property.name, domainNames))
|
|
184
|
+
names.add(name);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
names = new Set(domainNames);
|
|
189
|
+
}
|
|
190
|
+
// what is excluded, by the entity or by one it extends
|
|
191
|
+
for (const property of modifiers.values())
|
|
192
|
+
if (property.exclude === true)
|
|
193
|
+
names.delete(property.name);
|
|
194
|
+
for (const key of this.keys(entity, included))
|
|
195
|
+
names.add(key);
|
|
196
|
+
const properties = [];
|
|
197
|
+
for (const name of domainNames) {
|
|
198
|
+
const modifier = modifiers.get(name);
|
|
199
|
+
if (names.has(name)) {
|
|
200
|
+
if (modifier?.readExp)
|
|
201
|
+
properties.push({ name, readExp: modifier.readExp });
|
|
202
|
+
}
|
|
203
|
+
else if (modifier?.exclude === true && modifier.default !== undefined) {
|
|
204
|
+
properties.push({ name, exclude: true, default: modifier.default });
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
properties.push({ name, exclude: true });
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
// the new ones (not in the domain, with readExp)
|
|
211
|
+
const known = new Set(domainNames);
|
|
212
|
+
for (const modifier of modifiers.values()) {
|
|
213
|
+
if (known.has(modifier.name) || !modifier.readExp || modifier.exclude)
|
|
214
|
+
continue;
|
|
215
|
+
const added = { name: modifier.name, readExp: modifier.readExp };
|
|
216
|
+
if (modifier.type !== undefined)
|
|
217
|
+
added.type = modifier.type;
|
|
218
|
+
if (modifier.length !== undefined)
|
|
219
|
+
added.length = modifier.length;
|
|
220
|
+
if (modifier.description !== undefined)
|
|
221
|
+
added.description = modifier.description;
|
|
222
|
+
properties.push(added);
|
|
223
|
+
names.add(modifier.name);
|
|
224
|
+
}
|
|
225
|
+
result.set(entity.name, { properties, filter, names });
|
|
226
|
+
}
|
|
227
|
+
return result;
|
|
228
|
+
}
|
|
229
|
+
/** the keys λORM needs: the primary key and the fields of the relations to entities that are */
|
|
230
|
+
keys(entity, included) {
|
|
231
|
+
const keys = new Set(entity.primaryKey ?? []);
|
|
232
|
+
for (const relation of entity.relations ?? []) {
|
|
233
|
+
if (!included.has(relation.entity))
|
|
234
|
+
continue;
|
|
235
|
+
for (const key of relation.keys ?? [{ from: relation.from, to: relation.to }])
|
|
236
|
+
keys.add(key.from);
|
|
237
|
+
}
|
|
238
|
+
return [...keys];
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* A role resolved (docs/VIEWS_AUTHORIZATION.md §4, §9): the one it extends, complete, and over it its own entries
|
|
242
|
+
* (patterns expanded, entries combined): read and write are added, the expressions and properties of the most specific
|
|
243
|
+
* entry win, and the ones of the role over the ones of the role it extends
|
|
244
|
+
*/
|
|
245
|
+
role(view, role, included, done, errors, path) {
|
|
246
|
+
const resolved = done.get(role.name);
|
|
247
|
+
if (resolved)
|
|
248
|
+
return resolved;
|
|
249
|
+
if (path.includes(role.name)) {
|
|
250
|
+
errors.push(`view ${view.name}: the roles ${[...path, role.name].join(' -> ')} extend each other`);
|
|
251
|
+
return undefined;
|
|
252
|
+
}
|
|
253
|
+
let base = new Map();
|
|
254
|
+
if (role.extends) {
|
|
255
|
+
const parent = (view.roles ?? []).find(p => p.name === role.extends);
|
|
256
|
+
if (!parent) {
|
|
257
|
+
errors.push(`view ${view.name}, role ${role.name}: extends ${role.extends}, a role the view doesn't have`);
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
const parentResolved = this.role(view, parent, included, done, errors, [...path, role.name]);
|
|
261
|
+
if (parentResolved)
|
|
262
|
+
base = new Map([...parentResolved].map(([k, v]) => [k, { ...v }]));
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
const names = [...included];
|
|
266
|
+
const own = new Map();
|
|
267
|
+
const entries = role.entities ?? [];
|
|
268
|
+
for (const entry of entries) {
|
|
269
|
+
if (!entry?.name)
|
|
270
|
+
continue;
|
|
271
|
+
const matched = (0, exports.matchNames)(entry.name, names);
|
|
272
|
+
if (matched.length === 0)
|
|
273
|
+
errors.push(`view ${view.name}, role ${role.name}: ${entry.name} matches no entity of the view`);
|
|
274
|
+
for (const name of matched) {
|
|
275
|
+
const current = own.get(name) ?? { read: false, write: false };
|
|
276
|
+
current.read = current.read || entry.read === true || !!entry.readExp;
|
|
277
|
+
current.write = current.write || entry.write === true || !!entry.writeExp;
|
|
278
|
+
if (entry.read === false)
|
|
279
|
+
current.noRead = true;
|
|
280
|
+
if (entry.write === false)
|
|
281
|
+
current.noWrite = true;
|
|
282
|
+
own.set(name, current);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
for (const [name, current] of own) {
|
|
286
|
+
const readExp = this.entryOf(entries, name, p => !!p.readExp);
|
|
287
|
+
const writeExp = this.entryOf(entries, name, p => !!p.writeExp);
|
|
288
|
+
const properties = this.entryOf(entries, name, p => (p.properties ?? []).length > 0);
|
|
289
|
+
for (const [key, entry] of [['readExp', readExp], ['writeExp', writeExp]]) {
|
|
290
|
+
if (!entry)
|
|
291
|
+
continue;
|
|
292
|
+
const same = entries.filter(p => p !== entry && p[key] && p[key] !== entry[key] && (0, exports.specificity)(p.name) === (0, exports.specificity)(entry.name) && (0, exports.matchNames)(p.name, [name]).length > 0);
|
|
293
|
+
if (same.length > 0)
|
|
294
|
+
errors.push(`view ${view.name}, role ${role.name}: ${entry.name} and ${same[0].name} give ${name} different ${key}`);
|
|
295
|
+
}
|
|
296
|
+
if (readExp)
|
|
297
|
+
current.readExp = readExp.readExp;
|
|
298
|
+
if (writeExp)
|
|
299
|
+
current.writeExp = writeExp.writeExp;
|
|
300
|
+
if (properties)
|
|
301
|
+
current.properties = properties.properties;
|
|
302
|
+
const parent = base.get(name);
|
|
303
|
+
if (parent) {
|
|
304
|
+
base.set(name, {
|
|
305
|
+
read: current.noRead ? false : parent.read || current.read,
|
|
306
|
+
write: current.noWrite ? false : parent.write || current.write,
|
|
307
|
+
readExp: current.readExp ?? parent.readExp,
|
|
308
|
+
writeExp: current.writeExp ?? parent.writeExp,
|
|
309
|
+
properties: current.properties ?? parent.properties
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
base.set(name, { ...current, read: current.noRead ? false : current.read, write: current.noWrite ? false : current.write });
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
done.set(role.name, base);
|
|
317
|
+
return base;
|
|
318
|
+
}
|
|
319
|
+
result(view, role, entities, viewEntities, roleEntities) {
|
|
320
|
+
const name = role ? `${view.name}.${role}` : view.name;
|
|
321
|
+
const resolvedEntities = [];
|
|
322
|
+
const access = {};
|
|
323
|
+
let isDomain = !view.pii;
|
|
324
|
+
let isFull = true;
|
|
325
|
+
const inRole = (entity) => !roleEntities || ((roleEntities.get(entity)?.read || roleEntities.get(entity)?.write) ?? false);
|
|
326
|
+
const included = new Set([...viewEntities.keys()].filter(inRole));
|
|
327
|
+
for (const entity of entities) {
|
|
328
|
+
const seen = viewEntities.get(entity.name);
|
|
329
|
+
if (!seen || !inRole(entity.name)) {
|
|
330
|
+
if (!entity.abstract) {
|
|
331
|
+
resolvedEntities.push({ name: entity.name, exclude: true });
|
|
332
|
+
isDomain = false;
|
|
333
|
+
}
|
|
334
|
+
continue;
|
|
335
|
+
}
|
|
336
|
+
const roleEntity = roleEntities?.get(entity.name);
|
|
337
|
+
let properties = seen.properties;
|
|
338
|
+
let propertiesAccess;
|
|
339
|
+
const read = roleEntity ? roleEntity.read : true;
|
|
340
|
+
const write = roleEntity ? roleEntity.write : true;
|
|
341
|
+
if (roleEntity?.properties && roleEntity.properties.length > 0) {
|
|
342
|
+
// the ones of the role, among the ones of the view; the keys stay
|
|
343
|
+
const keys = new Set(this.keys(entity, included));
|
|
344
|
+
propertiesAccess = {};
|
|
345
|
+
for (const property of roleEntity.properties) {
|
|
346
|
+
for (const propertyName of (0, exports.matchNames)(property.name, [...seen.names])) {
|
|
347
|
+
// without read nor write, the ones of the entity; with one of them, only what it says (§6)
|
|
348
|
+
const said = property.read !== undefined || property.write !== undefined;
|
|
349
|
+
propertiesAccess[propertyName] = said ? { read: property.read === true, write: property.write === true } : { read, write };
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
for (const key of keys)
|
|
353
|
+
if (!propertiesAccess[key] && seen.names.has(key))
|
|
354
|
+
propertiesAccess[key] = { read: true, write };
|
|
355
|
+
const kept = new Set(Object.keys(propertiesAccess));
|
|
356
|
+
const out = new Set(properties.filter(p => p.exclude).map(p => p.name));
|
|
357
|
+
properties = [
|
|
358
|
+
...properties.filter(p => p.exclude || kept.has(p.name)),
|
|
359
|
+
...[...seen.names].filter(p => !kept.has(p) && !out.has(p) && (entity.properties ?? []).some(q => q.name === p)).map(p => ({ name: p, exclude: true }))
|
|
360
|
+
];
|
|
361
|
+
}
|
|
362
|
+
const readFilter = and(seen.filter, roleEntity?.readExp);
|
|
363
|
+
// writeExp: 'true' writes without a filter (instead of the one of its readExp, §5)
|
|
364
|
+
const writeExp = roleEntity?.writeExp?.trim() === 'true' ? undefined : roleEntity?.writeExp ?? roleEntity?.readExp;
|
|
365
|
+
const writeFilter = and(seen.filter, writeExp);
|
|
366
|
+
if (properties.length > 0 || readFilter || writeFilter) {
|
|
367
|
+
isDomain = false;
|
|
368
|
+
resolvedEntities.push({ name: entity.name, properties, ...(readFilter ? { readFilter } : {}), ...(writeFilter ? { writeFilter } : {}) });
|
|
369
|
+
}
|
|
370
|
+
access[entity.name] = { read, write, ...(propertiesAccess ? { properties: propertiesAccess } : {}), ...(writeFilter ? { writeFilter: true } : {}) };
|
|
371
|
+
if (!read || !write || propertiesAccess || writeFilter)
|
|
372
|
+
isFull = false;
|
|
373
|
+
}
|
|
374
|
+
return {
|
|
375
|
+
name,
|
|
376
|
+
view: view.name,
|
|
377
|
+
role,
|
|
378
|
+
resolved: { name, pii: view.pii, entities: resolvedEntities },
|
|
379
|
+
access: { view: view.name, role, entities: access },
|
|
380
|
+
isDomain,
|
|
381
|
+
isFull
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
exports.ViewResolver = ViewResolver;
|
|
386
|
+
//# sourceMappingURL=viewResolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewResolver.js","sourceRoot":"","sources":["../../../../../src/lib/schema/application/services/viewResolver.ts"],"names":[],"mappings":";;;AAAA,yCAAuH;AAEvH,gFAAgF;AACnE,QAAA,YAAY,GAAG,SAAS,CAAA;AACxB,QAAA,UAAU,GAAG,OAAO,CAAA;AAEjC,gHAAgH;AACzG,MAAM,WAAW,GAAG,GAAS,EAAE,CAAC,CAAC;IACvC,IAAI,EAAE,oBAAY;IAClB,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;IACzB,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,kBAAU,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;CACjF,CAAC,CAAA;AAJW,QAAA,WAAW,eAItB;AA4BF,sCAAsC;AAC/B,MAAM,SAAS,GAAG,CAAC,IAAY,EAAW,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AAAzD,QAAA,SAAS,aAAgD;AAEtE,iEAAi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;CACD;AA7SD,oCA6SC"}
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import { Expressions } from '3xpr';
|
|
2
2
|
import { Entity, View } from '../../domain';
|
|
3
3
|
/**
|
|
4
|
-
* The views of a schema, checked when it is loaded (docs/VIEWS.md §10
|
|
5
|
-
*
|
|
4
|
+
* The views of a schema as written, checked when it is loaded (docs/VIEWS.md §10, docs/VIEWS_AUTHORIZATION.md §11): the
|
|
5
|
+
* entities and properties they include exist, a new property has its readExp and a valid type, the readExp, the filters
|
|
6
|
+
* and the expressions of the roles compile on the properties of the entity. What a view or a role names (patterns,
|
|
7
|
+
* childs, extends) is checked when it is resolved (ViewResolver).
|
|
6
8
|
*/
|
|
7
9
|
export declare class ViewValidator {
|
|
8
10
|
private readonly exp;
|
|
9
11
|
constructor(exp: Expressions);
|
|
10
12
|
validate(views?: View[], entities?: Entity[]): string[];
|
|
13
|
+
/** the entities a name or a pattern of a view names (an abstract one only by its name) */
|
|
14
|
+
private entitiesOf;
|
|
15
|
+
private roles;
|
|
11
16
|
private properties;
|
|
12
|
-
/** the filter of the
|
|
13
|
-
private
|
|
17
|
+
/** a condition on the rows (filter of the view, readExp / writeExp of a role): it compiles and reads properties of the entity and the context */
|
|
18
|
+
private condition;
|
|
14
19
|
/** the properties of an entity and of the ones it extends */
|
|
15
20
|
private propertiesOf;
|
|
16
21
|
private defaultOf;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewValidator.d.ts","sourceRoot":"","sources":["../../../../../src/lib/schema/application/services/viewValidator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAA;AAElC,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"viewValidator.d.ts","sourceRoot":"","sources":["../../../../../src/lib/schema/application/services/viewValidator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAA;AAElC,OAAO,EAAE,MAAM,EAAgB,IAAI,EAAE,MAAM,cAAc,CAAA;AAMzD;;;;;GAKG;AACH,qBAAa,aAAa;IAEZ,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,WAAW;IAEvC,QAAQ,CAAE,KAAK,GAAE,IAAI,EAAO,EAAE,QAAQ,GAAE,MAAM,EAAO,GAAG,MAAM,EAAE;IA2CvE,0FAA0F;IAC1F,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,KAAK;IAqCb,OAAO,CAAC,UAAU;IAuDlB,iJAAiJ;IACjJ,OAAO,CAAC,SAAS;IAYjB,6DAA6D;IAC7D,OAAO,CAAC,YAAY;IAYpB,OAAO,CAAC,SAAS;IAUjB,OAAO,CAAC,IAAI;CAIZ"}
|