@ifc-lite/create 3.2.0 → 5.1.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.
Files changed (426) hide show
  1. package/README.md +43 -0
  2. package/dist/in-store/align-boxes.d.ts +38 -0
  3. package/dist/in-store/align-boxes.d.ts.map +1 -0
  4. package/dist/in-store/align-boxes.js +97 -0
  5. package/dist/in-store/align-boxes.js.map +1 -0
  6. package/dist/in-store/anchor.d.ts.map +1 -1
  7. package/dist/in-store/anchor.js +13 -2
  8. package/dist/in-store/anchor.js.map +1 -1
  9. package/dist/in-store/auto-space-detect.d.ts +1 -1
  10. package/dist/in-store/auto-space-detect.js +1 -1
  11. package/dist/in-store/beam.d.ts +10 -1
  12. package/dist/in-store/beam.d.ts.map +1 -1
  13. package/dist/in-store/beam.js +17 -35
  14. package/dist/in-store/beam.js.map +1 -1
  15. package/dist/in-store/column.d.ts +10 -1
  16. package/dist/in-store/column.d.ts.map +1 -1
  17. package/dist/in-store/column.js +23 -22
  18. package/dist/in-store/column.js.map +1 -1
  19. package/dist/in-store/copy-array.d.ts +17 -0
  20. package/dist/in-store/copy-array.d.ts.map +1 -0
  21. package/dist/in-store/copy-array.js +47 -0
  22. package/dist/in-store/copy-array.js.map +1 -0
  23. package/dist/in-store/copy-batch.d.ts +27 -0
  24. package/dist/in-store/copy-batch.d.ts.map +1 -0
  25. package/dist/in-store/copy-batch.js +101 -0
  26. package/dist/in-store/copy-batch.js.map +1 -0
  27. package/dist/in-store/copy-dependent-walk.d.ts +27 -0
  28. package/dist/in-store/copy-dependent-walk.d.ts.map +1 -0
  29. package/dist/in-store/copy-dependent-walk.js +61 -0
  30. package/dist/in-store/copy-dependent-walk.js.map +1 -0
  31. package/dist/in-store/copy-frame.d.ts +53 -0
  32. package/dist/in-store/copy-frame.d.ts.map +1 -0
  33. package/dist/in-store/copy-frame.js +112 -0
  34. package/dist/in-store/copy-frame.js.map +1 -0
  35. package/dist/in-store/copy-product.d.ts +76 -0
  36. package/dist/in-store/copy-product.d.ts.map +1 -0
  37. package/dist/in-store/copy-product.js +318 -0
  38. package/dist/in-store/copy-product.js.map +1 -0
  39. package/dist/in-store/curtain-wall.d.ts +87 -0
  40. package/dist/in-store/curtain-wall.d.ts.map +1 -0
  41. package/dist/in-store/curtain-wall.js +237 -0
  42. package/dist/in-store/curtain-wall.js.map +1 -0
  43. package/dist/in-store/edit/effective-mutation-view.d.ts +6 -0
  44. package/dist/in-store/edit/effective-mutation-view.d.ts.map +1 -0
  45. package/dist/in-store/edit/effective-mutation-view.js +45 -0
  46. package/dist/in-store/edit/effective-mutation-view.js.map +1 -0
  47. package/dist/in-store/edit/effective-storey.d.ts +13 -0
  48. package/dist/in-store/edit/effective-storey.d.ts.map +1 -0
  49. package/dist/in-store/edit/effective-storey.js +36 -0
  50. package/dist/in-store/edit/effective-storey.js.map +1 -0
  51. package/dist/in-store/edit/effective-storeys.d.ts +9 -0
  52. package/dist/in-store/edit/effective-storeys.d.ts.map +1 -0
  53. package/dist/in-store/edit/effective-storeys.js +16 -0
  54. package/dist/in-store/edit/effective-storeys.js.map +1 -0
  55. package/dist/in-store/edit/hosted-opening-refit.d.ts +29 -0
  56. package/dist/in-store/edit/hosted-opening-refit.d.ts.map +1 -0
  57. package/dist/in-store/edit/hosted-opening-refit.js +168 -0
  58. package/dist/in-store/edit/hosted-opening-refit.js.map +1 -0
  59. package/dist/in-store/edit/length-unit-scale.d.ts +24 -0
  60. package/dist/in-store/edit/length-unit-scale.d.ts.map +1 -0
  61. package/dist/in-store/edit/length-unit-scale.js +37 -0
  62. package/dist/in-store/edit/length-unit-scale.js.map +1 -0
  63. package/dist/in-store/edit/linear-element-edit.d.ts +131 -0
  64. package/dist/in-store/edit/linear-element-edit.d.ts.map +1 -0
  65. package/dist/in-store/edit/linear-element-edit.js +259 -0
  66. package/dist/in-store/edit/linear-element-edit.js.map +1 -0
  67. package/dist/in-store/edit/metadata-clone-effective.d.ts +5 -0
  68. package/dist/in-store/edit/metadata-clone-effective.d.ts.map +1 -0
  69. package/dist/in-store/edit/metadata-clone-effective.js +47 -0
  70. package/dist/in-store/edit/metadata-clone-effective.js.map +1 -0
  71. package/dist/in-store/edit/metadata-clone.d.ts +40 -0
  72. package/dist/in-store/edit/metadata-clone.d.ts.map +1 -0
  73. package/dist/in-store/edit/metadata-clone.js +107 -0
  74. package/dist/in-store/edit/metadata-clone.js.map +1 -0
  75. package/dist/in-store/edit/placement-core.d.ts +140 -0
  76. package/dist/in-store/edit/placement-core.d.ts.map +1 -0
  77. package/dist/in-store/edit/placement-core.js +317 -0
  78. package/dist/in-store/edit/placement-core.js.map +1 -0
  79. package/dist/in-store/edit/polygon-clip.d.ts +58 -0
  80. package/dist/in-store/edit/polygon-clip.d.ts.map +1 -0
  81. package/dist/in-store/edit/polygon-clip.js +153 -0
  82. package/dist/in-store/edit/polygon-clip.js.map +1 -0
  83. package/dist/in-store/edit/read-profile.d.ts +6 -0
  84. package/dist/in-store/edit/read-profile.d.ts.map +1 -0
  85. package/dist/in-store/edit/read-profile.js +95 -0
  86. package/dist/in-store/edit/read-profile.js.map +1 -0
  87. package/dist/in-store/edit/slab-edit-frame.d.ts +40 -0
  88. package/dist/in-store/edit/slab-edit-frame.d.ts.map +1 -0
  89. package/dist/in-store/edit/slab-edit-frame.js +146 -0
  90. package/dist/in-store/edit/slab-edit-frame.js.map +1 -0
  91. package/dist/in-store/edit/slab-edit.d.ts +112 -0
  92. package/dist/in-store/edit/slab-edit.d.ts.map +1 -0
  93. package/dist/in-store/edit/slab-edit.js +275 -0
  94. package/dist/in-store/edit/slab-edit.js.map +1 -0
  95. package/dist/in-store/edit/slab-opening-carry.d.ts +10 -0
  96. package/dist/in-store/edit/slab-opening-carry.d.ts.map +1 -0
  97. package/dist/in-store/edit/slab-opening-carry.js +65 -0
  98. package/dist/in-store/edit/slab-opening-carry.js.map +1 -0
  99. package/dist/in-store/edit/split-guid.d.ts +29 -0
  100. package/dist/in-store/edit/split-guid.d.ts.map +1 -0
  101. package/dist/in-store/edit/split-guid.js +64 -0
  102. package/dist/in-store/edit/split-guid.js.map +1 -0
  103. package/dist/in-store/edit/split-target.d.ts +90 -0
  104. package/dist/in-store/edit/split-target.d.ts.map +1 -0
  105. package/dist/in-store/edit/split-target.js +116 -0
  106. package/dist/in-store/edit/split-target.js.map +1 -0
  107. package/dist/in-store/edit/target.d.ts +8 -0
  108. package/dist/in-store/edit/target.d.ts.map +1 -0
  109. package/dist/in-store/edit/target.js +5 -0
  110. package/dist/in-store/edit/target.js.map +1 -0
  111. package/dist/in-store/edit/trim-extend-geometry.d.ts +99 -0
  112. package/dist/in-store/edit/trim-extend-geometry.d.ts.map +1 -0
  113. package/dist/in-store/edit/trim-extend-geometry.js +105 -0
  114. package/dist/in-store/edit/trim-extend-geometry.js.map +1 -0
  115. package/dist/in-store/edit/wall-axis-edit.d.ts +16 -0
  116. package/dist/in-store/edit/wall-axis-edit.d.ts.map +1 -0
  117. package/dist/in-store/edit/wall-axis-edit.js +40 -0
  118. package/dist/in-store/edit/wall-axis-edit.js.map +1 -0
  119. package/dist/in-store/edit/wall-edit.d.ts +157 -0
  120. package/dist/in-store/edit/wall-edit.d.ts.map +1 -0
  121. package/dist/in-store/edit/wall-edit.js +276 -0
  122. package/dist/in-store/edit/wall-edit.js.map +1 -0
  123. package/dist/in-store/edit/wall-hosted-cuts.d.ts +35 -0
  124. package/dist/in-store/edit/wall-hosted-cuts.d.ts.map +1 -0
  125. package/dist/in-store/edit/wall-hosted-cuts.js +27 -0
  126. package/dist/in-store/edit/wall-hosted-cuts.js.map +1 -0
  127. package/dist/in-store/edit/wall-opening-reassign.d.ts +18 -0
  128. package/dist/in-store/edit/wall-opening-reassign.d.ts.map +1 -0
  129. package/dist/in-store/edit/wall-opening-reassign.js +50 -0
  130. package/dist/in-store/edit/wall-opening-reassign.js.map +1 -0
  131. package/dist/in-store/element-align.d.ts +13 -0
  132. package/dist/in-store/element-align.d.ts.map +1 -0
  133. package/dist/in-store/element-align.js +90 -0
  134. package/dist/in-store/element-align.js.map +1 -0
  135. package/dist/in-store/element-replacement.d.ts +26 -0
  136. package/dist/in-store/element-replacement.d.ts.map +1 -0
  137. package/dist/in-store/element-replacement.js +68 -0
  138. package/dist/in-store/element-replacement.js.map +1 -0
  139. package/dist/in-store/element-size-edit.d.ts +40 -0
  140. package/dist/in-store/element-size-edit.d.ts.map +1 -0
  141. package/dist/in-store/element-size-edit.js +103 -0
  142. package/dist/in-store/element-size-edit.js.map +1 -0
  143. package/dist/in-store/element-split-axis.d.ts +6 -0
  144. package/dist/in-store/element-split-axis.d.ts.map +1 -0
  145. package/dist/in-store/element-split-axis.js +87 -0
  146. package/dist/in-store/element-split-axis.js.map +1 -0
  147. package/dist/in-store/element-split-joined.d.ts +13 -0
  148. package/dist/in-store/element-split-joined.d.ts.map +1 -0
  149. package/dist/in-store/element-split-joined.js +74 -0
  150. package/dist/in-store/element-split-joined.js.map +1 -0
  151. package/dist/in-store/element-split-placement.d.ts +19 -0
  152. package/dist/in-store/element-split-placement.d.ts.map +1 -0
  153. package/dist/in-store/element-split-placement.js +48 -0
  154. package/dist/in-store/element-split-placement.js.map +1 -0
  155. package/dist/in-store/element-split-slab.d.ts +19 -0
  156. package/dist/in-store/element-split-slab.d.ts.map +1 -0
  157. package/dist/in-store/element-split-slab.js +86 -0
  158. package/dist/in-store/element-split-slab.js.map +1 -0
  159. package/dist/in-store/element-split.d.ts +49 -0
  160. package/dist/in-store/element-split.d.ts.map +1 -0
  161. package/dist/in-store/element-split.js +52 -0
  162. package/dist/in-store/element-split.js.map +1 -0
  163. package/dist/in-store/element-transform-edit.d.ts +33 -0
  164. package/dist/in-store/element-transform-edit.d.ts.map +1 -0
  165. package/dist/in-store/element-transform-edit.js +97 -0
  166. package/dist/in-store/element-transform-edit.js.map +1 -0
  167. package/dist/in-store/element-transform-frames.d.ts +58 -0
  168. package/dist/in-store/element-transform-frames.d.ts.map +1 -0
  169. package/dist/in-store/element-transform-frames.js +110 -0
  170. package/dist/in-store/element-transform-frames.js.map +1 -0
  171. package/dist/in-store/element-transform-joins.d.ts +4 -0
  172. package/dist/in-store/element-transform-joins.d.ts.map +1 -0
  173. package/dist/in-store/element-transform-joins.js +62 -0
  174. package/dist/in-store/element-transform-joins.js.map +1 -0
  175. package/dist/in-store/element-transform-plan.d.ts +38 -0
  176. package/dist/in-store/element-transform-plan.d.ts.map +1 -0
  177. package/dist/in-store/element-transform-plan.js +115 -0
  178. package/dist/in-store/element-transform-plan.js.map +1 -0
  179. package/dist/in-store/element-trim-extend.d.ts +25 -0
  180. package/dist/in-store/element-trim-extend.d.ts.map +1 -0
  181. package/dist/in-store/element-trim-extend.js +97 -0
  182. package/dist/in-store/element-trim-extend.js.map +1 -0
  183. package/dist/in-store/extract-grids.d.ts +36 -0
  184. package/dist/in-store/extract-grids.d.ts.map +1 -0
  185. package/dist/in-store/extract-grids.js +220 -0
  186. package/dist/in-store/extract-grids.js.map +1 -0
  187. package/dist/in-store/extract-walls.d.ts +12 -23
  188. package/dist/in-store/extract-walls.d.ts.map +1 -1
  189. package/dist/in-store/extract-walls.js +6 -69
  190. package/dist/in-store/extract-walls.js.map +1 -1
  191. package/dist/in-store/generate-spaces.d.ts +1 -1
  192. package/dist/in-store/grid-column.d.ts +23 -0
  193. package/dist/in-store/grid-column.d.ts.map +1 -0
  194. package/dist/in-store/grid-column.js +73 -0
  195. package/dist/in-store/grid-column.js.map +1 -0
  196. package/dist/in-store/grid-intersection-read.d.ts +10 -0
  197. package/dist/in-store/grid-intersection-read.d.ts.map +1 -0
  198. package/dist/in-store/grid-intersection-read.js +45 -0
  199. package/dist/in-store/grid-intersection-read.js.map +1 -0
  200. package/dist/in-store/grid.d.ts +124 -0
  201. package/dist/in-store/grid.d.ts.map +1 -0
  202. package/dist/in-store/grid.js +204 -0
  203. package/dist/in-store/grid.js.map +1 -0
  204. package/dist/in-store/group-evidence.d.ts +49 -0
  205. package/dist/in-store/group-evidence.d.ts.map +1 -0
  206. package/dist/in-store/group-evidence.js +111 -0
  207. package/dist/in-store/group-evidence.js.map +1 -0
  208. package/dist/in-store/group-graph.d.ts +51 -0
  209. package/dist/in-store/group-graph.d.ts.map +1 -0
  210. package/dist/in-store/group-graph.js +213 -0
  211. package/dist/in-store/group-graph.js.map +1 -0
  212. package/dist/in-store/group.d.ts +34 -0
  213. package/dist/in-store/group.d.ts.map +1 -0
  214. package/dist/in-store/group.js +181 -0
  215. package/dist/in-store/group.js.map +1 -0
  216. package/dist/in-store/host-geometry-frame.d.ts +48 -0
  217. package/dist/in-store/host-geometry-frame.d.ts.map +1 -0
  218. package/dist/in-store/host-geometry-frame.js +190 -0
  219. package/dist/in-store/host-geometry-frame.js.map +1 -0
  220. package/dist/in-store/hosted-element-edit.d.ts +29 -0
  221. package/dist/in-store/hosted-element-edit.d.ts.map +1 -0
  222. package/dist/in-store/hosted-element-edit.js +120 -0
  223. package/dist/in-store/hosted-element-edit.js.map +1 -0
  224. package/dist/in-store/hosted-element.d.ts +41 -0
  225. package/dist/in-store/hosted-element.d.ts.map +1 -0
  226. package/dist/in-store/hosted-element.js +124 -0
  227. package/dist/in-store/hosted-element.js.map +1 -0
  228. package/dist/in-store/hosted-fill-read.d.ts +56 -0
  229. package/dist/in-store/hosted-fill-read.d.ts.map +1 -0
  230. package/dist/in-store/hosted-fill-read.js +197 -0
  231. package/dist/in-store/hosted-fill-read.js.map +1 -0
  232. package/dist/in-store/hosted-global-id.d.ts +8 -0
  233. package/dist/in-store/hosted-global-id.d.ts.map +1 -0
  234. package/dist/in-store/hosted-global-id.js +53 -0
  235. package/dist/in-store/hosted-global-id.js.map +1 -0
  236. package/dist/in-store/hosted-placement-edit.d.ts +30 -0
  237. package/dist/in-store/hosted-placement-edit.d.ts.map +1 -0
  238. package/dist/in-store/hosted-placement-edit.js +123 -0
  239. package/dist/in-store/hosted-placement-edit.js.map +1 -0
  240. package/dist/in-store/hosted-scale-chain.d.ts +12 -0
  241. package/dist/in-store/hosted-scale-chain.d.ts.map +1 -0
  242. package/dist/in-store/hosted-scale-chain.js +74 -0
  243. package/dist/in-store/hosted-scale-chain.js.map +1 -0
  244. package/dist/in-store/hosted-shape-edit.d.ts +9 -0
  245. package/dist/in-store/hosted-shape-edit.d.ts.map +1 -0
  246. package/dist/in-store/hosted-shape-edit.js +79 -0
  247. package/dist/in-store/hosted-shape-edit.js.map +1 -0
  248. package/dist/in-store/index.d.ts +66 -0
  249. package/dist/in-store/index.d.ts.map +1 -0
  250. package/dist/in-store/index.js +71 -0
  251. package/dist/in-store/index.js.map +1 -0
  252. package/dist/in-store/linear-profile-frame.d.ts +10 -0
  253. package/dist/in-store/linear-profile-frame.d.ts.map +1 -0
  254. package/dist/in-store/linear-profile-frame.js +17 -0
  255. package/dist/in-store/linear-profile-frame.js.map +1 -0
  256. package/dist/in-store/material.d.ts.map +1 -1
  257. package/dist/in-store/material.js +17 -6
  258. package/dist/in-store/material.js.map +1 -1
  259. package/dist/in-store/member.d.ts +8 -2
  260. package/dist/in-store/member.d.ts.map +1 -1
  261. package/dist/in-store/member.js +15 -21
  262. package/dist/in-store/member.js.map +1 -1
  263. package/dist/in-store/ordinary-element.d.ts +47 -0
  264. package/dist/in-store/ordinary-element.d.ts.map +1 -0
  265. package/dist/in-store/ordinary-element.js +38 -0
  266. package/dist/in-store/ordinary-element.js.map +1 -0
  267. package/dist/in-store/placement-frame.d.ts +15 -5
  268. package/dist/in-store/placement-frame.d.ts.map +1 -1
  269. package/dist/in-store/placement-frame.js +25 -36
  270. package/dist/in-store/placement-frame.js.map +1 -1
  271. package/dist/in-store/profile.d.ts +141 -0
  272. package/dist/in-store/profile.d.ts.map +1 -0
  273. package/dist/in-store/profile.js +174 -0
  274. package/dist/in-store/profile.js.map +1 -0
  275. package/dist/in-store/railing.d.ts +65 -0
  276. package/dist/in-store/railing.d.ts.map +1 -0
  277. package/dist/in-store/railing.js +112 -0
  278. package/dist/in-store/railing.js.map +1 -0
  279. package/dist/in-store/rel-connects-path.d.ts +43 -0
  280. package/dist/in-store/rel-connects-path.d.ts.map +1 -0
  281. package/dist/in-store/rel-connects-path.js +65 -0
  282. package/dist/in-store/rel-connects-path.js.map +1 -0
  283. package/dist/in-store/resolve-anchor.d.ts +3 -2
  284. package/dist/in-store/resolve-anchor.d.ts.map +1 -1
  285. package/dist/in-store/resolve-anchor.js +7 -5
  286. package/dist/in-store/resolve-anchor.js.map +1 -1
  287. package/dist/in-store/resolve-host.d.ts +12 -1
  288. package/dist/in-store/resolve-host.d.ts.map +1 -1
  289. package/dist/in-store/resolve-host.js +169 -85
  290. package/dist/in-store/resolve-host.js.map +1 -1
  291. package/dist/in-store/resolve-relations.d.ts +3 -1
  292. package/dist/in-store/resolve-relations.d.ts.map +1 -1
  293. package/dist/in-store/resolve-relations.js +8 -3
  294. package/dist/in-store/resolve-relations.js.map +1 -1
  295. package/dist/in-store/resolve-source.d.ts.map +1 -1
  296. package/dist/in-store/resolve-source.js +39 -59
  297. package/dist/in-store/resolve-source.js.map +1 -1
  298. package/dist/in-store/room-candidates.d.ts +58 -0
  299. package/dist/in-store/room-candidates.d.ts.map +1 -0
  300. package/dist/in-store/room-candidates.js +135 -0
  301. package/dist/in-store/room-candidates.js.map +1 -0
  302. package/dist/in-store/room-creation-plan.d.ts +16 -0
  303. package/dist/in-store/room-creation-plan.d.ts.map +1 -0
  304. package/dist/in-store/room-creation-plan.js +28 -0
  305. package/dist/in-store/room-creation-plan.js.map +1 -0
  306. package/dist/in-store/room-floor-height.d.ts +24 -0
  307. package/dist/in-store/room-floor-height.d.ts.map +1 -0
  308. package/dist/in-store/room-floor-height.js +32 -0
  309. package/dist/in-store/room-floor-height.js.map +1 -0
  310. package/dist/in-store/room-footprint-native.d.ts +19 -0
  311. package/dist/in-store/room-footprint-native.d.ts.map +1 -0
  312. package/dist/in-store/room-footprint-native.js +117 -0
  313. package/dist/in-store/room-footprint-native.js.map +1 -0
  314. package/dist/in-store/room-layout-cache.d.ts +23 -0
  315. package/dist/in-store/room-layout-cache.d.ts.map +1 -0
  316. package/dist/in-store/room-layout-cache.js +84 -0
  317. package/dist/in-store/room-layout-cache.js.map +1 -0
  318. package/dist/in-store/room-layout-core.d.ts +68 -0
  319. package/dist/in-store/room-layout-core.d.ts.map +1 -0
  320. package/dist/in-store/room-layout-core.js +153 -0
  321. package/dist/in-store/room-layout-core.js.map +1 -0
  322. package/dist/in-store/room-population.d.ts +5 -0
  323. package/dist/in-store/room-population.d.ts.map +1 -0
  324. package/dist/in-store/room-population.js +28 -0
  325. package/dist/in-store/room-population.js.map +1 -0
  326. package/dist/in-store/room-space-meshes.d.ts +15 -0
  327. package/dist/in-store/room-space-meshes.d.ts.map +1 -0
  328. package/dist/in-store/room-space-meshes.js +38 -0
  329. package/dist/in-store/room-space-meshes.js.map +1 -0
  330. package/dist/in-store/room-store.d.ts +55 -0
  331. package/dist/in-store/room-store.d.ts.map +1 -0
  332. package/dist/in-store/room-store.js +173 -0
  333. package/dist/in-store/room-store.js.map +1 -0
  334. package/dist/in-store/room-storey-elevation.d.ts +5 -0
  335. package/dist/in-store/room-storey-elevation.d.ts.map +1 -0
  336. package/dist/in-store/room-storey-elevation.js +42 -0
  337. package/dist/in-store/room-storey-elevation.js.map +1 -0
  338. package/dist/in-store/room-storey-frame.d.ts +47 -0
  339. package/dist/in-store/room-storey-frame.d.ts.map +1 -0
  340. package/dist/in-store/room-storey-frame.js +48 -0
  341. package/dist/in-store/room-storey-frame.js.map +1 -0
  342. package/dist/in-store/room-wall-rects.d.ts +117 -0
  343. package/dist/in-store/room-wall-rects.d.ts.map +1 -0
  344. package/dist/in-store/room-wall-rects.js +157 -0
  345. package/dist/in-store/room-wall-rects.js.map +1 -0
  346. package/dist/in-store/schema-attributes.d.ts +8 -3
  347. package/dist/in-store/schema-attributes.d.ts.map +1 -1
  348. package/dist/in-store/schema-attributes.js +18 -9
  349. package/dist/in-store/schema-attributes.js.map +1 -1
  350. package/dist/in-store/slab.d.ts.map +1 -1
  351. package/dist/in-store/slab.js +1 -4
  352. package/dist/in-store/slab.js.map +1 -1
  353. package/dist/in-store/space-footprints.d.ts +55 -0
  354. package/dist/in-store/space-footprints.d.ts.map +1 -0
  355. package/dist/in-store/space-footprints.js +260 -0
  356. package/dist/in-store/space-footprints.js.map +1 -0
  357. package/dist/in-store/space.d.ts.map +1 -1
  358. package/dist/in-store/space.js +15 -3
  359. package/dist/in-store/space.js.map +1 -1
  360. package/dist/in-store/spatial-children.d.ts +1 -1
  361. package/dist/in-store/spatial-children.js +1 -1
  362. package/dist/in-store/stair-edit.d.ts +24 -0
  363. package/dist/in-store/stair-edit.d.ts.map +1 -0
  364. package/dist/in-store/stair-edit.js +190 -0
  365. package/dist/in-store/stair-edit.js.map +1 -0
  366. package/dist/in-store/stair-removal.d.ts +17 -0
  367. package/dist/in-store/stair-removal.d.ts.map +1 -0
  368. package/dist/in-store/stair-removal.js +134 -0
  369. package/dist/in-store/stair-removal.js.map +1 -0
  370. package/dist/in-store/stair.d.ts +58 -0
  371. package/dist/in-store/stair.d.ts.map +1 -0
  372. package/dist/in-store/stair.js +156 -0
  373. package/dist/in-store/stair.js.map +1 -0
  374. package/dist/in-store/storey-plan-frame.d.ts +2 -1
  375. package/dist/in-store/storey-plan-frame.d.ts.map +1 -1
  376. package/dist/in-store/storey-plan-frame.js +20 -11
  377. package/dist/in-store/storey-plan-frame.js.map +1 -1
  378. package/dist/in-store/storey-reassignment-plan.d.ts +53 -0
  379. package/dist/in-store/storey-reassignment-plan.d.ts.map +1 -0
  380. package/dist/in-store/storey-reassignment-plan.js +237 -0
  381. package/dist/in-store/storey-reassignment-plan.js.map +1 -0
  382. package/dist/in-store/storey-reassignment.d.ts +8 -0
  383. package/dist/in-store/storey-reassignment.d.ts.map +1 -0
  384. package/dist/in-store/storey-reassignment.js +52 -0
  385. package/dist/in-store/storey-reassignment.js.map +1 -0
  386. package/dist/in-store/trim-extend-plan.d.ts +27 -0
  387. package/dist/in-store/trim-extend-plan.d.ts.map +1 -0
  388. package/dist/in-store/trim-extend-plan.js +49 -0
  389. package/dist/in-store/trim-extend-plan.js.map +1 -0
  390. package/dist/in-store/wall-join-apply.d.ts +74 -0
  391. package/dist/in-store/wall-join-apply.d.ts.map +1 -0
  392. package/dist/in-store/wall-join-apply.js +137 -0
  393. package/dist/in-store/wall-join-apply.js.map +1 -0
  394. package/dist/in-store/wall-join-edit.d.ts +53 -0
  395. package/dist/in-store/wall-join-edit.d.ts.map +1 -0
  396. package/dist/in-store/wall-join-edit.js +251 -0
  397. package/dist/in-store/wall-join-edit.js.map +1 -0
  398. package/dist/in-store/wall-join-read.d.ts +60 -0
  399. package/dist/in-store/wall-join-read.d.ts.map +1 -0
  400. package/dist/in-store/wall-join-read.js +230 -0
  401. package/dist/in-store/wall-join-read.js.map +1 -0
  402. package/dist/in-store/wall-join.d.ts +122 -0
  403. package/dist/in-store/wall-join.d.ts.map +1 -0
  404. package/dist/in-store/wall-join.js +231 -0
  405. package/dist/in-store/wall-join.js.map +1 -0
  406. package/dist/in-store/wall-opening-fit.d.ts +11 -0
  407. package/dist/in-store/wall-opening-fit.d.ts.map +1 -0
  408. package/dist/in-store/wall-opening-fit.js +27 -0
  409. package/dist/in-store/wall-opening-fit.js.map +1 -0
  410. package/dist/in-store/wall-section-edit.d.ts +16 -0
  411. package/dist/in-store/wall-section-edit.d.ts.map +1 -0
  412. package/dist/in-store/wall-section-edit.js +75 -0
  413. package/dist/in-store/wall-section-edit.js.map +1 -0
  414. package/dist/in-store/wall-size-edit.d.ts +29 -0
  415. package/dist/in-store/wall-size-edit.d.ts.map +1 -0
  416. package/dist/in-store/wall-size-edit.js +65 -0
  417. package/dist/in-store/wall-size-edit.js.map +1 -0
  418. package/dist/in-store/wall.d.ts +32 -0
  419. package/dist/in-store/wall.d.ts.map +1 -1
  420. package/dist/in-store/wall.js +77 -13
  421. package/dist/in-store/wall.js.map +1 -1
  422. package/dist/index.d.ts +25 -38
  423. package/dist/index.d.ts.map +1 -1
  424. package/dist/index.js +25 -40
  425. package/dist/index.js.map +1 -1
  426. package/package.json +9 -8
@@ -0,0 +1,213 @@
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 { isValidIfcGuid } from '@ifc-lite/encoding';
5
+ import { effectiveCreatedRecord, effectiveSourceRecord } from '@ifc-lite/export';
6
+ import { iterateEffectiveEntityIds } from '@ifc-lite/mutations';
7
+ import { createSchemaEntityNameSnapshot } from '@ifc-lite/parser';
8
+ import { AnchorEntityReader } from './resolve-anchor.js';
9
+ import { conformsTo, schemaRegistry } from './schema-attributes.js';
10
+ /** Explicit bounds on file-controlled input; refusal never returns a partial graph. */
11
+ export const GROUP_GRAPH_LIMITS = { entities: 250_000, recordCharacters: 4_000_000, totalRecordCharacters: 80_000_000, references: 2_000_000, members: 10_000 };
12
+ /** Scan actual effective export records, never attribute numbers mistaken for refs. */
13
+ export function groupRecordReferences(text) {
14
+ const refs = [];
15
+ let attributes = false;
16
+ for (let i = 0; i < text.length; i++) {
17
+ if (text[i] === '/' && text[i + 1] === '*') {
18
+ const end = text.indexOf('*/', i + 2);
19
+ if (end < 0)
20
+ throw new Error('Group graph has an unterminated record');
21
+ i = end + 1;
22
+ continue;
23
+ }
24
+ if (text[i] === "'") {
25
+ let end = i;
26
+ do {
27
+ end = text.indexOf("'", end + 1);
28
+ if (end < 0)
29
+ throw new Error('Group graph has an unterminated record');
30
+ if (text[end + 1] !== "'")
31
+ break;
32
+ end++;
33
+ } while (true);
34
+ i = end;
35
+ continue;
36
+ }
37
+ if (text[i] === '(')
38
+ attributes = true;
39
+ if (!attributes || text[i] !== '#')
40
+ continue;
41
+ let end = i + 1;
42
+ while (end < text.length && text[end] >= '0' && text[end] <= '9')
43
+ end++;
44
+ if (end === i + 1)
45
+ throw new Error('Group graph has an unreadable reference');
46
+ const id = Number(text.slice(i + 1, end));
47
+ if (!Number.isSafeInteger(id) || id <= 0)
48
+ throw new Error('Group graph has an invalid reference');
49
+ refs.push(id);
50
+ i = end - 1;
51
+ }
52
+ if (!attributes)
53
+ throw new Error('Group graph has an unreadable record');
54
+ return refs;
55
+ }
56
+ /**
57
+ * The graph's whole-model entity budget without decoding a record (#7346). The
58
+ * parsed type buckets plus overlay creations bound the live population from
59
+ * above, so only a model near the budget walks the canonical iterator.
60
+ */
61
+ export function assertGroupEntityBudget(store, view, limit = GROUP_GRAPH_LIMITS.entities) {
62
+ let bound = view.getNewEntities().length;
63
+ // @raw-entity-enumeration-ok bucket sizes only bound the live population; the canonical iterator decides
64
+ for (const ids of store.entityIndex.byType.values())
65
+ bound += ids.length;
66
+ if (bound <= limit)
67
+ return;
68
+ let count = 0;
69
+ for (const _entity of iterateEffectiveEntityIds(store, view)) {
70
+ if (++count > limit)
71
+ throw new Error('Group graph entity budget exceeded');
72
+ }
73
+ }
74
+ export class GroupGraph {
75
+ store;
76
+ view;
77
+ limits;
78
+ schemaNames;
79
+ entities = new Map();
80
+ incoming = new Map();
81
+ roots = new Map();
82
+ /** `limits` exists so the budgets can be exercised at test scale; callers use the defaults. */
83
+ constructor(store, view, limits = GROUP_GRAPH_LIMITS) {
84
+ this.store = store;
85
+ this.view = view;
86
+ this.limits = limits;
87
+ if (store.schemaVersion !== 'IFC4' && store.schemaVersion !== 'IFC4X3') {
88
+ throw new Error('Generic IfcGroup authoring requires a declared IFC4 or IFC4X3 model');
89
+ }
90
+ this.schemaNames = createSchemaEntityNameSnapshot(schemaRegistry(store.schemaVersion, 'IfcGroup'));
91
+ const reader = new AnchorEntityReader(store, view, this.schemaNames);
92
+ const exportRecord = (expressId) => {
93
+ const created = effectiveCreatedRecord(view, expressId, store.schemaVersion);
94
+ // @raw-entity-enumeration-ok current candidate came from the canonical live iterator; source lookup supplies export record bytes only
95
+ const source = created ? undefined : store.entityIndex.byId.get(expressId);
96
+ const record = created ?? (source ? effectiveSourceRecord(view, expressId, store.source.decodeUtf8(source.byteOffset, source.byteOffset + source.byteLength), source.type, store.schemaVersion) : null);
97
+ if (!record || record.notWritten.length)
98
+ throw new Error(`Group graph cannot certify exported entity #${expressId}`);
99
+ if (record.text.length > this.limits.recordCharacters)
100
+ throw new Error('Group graph record budget exceeded');
101
+ return record;
102
+ };
103
+ // Refuse the entity budget from the live iterator before decoding any record:
104
+ // a refusal is the same answer, without seconds of main-thread decoding (#7346).
105
+ // A source record whose byte length exceeds the record budget is decoded once to
106
+ // measure its export text; overlay growth is measured in the main pass below.
107
+ const ids = [];
108
+ for (const { expressId } of iterateEffectiveEntityIds(store, view)) {
109
+ if (ids.length >= this.limits.entities)
110
+ throw new Error('Group graph entity budget exceeded');
111
+ ids.push(expressId);
112
+ }
113
+ for (const expressId of ids) {
114
+ // @raw-entity-enumeration-ok id came from the canonical live iterator; source byte length only bounds its UTF-16 export text
115
+ const source = view.getNewEntity(expressId) ? undefined : store.entityIndex.byId.get(expressId);
116
+ if (source && source.byteLength > this.limits.recordCharacters)
117
+ exportRecord(expressId);
118
+ }
119
+ let referenceCount = 0;
120
+ let recordCharacters = 0;
121
+ for (const expressId of ids) {
122
+ const entity = reader.entity(expressId);
123
+ if (!entity)
124
+ throw new Error(`Group graph cannot read current entity #${expressId}`);
125
+ this.entities.set(expressId, entity);
126
+ if (entity.names[0] === 'GlobalId' && typeof entity.attributes[0] === 'string') {
127
+ const guid = entity.attributes[0];
128
+ const owners = this.roots.get(guid) ?? [];
129
+ owners.push(expressId);
130
+ this.roots.set(guid, owners);
131
+ }
132
+ const record = exportRecord(expressId);
133
+ recordCharacters += record.text.length;
134
+ if (recordCharacters > this.limits.totalRecordCharacters)
135
+ throw new Error('Group graph total record work budget exceeded');
136
+ for (const target of groupRecordReferences(record.text)) {
137
+ if (++referenceCount > this.limits.references)
138
+ throw new Error('Group graph reference budget exceeded');
139
+ const referrers = this.incoming.get(target) ?? new Set();
140
+ referrers.add(expressId);
141
+ this.incoming.set(target, referrers);
142
+ }
143
+ }
144
+ }
145
+ root(id, expected) {
146
+ const entity = this.entities.get(id);
147
+ const guid = entity?.names[0] === 'GlobalId' ? entity.attributes[0] : undefined;
148
+ if (typeof guid !== 'string' || !isValidIfcGuid(guid))
149
+ throw new Error(`Group graph #${id} is not a live valid IfcRoot`);
150
+ if (this.roots.get(guid)?.length !== 1)
151
+ throw new Error(`Group graph GlobalId ${guid} has ambiguous current ownership`);
152
+ if (expected !== undefined && guid !== expected)
153
+ throw new Error(`Group graph #${id} GlobalId changed`);
154
+ return { expressId: id, GlobalId: guid };
155
+ }
156
+ availableGuid(guid) {
157
+ if (!isValidIfcGuid(guid) || this.roots.has(guid))
158
+ throw new Error('Group GlobalId is invalid or already owned');
159
+ }
160
+ snapshot(target) {
161
+ if (typeof target?.GlobalId !== 'string' || !isValidIfcGuid(target.GlobalId))
162
+ throw new Error('Group target must pin its current GlobalId');
163
+ const identity = this.root(target.expressId, target.GlobalId);
164
+ const entity = this.entities.get(target.expressId);
165
+ if (entity.type.toUpperCase() !== 'IFCGROUP')
166
+ throw new Error('Generic lifecycle requires exact IfcGroup, not a specialized group');
167
+ const optional = (name) => {
168
+ const value = entity.attributes[entity.names.indexOf(name)];
169
+ if (value !== null && value !== undefined && typeof value !== 'string')
170
+ throw new Error(`IfcGroup.${name} is unreadable`);
171
+ return value ?? null;
172
+ };
173
+ const memberships = [];
174
+ let totalMembers = 0;
175
+ const registry = schemaRegistry(this.store.schemaVersion, 'IfcGroup');
176
+ for (const [id, row] of this.entities) {
177
+ if (!conformsTo(registry, row.type, 'IfcRelAssignsToGroup', this.schemaNames))
178
+ continue;
179
+ const relating = referenceId(row.attributes[row.names.indexOf('RelatingGroup')]);
180
+ if (relating !== target.expressId)
181
+ continue;
182
+ if (row.type.toUpperCase() !== 'IFCRELASSIGNSTOGROUP')
183
+ throw new Error('Group membership has specialized assignment semantics');
184
+ const values = row.attributes[row.names.indexOf('RelatedObjects')];
185
+ if (!Array.isArray(values) || !values.length || values.length > this.limits.members) {
186
+ throw new Error('IfcRelAssignsToGroup.RelatedObjects is incomplete or exceeds its budget');
187
+ }
188
+ const ids = values.map(referenceId);
189
+ if (ids.some(value => value === null) || new Set(ids).size !== ids.length)
190
+ throw new Error('Group membership references are unreadable or duplicated');
191
+ totalMembers += ids.length;
192
+ if (totalMembers > this.limits.members)
193
+ throw new Error('Complete group membership budget exceeded');
194
+ for (const member of ids) {
195
+ const type = this.entities.get(member)?.type;
196
+ if (member === target.expressId || !type || !conformsTo(registry, type, 'IfcObjectDefinition', this.schemaNames))
197
+ throw new Error('Current group membership has an invalid object definition');
198
+ }
199
+ memberships.push({ relationship: this.root(id), RelatedObjects: ids.map(value => this.root(value)) });
200
+ }
201
+ return { ...identity, Name: optional('Name'), Description: optional('Description'), ObjectType: optional('ObjectType'), memberships };
202
+ }
203
+ }
204
+ export function referenceId(value) {
205
+ if (typeof value === 'number' && Number.isSafeInteger(value) && value > 0)
206
+ return value;
207
+ if (typeof value === 'string' && /^#[1-9][0-9]*$/.test(value)) {
208
+ const id = Number(value.slice(1));
209
+ return Number.isSafeInteger(id) ? id : null;
210
+ }
211
+ return null;
212
+ }
213
+ //# sourceMappingURL=group-graph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"group-graph.js","sourceRoot":"","sources":["../../src/in-store/group-graph.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAA4B,MAAM,qBAAqB,CAAC;AAC1F,OAAO,EAAE,8BAA8B,EAAgF,MAAM,kBAAkB,CAAC;AAChJ,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAEpE,uFAAuF;AACvF,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,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IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,IAAI,EAAE,qBAAqB,EAAE,IAAI,CAAC,WAAW,CAAC;oBAAE,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;YACjM,CAAC;YACD,WAAW,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,cAAc,EAAE,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,KAAM,CAAC,CAAC,EAAE,CAAC,CAAC;QACzG,CAAC;QACD,OAAO,EAAE,GAAG,QAAQ,EAAE,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,QAAQ,CAAC,aAAa,CAAC,EAAE,UAAU,EAAE,QAAQ,CAAC,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IACxI,CAAC;CACF;AAED,MAAM,UAAU,WAAW,CAAC,KAAc;IACxC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IACxF,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9D,MAAM,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,OAAO,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACjF,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { type MutablePropertyView } from '@ifc-lite/mutations';
2
+ import type { IfcDataStore } from '@ifc-lite/parser';
3
+ import { type GroupRootIdentity, type GroupSnapshot } from './group-graph.js';
4
+ export interface GroupStoreContext {
5
+ store: IfcDataStore;
6
+ mutationView: MutablePropertyView;
7
+ ownerHistoryId: number | null;
8
+ /** A reviewed draft may replay its native allocations at commit; ownership checks still apply. */
9
+ guidSource?: () => string;
10
+ }
11
+ export interface GroupInStoreParams {
12
+ Name: string;
13
+ Description?: string | null;
14
+ ObjectType?: string | null;
15
+ GlobalId?: string;
16
+ RelatedObjects: readonly GroupRootIdentity[];
17
+ }
18
+ export interface GroupInStorePatch {
19
+ Name?: string | null;
20
+ Description?: string | null;
21
+ ObjectType?: string | null;
22
+ /** Entire intended membership, never an implicit append or subtraction. */
23
+ RelatedObjects: readonly GroupRootIdentity[];
24
+ }
25
+ export type { GroupRootIdentity, GroupSnapshot, GroupMembershipSnapshot } from './group-graph.js';
26
+ /** Complete current, source-bound readback used by SDK and reviewed authoring. */
27
+ export declare function readGroupInStore(context: GroupStoreContext, target: GroupRootIdentity): GroupSnapshot;
28
+ /** Group and optional nonempty relationship are published in one native atomic edit. */
29
+ export declare function addGroupToStore(context: GroupStoreContext, params: GroupInStoreParams): GroupRootIdentity;
30
+ /** Preserve group identity; reuse/consolidate only semantically compatible untyped assignments. */
31
+ export declare function updateGroupInStore(context: GroupStoreContext, expected: GroupSnapshot, patch: GroupInStorePatch): GroupRootIdentity;
32
+ /** Delete only the group and membership edges; retain members and other group memberships. */
33
+ export declare function removeGroupInStore(context: GroupStoreContext, expected: GroupSnapshot): void;
34
+ //# sourceMappingURL=group.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../../src/in-store/group.ts"],"names":[],"mappings":"AAIA,OAAO,EAAe,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAA+C,KAAK,iBAAiB,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE3H,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,YAAY,CAAC;IACpB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. 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 { generateIfcGuid } from '@ifc-lite/encoding';
5
+ import { StoreEditor } from '@ifc-lite/mutations';
6
+ import { conformsTo, schemaRegistry } from './schema-attributes.js';
7
+ import { GroupGraph, GROUP_GRAPH_LIMITS, referenceId } from './group-graph.js';
8
+ function text(value, name) {
9
+ if (value !== undefined && value !== null && (typeof value !== 'string' || value.length > 16_384)) {
10
+ throw new Error(`IfcGroup.${name} must be text or null within the text budget`);
11
+ }
12
+ }
13
+ function members(graph, values, groupId) {
14
+ if (!Array.isArray(values) || values.length > GROUP_GRAPH_LIMITS.members)
15
+ throw new Error('Group membership budget exceeded or list missing');
16
+ const registry = schemaRegistry(graph.store.schemaVersion, 'IfcGroup');
17
+ const ids = values.map(value => {
18
+ if (!value || !Number.isSafeInteger(value.expressId) || typeof value.GlobalId !== 'string')
19
+ throw new Error('Group member identity is missing');
20
+ const root = graph.root(value.expressId, value.GlobalId);
21
+ if (!conformsTo(registry, graph.entities.get(root.expressId).type, 'IfcObjectDefinition', graph.schemaNames)) {
22
+ throw new Error('Group membership requires an IfcObjectDefinition');
23
+ }
24
+ if (root.expressId === groupId)
25
+ throw new Error('IfcGroup cannot assign itself');
26
+ return root.expressId;
27
+ });
28
+ if (new Set(ids).size !== ids.length)
29
+ throw new Error('Group membership contains duplicate identities');
30
+ return ids;
31
+ }
32
+ function newGuid(graph, reserved = new Set(), source = generateIfcGuid) {
33
+ for (let attempt = 0; attempt < 100; attempt++) {
34
+ const guid = source();
35
+ if (reserved.has(guid))
36
+ continue;
37
+ try {
38
+ graph.availableGuid(guid);
39
+ return guid;
40
+ }
41
+ catch (error) {
42
+ if (attempt === 99)
43
+ throw error;
44
+ }
45
+ }
46
+ throw new Error('Cannot allocate an unowned Group GlobalId');
47
+ }
48
+ function owner(graph, id) {
49
+ if (id === null)
50
+ return null;
51
+ if (graph.entities.get(id)?.type.toUpperCase() !== 'IFCOWNERHISTORY')
52
+ throw new Error('Group OwnerHistory is not live in this source');
53
+ return `#${id}`;
54
+ }
55
+ function unchanged(graph, expected) {
56
+ const current = graph.snapshot(expected);
57
+ if (JSON.stringify(current) !== JSON.stringify(expected))
58
+ throw new Error('Group expected current identity, metadata or membership changed');
59
+ return current;
60
+ }
61
+ function protectRelationships(graph, removed) {
62
+ for (const id of removed) {
63
+ for (const referrer of graph.incoming.get(id) ?? []) {
64
+ if (!removed.has(referrer))
65
+ throw new Error(`Group relationship #${id} has protected incoming reference #${referrer}`);
66
+ }
67
+ }
68
+ }
69
+ function atomicGroupEdit(context, edit) {
70
+ // The constructor seeds the allocator; even that initialization belongs to the detached transaction.
71
+ return context.mutationView.runAtomic(view => edit(new StoreEditor(context.store, view)));
72
+ }
73
+ /** Complete current, source-bound readback used by SDK and reviewed authoring. */
74
+ export function readGroupInStore(context, target) {
75
+ return new GroupGraph(context.store, context.mutationView).snapshot(target);
76
+ }
77
+ /** Group and optional nonempty relationship are published in one native atomic edit. */
78
+ export function addGroupToStore(context, params) {
79
+ return atomicGroupEdit(context, editor => {
80
+ const graph = new GroupGraph(context.store, editor.getMutationView());
81
+ text(params.Name, 'Name');
82
+ text(params.Description, 'Description');
83
+ text(params.ObjectType, 'ObjectType');
84
+ if (typeof params.Name !== 'string' || !params.Name.length)
85
+ throw new Error('Group Name is required');
86
+ const ids = members(graph, params.RelatedObjects);
87
+ const GlobalId = params.GlobalId ?? newGuid(graph, undefined, context.guidSource);
88
+ graph.availableGuid(GlobalId);
89
+ const history = owner(graph, context.ownerHistoryId);
90
+ const relationGuid = ids.length ? newGuid(graph, new Set([GlobalId]), context.guidSource) : undefined;
91
+ const expressId = editor.addEntity('IfcGroup', [GlobalId, history, params.Name, params.Description ?? null, params.ObjectType ?? null]).expressId;
92
+ if (relationGuid)
93
+ editor.addEntity('IfcRelAssignsToGroup', [relationGuid, history, null, null, ids.map(id => `#${id}`), null, `#${expressId}`]);
94
+ return { expressId, GlobalId };
95
+ });
96
+ }
97
+ /** Preserve group identity; reuse/consolidate only semantically compatible untyped assignments. */
98
+ export function updateGroupInStore(context, expected, patch) {
99
+ return atomicGroupEdit(context, editor => {
100
+ const graph = new GroupGraph(context.store, editor.getMutationView());
101
+ const current = unchanged(graph, expected);
102
+ text(patch.Name, 'Name');
103
+ text(patch.Description, 'Description');
104
+ text(patch.ObjectType, 'ObjectType');
105
+ const ids = members(graph, patch.RelatedObjects, current.expressId);
106
+ // A complete member list supplies no PRODUCT/PROCESS/etc. partition. Never
107
+ // reinterpret typed assignments, nor erase distinct relationship metadata.
108
+ const semantics = current.memberships.map(row => {
109
+ const attributes = graph.entities.get(row.relationship.expressId).attributes;
110
+ if (attributes[5] !== null && attributes[5] !== undefined) {
111
+ throw new Error('Generic group replacement cannot rewrite typed RelatedObjectsType assignments');
112
+ }
113
+ return JSON.stringify([attributes[1], attributes[2], attributes[3], attributes[5], attributes[6]]);
114
+ });
115
+ if (new Set(semantics).size > 1)
116
+ throw new Error('Generic group replacement cannot consolidate distinct assignment semantics');
117
+ const keep = ids.length ? current.memberships[0]?.relationship.expressId : undefined;
118
+ const removed = new Set(current.memberships.map(row => row.relationship.expressId).filter(id => id !== keep));
119
+ protectRelationships(graph, removed);
120
+ const history = owner(graph, context.ownerHistoryId);
121
+ const relationGuid = ids.length && keep === undefined ? newGuid(graph, undefined, context.guidSource) : undefined;
122
+ for (const [name, index] of [['Name', 2], ['Description', 3], ['ObjectType', 4]]) {
123
+ if (patch[name] !== undefined)
124
+ editor.setPositionalAttribute(current.expressId, index, patch[name]);
125
+ }
126
+ for (const id of removed)
127
+ editor.removeEntity(id);
128
+ if (keep !== undefined)
129
+ editor.setPositionalAttribute(keep, 4, ids.map(id => `#${id}`));
130
+ else if (relationGuid)
131
+ editor.addEntity('IfcRelAssignsToGroup', [relationGuid, history, null, null, ids.map(id => `#${id}`), null, `#${current.expressId}`]);
132
+ return { expressId: current.expressId, GlobalId: current.GlobalId };
133
+ });
134
+ }
135
+ /** Delete only the group and membership edges; retain members and other group memberships. */
136
+ export function removeGroupInStore(context, expected) {
137
+ atomicGroupEdit(context, editor => {
138
+ const graph = new GroupGraph(context.store, editor.getMutationView());
139
+ const current = unchanged(graph, expected);
140
+ const removed = new Set(current.memberships.map(row => row.relationship.expressId));
141
+ const rewritten = new Map();
142
+ for (const id of graph.incoming.get(current.expressId) ?? []) {
143
+ if (removed.has(id))
144
+ continue;
145
+ const entity = graph.entities.get(id);
146
+ if (entity.type.toUpperCase() !== 'IFCRELASSIGNSTOGROUP')
147
+ throw new Error(`IfcGroup has protected incoming dependency #${id}`);
148
+ const relating = referenceId(entity.attributes[6]);
149
+ if (relating === null)
150
+ throw new Error('Incoming group membership has an unreadable owner');
151
+ graph.root(relating);
152
+ if (!conformsTo(schemaRegistry(graph.store.schemaVersion, 'IfcGroup'), graph.entities.get(relating).type, 'IfcGroup', graph.schemaNames))
153
+ throw new Error('Incoming membership owner is not an IfcGroup');
154
+ graph.root(id);
155
+ const raw = entity.attributes[4];
156
+ if (!Array.isArray(raw) || raw.length > GROUP_GRAPH_LIMITS.members)
157
+ throw new Error('Incoming group membership is incomplete');
158
+ const ids = raw.map(value => referenceId(value));
159
+ if (ids.some(value => value === null) || new Set(ids).size !== ids.length || !ids.includes(current.expressId))
160
+ throw new Error('Incoming group membership is unreadable');
161
+ ids.forEach(value => {
162
+ const member = graph.root(value);
163
+ if (!conformsTo(schemaRegistry(graph.store.schemaVersion, 'IfcGroup'), graph.entities.get(member.expressId).type, 'IfcObjectDefinition', graph.schemaNames)) {
164
+ throw new Error('Incoming group membership has an invalid object definition');
165
+ }
166
+ });
167
+ const remaining = ids.filter((value) => value !== null && value !== current.expressId);
168
+ if (remaining.length)
169
+ rewritten.set(id, remaining);
170
+ else
171
+ removed.add(id);
172
+ }
173
+ protectRelationships(graph, removed);
174
+ for (const [id, ids] of rewritten)
175
+ editor.setPositionalAttribute(id, 4, ids.map(member => `#${member}`));
176
+ for (const id of removed)
177
+ editor.removeEntity(id);
178
+ editor.removeEntity(current.expressId);
179
+ });
180
+ }
181
+ //# sourceMappingURL=group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"group.js","sourceRoot":"","sources":["../../src/in-store/group.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,WAAW,EAA4B,MAAM,qBAAqB,CAAC;AAE5E,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,WAAW,EAA8C,MAAM,kBAAkB,CAAC;AAyB3H,SAAS,IAAI,CAAC,KAAc,EAAE,IAAY;IACxC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;QAClG,MAAM,IAAI,KAAK,CAAC,YAAY,IAAI,8CAA8C,CAAC,CAAC;IAClF,CAAC;AACH,CAAC;AAED,SAAS,OAAO,CAAC,KAAiB,EAAE,MAAoC,EAAE,OAAgB;IACxF,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,GAAG,kBAAkB,CAAC,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;IAC9I,MAAM,QAAQ,GAAG,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,aAAkC,EAAE,UAAU,CAAC,CAAC;IAC5F,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QAC7B,IAAI,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,OAAO,KAAK,CAAC,QAAQ,KAAK,QAAQ;YAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;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CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC3E,CAAC;QACD,oBAAoB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACrC,KAAK,MAAM,CAAC,EAAE,EAAE,GAAG,CAAC,IAAI,SAAS;YAAE,MAAM,CAAC,sBAAsB,CAAC,EAAE,EAAE,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC;QACzG,KAAK,MAAM,EAAE,IAAI,OAAO;YAAE,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QAClD,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,48 @@
1
+ import type { AnchorEntityReader } from './resolve-anchor.js';
2
+ import type { HostBounds } from './anchor.js';
3
+ /** Structural entity access lets body and planar readers share the same
4
+ * placement validation without requiring an anchor's unrelated methods. */
5
+ export interface GeometryEntityReader {
6
+ entity(id: number): {
7
+ type: string;
8
+ attributes: readonly unknown[];
9
+ } | null;
10
+ }
11
+ export type Vec3 = [number, number, number];
12
+ export type Frame3 = {
13
+ o: Vec3;
14
+ x: Vec3;
15
+ y: Vec3;
16
+ z: Vec3;
17
+ };
18
+ /** Source extractors use numbers; overlay references use #id strings. */
19
+ export declare function refId(value: unknown): number | null;
20
+ export declare function num(value: unknown): number | null;
21
+ /** A 3D frame needs exactly three coordinates. A profile opts into two,
22
+ * embedded in XY; missing 3D coordinates must never be synthesized. */
23
+ export declare function vec3(value: unknown, dimension?: 2 | 3): Vec3 | null;
24
+ export declare function pointOf(reader: GeometryEntityReader, ref: unknown, type?: string, dimension?: 2 | 3): Vec3 | null;
25
+ export declare function unit(v: Vec3): Vec3 | null;
26
+ /** IfcAxis2Placement2D: Position is optional on a profile; Location is required. */
27
+ export declare function axis2d(reader: GeometryEntityReader, ref: unknown): {
28
+ o: [number, number];
29
+ x: [number, number];
30
+ } | null;
31
+ /** IfcAxis2Placement3D: only an omitted optional Position/Axis/RefDirection
32
+ * uses defaults. An explicit missing, zero or parallel axis is unreadable. */
33
+ export declare function axis3d(reader: GeometryEntityReader, ref: unknown): Frame3 | null;
34
+ export declare function applyFrame(f: Frame3, p: Vec3): Vec3;
35
+ export declare function transformBounds(bounds: HostBounds, frame: Frame3): HostBounds;
36
+ export declare function composeFrame(outer: Frame3, inner: Frame3): Frame3;
37
+ /** Rigid placement inverse; axis3d supplies orthonormal placement axes. */
38
+ export declare function inverseFrame(f: Frame3): Frame3;
39
+ /** Full 3D local-placement chain, including the opening's rotated frame.
40
+ * Missing references, cycles and excessive acyclic chains are unreadable. */
41
+ export declare function placementInAncestor(reader: GeometryEntityReader, placementId: number, ancestorId: number | null): Frame3 | null;
42
+ /** Express one local placement in another's full 3D frame. Only the branches
43
+ * below their common ancestor need readable frames; the shared ancestor
44
+ * cancels, as it does in the canonical planar storey reader (#6232). */
45
+ export declare function placementRelativeTo(reader: GeometryEntityReader, placementId: number, referenceId: number): Frame3 | null;
46
+ /** Subcontexts inherit CoordinateSpaceDimension from ParentContext. */
47
+ export declare function contextDimension(reader: AnchorEntityReader, contextId: number): 2 | 3 | null;
48
+ //# sourceMappingURL=host-geometry-frame.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-geometry-frame.d.ts","sourceRoot":"","sources":["../../src/in-store/host-geometry-frame.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;2EAC2E;AAC3E,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,SAAS,OAAO,EAAE,CAAA;KAAE,GAAG,IAAI,CAAC;CAC7E;AAED,MAAM,MAAM,IAAI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