@ifc-lite/ids 1.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/LICENSE +373 -0
- package/README.md +76 -0
- package/dist/constraints/index.d.ts +17 -0
- package/dist/constraints/index.d.ts.map +1 -0
- package/dist/constraints/index.js +226 -0
- package/dist/constraints/index.js.map +1 -0
- package/dist/facets/attribute-facet.d.ts +10 -0
- package/dist/facets/attribute-facet.d.ts.map +1 -0
- package/dist/facets/attribute-facet.js +107 -0
- package/dist/facets/attribute-facet.js.map +1 -0
- package/dist/facets/classification-facet.d.ts +10 -0
- package/dist/facets/classification-facet.d.ts.map +1 -0
- package/dist/facets/classification-facet.js +98 -0
- package/dist/facets/classification-facet.js.map +1 -0
- package/dist/facets/entity-facet.d.ts +18 -0
- package/dist/facets/entity-facet.d.ts.map +1 -0
- package/dist/facets/entity-facet.js +116 -0
- package/dist/facets/entity-facet.js.map +1 -0
- package/dist/facets/index.d.ts +31 -0
- package/dist/facets/index.d.ts.map +1 -0
- package/dist/facets/index.js +57 -0
- package/dist/facets/index.js.map +1 -0
- package/dist/facets/material-facet.d.ts +10 -0
- package/dist/facets/material-facet.d.ts.map +1 -0
- package/dist/facets/material-facet.js +67 -0
- package/dist/facets/material-facet.js.map +1 -0
- package/dist/facets/partof-facet.d.ts +10 -0
- package/dist/facets/partof-facet.d.ts.map +1 -0
- package/dist/facets/partof-facet.js +112 -0
- package/dist/facets/partof-facet.js.map +1 -0
- package/dist/facets/property-facet.d.ts +10 -0
- package/dist/facets/property-facet.d.ts.map +1 -0
- package/dist/facets/property-facet.js +156 -0
- package/dist/facets/property-facet.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/parser/xml-parser.d.ts +15 -0
- package/dist/parser/xml-parser.d.ts.map +1 -0
- package/dist/parser/xml-parser.js +486 -0
- package/dist/parser/xml-parser.js.map +1 -0
- package/dist/translation/index.d.ts +3 -0
- package/dist/translation/index.d.ts.map +1 -0
- package/dist/translation/index.js +6 -0
- package/dist/translation/index.js.map +1 -0
- package/dist/translation/locales/de.d.ts +189 -0
- package/dist/translation/locales/de.d.ts.map +1 -0
- package/dist/translation/locales/de.js +226 -0
- package/dist/translation/locales/de.js.map +1 -0
- package/dist/translation/locales/en.d.ts +190 -0
- package/dist/translation/locales/en.d.ts.map +1 -0
- package/dist/translation/locales/en.js +226 -0
- package/dist/translation/locales/en.js.map +1 -0
- package/dist/translation/locales/fr.d.ts +189 -0
- package/dist/translation/locales/fr.d.ts.map +1 -0
- package/dist/translation/locales/fr.js +226 -0
- package/dist/translation/locales/fr.js.map +1 -0
- package/dist/translation/locales/index.d.ts +4 -0
- package/dist/translation/locales/index.d.ts.map +1 -0
- package/dist/translation/locales/index.js +7 -0
- package/dist/translation/locales/index.js.map +1 -0
- package/dist/translation/service.d.ts +62 -0
- package/dist/translation/service.d.ts.map +1 -0
- package/dist/translation/service.js +569 -0
- package/dist/translation/service.js.map +1 -0
- package/dist/types.d.ts +407 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/dist/validation/validator.d.ts +9 -0
- package/dist/validation/validator.d.ts.map +1 -0
- package/dist/validation/validator.js +431 -0
- package/dist/validation/validator.js.map +1 -0
- package/package.json +51 -0
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
import { checkFacet, filterByFacet } from '../facets/index.js';
|
|
5
|
+
import { formatConstraint } from '../constraints/index.js';
|
|
6
|
+
/**
|
|
7
|
+
* Validate an IFC model against an IDS document
|
|
8
|
+
*/
|
|
9
|
+
export async function validateIDS(document, accessor, modelInfo, options = {}) {
|
|
10
|
+
const { translator, onProgress, includePassingEntities = true } = options;
|
|
11
|
+
const specificationResults = [];
|
|
12
|
+
const totalSpecs = document.specifications.length;
|
|
13
|
+
for (let i = 0; i < totalSpecs; i++) {
|
|
14
|
+
const spec = document.specifications[i];
|
|
15
|
+
// Report progress
|
|
16
|
+
if (onProgress) {
|
|
17
|
+
onProgress({
|
|
18
|
+
phase: 'filtering',
|
|
19
|
+
specificationIndex: i,
|
|
20
|
+
totalSpecifications: totalSpecs,
|
|
21
|
+
entitiesProcessed: 0,
|
|
22
|
+
totalEntities: 0,
|
|
23
|
+
percentage: Math.floor((i / totalSpecs) * 100),
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
const result = await validateSpecification(spec, accessor, modelInfo.modelId, options, (progress) => {
|
|
27
|
+
if (onProgress) {
|
|
28
|
+
onProgress({
|
|
29
|
+
...progress,
|
|
30
|
+
specificationIndex: i,
|
|
31
|
+
totalSpecifications: totalSpecs,
|
|
32
|
+
percentage: Math.floor(((i + progress.entitiesProcessed / Math.max(progress.totalEntities, 1)) /
|
|
33
|
+
totalSpecs) *
|
|
34
|
+
100),
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
specificationResults.push(result);
|
|
39
|
+
}
|
|
40
|
+
// Report completion
|
|
41
|
+
if (onProgress) {
|
|
42
|
+
onProgress({
|
|
43
|
+
phase: 'complete',
|
|
44
|
+
specificationIndex: totalSpecs,
|
|
45
|
+
totalSpecifications: totalSpecs,
|
|
46
|
+
entitiesProcessed: 0,
|
|
47
|
+
totalEntities: 0,
|
|
48
|
+
percentage: 100,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
const summary = calculateSummary(specificationResults);
|
|
52
|
+
return {
|
|
53
|
+
document,
|
|
54
|
+
modelInfo,
|
|
55
|
+
timestamp: new Date(),
|
|
56
|
+
summary,
|
|
57
|
+
specificationResults,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Validate a single specification against the model
|
|
62
|
+
*/
|
|
63
|
+
async function validateSpecification(spec, accessor, modelId, options, onProgress) {
|
|
64
|
+
const { translator, maxEntities, includePassingEntities = true } = options;
|
|
65
|
+
// Phase 1: Find applicable entities
|
|
66
|
+
const applicableIds = findApplicableEntities(spec, accessor);
|
|
67
|
+
// Apply max entities limit if specified
|
|
68
|
+
const idsToCheck = maxEntities
|
|
69
|
+
? applicableIds.slice(0, maxEntities)
|
|
70
|
+
: applicableIds;
|
|
71
|
+
// Phase 2: Check requirements for each applicable entity
|
|
72
|
+
const entityResults = [];
|
|
73
|
+
const totalEntities = idsToCheck.length;
|
|
74
|
+
for (let i = 0; i < totalEntities; i++) {
|
|
75
|
+
const expressId = idsToCheck[i];
|
|
76
|
+
// Report progress periodically
|
|
77
|
+
if (onProgress && i % 100 === 0) {
|
|
78
|
+
onProgress({
|
|
79
|
+
phase: 'validating',
|
|
80
|
+
entitiesProcessed: i,
|
|
81
|
+
totalEntities,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
const entityResult = validateEntityRequirements(spec, expressId, modelId, accessor, translator);
|
|
85
|
+
// Include result based on options
|
|
86
|
+
if (includePassingEntities || !entityResult.passed) {
|
|
87
|
+
entityResults.push(entityResult);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// Calculate pass/fail counts
|
|
91
|
+
let passedCount = 0;
|
|
92
|
+
let failedCount = 0;
|
|
93
|
+
for (const result of entityResults) {
|
|
94
|
+
if (result.passed) {
|
|
95
|
+
passedCount++;
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
failedCount++;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
// If we filtered out passing entities, adjust the passed count
|
|
102
|
+
if (!includePassingEntities) {
|
|
103
|
+
passedCount = totalEntities - failedCount;
|
|
104
|
+
}
|
|
105
|
+
// Check cardinality
|
|
106
|
+
const cardinalityResult = checkCardinality(spec, applicableIds.length);
|
|
107
|
+
// Determine overall status
|
|
108
|
+
let status = 'pass';
|
|
109
|
+
if (applicableIds.length === 0) {
|
|
110
|
+
// No applicable entities - check if that's allowed by cardinality
|
|
111
|
+
status = cardinalityResult?.passed === false ? 'fail' : 'not_applicable';
|
|
112
|
+
}
|
|
113
|
+
else if (failedCount > 0 || cardinalityResult?.passed === false) {
|
|
114
|
+
status = 'fail';
|
|
115
|
+
}
|
|
116
|
+
const passRate = totalEntities > 0 ? Math.floor((passedCount / totalEntities) * 100) : 100;
|
|
117
|
+
return {
|
|
118
|
+
specification: spec,
|
|
119
|
+
status,
|
|
120
|
+
applicableCount: applicableIds.length,
|
|
121
|
+
passedCount,
|
|
122
|
+
failedCount,
|
|
123
|
+
passRate,
|
|
124
|
+
entityResults,
|
|
125
|
+
cardinalityResult,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Find entities that match the applicability criteria
|
|
130
|
+
*/
|
|
131
|
+
function findApplicableEntities(spec, accessor) {
|
|
132
|
+
const applicabilityFacets = spec.applicability.facets;
|
|
133
|
+
if (applicabilityFacets.length === 0) {
|
|
134
|
+
// No applicability - applies to all entities
|
|
135
|
+
return accessor.getAllEntityIds();
|
|
136
|
+
}
|
|
137
|
+
// Use first entity facet for broadphase filtering
|
|
138
|
+
let candidateIds;
|
|
139
|
+
for (const facet of applicabilityFacets) {
|
|
140
|
+
const filtered = filterByFacet(facet, accessor);
|
|
141
|
+
if (filtered !== undefined) {
|
|
142
|
+
candidateIds = filtered;
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
// If no broadphase filter, check all entities
|
|
147
|
+
if (candidateIds === undefined) {
|
|
148
|
+
candidateIds = accessor.getAllEntityIds();
|
|
149
|
+
}
|
|
150
|
+
// Filter candidates by all applicability facets
|
|
151
|
+
const applicableIds = [];
|
|
152
|
+
for (const expressId of candidateIds) {
|
|
153
|
+
let matches = true;
|
|
154
|
+
for (const facet of applicabilityFacets) {
|
|
155
|
+
const result = checkFacet(facet, expressId, accessor);
|
|
156
|
+
if (!result.passed) {
|
|
157
|
+
matches = false;
|
|
158
|
+
break;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
if (matches) {
|
|
162
|
+
applicableIds.push(expressId);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return applicableIds;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Validate requirements for a single entity
|
|
169
|
+
*/
|
|
170
|
+
function validateEntityRequirements(spec, expressId, modelId, accessor, translator) {
|
|
171
|
+
const requirementResults = [];
|
|
172
|
+
let allPassed = true;
|
|
173
|
+
for (const requirement of spec.requirements) {
|
|
174
|
+
const result = checkRequirement(requirement, expressId, accessor, translator);
|
|
175
|
+
requirementResults.push(result);
|
|
176
|
+
if (result.status === 'fail') {
|
|
177
|
+
allPassed = false;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return {
|
|
181
|
+
expressId,
|
|
182
|
+
modelId,
|
|
183
|
+
entityType: accessor.getEntityType(expressId) || 'Unknown',
|
|
184
|
+
entityName: accessor.getEntityName(expressId),
|
|
185
|
+
globalId: accessor.getGlobalId(expressId),
|
|
186
|
+
passed: allPassed,
|
|
187
|
+
requirementResults,
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Check a single requirement against an entity
|
|
192
|
+
*/
|
|
193
|
+
function checkRequirement(requirement, expressId, accessor, translator) {
|
|
194
|
+
const facetResult = checkFacet(requirement.facet, expressId, accessor);
|
|
195
|
+
// Apply optionality
|
|
196
|
+
let status;
|
|
197
|
+
let failureReason;
|
|
198
|
+
switch (requirement.optionality) {
|
|
199
|
+
case 'required':
|
|
200
|
+
status = facetResult.passed ? 'pass' : 'fail';
|
|
201
|
+
if (!facetResult.passed) {
|
|
202
|
+
failureReason = translator
|
|
203
|
+
? translator.describeFailure({
|
|
204
|
+
requirement,
|
|
205
|
+
status: 'fail',
|
|
206
|
+
facetType: requirement.facet.type,
|
|
207
|
+
checkedDescription: '',
|
|
208
|
+
actualValue: facetResult.actualValue,
|
|
209
|
+
expectedValue: facetResult.expectedValue,
|
|
210
|
+
failure: facetResult.failure,
|
|
211
|
+
})
|
|
212
|
+
: formatFailureReason(facetResult);
|
|
213
|
+
}
|
|
214
|
+
break;
|
|
215
|
+
case 'optional':
|
|
216
|
+
status = 'pass'; // Optional always passes
|
|
217
|
+
break;
|
|
218
|
+
case 'prohibited':
|
|
219
|
+
status = facetResult.passed ? 'fail' : 'pass'; // Inverse logic
|
|
220
|
+
if (status === 'fail') {
|
|
221
|
+
failureReason = translator
|
|
222
|
+
? translator.t('failures.prohibited', {
|
|
223
|
+
field: facetResult.actualValue || 'value',
|
|
224
|
+
})
|
|
225
|
+
: `Prohibited: found ${facetResult.actualValue}`;
|
|
226
|
+
}
|
|
227
|
+
break;
|
|
228
|
+
default:
|
|
229
|
+
status = facetResult.passed ? 'pass' : 'fail';
|
|
230
|
+
}
|
|
231
|
+
// Generate checked description
|
|
232
|
+
const checkedDescription = translator
|
|
233
|
+
? translator.describeRequirement(requirement)
|
|
234
|
+
: formatRequirementDescription(requirement);
|
|
235
|
+
return {
|
|
236
|
+
requirement,
|
|
237
|
+
status,
|
|
238
|
+
facetType: requirement.facet.type,
|
|
239
|
+
checkedDescription,
|
|
240
|
+
failureReason,
|
|
241
|
+
actualValue: facetResult.actualValue,
|
|
242
|
+
expectedValue: facetResult.expectedValue,
|
|
243
|
+
failure: facetResult.failure,
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Check cardinality constraints
|
|
248
|
+
*/
|
|
249
|
+
function checkCardinality(spec, applicableCount) {
|
|
250
|
+
if (spec.minOccurs === undefined && spec.maxOccurs === undefined) {
|
|
251
|
+
return undefined;
|
|
252
|
+
}
|
|
253
|
+
const minExpected = spec.minOccurs ?? 0;
|
|
254
|
+
const maxExpected = spec.maxOccurs;
|
|
255
|
+
let passed = true;
|
|
256
|
+
const messages = [];
|
|
257
|
+
if (applicableCount < minExpected) {
|
|
258
|
+
passed = false;
|
|
259
|
+
messages.push(`Expected at least ${minExpected}, found ${applicableCount}`);
|
|
260
|
+
}
|
|
261
|
+
if (maxExpected !== 'unbounded' && maxExpected !== undefined) {
|
|
262
|
+
if (applicableCount > maxExpected) {
|
|
263
|
+
passed = false;
|
|
264
|
+
messages.push(`Expected at most ${maxExpected}, found ${applicableCount}`);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
return {
|
|
268
|
+
passed,
|
|
269
|
+
actualCount: applicableCount,
|
|
270
|
+
minExpected: spec.minOccurs,
|
|
271
|
+
maxExpected: spec.maxOccurs,
|
|
272
|
+
message: messages.length > 0 ? messages.join('; ') : 'Cardinality satisfied',
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Calculate validation summary
|
|
277
|
+
*/
|
|
278
|
+
function calculateSummary(specificationResults) {
|
|
279
|
+
let totalSpecifications = specificationResults.length;
|
|
280
|
+
let passedSpecifications = 0;
|
|
281
|
+
let failedSpecifications = 0;
|
|
282
|
+
let totalEntitiesChecked = 0;
|
|
283
|
+
let totalEntitiesPassed = 0;
|
|
284
|
+
let totalEntitiesFailed = 0;
|
|
285
|
+
for (const result of specificationResults) {
|
|
286
|
+
if (result.status === 'pass') {
|
|
287
|
+
passedSpecifications++;
|
|
288
|
+
}
|
|
289
|
+
else if (result.status === 'fail') {
|
|
290
|
+
failedSpecifications++;
|
|
291
|
+
}
|
|
292
|
+
totalEntitiesChecked += result.applicableCount;
|
|
293
|
+
totalEntitiesPassed += result.passedCount;
|
|
294
|
+
totalEntitiesFailed += result.failedCount;
|
|
295
|
+
}
|
|
296
|
+
const overallPassRate = totalEntitiesChecked > 0
|
|
297
|
+
? Math.floor((totalEntitiesPassed / totalEntitiesChecked) * 100)
|
|
298
|
+
: 100;
|
|
299
|
+
return {
|
|
300
|
+
totalSpecifications,
|
|
301
|
+
passedSpecifications,
|
|
302
|
+
failedSpecifications,
|
|
303
|
+
totalEntitiesChecked,
|
|
304
|
+
totalEntitiesPassed,
|
|
305
|
+
totalEntitiesFailed,
|
|
306
|
+
overallPassRate,
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Format a failure reason without translation
|
|
311
|
+
*/
|
|
312
|
+
function formatFailureReason(result) {
|
|
313
|
+
if (!result.failure) {
|
|
314
|
+
return `Expected ${result.expectedValue}, got ${result.actualValue}`;
|
|
315
|
+
}
|
|
316
|
+
const { type, field, actual, expected } = result.failure;
|
|
317
|
+
switch (type) {
|
|
318
|
+
case 'ENTITY_TYPE_MISMATCH':
|
|
319
|
+
return `Entity type "${actual}" does not match expected ${expected}`;
|
|
320
|
+
case 'PREDEFINED_TYPE_MISMATCH':
|
|
321
|
+
return `Predefined type "${actual}" does not match expected ${expected}`;
|
|
322
|
+
case 'PREDEFINED_TYPE_MISSING':
|
|
323
|
+
return `Predefined type is missing, expected ${expected}`;
|
|
324
|
+
case 'ATTRIBUTE_MISSING':
|
|
325
|
+
return `Attribute "${field}" is missing`;
|
|
326
|
+
case 'ATTRIBUTE_VALUE_MISMATCH':
|
|
327
|
+
return `Attribute "${field}" value "${actual}" does not match expected ${expected}`;
|
|
328
|
+
case 'ATTRIBUTE_PATTERN_MISMATCH':
|
|
329
|
+
return `Attribute "${field}" value "${actual}" does not match pattern ${expected}`;
|
|
330
|
+
case 'PSET_MISSING':
|
|
331
|
+
return `Property set "${field || expected}" not found`;
|
|
332
|
+
case 'PROPERTY_MISSING':
|
|
333
|
+
return `Property "${field}" not found`;
|
|
334
|
+
case 'PROPERTY_VALUE_MISMATCH':
|
|
335
|
+
return `Property "${field}" value "${actual}" does not match expected ${expected}`;
|
|
336
|
+
case 'PROPERTY_DATATYPE_MISMATCH':
|
|
337
|
+
return `Property "${field}" type "${actual}" does not match expected ${expected}`;
|
|
338
|
+
case 'PROPERTY_OUT_OF_BOUNDS':
|
|
339
|
+
return `Property "${field}" value ${actual} is out of bounds ${expected}`;
|
|
340
|
+
case 'CLASSIFICATION_MISSING':
|
|
341
|
+
return 'No classification found';
|
|
342
|
+
case 'CLASSIFICATION_SYSTEM_MISMATCH':
|
|
343
|
+
return `Classification system "${actual}" does not match expected ${expected}`;
|
|
344
|
+
case 'CLASSIFICATION_VALUE_MISMATCH':
|
|
345
|
+
return `Classification value "${actual}" does not match expected ${expected}`;
|
|
346
|
+
case 'MATERIAL_MISSING':
|
|
347
|
+
return 'No material assigned';
|
|
348
|
+
case 'MATERIAL_VALUE_MISMATCH':
|
|
349
|
+
return `Material "${actual}" does not match expected ${expected}`;
|
|
350
|
+
case 'PARTOF_RELATION_MISSING':
|
|
351
|
+
return `Not ${field} any entity`;
|
|
352
|
+
case 'PARTOF_ENTITY_MISMATCH':
|
|
353
|
+
return `Parent entity "${actual}" does not match expected ${expected}`;
|
|
354
|
+
default:
|
|
355
|
+
return `Validation failed: ${type}`;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Format a requirement description without translation
|
|
360
|
+
*/
|
|
361
|
+
function formatRequirementDescription(requirement) {
|
|
362
|
+
const facet = requirement.facet;
|
|
363
|
+
const optionality = requirement.optionality;
|
|
364
|
+
let desc;
|
|
365
|
+
switch (facet.type) {
|
|
366
|
+
case 'entity':
|
|
367
|
+
desc = `Must be ${formatConstraint(facet.name)}`;
|
|
368
|
+
if (facet.predefinedType) {
|
|
369
|
+
desc += ` with predefinedType ${formatConstraint(facet.predefinedType)}`;
|
|
370
|
+
}
|
|
371
|
+
break;
|
|
372
|
+
case 'attribute':
|
|
373
|
+
if (facet.value) {
|
|
374
|
+
desc = `Attribute "${formatConstraint(facet.name)}" must equal ${formatConstraint(facet.value)}`;
|
|
375
|
+
}
|
|
376
|
+
else {
|
|
377
|
+
desc = `Attribute "${formatConstraint(facet.name)}" must exist`;
|
|
378
|
+
}
|
|
379
|
+
break;
|
|
380
|
+
case 'property':
|
|
381
|
+
if (facet.value) {
|
|
382
|
+
desc = `Property "${formatConstraint(facet.propertySet)}.${formatConstraint(facet.baseName)}" must equal ${formatConstraint(facet.value)}`;
|
|
383
|
+
}
|
|
384
|
+
else {
|
|
385
|
+
desc = `Property "${formatConstraint(facet.propertySet)}.${formatConstraint(facet.baseName)}" must exist`;
|
|
386
|
+
}
|
|
387
|
+
break;
|
|
388
|
+
case 'classification':
|
|
389
|
+
if (facet.system && facet.value) {
|
|
390
|
+
desc = `Must have classification ${formatConstraint(facet.value)} in ${formatConstraint(facet.system)}`;
|
|
391
|
+
}
|
|
392
|
+
else if (facet.system) {
|
|
393
|
+
desc = `Must be classified in ${formatConstraint(facet.system)}`;
|
|
394
|
+
}
|
|
395
|
+
else if (facet.value) {
|
|
396
|
+
desc = `Must have classification ${formatConstraint(facet.value)}`;
|
|
397
|
+
}
|
|
398
|
+
else {
|
|
399
|
+
desc = 'Must have a classification';
|
|
400
|
+
}
|
|
401
|
+
break;
|
|
402
|
+
case 'material':
|
|
403
|
+
if (facet.value) {
|
|
404
|
+
desc = `Must have material ${formatConstraint(facet.value)}`;
|
|
405
|
+
}
|
|
406
|
+
else {
|
|
407
|
+
desc = 'Must have a material assigned';
|
|
408
|
+
}
|
|
409
|
+
break;
|
|
410
|
+
case 'partOf': {
|
|
411
|
+
const relName = facet.relation.replace('IfcRel', '').toLowerCase();
|
|
412
|
+
if (facet.entity) {
|
|
413
|
+
desc = `Must be ${relName} ${formatConstraint(facet.entity.name)}`;
|
|
414
|
+
}
|
|
415
|
+
else {
|
|
416
|
+
desc = `Must be ${relName} some entity`;
|
|
417
|
+
}
|
|
418
|
+
break;
|
|
419
|
+
}
|
|
420
|
+
default:
|
|
421
|
+
desc = 'Unknown requirement';
|
|
422
|
+
}
|
|
423
|
+
if (optionality === 'prohibited') {
|
|
424
|
+
desc = desc.replace('Must', 'Must NOT').replace('must', 'must NOT');
|
|
425
|
+
}
|
|
426
|
+
else if (optionality === 'optional') {
|
|
427
|
+
desc = desc.replace('Must', 'Should').replace('must', 'should');
|
|
428
|
+
}
|
|
429
|
+
return desc;
|
|
430
|
+
}
|
|
431
|
+
//# sourceMappingURL=validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validator.js","sourceRoot":"","sources":["../../src/validation/validator.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAuB/D,OAAO,EAAE,UAAU,EAAE,aAAa,EAAyB,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,QAAqB,EACrB,QAAyB,EACzB,SAAuB,EACvB,UAA4B,EAAE;IAE9B,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,sBAAsB,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC;IAE1E,MAAM,oBAAoB,GAA6B,EAAE,CAAC;IAC1D,MAAM,UAAU,GAAG,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC;IAElD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,EAAE,CAAC,EAAE,EAAE,CAAC;QACpC,MAAM,IAAI,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;QAExC,kBAAkB;QAClB,IAAI,UAAU,EAAE,CAAC;YACf,UAAU,CAAC;gBACT,KAAK,EAAE,WAAW;gBAClB,kBAAkB,EAAE,CAAC;gBACrB,mBAAmB,EAAE,UAAU;gBAC/B,iBAAiB,EAAE,CAAC;gBACpB,aAAa,EAAE,CAAC;gBAChB,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,GAAG,GAAG,CAAC;aAC/C,CAAC,CAAC;QACL,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,qBAAqB,CACxC,IAAI,EACJ,QAAQ,EACR,SAAS,CAAC,OAAO,EACjB,OAAO,EACP,CAAC,QAAQ,EAAE,EAAE;YACX,IAAI,UAAU,EAAE,CAAC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AC,EAAE,CAAC;YAC/D,CAAC;iBAAM,CAAC;gBACN,IAAI,GAAG,+BAA+B,CAAC;YACzC,CAAC;YACD,MAAM;QAER,KAAK,QAAQ,CAAC,CAAC,CAAC;YACd,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;YACnE,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;gBACjB,IAAI,GAAG,WAAW,OAAO,IAAI,gBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;YACrE,CAAC;iBAAM,CAAC;gBACN,IAAI,GAAG,WAAW,OAAO,cAAc,CAAC;YAC1C,CAAC;YACD,MAAM;QACR,CAAC;QAED;YACE,IAAI,GAAG,qBAAqB,CAAC;IACjC,CAAC;IAED,IAAI,WAAW,KAAK,YAAY,EAAE,CAAC;QACjC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACtE,CAAC;SAAM,IAAI,WAAW,KAAK,UAAU,EAAE,CAAC;QACtC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ifc-lite/ids",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "IDS (Information Delivery Specification) support for IFC-Lite",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@ifc-lite/data": "1.3.0"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"typescript": "^5.3.0",
|
|
19
|
+
"vitest": "^1.6.0"
|
|
20
|
+
},
|
|
21
|
+
"license": "MPL-2.0",
|
|
22
|
+
"author": "Louis True",
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "https://github.com/louistrue/ifc-lite.git",
|
|
26
|
+
"directory": "packages/ids"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://louistrue.github.io/ifc-lite/",
|
|
29
|
+
"bugs": "https://github.com/louistrue/ifc-lite/issues",
|
|
30
|
+
"keywords": [
|
|
31
|
+
"ifc",
|
|
32
|
+
"bim",
|
|
33
|
+
"ids",
|
|
34
|
+
"buildingsmart",
|
|
35
|
+
"validation",
|
|
36
|
+
"information-delivery-specification",
|
|
37
|
+
"aec"
|
|
38
|
+
],
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
41
|
+
},
|
|
42
|
+
"files": [
|
|
43
|
+
"dist",
|
|
44
|
+
"README.md"
|
|
45
|
+
],
|
|
46
|
+
"scripts": {
|
|
47
|
+
"build": "tsc",
|
|
48
|
+
"dev": "tsc --watch",
|
|
49
|
+
"test": "vitest run --passWithNoTests"
|
|
50
|
+
}
|
|
51
|
+
}
|