@qaecy/cue-sdk 0.0.16 → 0.0.18
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/{cue-DiFnK22Q.js → cue-D52ik-Oy.js} +639 -407
- package/index.d.ts +2 -0
- package/index.js +9 -8
- package/lib/cue.d.ts +50 -0
- package/lib/documents.d.ts +50 -0
- package/lib/storage.d.ts +26 -0
- package/node.js +43 -42
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { Cue } from './lib/cue';
|
|
2
2
|
export { CueGis } from './lib/gis';
|
|
3
|
+
export { CueStorage } from './lib/storage';
|
|
4
|
+
export type { StorageBucket } from './lib/storage';
|
|
3
5
|
export type { GisBBox, GisCategoryDescriptor, GisFeature, GisFeaturesMap, FeatureCategory } from './lib/gis';
|
|
4
6
|
export { CueAuth } from './lib/auth';
|
|
5
7
|
export { CueApi } from './lib/api';
|
package/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { C as s, a as u, b as C, c as i, d as
|
|
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-D52ik-Oy.js";
|
|
2
2
|
export {
|
|
3
3
|
s as Cue,
|
|
4
4
|
u as CueApi,
|
|
5
5
|
C as CueAuth,
|
|
6
6
|
i as CueCache,
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
t as CueGis,
|
|
8
|
+
c as CuePrivileges,
|
|
9
9
|
o as CueProfile,
|
|
10
10
|
r as CueProjectDocuments,
|
|
11
11
|
l as CueProjectEntities,
|
|
@@ -13,10 +13,11 @@ export {
|
|
|
13
13
|
P as CueProjectView,
|
|
14
14
|
j as CueProjects,
|
|
15
15
|
m as CueSignal,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
S as CueStorage,
|
|
17
|
+
g as CueSyncApi,
|
|
18
|
+
h as CueTables,
|
|
19
|
+
p as REQUIRED_ROLES,
|
|
20
|
+
R as configureScanWasm,
|
|
20
21
|
f as cueComputed,
|
|
21
|
-
|
|
22
|
+
E as staleWhileRevalidate
|
|
22
23
|
};
|
package/lib/cue.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
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';
|
|
4
6
|
import { CueGis } from './gis';
|
|
5
7
|
import { CueProjects } from './project';
|
|
@@ -7,6 +9,8 @@ import { CueProfile } from './profile';
|
|
|
7
9
|
import { CuePrivileges } from './privileges';
|
|
8
10
|
import { CueCache } from './cache';
|
|
9
11
|
import { CueProjectView, CueProjectViewOptions } from './project-view';
|
|
12
|
+
import { CueProjectEntities } from './entities';
|
|
13
|
+
import { CueProjectDocuments } from './documents';
|
|
10
14
|
import { CueEndpoints, CueSdkConfig, QueryCache } from './models';
|
|
11
15
|
/**
|
|
12
16
|
* Main entry point for the QAECY SDK (browser-safe).
|
|
@@ -24,10 +28,14 @@ export declare class Cue {
|
|
|
24
28
|
readonly profile: CueProfile;
|
|
25
29
|
readonly privileges: CuePrivileges;
|
|
26
30
|
readonly cache: CueCache;
|
|
31
|
+
readonly storage: CueStorage;
|
|
27
32
|
protected readonly _app: FirebaseApp;
|
|
28
33
|
protected readonly _endpoints: CueEndpoints;
|
|
29
34
|
protected readonly _isEmulator: boolean;
|
|
35
|
+
protected _storageRaw: FirebaseStorage;
|
|
36
|
+
protected _storageProcessed: FirebaseStorage;
|
|
30
37
|
private _gis;
|
|
38
|
+
private readonly _projectDocuments;
|
|
31
39
|
/**
|
|
32
40
|
* Reactive GIS service. Lazily constructed on first access.
|
|
33
41
|
*
|
|
@@ -79,4 +87,46 @@ export declare class Cue {
|
|
|
79
87
|
createProjectView(projectId: string, opts: Omit<CueProjectViewOptions, 'queryCache'> & {
|
|
80
88
|
queryCache?: QueryCache;
|
|
81
89
|
}): CueProjectView;
|
|
90
|
+
/**
|
|
91
|
+
* Creates a `CueProjectEntities` instance for the given project, with the
|
|
92
|
+
* SDK query cache wired automatically.
|
|
93
|
+
*
|
|
94
|
+
* Prefer this over `new CueProjectEntities(cue.api, projectId)` — it avoids
|
|
95
|
+
* the manual cache setup and keeps the instance bound to the correct API.
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```ts
|
|
99
|
+
* const entities = cue.createProjectEntities('my-project');
|
|
100
|
+
* entities.requestEntityData(['uuid1']);
|
|
101
|
+
* const info = entities.entityInfoMap.get()['uuid1'];
|
|
102
|
+
*
|
|
103
|
+
* // Promise-based (no signal polling needed):
|
|
104
|
+
* const graph = await entities.buildSummaryGraph('graph');
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
createProjectEntities(projectId: string, opts?: {
|
|
108
|
+
rdfBase?: string;
|
|
109
|
+
graphType?: string;
|
|
110
|
+
queryCache?: QueryCache;
|
|
111
|
+
}): CueProjectEntities;
|
|
112
|
+
/**
|
|
113
|
+
* Creates a `CueProjectDocuments` instance for the given project, with the
|
|
114
|
+
* SDK query cache wired automatically.
|
|
115
|
+
*
|
|
116
|
+
* Prefer this over `new CueProjectDocuments(cue.api, projectId)` — it avoids
|
|
117
|
+
* the manual cache setup and keeps the instance bound to the correct API.
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```ts
|
|
121
|
+
* const docs = cue.createProjectDocuments('my-project');
|
|
122
|
+
* await docs.fetchOverview();
|
|
123
|
+
* const data = await docs.fetchDocumentData(['uuid1', 'uuid2']);
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
createProjectDocuments(projectId: string, opts?: {
|
|
127
|
+
language?: string;
|
|
128
|
+
rdfBase?: string;
|
|
129
|
+
graphType?: string;
|
|
130
|
+
queryCache?: QueryCache;
|
|
131
|
+
}): CueProjectDocuments;
|
|
82
132
|
}
|
package/lib/documents.d.ts
CHANGED
|
@@ -73,11 +73,61 @@ export declare class CueProjectDocuments {
|
|
|
73
73
|
* once the SPARQL response arrives.
|
|
74
74
|
*/
|
|
75
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
|
+
* Fetches a lightweight document metadata shape (id/path/suffix/size) for
|
|
95
|
+
* the given UUIDs and merges the results into `documentInfoMap`.
|
|
96
|
+
*
|
|
97
|
+
* This is useful for list/table contexts that do not need language-tagged
|
|
98
|
+
* fields (`subject`, `summary`) or category/tag enrichment.
|
|
99
|
+
*
|
|
100
|
+
* UUIDs already present in `documentInfoMap` are skipped.
|
|
101
|
+
*/
|
|
102
|
+
fetchDocumentDataSimple(uuids: string[]): Promise<Record<string, DocumentInfo>>;
|
|
103
|
+
/**
|
|
104
|
+
* Returns the alternative representations of the given document UUID.
|
|
105
|
+
*
|
|
106
|
+
* Alternative representations are derived artefacts stored under
|
|
107
|
+
* `qcy:alternativeRepresentation` in the triplestore — for example a
|
|
108
|
+
* `.fragments` BIM tile derived from an `.ifc` source file.
|
|
109
|
+
*
|
|
110
|
+
* The returned `DocumentInfo` entries are also merged into
|
|
111
|
+
* `documentInfoMap` so reactive consumers stay in sync.
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```ts
|
|
115
|
+
* const alts = await docs.fetchAlternativeRepresentations('abc-123');
|
|
116
|
+
* // alts[0].suffix => '.fragments'
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
fetchAlternativeRepresentations(uuid: string): Promise<DocumentInfo[]>;
|
|
76
120
|
/**
|
|
77
121
|
* Returns a single arbitrary file path from the project's triplestore.
|
|
78
122
|
* Useful for pre-filling path-based query inputs with a realistic example.
|
|
79
123
|
*/
|
|
80
124
|
randomFilePath(): Promise<string | null>;
|
|
125
|
+
/** Executes the document-info SPARQL query for the given UUIDs, merges results
|
|
126
|
+
* into `documentInfoMap`, and returns the newly fetched entries. */
|
|
127
|
+
private _fetchDocumentInfoBatch;
|
|
128
|
+
/** Executes a reduced document-info query (id/path/suffix/size only), merges
|
|
129
|
+
* into `documentInfoMap`, and returns newly fetched entries. */
|
|
130
|
+
private _fetchSimpleDocumentInfoBatch;
|
|
81
131
|
private _fetchDocumentsBySuffix;
|
|
82
132
|
private _buildDocumentsBySuffixQuery;
|
|
83
133
|
private _runDocumentsBySuffixQuery;
|
package/lib/storage.d.ts
ADDED
|
@@ -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
|
+
}
|
package/node.js
CHANGED
|
@@ -1,57 +1,58 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import { b as
|
|
3
|
-
import { getStorage as
|
|
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-D52ik-Oy.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-D52ik-Oy.js";
|
|
3
|
+
import { getStorage as e, connectStorageEmulator as b } from "firebase/storage";
|
|
4
4
|
import "firebase/firestore";
|
|
5
|
-
class
|
|
6
|
-
constructor(
|
|
7
|
-
super(
|
|
5
|
+
class A extends h {
|
|
6
|
+
constructor(s) {
|
|
7
|
+
super(s);
|
|
8
8
|
}
|
|
9
|
-
_buildApi(
|
|
10
|
-
const
|
|
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
|
|
13
|
-
|
|
12
|
+
const p = this._endpoints.storageEmulatorHost, g = this._endpoints.storageEmulatorPort;
|
|
13
|
+
b(t, p, g);
|
|
14
14
|
}
|
|
15
|
-
const
|
|
16
|
-
storageChatSessions:
|
|
17
|
-
storageLogs:
|
|
18
|
-
storageRaw:
|
|
19
|
-
storagePersistence:
|
|
20
|
-
storageProcessed:
|
|
21
|
-
storagePublic:
|
|
22
|
-
}),
|
|
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
|
-
|
|
25
|
-
|
|
24
|
+
s,
|
|
25
|
+
C,
|
|
26
26
|
this._endpoints.gatewayUrl
|
|
27
|
-
),
|
|
27
|
+
), o = new d(
|
|
28
28
|
this.auth,
|
|
29
29
|
this._endpoints.gatewayUrl,
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
s,
|
|
31
|
+
a
|
|
32
32
|
);
|
|
33
|
-
return
|
|
33
|
+
return a._bindApi(o), o;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
export {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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,
|
|
47
47
|
H as CueProjectSchema,
|
|
48
48
|
N as CueProjectView,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
49
|
+
O as CueProjects,
|
|
50
|
+
D as CueSignal,
|
|
51
|
+
G as CueStorage,
|
|
52
|
+
m as CueSyncApi,
|
|
53
|
+
W as CueTables,
|
|
54
|
+
k as REQUIRED_ROLES,
|
|
55
|
+
q as configureScanWasm,
|
|
56
|
+
Q as cueComputed,
|
|
57
|
+
V as staleWhileRevalidate
|
|
57
58
|
};
|