@qaecy/cue-sdk 0.0.28 → 0.0.30
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 +12 -14
- package/{cue-BR7V1Nem.js → cue-DWCLcFvj.js} +280 -220
- package/index.js +1 -1
- package/lib/cue.d.ts +3 -0
- package/lib/documents.d.ts +26 -1
- package/lib/entities.d.ts +21 -6
- package/lib/models.d.ts +2 -0
- package/lib/project-view.d.ts +3 -1
- package/node.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -238,16 +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
|
|
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 —
|
|
244
|
+
// Lean — iri + uuid, no extra SPARQL traffic (default)
|
|
245
245
|
const entities = await view.entities.entitiesByCategory([
|
|
246
246
|
'qcy:Building',
|
|
247
247
|
'qcy:BuildingStorey',
|
|
248
248
|
]);
|
|
249
|
-
|
|
250
|
-
view.entities.requestEntityData(uuids); // lazy-loads labels + categories
|
|
249
|
+
view.entities.requestEntityData(entities.map((e) => e.uuid));
|
|
251
250
|
|
|
252
251
|
// With metadata
|
|
253
252
|
const entities = await view.entities.entitiesByCategory(
|
|
@@ -303,10 +302,10 @@ Document data for a project is accessed via `view.documents` (`CueProjectDocumen
|
|
|
303
302
|
|
|
304
303
|
Fetch all documents whose file extension matches one of the given suffixes. The leading dot is optional — both `'ifc'` and `'.ifc'` are accepted.
|
|
305
304
|
|
|
306
|
-
By default returns
|
|
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`.
|
|
307
306
|
|
|
308
307
|
```typescript
|
|
309
|
-
// Lean —
|
|
308
|
+
// Lean — iri + uuid, no extra SPARQL traffic (default)
|
|
310
309
|
const docs = await view.documents.documentsBySuffix(['.ifc', '.rvt']);
|
|
311
310
|
view.documents.requestDocumentData(docs.map((d) => d.uuid));
|
|
312
311
|
|
|
@@ -322,7 +321,7 @@ Fetch documents by semantic `FileType` category. Resolves all matching suffixes
|
|
|
322
321
|
```typescript
|
|
323
322
|
import { FileType } from 'js/models';
|
|
324
323
|
|
|
325
|
-
// All BIM and CAD files
|
|
324
|
+
// All BIM and CAD files — iri + uuid
|
|
326
325
|
const docs = await view.documents.documentsByFileType([
|
|
327
326
|
FileType.BIM,
|
|
328
327
|
FileType.CAD,
|
|
@@ -337,6 +336,7 @@ const docs = await view.documents.documentsByFileType([FileType.IMAGE], true);
|
|
|
337
336
|
Fetch documents whose MIME type matches one of the given strings:
|
|
338
337
|
|
|
339
338
|
```typescript
|
|
339
|
+
// Just iri + uuid
|
|
340
340
|
const docs = await view.documents.documentsByMime([
|
|
341
341
|
'application/x-step', // .ifc
|
|
342
342
|
'application/pdf',
|
|
@@ -349,13 +349,11 @@ const docs = await view.documents.documentsByMime(
|
|
|
349
349
|
);
|
|
350
350
|
```
|
|
351
351
|
|
|
352
|
-
| Method | Filters by |
|
|
353
|
-
|
|
354
|
-
| `documentsBySuffix` | File extension string(s) | `path`, `suffix`, `size` |
|
|
355
|
-
| `documentsByFileType` | `FileType` enum value(s) | `path`, `suffix`, `size` |
|
|
356
|
-
| `documentsByMime` | MIME type string(s) | `path`, `suffix`, `size` |
|
|
357
|
-
|
|
358
|
-
All three exclude alternative representations (e.g. derived `.fragments` tiles) from results.
|
|
352
|
+
| Method | Filters by | Default return | With `true` |
|
|
353
|
+
|---|---|---|---|
|
|
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` |
|
|
359
357
|
|
|
360
358
|
## Node.js — file sync
|
|
361
359
|
|