@ifc-lite/ids 1.15.25 → 1.15.26

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.
Files changed (2) hide show
  1. package/README.md +24 -2
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -12,12 +12,21 @@ npm install @ifc-lite/ids
12
12
 
13
13
  ```typescript
14
14
  import { parseIDS, validateIDS, createTranslationService } from '@ifc-lite/ids';
15
+ import { createDataAccessor } from '@ifc-lite/ids/bridge';
15
16
 
16
17
  const idsXml = await fetch('project-requirements.ids').then(r => r.text());
17
18
  const idsSpec = parseIDS(idsXml);
18
19
 
20
+ // Bridge a parsed IfcDataStore into the validator's data-accessor interface
21
+ const accessor = createDataAccessor(store);
22
+
19
23
  const translator = createTranslationService('en');
20
- const report = await validateIDS(idsSpec, store, { translator });
24
+ const report = await validateIDS(
25
+ idsSpec,
26
+ accessor,
27
+ { modelId: 'model.ifc', schemaVersion: store.schemaVersion, entityCount: store.entityCount },
28
+ { translator },
29
+ );
21
30
 
22
31
  console.log(`Overall: ${report.summary.totalEntitiesPassed} / ${report.summary.totalEntitiesChecked} passed`);
23
32
 
@@ -40,10 +49,23 @@ Reports translate automatically. Supported languages: English (`en`), German (`d
40
49
 
41
50
  ```typescript
42
51
  const de = createTranslationService('de');
43
- const report = await validateIDS(idsSpec, store, { translator: de });
52
+ const report = await validateIDS(idsSpec, accessor, modelInfo, { translator: de });
44
53
  // Failures now read: "Anforderung 'FireRating' nicht erfüllt..."
45
54
  ```
46
55
 
56
+ ## Audit an IDS document
57
+
58
+ Check an IDS file itself for authoring mistakes (broken restrictions, impossible cardinalities, unknown entity names) before running it against a model:
59
+
60
+ ```typescript
61
+ import { auditIDSDocument } from '@ifc-lite/ids';
62
+
63
+ const audit = await auditIDSDocument(idsXml);
64
+ for (const issue of audit.issues) {
65
+ console.log(`${issue.severity}: ${issue.message}`);
66
+ }
67
+ ```
68
+
47
69
  ## Inspect an IDS specification
48
70
 
49
71
  ```typescript
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ifc-lite/ids",
3
- "version": "1.15.25",
3
+ "version": "1.15.26",
4
4
  "description": "IDS (Information Delivery Specification) support for IFC-Lite",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -18,8 +18,8 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@xmldom/xmldom": "^0.9.10",
21
- "@ifc-lite/data": "2.5.0",
22
- "@ifc-lite/parser": "3.8.0"
21
+ "@ifc-lite/data": "2.5.1",
22
+ "@ifc-lite/parser": "3.8.1"
23
23
  },
24
24
  "devDependencies": {
25
25
  "happy-dom": "^20.10.6",