@qaecy/cue-sdk 0.0.6 → 0.0.8
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/PORTAL_MIGRATION.md +346 -0
- package/README.md +50 -3
- package/cue-BIvMahsX.js +3553 -0
- package/index.d.ts +13 -1
- package/index.js +15 -3
- package/lib/api.d.ts +2 -3
- package/lib/auth.d.ts +41 -2
- package/lib/cache.d.ts +26 -0
- package/lib/cue.d.ts +42 -2
- package/lib/documents.d.ts +84 -0
- package/lib/entities.d.ts +107 -0
- package/lib/models.d.ts +170 -8
- package/lib/privileges.d.ts +53 -0
- package/lib/profile.d.ts +22 -5
- package/lib/project-view.d.ts +107 -0
- package/lib/project.d.ts +17 -2
- package/lib/schema.d.ts +66 -0
- package/lib/signal.d.ts +54 -0
- package/lib/sync.d.ts +75 -3
- package/node.js +46 -380
- package/package.json +1 -1
- package/variables.d.ts +40 -0
- package/cue-BA1pOKTu.js +0 -357
package/node.js
CHANGED
|
@@ -1,389 +1,55 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import { b as
|
|
3
|
-
import { getStorage as
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
import { join as S } from "path";
|
|
7
|
-
import { pathToFileURL as H } from "url";
|
|
8
|
-
import { tmpdir as G } from "os";
|
|
9
|
-
import { compareLocalRemote as j } from "js-sync-tools";
|
|
10
|
-
import { uploadedFileMetadata as J } from "js-file-metadata-helpers";
|
|
11
|
-
import { qaecyPrefixes as K } from "js/prefixes";
|
|
12
|
-
let N = null, I = null;
|
|
13
|
-
async function W() {
|
|
14
|
-
const u = S(__dirname, "assets", "wasm"), t = await b(S(u, "dir_scanner_wasm_bg.wasm")), e = await import(H(S(u, "dir_scanner_wasm.mjs")).href);
|
|
15
|
-
await e.default({ module_or_path: t }), N = e.scan;
|
|
16
|
-
}
|
|
17
|
-
const Y = "fuseki", Q = "/triplestore/query", V = "/sparql/query", X = "/triplestore/update", Z = "/sparql/update", tt = "/commands/file-system-structure/batch", O = 1e3, F = "cue:pending:";
|
|
18
|
-
function v(u) {
|
|
19
|
-
return S(G(), `cue-sync-pending-${u}.json`);
|
|
20
|
-
}
|
|
21
|
-
async function R(u) {
|
|
22
|
-
if (typeof window < "u") {
|
|
23
|
-
const t = window.localStorage.getItem(`${F}${u}`);
|
|
24
|
-
return t ? JSON.parse(t) : null;
|
|
25
|
-
}
|
|
26
|
-
try {
|
|
27
|
-
const t = await b(v(u), "utf-8");
|
|
28
|
-
return JSON.parse(t);
|
|
29
|
-
} catch {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
async function q(u) {
|
|
34
|
-
const t = JSON.stringify(u);
|
|
35
|
-
if (typeof window < "u") {
|
|
36
|
-
window.localStorage.setItem(`${F}${u.spaceId}`, t);
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
await L(v(u.spaceId), t, "utf-8");
|
|
40
|
-
}
|
|
41
|
-
async function et(u) {
|
|
42
|
-
if (typeof window < "u") {
|
|
43
|
-
window.localStorage.removeItem(`${F}${u}`);
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
try {
|
|
47
|
-
await k(v(u));
|
|
48
|
-
} catch {
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
class it {
|
|
52
|
-
constructor(t, o, e, n) {
|
|
53
|
-
this._auth = t, this._projects = o, this._blob = e, this._gatewayUrl = n;
|
|
54
|
-
}
|
|
55
|
-
_auth;
|
|
56
|
-
_projects;
|
|
57
|
-
_blob;
|
|
58
|
-
_gatewayUrl;
|
|
59
|
-
_graphMap = /* @__PURE__ */ new Map();
|
|
60
|
-
_api;
|
|
61
|
-
_pendingItems = [];
|
|
62
|
-
_pendingSpaceId = null;
|
|
63
|
-
_flushTimer = null;
|
|
64
|
-
/** @internal Injected by CueApi after construction to avoid circular dependency. */
|
|
65
|
-
_bindApi(t) {
|
|
66
|
-
this._api = t;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Flushes any pending metadata items from a previous interrupted sync.
|
|
70
|
-
* Safe to call even when there is nothing new to upload.
|
|
71
|
-
*/
|
|
72
|
-
async flushPendingMetadata(t, o) {
|
|
73
|
-
const e = await this._auth.getToken();
|
|
74
|
-
if (!e) throw new Error("Not authenticated. Call cue.auth.signIn() first.");
|
|
75
|
-
const n = await R(t);
|
|
76
|
-
if (!(!n || n.items.length === 0)) {
|
|
77
|
-
console.info(`Trying to upload metadata (${n.items.length} item(s))...`), o && console.info(`Flushing ${n.items.length} pending file location(s) from previous sync ⏳`);
|
|
78
|
-
try {
|
|
79
|
-
this._pendingSpaceId = t, this._pendingItems = [], await this._flushBatch(n.items, t, e, o), console.info("Metadata uploaded ✅");
|
|
80
|
-
} catch (s) {
|
|
81
|
-
throw new Error(`METADATA_SYNC_FAILED: ${s instanceof Error ? s.message : String(s)}`);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Returns a preview of what would be synced: cost breakdown for new files only,
|
|
87
|
-
* units required, and units still available. Use this before calling {@link sync}
|
|
88
|
-
* to show the user an accurate cost estimate.
|
|
89
|
-
*/
|
|
90
|
-
async previewSync(t, o) {
|
|
91
|
-
const { spaceId: e, providerId: n, verbose: s } = o, i = await this._auth.getToken();
|
|
92
|
-
if (!i) throw new Error("Not authenticated. Call cue.auth.signIn() first.");
|
|
93
|
-
const r = await this._getOrCreateGraph(e, i), c = (await this._projects.getProject(e))?.projectSettings?.tier ?? "l", [p, g, m, C] = await Promise.all([
|
|
94
|
-
this._listRemoteFiles(r, e, n, s),
|
|
95
|
-
this._api?.getConsumption(e, c) ?? Promise.reject(new Error("CueSyncApi is not bound to a CueApi instance")),
|
|
96
|
-
this._fetchUnitCreditMap(s),
|
|
97
|
-
this._fetchTierNames()
|
|
98
|
-
]), l = (await j(t, p)).localNotOnRemote ?? [], _ = l.length > 0 ? await this.scanCost(l) : [];
|
|
99
|
-
let w = 0, y = 0;
|
|
100
|
-
for (const f of _) {
|
|
101
|
-
w += f.units;
|
|
102
|
-
const E = m[c], h = E?.[f.ext] ?? 1;
|
|
103
|
-
s && E && !(f.ext in E) && console.info(` Unknown format: .${f.ext} (using default rate of 1 credit/unit)`);
|
|
104
|
-
const d = f.units * h;
|
|
105
|
-
y += d, f.credits = Math.round(d);
|
|
106
|
-
}
|
|
107
|
-
const P = C[c] ?? c;
|
|
108
|
-
return {
|
|
109
|
-
costRecords: _,
|
|
110
|
-
tier: c,
|
|
111
|
-
tierName: P,
|
|
112
|
-
unitsToConsume: w,
|
|
113
|
-
creditsToConsume: Math.round(y),
|
|
114
|
-
creditsAvailable: g.creditsAvailable,
|
|
115
|
-
unitsAvailable: g.unitsAvailable,
|
|
116
|
-
filesToUpload: l.length,
|
|
117
|
-
totalLocalFiles: t.length
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
async sync(t, o) {
|
|
121
|
-
const { spaceId: e, providerId: n, userId: s, verbose: i, onProgress: r } = o, a = await this._auth.getToken();
|
|
122
|
-
if (!a) throw new Error("Not authenticated. Call cue.auth.signIn() first.");
|
|
123
|
-
const c = await this._getOrCreateGraph(e, a);
|
|
124
|
-
i && console.info("Listing remote files ⏳");
|
|
125
|
-
const g = (await this._projects.getProject(e))?.projectSettings?.tier ?? "l", [m, C] = await Promise.all([
|
|
126
|
-
this._listRemoteFiles(c, e, n, i),
|
|
127
|
-
this._api?.getConsumption(e, g) ?? Promise.reject(new Error("CueSyncApi is not bound to a CueApi instance"))
|
|
128
|
-
]), { unitsAvailable: T } = C, l = await j(t, m);
|
|
129
|
-
i && (console.info(`Total local files: ${t.length}`), console.info(`Total remote files: ${m.length}`), console.info(
|
|
130
|
-
`Total files to sync: ${(l.localNotOnRemote?.length ?? 0) + l.localNotOnRemotePathOnly.length}`
|
|
131
|
-
));
|
|
132
|
-
let _ = l.syncCount, w = l.syncSize, y = 0, P = !1;
|
|
133
|
-
const f = l.localNotOnRemote ?? [];
|
|
134
|
-
if (f.length > 0) {
|
|
135
|
-
const d = (await this.scanCost(f)).reduce(($, M) => $ + M.units, 0);
|
|
136
|
-
if (d > T)
|
|
137
|
-
throw new Error(
|
|
138
|
-
`Insufficient units: ${d} units required but only ${T} available.`
|
|
139
|
-
);
|
|
140
|
-
}
|
|
141
|
-
await this._initPendingBatch(e, a, i), i && f.length && console.info("Syncing missing files ⏳");
|
|
142
|
-
for (const h of f)
|
|
143
|
-
try {
|
|
144
|
-
const d = J(
|
|
145
|
-
h.relativePath,
|
|
146
|
-
e,
|
|
147
|
-
s,
|
|
148
|
-
h.md5,
|
|
149
|
-
n
|
|
150
|
-
);
|
|
151
|
-
if (!d.blob_name) throw new Error(`blob_name missing for ${h.relativePath}`);
|
|
152
|
-
const $ = await b(h.fullPath);
|
|
153
|
-
await this._blob.uploadRaw(
|
|
154
|
-
d.blob_name,
|
|
155
|
-
new Uint8Array($),
|
|
156
|
-
d
|
|
157
|
-
), await this._queueFileLocation({
|
|
158
|
-
relativePath: h.relativePath,
|
|
159
|
-
md5: h.md5,
|
|
160
|
-
size: h.size,
|
|
161
|
-
providerId: n,
|
|
162
|
-
fileContentExists: !1
|
|
163
|
-
}), P = !0, _ += 1, w += h.size || 0, this._logProgress(_, l.totalCount, w, l.totalSize, r);
|
|
164
|
-
} catch (d) {
|
|
165
|
-
y += 1, console.error(`[CueSyncApi] Failed to upload file: ${h.fullPath}`), i && console.error("[CueSyncApi] Upload error details:", d);
|
|
166
|
-
}
|
|
167
|
-
i && l.localNotOnRemotePathOnly.length && console.info(`Syncing missing file locations (on provider "${n}") ⏳`);
|
|
168
|
-
for (const h of l.localNotOnRemotePathOnly)
|
|
169
|
-
await this._queueFileLocation({
|
|
170
|
-
relativePath: h.relativePath,
|
|
171
|
-
md5: h.md5,
|
|
172
|
-
size: h.size,
|
|
173
|
-
providerId: n,
|
|
174
|
-
fileContentExists: !0
|
|
175
|
-
}), P = !0, _ += 1, w += h.size || 0, this._logProgress(_, l.totalCount, w, l.totalSize, r);
|
|
176
|
-
await this._drainPending(i), this._stopFlushTimer();
|
|
177
|
-
const E = await (this._api?.getConsumption(e, g) ?? Promise.resolve({ creditsAvailable: 0 }));
|
|
178
|
-
return {
|
|
179
|
-
syncCount: _,
|
|
180
|
-
syncSize: w,
|
|
181
|
-
failedUploads: y,
|
|
182
|
-
totalCount: l.totalCount,
|
|
183
|
-
totalSize: l.totalSize,
|
|
184
|
-
rdfWritten: P,
|
|
185
|
-
creditsAvailable: E.creditsAvailable
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
|
-
async _getOrCreateGraph(t, o) {
|
|
189
|
-
const e = this._graphMap.get(t);
|
|
190
|
-
if (e) return e;
|
|
191
|
-
const s = (await this._projects.getProject(t))?.projectSettings?.graph?.type ?? Y, i = s === "qlever" ? `${this._gatewayUrl}${V}` : `${this._gatewayUrl}${Q}`, r = s === "qlever" ? `${this._gatewayUrl}${Z}` : `${this._gatewayUrl}${X}`, a = new B({
|
|
192
|
-
graphType: s,
|
|
193
|
-
queryEndpoint: i,
|
|
194
|
-
updateEndpoint: r,
|
|
195
|
-
originalHeaders: {
|
|
196
|
-
"x-project-id": t,
|
|
197
|
-
authorization: `Bearer ${o}`
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
return this._graphMap.set(t, a), a;
|
|
201
|
-
}
|
|
202
|
-
async _listRemoteFiles(t, o, e, n) {
|
|
203
|
-
n && console.info(`Listing files in raw space: ${o}`);
|
|
204
|
-
const s = Promise.race([
|
|
205
|
-
this._getGraphFiles(t, e),
|
|
206
|
-
new Promise(
|
|
207
|
-
(c, p) => setTimeout(() => p(new Error("GRAPH_TIMEOUT: Knowledge graph query timed out")), 15e3)
|
|
208
|
-
)
|
|
209
|
-
]), [i, r] = await Promise.all([
|
|
210
|
-
this._blob.listRaw(o),
|
|
211
|
-
s
|
|
212
|
-
]);
|
|
213
|
-
n && console.info(`Found ${i.length} files in raw store for space: ${o}`);
|
|
214
|
-
const a = [];
|
|
215
|
-
for (const c of i) {
|
|
216
|
-
const p = c.substring(0, 36), g = r[p] ?? [];
|
|
217
|
-
if (g.length === 0)
|
|
218
|
-
n && console.warn(`No location data found for contentUUID: ${p}`), a.push({ contentUUID: p });
|
|
219
|
-
else
|
|
220
|
-
for (const m of g)
|
|
221
|
-
a.push({
|
|
222
|
-
contentUUID: p,
|
|
223
|
-
locationUUID: m.locationUUID,
|
|
224
|
-
created: m.created,
|
|
225
|
-
size: m.size
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
return a;
|
|
229
|
-
}
|
|
230
|
-
async _getGraphFiles(t, o) {
|
|
231
|
-
const e = `PREFIX qcy: <${K.qcy}>
|
|
232
|
-
SELECT ?fc ?loc ?created ?fp ?size
|
|
233
|
-
WHERE {
|
|
234
|
-
?fc a qcy:FileContent ;
|
|
235
|
-
qcy:sizeBytes ?size ;
|
|
236
|
-
qcy:hasFileLocation ?loc .
|
|
237
|
-
?loc qcy:remoteProviderId "${o}" ;
|
|
238
|
-
qcy:dateCreated ?created ;
|
|
239
|
-
qcy:filePath ?fp .
|
|
240
|
-
}`, n = await t.query(e, "application/sparql-results+json"), s = {};
|
|
241
|
-
if (typeof n == "string") return s;
|
|
242
|
-
for (const i of n.results.bindings) {
|
|
243
|
-
const r = i.loc.value.split("/").at(-1) ?? "", a = i.fc.value.split("/").at(-1) ?? "", c = i.created.value, p = i.size.value;
|
|
244
|
-
s[a] || (s[a] = []), s[a].push({ locationUUID: r, created: c, size: p });
|
|
245
|
-
}
|
|
246
|
-
return s;
|
|
247
|
-
}
|
|
248
|
-
async _initPendingBatch(t, o, e) {
|
|
249
|
-
this._pendingSpaceId = t, this._pendingItems = [];
|
|
250
|
-
const n = await R(t);
|
|
251
|
-
if (n && n.items.length > 0) {
|
|
252
|
-
console.info(`Trying to upload metadata from interrupted sync (${n.items.length} item(s))...`), e && console.info(`Flushing ${n.items.length} pending file location(s) from previous sync ⏳`);
|
|
253
|
-
try {
|
|
254
|
-
await this._flushBatch(n.items, t, o, e), console.info("Metadata uploaded ✅");
|
|
255
|
-
} catch (i) {
|
|
256
|
-
throw new Error(`METADATA_SYNC_FAILED: ${i instanceof Error ? i.message : String(i)}`);
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
const s = setInterval(() => {
|
|
260
|
-
this._drainPending(e).catch(
|
|
261
|
-
(i) => console.error("[CueSyncApi] Periodic flush failed:", i)
|
|
262
|
-
);
|
|
263
|
-
}, 6e4);
|
|
264
|
-
typeof s == "object" && typeof s.unref == "function" && s.unref(), this._flushTimer = s;
|
|
265
|
-
}
|
|
266
|
-
async _queueFileLocation(t) {
|
|
267
|
-
this._pendingItems.push(t), this._pendingSpaceId && await q({ spaceId: this._pendingSpaceId, items: this._pendingItems });
|
|
268
|
-
}
|
|
269
|
-
async _drainPending(t) {
|
|
270
|
-
if (!this._pendingSpaceId || this._pendingItems.length === 0) return;
|
|
271
|
-
const o = await this._auth.getToken();
|
|
272
|
-
o && await this._flushBatch(this._pendingItems, this._pendingSpaceId, o, t);
|
|
273
|
-
}
|
|
274
|
-
async _flushBatch(t, o, e, n) {
|
|
275
|
-
const s = [...t];
|
|
276
|
-
this._pendingSpaceId === o && (this._pendingItems = []), await et(o);
|
|
277
|
-
try {
|
|
278
|
-
for (let i = 0; i < s.length; i += O)
|
|
279
|
-
await this._postFssBatch(s.slice(i, i + O), o, e);
|
|
280
|
-
n && console.info(`Wrote ${s.length} file location(s) to commands API ✅`);
|
|
281
|
-
} catch (i) {
|
|
282
|
-
const r = [...s, ...this._pendingItems];
|
|
283
|
-
throw this._pendingItems = r, await q({ spaceId: o, items: r }), i;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
async _postFssBatch(t, o, e) {
|
|
287
|
-
const n = new AbortController(), s = setTimeout(() => n.abort(), 15e3);
|
|
288
|
-
let i;
|
|
289
|
-
try {
|
|
290
|
-
i = await fetch(`${this._gatewayUrl}${tt}`, {
|
|
291
|
-
method: "POST",
|
|
292
|
-
headers: {
|
|
293
|
-
Authorization: `Bearer ${e}`,
|
|
294
|
-
"Content-Type": "application/json",
|
|
295
|
-
"x-project-id": o
|
|
296
|
-
},
|
|
297
|
-
body: JSON.stringify({ items: t }),
|
|
298
|
-
signal: n.signal
|
|
299
|
-
});
|
|
300
|
-
} catch (r) {
|
|
301
|
-
const a = r instanceof Error && r.name === "AbortError";
|
|
302
|
-
throw new Error(`File structure batch POST failed: ${a ? "request timed out" : r instanceof Error ? r.message : String(r)}`);
|
|
303
|
-
} finally {
|
|
304
|
-
clearTimeout(s);
|
|
305
|
-
}
|
|
306
|
-
if (!i.ok) {
|
|
307
|
-
const r = await i.text().catch(() => "");
|
|
308
|
-
throw new Error(`File structure batch POST failed: ${i.status} ${i.statusText}${r ? ` — ${r}` : ""}`);
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
_stopFlushTimer() {
|
|
312
|
-
this._flushTimer !== null && (clearInterval(this._flushTimer), this._flushTimer = null);
|
|
313
|
-
}
|
|
314
|
-
/**
|
|
315
|
-
* Scans `localFiles` and returns a per-extension cost breakdown.
|
|
316
|
-
*
|
|
317
|
-
* Each {@link ScanOutputRecord} contains `units` — the billable metric for
|
|
318
|
-
* that extension (e.g. pages for PDFs, rows for spreadsheets) — which can be
|
|
319
|
-
* shown to the user before or after calling {@link sync}.
|
|
320
|
-
*/
|
|
321
|
-
async scanCost(t) {
|
|
322
|
-
if (I || (I = W()), await I, !N) throw new Error("WASM scan function not initialised");
|
|
323
|
-
const o = 200, e = /* @__PURE__ */ new Map();
|
|
324
|
-
for (let n = 0; n < t.length; n += o) {
|
|
325
|
-
const s = t.slice(n, n + o), i = await Promise.all(
|
|
326
|
-
s.map(async (a) => ({
|
|
327
|
-
originalPath: a.relativePath,
|
|
328
|
-
data: new Uint8Array(await b(a.fullPath))
|
|
329
|
-
}))
|
|
330
|
-
), r = N(i);
|
|
331
|
-
for (const a of r) {
|
|
332
|
-
const c = e.get(a.ext);
|
|
333
|
-
c ? (c.count += a.count, c.units += a.units, c.sizeMb += a.sizeMb) : e.set(a.ext, { ...a });
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
return Array.from(e.values());
|
|
337
|
-
}
|
|
338
|
-
async _fetchTierNames() {
|
|
339
|
-
try {
|
|
340
|
-
const t = await this._blob.downloadPublic("tier-names.json");
|
|
341
|
-
return JSON.parse(t);
|
|
342
|
-
} catch {
|
|
343
|
-
return {};
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
async _fetchUnitCreditMap(t) {
|
|
347
|
-
let o;
|
|
348
|
-
try {
|
|
349
|
-
o = await this._blob.downloadPublic("unit-credit.json");
|
|
350
|
-
} catch (e) {
|
|
351
|
-
throw new Error(`Couldn't fetch credits table: ${e instanceof Error ? e.message : String(e)}`);
|
|
352
|
-
}
|
|
353
|
-
t && console.info(`Price file: ${o.length} bytes`);
|
|
354
|
-
try {
|
|
355
|
-
return JSON.parse(o);
|
|
356
|
-
} catch {
|
|
357
|
-
throw new Error(`Credits table is not valid JSON (${o.length} bytes)`);
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
_logProgress(t, o, e, n, s) {
|
|
361
|
-
if (!s || o === 0) return;
|
|
362
|
-
const i = Math.floor(t / o * 100);
|
|
363
|
-
s({ percent: i, syncCount: t, totalCount: o, syncSize: e, totalSize: n });
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
const ot = "spaces_raw_eu_west6", nt = "spaces_processed_eu_west6", st = "cue_public_eu_west6";
|
|
367
|
-
class mt extends z {
|
|
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-BIvMahsX.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-BIvMahsX.js";
|
|
3
|
+
import { getStorage as s, connectStorageEmulator as o } from "firebase/storage";
|
|
4
|
+
import "firebase/firestore";
|
|
5
|
+
class w extends _ {
|
|
368
6
|
constructor(t) {
|
|
369
7
|
super(t);
|
|
370
8
|
}
|
|
371
9
|
_buildApi(t) {
|
|
372
|
-
const
|
|
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);
|
|
373
11
|
if (this._isEmulator) {
|
|
374
|
-
const
|
|
375
|
-
|
|
376
|
-
}
|
|
377
|
-
const
|
|
378
|
-
|
|
12
|
+
const e = this._endpoints.storageEmulatorHost, a = this._endpoints.storageEmulatorPort;
|
|
13
|
+
o(i, e, a), o(r, e, a), o(n, e, a);
|
|
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(
|
|
23
|
+
this.auth,
|
|
24
|
+
t,
|
|
25
|
+
h,
|
|
26
|
+
this._endpoints.gatewayUrl
|
|
27
|
+
), u = new R(
|
|
28
|
+
this.auth,
|
|
29
|
+
this._endpoints.gatewayUrl,
|
|
30
|
+
t,
|
|
31
|
+
c
|
|
32
|
+
);
|
|
33
|
+
return c._bindApi(u), u;
|
|
379
34
|
}
|
|
380
35
|
}
|
|
381
36
|
export {
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
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,
|
|
46
|
+
H as CueProjectSchema,
|
|
47
|
+
N as CueProjectView,
|
|
48
|
+
W as CueProjects,
|
|
49
|
+
v as CueSignal,
|
|
50
|
+
U as CueSyncApi,
|
|
51
|
+
k as REQUIRED_ROLES,
|
|
52
|
+
q as configureScanWasm,
|
|
53
|
+
G as cueComputed,
|
|
54
|
+
Q as staleWhileRevalidate
|
|
389
55
|
};
|
package/package.json
CHANGED
package/variables.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default Firebase configuration for the QAECY SDK demo app ("sdk-default").
|
|
3
|
+
* These are safe to use for evaluation and development purposes.
|
|
4
|
+
* For production use, obtain your own configuration from QAECY.
|
|
5
|
+
*/
|
|
6
|
+
export declare const DEFAULT_SDK_CONFIG: {
|
|
7
|
+
readonly apiKey: "AIzaSyAiW42QBx9HS4Khu88pCW7MV66IhBAQul0";
|
|
8
|
+
readonly appId: "1:151132927589:web:d2ffdb377dfadfd23ab88c";
|
|
9
|
+
readonly measurementId: "G-YT4PK6HGZD";
|
|
10
|
+
};
|
|
11
|
+
export declare const FIREBASE_PROJECT_ID = "qaecy-mvp-406413";
|
|
12
|
+
export declare const FIREBASE_SENDER_ID = "734737865998";
|
|
13
|
+
export declare const GCP_REGION = "europe-west6";
|
|
14
|
+
export declare const COLLECTION_API_KEYS = "apiKeys";
|
|
15
|
+
export declare const COLLECTION_ORGANIZATIONS = "organizations";
|
|
16
|
+
export declare const COLLECTION_PROJECTS = "projects";
|
|
17
|
+
export declare const BUCKET_CHAT_SESSIONS = "spaces_chats_eu_west6";
|
|
18
|
+
export declare const BUCKET_RAW = "spaces_raw_eu_west6";
|
|
19
|
+
export declare const BUCKET_PROCESSED = "spaces_processed_eu_west6";
|
|
20
|
+
export declare const BUCKET_LOGS = "spaces_logs_eu_west6";
|
|
21
|
+
export declare const BUCKET_PUBLIC = "cue_public_eu_west6";
|
|
22
|
+
export declare const BUCKET_PERSISTENCE = "db_persistence_eu_west6";
|
|
23
|
+
export declare const ENDPOINT_CONSUMPTION = "/data-views/admin/consumption";
|
|
24
|
+
export declare const ENDPOINT_PROFILE_ORGANIZATIONS = "/data-views/admin/profile/organizations";
|
|
25
|
+
export declare const ENDPOINT_PROFILE_API_KEYS = "/data-views/admin/profile/api-keys";
|
|
26
|
+
export declare const ENDPOINT_ORG_MEMBERS: (orgId: string) => string;
|
|
27
|
+
export declare const ENDPOINT_CREATE_PROJECT = "/commands/admin/project";
|
|
28
|
+
export declare const ENDPOINT_SEARCH = "/assistant/search";
|
|
29
|
+
export declare const ENDPOINT_FUSEKI_QUERY = "/triplestore/query";
|
|
30
|
+
export declare const ENDPOINT_FUSEKI_UPDATE = "/triplestore/update";
|
|
31
|
+
export declare const ENDPOINT_QLEVER_QUERY = "/qlever-server/qlever/query";
|
|
32
|
+
export declare const ENDPOINT_QLEVER_UPDATE = "/qlever-server/qlever/update";
|
|
33
|
+
export declare const ENDPOINT_FSS_BATCH = "/commands/file-system-structure/batch";
|
|
34
|
+
export declare const MICROSOFT_PROVIDER_ID = "microsoft.com";
|
|
35
|
+
export declare const SUPERADMIN_ROLE = "superadmin";
|
|
36
|
+
/**
|
|
37
|
+
* Base URL for all RDF resource IRIs: `https://cue.qaecy.com/r/{projectId}/{entityUUID}`.
|
|
38
|
+
* Entity IRIs are constructed as `${RESOURCE_BASE}${projectId}/${uuid}`.
|
|
39
|
+
*/
|
|
40
|
+
export declare const RESOURCE_BASE = "https://cue.qaecy.com/r/";
|