@qaecy/cue-sdk 0.0.29 → 0.0.31

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/README.md CHANGED
@@ -238,15 +238,15 @@ Entity data for a project is accessed via a `CueProjectView`. Create a view with
238
238
 
239
239
  Fetch all canonical entities that belong to at least one of the given category IRIs. Accepts both full HTTP IRIs and prefixed forms.
240
240
 
241
- By default returns a `string[]` of UUIDs suitable for feeding directly into `requestEntityData()` for lazy detail loading. Pass `true` to also receive `iri`, `value`, and `categories`.
241
+ By default returns `{ iri, uuid }[]` the IRI is built locally from the project base URL so no extra data is fetched from the endpoint. Pass `true` to also receive `value` and `categories`.
242
242
 
243
243
  ```typescript
244
- // Lean — just UUIDs (default)
245
- const uuids = await view.entities.entitiesByCategory([
244
+ // Lean — iri + uuid, no extra SPARQL traffic (default)
245
+ const entities = await view.entities.entitiesByCategory([
246
246
  'qcy:Building',
247
247
  'qcy:BuildingStorey',
248
248
  ]);
249
- view.entities.requestEntityData(uuids); // lazy-loads labels + categories
249
+ view.entities.requestEntityData(entities.map((e) => e.uuid));
250
250
 
251
251
  // With metadata
252
252
  const entities = await view.entities.entitiesByCategory(
@@ -259,7 +259,7 @@ entities.forEach((e) => console.log(e.uuid, e.value, e.categories));
259
259
  | Parameter | Type | Description |
260
260
  |---|---|---|
261
261
  | `categoryIris` | `string[]` | Full IRIs (`https://…`) or prefixed forms (`qcy:…`) |
262
- | `includeMetadata` | `boolean` | `false` (default) → `string[]` UUIDs; `true` → adds `iri`, `value`, and `categories` |
262
+ | `includeMetadata` | `boolean` | `false` (default) → `{ iri, uuid }[]`; `true` → adds `value` and `categories` |
263
263
 
264
264
  ### `view.entities.contentCategoriesInProject(orderByOccurrences?)`
265
265
 
@@ -302,12 +302,12 @@ Document data for a project is accessed via `view.documents` (`CueProjectDocumen
302
302
 
303
303
  Fetch all documents whose file extension matches one of the given suffixes. The leading dot is optional — both `'ifc'` and `'.ifc'` are accepted.
304
304
 
305
- By default returns a `string[]` of UUIDs suitable for feeding directly into `requestDocumentData()`. Pass `true` to also receive `path`, `suffix`, and `size`.
305
+ By default returns `{ iri, uuid }[]` the IRI is built locally from the project base URL, no extra data fetched. Pass `true` to also receive `path`, `suffix`, and `size`.
306
306
 
307
307
  ```typescript
308
- // Lean — just UUIDs (default)
309
- const uuids = await view.documents.documentsBySuffix(['.ifc', '.rvt']);
310
- view.documents.requestDocumentData(uuids);
308
+ // Lean — iri + uuid, no extra SPARQL traffic (default)
309
+ const docs = await view.documents.documentsBySuffix(['.ifc', '.rvt']);
310
+ view.documents.requestDocumentData(docs.map((d) => d.uuid));
311
311
 
312
312
  // With file metadata
313
313
  const docs = await view.documents.documentsBySuffix(['pdf', 'docx'], true);
@@ -321,8 +321,8 @@ Fetch documents by semantic `FileType` category. Resolves all matching suffixes
321
321
  ```typescript
322
322
  import { FileType } from 'js/models';
323
323
 
324
- // All BIM and CAD files — just UUIDs
325
- const uuids = await view.documents.documentsByFileType([
324
+ // All BIM and CAD files — iri + uuid
325
+ const docs = await view.documents.documentsByFileType([
326
326
  FileType.BIM,
327
327
  FileType.CAD,
328
328
  ]);
@@ -336,8 +336,8 @@ const docs = await view.documents.documentsByFileType([FileType.IMAGE], true);
336
336
  Fetch documents whose MIME type matches one of the given strings:
337
337
 
338
338
  ```typescript
339
- // Just UUIDs
340
- const uuids = await view.documents.documentsByMime([
339
+ // Just iri + uuid
340
+ const docs = await view.documents.documentsByMime([
341
341
  'application/x-step', // .ifc
342
342
  'application/pdf',
343
343
  ]);
@@ -351,9 +351,9 @@ const docs = await view.documents.documentsByMime(
351
351
 
352
352
  | Method | Filters by | Default return | With `true` |
353
353
  |---|---|---|---|
354
- | `documentsBySuffix` | File extension string(s) | `string[]` UUIDs | adds `iri`, `path`, `suffix`, `size` |
355
- | `documentsByFileType` | `FileType` enum value(s) | `string[]` UUIDs | adds `iri`, `path`, `suffix`, `size` |
356
- | `documentsByMime` | MIME type string(s) | `string[]` UUIDs | adds `iri`, `path`, `suffix`, `size` |
354
+ | `documentsBySuffix` | File extension string(s) | `{ iri, uuid }[]` | adds `path`, `suffix`, `size` |
355
+ | `documentsByFileType` | `FileType` enum value(s) | `{ iri, uuid }[]` | adds `path`, `suffix`, `size` |
356
+ | `documentsByMime` | MIME type string(s) | `{ iri, uuid }[]` | adds `path`, `suffix`, `size` |
357
357
 
358
358
  ## Node.js — file sync
359
359