@vertesia/client 1.5.0-dev.20260722.120446Z → 1.5.0-dev.20260804.124748Z
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/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 +7 -1
- package/lib/AppsApi.d.ts.map +1 -1
- package/lib/AppsApi.js +12 -0
- package/lib/AppsApi.js.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/InteractionBase.d.ts +686 -2
- package/lib/InteractionBase.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/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/client.d.ts +10 -2
- package/lib/client.d.ts.map +1 -1
- package/lib/store/AgentsApi.d.ts +5 -1
- package/lib/store/AgentsApi.d.ts.map +1 -1
- package/lib/store/AgentsApi.js +129 -77
- package/lib/store/AgentsApi.js.map +1 -1
- package/lib/store/FilesApi.d.ts.map +1 -1
- package/lib/store/FilesApi.js +10 -4
- package/lib/store/FilesApi.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 +5 -4
- package/lib/store/ObjectsApi.js.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/uploadMimeType.d.ts +3 -0
- package/lib/store/uploadMimeType.d.ts.map +1 -0
- package/lib/store/uploadMimeType.js +11 -0
- package/lib/store/uploadMimeType.js.map +1 -0
- package/lib/store/version.d.ts +1 -2
- package/lib/store/version.d.ts.map +1 -1
- package/lib/store/version.js +3 -2
- 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.test.ts +14 -6
- package/src/AppsApi.ts +19 -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/store/AgentsApi.stream.test.ts +298 -0
- package/src/store/AgentsApi.ts +137 -68
- package/src/store/FilesApi.ts +10 -4
- package/src/store/ObjectsApi.ts +11 -10
- package/src/store/TaskApi.ts +11 -11
- package/src/store/TypeCatalogApi.ts +21 -7
- package/src/store/TypesApi.ts +2 -1
- package/src/store/uploadMimeType.test.ts +22 -0
- package/src/store/uploadMimeType.ts +16 -0
- package/src/store/version.ts +3 -2
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.20260804.124748Z",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -12,16 +12,16 @@
|
|
|
12
12
|
"license": "Apache-2.0",
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"@types/node": "^24.13.3",
|
|
15
|
-
"rolldown": "1.
|
|
15
|
+
"rolldown": "1.2.0",
|
|
16
16
|
"typescript": "^6.0.3",
|
|
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/common": "1.5.0-dev.
|
|
24
|
-
"@vertesia/api-fetch-client": "1.5.0-dev.
|
|
22
|
+
"@llumiverse/common": "1.5.0-dev.20260804.122431Z",
|
|
23
|
+
"@vertesia/common": "1.5.0-dev.20260804.124748Z",
|
|
24
|
+
"@vertesia/api-fetch-client": "1.5.0-dev.20260804.124748Z"
|
|
25
25
|
},
|
|
26
26
|
"exports": {
|
|
27
27
|
".": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"ai",
|
|
49
49
|
"typescript"
|
|
50
50
|
],
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "87ac9166db2b38bd1be6e37adf0414ea83e402ee",
|
|
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.test.ts
CHANGED
|
@@ -106,10 +106,13 @@ describe('AppsApi', () => {
|
|
|
106
106
|
|
|
107
107
|
expect(result.commit).toBe('2'.repeat(40));
|
|
108
108
|
const request = requests[0];
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
expect(
|
|
109
|
+
if (!request) {
|
|
110
|
+
throw new Error('Expected a multipart document request');
|
|
111
|
+
}
|
|
112
|
+
expect(request.url).toBe('https://studio.example.com/api/v1/apps/sample-app/repo/documents');
|
|
113
|
+
expect(request.headers.get('content-type')).toContain('multipart/form-data; boundary=');
|
|
114
|
+
const form = await request.formData();
|
|
115
|
+
expect(JSON.parse(String(form.get('metadata')))).toEqual({
|
|
113
116
|
ref: 'main',
|
|
114
117
|
expected_head: '1'.repeat(40),
|
|
115
118
|
message: 'Add docs',
|
|
@@ -118,7 +121,12 @@ describe('AppsApi', () => {
|
|
|
118
121
|
{ field: 'file_1', path: 'docs/diagram.png' },
|
|
119
122
|
],
|
|
120
123
|
});
|
|
121
|
-
|
|
122
|
-
|
|
124
|
+
const guideFile = form.get('file_0');
|
|
125
|
+
const diagramFile = form.get('file_1');
|
|
126
|
+
if (!(guideFile instanceof File) || !(diagramFile instanceof File)) {
|
|
127
|
+
throw new Error('Expected multipart file entries');
|
|
128
|
+
}
|
|
129
|
+
expect(guideFile.name).toBe('guide.md');
|
|
130
|
+
expect(diagramFile.size).toBe(3);
|
|
123
131
|
});
|
|
124
132
|
});
|
package/src/AppsApi.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { ApiTopic, type ClientBase, type ServerError } from '@vertesia/api-fetch
|
|
|
2
2
|
import type {
|
|
3
3
|
AppBuildProgress,
|
|
4
4
|
AppDeleteSummary,
|
|
5
|
+
AppDevelopmentTaskDetails,
|
|
6
|
+
AppDevelopmentTaskList,
|
|
5
7
|
AppInspectionResult,
|
|
6
8
|
AppInstallation,
|
|
7
9
|
AppInstallationKind,
|
|
@@ -12,6 +14,7 @@ import type {
|
|
|
12
14
|
AppManifestData,
|
|
13
15
|
AppPackage,
|
|
14
16
|
AppPackageScope,
|
|
17
|
+
AppRepoBranch,
|
|
15
18
|
AppRepoCommits,
|
|
16
19
|
AppRepoDocumentCommit,
|
|
17
20
|
AppRepoRefs,
|
|
@@ -21,6 +24,7 @@ import type {
|
|
|
21
24
|
AppVersionListQuery,
|
|
22
25
|
AppVersionRecord,
|
|
23
26
|
CountResult,
|
|
27
|
+
CreateAppRepoBranchRequest,
|
|
24
28
|
DeleteAppVersionResponse,
|
|
25
29
|
ProjectRef,
|
|
26
30
|
PromoteAppVersionResponse,
|
|
@@ -218,6 +222,21 @@ export default class AppsApi extends ApiTopic {
|
|
|
218
222
|
return this.get(`/${encodeURIComponent(appIdOrName)}/repo/refs`);
|
|
219
223
|
}
|
|
220
224
|
|
|
225
|
+
/** List mutable development tasks represented by `agent/*` repository branches. */
|
|
226
|
+
listDevelopmentTasks(appIdOrName: string): Promise<AppDevelopmentTaskList> {
|
|
227
|
+
return this.get(`/${encodeURIComponent(appIdOrName)}/development-tasks`);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/** Get a development task and its latest parent Studio Assistant run, when started. */
|
|
231
|
+
getDevelopmentTask(appIdOrName: string, taskId: string): Promise<AppDevelopmentTaskDetails> {
|
|
232
|
+
return this.get(`/${encodeURIComponent(appIdOrName)}/development-tasks/${encodeURIComponent(taskId)}`);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/** Create a repository branch from an existing branch, tag, or commit. */
|
|
236
|
+
createRepoBranch(appIdOrName: string, payload: CreateAppRepoBranchRequest): Promise<AppRepoBranch> {
|
|
237
|
+
return this.post(`/${encodeURIComponent(appIdOrName)}/repo/branches`, { payload });
|
|
238
|
+
}
|
|
239
|
+
|
|
221
240
|
/**
|
|
222
241
|
* Get the promoted package an app exposes, filtered by scope. App-owned (in-code) artifacts are
|
|
223
242
|
* package-resolved (no per-id route), so this is how a client reads the full definition — type
|
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;
|