@qaecy/cue-sdk 0.0.29 → 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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { C as s, a as u, b as C, c as t, d as i, e as c, f as o, g as r, h as l, i as n, j as P, k as j, l as m, m as S, n as g, o as h, p, R as E, q as R, r as f, s as d } from "./cue-CnZyGMRG.js";
1
+ import { C as s, a as u, b as C, c as t, d as i, e as c, f as o, g as r, h as l, i as n, j as P, k as j, l as m, m as S, n as g, o as h, p, R as E, q as R, r as f, s as d } from "./cue-DWCLcFvj.js";
2
2
  export {
3
3
  s as Cue,
4
4
  u as CueApi,
package/lib/cue.d.ts CHANGED
@@ -36,6 +36,7 @@ export declare class Cue {
36
36
  protected _storageProcessed: FirebaseStorage;
37
37
  private _gis;
38
38
  private readonly _projectDocuments;
39
+ private readonly _verbose;
39
40
  /**
40
41
  * Reactive GIS service. Lazily constructed on first access.
41
42
  *
@@ -108,6 +109,7 @@ export declare class Cue {
108
109
  rdfBase?: string;
109
110
  graphType?: string;
110
111
  queryCache?: QueryCache;
112
+ verbose?: boolean;
111
113
  }): CueProjectEntities;
112
114
  /**
113
115
  * Creates a `CueProjectDocuments` instance for the given project, with the
@@ -128,5 +130,6 @@ export declare class Cue {
128
130
  rdfBase?: string;
129
131
  graphType?: string;
130
132
  queryCache?: QueryCache;
133
+ verbose?: boolean;
131
134
  }): CueProjectDocuments;
132
135
  }
@@ -38,11 +38,14 @@ export declare class CueProjectDocuments {
38
38
  private readonly _projectId;
39
39
  private readonly _queryCache?;
40
40
  private readonly _graphType?;
41
+ private readonly _verbose;
41
42
  /** Full RDF base URL for this project, e.g. `https://cue.qaecy.com/r/{pid}/` */
42
43
  readonly baseURL: string;
43
44
  /** Tracks the language for which `_documentInfoMap` is currently populated. */
44
45
  private _currentLang;
45
46
  private readonly _documentInfoMap;
47
+ /** Cumulative unique document UUIDs ever passed to request methods (survives cache hits). */
48
+ private readonly _seenIds;
46
49
  private readonly _projectDocumentsData;
47
50
  /** Lazily populated per-document detail map. */
48
51
  readonly documentInfoMap: ReadonlySignal<Record<string, DocumentInfo>>;
@@ -50,7 +53,7 @@ export declare class CueProjectDocuments {
50
53
  readonly projectDocumentsData: ReadonlySignal<ProjectDocumentsData>;
51
54
  constructor(_api: CueApi, _projectId: string, language?: string,
52
55
  /** Override the RDF resource base URL. Defaults to `https://cue.qaecy.com/r/`. */
53
- rdfBase?: string, _queryCache?: QueryCache | undefined, _graphType?: string | undefined);
56
+ rdfBase?: string, _queryCache?: QueryCache | undefined, _graphType?: string | undefined, _verbose?: boolean);
54
57
  /**
55
58
  * Resets all document state. Call when the active project changes.
56
59
  * Follow with `fetchOverview()` once the triplestore is ready.
@@ -134,7 +137,10 @@ export declare class CueProjectDocuments {
134
137
  * Suffixes are matched case-insensitively and the leading dot is optional
135
138
  * (both `'ifc'` and `'.ifc'` are accepted).
136
139
  */
137
- documentsBySuffix(suffixes: string[], includeMetadata?: false): Promise<string[]>;
140
+ documentsBySuffix(suffixes: string[], includeMetadata?: false): Promise<Array<{
141
+ iri: string;
142
+ uuid: string;
143
+ }>>;
138
144
  documentsBySuffix(suffixes: string[], includeMetadata: true): Promise<Array<{
139
145
  iri: string;
140
146
  uuid: string;
@@ -149,7 +155,10 @@ export declare class CueProjectDocuments {
149
155
  * Resolves matching suffixes from `fileExtensionsInfo` and delegates to
150
156
  * `documentsBySuffix`. Accepts the same `includeMetadata` flag.
151
157
  */
152
- documentsByFileType(fileTypes: FileType[], includeMetadata?: false): Promise<string[]>;
158
+ documentsByFileType(fileTypes: FileType[], includeMetadata?: false): Promise<Array<{
159
+ iri: string;
160
+ uuid: string;
161
+ }>>;
153
162
  documentsByFileType(fileTypes: FileType[], includeMetadata: true): Promise<Array<{
154
163
  iri: string;
155
164
  uuid: string;
@@ -157,6 +166,25 @@ export declare class CueProjectDocuments {
157
166
  suffix: string;
158
167
  size: number;
159
168
  }>>;
169
+ /**
170
+ * Fetches all `qcy:FileContent` documents that carry one of the given
171
+ * content-category IRIs (e.g. as returned by `projectDocumentsData.documentsByContentCategory`).
172
+ *
173
+ * By default returns only `{ iri, uuid }` — pass `includeMetadata: true` to
174
+ * also get `path`, `suffix`, and `size`. Use the default form when you intend
175
+ * to lazy-load full details via `requestDocumentData`.
176
+ */
177
+ documentsByContentCategory(categoryIRIs: string[], includeMetadata?: false): Promise<Array<{
178
+ iri: string;
179
+ uuid: string;
180
+ }>>;
181
+ documentsByContentCategory(categoryIRIs: string[], includeMetadata: true): Promise<Array<{
182
+ iri: string;
183
+ uuid: string;
184
+ path: string;
185
+ suffix: string;
186
+ size: number;
187
+ }>>;
160
188
  /**
161
189
  * Fetches documents whose MIME type matches one of the given strings
162
190
  * (e.g. `'application/x-step'`, `'application/pdf'`).
@@ -164,7 +192,10 @@ export declare class CueProjectDocuments {
164
192
  * Resolves matching suffixes from `fileExtensionsInfo` and delegates to
165
193
  * `documentsBySuffix`. Accepts the same `includeMetadata` flag.
166
194
  */
167
- documentsByMime(mimeTypes: string[], includeMetadata?: false): Promise<string[]>;
195
+ documentsByMime(mimeTypes: string[], includeMetadata?: false): Promise<Array<{
196
+ iri: string;
197
+ uuid: string;
198
+ }>>;
168
199
  documentsByMime(mimeTypes: string[], includeMetadata: true): Promise<Array<{
169
200
  iri: string;
170
201
  uuid: string;
@@ -172,6 +203,9 @@ export declare class CueProjectDocuments {
172
203
  suffix: string;
173
204
  size: number;
174
205
  }>>;
206
+ /** Builds a full resource IRI from a UUID without a SPARQL round-trip. */
207
+ private _resourceIri;
208
+ private _log;
175
209
  /** Executes the document-info SPARQL query for the given UUIDs, merges results
176
210
  * into `documentInfoMap`, and returns the newly fetched entries. */
177
211
  private _fetchDocumentInfoBatch;
package/lib/entities.d.ts CHANGED
@@ -38,6 +38,7 @@ export declare class CueProjectEntities {
38
38
  private readonly _projectId;
39
39
  private readonly _queryCache?;
40
40
  private readonly _graphType?;
41
+ private readonly _verbose;
41
42
  /** Full RDF base URL for this project, e.g. `https://cue.qaecy.com/r/{pid}/` */
42
43
  readonly baseURL: string;
43
44
  private readonly _entityDetails;
@@ -46,6 +47,8 @@ export declare class CueProjectEntities {
46
47
  private readonly _entityOSMMap;
47
48
  private readonly _osmWKTMap;
48
49
  private readonly _fetchingOSMIds;
50
+ /** Cumulative unique entity UUIDs ever passed to request methods (survives cache hits). */
51
+ private readonly _seenIds;
49
52
  private readonly _entityGraph;
50
53
  private readonly _entityInfoMapComputed;
51
54
  /** Merged per-entity detail map. Updated reactively as data arrives. */
@@ -54,12 +57,15 @@ export declare class CueProjectEntities {
54
57
  readonly entityGraph: ReadonlySignal<ProjectEntitiesData | undefined>;
55
58
  constructor(_api: CueApi, _projectId: string,
56
59
  /** Override the RDF resource base URL. Defaults to `https://cue.qaecy.com/r/`. */
57
- rdfBase?: string, _queryCache?: QueryCache | undefined, _graphType?: string | undefined);
60
+ rdfBase?: string, _queryCache?: QueryCache | undefined, _graphType?: string | undefined, _verbose?: boolean);
58
61
  /**
59
62
  * Constructs the full RDF IRI for the given entity UUID.
60
63
  * Use this to bridge the UUID-based batch APIs and the IRI-based per-entity APIs.
61
64
  */
62
65
  entityIri(uuid: string): string;
66
+ /** @internal Builds a full resource IRI from a UUID without a SPARQL round-trip. */
67
+ private _resourceIri;
68
+ private _log;
63
69
  /**
64
70
  * Resets all entity state and re-fetches the entity graph.
65
71
  * Call when the active project changes.
@@ -114,11 +120,15 @@ export declare class CueProjectEntities {
114
120
  * - `"qcy:Building"`
115
121
  * - `"https://cue.qaecy.com/ontology#Building"`
116
122
  *
117
- * By default returns only UUIDs (`string[]`)pass `includeMetadata: true` to
118
- * also get `iri`, `value`, and `categories` (all categories, not just the filtered ones).
123
+ * By default returns `{ iri, uuid }[]` — the IRI is built locally from the
124
+ * project base URL so no extra data is fetched from the endpoint.
125
+ * Pass `includeMetadata: true` to also get `value` and `categories`.
119
126
  * Use the default form when you intend to lazy-load details via `requestEntityData`.
120
127
  */
121
- entitiesByCategory(categoryIris: string[], includeMetadata?: false): Promise<string[]>;
128
+ entitiesByCategory(categoryIris: string[], includeMetadata?: false): Promise<Array<{
129
+ iri: string;
130
+ uuid: string;
131
+ }>>;
122
132
  entitiesByCategory(categoryIris: string[], includeMetadata: true): Promise<Array<{
123
133
  iri: string;
124
134
  uuid: string;
@@ -137,6 +147,11 @@ export declare class CueProjectEntities {
137
147
  * - `'graph'` — structured `{ entities, relations }` with predicates and weights
138
148
  * - `'md'` — compact aligned text table
139
149
  *
150
+ * @param entityIRI Optional category IRI (prefixed, e.g. `qcy:Building`, or
151
+ * full, e.g. `https://…Building`). When supplied, only edges where either
152
+ * the source or target category equals this IRI are returned — i.e. the
153
+ * one-hop neighbourhood of that category.
154
+ *
140
155
  * @example
141
156
  * ```ts
142
157
  * // Structured graph (nodes + edges)
@@ -144,14 +159,17 @@ export declare class CueProjectEntities {
144
159
  * // g.entities → [{ iri: 'https://…FloorPlanDrawing' }, …]
145
160
  * // g.relations → [{ sourceID, predicate, targetID, weight }, …]
146
161
  *
162
+ * // Neighbourhood of a single category (prefixed IRI)
163
+ * const g2 = await entities.buildSummaryGraph('graph', 'qcy:Building');
164
+ *
147
165
  * // Markdown table
148
166
  * const md = await entities.buildSummaryGraph('md');
149
167
  * // qcy:FloorPlanDrawing -> qcy:includesBuildingEntity -> qcy:BuildingZone (5652)
150
168
  * ```
151
169
  */
152
- buildSummaryGraph(format: 'graph'): Promise<SummaryGraphData>;
153
- buildSummaryGraph(format: 'md'): Promise<string>;
154
- buildSummaryGraph(format?: undefined): Promise<unknown>;
170
+ buildSummaryGraph(format: 'graph', entityIRI?: string): Promise<SummaryGraphData>;
171
+ buildSummaryGraph(format: 'md', entityIRI?: string): Promise<string>;
172
+ buildSummaryGraph(format?: undefined, entityIRI?: string): Promise<unknown>;
155
173
  private _computeEntityInfoMap;
156
174
  private _fetchOutgoingRelationships;
157
175
  private _fetchIncomingRelationships;
package/lib/models.d.ts CHANGED
@@ -26,6 +26,8 @@ export interface CueSdkConfig {
26
26
  environment?: CueEnvironment;
27
27
  /** Override individual endpoint URLs. Takes precedence over environment. */
28
28
  endpoints?: Partial<CueEndpoints>;
29
+ /** Enable verbose debug logging for all entity/document store operations. */
30
+ verbose?: boolean;
29
31
  }
30
32
  export type SsoProvider = 'google' | 'microsoft';
31
33
  export interface PasswordCredentials {
@@ -11,6 +11,8 @@ export interface CueProjectViewOptions {
11
11
  rdfBase?: string;
12
12
  /** Graph engine type from projectSettings.graph.type (e.g. 'qlever' or 'fuseki'). */
13
13
  graphType?: string;
14
+ /** Enable verbose debug logging for entity and document fetch stats. */
15
+ verbose?: boolean;
14
16
  }
15
17
  /**
16
18
  * Framework-agnostic facade over `CueProjectSchema`, `CueProjectEntities`, and
@@ -59,7 +61,7 @@ export declare class CueProjectView {
59
61
  /** The result of the most recent `search()` call. `undefined` before first search. */
60
62
  readonly searchResults: ReadonlySignal<SearchResponse | undefined>;
61
63
  private _destroyed;
62
- constructor(_api: CueApi, _projectId: string, { language, queryCache, rdfBase, graphType }: CueProjectViewOptions);
64
+ constructor(_api: CueApi, _projectId: string, { language, queryCache, rdfBase, graphType, verbose }: CueProjectViewOptions);
63
65
  /**
64
66
  * Lazily batch-fetch core data (label + categories) for the given entity UUIDs.
65
67
  * Already-fetched UUIDs are skipped. Populates `entityInfoMap`.
package/node.js CHANGED
@@ -1,5 +1,5 @@
1
- import { C as h, B as l, t as _, u as E, v as S, o as m, w as P, a as d } from "./cue-CnZyGMRG.js";
2
- import { b as j, c as x, d as y, e as I, f as K, g as L, h as v, i as H, j as N, k as O, l as D, m as G, n as W, p as k, R as q, q as Q, r as V, s as z } from "./cue-CnZyGMRG.js";
1
+ import { C as h, B as l, t as _, u as E, v as S, o as m, w as P, a as d } from "./cue-DWCLcFvj.js";
2
+ import { b as j, c as x, d as y, e as I, f as K, g as L, h as v, i as H, j as N, k as O, l as D, m as G, n as W, p as k, R as q, q as Q, r as V, s as z } from "./cue-DWCLcFvj.js";
3
3
  import { getStorage as t, connectStorageEmulator as w } from "firebase/storage";
4
4
  import "firebase/firestore";
5
5
  class A extends h {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qaecy/cue-sdk",
3
- "version": "0.0.29",
3
+ "version": "0.0.30",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",