@thatopen/services 0.24.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +104 -0
- package/dist/cli.js.map +1 -1
- package/dist/core/builtin-recipes/index.d.ts +9 -0
- package/dist/core/builtin-recipes/records-to-revit.d.ts +24 -0
- package/dist/core/builtin-recipes/rhino-to-revit.d.ts +16 -0
- package/dist/core/builtin-recipes/shared.d.ts +42 -0
- package/dist/core/documents.d.ts +37 -0
- package/dist/core/frag-items.d.ts +28 -0
- package/dist/index.cjs.js +81 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +2413 -1815
- package/dist/index.es.js.map +1 -1
- package/docs/ai-quickstart.md +23 -4
- package/package.json +2 -1
package/docs/ai-quickstart.md
CHANGED
|
@@ -381,11 +381,19 @@ returns null).
|
|
|
381
381
|
|
|
382
382
|
```ts
|
|
383
383
|
const documents = client.documents(projectId);
|
|
384
|
-
const
|
|
384
|
+
const all = await documents.list(); // every document (folderId + descriptor)
|
|
385
|
+
const descriptor = await documents.descriptor(folderId); // null on a plain folder
|
|
385
386
|
const view = await documents.view(folderId, ['frag', 'ifc']); // your preference order wins
|
|
386
387
|
await documents.addView(folderId, { fileId, format: 'frag' }); // a processor's last act
|
|
388
|
+
const doc = await documents.fromFile(fileId); // convert a loose file into a document
|
|
387
389
|
```
|
|
388
390
|
|
|
391
|
+
`fromFile` creates the folder next to the file, moves the file in (ids survive
|
|
392
|
+
moves), and writes the descriptor: the file as `native`, and as `views[0]` too
|
|
393
|
+
when its format views itself (`SELF_VIEWING_FORMATS`; `selfView` overrides). A
|
|
394
|
+
file with an old `derivedFileId` link (an IFC's frag) brings the derivative
|
|
395
|
+
into the folder as a view, so the document is born ready to visualize.
|
|
396
|
+
|
|
389
397
|
## 5d. History and recipes: versions, change requests
|
|
390
398
|
|
|
391
399
|
Three sentences hold the whole model. Every connected document (a Revit model,
|
|
@@ -419,9 +427,20 @@ To AUTHOR a suggestion's payload, `OperationBuilder` (same import) writes the
|
|
|
419
427
|
operation .frag: `new OperationBuilder(target).add(attrs, placement)` /
|
|
420
428
|
`.set(id, attrs)` / `.remove(id)`, then `await builder.build(opId)` gives the
|
|
421
429
|
bytes for `suggest({ payload })`. Attributes go in the TARGET app's own terms
|
|
422
|
-
and units, untranslated.
|
|
423
|
-
|
|
424
|
-
|
|
430
|
+
and units, untranslated. To READ a .frag's data without rendering anything,
|
|
431
|
+
`readFrag(bytes)` answers its metadata and items (guids, categories,
|
|
432
|
+
attributes). Both need the optional peers `flatbuffers` and
|
|
433
|
+
`@thatopen/fragments` resolvable (loaded only when they run — nothing else in
|
|
434
|
+
the package needs them; in plain Node, fragments also pulls `web-ifc`).
|
|
435
|
+
|
|
436
|
+
BUILT-IN RECIPES ship with the SDK — proof that interoperability works
|
|
437
|
+
without writing anything, and the templates to copy:
|
|
438
|
+
`registerBuiltinRecipes(client)` registers `rhino-to-revit` (a Rhino layer's
|
|
439
|
+
placed objects become instances of a chosen Revit type, reconciled on re-run),
|
|
440
|
+
`ifc-to-revit` and `frag-to-revit` (the platform's own records — columns and
|
|
441
|
+
free-standing instances today, more as the Revit applier grows; walls and
|
|
442
|
+
slabs are read and tallied, proposing nothing yet). Every proposal is a
|
|
443
|
+
suggestion: nothing changes in the native app until its owner accepts there.
|
|
425
444
|
|
|
426
445
|
This surface is the only supported way in: the storage underneath is private
|
|
427
446
|
and will move. Never list or write the `bimterop` files directly. The full
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"access": "public"
|
|
16
16
|
},
|
|
17
17
|
"private": false,
|
|
18
|
-
"version": "0.
|
|
18
|
+
"version": "0.26.0",
|
|
19
19
|
"main": "dist/index.cjs.js",
|
|
20
20
|
"module": "dist/index.es.js",
|
|
21
21
|
"types": "dist/index.d.ts",
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
"vite-plugin-dts": "^3.9.1",
|
|
73
73
|
"vite-plugin-eslint": "^1.8.1",
|
|
74
74
|
"vitest": "^4.1.4",
|
|
75
|
+
"web-ifc": "^0.0.78",
|
|
75
76
|
"zod": "^3.25.76"
|
|
76
77
|
},
|
|
77
78
|
"dependencies": {
|