@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.
@@ -381,11 +381,19 @@ returns null).
381
381
 
382
382
  ```ts
383
383
  const documents = client.documents(projectId);
384
- const descriptor = await documents.descriptor(folderId); // null on a plain folder
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,
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "access": "public"
16
16
  },
17
17
  "private": false,
18
- "version": "0.24.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",