@vertesia/client 0.65.0 → 0.67.0
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/GroupsApi.js +78 -0
- package/lib/cjs/GroupsApi.js.map +1 -0
- package/lib/cjs/IamApi.js +2 -0
- package/lib/cjs/IamApi.js.map +1 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/store/WorkflowsApi.js +8 -4
- package/lib/cjs/store/WorkflowsApi.js.map +1 -1
- package/lib/esm/GroupsApi.js +74 -0
- package/lib/esm/GroupsApi.js.map +1 -0
- package/lib/esm/IamApi.js +2 -0
- package/lib/esm/IamApi.js.map +1 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/store/WorkflowsApi.js +8 -4
- package/lib/esm/store/WorkflowsApi.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/GroupsApi.d.ts +65 -0
- package/lib/types/GroupsApi.d.ts.map +1 -0
- package/lib/types/IamApi.d.ts +2 -0
- package/lib/types/IamApi.d.ts.map +1 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/store/WorkflowsApi.d.ts +4 -2
- package/lib/types/store/WorkflowsApi.d.ts.map +1 -1
- package/lib/vertesia-client.js +1 -1
- package/lib/vertesia-client.js.map +1 -1
- package/package.json +4 -4
- package/src/GroupsApi.ts +92 -0
- package/src/IamApi.ts +2 -0
- package/src/index.ts +1 -0
- package/src/store/WorkflowsApi.ts +9 -4
package/src/index.ts
CHANGED
|
@@ -3,5 +3,6 @@ export * from './InteractionBase.js';
|
|
|
3
3
|
export type { AsyncExecutionResult, ComputeInteractionFacetsResponse } from './InteractionsApi.js';
|
|
4
4
|
export type { ComputePromptFacetsResponse, ListInteractionsResponse } from './PromptsApi.js';
|
|
5
5
|
export type { ComputeRunFacetsResponse, FilterOption } from './RunsApi.js';
|
|
6
|
+
export type { GroupsQueryOptions } from './GroupsApi.js';
|
|
6
7
|
export * from "./store/index.js";
|
|
7
8
|
export * from "./StreamSource.js";
|
|
@@ -31,6 +31,11 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
31
31
|
return this.post(`/runs`, { payload: { documentId, eventName, ruleId } });
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
/** List conversations the users has access to */
|
|
35
|
+
listConversations(): Promise<ListWorkflowRunsResponse> {
|
|
36
|
+
return this.get(`/conversations`);
|
|
37
|
+
}
|
|
38
|
+
|
|
34
39
|
searchRuns(payload: ListWorkflowRunsPayload): Promise<ListWorkflowRunsResponse> {
|
|
35
40
|
return this.post(`/runs`, { payload: payload });
|
|
36
41
|
}
|
|
@@ -70,14 +75,14 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
70
75
|
return this.post(`/runs/${runId}/updates`, { payload: msg });
|
|
71
76
|
}
|
|
72
77
|
|
|
73
|
-
retrieveMessages(runId: string, since?: number): Promise<AgentMessage[]> {
|
|
78
|
+
retrieveMessages(workflowId: string, runId: string, since?: number): Promise<AgentMessage[]> {
|
|
74
79
|
const query = {
|
|
75
80
|
since,
|
|
76
81
|
};
|
|
77
|
-
return this.get(`/runs/${runId}/updates`, { query });
|
|
82
|
+
return this.get(`/runs/${workflowId}/${runId}/updates`, { query });
|
|
78
83
|
}
|
|
79
84
|
|
|
80
|
-
async streamMessages(runId: string, onMessage?: (message: AgentMessage, exitFn?: (payload: unknown) => void) => void, since?: number): Promise<unknown> {
|
|
85
|
+
async streamMessages(workflowId: string, runId: string, onMessage?: (message: AgentMessage, exitFn?: (payload: unknown) => void) => void, since?: number): Promise<unknown> {
|
|
81
86
|
return new Promise<unknown>((resolve, reject) => {
|
|
82
87
|
let reconnectAttempts = 0;
|
|
83
88
|
let lastMessageTimestamp = since || 0;
|
|
@@ -121,7 +126,7 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
121
126
|
try {
|
|
122
127
|
const EventSourceImpl = await EventSourceProvider();
|
|
123
128
|
const client = this.client as VertesiaClient;
|
|
124
|
-
const streamUrl = new URL(client.workflows.baseUrl +
|
|
129
|
+
const streamUrl = new URL(client.workflows.baseUrl + `/runs/${workflowId}/${runId}/stream`);
|
|
125
130
|
|
|
126
131
|
// Use the timestamp of the last received message for reconnection
|
|
127
132
|
if (lastMessageTimestamp > 0) {
|