@qaecy/cue-sdk 0.0.35 → 0.0.37
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/{document-filter-Dr_-QbaZ.js → document-filter-BNui_ucF.js} +1612 -1531
- package/index.d.ts +3 -1
- package/index.js +22 -21
- package/lib/api.d.ts +3 -0
- package/lib/dms.d.ts +39 -0
- package/lib/models.d.ts +33 -0
- package/lib/profile.d.ts +10 -1
- package/node.js +24 -23
- package/package.json +7 -1
- package/variables.d.ts +4 -0
package/index.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ export type { IndexSearchRequest, IndexItem, IndexSearchResponse, IndexFilterOpt
|
|
|
14
14
|
export { CueSyncApi, configureScanWasm } from './lib/sync';
|
|
15
15
|
export { CueProcessingApi } from './lib/processing';
|
|
16
16
|
export type { ProcessingStatusWatcher } from './lib/processing';
|
|
17
|
+
export { CueDmsApi } from './lib/dms';
|
|
18
|
+
export type { DmsProviderInfo, DmsRemoteFile, DmsSyncPreviewResponse } from './lib/models';
|
|
17
19
|
export { CueProjectSchema } from './lib/schema';
|
|
18
20
|
export { CueDocumentFilter } from './lib/document-filter';
|
|
19
21
|
export { CueProjectEntities } from './lib/entities';
|
|
@@ -30,7 +32,7 @@ export { CueCache } from './lib/cache';
|
|
|
30
32
|
export type { QueryCacheEntry } from './lib/cache';
|
|
31
33
|
export { CueCurrency, SUPPORTED_CURRENCIES, BASE_CURRENCY } from './lib/currency';
|
|
32
34
|
export type { SupportedCurrency, CurrencyRates } from './lib/currency';
|
|
33
|
-
export type { CueSdkConfig, SsoProvider, PasswordCredentials, SearchRequest, SearchResponse, SearchSource, SearchOptions, ProjectData, ProjectSettings, QleverStats, CreateProjectOptions, SyncOptions, SyncResult, SyncPreview, ScanOutputRecord, UnitCreditMap, UnitsConsumedDto, OrgCreditsDto, OrgPlanSummary, MonthlyConsumptionDto, ProjectConsumptionReportDto, OrgConsumptionReportDto, OrganizationData, OrgMember, ProfileSSOAccount, APIKeyInfo, APIKeyDoc, ProjectDoc, OrganizationDoc, UserDoc, UserSettings, CustomAppRecord, CustomAppWithHtml, CreateCustomAppOptions, UpdateCustomAppOptions, RDFWritingDoc, ProcessingStatus, ProcessingStage, ViewDefinition, QueryCache, LangMap, CategoryDef, RelationshipDef, EntityCoreData, EntityRelationship, EntityRelationships, MapGeometry, EntityDetailedData, ProjectEntitiesData, SummaryGraphData, DocumentInfo, DocumentSummary, ProjectDocumentsData, } from './lib/models';
|
|
35
|
+
export type { CueSdkConfig, SsoProvider, PasswordCredentials, SearchRequest, SearchResponse, SearchSource, SearchOptions, ProjectData, ProjectSettings, QleverStats, CreateProjectOptions, SyncOptions, SyncResult, SyncPreview, ScanOutputRecord, UnitCreditMap, UnitsConsumedDto, OrgCreditsDto, OrgPlanSummary, MonthlyConsumptionDto, ProjectConsumptionReportDto, OrgConsumptionReportDto, FileTypeConsumptionDto, FileTypeBreakdownDto, OrganizationData, OrgMember, ProfileSSOAccount, APIKeyInfo, APIKeyDoc, ProjectDoc, OrganizationDoc, UserDoc, UserSettings, CustomAppRecord, CustomAppWithHtml, CreateCustomAppOptions, UpdateCustomAppOptions, RDFWritingDoc, ProcessingStatus, ProcessingStage, ViewDefinition, QueryCache, LangMap, CategoryDef, RelationshipDef, EntityCoreData, EntityRelationship, EntityRelationships, MapGeometry, EntityDetailedData, ProjectEntitiesData, SummaryGraphData, DocumentInfo, DocumentSummary, ProjectDocumentsData, } from './lib/models';
|
|
34
36
|
export type { AuthStateListener, Unsubscribe } from './lib/auth';
|
|
35
37
|
export { CueTables } from './lib/tables';
|
|
36
38
|
export type { ProjectTable } from './lib/tables';
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as a, C as u,
|
|
1
|
+
import { B as a, C as u, a as C, b as t, c as r, d as i, e as c, f as o, g as n, h as p, i as E, j as S, k as A, l as P, m as R, n as g, o as m, p as D, q as j, r as l, s as U, t as x, u as f, v as h, w as d, x as y, y as I, z as _, A as b, D as q, R as v, S as w, E as B, F } from "./document-filter-BNui_ucF.js";
|
|
2
2
|
export {
|
|
3
3
|
a as BASE_CURRENCY,
|
|
4
4
|
u as Cue,
|
|
@@ -9,28 +9,29 @@ export {
|
|
|
9
9
|
c as CueCache,
|
|
10
10
|
o as CueContexts,
|
|
11
11
|
n as CueCurrency,
|
|
12
|
-
p as
|
|
13
|
-
E as
|
|
14
|
-
S as
|
|
12
|
+
p as CueDmsApi,
|
|
13
|
+
E as CueDocumentFilter,
|
|
14
|
+
S as CueExtraction,
|
|
15
|
+
A as CueGis,
|
|
15
16
|
P as CueIndexApi,
|
|
16
17
|
R as CueMcp,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
g as CuePrivileges,
|
|
19
|
+
m as CueProcessingApi,
|
|
20
|
+
D as CueProfile,
|
|
20
21
|
j as CueProjectDocuments,
|
|
21
22
|
l as CueProjectEntities,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
23
|
+
U as CueProjectSchema,
|
|
24
|
+
x as CueProjectView,
|
|
25
|
+
f as CueProjects,
|
|
26
|
+
h as CueRequestError,
|
|
27
|
+
d as CueSignUp,
|
|
28
|
+
y as CueSignal,
|
|
29
|
+
I as CueStorage,
|
|
30
|
+
_ as CueSyncApi,
|
|
31
|
+
b as CueTables,
|
|
32
|
+
q as CueUserSettings,
|
|
33
|
+
v as REQUIRED_ROLES,
|
|
34
|
+
w as SUPPORTED_CURRENCIES,
|
|
35
|
+
B as configureScanWasm,
|
|
36
|
+
F as cueComputed
|
|
36
37
|
};
|
package/lib/api.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { CueAppData } from './app-data';
|
|
|
11
11
|
import { CueApps } from './apps';
|
|
12
12
|
import { CueUserSettings } from './user-settings';
|
|
13
13
|
import { CueProcessingApi } from './processing';
|
|
14
|
+
import { CueDmsApi } from './dms';
|
|
14
15
|
export declare class CueApi {
|
|
15
16
|
private readonly _auth;
|
|
16
17
|
private readonly _gatewayUrl;
|
|
@@ -33,6 +34,8 @@ export declare class CueApi {
|
|
|
33
34
|
readonly userSettings: CueUserSettings;
|
|
34
35
|
/** Live pipeline-progress status for a project (upload → processing → loading → enrichment). */
|
|
35
36
|
readonly processing: CueProcessingApi;
|
|
37
|
+
/** Sync files into a project from a 3rd-party DMS (e.g. ThinkProject). */
|
|
38
|
+
readonly dms: CueDmsApi;
|
|
36
39
|
/** Active language used for language-sensitive SPARQL queries across all project classes. */
|
|
37
40
|
language: string;
|
|
38
41
|
/** Updates the active language. All project classes (`CueProjectSchema`, `CueProjectDocuments`, `CueProjectEntities`) read this at query time. */
|
package/lib/dms.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { CueAuth } from './auth';
|
|
2
|
+
import { DmsProviderInfo, DmsRemoteFile, DmsSyncPreviewResponse } from './models';
|
|
3
|
+
/**
|
|
4
|
+
* Sync files into a project from a 3rd-party Document Management System
|
|
5
|
+
* (e.g. ThinkProject). Credentials (externalProjectId/username/token) are
|
|
6
|
+
* never persisted — callers must re-supply them on every preview/confirm
|
|
7
|
+
* call. `token` is a user-generated personal access token, not a password.
|
|
8
|
+
*/
|
|
9
|
+
export declare class CueDmsApi {
|
|
10
|
+
private readonly _auth;
|
|
11
|
+
private readonly _gatewayUrl;
|
|
12
|
+
constructor(_auth: CueAuth, _gatewayUrl: string);
|
|
13
|
+
/** Lists the DMS providers this project can sync from. */
|
|
14
|
+
listSupportedProviders(): Promise<DmsProviderInfo[]>;
|
|
15
|
+
/**
|
|
16
|
+
* Fetches the file list from the DMS and diffs it against files already
|
|
17
|
+
* synced for this project+provider. Returns the delta for user confirmation
|
|
18
|
+
* — no bytes are downloaded and nothing is written yet.
|
|
19
|
+
*/
|
|
20
|
+
previewSync(providerId: string, projectId: string, params: {
|
|
21
|
+
externalProjectId: string;
|
|
22
|
+
username: string;
|
|
23
|
+
token: string;
|
|
24
|
+
}): Promise<DmsSyncPreviewResponse>;
|
|
25
|
+
/**
|
|
26
|
+
* Downloads and syncs the user-confirmed file subset from the DMS into
|
|
27
|
+
* this project's raw storage + graph.
|
|
28
|
+
*/
|
|
29
|
+
confirmSync(providerId: string, projectId: string, params: {
|
|
30
|
+
externalProjectId: string;
|
|
31
|
+
username: string;
|
|
32
|
+
token: string;
|
|
33
|
+
files: DmsRemoteFile[];
|
|
34
|
+
comment?: string;
|
|
35
|
+
}): Promise<{
|
|
36
|
+
success: boolean;
|
|
37
|
+
message: string;
|
|
38
|
+
}>;
|
|
39
|
+
}
|
package/lib/models.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SupportedCurrency } from './currency';
|
|
2
|
+
import { ComparisonResult } from 'js-sync-tools';
|
|
2
3
|
export type CueEnvironment = 'production' | 'emulator';
|
|
3
4
|
export interface CueEndpoints {
|
|
4
5
|
/** API gateway base URL */
|
|
@@ -35,6 +36,28 @@ export interface PasswordCredentials {
|
|
|
35
36
|
email: string;
|
|
36
37
|
password: string;
|
|
37
38
|
}
|
|
39
|
+
/** A supported 3rd-party DMS sync provider (e.g. ThinkProject). */
|
|
40
|
+
export interface DmsProviderInfo {
|
|
41
|
+
id: string;
|
|
42
|
+
label: string;
|
|
43
|
+
}
|
|
44
|
+
/** A file found in a 3rd-party DMS, as returned by a preview/dry-run sync. */
|
|
45
|
+
export interface DmsRemoteFile {
|
|
46
|
+
relativePath: string;
|
|
47
|
+
size: number;
|
|
48
|
+
/** Content checksum (e.g. md5), if the provider's listing exposes one. */
|
|
49
|
+
checksum?: string;
|
|
50
|
+
/** Opaque id used to fetch this file's bytes when confirming the sync. */
|
|
51
|
+
externalFileId: string;
|
|
52
|
+
modifiedAt?: string;
|
|
53
|
+
}
|
|
54
|
+
/** Result of previewing a DMS sync — the delta to show the user for confirmation. */
|
|
55
|
+
export interface DmsSyncPreviewResponse {
|
|
56
|
+
providerId: string;
|
|
57
|
+
filesToSync: DmsRemoteFile[];
|
|
58
|
+
filesAlreadySynced: DmsRemoteFile[];
|
|
59
|
+
totalRemoteCount: number;
|
|
60
|
+
}
|
|
38
61
|
export interface SearchRequest {
|
|
39
62
|
/** Natural language query or search term */
|
|
40
63
|
term: string;
|
|
@@ -254,6 +277,8 @@ export interface SyncPreview {
|
|
|
254
277
|
filesToUpload: number;
|
|
255
278
|
/** Total local files scanned */
|
|
256
279
|
totalLocalFiles: number;
|
|
280
|
+
/** Full local/remote comparison — file lists, path-only mismatches, sync stats */
|
|
281
|
+
report: ComparisonResult;
|
|
257
282
|
}
|
|
258
283
|
export interface SyncResult {
|
|
259
284
|
/** Number of files successfully synced in this run */
|
|
@@ -322,6 +347,14 @@ export interface ProjectConsumptionReportDto {
|
|
|
322
347
|
export interface OrgConsumptionReportDto {
|
|
323
348
|
projects: ProjectConsumptionReportDto[];
|
|
324
349
|
}
|
|
350
|
+
/** Consumption for one raw-file extension (lowercased, no leading dot; `'unknown'` if a file had none). */
|
|
351
|
+
export interface FileTypeConsumptionDto {
|
|
352
|
+
unitsConsumed: number;
|
|
353
|
+
creditsConsumed: number;
|
|
354
|
+
filesProcessed: number;
|
|
355
|
+
}
|
|
356
|
+
/** Per-file-extension breakdown for one project within a given period — see {@link CueProfile.getProjectFileTypeBreakdown}. */
|
|
357
|
+
export type FileTypeBreakdownDto = Record<string, FileTypeConsumptionDto>;
|
|
325
358
|
export interface ProfileSSOAccount {
|
|
326
359
|
id: string;
|
|
327
360
|
label: string;
|
package/lib/profile.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UserInfo } from 'firebase/auth';
|
|
2
2
|
import { FirebaseApp } from 'firebase/app';
|
|
3
|
-
import { APIKeyDoc, APIKeyInfo, OrgConsumptionReportDto, OrgCreditsDto, OrgMember, OrganizationData, ProfileSSOAccount } from './models';
|
|
3
|
+
import { APIKeyDoc, APIKeyInfo, FileTypeBreakdownDto, OrgConsumptionReportDto, OrgCreditsDto, OrgMember, OrganizationData, ProfileSSOAccount } from './models';
|
|
4
4
|
import { CueAuth } from './auth';
|
|
5
5
|
import { ReadonlySignal } from './signal';
|
|
6
6
|
export declare class CueProfile {
|
|
@@ -72,6 +72,15 @@ export declare class CueProfile {
|
|
|
72
72
|
* or superadmin.
|
|
73
73
|
*/
|
|
74
74
|
getOrgConsumptionReport(orgId: string): Promise<OrgConsumptionReportDto>;
|
|
75
|
+
/**
|
|
76
|
+
* Per-file-extension credit/unit breakdown for one project within `[from, to)` (UTC ISO 8601,
|
|
77
|
+
* `to` exclusive) — for a report drill-down (e.g. a monthly/yearly PDF export), not the
|
|
78
|
+
* regular monthly totals (use {@link getOrgConsumptionReport} for those). The backend
|
|
79
|
+
* recomputes this on every call by re-scanning the project's raw files — only call it when
|
|
80
|
+
* the user actually asks for a report, not on every page load. Caller must be an org admin
|
|
81
|
+
* or superadmin.
|
|
82
|
+
*/
|
|
83
|
+
getProjectFileTypeBreakdown(orgId: string, projectId: string, from: string, to: string): Promise<FileTypeBreakdownDto>;
|
|
75
84
|
/** Manual/support credit grant to an organisation's shared pool. Superadmins only — org admins self-serve via `startOrgCheckout`. */
|
|
76
85
|
topUpOrgCredits(orgId: string, amount: number): Promise<void>;
|
|
77
86
|
/**
|
package/node.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as s } from "./document-filter-
|
|
2
|
-
import { B as o,
|
|
1
|
+
import { C as s } from "./document-filter-BNui_ucF.js";
|
|
2
|
+
import { B as o, a as c, b as i, c as n, d as p, e as E, f as S, g as m, h as A, i as P, j as R, k as g, l, m as x, n as D, o as j, p as U, q as d, r as f, s as h, t as y, u as I, v as N, w as _, x as b, y as q, z as v, A as w, D as B, R as F, S as O, E as T, F as k } from "./document-filter-BNui_ucF.js";
|
|
3
3
|
class C extends s {
|
|
4
4
|
constructor(e) {
|
|
5
5
|
super(e);
|
|
@@ -14,29 +14,30 @@ export {
|
|
|
14
14
|
p as CueAuth,
|
|
15
15
|
E as CueCache,
|
|
16
16
|
S as CueContexts,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
g as
|
|
22
|
-
l as
|
|
17
|
+
m as CueCurrency,
|
|
18
|
+
A as CueDmsApi,
|
|
19
|
+
P as CueDocumentFilter,
|
|
20
|
+
R as CueExtraction,
|
|
21
|
+
g as CueGis,
|
|
22
|
+
l as CueIndexApi,
|
|
23
|
+
x as CueMcp,
|
|
23
24
|
C as CueNode,
|
|
24
|
-
|
|
25
|
+
D as CuePrivileges,
|
|
25
26
|
j as CueProcessingApi,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
27
|
+
U as CueProfile,
|
|
28
|
+
d as CueProjectDocuments,
|
|
29
|
+
f as CueProjectEntities,
|
|
30
|
+
h as CueProjectSchema,
|
|
31
|
+
y as CueProjectView,
|
|
32
|
+
I as CueProjects,
|
|
33
|
+
N as CueRequestError,
|
|
34
|
+
_ as CueSignUp,
|
|
35
|
+
b as CueSignal,
|
|
36
|
+
q as CueStorage,
|
|
37
|
+
v as CueSyncApi,
|
|
38
|
+
w as CueTables,
|
|
39
|
+
B as CueUserSettings,
|
|
40
|
+
F as REQUIRED_ROLES,
|
|
40
41
|
O as SUPPORTED_CURRENCIES,
|
|
41
42
|
T as configureScanWasm,
|
|
42
43
|
k as cueComputed
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qaecy/cue-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.37",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -23,6 +23,12 @@
|
|
|
23
23
|
"lib",
|
|
24
24
|
"assets"
|
|
25
25
|
],
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
28
|
+
"n3": "^1.26.0",
|
|
29
|
+
"spark-md5": "^3.0.2",
|
|
30
|
+
"uuid": "^9.0.0"
|
|
31
|
+
},
|
|
26
32
|
"peerDependencies": {
|
|
27
33
|
"firebase": ">=10.0.0"
|
|
28
34
|
}
|
package/variables.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export declare const ENDPOINT_COMMANDS_PROFILE_TERMS = "/commands/admin/profile/
|
|
|
29
29
|
export declare const ENDPOINT_ORG_MEMBERS: (orgId: string) => string;
|
|
30
30
|
export declare const ENDPOINT_ORG_CREDITS: (orgId: string) => string;
|
|
31
31
|
export declare const ENDPOINT_ORG_CREDITS_REPORT: (orgId: string) => string;
|
|
32
|
+
export declare const ENDPOINT_ORG_PROJECT_FILE_TYPE_BREAKDOWN: (orgId: string, projectId: string) => string;
|
|
32
33
|
export declare const ENDPOINT_COMMANDS_USER_SIGNUP = "/commands/admin/user/signup";
|
|
33
34
|
export declare const ENDPOINT_COMMANDS_USER_SIGNUP_RESEND = "/commands/admin/user/signup/resend";
|
|
34
35
|
export declare const ENDPOINT_COMMANDS_USER_SETTINGS = "/commands/admin/user/settings";
|
|
@@ -58,6 +59,9 @@ export declare const ENDPOINT_QLEVER_SHACL = "/qlever-server/qlever/shacl";
|
|
|
58
59
|
export declare const ENDPOINT_QLEVER_ADMIN_REBUILD = "/qlever-server/qlever/admin/rebuild";
|
|
59
60
|
export declare const ENDPOINT_QLEVER_ADMIN_STATS_REFRESH = "/qlever-server/admin/stats/refresh";
|
|
60
61
|
export declare const ENDPOINT_FSS_BATCH = "/commands/file-system-structure/batch";
|
|
62
|
+
export declare const ENDPOINT_DMS_SYNC_PROVIDERS = "/commands/dms-sync/providers";
|
|
63
|
+
export declare const ENDPOINT_DMS_SYNC_PREVIEW: (providerId: string) => string;
|
|
64
|
+
export declare const ENDPOINT_DMS_SYNC_CONFIRM: (providerId: string) => string;
|
|
61
65
|
export declare const ENDPOINT_STORAGE_SESSIONS = "/storage/sessions";
|
|
62
66
|
export declare const ENDPOINT_STORAGE_RAW = "/storage/raw";
|
|
63
67
|
export declare const ENDPOINT_STORAGE_PROCESSED = "/storage/processed";
|