@qaecy/cue-sdk 0.0.14 → 0.0.17

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.d.ts CHANGED
@@ -1,4 +1,8 @@
1
1
  export { Cue } from './lib/cue';
2
+ export { CueGis } from './lib/gis';
3
+ export { CueStorage } from './lib/storage';
4
+ export type { StorageBucket } from './lib/storage';
5
+ export type { GisBBox, GisCategoryDescriptor, GisFeature, GisFeaturesMap, FeatureCategory } from './lib/gis';
2
6
  export { CueAuth } from './lib/auth';
3
7
  export { CueApi } from './lib/api';
4
8
  export { CueSyncApi, configureScanWasm } from './lib/sync';
@@ -17,3 +21,5 @@ export { CueCache } from './lib/cache';
17
21
  export type { QueryCacheEntry } from './lib/cache';
18
22
  export type { CueSdkConfig, SsoProvider, PasswordCredentials, SearchRequest, SearchResponse, SearchSource, SearchOptions, ProjectData, ProjectSettings, CreateProjectOptions, SyncOptions, SyncResult, SyncPreview, ScanOutputRecord, UnitsConsumedDto, OrganizationData, OrgMember, ProfileSSOAccount, APIKeyInfo, APIKeyDoc, ProjectDoc, OrganizationDoc, UserDoc, RDFWritingDoc, ViewDefinition, QueryCache, CategoryDef, RelationshipDef, EntityCoreData, EntityRelationship, EntityRelationships, MapGeometry, EntityDetailedData, ProjectEntitiesData, DocumentInfo, DocumentSummary, ProjectDocumentsData, } from './lib/models';
19
23
  export type { AuthStateListener, Unsubscribe } from './lib/auth';
24
+ export { CueTables } from './lib/tables';
25
+ export type { ProjectTable } from './lib/tables';
package/index.js CHANGED
@@ -1,20 +1,23 @@
1
- import { C as s, a as u, b as C, c, d as i, e as t, f as o, g as r, h as l, i as n, j as P, k as j, l as m, R as h, m as R, n as S, s as f } from "./cue-DjbCgB69.js";
1
+ import { C as s, a as u, b as C, c as i, d as t, 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, R as p, p as R, q as f, s as E } from "./cue-yUoyoy61.js";
2
2
  export {
3
3
  s as Cue,
4
4
  u as CueApi,
5
5
  C as CueAuth,
6
- c as CueCache,
7
- i as CuePrivileges,
8
- t as CueProfile,
9
- o as CueProjectDocuments,
10
- r as CueProjectEntities,
11
- l as CueProjectSchema,
12
- n as CueProjectView,
13
- P as CueProjects,
14
- j as CueSignal,
15
- m as CueSyncApi,
16
- h as REQUIRED_ROLES,
6
+ i as CueCache,
7
+ t as CueGis,
8
+ c as CuePrivileges,
9
+ o as CueProfile,
10
+ r as CueProjectDocuments,
11
+ l as CueProjectEntities,
12
+ n as CueProjectSchema,
13
+ P as CueProjectView,
14
+ j as CueProjects,
15
+ m as CueSignal,
16
+ S as CueStorage,
17
+ g as CueSyncApi,
18
+ h as CueTables,
19
+ p as REQUIRED_ROLES,
17
20
  R as configureScanWasm,
18
- S as cueComputed,
19
- f as staleWhileRevalidate
21
+ f as cueComputed,
22
+ E as staleWhileRevalidate
20
23
  };
package/lib/api.d.ts CHANGED
@@ -1,12 +1,18 @@
1
1
  import { CueAuth } from './auth';
2
- import { SearchRequest, SearchResponse, UnitsConsumedDto } from './models';
2
+ import { SearchRequest, SearchResponse, ShaclValidationReport, UnitsConsumedDto } from './models';
3
3
  import { CueProjects } from './project';
4
4
  import { CueSyncApi } from './sync';
5
+ import { CueTables } from './tables';
5
6
  export declare class CueApi {
6
7
  private readonly _auth;
7
8
  private readonly _gatewayUrl;
8
9
  readonly projects: CueProjects;
9
10
  readonly sync?: CueSyncApi | undefined;
11
+ readonly tables: CueTables;
12
+ /** Active language used for language-sensitive SPARQL queries across all project classes. */
13
+ language: string;
14
+ /** Updates the active language. All project classes (`CueProjectSchema`, `CueProjectDocuments`, `CueProjectEntities`) read this at query time. */
15
+ setLanguage(lang: string): void;
10
16
  constructor(_auth: CueAuth, _gatewayUrl: string, projects: CueProjects, sync?: CueSyncApi | undefined);
11
17
  /**
12
18
  * Returns standard authentication headers for the current user.
@@ -23,5 +29,20 @@ export declare class CueApi {
23
29
  * The user must be authenticated before calling this.
24
30
  */
25
31
  sparql(query: string, projectId: string, graphType?: string): Promise<unknown>;
32
+ /**
33
+ * Validate a SHACL shape against the project's triplestore.
34
+ *
35
+ * @param shape - SHACL shapes graph in Turtle syntax.
36
+ * @param projectId - Project to validate against.
37
+ * @param options - `format`: `'json-ld'` (default, structured result) or `'turtle'` (raw string).
38
+ * `verbose`: include server-side timing logs.
39
+ *
40
+ * Returns a {@link ShaclValidationReport} for JSON-LD, or a Turtle string.
41
+ */
42
+ shacl(shape: string, projectId: string, options?: {
43
+ format?: 'json-ld' | 'turtle';
44
+ verbose?: boolean;
45
+ graphType?: string;
46
+ }): Promise<ShaclValidationReport | string>;
26
47
  getConsumption(projectId: string): Promise<UnitsConsumedDto>;
27
48
  }
package/lib/cue.d.ts CHANGED
@@ -1,11 +1,16 @@
1
1
  import { FirebaseApp } from 'firebase/app';
2
+ import { FirebaseStorage } from 'firebase/storage';
2
3
  import { CueAuth } from './auth';
4
+ import { CueStorage } from './storage';
3
5
  import { CueApi } from './api';
6
+ import { CueGis } from './gis';
4
7
  import { CueProjects } from './project';
5
8
  import { CueProfile } from './profile';
6
9
  import { CuePrivileges } from './privileges';
7
10
  import { CueCache } from './cache';
8
11
  import { CueProjectView, CueProjectViewOptions } from './project-view';
12
+ import { CueProjectEntities } from './entities';
13
+ import { CueProjectDocuments } from './documents';
9
14
  import { CueEndpoints, CueSdkConfig, QueryCache } from './models';
10
15
  /**
11
16
  * Main entry point for the QAECY SDK (browser-safe).
@@ -23,9 +28,25 @@ export declare class Cue {
23
28
  readonly profile: CueProfile;
24
29
  readonly privileges: CuePrivileges;
25
30
  readonly cache: CueCache;
31
+ readonly storage: CueStorage;
26
32
  protected readonly _app: FirebaseApp;
27
33
  protected readonly _endpoints: CueEndpoints;
28
34
  protected readonly _isEmulator: boolean;
35
+ protected _storageRaw: FirebaseStorage;
36
+ protected _storageProcessed: FirebaseStorage;
37
+ private _gis;
38
+ /**
39
+ * Reactive GIS service. Lazily constructed on first access.
40
+ *
41
+ * @example
42
+ * ```ts
43
+ * cue.gis.setProjectId('my-project');
44
+ * cue.gis.onAvailableCategories(cats => ...);
45
+ * cue.gis.setBbox([west, south, east, north]);
46
+ * cue.gis.setSelectedCategories(new Set(['cadastre', 'building']));
47
+ * ```
48
+ */
49
+ get gis(): CueGis;
29
50
  constructor(config?: CueSdkConfig);
30
51
  /**
31
52
  * Create a `Cue` instance from an already-initialized Firebase app.
@@ -65,4 +86,46 @@ export declare class Cue {
65
86
  createProjectView(projectId: string, opts: Omit<CueProjectViewOptions, 'queryCache'> & {
66
87
  queryCache?: QueryCache;
67
88
  }): CueProjectView;
89
+ /**
90
+ * Creates a `CueProjectEntities` instance for the given project, with the
91
+ * SDK query cache wired automatically.
92
+ *
93
+ * Prefer this over `new CueProjectEntities(cue.api, projectId)` — it avoids
94
+ * the manual cache setup and keeps the instance bound to the correct API.
95
+ *
96
+ * @example
97
+ * ```ts
98
+ * const entities = cue.createProjectEntities('my-project');
99
+ * entities.requestEntityData(['uuid1']);
100
+ * const info = entities.entityInfoMap.get()['uuid1'];
101
+ *
102
+ * // Promise-based (no signal polling needed):
103
+ * const graph = await entities.buildSummaryGraph('graph');
104
+ * ```
105
+ */
106
+ createProjectEntities(projectId: string, opts?: {
107
+ rdfBase?: string;
108
+ graphType?: string;
109
+ queryCache?: QueryCache;
110
+ }): CueProjectEntities;
111
+ /**
112
+ * Creates a `CueProjectDocuments` instance for the given project, with the
113
+ * SDK query cache wired automatically.
114
+ *
115
+ * Prefer this over `new CueProjectDocuments(cue.api, projectId)` — it avoids
116
+ * the manual cache setup and keeps the instance bound to the correct API.
117
+ *
118
+ * @example
119
+ * ```ts
120
+ * const docs = cue.createProjectDocuments('my-project');
121
+ * await docs.fetchOverview();
122
+ * const data = await docs.fetchDocumentData(['uuid1', 'uuid2']);
123
+ * ```
124
+ */
125
+ createProjectDocuments(projectId: string, opts?: {
126
+ language?: string;
127
+ rdfBase?: string;
128
+ graphType?: string;
129
+ queryCache?: QueryCache;
130
+ }): CueProjectDocuments;
68
131
  }
@@ -39,14 +39,15 @@ export declare class CueProjectDocuments {
39
39
  private readonly _graphType?;
40
40
  /** Full RDF base URL for this project, e.g. `https://cue.qaecy.com/r/{pid}/` */
41
41
  readonly baseURL: string;
42
- private _language;
42
+ /** Tracks the language for which `_documentInfoMap` is currently populated. */
43
+ private _currentLang;
43
44
  private readonly _documentInfoMap;
44
45
  private readonly _projectDocumentsData;
45
46
  /** Lazily populated per-document detail map. */
46
47
  readonly documentInfoMap: ReadonlySignal<Record<string, DocumentInfo>>;
47
48
  /** Project-level document overview (grouped counts + sizes). */
48
49
  readonly projectDocumentsData: ReadonlySignal<ProjectDocumentsData>;
49
- constructor(_api: CueApi, _projectId: string, language: string,
50
+ constructor(_api: CueApi, _projectId: string, language?: string,
50
51
  /** Override the RDF resource base URL. Defaults to `https://cue.qaecy.com/r/`. */
51
52
  rdfBase?: string, _queryCache?: QueryCache | undefined, _graphType?: string | undefined);
52
53
  /**
@@ -72,6 +73,48 @@ export declare class CueProjectDocuments {
72
73
  * once the SPARQL response arrives.
73
74
  */
74
75
  requestDocumentData(uuids: string[]): void;
76
+ /**
77
+ * Promise-based alternative to {@link requestDocumentData} for non-reactive contexts.
78
+ *
79
+ * Resolves with the `DocumentInfo` entries for every requested UUID once the
80
+ * SPARQL response arrives. UUIDs already present in the cache are returned
81
+ * immediately without a network request. The result is also written into
82
+ * `documentInfoMap` so reactive consumers stay in sync.
83
+ *
84
+ * UUIDs not found in the triplestore are omitted from the returned map.
85
+ *
86
+ * @example
87
+ * ```ts
88
+ * const docs = await cueProjectDocs.fetchDocumentData(['uuid1', 'uuid2']);
89
+ * console.log(docs['uuid1'].subject);
90
+ * ```
91
+ */
92
+ fetchDocumentData(uuids: string[]): Promise<Record<string, DocumentInfo>>;
93
+ /**
94
+ * Returns the alternative representations of the given document UUID.
95
+ *
96
+ * Alternative representations are derived artefacts stored under
97
+ * `qcy:alternativeRepresentation` in the triplestore — for example a
98
+ * `.fragments` BIM tile derived from an `.ifc` source file.
99
+ *
100
+ * The returned `DocumentInfo` entries are also merged into
101
+ * `documentInfoMap` so reactive consumers stay in sync.
102
+ *
103
+ * @example
104
+ * ```ts
105
+ * const alts = await docs.fetchAlternativeRepresentations('abc-123');
106
+ * // alts[0].suffix => '.fragments'
107
+ * ```
108
+ */
109
+ fetchAlternativeRepresentations(uuid: string): Promise<DocumentInfo[]>;
110
+ /**
111
+ * Returns a single arbitrary file path from the project's triplestore.
112
+ * Useful for pre-filling path-based query inputs with a realistic example.
113
+ */
114
+ randomFilePath(): Promise<string | null>;
115
+ /** Executes the document-info SPARQL query for the given UUIDs, merges results
116
+ * into `documentInfoMap`, and returns the newly fetched entries. */
117
+ private _fetchDocumentInfoBatch;
75
118
  private _fetchDocumentsBySuffix;
76
119
  private _buildDocumentsBySuffixQuery;
77
120
  private _runDocumentsBySuffixQuery;
package/lib/entities.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { CueApi } from './api';
2
2
  import { ReadonlySignal } from './signal';
3
- import { EntityDetailedData, EntityRelationships, ProjectEntitiesData, QueryCache } from './models';
3
+ import { EntityDetailedData, EntityRelationships, ProjectEntitiesData, SummaryGraphData, QueryCache } from './models';
4
4
  /**
5
5
  * Manages entity data for a single project.
6
6
  *
@@ -97,6 +97,42 @@ export declare class CueProjectEntities {
97
97
  * document service (future `CueProjectDocuments`).
98
98
  */
99
99
  fetchEntityDocuments(iri: string): Promise<string[]>;
100
+ /**
101
+ * Fetches all `qcy:EntityCategory` IRIs and their preferred labels for this
102
+ * project. Uses `api.language` (default `'en'`);
103
+ * falls back to an untagged label when no match is found.
104
+ */
105
+ contentCategoriesInProject(orderByOccurences?: boolean): Promise<{
106
+ iri: string;
107
+ label: string;
108
+ }[]>;
109
+ /**
110
+ * Fetches a summary graph of entity category relationships for the project.
111
+ *
112
+ * Each row describes how many times entities of `sourceCat` point to
113
+ * entities of `targetCat` via a given `predicate`, ordered by descending
114
+ * occurrence count.
115
+ *
116
+ * @param format
117
+ * - `undefined` — raw SPARQL JSON result
118
+ * - `'graph'` — structured `{ entities, relations }` with predicates and weights
119
+ * - `'md'` — compact aligned text table
120
+ *
121
+ * @example
122
+ * ```ts
123
+ * // Structured graph (nodes + edges)
124
+ * const g = await entities.buildSummaryGraph('graph');
125
+ * // g.entities → [{ iri: 'https://…FloorPlanDrawing' }, …]
126
+ * // g.relations → [{ sourceID, predicate, targetID, weight }, …]
127
+ *
128
+ * // Markdown table
129
+ * const md = await entities.buildSummaryGraph('md');
130
+ * // qcy:FloorPlanDrawing -> qcy:includesBuildingEntity -> qcy:BuildingZone (5652)
131
+ * ```
132
+ */
133
+ buildSummaryGraph(format: 'graph'): Promise<SummaryGraphData>;
134
+ buildSummaryGraph(format: 'md'): Promise<string>;
135
+ buildSummaryGraph(format?: undefined): Promise<unknown>;
100
136
  private _computeEntityInfoMap;
101
137
  private _fetchOutgoingRelationships;
102
138
  private _fetchIncomingRelationships;
package/lib/gis.d.ts ADDED
@@ -0,0 +1,89 @@
1
+ import { BBox, FeatureCategory, FeatureCategoryDescriptor, GisFeature } from 'js/cue-gis';
2
+ export type GisBBox = BBox;
3
+ export type { FeatureCategory };
4
+ export type GisCategoryDescriptor = FeatureCategoryDescriptor;
5
+ export type { GisFeature };
6
+ export type GisFeaturesMap = Map<FeatureCategory, GisFeature[]>;
7
+ type Listener<T> = (value: T) => void;
8
+ /**
9
+ * Reactive GIS service, exposed lazily as `cue.gis`.
10
+ *
11
+ * Push-based: consumers set the active bbox and selected categories; results are
12
+ * delivered via subscription callbacks. All debouncing and request cancellation
13
+ * are handled internally.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * cue.gis.setProjectId('my-project-id');
18
+ * cue.gis.onAvailableCategories(cats => console.log(cats));
19
+ *
20
+ * // On every map pan/zoom:
21
+ * cue.gis.setBbox([west, south, east, north]);
22
+ *
23
+ * // When the user toggles a category:
24
+ * cue.gis.setSelectedCategories(new Set(['cadastre', 'building']));
25
+ *
26
+ * // Cleanup:
27
+ * cue.gis.destroy();
28
+ * ```
29
+ */
30
+ export declare class CueGis {
31
+ private readonly _getAuthHeaders;
32
+ private readonly _gatewayUrl;
33
+ private _bbox;
34
+ private _projectId;
35
+ private _selectedCategories;
36
+ private _queryToken;
37
+ private _categoryTokens;
38
+ private _debounceTimer;
39
+ private _availableCategories;
40
+ private _features;
41
+ private readonly _catListeners;
42
+ private readonly _featListeners;
43
+ private readonly _loadListeners;
44
+ private _gatewayCache;
45
+ private _gatewayProjectId;
46
+ /** @internal — construct via `cue.gis`, not directly. */
47
+ constructor(_getAuthHeaders: () => Promise<Record<string, string>>, _gatewayUrl: string);
48
+ /**
49
+ * Update the current map viewport.
50
+ * Triggers a debounced query for available categories and reloads selected ones.
51
+ */
52
+ setBbox(bbox: BBox): void;
53
+ /**
54
+ * Set or clear the active project.
55
+ * Rebuilds the authenticated adapter so subsequent requests carry the new project header.
56
+ */
57
+ setProjectId(projectId: string | null): void;
58
+ /**
59
+ * Replace the full set of selected categories.
60
+ * Newly added categories begin loading immediately; removed categories are cleared.
61
+ */
62
+ setSelectedCategories(categories: Set<FeatureCategory>): void;
63
+ /**
64
+ * Subscribe to available-category updates.
65
+ * Replays the current value immediately, then fires on every bbox change.
66
+ * @returns An unsubscribe function.
67
+ */
68
+ onAvailableCategories(cb: Listener<GisCategoryDescriptor[]>): () => void;
69
+ /**
70
+ * Subscribe to the feature map (category → GisFeature[]).
71
+ * Replays the current value immediately, then fires whenever features change.
72
+ * @returns An unsubscribe function.
73
+ */
74
+ onFeaturesChange(cb: Listener<GisFeaturesMap>): () => void;
75
+ /**
76
+ * Subscribe to the global loading state.
77
+ * Fires `true` while the category list is being queried, `false` when done.
78
+ * @returns An unsubscribe function.
79
+ */
80
+ onLoadingChange(cb: Listener<boolean>): () => void;
81
+ /** Cancel all pending requests and clear all listeners. */
82
+ destroy(): void;
83
+ private _scheduleDebouncedQuery;
84
+ private _getGateway;
85
+ private _queryLayers;
86
+ private _loadCategory;
87
+ private _emitFeatures;
88
+ private _emitLoading;
89
+ }
package/lib/models.d.ts CHANGED
@@ -152,6 +152,34 @@ export interface UnitsConsumedDto {
152
152
  unitsAvailable: number;
153
153
  unitsConsumed: number;
154
154
  }
155
+ export interface ShaclViolation {
156
+ '@type': string;
157
+ 'sh:focusNode': {
158
+ '@id': string;
159
+ } | {
160
+ '@value': string;
161
+ };
162
+ 'sh:resultPath'?: {
163
+ '@id': string;
164
+ };
165
+ 'sh:resultSeverity': {
166
+ '@id': string;
167
+ };
168
+ 'sh:sourceConstraintComponent': {
169
+ '@id': string;
170
+ };
171
+ 'sh:sourceShape'?: {
172
+ '@id': string;
173
+ };
174
+ 'sh:resultMessage': string;
175
+ 'sh:value'?: string;
176
+ }
177
+ export interface ShaclValidationReport {
178
+ '@context': Record<string, string>;
179
+ '@type': string;
180
+ 'sh:conforms': boolean;
181
+ 'sh:result'?: ShaclViolation[];
182
+ }
155
183
  export interface SyncPreview {
156
184
  /** Per-extension cost breakdown for files not yet synced */
157
185
  costRecords: ScanOutputRecord[];
@@ -320,6 +348,22 @@ export interface ProjectEntitiesData {
320
348
  targetID: string;
321
349
  }>;
322
350
  }
351
+ /**
352
+ * Structured summary graph returned by `buildSummaryGraph('graph')`.
353
+ * Nodes are deduplicated category IRIs; edges carry the predicate and
354
+ * occurrence count from the summary query.
355
+ */
356
+ export interface SummaryGraphData {
357
+ entities: Array<{
358
+ iri: string;
359
+ }>;
360
+ relations: Array<{
361
+ sourceID: string;
362
+ predicate: string;
363
+ targetID: string;
364
+ weight: number;
365
+ }>;
366
+ }
323
367
  /** Core metadata for a single document (FileContent node). */
324
368
  export interface DocumentInfo {
325
369
  id: string;
@@ -42,6 +42,11 @@ export declare class CueProjectView {
42
42
  readonly availableEntityCategories: ReadonlySignal<CategoryDef[]>;
43
43
  /** Available entity relationship types. Auto-fetched on init. */
44
44
  readonly availableEntityRelationships: ReadonlySignal<RelationshipDef[]>;
45
+ /**
46
+ * Resolves when the initial schema load has completed. Await before reading
47
+ * schema signal values imperatively.
48
+ */
49
+ readonly schemaReady: Promise<void>;
45
50
  /** Merged per-entity detail map. Populated lazily via `requestEntityData()` etc. */
46
51
  readonly entityInfoMap: ReadonlySignal<Record<string, EntityDetailedData>>;
47
52
  /** Project-level entity co-occurrence graph. Fetched once on init. */
package/lib/schema.d.ts CHANGED
@@ -31,7 +31,7 @@ export declare class CueProjectSchema {
31
31
  private readonly _queryCache?;
32
32
  private readonly _graphType?;
33
33
  private readonly _cache;
34
- private readonly _language;
34
+ private _currentLang;
35
35
  private readonly _contentCategories;
36
36
  private readonly _entityCategories;
37
37
  private readonly _relationships;
@@ -41,6 +41,11 @@ export declare class CueProjectSchema {
41
41
  readonly availableEntityCategories: ReadonlySignal<CategoryDef[]>;
42
42
  /** Currently active entity relationship types for the selected language. */
43
43
  readonly availableEntityRelationships: ReadonlySignal<RelationshipDef[]>;
44
+ /**
45
+ * Resolves when the initial schema load for the constructor language has
46
+ * completed (or failed). Await this before reading signal values imperatively.
47
+ */
48
+ readonly ready: Promise<void>;
44
49
  constructor(_api: CueApi, _projectId: string, language: string, _queryCache?: QueryCache | undefined, _graphType?: string | undefined);
45
50
  /** Returns the currently active language. */
46
51
  get language(): string;
@@ -0,0 +1,26 @@
1
+ import { FirebaseStorage } from 'firebase/storage';
2
+ export type StorageBucket = 'raw' | 'processed';
3
+ /**
4
+ * Provides document download URL resolution against the Cue Firebase Storage buckets.
5
+ *
6
+ * @example
7
+ * ```ts
8
+ * const url = await cue.storage.getDownloadUrl('my-project', 'abc123', '.pdf');
9
+ * ```
10
+ */
11
+ export declare class CueStorage {
12
+ private readonly _storageRaw;
13
+ private readonly _storageProcessed;
14
+ constructor(_storageRaw: FirebaseStorage, _storageProcessed: FirebaseStorage);
15
+ /**
16
+ * Returns a Firebase authenticated download URL for a document stored in Cue.
17
+ *
18
+ * The storage path is `{projectId}/{uuid}{suffix}`, e.g. `my-project/abc-123.pdf`.
19
+ *
20
+ * @param projectId - The Cue project (space) ID.
21
+ * @param uuid - The document UUID.
22
+ * @param suffix - File suffix including the leading dot, e.g. `'.pdf'`, `'.ifc'`.
23
+ * @param bucket - `'raw'` (default, original uploads) or `'processed'` (derived artefacts).
24
+ */
25
+ getDownloadUrl(projectId: string, uuid: string, suffix: string, bucket?: StorageBucket): Promise<string>;
26
+ }
@@ -0,0 +1,14 @@
1
+ import { CueAuth } from './auth';
2
+ export interface ProjectTable {
3
+ id: string;
4
+ title: string;
5
+ columnDefs: Record<string, unknown>[];
6
+ rowDef: string;
7
+ }
8
+ export declare class CueTables {
9
+ private readonly _auth;
10
+ private readonly _gatewayUrl;
11
+ constructor(_auth: CueAuth, _gatewayUrl: string);
12
+ listTables(projectId: string): Promise<ProjectTable[]>;
13
+ saveTables(tables: ProjectTable[] | unknown[], projectId: string): Promise<void>;
14
+ }
package/node.js CHANGED
@@ -1,55 +1,58 @@
1
- import { C as _, B as E, o as l, p as S, q as m, r as P, t as d, l as U, u as B, a as R } from "./cue-DjbCgB69.js";
2
- import { b as y, c as I, d as L, e as O, f as x, g as D, h as H, i as N, j as W, k as v, R as k, m as q, n as G, s as Q } from "./cue-DjbCgB69.js";
3
- import { getStorage as s, connectStorageEmulator as o } from "firebase/storage";
1
+ import { C as h, B as l, r as _, t as S, u as E, n as m, v as P, a as d } from "./cue-yUoyoy61.js";
2
+ import { b as j, c as y, d as I, e as K, f as L, g as v, h as x, i as H, j as N, k as O, l as D, m as G, o as W, R as k, p as q, q as Q, s as V } from "./cue-yUoyoy61.js";
3
+ import { getStorage as e, connectStorageEmulator as b } from "firebase/storage";
4
4
  import "firebase/firestore";
5
- class w extends _ {
6
- constructor(t) {
7
- super(t);
5
+ class A extends h {
6
+ constructor(s) {
7
+ super(s);
8
8
  }
9
- _buildApi(t) {
10
- const p = s(this._app, E), C = s(this._app, l), i = s(this._app, S), g = s(this._app, m), r = s(this._app, P), n = s(this._app, d);
9
+ _buildApi(s) {
10
+ const r = e(this._app, l), i = e(this._app, _), n = this._storageRaw, u = e(this._app, S), c = this._storageProcessed, t = e(this._app, E);
11
11
  if (this._isEmulator) {
12
- const e = this._endpoints.storageEmulatorHost, a = this._endpoints.storageEmulatorPort;
13
- o(i, e, a), o(r, e, a), o(n, e, a);
12
+ const p = this._endpoints.storageEmulatorHost, g = this._endpoints.storageEmulatorPort;
13
+ b(t, p, g);
14
14
  }
15
- const h = new B({
16
- storageChatSessions: p,
17
- storageLogs: C,
18
- storageRaw: i,
19
- storagePersistence: g,
20
- storageProcessed: r,
21
- storagePublic: n
22
- }), c = new U(
15
+ const C = new P({
16
+ storageChatSessions: r,
17
+ storageLogs: i,
18
+ storageRaw: n,
19
+ storagePersistence: u,
20
+ storageProcessed: c,
21
+ storagePublic: t
22
+ }), a = new m(
23
23
  this.auth,
24
- t,
25
- h,
24
+ s,
25
+ C,
26
26
  this._endpoints.gatewayUrl
27
- ), u = new R(
27
+ ), o = new d(
28
28
  this.auth,
29
29
  this._endpoints.gatewayUrl,
30
- t,
31
- c
30
+ s,
31
+ a
32
32
  );
33
- return c._bindApi(u), u;
33
+ return a._bindApi(o), o;
34
34
  }
35
35
  }
36
36
  export {
37
- _ as Cue,
38
- R as CueApi,
39
- y as CueAuth,
40
- I as CueCache,
41
- w as CueNode,
42
- L as CuePrivileges,
43
- O as CueProfile,
44
- x as CueProjectDocuments,
45
- D as CueProjectEntities,
37
+ h as Cue,
38
+ d as CueApi,
39
+ j as CueAuth,
40
+ y as CueCache,
41
+ I as CueGis,
42
+ A as CueNode,
43
+ K as CuePrivileges,
44
+ L as CueProfile,
45
+ v as CueProjectDocuments,
46
+ x as CueProjectEntities,
46
47
  H as CueProjectSchema,
47
48
  N as CueProjectView,
48
- W as CueProjects,
49
- v as CueSignal,
50
- U as CueSyncApi,
49
+ O as CueProjects,
50
+ D as CueSignal,
51
+ G as CueStorage,
52
+ m as CueSyncApi,
53
+ W as CueTables,
51
54
  k as REQUIRED_ROLES,
52
55
  q as configureScanWasm,
53
- G as cueComputed,
54
- Q as staleWhileRevalidate
56
+ Q as cueComputed,
57
+ V as staleWhileRevalidate
55
58
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qaecy/cue-sdk",
3
- "version": "0.0.14",
3
+ "version": "0.0.17",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
package/variables.d.ts CHANGED
@@ -30,8 +30,10 @@ export declare const ENDPOINT_CREATE_PROJECT = "/commands/admin/project";
30
30
  export declare const ENDPOINT_SEARCH = "/assistant/search";
31
31
  export declare const ENDPOINT_FUSEKI_QUERY = "/triplestore/query";
32
32
  export declare const ENDPOINT_FUSEKI_UPDATE = "/triplestore/update";
33
+ export declare const ENDPOINT_FUSEKI_SHACL = "/triplestore/shacl";
33
34
  export declare const ENDPOINT_QLEVER_QUERY = "/qlever-server/qlever/query";
34
35
  export declare const ENDPOINT_QLEVER_UPDATE = "/qlever-server/qlever/update";
36
+ export declare const ENDPOINT_QLEVER_SHACL = "/qlever-server/qlever/shacl";
35
37
  export declare const ENDPOINT_FSS_BATCH = "/commands/file-system-structure/batch";
36
38
  export declare const MICROSOFT_PROVIDER_ID = "microsoft.com";
37
39
  export declare const SUPERADMIN_ROLE = "superadmin";