@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertesia/client",
|
|
3
|
-
"version": "1.5.0-dev.
|
|
3
|
+
"version": "1.5.0-dev.20260806.125520Z",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -13,15 +13,15 @@
|
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"@types/node": "^24.13.3",
|
|
15
15
|
"rolldown": "1.2.0",
|
|
16
|
-
"typescript": "
|
|
16
|
+
"typescript": "7.0.2",
|
|
17
17
|
"vitest": "^4.1.10",
|
|
18
18
|
"@vertesia/tsconfig": "0.1.0"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"eventsource": "^4.1.0",
|
|
22
|
-
"@llumiverse/common": "1.5.0-dev.
|
|
23
|
-
"@vertesia/
|
|
24
|
-
"@vertesia/
|
|
22
|
+
"@llumiverse/common": "1.5.0-dev.20260806.124634Z",
|
|
23
|
+
"@vertesia/common": "1.5.0-dev.20260806.125520Z",
|
|
24
|
+
"@vertesia/api-fetch-client": "1.5.0-dev.20260806.125520Z"
|
|
25
25
|
},
|
|
26
26
|
"exports": {
|
|
27
27
|
".": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"ai",
|
|
49
49
|
"typescript"
|
|
50
50
|
],
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "416423ef4182d8668809604902a871ca79629298",
|
|
52
52
|
"scripts": {
|
|
53
53
|
"lint": "biome lint src",
|
|
54
54
|
"clean:lib": "rimraf ./lib ./tsconfig.tsbuildinfo",
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
2
|
+
import { VertesiaClient } from './client.js';
|
|
3
|
+
|
|
4
|
+
describe('AccountApi', () => {
|
|
5
|
+
it('returns onboarding.completed_at as the ISO string received over JSON', async () => {
|
|
6
|
+
const completedAt = '2026-07-29T10:00:00.000Z';
|
|
7
|
+
const fetchMock = vi.fn(async () => {
|
|
8
|
+
return new Response(
|
|
9
|
+
JSON.stringify({
|
|
10
|
+
id: 'account-id',
|
|
11
|
+
onboarding: { completed: true, completed_at: completedAt },
|
|
12
|
+
}),
|
|
13
|
+
{
|
|
14
|
+
status: 200,
|
|
15
|
+
headers: { 'content-type': 'application/json' },
|
|
16
|
+
},
|
|
17
|
+
);
|
|
18
|
+
});
|
|
19
|
+
const client = new VertesiaClient({
|
|
20
|
+
serverUrl: 'https://api.example.com',
|
|
21
|
+
storeUrl: 'https://api.example.com',
|
|
22
|
+
fetch: fetchMock,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const account = await client.account.info();
|
|
26
|
+
|
|
27
|
+
expect(account.onboarding.completed_at).toBe(completedAt);
|
|
28
|
+
expect(account.onboarding.completed_at).not.toBeInstanceOf(Date);
|
|
29
|
+
});
|
|
30
|
+
});
|
package/src/AccountApi.ts
CHANGED
|
@@ -9,10 +9,9 @@ import type {
|
|
|
9
9
|
OnboardingProgress,
|
|
10
10
|
ProjectRef,
|
|
11
11
|
StripeBillingStatusResponse,
|
|
12
|
-
TransientToken,
|
|
13
12
|
UpdateAccountPayload,
|
|
14
13
|
User,
|
|
15
|
-
|
|
14
|
+
UserInviteToken,
|
|
16
15
|
} from '@vertesia/common';
|
|
17
16
|
|
|
18
17
|
export default class AccountApi extends ApiTopic {
|
|
@@ -56,17 +55,20 @@ export default class AccountApi extends ApiTopic {
|
|
|
56
55
|
|
|
57
56
|
/**
|
|
58
57
|
* Fetch Invites for Principal
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
|
|
58
|
+
*
|
|
59
|
+
* Returns `UserInviteToken[]`, not `TransientToken<UserInviteTokenData>[]`. The latter declared
|
|
60
|
+
* `Date` for `expires`, `created_at` and `updated_at`, which no HTTP response can carry — the
|
|
61
|
+
* client hands back whatever `JSON.parse` produced, so those three were always strings. It now
|
|
62
|
+
* says so.
|
|
63
|
+
*/
|
|
64
|
+
listInvites(): Promise<UserInviteToken[]> {
|
|
62
65
|
return this.get('/invites');
|
|
63
66
|
}
|
|
64
67
|
/**
|
|
65
68
|
* Fetch Invites for specific account or project
|
|
66
69
|
* @param type Filter for the type of invitation, either "project" or "account"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
listInvitation(type: 'project' | 'account' = 'project'): Promise<TransientToken<UserInviteTokenData>[]> {
|
|
70
|
+
*/
|
|
71
|
+
listInvitation(type: 'project' | 'account' = 'project'): Promise<UserInviteToken[]> {
|
|
70
72
|
return this.get(`/invites/${type}`);
|
|
71
73
|
}
|
|
72
74
|
|
package/src/ApiKeysApi.ts
CHANGED
|
@@ -4,9 +4,10 @@ import type {
|
|
|
4
4
|
ApiKeyReadResponse,
|
|
5
5
|
ApiKeyWithValue,
|
|
6
6
|
AuthTokenResponse,
|
|
7
|
-
|
|
7
|
+
CreateApiKeyPayload,
|
|
8
8
|
CreatePublicKeyPayload,
|
|
9
9
|
DeleteOperationResult,
|
|
10
|
+
UpdateApiKeyPayload,
|
|
10
11
|
} from '@vertesia/common';
|
|
11
12
|
|
|
12
13
|
export class ApiKeysApi extends ApiTopic {
|
|
@@ -28,7 +29,7 @@ export class ApiKeysApi extends ApiTopic {
|
|
|
28
29
|
* ALL REQUESTS ARE LOGGED IN SECURITY AUDIT LOG
|
|
29
30
|
* @returns ApiKeyWithValue
|
|
30
31
|
*/
|
|
31
|
-
create(payload:
|
|
32
|
+
create(payload: CreateApiKeyPayload): Promise<ApiKeyWithValue> {
|
|
32
33
|
return this.post('/', { payload });
|
|
33
34
|
}
|
|
34
35
|
|
|
@@ -36,7 +37,7 @@ export class ApiKeysApi extends ApiTopic {
|
|
|
36
37
|
* Update an existing ApiKey for account
|
|
37
38
|
* @returns ApiKey
|
|
38
39
|
*/
|
|
39
|
-
update(id: string, payload:
|
|
40
|
+
update(id: string, payload: UpdateApiKeyPayload): Promise<ApiKey> {
|
|
40
41
|
return this.put(`/${id}`, { payload });
|
|
41
42
|
}
|
|
42
43
|
|
package/src/AppsApi.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ApiTopic, type ClientBase, type ServerError } from '@vertesia/api-fetch-client';
|
|
2
2
|
import type {
|
|
3
|
+
AppApiKeyCollectionParams,
|
|
3
4
|
AppBuildProgress,
|
|
4
5
|
AppDeleteSummary,
|
|
5
6
|
AppDevelopmentTaskDetails,
|
|
@@ -26,9 +27,11 @@ import type {
|
|
|
26
27
|
CountResult,
|
|
27
28
|
CreateAppRepoBranchRequest,
|
|
28
29
|
DeleteAppVersionResponse,
|
|
30
|
+
McpApiKeyStatus,
|
|
29
31
|
ProjectRef,
|
|
30
32
|
PromoteAppVersionResponse,
|
|
31
33
|
RequireAtLeastOne,
|
|
34
|
+
SetMcpApiKeyRequest,
|
|
32
35
|
StartAppBuildRequest,
|
|
33
36
|
StartAppBuildResponse,
|
|
34
37
|
StartAppScaffoldRequest,
|
|
@@ -64,6 +67,27 @@ export default class AppsApi extends ApiTopic {
|
|
|
64
67
|
return this.del(`/${id}`);
|
|
65
68
|
}
|
|
66
69
|
|
|
70
|
+
/**
|
|
71
|
+
* Store the API key of an MCP tool collection declared with `auth: 'api_key'`.
|
|
72
|
+
* The key is write-only: it is encrypted server-side and never returned by any endpoint,
|
|
73
|
+
* so the response carries only the configured flag and a masked hint.
|
|
74
|
+
*/
|
|
75
|
+
setMcpCollectionApiKey(appId: string, collectionId: string, apiKey: string): Promise<McpApiKeyStatus> {
|
|
76
|
+
return this.put(`/${encodeURIComponent(appId)}/collections/${encodeURIComponent(collectionId)}/api-key`, {
|
|
77
|
+
payload: { api_key: apiKey } satisfies SetMcpApiKeyRequest,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** Whether an MCP tool collection has an API key stored, with a masked hint for display. */
|
|
82
|
+
getMcpCollectionApiKeyStatus(appId: string, collectionId: string): Promise<McpApiKeyStatus> {
|
|
83
|
+
return this.get(`/${encodeURIComponent(appId)}/collections/${encodeURIComponent(collectionId)}/api-key`);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** Remove the stored API key of an MCP tool collection. */
|
|
87
|
+
deleteMcpCollectionApiKey(appId: string, collectionId: string): Promise<McpApiKeyStatus> {
|
|
88
|
+
return this.del(`/${encodeURIComponent(appId)}/collections/${encodeURIComponent(collectionId)}/api-key`);
|
|
89
|
+
}
|
|
90
|
+
|
|
67
91
|
/**
|
|
68
92
|
* Cascade-delete an app and everything attached to it (versions,
|
|
69
93
|
* installations + ACEs, git repo on the app-git server). Pass through
|
|
@@ -288,6 +312,7 @@ export default class AppsApi extends ApiTopic {
|
|
|
288
312
|
settings?: Record<string, unknown>,
|
|
289
313
|
oauthParams?: Record<string, { client_id?: string; client_secret?: string; scopes?: string[] }>,
|
|
290
314
|
oauthProviderParams?: Record<string, { client_id?: string; client_secret?: string; scopes?: string[] }>,
|
|
315
|
+
apiKeyParams?: AppApiKeyCollectionParams,
|
|
291
316
|
): Promise<AppInstallation> {
|
|
292
317
|
return this.post(`/install`, {
|
|
293
318
|
payload: {
|
|
@@ -295,6 +320,7 @@ export default class AppsApi extends ApiTopic {
|
|
|
295
320
|
settings,
|
|
296
321
|
oauth_params: oauthParams,
|
|
297
322
|
oauth_provider_params: oauthProviderParams,
|
|
323
|
+
api_key_params: apiKeyParams,
|
|
298
324
|
} satisfies AppInstallationPayload,
|
|
299
325
|
});
|
|
300
326
|
}
|
package/src/EnvironmentsApi.ts
CHANGED
|
@@ -5,11 +5,9 @@ import type {
|
|
|
5
5
|
EmbeddingsApiResult,
|
|
6
6
|
EnableEnvironmentModelPayload,
|
|
7
7
|
ExecutionEnvironment,
|
|
8
|
+
ExecutionEnvironmentConfigUpdatePayload,
|
|
8
9
|
ExecutionEnvironmentCreatePayload,
|
|
9
|
-
ExecutionEnvironmentRef,
|
|
10
10
|
ExecutionEnvironmentUpdatePayload,
|
|
11
|
-
LoadBalancingEnvConfig,
|
|
12
|
-
MediatorEnvConfig,
|
|
13
11
|
MigrateInteractionsPayload,
|
|
14
12
|
MigrateInteractionsResult,
|
|
15
13
|
} from '@vertesia/common';
|
|
@@ -23,7 +21,7 @@ export default class EnvironmentsApi extends ApiTopic {
|
|
|
23
21
|
* List all environments for the current project
|
|
24
22
|
* @param all if true, list all environments, otherwise only the ones for the current project
|
|
25
23
|
*/
|
|
26
|
-
list(all: boolean = false): Promise<
|
|
24
|
+
list(all: boolean = false): Promise<ExecutionEnvironment[]> {
|
|
27
25
|
const query = all ? { all: true } : undefined;
|
|
28
26
|
|
|
29
27
|
return this.get('/', { query });
|
|
@@ -54,13 +52,7 @@ export default class EnvironmentsApi extends ApiTopic {
|
|
|
54
52
|
* @param payload
|
|
55
53
|
* @returns
|
|
56
54
|
*/
|
|
57
|
-
updateConfig(
|
|
58
|
-
id: string,
|
|
59
|
-
payload: {
|
|
60
|
-
enabled_models?: AIModel[];
|
|
61
|
-
config?: MediatorEnvConfig | LoadBalancingEnvConfig;
|
|
62
|
-
},
|
|
63
|
-
): Promise<ExecutionEnvironment> {
|
|
55
|
+
updateConfig(id: string, payload: ExecutionEnvironmentConfigUpdatePayload): Promise<ExecutionEnvironment> {
|
|
64
56
|
return this.put(`/${id}/config`, {
|
|
65
57
|
payload,
|
|
66
58
|
});
|
package/src/GroupsApi.ts
CHANGED
|
@@ -12,6 +12,8 @@ export interface GroupsQueryOptions {
|
|
|
12
12
|
tags?: string[];
|
|
13
13
|
limit?: number;
|
|
14
14
|
offset?: number;
|
|
15
|
+
/** Only return groups usable in this project (org-wide + restricted-to-this-project). */
|
|
16
|
+
project?: string;
|
|
15
17
|
[key: string]: string | string[] | number | undefined;
|
|
16
18
|
}
|
|
17
19
|
|
package/src/OAuthGrantsApi.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type {
|
|
|
5
5
|
OAuthGrant,
|
|
6
6
|
OAuthGrantListResponse,
|
|
7
7
|
OAuthGrantRevokeResponse,
|
|
8
|
+
RevokeOAuthGrantQuery,
|
|
8
9
|
} from '@vertesia/common';
|
|
9
10
|
|
|
10
11
|
function toQueryRecord(query?: ListOAuthGrantsQuery): Record<string, string> | undefined {
|
|
@@ -32,7 +33,7 @@ export default class OAuthGrantsApi extends ApiTopic {
|
|
|
32
33
|
return this.get(`/${grantId}`);
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
revoke(grantId: string, query?:
|
|
36
|
+
revoke(grantId: string, query?: RevokeOAuthGrantQuery): Promise<OAuthGrantRevokeResponse> {
|
|
36
37
|
return this.del(`/${grantId}`, { query });
|
|
37
38
|
}
|
|
38
39
|
|
package/src/OAuthProvidersApi.ts
CHANGED
|
@@ -30,7 +30,12 @@ export default class OAuthProvidersApi extends ApiTopic {
|
|
|
30
30
|
return this.put(`/${id}`, { payload });
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
/**
|
|
34
|
+
* `SuccessResponse`, not `void`: the endpoint has always returned `{ success: true }` and the
|
|
35
|
+
* document has always published it. Typing it as `void` meant a caller could not read the one
|
|
36
|
+
* field it sends without casting.
|
|
37
|
+
*/
|
|
38
|
+
remove(id: string): Promise<SuccessResponse> {
|
|
34
39
|
return this.del(`/${id}`);
|
|
35
40
|
}
|
|
36
41
|
|
package/src/PromptsApi.ts
CHANGED
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
import type { PromptRole } from '@llumiverse/common';
|
|
2
1
|
import { ApiTopic, type ClientBase } from '@vertesia/api-fetch-client';
|
|
3
2
|
import type {
|
|
3
|
+
ComputedFacetResponse,
|
|
4
4
|
ComputePromptFacetPayload,
|
|
5
5
|
PromptSearchPayload,
|
|
6
6
|
PromptSearchQuery,
|
|
7
7
|
PromptTemplate,
|
|
8
8
|
PromptTemplateCreatePayload,
|
|
9
9
|
PromptTemplateForkPayload,
|
|
10
|
+
PromptTemplateInteractionsResponse,
|
|
10
11
|
PromptTemplateRef,
|
|
11
12
|
PromptTemplateUpdatePayload,
|
|
12
|
-
|
|
13
|
+
RenderPromptPayload,
|
|
14
|
+
RenderPromptResponse,
|
|
13
15
|
} from '@vertesia/common';
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated Use `ComputedFacetResponse` from `@vertesia/common`, which is what the endpoint
|
|
19
|
+
* publishes. This restated the facet buckets in their pre-collapse shape: `total` is a number by
|
|
20
|
+
* the time the response is written, not a one-element array.
|
|
21
|
+
*/
|
|
22
|
+
export type ComputePromptFacetsResponse = ComputedFacetResponse;
|
|
19
23
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
name: string;
|
|
23
|
-
role: PromptRole;
|
|
24
|
-
content_type: TemplateType;
|
|
25
|
-
rendered: string;
|
|
26
|
-
}
|
|
24
|
+
/** @deprecated Use `RenderPromptResponse` from `@vertesia/common`. */
|
|
25
|
+
export type PromptRenderResponse = RenderPromptResponse;
|
|
27
26
|
|
|
28
27
|
export default class PromptsApi extends ApiTopic {
|
|
29
28
|
constructor(parent: ClientBase) {
|
|
@@ -48,9 +47,9 @@ export default class PromptsApi extends ApiTopic {
|
|
|
48
47
|
/**
|
|
49
48
|
* Get the list of all prompt facets
|
|
50
49
|
* @param payload query payload to filter facet search
|
|
51
|
-
* @returns
|
|
50
|
+
* @returns ComputedFacetResponse
|
|
52
51
|
**/
|
|
53
|
-
computeFacets(query: ComputePromptFacetPayload): Promise<
|
|
52
|
+
computeFacets(query: ComputePromptFacetPayload): Promise<ComputedFacetResponse> {
|
|
54
53
|
return this.post('/facets', {
|
|
55
54
|
payload: query,
|
|
56
55
|
});
|
|
@@ -125,7 +124,7 @@ export default class PromptsApi extends ApiTopic {
|
|
|
125
124
|
* @throws 404 if not found
|
|
126
125
|
* @throws 403 if the prompt is not in the current project
|
|
127
126
|
*/
|
|
128
|
-
render(id: string, payload:
|
|
127
|
+
render(id: string, payload: RenderPromptPayload): Promise<RenderPromptResponse> {
|
|
129
128
|
return this.post(`/${id}/render`, {
|
|
130
129
|
payload,
|
|
131
130
|
});
|
|
@@ -153,7 +152,7 @@ export default class PromptsApi extends ApiTopic {
|
|
|
153
152
|
/**
|
|
154
153
|
* Retrieve list of interactions that use the prompt template
|
|
155
154
|
*/
|
|
156
|
-
listInteractions(id: string): Promise<
|
|
155
|
+
listInteractions(id: string): Promise<PromptTemplateInteractionsResponse> {
|
|
157
156
|
return this.get(`/${id}/interactions`);
|
|
158
157
|
}
|
|
159
158
|
|
|
@@ -167,11 +166,9 @@ export default class PromptsApi extends ApiTopic {
|
|
|
167
166
|
}
|
|
168
167
|
}
|
|
169
168
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}[];
|
|
177
|
-
}
|
|
169
|
+
/**
|
|
170
|
+
* @deprecated Use `PromptTemplateInteractionsResponse` from `@vertesia/common`, which is what the
|
|
171
|
+
* endpoint publishes. This declared `versions: string[]`; the endpoint has always sent
|
|
172
|
+
* `[{ version: number }]`.
|
|
173
|
+
*/
|
|
174
|
+
export type ListInteractionsResponse = PromptTemplateInteractionsResponse;
|
package/src/client.test.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { APP_VERSION_HEADER } from '@vertesia/common';
|
|
1
2
|
import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';
|
|
2
3
|
import { isTokenExpired, VertesiaClient } from './client.js';
|
|
3
4
|
|
|
@@ -145,6 +146,21 @@ describe('Test Vertesia Client', () => {
|
|
|
145
146
|
expect(client.baseUrl).toBe('https://studio-server-production.api.becomposable.com');
|
|
146
147
|
expect(client.storeUrl).toBe('https://zeno-server-production.api.becomposable.com');
|
|
147
148
|
});
|
|
149
|
+
|
|
150
|
+
test('withAppVersion keeps Studio and Store requests pinned together', () => {
|
|
151
|
+
const client = new VertesiaClient({
|
|
152
|
+
serverUrl: 'https://studio-server-production.api.becomposable.com',
|
|
153
|
+
storeUrl: 'https://zeno-server-production.api.becomposable.com',
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
expect(client.withAppVersion('candidate-v1')).toBe(client);
|
|
157
|
+
expect(client.headers[APP_VERSION_HEADER]).toBe('candidate-v1');
|
|
158
|
+
expect(client.store.headers[APP_VERSION_HEADER]).toBe('candidate-v1');
|
|
159
|
+
|
|
160
|
+
client.withAppVersion(null);
|
|
161
|
+
expect(client.headers[APP_VERSION_HEADER]).toBeUndefined();
|
|
162
|
+
expect(client.store.headers[APP_VERSION_HEADER]).toBeUndefined();
|
|
163
|
+
});
|
|
148
164
|
});
|
|
149
165
|
|
|
150
166
|
describe('isTokenExpired', () => {
|
package/src/client.ts
CHANGED
|
@@ -248,6 +248,7 @@ export class VertesiaClient extends AbstractFetchClient<VertesiaClient> {
|
|
|
248
248
|
* exact built version instead of the promoted version. Pass null/empty to clear (→ promoted).
|
|
249
249
|
*/
|
|
250
250
|
withAppVersion(version: string | null | undefined) {
|
|
251
|
+
this.store.withAppVersion(version);
|
|
251
252
|
if (!version) {
|
|
252
253
|
delete this.headers[APP_VERSION_HEADER];
|
|
253
254
|
} else {
|