@qaecy/cue-sdk 0.0.26 → 0.0.27
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 +31 -0
- package/{cue-BjbRXItA.js → cue-CzxsQ6aP.js} +284 -238
- package/index.d.ts +2 -0
- package/index.js +17 -16
- package/lib/api.d.ts +3 -0
- package/lib/auth.d.ts +2 -0
- package/lib/extraction.d.ts +48 -0
- package/node.js +19 -18
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -23,3 +23,5 @@ export type { CueSdkConfig, SsoProvider, PasswordCredentials, SearchRequest, Sea
|
|
|
23
23
|
export type { AuthStateListener, Unsubscribe } from './lib/auth';
|
|
24
24
|
export { CueTables } from './lib/tables';
|
|
25
25
|
export type { ProjectTable } from './lib/tables';
|
|
26
|
+
export { CueExtraction } from './lib/extraction';
|
|
27
|
+
export type { ExtractionRequest, ExtractionResponse } from './lib/extraction';
|
package/index.js
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { C as s, a as u, b as C, c as
|
|
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-CzxsQ6aP.js";
|
|
2
2
|
export {
|
|
3
3
|
s as Cue,
|
|
4
4
|
u as CueApi,
|
|
5
5
|
C as CueAuth,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
c as
|
|
9
|
-
o as
|
|
10
|
-
r as
|
|
11
|
-
l as
|
|
12
|
-
n as
|
|
13
|
-
P as
|
|
14
|
-
j as
|
|
15
|
-
m as
|
|
16
|
-
S as
|
|
17
|
-
g as
|
|
18
|
-
h as
|
|
19
|
-
p as
|
|
6
|
+
t as CueCache,
|
|
7
|
+
i as CueExtraction,
|
|
8
|
+
c as CueGis,
|
|
9
|
+
o as CuePrivileges,
|
|
10
|
+
r as CueProfile,
|
|
11
|
+
l as CueProjectDocuments,
|
|
12
|
+
n as CueProjectEntities,
|
|
13
|
+
P as CueProjectSchema,
|
|
14
|
+
j as CueProjectView,
|
|
15
|
+
m as CueProjects,
|
|
16
|
+
S as CueSignal,
|
|
17
|
+
g as CueStorage,
|
|
18
|
+
h as CueSyncApi,
|
|
19
|
+
p as CueTables,
|
|
20
|
+
E as REQUIRED_ROLES,
|
|
20
21
|
R as configureScanWasm,
|
|
21
22
|
f as cueComputed,
|
|
22
|
-
|
|
23
|
+
d as staleWhileRevalidate
|
|
23
24
|
};
|
package/lib/api.d.ts
CHANGED
|
@@ -3,12 +3,15 @@ import { SearchRequest, SearchResponse, ShaclValidationReport, UnitsConsumedDto
|
|
|
3
3
|
import { CueProjects } from './project';
|
|
4
4
|
import { CueSyncApi } from './sync';
|
|
5
5
|
import { CueTables } from './tables';
|
|
6
|
+
import { CueExtraction } from './extraction';
|
|
6
7
|
export declare class CueApi {
|
|
7
8
|
private readonly _auth;
|
|
8
9
|
private readonly _gatewayUrl;
|
|
9
10
|
readonly projects: CueProjects;
|
|
10
11
|
readonly sync?: CueSyncApi | undefined;
|
|
11
12
|
readonly tables: CueTables;
|
|
13
|
+
/** Semantic extraction client — call document pages against a SemanticTemplate. */
|
|
14
|
+
readonly extraction: CueExtraction;
|
|
12
15
|
/** Active language used for language-sensitive SPARQL queries across all project classes. */
|
|
13
16
|
language: string;
|
|
14
17
|
/** Updates the active language. All project classes (`CueProjectSchema`, `CueProjectDocuments`, `CueProjectEntities`) read this at query time. */
|
package/lib/auth.d.ts
CHANGED
|
@@ -47,6 +47,8 @@ export declare class CueAuth {
|
|
|
47
47
|
checkSuperAdmin(): Promise<boolean>;
|
|
48
48
|
/** Sign in with a Cue API key. `projectId` is optional — omit it when no project context is available (e.g. admin flows). */
|
|
49
49
|
signInWithApiKey(cueApiKey: string, projectId?: string): Promise<User>;
|
|
50
|
+
/** Sign in with a Firebase custom token (e.g. minted server-side for MCP/OAuth flows). */
|
|
51
|
+
signInWithCustomToken(token: string): Promise<User>;
|
|
50
52
|
/** Sign out the current user */
|
|
51
53
|
signOut(): Promise<void>;
|
|
52
54
|
/**
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { CueAuth } from './auth';
|
|
2
|
+
export declare const ENDPOINT_EXTRACTION = "/semantic-extraction/extract";
|
|
3
|
+
export interface ExtractionRequest {
|
|
4
|
+
/** PNG (or other image) blob of the document page to extract from. */
|
|
5
|
+
image: Blob;
|
|
6
|
+
/** SemanticTemplate JSON object. */
|
|
7
|
+
template: object;
|
|
8
|
+
/** Project / space ID used by the extraction service. */
|
|
9
|
+
projectId: string;
|
|
10
|
+
/** IRI of the pre-selected content category; omit to let the model classify. */
|
|
11
|
+
category?: string | null;
|
|
12
|
+
/** Plain text of the page, used as additional context. */
|
|
13
|
+
text?: string | null;
|
|
14
|
+
/** Desired RDF serialisation — defaults to `'json-ld'`. */
|
|
15
|
+
rdfFormat?: 'json-ld' | 'turtle' | 'ntriples' | 'xml';
|
|
16
|
+
}
|
|
17
|
+
export interface ExtractionResponse {
|
|
18
|
+
/** Parsed JSON-LD document ready for `cue-rdf-graph`. */
|
|
19
|
+
jsonld: object;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Client for the Cue semantic-extraction endpoint.
|
|
23
|
+
*
|
|
24
|
+
* Exposed as `cue.api.extraction`.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const result = await cue.api.extraction.extract({
|
|
29
|
+
* image: pngBlob,
|
|
30
|
+
* template: myTemplate,
|
|
31
|
+
* projectId: 'my-project',
|
|
32
|
+
* });
|
|
33
|
+
* // result.jsonld is a JSON-LD document for cue-rdf-graph
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare class CueExtraction {
|
|
37
|
+
private readonly _auth;
|
|
38
|
+
private readonly _gatewayUrl;
|
|
39
|
+
constructor(_auth: CueAuth, _gatewayUrl: string);
|
|
40
|
+
/**
|
|
41
|
+
* Run semantic extraction on a document page image.
|
|
42
|
+
*
|
|
43
|
+
* Sends a multipart/form-data POST to `/semantic-extraction/extract`.
|
|
44
|
+
* Always requests JSON-LD so the result can be displayed directly in
|
|
45
|
+
* `cue-rdf-graph` without any further parsing.
|
|
46
|
+
*/
|
|
47
|
+
extract(request: ExtractionRequest): Promise<ExtractionResponse>;
|
|
48
|
+
}
|
package/node.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { C as h, B as l,
|
|
2
|
-
import { b as j, c as
|
|
3
|
-
import { getStorage as
|
|
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-CzxsQ6aP.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-CzxsQ6aP.js";
|
|
3
|
+
import { getStorage as t, connectStorageEmulator as w } from "firebase/storage";
|
|
4
4
|
import "firebase/firestore";
|
|
5
5
|
class A extends h {
|
|
6
6
|
constructor(s) {
|
|
7
7
|
super(s);
|
|
8
8
|
}
|
|
9
9
|
_buildApi(s) {
|
|
10
|
-
const r =
|
|
10
|
+
const r = t(this._app, l), i = t(this._app, _), n = this._storageRaw, u = t(this._app, E), c = this._storageProcessed, e = t(this._app, S);
|
|
11
11
|
if (this._isEmulator) {
|
|
12
12
|
const p = this._endpoints.storageEmulatorHost, g = this._endpoints.storageEmulatorPort;
|
|
13
|
-
|
|
13
|
+
w(e, p, g);
|
|
14
14
|
}
|
|
15
15
|
const C = new P({
|
|
16
16
|
storageChatSessions: r,
|
|
@@ -18,7 +18,7 @@ class A extends h {
|
|
|
18
18
|
storageRaw: n,
|
|
19
19
|
storagePersistence: u,
|
|
20
20
|
storageProcessed: c,
|
|
21
|
-
storagePublic:
|
|
21
|
+
storagePublic: e
|
|
22
22
|
}), a = new m(
|
|
23
23
|
this.auth,
|
|
24
24
|
s,
|
|
@@ -37,22 +37,23 @@ export {
|
|
|
37
37
|
h as Cue,
|
|
38
38
|
d as CueApi,
|
|
39
39
|
j as CueAuth,
|
|
40
|
-
|
|
40
|
+
x as CueCache,
|
|
41
|
+
y as CueExtraction,
|
|
41
42
|
I as CueGis,
|
|
42
43
|
A as CueNode,
|
|
43
44
|
K as CuePrivileges,
|
|
44
45
|
L as CueProfile,
|
|
45
46
|
v as CueProjectDocuments,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
H as CueProjectEntities,
|
|
48
|
+
N as CueProjectSchema,
|
|
49
|
+
O as CueProjectView,
|
|
50
|
+
D as CueProjects,
|
|
51
|
+
G as CueSignal,
|
|
52
|
+
W as CueStorage,
|
|
52
53
|
m as CueSyncApi,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
k as CueTables,
|
|
55
|
+
q as REQUIRED_ROLES,
|
|
56
|
+
Q as configureScanWasm,
|
|
57
|
+
V as cueComputed,
|
|
58
|
+
z as staleWhileRevalidate
|
|
58
59
|
};
|