@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 +16 -16
- package/{cue-CnZyGMRG.js → cue-VOCN5IEZ.js} +865 -600
- package/index.d.ts +3 -1
- package/index.js +17 -16
- package/lib/api.d.ts +3 -0
- package/lib/contexts.d.ts +17 -0
- package/lib/cue.d.ts +3 -0
- package/lib/documents.d.ts +38 -4
- package/lib/entities.d.ts +32 -7
- package/lib/models.d.ts +45 -0
- package/lib/project-view.d.ts +3 -1
- package/lib/schema.d.ts +30 -16
- package/lib/storage.d.ts +26 -10
- package/node.js +40 -38
- package/package.json +1 -1
- package/variables.d.ts +4 -0
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
|
|
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 —
|
|
245
|
-
const
|
|
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(
|
|
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) → `
|
|
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
|
|
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 —
|
|
309
|
-
const
|
|
310
|
-
view.documents.requestDocumentData(
|
|
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 —
|
|
325
|
-
const
|
|
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
|
|
340
|
-
const
|
|
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) | `
|
|
355
|
-
| `documentsByFileType` | `FileType` enum value(s) | `
|
|
356
|
-
| `documentsByMime` | MIME type string(s) | `
|
|
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
|
|