@ifc-lite/export 4.5.0 → 4.7.4

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 (208) hide show
  1. package/README.md +5 -5
  2. package/dist/appearance-dependencies.d.ts.map +1 -1
  3. package/dist/appearance-dependencies.js +1 -0
  4. package/dist/appearance-dependencies.js.map +1 -1
  5. package/dist/attribute-real-slots.d.ts.map +1 -1
  6. package/dist/attribute-real-slots.js +7 -1
  7. package/dist/attribute-real-slots.js.map +1 -1
  8. package/dist/attribute-slot-types.js +2 -2
  9. package/dist/attribute-slot-types.js.map +1 -1
  10. package/dist/demesh-prune.d.ts.map +1 -1
  11. package/dist/demesh-prune.js +1 -0
  12. package/dist/demesh-prune.js.map +1 -1
  13. package/dist/demesh-writer.d.ts.map +1 -1
  14. package/dist/demesh-writer.js +1 -0
  15. package/dist/demesh-writer.js.map +1 -1
  16. package/dist/effective-index.d.ts.map +1 -1
  17. package/dist/effective-index.js +2 -0
  18. package/dist/effective-index.js.map +1 -1
  19. package/dist/entity-iteration.d.ts.map +1 -1
  20. package/dist/entity-iteration.js +1 -0
  21. package/dist/entity-iteration.js.map +1 -1
  22. package/dist/entity-type-sets.js +2 -2
  23. package/dist/entity-type-sets.js.map +1 -1
  24. package/dist/generated/ifc4-required-slots.d.ts +17 -0
  25. package/dist/generated/ifc4-required-slots.d.ts.map +1 -0
  26. package/dist/generated/ifc4-required-slots.js +619 -0
  27. package/dist/generated/ifc4-required-slots.js.map +1 -0
  28. package/dist/georef-closure.d.ts.map +1 -1
  29. package/dist/georef-closure.js +5 -0
  30. package/dist/georef-closure.js.map +1 -1
  31. package/dist/ifc5-effective-rows.d.ts +16 -0
  32. package/dist/ifc5-effective-rows.d.ts.map +1 -0
  33. package/dist/ifc5-effective-rows.js +90 -0
  34. package/dist/ifc5-effective-rows.js.map +1 -0
  35. package/dist/ifc5-export-helpers.d.ts +19 -0
  36. package/dist/ifc5-export-helpers.d.ts.map +1 -1
  37. package/dist/ifc5-export-helpers.js +16 -0
  38. package/dist/ifc5-export-helpers.js.map +1 -1
  39. package/dist/ifc5-exporter.d.ts +9 -11
  40. package/dist/ifc5-exporter.d.ts.map +1 -1
  41. package/dist/ifc5-exporter.js +38 -95
  42. package/dist/ifc5-exporter.js.map +1 -1
  43. package/dist/ifc5-pset-properties.d.ts +61 -0
  44. package/dist/ifc5-pset-properties.d.ts.map +1 -0
  45. package/dist/ifc5-pset-properties.js +100 -0
  46. package/dist/ifc5-pset-properties.js.map +1 -0
  47. package/dist/ifc5-tree-scope.js +3 -0
  48. package/dist/ifc5-tree-scope.js.map +1 -1
  49. package/dist/index.d.ts +1 -0
  50. package/dist/index.d.ts.map +1 -1
  51. package/dist/index.js +1 -0
  52. package/dist/index.js.map +1 -1
  53. package/dist/lod0-generator.d.ts.map +1 -1
  54. package/dist/lod0-generator.js +2 -0
  55. package/dist/lod0-generator.js.map +1 -1
  56. package/dist/merged-context.d.ts.map +1 -1
  57. package/dist/merged-context.js +3 -0
  58. package/dist/merged-context.js.map +1 -1
  59. package/dist/merged-decomposition-parents.d.ts +99 -0
  60. package/dist/merged-decomposition-parents.d.ts.map +1 -0
  61. package/dist/merged-decomposition-parents.js +142 -0
  62. package/dist/merged-decomposition-parents.js.map +1 -0
  63. package/dist/merged-empty-containers-refs.d.ts +24 -0
  64. package/dist/merged-empty-containers-refs.d.ts.map +1 -0
  65. package/dist/merged-empty-containers-refs.js +126 -0
  66. package/dist/merged-empty-containers-refs.js.map +1 -0
  67. package/dist/merged-empty-containers.d.ts +31 -0
  68. package/dist/merged-empty-containers.d.ts.map +1 -1
  69. package/dist/merged-empty-containers.js +14 -123
  70. package/dist/merged-empty-containers.js.map +1 -1
  71. package/dist/merged-exporter.d.ts +7 -18
  72. package/dist/merged-exporter.d.ts.map +1 -1
  73. package/dist/merged-exporter.js +80 -70
  74. package/dist/merged-exporter.js.map +1 -1
  75. package/dist/merged-header.d.ts +11 -0
  76. package/dist/merged-header.d.ts.map +1 -0
  77. package/dist/merged-header.js +23 -0
  78. package/dist/merged-header.js.map +1 -0
  79. package/dist/nonrel-positional-ref-narrowing.d.ts +3 -0
  80. package/dist/nonrel-positional-ref-narrowing.d.ts.map +1 -0
  81. package/dist/nonrel-positional-ref-narrowing.js +194 -0
  82. package/dist/nonrel-positional-ref-narrowing.js.map +1 -0
  83. package/dist/nonrel-ref-list-types.d.ts +13 -0
  84. package/dist/nonrel-ref-list-types.d.ts.map +1 -0
  85. package/dist/nonrel-ref-list-types.js +162 -0
  86. package/dist/nonrel-ref-list-types.js.map +1 -0
  87. package/dist/parquet-created-entity-rows.d.ts +20 -0
  88. package/dist/parquet-created-entity-rows.d.ts.map +1 -0
  89. package/dist/parquet-created-entity-rows.js +40 -0
  90. package/dist/parquet-created-entity-rows.js.map +1 -0
  91. package/dist/parquet-exporter-ondemand.d.ts +3 -2
  92. package/dist/parquet-exporter-ondemand.d.ts.map +1 -1
  93. package/dist/parquet-exporter-ondemand.js +15 -6
  94. package/dist/parquet-exporter-ondemand.js.map +1 -1
  95. package/dist/parquet-exporter.d.ts +5 -12
  96. package/dist/parquet-exporter.d.ts.map +1 -1
  97. package/dist/parquet-exporter.js +57 -84
  98. package/dist/parquet-exporter.js.map +1 -1
  99. package/dist/parquet-relationship-rows.d.ts +11 -0
  100. package/dist/parquet-relationship-rows.d.ts.map +1 -0
  101. package/dist/parquet-relationship-rows.js +57 -0
  102. package/dist/parquet-relationship-rows.js.map +1 -0
  103. package/dist/parquet-spatial-rows.d.ts +14 -0
  104. package/dist/parquet-spatial-rows.d.ts.map +1 -0
  105. package/dist/parquet-spatial-rows.js +57 -0
  106. package/dist/parquet-spatial-rows.js.map +1 -0
  107. package/dist/reference-collector.d.ts +17 -1
  108. package/dist/reference-collector.d.ts.map +1 -1
  109. package/dist/reference-collector.js +30 -1
  110. package/dist/reference-collector.js.map +1 -1
  111. package/dist/registry-entity-names.d.ts +3 -0
  112. package/dist/registry-entity-names.d.ts.map +1 -0
  113. package/dist/registry-entity-names.js +38 -0
  114. package/dist/registry-entity-names.js.map +1 -0
  115. package/dist/relationship-slot-bounds.d.ts +14 -0
  116. package/dist/relationship-slot-bounds.d.ts.map +1 -0
  117. package/dist/relationship-slot-bounds.js +64 -0
  118. package/dist/relationship-slot-bounds.js.map +1 -0
  119. package/dist/retype.d.ts.map +1 -1
  120. package/dist/retype.js +5 -2
  121. package/dist/retype.js.map +1 -1
  122. package/dist/schema-conversion-loss-report.d.ts +97 -0
  123. package/dist/schema-conversion-loss-report.d.ts.map +1 -0
  124. package/dist/schema-conversion-loss-report.js +116 -0
  125. package/dist/schema-conversion-loss-report.js.map +1 -0
  126. package/dist/schema-converter-attr-remap.d.ts +8 -0
  127. package/dist/schema-converter-attr-remap.d.ts.map +1 -1
  128. package/dist/schema-converter-attr-remap.js +14 -1
  129. package/dist/schema-converter-attr-remap.js.map +1 -1
  130. package/dist/schema-converter-enums.d.ts +27 -0
  131. package/dist/schema-converter-enums.d.ts.map +1 -0
  132. package/dist/schema-converter-enums.js +117 -0
  133. package/dist/schema-converter-enums.js.map +1 -0
  134. package/dist/schema-converter-ifc4-slots.d.ts +36 -0
  135. package/dist/schema-converter-ifc4-slots.d.ts.map +1 -0
  136. package/dist/schema-converter-ifc4-slots.js +70 -0
  137. package/dist/schema-converter-ifc4-slots.js.map +1 -0
  138. package/dist/schema-converter.d.ts +41 -19
  139. package/dist/schema-converter.d.ts.map +1 -1
  140. package/dist/schema-converter.js +73 -42
  141. package/dist/schema-converter.js.map +1 -1
  142. package/dist/schema-enum-policy.d.ts +48 -0
  143. package/dist/schema-enum-policy.d.ts.map +1 -0
  144. package/dist/schema-enum-policy.js +26 -0
  145. package/dist/schema-enum-policy.js.map +1 -0
  146. package/dist/schema-untranslatable.d.ts +84 -2
  147. package/dist/schema-untranslatable.d.ts.map +1 -1
  148. package/dist/schema-untranslatable.js +98 -3
  149. package/dist/schema-untranslatable.js.map +1 -1
  150. package/dist/step-collection.js +1 -1
  151. package/dist/step-collection.js.map +1 -1
  152. package/dist/step-export-types.d.ts +13 -3
  153. package/dist/step-export-types.d.ts.map +1 -1
  154. package/dist/step-exporter.d.ts.map +1 -1
  155. package/dist/step-exporter.js +4 -2
  156. package/dist/step-exporter.js.map +1 -1
  157. package/dist/step-georeferencing.js +2 -0
  158. package/dist/step-georeferencing.js.map +1 -1
  159. package/dist/step-header.d.ts.map +1 -1
  160. package/dist/step-header.js +1 -0
  161. package/dist/step-header.js.map +1 -1
  162. package/dist/step-map-unit.d.ts.map +1 -1
  163. package/dist/step-map-unit.js +4 -0
  164. package/dist/step-map-unit.js.map +1 -1
  165. package/dist/step-overlay-entities.d.ts.map +1 -1
  166. package/dist/step-overlay-entities.js +5 -1
  167. package/dist/step-overlay-entities.js.map +1 -1
  168. package/dist/step-pass-builder.d.ts.map +1 -1
  169. package/dist/step-pass-builder.js +8 -1
  170. package/dist/step-pass-builder.js.map +1 -1
  171. package/dist/step-property-set-generators.d.ts.map +1 -1
  172. package/dist/step-property-set-generators.js +17 -0
  173. package/dist/step-property-set-generators.js.map +1 -1
  174. package/dist/step-property-set-index.d.ts +4 -10
  175. package/dist/step-property-set-index.d.ts.map +1 -1
  176. package/dist/step-property-set-index.js +52 -8
  177. package/dist/step-property-set-index.js.map +1 -1
  178. package/dist/step-property-set-readers.d.ts.map +1 -1
  179. package/dist/step-property-set-readers.js +4 -0
  180. package/dist/step-property-set-readers.js.map +1 -1
  181. package/dist/step-ref-scan.d.ts +6 -0
  182. package/dist/step-ref-scan.d.ts.map +1 -0
  183. package/dist/step-ref-scan.js +52 -0
  184. package/dist/step-ref-scan.js.map +1 -0
  185. package/dist/step-serialization.d.ts.map +1 -1
  186. package/dist/step-serialization.js +18 -2
  187. package/dist/step-serialization.js.map +1 -1
  188. package/dist/step-shared-atom-retention.d.ts +5 -0
  189. package/dist/step-shared-atom-retention.d.ts.map +1 -0
  190. package/dist/step-shared-atom-retention.js +60 -0
  191. package/dist/step-shared-atom-retention.js.map +1 -0
  192. package/dist/step-source-iteration.d.ts +1 -1
  193. package/dist/step-source-iteration.d.ts.map +1 -1
  194. package/dist/step-source-iteration.js +50 -45
  195. package/dist/step-source-iteration.js.map +1 -1
  196. package/dist/style-closure.d.ts.map +1 -1
  197. package/dist/style-closure.js +11 -0
  198. package/dist/style-closure.js.map +1 -1
  199. package/dist/subset-entity-reader.d.ts.map +1 -1
  200. package/dist/subset-entity-reader.js +3 -2
  201. package/dist/subset-entity-reader.js.map +1 -1
  202. package/dist/subset-roots.js +2 -2
  203. package/dist/subset-roots.js.map +1 -1
  204. package/package.json +11 -10
  205. package/dist/merged-rel-aggregates.d.ts +0 -63
  206. package/dist/merged-rel-aggregates.d.ts.map +0 -1
  207. package/dist/merged-rel-aggregates.js +0 -122
  208. package/dist/merged-rel-aggregates.js.map +0 -1
@@ -0,0 +1,194 @@
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
+ /**
5
+ * The `NONREL_REF_LIST_TYPES` (`nonrel-ref-list-types.ts`) sibling of
6
+ * `filterHiddenRefsFromRelationshipLine` (`reference-collector.ts`): narrows
7
+ * a parenthesised list attribute exactly as that function does, but NEVER
8
+ * withholds the line.
9
+ *
10
+ * Split into its own file rather than added to `reference-collector.ts`:
11
+ * that module already documents itself as sitting at its module-size budget
12
+ * (`style-closure.ts`'s header says so, and this addition measured 968 lines
13
+ * pushed to 1054 against a 976 budget — over it), and this function shares
14
+ * no state with anything else there, only two already-exported helpers.
15
+ *
16
+ * A separate function, not a parameter on the shared one, because the two
17
+ * rules disagree on what a bare excluded `#N` means, and that disagreement
18
+ * cannot be papered over with a flag without also touching every existing
19
+ * `IFCREL*`/`STYLE_RESCUE_TYPES` call site's contract:
20
+ *
21
+ * `filterHiddenRefsFromRelationshipLine` withholds the WHOLE line when a
22
+ * bare, single-valued attribute names an excluded id, because for an
23
+ * `IFCREL*` line that IS the association — `IfcRelContainedInSpatialStructure
24
+ * .RelatingStructure` naming a hidden storey has no other spelling for "this
25
+ * relationship no longer applies", so the relationship itself must go. The
26
+ * classes in `NONREL_REF_LIST_TYPES` are not relationships: `IfcCostItem`'s
27
+ * bare `OwnerHistory` (`IfcRoot`) or `IfcAppliedValue`'s bare `UnitBasis` are
28
+ * ordinary attributes of the entity's OWN record, not a link between two
29
+ * OTHER records. Withholding `#N=IFCCOSTITEM(...)` over its OwnerHistory
30
+ * having been deleted does not remove an association the way withholding a
31
+ * relationship does — it deletes the cost item itself, and every OTHER
32
+ * entity that names that cost item now dangles instead. That is worse than
33
+ * the one dangling `#N` this function exists to remove, and a regression
34
+ * against the untouched-line behaviour `upstream/main` already ships for
35
+ * these types. So a bare excluded ref here is left exactly as `main` emits
36
+ * it: unfiltered, exempt, the same as `Representation`/`ObjectPlacement`
37
+ * (`step-omission-predicates.ts`'s documented general gap for
38
+ * non-relationship lines) already is.
39
+ *
40
+ * ## An emptied list: `$`, unchanged, or `()` — and why not always the same one
41
+ *
42
+ * `filterHiddenRefsFromRelationshipLine`'s own doc already states the trap:
43
+ * "a SET attribute of a real IFC schema is never empty, so an empty list is
44
+ * not 'no forward reference', it is a second, different kind of invalid
45
+ * file." An earlier revision of this function answered every emptied list
46
+ * with `()` and reproduced exactly that invalid file. The right answer is
47
+ * NOT uniform, because the types in `NONREL_REF_LIST_TYPES` do not all
48
+ * declare their list attribute alike — two examples:
49
+ *
50
+ * - `IfcCostItem.CostValues` / `.CostQuantities`, `IfcAppliedValue`/
51
+ * `IfcCostValue.Components` are all `OPTIONAL LIST [1:?]`
52
+ * (`IFC4_ADD2_TC1.exp`) — the schema HAS a spelling for "none of these":
53
+ * `$`, the same token every other omitted optional attribute already
54
+ * uses in this export.
55
+ * - `IfcPhysicalComplexQuantity.HasQuantities` is `SET [1:?]`, NOT
56
+ * `OPTIONAL` (`IFC4_ADD2_TC1.exp` AND `IFC2X3_TC1.exp` — checked both,
57
+ * identical). There is no valid spelling for "none left" at all: `()`
58
+ * breaks the `[1:?]` lower bound and `$` breaks "this attribute is
59
+ * mandatory", equally invalid. Withholding the whole record cascades the
60
+ * same way the bare-`OwnerHistory` case does. The only choice that harms
61
+ * nothing else is to leave the slot exactly as `upstream/main` already
62
+ * ships it: the excluded ref(s) stay, dangling — one dangling `#N`,
63
+ * which is the pre-existing, already-accepted defect class this file
64
+ * only narrows the REACH of, not a new invalid shape.
65
+ *
66
+ * `readAggregateSlot` below derives the optional/mandatory answer (and the
67
+ * slot's own lower bound) from
68
+ * the generated schema registry (`@ifc-lite/parser`'s
69
+ * `getSchemaRegistryForVersion`, keyed by the SOURCE line's own schema
70
+ * version) rather than a fourth hand-written table — the exact defect shape
71
+ * flagged separately (a hand-maintained table silently diverging from the
72
+ * schema it was copied from). `IfcCostItem` in particular is NOT the same
73
+ * shape across schema versions: IFC2X3's `IfcCostItem` declares neither
74
+ * `CostValues` nor `CostQuantities` at all (`IFC2X3_TC1.exp` — the entity is
75
+ * `SUBTYPE OF (IfcControl)` with zero own attributes), so a lookup keyed to
76
+ * the wrong version would answer about attributes that line does not have.
77
+ * Reading `allAttributes[slotIndex]` from the version-correct registry
78
+ * answers both "is this slot even an aggregate" and "is it optional" from
79
+ * one source, so a schema evolution changing either can never desync the two
80
+ * questions the way two separately hand-kept facts could.
81
+ *
82
+ * Returns the line unchanged when it names nothing excluded, or a rewritten
83
+ * line otherwise. Never returns `null`: unlike the sibling function, there is
84
+ * no shape this rule ever withholds a whole record for. A line whose
85
+ * validated slot layout cannot be read is still returned unchanged rather
86
+ * than withheld — nothing here can VERIFY it holds an excluded ref, so
87
+ * altering it would be a guess, and the untouched-line behaviour for these
88
+ * types is already the accepted default. Non-entity text is returned
89
+ * unchanged, matching the sibling function.
90
+ */
91
+ import { getSchemaRegistryForVersion } from '@ifc-lite/parser';
92
+ import { readStepSlots, splitTopLevelListItems } from './step-argument-parser.js';
93
+ import { BARE_REF_RE } from './reference-collector.js';
94
+ import { NONREL_REF_LIST_REGISTRY_NAMES } from './nonrel-ref-list-types.js';
95
+ function isRegistryVersion(version) {
96
+ return version === 'IFC2X3' || version === 'IFC4' || version === 'IFC4X3';
97
+ }
98
+ /**
99
+ * The declaration of the aggregate attribute at `slotIndex` of `entityType`,
100
+ * as `schemaVersion`'s generated registry declares it: whether it is
101
+ * `OPTIONAL`, and its lower bound.
102
+ *
103
+ * Returns `undefined` when the metadata cannot be read (an entity/schema
104
+ * version this file does not cover, a slot index the registry has no
105
+ * attribute for, a slot that is not an aggregate at all, or an aggregate
106
+ * with no declared bound) so the caller falls back to the SAFE default —
107
+ * leave the slot untouched — rather than guess. `IFC5` (this export's
108
+ * schema-conversion target enum, never a source-iteration STEP schema) and
109
+ * any future addition to `IfcSchemaVersion` outside
110
+ * {@link SchemaVersionWithRegistry} take this path automatically, by
111
+ * construction, with no version list to keep in sync here.
112
+ *
113
+ * Read PER SLOT because a type joins `NONREL_REF_LIST_TYPES` on the strength
114
+ * of ONE qualifying attribute, while this function rewrites every
115
+ * parenthesised slot on the line. `IfcTextureMap` qualifies through
116
+ * `Maps : LIST [1:?]` but also carries `Vertices : LIST [3:?]`;
117
+ * `IfcFillAreaStyleTiles` qualifies through `Tiles : SET [1:?]` but also
118
+ * carries `TilingPattern : LIST [2:2]` (#5181). Narrowing those by the
119
+ * `[1:?]` rule would turn a valid 3-vertex map into an invalid 2-vertex one,
120
+ * so each slot is held to its OWN declared lower bound.
121
+ */
122
+ function readAggregateSlot(entityType, slotIndex, schemaVersion) {
123
+ const registryName = NONREL_REF_LIST_REGISTRY_NAMES.get(entityType);
124
+ if (registryName === undefined || !isRegistryVersion(schemaVersion))
125
+ return undefined;
126
+ const attr = getSchemaRegistryForVersion(schemaVersion).entities[registryName]?.allAttributes?.[slotIndex];
127
+ if (attr === undefined || !(attr.isList || attr.isSet))
128
+ return undefined;
129
+ const lowerBound = attr.arrayBounds?.[0];
130
+ if (lowerBound === undefined || !Number.isFinite(lowerBound))
131
+ return undefined;
132
+ return { optional: attr.optional, lowerBound };
133
+ }
134
+ export function narrowNonRelPositionalRefLists(line, isExcluded, entityType, schemaVersion) {
135
+ const record = readStepSlots(line);
136
+ if (record === null)
137
+ return line;
138
+ const attrs = [...record.slots];
139
+ let changed = false;
140
+ const nextAttrs = [];
141
+ for (let index = 0; index < attrs.length; index++) {
142
+ const rawAttr = attrs[index];
143
+ const attr = rawAttr.trim();
144
+ const leading = rawAttr.slice(0, rawAttr.indexOf(attr));
145
+ const trailing = rawAttr.slice(rawAttr.indexOf(attr) + attr.length);
146
+ if (attr.length >= 2 && attr.charCodeAt(0) === 0x28 /* '(' */ && attr.charCodeAt(attr.length - 1) === 0x29 /* ')' */) {
147
+ const inner = attr.trim() === '()' ? '' : attr.slice(1, -1);
148
+ const items = inner.trim() === '' ? [] : splitTopLevelListItems(inner);
149
+ const survivors = items.filter((item) => {
150
+ const refMatch = item.match(BARE_REF_RE);
151
+ return !(refMatch && isExcluded(Number(refMatch[1])));
152
+ });
153
+ if (survivors.length === items.length) {
154
+ // Nothing excluded in this list — untouched, whatever its cardinality.
155
+ nextAttrs.push(rawAttr);
156
+ continue;
157
+ }
158
+ const slot = readAggregateSlot(entityType, index, schemaVersion);
159
+ if (slot === undefined) {
160
+ // No declaration to check a narrowed list against — leave it exactly
161
+ // as the source emitted it rather than guess its cardinality.
162
+ nextAttrs.push(rawAttr);
163
+ continue;
164
+ }
165
+ if (survivors.length > 0 && survivors.length >= slot.lowerBound) {
166
+ // Still at or above this slot's own declared lower bound.
167
+ changed = true;
168
+ nextAttrs.push(`${leading}(${survivors.join(',')})${trailing}`);
169
+ continue;
170
+ }
171
+ // Narrowing would break the slot's lower bound (every member excluded
172
+ // from a `[1:?]` slot, or fewer than N left in an `[N:?]` one). `()`
173
+ // or a short list is a different invalid file — see the module doc —
174
+ // so the choice is `$` when nothing survives and the schema allows
175
+ // omitting the attribute entirely, or otherwise leaving this slot
176
+ // exactly as the source emitted it (dangling ref intact): `$` over a
177
+ // list that still has survivors would drop live references too.
178
+ if (survivors.length === 0 && slot.optional) {
179
+ changed = true;
180
+ nextAttrs.push(`${leading}$${trailing}`);
181
+ continue;
182
+ }
183
+ nextAttrs.push(rawAttr);
184
+ continue;
185
+ }
186
+ // A bare `#N` is left alone even when excluded — see the doc above for
187
+ // why: narrowing reach only, never withholding, for these types.
188
+ nextAttrs.push(rawAttr);
189
+ }
190
+ if (!changed)
191
+ return line;
192
+ return `${record.prefix}${nextAttrs.join(',')}${record.suffix}`;
193
+ }
194
+ //# sourceMappingURL=nonrel-positional-ref-narrowing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nonrel-positional-ref-narrowing.js","sourceRoot":"","sources":["../src/nonrel-positional-ref-narrowing.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsFG;AACH,OAAO,EAAE,2BAA2B,EAAkC,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,8BAA8B,EAAE,MAAM,4BAA4B,CAAC;AAG5E,SAAS,iBAAiB,CAAC,OAAyB;IAClD,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,MAAM,IAAI,OAAO,KAAK,QAAQ,CAAC;AAC5E,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,SAAS,iBAAiB,CACxB,UAAkB,EAClB,SAAiB,EACjB,aAA+B;IAE/B,MAAM,YAAY,GAAG,8BAA8B,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACpE,IAAI,YAAY,KAAK,SAAS,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC;QAAE,OAAO,SAAS,CAAC;IACtF,MAAM,IAAI,GAAG,2BAA2B,C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S,CAAC,MAAM,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;gBAChE,0DAA0D;gBAC1D,OAAO,GAAG,IAAI,CAAC;gBACf,SAAS,CAAC,IAAI,CAAC,GAAG,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,QAAQ,EAAE,CAAC,CAAC;gBAChE,SAAS;YACX,CAAC;YACD,sEAAsE;YACtE,qEAAqE;YACrE,qEAAqE;YACrE,mEAAmE;YACnE,kEAAkE;YAClE,qEAAqE;YACrE,gEAAgE;YAChE,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAC5C,OAAO,GAAG,IAAI,CAAC;gBACf,SAAS,CAAC,IAAI,CAAC,GAAG,OAAO,IAAI,QAAQ,EAAE,CAAC,CAAC;gBACzC,SAAS;YACX,CAAC;YACD,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACxB,SAAS;QACX,CAAC;QAED,uEAAuE;QACvE,iEAAiE;QACjE,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC1B,CAAC;IAED,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAC1B,OAAO,GAAG,MAAM,CAAC,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;AAClE,CAAC"}
@@ -0,0 +1,13 @@
1
+ /** See the module doc: derived, not hand-kept, from the schema registries. */
2
+ export declare const NONREL_REF_LIST_TYPES: ReadonlySet<string>;
3
+ /**
4
+ * `effectiveRelType` (the STEP type token, e.g. `IFCPROPERTYSET`) to the
5
+ * exact PascalCase key the generated schema registries use
6
+ * (`IfcPropertySet`), for every type in {@link NONREL_REF_LIST_TYPES} —
7
+ * consumed by `nonrel-positional-ref-narrowing.ts` to read
8
+ * `allAttributes[slotIndex]` back out of the version-correct registry.
9
+ * Derived alongside `NONREL_REF_LIST_TYPES` from the exact same registry
10
+ * entities, so the two sets can never drift apart.
11
+ */
12
+ export declare const NONREL_REF_LIST_REGISTRY_NAMES: ReadonlyMap<string, string>;
13
+ //# sourceMappingURL=nonrel-ref-list-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nonrel-ref-list-types.d.ts","sourceRoot":"","sources":["../src/nonrel-ref-list-types.ts"],"names":[],"mappings":"AAiKA,8EAA8E;AAC9E,eAAO,MAAM,qBAAqB,EAAE,WAAW,CAAC,MAAM,CAAiB,CAAC;AAExE;;;;;;;;GAQG;AACH,eAAO,MAAM,8BAA8B,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAyB,CAAC"}
@@ -0,0 +1,162 @@
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
+ /**
5
+ * Non-`IFCREL*` classes whose OWN attributes hold direct entity-reference
6
+ * LISTS, so `step-source-iteration.ts` runs
7
+ * `narrowNonRelPositionalRefLists` (`nonrel-positional-ref-narrowing.ts`) on their
8
+ * source line — a narrow-only sibling of the `filterHiddenRefsFromRelationshipLine`
9
+ * rule already run on every `IFCREL*` line and on `STYLE_RESCUE_TYPES`
10
+ * (`style-closure.ts`). Deliberately the sibling, not the shared function:
11
+ * these classes also carry bare, inherited single-valued refs (`IfcRoot
12
+ * .OwnerHistory`, `IfcAppliedValue.UnitBasis`) that the shared function's
13
+ * bare-ref rule would withhold the whole line for — correct for an
14
+ * `IFCREL*` association, wrong for an entity's own record (see
15
+ * `narrowNonRelPositionalRefLists`'s doc for the full argument).
16
+ *
17
+ * `step-omission-predicates.ts` documents the filter's reach as "Only
18
+ * `IFCREL*` lines" and gives `Representation`/`ObjectPlacement` as the
19
+ * general exempt case (80 dangling refs before and after on
20
+ * `tests/models/AB22.ifc`) — that stays true for every type NOT in this set,
21
+ * and a BARE ref stays exempt even for a type IN this set (narrowing reaches
22
+ * lists only).
23
+ *
24
+ * DERIVED, not hand-kept (#5181). Two rounds of hand-enumeration
25
+ * (`IfcCostItem.CostValues`/`.CostQuantities`, `IfcAppliedValue`/
26
+ * `IfcCostValue.Components`, `IfcPhysicalComplexQuantity.HasQuantities` —
27
+ * the original four; `IfcPropertySet.HasProperties` and
28
+ * `IfcElementQuantity.Quantities` — #5181's own gap) each missed a case, so
29
+ * this is now computed at module load from `@ifc-lite/parser`'s
30
+ * codegen-generated schema registries rather than copied by hand from the
31
+ * `.exp` files: every CONCRETE, non-`IFCREL*` entity — across all three
32
+ * registries `@ifc-lite/parser` carries (IFC2X3/IFC4/IFC4X3), since a class
33
+ * can declare an attribute in one schema version and not another (the doc
34
+ * on `IfcCostItem` in `nonrel-positional-ref-narrowing.ts` is the checked
35
+ * example: no `CostValues`/`CostQuantities` at all in IFC2X3) — that has at
36
+ * least one attribute, own or inherited, which is a SET or LIST (`isSet ||
37
+ * isList`) whose `type` names another entity in that same registry. That is
38
+ * exactly the shape `narrowNonRelPositionalRefLists` exists for: a direct
39
+ * LIST attribute on a non-relationship class that names other entities,
40
+ * reached by a session deletion (`bim.store.removeEntity`,
41
+ * `@ifc-lite/mutations`'s `store-editor.ts`) the same way an `IFCREL*`
42
+ * line's list attributes are.
43
+ *
44
+ * `@ifc-lite/parser`'s runtime schema registries are already an existing
45
+ * runtime dependency of this package (`declared-property-type.ts` imports
46
+ * `SCHEMA_REGISTRY` directly, and `nonrel-positional-ref-narrowing.ts`
47
+ * already calls `getSchemaRegistryForVersion` for all three versions at
48
+ * narrowing time) — deriving this set from them adds no new dependency
49
+ * surface, so there is no perf/layering reason to fall back to a hand-kept
50
+ * set plus a drift test here.
51
+ *
52
+ * `narrowNonRelPositionalRefLists` is purely SYNTACTIC — it does not know or
53
+ * care which attribute position means what, only whether an attribute is a
54
+ * bare `#N` (left alone) or a parenthesised list of them (narrowed) — so a
55
+ * type appearing in the derived set is the whole change needed to cover it:
56
+ * no new per-type attribute-index table.
57
+ *
58
+ * LOWER BOUND, NOT JUST "IS AN AGGREGATE OF ENTITIES". A first pass at this
59
+ * derivation checked only `isSet || isList` plus an entity `type` and
60
+ * produced 270 types — every non-`IFCREL*` concrete class with ANY
61
+ * entity-reference aggregate, including geometry shapes such as
62
+ * `IfcPolyline.Points` (`SET [2:?]`) and `IfcPolyLoop.Polygon`
63
+ * (`SET [3:?]`). `narrowNonRelPositionalRefLists`'s own doc states the
64
+ * premise its "still non-empty: narrowing alone cannot violate a `[1:?]`
65
+ * lower bound" branch depends on: a lower bound of exactly 1 (or 0). Those
66
+ * two examples have a lower bound of 2 and 3 — deleting one member of a
67
+ * two-point `IfcPolyline` would narrow a valid 2-point line to an INVALID
68
+ * 1-point one, silently, which is a worse defect than the dangling ref this
69
+ * file exists to remove. So the derivation below additionally requires
70
+ * `arrayBounds[0] <= 1` of the attribute that QUALIFIES a type. That gate
71
+ * is per type, but a qualifying type can still carry a second, higher-bound
72
+ * aggregate on the same line (`IfcFillAreaStyleTiles.TilingPattern`,
73
+ * `LIST [2:2]`, beside its qualifying `Tiles`), so
74
+ * `narrowNonRelPositionalRefLists` also reads EACH slot's own declared
75
+ * lower bound and leaves a slot untouched when narrowing would drop it below
76
+ * that bound.
77
+ *
78
+ * ONE MORE EXCLUSION: every `IfcTypeObject` subtype (`IfcWallType`,
79
+ * `IfcDoorStyle`, …) is skipped ENTIRELY, not just at its
80
+ * `HasPropertySets` attribute. `HasPropertySets` — `SET [1:?] OF
81
+ * IfcPropertySetDefinition` — already has a DEDICATED, tested owner:
82
+ * `type-owned-psets.ts`'s `HAS_PROPERTY_SETS_SLOT` plus
83
+ * `anonymize-scrub.ts`'s `keepPropertySets` option, which writes this exact
84
+ * slot BEFORE `StepExporter` runs. `keepPropertySets: true`'s documented
85
+ * contract is to preserve the ORIGINAL list verbatim, dangling ref and all
86
+ * (`anonymize-scrub.test.ts`, "keeps the original HasPropertySets list").
87
+ * A first version of this derivation tried excluding only the
88
+ * `HasPropertySets` attribute by name — and still broke that contract,
89
+ * because `IfcWallType` (through `IfcTypeProduct`) ALSO carries
90
+ * `RepresentationMaps : SET [1:?] OF IfcRepresentationMap`, which
91
+ * legitimately qualifies on its own. `narrowNonRelPositionalRefLists` reads
92
+ * and rewrites a source line's slots as a whole (`readStepSlots` over every
93
+ * parenthesised attribute), with no per-slot exemption mechanism — once a
94
+ * line is in scope for ANY slot, EVERY slot on it is narrowed, including
95
+ * `HasPropertySets`. So the only choice that actually keeps
96
+ * `keepPropertySets`'s contract is to exclude the whole `IfcTypeObject`
97
+ * family from this set, trading away narrowing's reach onto
98
+ * `RepresentationMaps` (a pre-existing gap this change does not close,
99
+ * not a regression) for correctness on the slot that already has an owner.
100
+ */
101
+ import { getSchemaRegistryForVersion } from '@ifc-lite/parser';
102
+ const REGISTRY_VERSIONS = ['IFC2X3', 'IFC4', 'IFC4X3'];
103
+ /**
104
+ * Builds {@link NONREL_REF_LIST_TYPES} (STEP type tokens) and
105
+ * {@link NONREL_REF_LIST_REGISTRY_NAMES} (STEP token -> the registry's own
106
+ * PascalCase entity name, e.g. `IFCPROPERTYSET` -> `IfcPropertySet`) in one
107
+ * pass over all three schema registries, so the two can never disagree with
108
+ * each other about which classes are covered — the same defect shape as the
109
+ * `NONREL_REF_LIST_TYPES`/`REGISTRY_ENTITY_NAME` pair this replaces, which
110
+ * were two independently hand-kept four-entry tables tied 1:1 by convention
111
+ * only.
112
+ */
113
+ function deriveNonRelRefListEntities() {
114
+ const types = new Set();
115
+ const registryNames = new Map();
116
+ for (const version of REGISTRY_VERSIONS) {
117
+ const registry = getSchemaRegistryForVersion(version);
118
+ for (const entity of Object.values(registry.entities)) {
119
+ if (entity.isAbstract)
120
+ continue;
121
+ const upperName = entity.name.toUpperCase();
122
+ if (upperName.startsWith('IFCREL'))
123
+ continue;
124
+ // See the module doc: `IfcTypeObject`'s `HasPropertySets` already has
125
+ // a dedicated owner, and narrowing cannot exempt one slot on a line
126
+ // it otherwise touches, so the whole subtype family is excluded.
127
+ if (entity.inheritanceChain?.includes('IfcTypeObject') === true)
128
+ continue;
129
+ const attributes = entity.allAttributes ?? entity.attributes;
130
+ const namesAnEntityAggregate = attributes.some((attribute) => (attribute.isSet || attribute.isList) &&
131
+ Object.hasOwn(registry.entities, attribute.type) &&
132
+ // See the module doc: narrowing only ever removes members, never
133
+ // adds them, so it is only safe when the attribute's own lower
134
+ // bound is 0 or 1 — a higher bound (e.g. `IfcPolyline.Points`,
135
+ // `[2:?]`) can be narrowed below its own minimum cardinality.
136
+ // No `arrayBounds` at all (should not happen for a `isSet`/
137
+ // `isList` attribute the generator produced, but not guaranteed
138
+ // by the type) is treated as unsafe, not as bound-1: `Infinity`
139
+ // fails the `<= 1` test below rather than passing by default.
140
+ (attribute.arrayBounds?.[0] ?? Infinity) <= 1);
141
+ if (!namesAnEntityAggregate)
142
+ continue;
143
+ types.add(upperName);
144
+ registryNames.set(upperName, entity.name);
145
+ }
146
+ }
147
+ return { types, registryNames };
148
+ }
149
+ const DERIVED = deriveNonRelRefListEntities();
150
+ /** See the module doc: derived, not hand-kept, from the schema registries. */
151
+ export const NONREL_REF_LIST_TYPES = DERIVED.types;
152
+ /**
153
+ * `effectiveRelType` (the STEP type token, e.g. `IFCPROPERTYSET`) to the
154
+ * exact PascalCase key the generated schema registries use
155
+ * (`IfcPropertySet`), for every type in {@link NONREL_REF_LIST_TYPES} —
156
+ * consumed by `nonrel-positional-ref-narrowing.ts` to read
157
+ * `allAttributes[slotIndex]` back out of the version-correct registry.
158
+ * Derived alongside `NONREL_REF_LIST_TYPES` from the exact same registry
159
+ * entities, so the two sets can never drift apart.
160
+ */
161
+ export const NONREL_REF_LIST_REGISTRY_NAMES = DERIVED.registryNames;
162
+ //# sourceMappingURL=nonrel-ref-list-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nonrel-ref-list-types.js","sourceRoot":"","sources":["../src/nonrel-ref-list-types.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;;;;;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AA8D;gBAC9D,4DAA4D;gBAC5D,gEAAgE;gBAChE,gEAAgE;gBAChE,8DAA8D;gBAC9D,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,CAChD,CAAC;YACF,IAAI,CAAC,sBAAsB;gBAAE,SAAS;YAEtC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YACrB,aAAa,CAAC,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;QAC5C,CAAC;IACH,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC;AAClC,CAAC;AAED,MAAM,OAAO,GAAG,2BAA2B,EAAE,CAAC;AAE9C,8EAA8E;AAC9E,MAAM,CAAC,MAAM,qBAAqB,GAAwB,OAAO,CAAC,KAAK,CAAC;AAExE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAgC,OAAO,CAAC,aAAa,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { type IfcDataStore } from '@ifc-lite/parser';
2
+ import type { MutablePropertyView } from '@ifc-lite/mutations';
3
+ import type { EffectiveEntityIndex } from './effective-index.js';
4
+ interface EntityColumns {
5
+ ExpressId: number[];
6
+ GlobalId: string[];
7
+ Name: string[];
8
+ Description: string[];
9
+ Type: string[];
10
+ ObjectType: string[];
11
+ HasGeometry: boolean[];
12
+ IsType: boolean[];
13
+ ContainedInStorey: number[];
14
+ DefinedByType: number[];
15
+ GeometryIndex: number[];
16
+ }
17
+ /** Append live creations after the parsed rows; the caller filters tombstoned source rows. */
18
+ export declare function appendCreatedParquetEntityRows(columns: EntityColumns, store: IfcDataStore, view: MutablePropertyView | null, effective: EffectiveEntityIndex | null): void;
19
+ export {};
20
+ //# sourceMappingURL=parquet-created-entity-rows.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parquet-created-entity-rows.d.ts","sourceRoot":"","sources":["../src/parquet-created-entity-rows.ts"],"names":[],"mappings":"AAIA,OAAO,EAAkG,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrJ,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,UAAU,aAAa;IACrB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,WAAW,EAAE,OAAO,EAAE,CAAC;IACvB,MAAM,EAAE,OAAO,EAAE,CAAC;IAClB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB;AAQD,8FAA8F;AAC9F,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,YAAY,EACnB,IAAI,EAAE,mBAAmB,GAAG,IAAI,EAChC,SAAS,EAAE,oBAAoB,GAAG,IAAI,GACrC,IAAI,CA6BN"}
@@ -0,0 +1,40 @@
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 { getAttributeNamesAcrossSchemas, getInheritanceChainAcrossSchemas, resolveEffectiveEntityRecord } from '@ifc-lite/parser';
5
+ function stepText(value) {
6
+ if (typeof value !== 'string' || value === '$')
7
+ return '';
8
+ return value.startsWith("'") && value.endsWith("'")
9
+ ? value.slice(1, -1).replaceAll("''", "'") : value;
10
+ }
11
+ /** Append live creations after the parsed rows; the caller filters tombstoned source rows. */
12
+ export function appendCreatedParquetEntityRows(columns, store, view, effective) {
13
+ if (!view || !effective)
14
+ return;
15
+ for (const created of view.getNewEntities()) {
16
+ if (!effective.isOverlayCreated(created.expressId) || effective.isDeleted(created.expressId))
17
+ continue;
18
+ const record = resolveEffectiveEntityRecord({ type: created.type, attributes: created.attributes }, {
19
+ retype: view.getTypeMutations().get(created.expressId)?.newType,
20
+ named: view.getAttributeMutationsForEntity(created.expressId).map(({ name, value }) => [name, value]),
21
+ positional: view.getPositionalMutationsForEntity(created.expressId) ?? [],
22
+ }, store.schemaVersion);
23
+ const names = record.names.length > 0 ? record.names : getAttributeNamesAcrossSchemas(record.type);
24
+ const field = (name) => stepText(record.attributes[names.indexOf(name)]);
25
+ columns.ExpressId.push(created.expressId);
26
+ columns.GlobalId.push(field('GlobalId'));
27
+ columns.Name.push(field('Name'));
28
+ columns.Description.push(field('Description'));
29
+ columns.Type.push(record.type);
30
+ columns.ObjectType.push(field('ObjectType'));
31
+ // Geometry and relationship-derived indexes are absent until their own
32
+ // Parquet tables can write the authored mesh/relationship rows.
33
+ columns.HasGeometry.push(false);
34
+ columns.IsType.push(getInheritanceChainAcrossSchemas(record.type).includes('IfcTypeObject'));
35
+ columns.ContainedInStorey.push(-1);
36
+ columns.DefinedByType.push(-1);
37
+ columns.GeometryIndex.push(-1);
38
+ }
39
+ }
40
+ //# sourceMappingURL=parquet-created-entity-rows.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parquet-created-entity-rows.js","sourceRoot":"","sources":["../src/parquet-created-entity-rows.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D,OAAO,EAAE,8BAA8B,EAAE,gCAAgC,EAAE,4BAA4B,EAAqB,MAAM,kBAAkB,CAAC;AAkBrJ,SAAS,QAAQ,CAAC,KAAc;IAC9B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,EAAE,CAAC;IAC1D,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CA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G,CAAC,IAAY,EAAU,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACzF,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC1C,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;QACzC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;QACjC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;QAC/C,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC/B,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;QAC7C,uEAAuE;QACvE,gEAAgE;QAChE,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAChC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,gCAAgC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC;QAC7F,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACnC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/B,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACjC,CAAC;AACH,CAAC"}
@@ -22,13 +22,14 @@
22
22
  * second copy of the pset/property walk.
23
23
  */
24
24
  import type { IfcDataStore } from '@ifc-lite/parser';
25
+ import type { MutablePropertyView } from '@ifc-lite/mutations';
25
26
  import type { EffectiveEntityIndex } from './effective-index.js';
26
- export declare function writePropertiesOnDemand(store: IfcDataStore, effective: EffectiveEntityIndex | null): Promise<Uint8Array>;
27
+ export declare function writePropertiesOnDemand(store: IfcDataStore, effective: EffectiveEntityIndex | null, view?: MutablePropertyView | null, sourceIds?: Iterable<number>, getBase?: (id: number) => import("@ifc-lite/data").PropertySet[], onCount?: (count: number) => void): Promise<Uint8Array>;
27
28
  /**
28
29
  * `Formula` is always NULL here: the on-demand quantity reader
29
30
  * (`readQuantitySet` in `@ifc-lite/parser`) reports only
30
31
  * `{name, type, value}` per quantity, so there is no formula string to carry
31
32
  * — `ParquetExporter`'s bulk-table path is the only one that can populate it.
32
33
  */
33
- export declare function writeQuantitiesOnDemand(store: IfcDataStore, effective: EffectiveEntityIndex | null): Promise<Uint8Array>;
34
+ export declare function writeQuantitiesOnDemand(store: IfcDataStore, effective: EffectiveEntityIndex | null, view?: MutablePropertyView | null, sourceIds?: Iterable<number>, getBase?: (id: number) => import("@ifc-lite/data").QuantitySet[]): Promise<Uint8Array>;
34
35
  //# sourceMappingURL=parquet-exporter-ondemand.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parquet-exporter-ondemand.d.ts","sourceRoot":"","sources":["../src/parquet-exporter-ondemand.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAKjE,wBAAsB,uBAAuB,CACzC,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,oBAAoB,GAAG,IAAI,GACvC,OAAO,CAAC,UAAU,CAAC,CA4CrB;AAED;;;;;GAKG;AACH,wBAAsB,uBAAuB,CACzC,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,oBAAoB,GAAG,IAAI,GACvC,OAAO,CAAC,UAAU,CAAC,CA+BrB"}
1
+ {"version":3,"file":"parquet-exporter-ondemand.d.ts","sourceRoot":"","sources":["../src/parquet-exporter-ondemand.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAYjE,wBAAsB,uBAAuB,CACzC,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,oBAAoB,GAAG,IAAI,EACtC,IAAI,CAAC,EAAE,mBAAmB,GAAG,IAAI,EACjC,SAAS,GAAE,QAAQ,CAAC,MAAM,CAA2C,EACrE,OAAO,IAAI,IAAI,MAAM,2CAA4B,EACjD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAClC,OAAO,CAAC,UAAU,CAAC,CA6CrB;AAED;;;;;GAKG;AACH,wBAAsB,uBAAuB,CACzC,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,oBAAoB,GAAG,IAAI,EACtC,IAAI,CAAC,EAAE,mBAAmB,GAAG,IAAI,EACjC,SAAS,GAAE,QAAQ,CAAC,MAAM,CAA2C,EACrE,OAAO,IAAI,IAAI,MAAM,2CAA4B,GAClD,OAAO,CAAC,UAAU,CAAC,CA+BrB"}
@@ -5,7 +5,15 @@ import { PropertyValueType } from '@ifc-lite/data';
5
5
  import { columnsToParquet } from './columns-to-parquet.js';
6
6
  import { PARQUET_UINT32_COLUMNS } from './parquet-uint32-columns.js';
7
7
  import { propertyValueTypeToString, quantityTypeToString } from './parquet-type-strings.js';
8
- export async function writePropertiesOnDemand(store, effective) {
8
+ function effectiveOwnerIds(sourceIds, view) {
9
+ const ids = new Set(sourceIds);
10
+ for (const change of view.getEffectiveChanges())
11
+ ids.add(change.entityId);
12
+ for (const created of view.getNewEntities())
13
+ ids.add(created.expressId);
14
+ return ids;
15
+ }
16
+ export async function writePropertiesOnDemand(store, effective, view, sourceIds = store.onDemandPropertyMap?.keys() ?? [], getBase = (id) => store.getProperties(id), onCount) {
9
17
  const entityIdCol = [];
10
18
  const psetNameCol = [];
11
19
  const psetGlobalIdCol = [];
@@ -18,10 +26,10 @@ export async function writePropertiesOnDemand(store, effective) {
18
26
  const valueRealCol = [];
19
27
  const valueIntCol = [];
20
28
  const valueBoolCol = [];
21
- for (const id of store.onDemandPropertyMap.keys()) {
29
+ for (const id of view ? effectiveOwnerIds(sourceIds, view) : sourceIds) {
22
30
  if (effective?.isDeleted(id))
23
31
  continue;
24
- const psets = store.getProperties(id);
32
+ const psets = view ? view.getForEntity(id, getBase) : getBase(id);
25
33
  for (const pset of psets) {
26
34
  for (const prop of pset.properties) {
27
35
  entityIdCol.push(id);
@@ -37,6 +45,7 @@ export async function writePropertiesOnDemand(store, effective) {
37
45
  }
38
46
  }
39
47
  }
48
+ onCount?.(entityIdCol.length);
40
49
  return columnsToParquet({
41
50
  EntityId: entityIdCol,
42
51
  PsetName: psetNameCol,
@@ -55,17 +64,17 @@ export async function writePropertiesOnDemand(store, effective) {
55
64
  * `{name, type, value}` per quantity, so there is no formula string to carry
56
65
  * — `ParquetExporter`'s bulk-table path is the only one that can populate it.
57
66
  */
58
- export async function writeQuantitiesOnDemand(store, effective) {
67
+ export async function writeQuantitiesOnDemand(store, effective, view, sourceIds = store.onDemandQuantityMap?.keys() ?? [], getBase = (id) => store.getQuantities(id)) {
59
68
  const entityIdCol = [];
60
69
  const qsetNameCol = [];
61
70
  const quantityNameCol = [];
62
71
  const quantityTypeCol = [];
63
72
  const valueCol = [];
64
73
  const formulaCol = [];
65
- for (const id of store.onDemandQuantityMap.keys()) {
74
+ for (const id of view ? effectiveOwnerIds(sourceIds, view) : sourceIds) {
66
75
  if (effective?.isDeleted(id))
67
76
  continue;
68
- const qsets = store.getQuantities(id);
77
+ const qsets = view ? view.getQuantitiesForEntity(id, getBase) : getBase(id);
69
78
  for (const qset of qsets) {
70
79
  for (const q of qset.quantities) {
71
80
  entityIdCol.push(id);
@@ -1 +1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;KACtB,EAAE,IAAI,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,sBAAsB,CAAC,CAAC;AACnD,CAAC"}
@@ -18,18 +18,11 @@ export declare class ParquetExporter {
18
18
  * (README example, `tests/integration.test.ts`) keep working unchanged and
19
19
  * keep exporting the source model as parsed.
20
20
  *
21
- * When supplied, entities the overlay tombstoned via
22
- * `MutablePropertyView.deleteEntity()` — and every row that references
23
- * one — are dropped from `Entities`, `Properties`, `Quantities`,
24
- * `Relationships`, `SpatialHierarchy` and the geometry tables
25
- * (`VertexBuffer`, `IndexBuffer`, `Meshes`) (#2046; geometry tables
26
- * joined the set after they were found still emitting a deleted
27
- * entity's mesh into an otherwise-filtered archive). Unlike
28
- * `StepExporter`/`Ifc5Exporter`, this is deletion-only: unlike those
29
- * two, the writers below column-copy typed arrays out of the store in
30
- * one shot rather than looping per entity, so they cannot also apply
31
- * the overlay's pset/quantity/attribute edits the way a per-entity
32
- * emission pass can. That is a known, separate gap.
21
+ * When supplied, tombstoned entities and rows that reference them are
22
+ * dropped from every table (#2046), and overlay-created entities are
23
+ * appended to `Entities.parquet`. Relationship rows resolve authored
24
+ * records and edited endpoints; property and quantity rows resolve live
25
+ * overlays. Geometry payload edits remain a separate gap.
33
26
  */
34
27
  constructor(store: IfcDataStore, geometryResult?: GeometryResult, mutationView?: MutablePropertyView);
35
28
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"parquet-exporter.d.ts","sourceRoot":"","sources":["../src/parquet-exporter.ts"],"names":[],"mappings":"AAIA,uDAAuD;AAEvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAQ/D,MAAM,WAAW,oBAAoB;IACjC,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;GAGG;AACH,qBAAa,eAA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