@thatopen/services 0.23.0 → 0.25.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/documents.d.ts +37 -0
- package/dist/core/op-builder.d.ts +118 -0
- package/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +1340 -1068
- package/dist/index.es.js.map +1 -1
- package/docs/ai-quickstart.md +17 -1
- package/package.json +9 -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,
|
|
@@ -415,6 +423,14 @@ await client.recipes.run('my-recipe', { // only QUEUES a suggestion:
|
|
|
415
423
|
`docs()` also answers `folderId` — the id the CDE knows that document by, the
|
|
416
424
|
bridge between this section and 5c.
|
|
417
425
|
|
|
426
|
+
To AUTHOR a suggestion's payload, `OperationBuilder` (same import) writes the
|
|
427
|
+
operation .frag: `new OperationBuilder(target).add(attrs, placement)` /
|
|
428
|
+
`.set(id, attrs)` / `.remove(id)`, then `await builder.build(opId)` gives the
|
|
429
|
+
bytes for `suggest({ payload })`. Attributes go in the TARGET app's own terms
|
|
430
|
+
and units, untranslated. It needs the optional peers `flatbuffers` and
|
|
431
|
+
`@thatopen/fragments` installed (loaded only when `build()` runs — nothing
|
|
432
|
+
else in the package needs them).
|
|
433
|
+
|
|
418
434
|
This surface is the only supported way in: the storage underneath is private
|
|
419
435
|
and will move. Never list or write the `bimterop` files directly. The full
|
|
420
436
|
walkthrough (manifest fields, StaleHistoryError on concurrent syncs, payloads)
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"access": "public"
|
|
16
16
|
},
|
|
17
17
|
"private": false,
|
|
18
|
-
"version": "0.
|
|
18
|
+
"version": "0.25.0",
|
|
19
19
|
"main": "dist/index.cjs.js",
|
|
20
20
|
"module": "dist/index.es.js",
|
|
21
21
|
"types": "dist/index.d.ts",
|
|
@@ -82,16 +82,24 @@
|
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
84
84
|
"@thatopen/components": "~3.4.0",
|
|
85
|
+
"@thatopen/fragments": "~3.4.0",
|
|
85
86
|
"@thatopen/ui": "~3.4.0",
|
|
87
|
+
"flatbuffers": ">=23.0.0",
|
|
86
88
|
"three": ">=0.182.0"
|
|
87
89
|
},
|
|
88
90
|
"peerDependenciesMeta": {
|
|
89
91
|
"@thatopen/components": {
|
|
90
92
|
"optional": true
|
|
91
93
|
},
|
|
94
|
+
"@thatopen/fragments": {
|
|
95
|
+
"optional": true
|
|
96
|
+
},
|
|
92
97
|
"@thatopen/ui": {
|
|
93
98
|
"optional": true
|
|
94
99
|
},
|
|
100
|
+
"flatbuffers": {
|
|
101
|
+
"optional": true
|
|
102
|
+
},
|
|
95
103
|
"three": {
|
|
96
104
|
"optional": true
|
|
97
105
|
}
|