@vertesia/client 1.0.0-dev.20260128.144200 → 1.0.0-dev.20260225.024852Z
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/lib/cjs/AuditTrailApi.js +35 -0
- package/lib/cjs/AuditTrailApi.js.map +1 -0
- package/lib/cjs/ProjectsApi.js +16 -0
- package/lib/cjs/ProjectsApi.js.map +1 -1
- package/lib/cjs/RunsApi.js +0 -5
- package/lib/cjs/RunsApi.js.map +1 -1
- package/lib/cjs/UsersApi.js +7 -1
- package/lib/cjs/UsersApi.js.map +1 -1
- package/lib/cjs/client.js +2 -0
- package/lib/cjs/client.js.map +1 -1
- package/lib/cjs/store/HiveMemoryApi.js +174 -0
- package/lib/cjs/store/HiveMemoryApi.js.map +1 -0
- package/lib/cjs/store/IndexingApi.js +207 -0
- package/lib/cjs/store/IndexingApi.js.map +1 -0
- package/lib/cjs/store/ObjectsApi.js +6 -4
- package/lib/cjs/store/ObjectsApi.js.map +1 -1
- package/lib/cjs/store/QueryApi.js +67 -0
- package/lib/cjs/store/QueryApi.js.map +1 -0
- package/lib/cjs/store/RenderingApi.js +84 -0
- package/lib/cjs/store/RenderingApi.js.map +1 -0
- package/lib/cjs/store/TypeCatalogApi.js +50 -0
- package/lib/cjs/store/TypeCatalogApi.js.map +1 -0
- package/lib/cjs/store/TypesApi.js +3 -0
- package/lib/cjs/store/TypesApi.js.map +1 -1
- package/lib/cjs/store/client.js +8 -0
- package/lib/cjs/store/client.js.map +1 -1
- package/lib/cjs/store/index.js +6 -0
- package/lib/cjs/store/index.js.map +1 -1
- package/lib/cjs/store/version.js +1 -1
- package/lib/esm/AuditTrailApi.js +32 -0
- package/lib/esm/AuditTrailApi.js.map +1 -0
- package/lib/esm/ProjectsApi.js +16 -0
- package/lib/esm/ProjectsApi.js.map +1 -1
- package/lib/esm/RunsApi.js +0 -5
- package/lib/esm/RunsApi.js.map +1 -1
- package/lib/esm/UsersApi.js +8 -2
- package/lib/esm/UsersApi.js.map +1 -1
- package/lib/esm/client.js +2 -0
- package/lib/esm/client.js.map +1 -1
- package/lib/esm/store/HiveMemoryApi.js +170 -0
- package/lib/esm/store/HiveMemoryApi.js.map +1 -0
- package/lib/esm/store/IndexingApi.js +203 -0
- package/lib/esm/store/IndexingApi.js.map +1 -0
- package/lib/esm/store/ObjectsApi.js +7 -5
- package/lib/esm/store/ObjectsApi.js.map +1 -1
- package/lib/esm/store/QueryApi.js +63 -0
- package/lib/esm/store/QueryApi.js.map +1 -0
- package/lib/esm/store/RenderingApi.js +80 -0
- package/lib/esm/store/RenderingApi.js.map +1 -0
- package/lib/esm/store/TypeCatalogApi.js +46 -0
- package/lib/esm/store/TypeCatalogApi.js.map +1 -0
- package/lib/esm/store/TypesApi.js +3 -0
- package/lib/esm/store/TypesApi.js.map +1 -1
- package/lib/esm/store/client.js +8 -0
- package/lib/esm/store/client.js.map +1 -1
- package/lib/esm/store/index.js +6 -0
- package/lib/esm/store/index.js.map +1 -1
- package/lib/esm/store/version.js +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/AuditTrailApi.d.ts +6 -0
- package/lib/types/AuditTrailApi.d.ts.map +1 -0
- package/lib/types/ProjectsApi.d.ts +5 -1
- package/lib/types/ProjectsApi.d.ts.map +1 -1
- package/lib/types/RunsApi.d.ts +1 -2
- package/lib/types/RunsApi.d.ts.map +1 -1
- package/lib/types/UsersApi.d.ts +6 -2
- package/lib/types/UsersApi.d.ts.map +1 -1
- package/lib/types/client.d.ts +2 -0
- package/lib/types/client.d.ts.map +1 -1
- package/lib/types/store/HiveMemoryApi.d.ts +160 -0
- package/lib/types/store/HiveMemoryApi.d.ts.map +1 -0
- package/lib/types/store/IndexingApi.d.ts +140 -0
- package/lib/types/store/IndexingApi.d.ts.map +1 -0
- package/lib/types/store/ObjectsApi.d.ts +3 -1
- package/lib/types/store/ObjectsApi.d.ts.map +1 -1
- package/lib/types/store/QueryApi.d.ts +99 -0
- package/lib/types/store/QueryApi.d.ts.map +1 -0
- package/lib/types/store/RenderingApi.d.ts +34 -0
- package/lib/types/store/RenderingApi.d.ts.map +1 -0
- package/lib/types/store/TypeCatalogApi.d.ts +39 -0
- package/lib/types/store/TypeCatalogApi.d.ts.map +1 -0
- package/lib/types/store/TypesApi.d.ts +2 -0
- package/lib/types/store/TypesApi.d.ts.map +1 -1
- package/lib/types/store/client.d.ts +8 -0
- package/lib/types/store/client.d.ts.map +1 -1
- package/lib/types/store/index.d.ts +6 -0
- package/lib/types/store/index.d.ts.map +1 -1
- package/lib/types/store/version.d.ts +1 -1
- package/lib/vertesia-client.js +1 -1
- package/lib/vertesia-client.js.map +1 -1
- package/package.json +4 -4
- package/src/AuditTrailApi.ts +25 -0
- package/src/ProjectsApi.ts +21 -1
- package/src/RunsApi.ts +0 -7
- package/src/UsersApi.ts +9 -5
- package/src/client.ts +2 -0
- package/src/store/HiveMemoryApi.ts +231 -0
- package/src/store/IndexingApi.ts +250 -0
- package/src/store/ObjectsApi.ts +12 -8
- package/src/store/QueryApi.ts +110 -0
- package/src/store/RenderingApi.ts +105 -0
- package/src/store/TypeCatalogApi.ts +53 -0
- package/src/store/TypesApi.ts +3 -0
- package/src/store/client.ts +8 -0
- package/src/store/index.ts +6 -0
- package/src/store/version.ts +1 -1
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
|
|
2
|
+
import {
|
|
3
|
+
isWorkflowTerminalStatus,
|
|
4
|
+
RenderMarkdownPollOptions,
|
|
5
|
+
RenderMarkdownPayload,
|
|
6
|
+
RenderMarkdownStartResponse,
|
|
7
|
+
RenderMarkdownStatusResponse,
|
|
8
|
+
RenderMarkdownResponse,
|
|
9
|
+
WorkflowExecutionStatus,
|
|
10
|
+
} from "@vertesia/common";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* API for rendering markdown documents to PDF or DOCX.
|
|
14
|
+
* Rendering is performed on workflow workers (not on the API server).
|
|
15
|
+
*/
|
|
16
|
+
export class RenderingApi extends ApiTopic {
|
|
17
|
+
constructor(parent: ClientBase) {
|
|
18
|
+
super(parent, "/api/v1/rendering");
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Render markdown content to PDF or DOCX.
|
|
23
|
+
*
|
|
24
|
+
* @param payload - Rendering options including format and either object_id or inline content
|
|
25
|
+
* @returns Rendering result with download URL
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // Render an existing markdown document
|
|
29
|
+
* const result = await client.rendering.render({
|
|
30
|
+
* format: MarkdownRenditionFormat.pdf,
|
|
31
|
+
* object_id: "doc-123"
|
|
32
|
+
* });
|
|
33
|
+
* // Download from result.download_url
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* // Render inline markdown content
|
|
37
|
+
* const result = await client.rendering.render({
|
|
38
|
+
* format: MarkdownRenditionFormat.docx,
|
|
39
|
+
* content: "# My Report\n\nContent here...",
|
|
40
|
+
* title: "My Report"
|
|
41
|
+
* });
|
|
42
|
+
*/
|
|
43
|
+
start(payload: RenderMarkdownPayload): Promise<RenderMarkdownStartResponse> {
|
|
44
|
+
return this.post("/jobs", { payload });
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
getStatus(
|
|
48
|
+
workflowId: string,
|
|
49
|
+
workflowRunId: string,
|
|
50
|
+
): Promise<RenderMarkdownStatusResponse> {
|
|
51
|
+
return this.get("/jobs/status", {
|
|
52
|
+
query: {
|
|
53
|
+
workflow_id: workflowId,
|
|
54
|
+
workflow_run_id: workflowRunId,
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async render(
|
|
60
|
+
payload: RenderMarkdownPayload,
|
|
61
|
+
options: RenderMarkdownPollOptions = {},
|
|
62
|
+
): Promise<RenderMarkdownResponse> {
|
|
63
|
+
const pollIntervalMs = options.pollIntervalMs ?? 1500;
|
|
64
|
+
const timeoutMs = options.timeoutMs ?? 10 * 60 * 1000;
|
|
65
|
+
|
|
66
|
+
const started = await this.start(payload);
|
|
67
|
+
if (!started.workflow_id || !started.workflow_run_id) {
|
|
68
|
+
throw new Error("Failed to start rendering workflow");
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const startTime = Date.now();
|
|
72
|
+
|
|
73
|
+
// Poll until workflow reaches terminal state.
|
|
74
|
+
while (true) {
|
|
75
|
+
const status = await this.getStatus(started.workflow_id, started.workflow_run_id);
|
|
76
|
+
|
|
77
|
+
if (status.status === WorkflowExecutionStatus.COMPLETED) {
|
|
78
|
+
if (!status.download_url && !status.file_uri) {
|
|
79
|
+
throw new Error(status.error || "Rendering completed but no output file was produced");
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
status: "success",
|
|
83
|
+
format: payload.format,
|
|
84
|
+
download_url: status.download_url,
|
|
85
|
+
file_uri: status.file_uri,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (isWorkflowTerminalStatus(status.status)) {
|
|
90
|
+
const statusLabel = WorkflowExecutionStatus[status.status] || String(status.status);
|
|
91
|
+
throw new Error(status.error || `Rendering failed with status: ${statusLabel}`);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (Date.now() - startTime >= timeoutMs) {
|
|
95
|
+
throw new Error(`Rendering timed out after ${timeoutMs}ms`);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
await sleep(pollIntervalMs);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function sleep(ms: number): Promise<void> {
|
|
104
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
105
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ApiTopic, ClientBase } from '@vertesia/api-fetch-client';
|
|
2
|
+
import { ContentObjectTypeItem, ContentObjectTypeRef } from '@vertesia/common';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export class TypeCatalogApi extends ApiTopic {
|
|
6
|
+
constructor(parent: ClientBase) {
|
|
7
|
+
super(parent, '/api/v1/types/catalog');
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* List all content types (system + app + stored)
|
|
12
|
+
*/
|
|
13
|
+
list(query: { tag?: string, limit?: number, offset?: number, layout?: boolean, schema?: boolean } = {}): Promise<ContentObjectTypeItem[]> {
|
|
14
|
+
return this.get('/', { query });
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* List system types only
|
|
19
|
+
*/
|
|
20
|
+
listSysTypes(tag?: string): Promise<ContentObjectTypeItem[]> {
|
|
21
|
+
return this.get('/sys', {
|
|
22
|
+
query: { tag }
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* List all app types from all installed apps
|
|
28
|
+
*/
|
|
29
|
+
listAppTypes(tag?: string): Promise<ContentObjectTypeItem[]> {
|
|
30
|
+
return this.get('/apps', {
|
|
31
|
+
query: { tag }
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* List stored types only
|
|
37
|
+
*/
|
|
38
|
+
listStoredTypes(query: { tag?: string, limit?: number, offset?: number, layout?: boolean, schema?: boolean } = {}): Promise<ContentObjectTypeItem[]> {
|
|
39
|
+
return this.get('/stored', {
|
|
40
|
+
query
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Resolve a type to its full definition.
|
|
46
|
+
* Accepts a string (type ID or code) or a ContentObjectTypeRef (extracts code or id automatically).
|
|
47
|
+
* @param typeOrRef Type identifier string, or a ContentObjectTypeRef from a content object
|
|
48
|
+
*/
|
|
49
|
+
resolve(typeOrRef: string | ContentObjectTypeRef): Promise<ContentObjectTypeItem> {
|
|
50
|
+
const typeId = typeof typeOrRef === 'string' ? typeOrRef : (typeOrRef.code || typeOrRef.id!);
|
|
51
|
+
return this.get(`/resolve/${typeId}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
package/src/store/TypesApi.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { ContentObjectType, ContentObjectTypeItem, CreateContentObjectTypePayload, FindPayload, ObjectTypeSearchQuery, ObjectTypeSearchPayload } from "@vertesia/common";
|
|
2
2
|
import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
|
|
3
|
+
import { TypeCatalogApi } from "./TypeCatalogApi.js";
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
export class TypesApi extends ApiTopic {
|
|
7
|
+
catalog: TypeCatalogApi;
|
|
6
8
|
|
|
7
9
|
constructor(parent: ClientBase) {
|
|
8
10
|
super(parent, "/api/v1/types");
|
|
11
|
+
this.catalog = new TypeCatalogApi(parent);
|
|
9
12
|
}
|
|
10
13
|
|
|
11
14
|
/**
|
package/src/store/client.ts
CHANGED
|
@@ -4,11 +4,15 @@ import { CollectionsApi } from "./CollectionsApi.js";
|
|
|
4
4
|
import { CommandsApi } from "./CommandsApi.js";
|
|
5
5
|
import { DataApi } from "./DataApi.js";
|
|
6
6
|
import { EmailApi } from "./EmailApi.js";
|
|
7
|
+
import { IndexingApi } from "./IndexingApi.js";
|
|
7
8
|
import { EmbeddingsApi } from "./EmbeddingsApi.js";
|
|
8
9
|
import { ZenoClientNotFoundError } from "./errors.js";
|
|
9
10
|
import { FilesApi } from "./FilesApi.js";
|
|
11
|
+
import { HiveMemoryApi } from "./HiveMemoryApi.js";
|
|
10
12
|
import { ObjectsApi } from "./ObjectsApi.js";
|
|
11
13
|
import { PendingAsksApi } from "./PendingAsksApi.js";
|
|
14
|
+
import { QueryApi } from "./QueryApi.js";
|
|
15
|
+
import { RenderingApi } from "./RenderingApi.js";
|
|
12
16
|
import { SchedulesApi } from "./SchedulesApi.js";
|
|
13
17
|
import { ToolsApi } from "./ToolsApi.js";
|
|
14
18
|
import { TypesApi } from "./TypesApi.js";
|
|
@@ -92,4 +96,8 @@ export class ZenoClient extends AbstractFetchClient<ZenoClient> {
|
|
|
92
96
|
pendingAsks = new PendingAsksApi(this);
|
|
93
97
|
data = new DataApi(this);
|
|
94
98
|
tools = new ToolsApi(this);
|
|
99
|
+
indexing = new IndexingApi(this);
|
|
100
|
+
query = new QueryApi(this);
|
|
101
|
+
hiveMemory = new HiveMemoryApi(this);
|
|
102
|
+
rendering = new RenderingApi(this);
|
|
95
103
|
}
|
package/src/store/index.ts
CHANGED
|
@@ -2,10 +2,16 @@ export * from "./client.js";
|
|
|
2
2
|
export * from "./CommandsApi.js";
|
|
3
3
|
export * from "./DataApi.js";
|
|
4
4
|
export * from "./EmailApi.js";
|
|
5
|
+
export * from "./errors.js";
|
|
5
6
|
export * from "./FilesApi.js";
|
|
7
|
+
export * from "./HiveMemoryApi.js";
|
|
8
|
+
export * from "./IndexingApi.js";
|
|
6
9
|
export * from "./ObjectsApi.js";
|
|
7
10
|
export * from "./PendingAsksApi.js";
|
|
11
|
+
export * from "./QueryApi.js";
|
|
12
|
+
export * from "./RenderingApi.js";
|
|
8
13
|
export * from "./SchedulesApi.js";
|
|
14
|
+
export * from "./TypeCatalogApi.js";
|
|
9
15
|
export * from "./TypesApi.js";
|
|
10
16
|
export * from "./WorkflowsApi.js";
|
|
11
17
|
|
package/src/store/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '
|
|
1
|
+
export const VERSION = '20260210' // YYYYMMDD, client versioning for API endpoints. Increment manually for breaking changes
|
|
2
2
|
export const VERSION_HEADER = 'x-api-version';
|