@thatopen/services 0.24.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/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +751 -668
- package/dist/index.es.js.map +1 -1
- package/docs/ai-quickstart.md +9 -1
- package/package.json +1 -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,
|