@vertesia/client 1.5.0-dev.20260725.083715Z → 1.5.0-dev.20260806.125520Z
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/AccountApi.d.ts +10 -7
- package/lib/AccountApi.d.ts.map +1 -1
- package/lib/AccountApi.js +7 -4
- package/lib/AccountApi.js.map +1 -1
- package/lib/AccountsApi.d.ts.map +1 -1
- package/lib/AnalyticsApi.d.ts.map +1 -1
- package/lib/ApiKeysApi.d.ts +3 -3
- package/lib/ApiKeysApi.d.ts.map +1 -1
- package/lib/ApiKeysApi.js.map +1 -1
- package/lib/AppsApi.d.ts +12 -2
- package/lib/AppsApi.d.ts.map +1 -1
- package/lib/AppsApi.js +20 -1
- package/lib/AppsApi.js.map +1 -1
- package/lib/AuditTrailApi.d.ts.map +1 -1
- package/lib/CommandsApi.d.ts.map +1 -1
- package/lib/EnvironmentsApi.d.ts +3 -6
- package/lib/EnvironmentsApi.d.ts.map +1 -1
- package/lib/EnvironmentsApi.js.map +1 -1
- package/lib/GroupsApi.d.ts +2 -0
- package/lib/GroupsApi.d.ts.map +1 -1
- package/lib/GroupsApi.js.map +1 -1
- package/lib/IamApi.d.ts.map +1 -1
- package/lib/InteractionBase.d.ts +686 -2
- package/lib/InteractionBase.d.ts.map +1 -1
- package/lib/InteractionBase.js.map +1 -1
- package/lib/InteractionCatalogApi.d.ts.map +1 -1
- package/lib/InteractionCatalogApi.js.map +1 -1
- package/lib/InteractionOutput.d.ts.map +1 -1
- package/lib/InteractionOutput.js.map +1 -1
- package/lib/InteractionsApi.d.ts.map +1 -1
- package/lib/InteractionsApi.js.map +1 -1
- package/lib/InternalSecretsApi.d.ts.map +1 -1
- package/lib/OAuthClientsApi.d.ts.map +1 -1
- package/lib/OAuthGrantsApi.d.ts +2 -4
- package/lib/OAuthGrantsApi.d.ts.map +1 -1
- package/lib/OAuthGrantsApi.js.map +1 -1
- package/lib/OAuthProvidersApi.d.ts +6 -1
- package/lib/OAuthProvidersApi.d.ts.map +1 -1
- package/lib/OAuthProvidersApi.js +5 -0
- package/lib/OAuthProvidersApi.js.map +1 -1
- package/lib/OAuthServerApi.d.ts.map +1 -1
- package/lib/OAuthServerApi.js.map +1 -1
- package/lib/ProjectsApi.d.ts.map +1 -1
- package/lib/PromptsApi.d.ts +19 -30
- package/lib/PromptsApi.d.ts.map +1 -1
- package/lib/PromptsApi.js +1 -1
- package/lib/PromptsApi.js.map +1 -1
- package/lib/QuotaApi.d.ts.map +1 -1
- package/lib/RefsApi.d.ts.map +1 -1
- package/lib/RemoteMcpConnectionsApi.d.ts.map +1 -1
- package/lib/RunsApi.d.ts.map +1 -1
- package/lib/SecretsApi.d.ts.map +1 -1
- package/lib/SkillsApi.d.ts.map +1 -1
- package/lib/StreamSource.d.ts.map +1 -1
- package/lib/StreamSource.js.map +1 -1
- package/lib/ToolsApi.d.ts.map +1 -1
- package/lib/TrainingApi.d.ts.map +1 -1
- package/lib/TrainingApi.js.map +1 -1
- package/lib/UsersApi.d.ts.map +1 -1
- package/lib/ViewsApi.d.ts.map +1 -1
- package/lib/ViewsApi.js.map +1 -1
- package/lib/client.d.ts +10 -2
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +1 -0
- package/lib/client.js.map +1 -1
- package/lib/execute.js.map +1 -1
- package/lib/managed-sse.js +1 -1
- package/lib/managed-sse.js.map +1 -1
- package/lib/nodejs/NodeStreamSource.d.ts.map +1 -1
- package/lib/store/AgentsApi.d.ts.map +1 -1
- package/lib/store/AgentsApi.js +121 -77
- package/lib/store/AgentsApi.js.map +1 -1
- package/lib/store/AnalyzeDocApi.d.ts.map +1 -1
- package/lib/store/AnalyzeDocApi.js.map +1 -1
- package/lib/store/CollectionsApi.d.ts.map +1 -1
- package/lib/store/CollectionsApi.js.map +1 -1
- package/lib/store/CostApi.d.ts.map +1 -1
- package/lib/store/CostApi.js.map +1 -1
- package/lib/store/DashboardApi.d.ts.map +1 -1
- package/lib/store/DataApi.d.ts.map +1 -1
- package/lib/store/EmailApi.d.ts.map +1 -1
- package/lib/store/EmbeddingsApi.d.ts.map +1 -1
- package/lib/store/EmbeddingsApi.js.map +1 -1
- package/lib/store/EventIngestChannelsApi.d.ts.map +1 -1
- package/lib/store/EventSubscriptionsApi.d.ts.map +1 -1
- package/lib/store/EventsApi.d.ts +2 -1
- package/lib/store/EventsApi.d.ts.map +1 -1
- package/lib/store/EventsApi.js +3 -0
- package/lib/store/EventsApi.js.map +1 -1
- package/lib/store/FilesApi.d.ts +4 -0
- package/lib/store/FilesApi.d.ts.map +1 -1
- package/lib/store/FilesApi.js +48 -23
- package/lib/store/FilesApi.js.map +1 -1
- package/lib/store/HiveMemoryApi.d.ts.map +1 -1
- package/lib/store/IndexingApi.d.ts.map +1 -1
- package/lib/store/IndexingApi.js.map +1 -1
- package/lib/store/ObjectsApi.d.ts +3 -8
- package/lib/store/ObjectsApi.d.ts.map +1 -1
- package/lib/store/ObjectsApi.js +2 -2
- package/lib/store/ObjectsApi.js.map +1 -1
- package/lib/store/PendingAsksApi.d.ts.map +1 -1
- package/lib/store/ProcessApi.d.ts.map +1 -1
- package/lib/store/QueryApi.d.ts.map +1 -1
- package/lib/store/QueryApi.js.map +1 -1
- package/lib/store/RenderingApi.d.ts.map +1 -1
- package/lib/store/RenderingApi.js.map +1 -1
- package/lib/store/SchedulesApi.d.ts.map +1 -1
- package/lib/store/TaskApi.d.ts +9 -0
- package/lib/store/TaskApi.d.ts.map +1 -1
- package/lib/store/TaskApi.js +11 -16
- package/lib/store/TaskApi.js.map +1 -1
- package/lib/store/TypeCatalogApi.d.ts +21 -7
- package/lib/store/TypeCatalogApi.d.ts.map +1 -1
- package/lib/store/TypeCatalogApi.js +16 -2
- package/lib/store/TypeCatalogApi.js.map +1 -1
- package/lib/store/TypesApi.d.ts +2 -2
- package/lib/store/TypesApi.d.ts.map +1 -1
- package/lib/store/TypesApi.js.map +1 -1
- package/lib/store/ViewsApi.d.ts.map +1 -1
- package/lib/store/ViewsApi.js.map +1 -1
- package/lib/store/WorkflowsApi.d.ts.map +1 -1
- package/lib/store/WorkflowsApi.js.map +1 -1
- package/lib/store/client.d.ts.map +1 -1
- package/lib/store/client.js.map +1 -1
- package/lib/store/errors.d.ts.map +1 -1
- package/lib/store/signed-url.js.map +1 -1
- package/lib/store/version.d.ts +1 -3
- package/lib/store/version.d.ts.map +1 -1
- package/lib/store/version.js +3 -3
- package/lib/store/version.js.map +1 -1
- package/lib/vertesia-client.js +10 -10
- package/lib/vertesia-client.js.map +1 -1
- package/package.json +6 -6
- package/src/AccountApi.test.ts +30 -0
- package/src/AccountApi.ts +10 -8
- package/src/ApiKeysApi.ts +4 -3
- package/src/AppsApi.ts +26 -0
- package/src/EnvironmentsApi.ts +3 -11
- package/src/GroupsApi.ts +2 -0
- package/src/OAuthGrantsApi.ts +2 -1
- package/src/OAuthProvidersApi.ts +6 -1
- package/src/PromptsApi.ts +22 -25
- package/src/client.test.ts +16 -0
- package/src/client.ts +1 -0
- package/src/store/AgentsApi.stream.test.ts +298 -0
- package/src/store/AgentsApi.ts +120 -68
- package/src/store/EventsApi.ts +8 -0
- package/src/store/FilesApi.test.ts +37 -1
- package/src/store/FilesApi.ts +49 -20
- package/src/store/ObjectsApi.ts +8 -8
- package/src/store/TaskApi.ts +11 -11
- package/src/store/TypeCatalogApi.ts +21 -7
- package/src/store/TypesApi.ts +2 -1
- package/src/store/version.ts +7 -3
package/src/store/FilesApi.ts
CHANGED
|
@@ -28,6 +28,44 @@ const FILE_SIGNING_RETRY_POLICY: IRequestRetryPolicy = {
|
|
|
28
28
|
statuses: [502, 503, 504],
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
+
function fileLocationForError(location: string): string {
|
|
32
|
+
try {
|
|
33
|
+
const url = new URL(location);
|
|
34
|
+
return `${url.protocol}//${url.host}${url.pathname}`;
|
|
35
|
+
} catch {
|
|
36
|
+
return location.split(/[?#]/, 1)[0] || 'unknown file';
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function sanitizedErrorCause(error: unknown): Error | undefined {
|
|
41
|
+
if (!(error instanceof Error)) {
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
const message = error.message.replace(/https?:\/\/[^\s)\]}>"']+/g, (url) => fileLocationForError(url));
|
|
45
|
+
const cause = new Error(message);
|
|
46
|
+
cause.name = error.name;
|
|
47
|
+
return cause;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function fileDownloadFailureReason(status?: number, statusText?: string): string {
|
|
51
|
+
if (status === 404) return 'not found';
|
|
52
|
+
if (status === 403) return 'forbidden';
|
|
53
|
+
if (status) return `failed with status ${status}${statusText ? ` ${statusText}` : ''}`;
|
|
54
|
+
return 'failed';
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export class FileDownloadError extends Error {
|
|
58
|
+
readonly status?: number;
|
|
59
|
+
|
|
60
|
+
constructor(location: string, status?: number, statusText?: string, cause?: unknown) {
|
|
61
|
+
const safeLocation = fileLocationForError(location);
|
|
62
|
+
const reason = fileDownloadFailureReason(status, statusText);
|
|
63
|
+
super(`File download ${reason}: ${safeLocation}`, { cause: sanitizedErrorCause(cause) });
|
|
64
|
+
this.name = 'FileDownloadError';
|
|
65
|
+
this.status = status;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
31
69
|
export function getMemoryFilePath(name: string) {
|
|
32
70
|
const nameWithExt = name.endsWith('.tar.gz') ? name : `${name}.tar.gz`;
|
|
33
71
|
return `${MEMORIES_PREFIX}/${nameWithExt}`;
|
|
@@ -229,28 +267,19 @@ export class FilesApi extends ApiTopic {
|
|
|
229
267
|
const needSign = !location.startsWith('https:');
|
|
230
268
|
const { url } = needSign ? await this.getDownloadUrl(location) : { url: location };
|
|
231
269
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
} else {
|
|
243
|
-
console.log(res);
|
|
244
|
-
throw new Error(`Failed to download file ${location}: ${res.statusText}`);
|
|
245
|
-
}
|
|
246
|
-
})
|
|
247
|
-
.catch((err) => {
|
|
248
|
-
console.error(`Failed to download file ${location}.`, err);
|
|
249
|
-
throw err;
|
|
250
|
-
});
|
|
270
|
+
let res: Response;
|
|
271
|
+
try {
|
|
272
|
+
res = await fetchSignedUrl(url, { method: 'GET' });
|
|
273
|
+
} catch (error: unknown) {
|
|
274
|
+
throw new FileDownloadError(location, undefined, undefined, error);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
if (!res.ok) {
|
|
278
|
+
throw new FileDownloadError(location, res.status, res.statusText);
|
|
279
|
+
}
|
|
251
280
|
|
|
252
281
|
if (!res.body) {
|
|
253
|
-
throw new
|
|
282
|
+
throw new FileDownloadError(location);
|
|
254
283
|
}
|
|
255
284
|
|
|
256
285
|
return res.body;
|
package/src/store/ObjectsApi.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { ApiTopic } from '@vertesia/api-fetch-client';
|
|
2
2
|
import {
|
|
3
|
+
type BulkObjectCreateOptions,
|
|
3
4
|
type BulkObjectCreateResult,
|
|
4
5
|
type BulkObjectDeleteResult,
|
|
6
|
+
type BulkObjectUpdateOptions,
|
|
5
7
|
type BulkObjectUpdateResult,
|
|
6
8
|
type Collection,
|
|
7
9
|
type ComplexSearchPayload,
|
|
@@ -458,23 +460,21 @@ export class ObjectsApi extends ApiTopic {
|
|
|
458
460
|
return this.del(`/${idOrIds}`);
|
|
459
461
|
}
|
|
460
462
|
|
|
461
|
-
bulkUpdate(
|
|
463
|
+
bulkUpdate(
|
|
464
|
+
updates: Record<string, Record<string, unknown>>,
|
|
465
|
+
options?: BulkObjectUpdateOptions,
|
|
466
|
+
): Promise<BulkObjectUpdateResult> {
|
|
462
467
|
const ids = Object.keys(updates);
|
|
463
468
|
return this.client.runOperation({
|
|
464
469
|
name: 'update',
|
|
465
470
|
ids,
|
|
466
|
-
params: updates,
|
|
471
|
+
params: options ? { updates, ...options } : updates,
|
|
467
472
|
}) as Promise<BulkObjectUpdateResult>;
|
|
468
473
|
}
|
|
469
474
|
|
|
470
475
|
bulkCreate(
|
|
471
476
|
objects: CreateContentObjectPayload[],
|
|
472
|
-
options?:
|
|
473
|
-
collection_id?: string;
|
|
474
|
-
/** @deprecated Events are now always emitted. This suppresses the Temporal-backed delivery targets (workflow, agent, and process) — webhook deliveries still fire. */
|
|
475
|
-
skip_workflows?: boolean;
|
|
476
|
-
processing_priority?: ContentObjectProcessingPriority;
|
|
477
|
-
},
|
|
477
|
+
options?: BulkObjectCreateOptions,
|
|
478
478
|
): Promise<BulkObjectCreateResult> {
|
|
479
479
|
return this.client.runOperation({
|
|
480
480
|
name: 'create',
|
package/src/store/TaskApi.ts
CHANGED
|
@@ -6,17 +6,17 @@ export class TaskApi extends ApiTopic {
|
|
|
6
6
|
super(parent, '/api/v1/tasks');
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return this.get('/', { query
|
|
9
|
+
/**
|
|
10
|
+
* Lists tasks.
|
|
11
|
+
*
|
|
12
|
+
* `status` accepts one value or several, and several go out as a repeated key
|
|
13
|
+
* (`status=a&status=b`) — which is what the parameter publishes: `style: form`, `explode: true`.
|
|
14
|
+
* This used to comma-join the array before sending it. Servers still split each occurrence on
|
|
15
|
+
* commas so SDKs pinned to an older version keep working, but that form was never in the spec,
|
|
16
|
+
* so newly published clients send the declared one.
|
|
17
|
+
*/
|
|
18
|
+
list(query: ListTasksQuery = {}): Promise<Task[]> {
|
|
19
|
+
return this.get('/', { query });
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
retrieve(id: string): Promise<Task> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApiTopic, type ClientBase } from '@vertesia/api-fetch-client';
|
|
2
|
-
import type { ContentObjectTypeItem, ContentObjectTypeRef } from '@vertesia/common';
|
|
2
|
+
import type { ContentObjectTypeCatalogEntry, ContentObjectTypeItem, ContentObjectTypeRef } from '@vertesia/common';
|
|
3
3
|
|
|
4
4
|
export class TypeCatalogApi extends ApiTopic {
|
|
5
5
|
constructor(parent: ClientBase) {
|
|
@@ -7,18 +7,22 @@ export class TypeCatalogApi extends ApiTopic {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* List all content types (system + app + stored)
|
|
10
|
+
* List all content types (system + app + stored).
|
|
11
|
+
*
|
|
12
|
+
* Returns `ContentObjectTypeCatalogEntry`, not `ContentObjectTypeItem`, for the same reason
|
|
13
|
+
* {@link resolve} does: the listing includes system and app types, which are declared in code
|
|
14
|
+
* rather than authored, so they carry none of the four audit fields.
|
|
11
15
|
*/
|
|
12
16
|
list(
|
|
13
17
|
query: { tag?: string; limit?: number; offset?: number; layout?: boolean; schema?: boolean } = {},
|
|
14
|
-
): Promise<
|
|
18
|
+
): Promise<ContentObjectTypeCatalogEntry[]> {
|
|
15
19
|
return this.get('/', { query });
|
|
16
20
|
}
|
|
17
21
|
|
|
18
22
|
/**
|
|
19
23
|
* List system types only
|
|
20
24
|
*/
|
|
21
|
-
listSysTypes(tag?: string): Promise<
|
|
25
|
+
listSysTypes(tag?: string): Promise<ContentObjectTypeCatalogEntry[]> {
|
|
22
26
|
return this.get('/sys', {
|
|
23
27
|
query: { tag },
|
|
24
28
|
});
|
|
@@ -27,14 +31,17 @@ export class TypeCatalogApi extends ApiTopic {
|
|
|
27
31
|
/**
|
|
28
32
|
* List all app types from all installed apps
|
|
29
33
|
*/
|
|
30
|
-
listAppTypes(tag?: string): Promise<
|
|
34
|
+
listAppTypes(tag?: string): Promise<ContentObjectTypeCatalogEntry[]> {
|
|
31
35
|
return this.get('/apps', {
|
|
32
36
|
query: { tag },
|
|
33
37
|
});
|
|
34
38
|
}
|
|
35
39
|
|
|
36
40
|
/**
|
|
37
|
-
* List stored types only
|
|
41
|
+
* List stored types only.
|
|
42
|
+
*
|
|
43
|
+
* Stored types are real records, so this one does return `ContentObjectTypeItem` with its audit
|
|
44
|
+
* fields required.
|
|
38
45
|
*/
|
|
39
46
|
listStoredTypes(
|
|
40
47
|
query: { tag?: string; limit?: number; offset?: number; layout?: boolean; schema?: boolean } = {},
|
|
@@ -47,9 +54,16 @@ export class TypeCatalogApi extends ApiTopic {
|
|
|
47
54
|
/**
|
|
48
55
|
* Resolve a type to its full definition.
|
|
49
56
|
* Accepts a string (type ID or code) or a ContentObjectTypeRef.
|
|
57
|
+
*
|
|
58
|
+
* Returns a `ContentObjectTypeCatalogEntry`, which is what the endpoint publishes and is NOT
|
|
59
|
+
* `ContentObjectTypeItem`: the catalog resolves in-code types contributed by plugins, which no
|
|
60
|
+
* user created and no user has modified, so its four audit fields are optional. Declaring the
|
|
61
|
+
* stored type here told callers `created_by` was always a string when resolving `sys:Invoice`
|
|
62
|
+
* hands back a record that has none.
|
|
63
|
+
*
|
|
50
64
|
* @param typeOrRef Type identifier string, or a ContentObjectTypeRef from a content object
|
|
51
65
|
*/
|
|
52
|
-
resolve(typeOrRef: string | ContentObjectTypeRef): Promise<
|
|
66
|
+
resolve(typeOrRef: string | ContentObjectTypeRef): Promise<ContentObjectTypeCatalogEntry> {
|
|
53
67
|
const typeId = typeof typeOrRef === 'string' ? typeOrRef : typeOrRef.id;
|
|
54
68
|
return this.get(`/resolve/${typeId}`);
|
|
55
69
|
}
|
package/src/store/TypesApi.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type {
|
|
|
6
6
|
FindPayload,
|
|
7
7
|
ObjectTypeSearchPayload,
|
|
8
8
|
ObjectTypeSearchQuery,
|
|
9
|
+
UpdateContentObjectTypePayload,
|
|
9
10
|
} from '@vertesia/common';
|
|
10
11
|
import { TypeCatalogApi } from './TypeCatalogApi.js';
|
|
11
12
|
|
|
@@ -58,7 +59,7 @@ export class TypesApi extends ApiTopic {
|
|
|
58
59
|
return this.get(`/name/${typeName}`);
|
|
59
60
|
}
|
|
60
61
|
|
|
61
|
-
update(typeId: string, payload:
|
|
62
|
+
update(typeId: string, payload: UpdateContentObjectTypePayload): Promise<ContentObjectType> {
|
|
62
63
|
return this.put(`/${typeId}`, {
|
|
63
64
|
payload,
|
|
64
65
|
});
|
package/src/store/version.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export {
|
|
1
|
+
// Preserve the public client export while sourcing its value from the same module as the servers
|
|
2
|
+
// and OpenAPI generator.
|
|
3
|
+
export {
|
|
4
|
+
APP_VERSION_HEADER,
|
|
5
|
+
CURRENT_API_VERSION_HEADER_VALUE as VERSION,
|
|
6
|
+
VERSION_HEADER,
|
|
7
|
+
} from '@vertesia/common';
|