@vertesia/client 1.6.0-dev.20260923.085325Z → 1.6.0-dev.20261008.064737Z
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/AuditTrailApi.d.ts +3 -1
- package/lib/AuditTrailApi.d.ts.map +1 -1
- package/lib/AuditTrailApi.js +6 -0
- package/lib/AuditTrailApi.js.map +1 -1
- package/lib/EnvironmentsApi.d.ts +2 -1
- package/lib/EnvironmentsApi.d.ts.map +1 -1
- package/lib/EnvironmentsApi.js +3 -0
- package/lib/EnvironmentsApi.js.map +1 -1
- package/lib/InferenceProfilesApi.d.ts +14 -0
- package/lib/InferenceProfilesApi.d.ts.map +1 -0
- package/lib/InferenceProfilesApi.js +33 -0
- package/lib/InferenceProfilesApi.js.map +1 -0
- package/lib/InteractionBase.d.ts +2 -954
- package/lib/InteractionBase.d.ts.map +1 -1
- package/lib/InteractionConfigurationsApi.d.ts +9 -0
- package/lib/InteractionConfigurationsApi.d.ts.map +1 -0
- package/lib/InteractionConfigurationsApi.js +16 -0
- package/lib/InteractionConfigurationsApi.js.map +1 -0
- package/lib/InteractionsApi.d.ts +2 -7
- package/lib/InteractionsApi.d.ts.map +1 -1
- package/lib/InteractionsApi.js.map +1 -1
- package/lib/client.d.ts +6 -12
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +4 -3
- package/lib/client.js.map +1 -1
- package/lib/execute.d.ts.map +1 -1
- package/lib/execute.js +9 -2
- package/lib/execute.js.map +1 -1
- package/lib/index.d.ts +0 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +0 -2
- package/lib/index.js.map +1 -1
- package/lib/managed-sse.d.ts.map +1 -1
- package/lib/managed-sse.js +2 -3
- package/lib/managed-sse.js.map +1 -1
- package/lib/store/AgentsApi.d.ts +6 -1
- package/lib/store/AgentsApi.d.ts.map +1 -1
- package/lib/store/AgentsApi.js +12 -4
- package/lib/store/AgentsApi.js.map +1 -1
- package/lib/store/ContentApi.d.ts +111 -0
- package/lib/store/ContentApi.d.ts.map +1 -0
- package/lib/store/ContentApi.js +83 -0
- package/lib/store/ContentApi.js.map +1 -0
- package/lib/store/DataApi.d.ts +1 -1
- package/lib/store/DataApi.js +1 -1
- package/lib/store/IndexingApi.d.ts +1 -1
- package/lib/store/IndexingApi.d.ts.map +1 -1
- package/lib/store/IndexingApi.js +2 -1
- package/lib/store/IndexingApi.js.map +1 -1
- package/lib/store/WorkflowsApi.d.ts.map +1 -1
- package/lib/store/WorkflowsApi.js +6 -1
- package/lib/store/WorkflowsApi.js.map +1 -1
- package/lib/store/client.d.ts +2 -0
- package/lib/store/client.d.ts.map +1 -1
- package/lib/store/client.js +2 -0
- package/lib/store/client.js.map +1 -1
- package/lib/store/index.d.ts +1 -0
- package/lib/store/index.d.ts.map +1 -1
- package/lib/store/index.js +1 -0
- package/lib/store/index.js.map +1 -1
- package/lib/store/signed-url.d.ts +13 -0
- package/lib/store/signed-url.d.ts.map +1 -1
- package/lib/store/signed-url.js +29 -1
- package/lib/store/signed-url.js.map +1 -1
- package/lib/vertesia-client.js +4 -4
- package/lib/vertesia-client.js.map +1 -1
- package/package.json +12 -11
- package/src/AuditTrailApi.ts +12 -0
- package/src/EnvironmentsApi.ts +6 -0
- package/src/InferenceProfilesApi.ts +47 -0
- package/src/InteractionConfigurationsApi.ts +20 -0
- package/src/InteractionsApi.ts +2 -9
- package/src/client.ts +4 -3
- package/src/execute.ts +15 -4
- package/src/index.ts +0 -2
- package/src/managed-sse.ts +2 -5
- package/src/store/AgentsApi.ts +14 -4
- package/src/store/ContentApi.ts +158 -0
- package/src/store/DataApi.ts +1 -1
- package/src/store/IndexingApi.ts +2 -0
- package/src/store/WorkflowsApi.ts +5 -1
- package/src/store/client.ts +2 -0
- package/src/store/index.ts +1 -0
- package/src/store/signed-url.ts +32 -1
- package/lib/InternalAccountsApi.d.ts +0 -7
- package/lib/InternalAccountsApi.d.ts.map +0 -1
- package/lib/InternalAccountsApi.js +0 -10
- package/lib/InternalAccountsApi.js.map +0 -1
- package/lib/InternalSecretsApi.d.ts +0 -18
- package/lib/InternalSecretsApi.d.ts.map +0 -1
- package/lib/InternalSecretsApi.js +0 -29
- package/lib/InternalSecretsApi.js.map +0 -1
- package/src/AccountApi.test.ts +0 -30
- package/src/AppsApi.test.ts +0 -132
- package/src/EnvironmentsApi.test.ts +0 -39
- package/src/InteractionOutput.test.ts +0 -338
- package/src/InternalAccountsApi.ts +0 -12
- package/src/InternalSecretsApi.ts +0 -63
- package/src/OAuthServerApi.test.ts +0 -56
- package/src/ProjectsApi.test.ts +0 -33
- package/src/RunsApi.test.ts +0 -24
- package/src/ViewsApi.test.ts +0 -38
- package/src/app-session.test.ts +0 -23
- package/src/bundle-isolation.test.ts +0 -37
- package/src/client.test.ts +0 -332
- package/src/execute.test.ts +0 -22
- package/src/store/AgentsApi.artifacts.test.ts +0 -119
- package/src/store/AgentsApi.history.test.ts +0 -29
- package/src/store/AgentsApi.stream.test.ts +0 -386
- package/src/store/DataApi.test.ts +0 -42
- package/src/store/EmbeddingsApi.test.ts +0 -31
- package/src/store/EventsApi.test.ts +0 -131
- package/src/store/FilesApi.test.ts +0 -118
- package/src/store/ObjectsApi.test.ts +0 -50
- package/src/store/ProcessApi.test.ts +0 -24
- package/src/store/ViewsApi.test.ts +0 -33
- package/src/store/signed-url.test.ts +0 -204
- package/src/store/stream-gap.test.ts +0 -230
- package/src/store/stream-termination.test.ts +0 -82
- package/src/store/uploadMimeType.test.ts +0 -22
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ApiTopic, type ClientBase } from '@vertesia/api-fetch-client';
|
|
2
|
-
import type { AccountApiVersionPolicy } from '@vertesia/common';
|
|
3
|
-
export default class InternalAccountsApi extends ApiTopic {
|
|
4
|
-
constructor(parent: ClientBase);
|
|
5
|
-
getApiVersionPolicy(accountId: string): Promise<AccountApiVersionPolicy>;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=InternalAccountsApi.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InternalAccountsApi.d.ts","sourceRoot":"","sources":["../src/InternalAccountsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAEhE,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,QAAQ;IACrD,YAAY,MAAM,EAAE,UAAU,EAE7B;IAED,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAEvE;CACJ"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ApiTopic } from '@vertesia/api-fetch-client';
|
|
2
|
-
export default class InternalAccountsApi extends ApiTopic {
|
|
3
|
-
constructor(parent) {
|
|
4
|
-
super(parent, '/internal/accounts');
|
|
5
|
-
}
|
|
6
|
-
getApiVersionPolicy(accountId) {
|
|
7
|
-
return this.get(`/${encodeURIComponent(accountId)}/api-version-policy`);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=InternalAccountsApi.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InternalAccountsApi.js","sourceRoot":"","sources":["../src/InternalAccountsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAmB,MAAM,4BAA4B,CAAC;AAGvE,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,QAAQ;IACrD,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IACxC,CAAC;IAED,mBAAmB,CAAC,SAAiB;QACjC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,kBAAkB,CAAC,SAAS,CAAC,qBAAqB,CAAC,CAAC;IAC5E,CAAC;CACJ"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ApiTopic, type ClientBase } from '@vertesia/api-fetch-client';
|
|
2
|
-
import type { EventIngestSigningSecretRequest, EventIngestSigningSecretResponse, EventWebhookSigningSecretRequest, EventWebhookSigningSecretResponse, GithubInstallationTokenRequest, GithubInstallationTokenResponse, SignEventWebhookRequest, SignEventWebhookResponse, VerifyEventIngestSignatureRequest, VerifyEventIngestSignatureResponse } from '@vertesia/common';
|
|
3
|
-
export default class InternalSecretsApi extends ApiTopic {
|
|
4
|
-
constructor(parent: ClientBase);
|
|
5
|
-
rotateEventWebhookSigningSecret(subscriptionId: string, payload: EventWebhookSigningSecretRequest): Promise<EventWebhookSigningSecretResponse>;
|
|
6
|
-
deleteEventWebhookSigningSecret(subscriptionId: string, payload: EventWebhookSigningSecretRequest): Promise<{
|
|
7
|
-
deleted: true;
|
|
8
|
-
}>;
|
|
9
|
-
signEventWebhook(subscriptionId: string, payload: SignEventWebhookRequest): Promise<SignEventWebhookResponse>;
|
|
10
|
-
rotateEventIngestChannelSigningSecret(channelId: string, payload: EventIngestSigningSecretRequest): Promise<EventIngestSigningSecretResponse>;
|
|
11
|
-
deleteEventIngestChannelSigningSecret(channelId: string, payload: EventIngestSigningSecretRequest): Promise<{
|
|
12
|
-
deleted: true;
|
|
13
|
-
}>;
|
|
14
|
-
verifyEventIngestSignature(channelId: string, payload: VerifyEventIngestSignatureRequest): Promise<VerifyEventIngestSignatureResponse>;
|
|
15
|
-
/** Mint a short-lived, repository-scoped GitHub App installation token for the project. */
|
|
16
|
-
mintGithubInstallationToken(payload: GithubInstallationTokenRequest): Promise<GithubInstallationTokenResponse>;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=InternalSecretsApi.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InternalSecretsApi.d.ts","sourceRoot":"","sources":["../src/InternalSecretsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,KAAK,EACR,+BAA+B,EAC/B,gCAAgC,EAChC,gCAAgC,EAChC,iCAAiC,EACjC,8BAA8B,EAC9B,+BAA+B,EAC/B,uBAAuB,EACvB,wBAAwB,EACxB,iCAAiC,EACjC,kCAAkC,EACrC,MAAM,kBAAkB,CAAC;AAE1B,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,QAAQ;IACpD,YAAY,MAAM,EAAE,UAAU,EAE7B;IAED,+BAA+B,CAC3B,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,gCAAgC,GAC1C,OAAO,CAAC,iCAAiC,CAAC,CAE5C;IAED,+BAA+B,CAC3B,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,gCAAgC,GAC1C,OAAO,CAAC;QAAE,OAAO,EAAE,IAAI,CAAA;KAAE,CAAC,CAE5B;IAED,gBAAgB,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAE5G;IAED,qCAAqC,CACjC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,+BAA+B,GACzC,OAAO,CAAC,gCAAgC,CAAC,CAE3C;IAED,qCAAqC,CACjC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,+BAA+B,GACzC,OAAO,CAAC;QAAE,OAAO,EAAE,IAAI,CAAA;KAAE,CAAC,CAE5B;IAED,0BAA0B,CACtB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,iCAAiC,GAC3C,OAAO,CAAC,kCAAkC,CAAC,CAE7C;IAED,2FAA2F;IAC3F,2BAA2B,CAAC,OAAO,EAAE,8BAA8B,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAE7G;CACJ"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { ApiTopic } from '@vertesia/api-fetch-client';
|
|
2
|
-
export default class InternalSecretsApi extends ApiTopic {
|
|
3
|
-
constructor(parent) {
|
|
4
|
-
super(parent, '/internal/secrets');
|
|
5
|
-
}
|
|
6
|
-
rotateEventWebhookSigningSecret(subscriptionId, payload) {
|
|
7
|
-
return this.post(`/event-webhooks/${subscriptionId}/rotate`, { payload });
|
|
8
|
-
}
|
|
9
|
-
deleteEventWebhookSigningSecret(subscriptionId, payload) {
|
|
10
|
-
return this.post(`/event-webhooks/${subscriptionId}/delete`, { payload });
|
|
11
|
-
}
|
|
12
|
-
signEventWebhook(subscriptionId, payload) {
|
|
13
|
-
return this.post(`/event-webhooks/${subscriptionId}/sign`, { payload });
|
|
14
|
-
}
|
|
15
|
-
rotateEventIngestChannelSigningSecret(channelId, payload) {
|
|
16
|
-
return this.post(`/event-ingest-channels/${channelId}/rotate`, { payload });
|
|
17
|
-
}
|
|
18
|
-
deleteEventIngestChannelSigningSecret(channelId, payload) {
|
|
19
|
-
return this.post(`/event-ingest-channels/${channelId}/delete`, { payload });
|
|
20
|
-
}
|
|
21
|
-
verifyEventIngestSignature(channelId, payload) {
|
|
22
|
-
return this.post(`/event-ingest-channels/${channelId}/verify`, { payload });
|
|
23
|
-
}
|
|
24
|
-
/** Mint a short-lived, repository-scoped GitHub App installation token for the project. */
|
|
25
|
-
mintGithubInstallationToken(payload) {
|
|
26
|
-
return this.post('/github/installation-token', { payload });
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=InternalSecretsApi.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InternalSecretsApi.js","sourceRoot":"","sources":["../src/InternalSecretsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAmB,MAAM,4BAA4B,CAAC;AAcvE,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,QAAQ;IACpD,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IACvC,CAAC;IAED,+BAA+B,CAC3B,cAAsB,EACtB,OAAyC;QAEzC,OAAO,IAAI,CAAC,IAAI,CAAC,mBAAmB,cAAc,SAAS,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC;IAED,+BAA+B,CAC3B,cAAsB,EACtB,OAAyC;QAEzC,OAAO,IAAI,CAAC,IAAI,CAAC,mBAAmB,cAAc,SAAS,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC;IAED,gBAAgB,CAAC,cAAsB,EAAE,OAAgC;QACrE,OAAO,IAAI,CAAC,IAAI,CAAC,mBAAmB,cAAc,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED,qCAAqC,CACjC,SAAiB,EACjB,OAAwC;QAExC,OAAO,IAAI,CAAC,IAAI,CAAC,0BAA0B,SAAS,SAAS,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;IAED,qCAAqC,CACjC,SAAiB,EACjB,OAAwC;QAExC,OAAO,IAAI,CAAC,IAAI,CAAC,0BAA0B,SAAS,SAAS,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;IAED,0BAA0B,CACtB,SAAiB,EACjB,OAA0C;QAE1C,OAAO,IAAI,CAAC,IAAI,CAAC,0BAA0B,SAAS,SAAS,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;IAED,2FAA2F;IAC3F,2BAA2B,CAAC,OAAuC;QAC/D,OAAO,IAAI,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;CACJ"}
|
package/src/AccountApi.test.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
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/AppsApi.test.ts
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
2
|
-
import { VertesiaClient } from './client.js';
|
|
3
|
-
|
|
4
|
-
describe('AppsApi', () => {
|
|
5
|
-
it('starts an in-place version rebuild without a caller-controlled payload', async () => {
|
|
6
|
-
const requests: Request[] = [];
|
|
7
|
-
const fetchMock = vi.fn(async () =>
|
|
8
|
-
Response.json({
|
|
9
|
-
workflow_id: 'workflow-1',
|
|
10
|
-
run_id: 'run-1',
|
|
11
|
-
app_id: 'sample-app',
|
|
12
|
-
version_id: 'version-1',
|
|
13
|
-
rebuild_version_record_id: 'record-1',
|
|
14
|
-
}),
|
|
15
|
-
);
|
|
16
|
-
const client = new VertesiaClient({
|
|
17
|
-
serverUrl: 'https://studio.example.com',
|
|
18
|
-
storeUrl: 'https://zeno.example.com',
|
|
19
|
-
fetch: fetchMock,
|
|
20
|
-
onRequest: (request) => requests.push(request),
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
const result = await client.apps.rebuildVersion('record-1');
|
|
24
|
-
|
|
25
|
-
expect(result.version_id).toBe('version-1');
|
|
26
|
-
expect(requests[0]?.method).toBe('POST');
|
|
27
|
-
expect(requests[0]?.url).toBe('https://studio.example.com/api/v1/apps/versions/record-1/rebuild');
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
it('deletes a version through its dedicated endpoint', async () => {
|
|
31
|
-
const requests: Request[] = [];
|
|
32
|
-
const fetchMock = vi.fn(async () =>
|
|
33
|
-
Response.json({
|
|
34
|
-
id: 'record-1',
|
|
35
|
-
app_id: 'sample-app',
|
|
36
|
-
version_id: 'version-1',
|
|
37
|
-
deleted: true,
|
|
38
|
-
warnings: [],
|
|
39
|
-
}),
|
|
40
|
-
);
|
|
41
|
-
const client = new VertesiaClient({
|
|
42
|
-
serverUrl: 'https://studio.example.com',
|
|
43
|
-
storeUrl: 'https://zeno.example.com',
|
|
44
|
-
fetch: fetchMock,
|
|
45
|
-
onRequest: (request) => requests.push(request),
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
const result = await client.apps.deleteVersion('record-1');
|
|
49
|
-
|
|
50
|
-
expect(result.deleted).toBe(true);
|
|
51
|
-
expect(requests[0]?.method).toBe('DELETE');
|
|
52
|
-
expect(requests[0]?.url).toBe('https://studio.example.com/api/v1/apps/versions/record-1');
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it('returns the original response bytes and content type', async () => {
|
|
56
|
-
const requests: Request[] = [];
|
|
57
|
-
const bytes = new Uint8Array([0, 255, 10, 42]);
|
|
58
|
-
const fetchMock = vi.fn(
|
|
59
|
-
async () =>
|
|
60
|
-
new Response(bytes, {
|
|
61
|
-
status: 200,
|
|
62
|
-
headers: { 'content-type': 'application/octet-stream' },
|
|
63
|
-
}),
|
|
64
|
-
);
|
|
65
|
-
const client = new VertesiaClient({
|
|
66
|
-
serverUrl: 'https://studio.example.com',
|
|
67
|
-
storeUrl: 'https://zeno.example.com',
|
|
68
|
-
fetch: fetchMock,
|
|
69
|
-
onRequest: (request) => requests.push(request),
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
const response = await client.apps.getRepoFile('sample-app', 'docs/file.bin', { ref: 'feature/demo' });
|
|
73
|
-
|
|
74
|
-
expect(response.headers.get('content-type')).toBe('application/octet-stream');
|
|
75
|
-
expect(new Uint8Array(await response.arrayBuffer())).toEqual(bytes);
|
|
76
|
-
expect(requests[0]?.url).toBe(
|
|
77
|
-
'https://studio.example.com/api/v1/apps/sample-app/repo/file?path=docs%2Ffile.bin&ref=feature%2Fdemo',
|
|
78
|
-
);
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
it('uploads multiple documents as one multipart commit request', async () => {
|
|
82
|
-
const requests: Request[] = [];
|
|
83
|
-
const fetchMock = vi.fn(async () =>
|
|
84
|
-
Response.json({
|
|
85
|
-
ref: 'main',
|
|
86
|
-
previous_commit: '1'.repeat(40),
|
|
87
|
-
commit: '2'.repeat(40),
|
|
88
|
-
paths: ['docs/guide.md', 'docs/diagram.png'],
|
|
89
|
-
}),
|
|
90
|
-
);
|
|
91
|
-
const client = new VertesiaClient({
|
|
92
|
-
serverUrl: 'https://studio.example.com',
|
|
93
|
-
storeUrl: 'https://zeno.example.com',
|
|
94
|
-
fetch: fetchMock,
|
|
95
|
-
onRequest: (request) => requests.push(request),
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
const result = await client.apps.commitRepoDocuments(
|
|
99
|
-
'sample-app',
|
|
100
|
-
[
|
|
101
|
-
{ path: 'docs/guide.md', content: new Blob(['# Guide']), fileName: 'guide.md' },
|
|
102
|
-
{ path: 'docs/diagram.png', content: new Blob([new Uint8Array([1, 2, 3])]), fileName: 'diagram.png' },
|
|
103
|
-
],
|
|
104
|
-
{ ref: 'main', expectedHead: '1'.repeat(40), message: 'Add docs' },
|
|
105
|
-
);
|
|
106
|
-
|
|
107
|
-
expect(result.commit).toBe('2'.repeat(40));
|
|
108
|
-
const request = requests[0];
|
|
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({
|
|
116
|
-
ref: 'main',
|
|
117
|
-
expected_head: '1'.repeat(40),
|
|
118
|
-
message: 'Add docs',
|
|
119
|
-
files: [
|
|
120
|
-
{ field: 'file_0', path: 'docs/guide.md' },
|
|
121
|
-
{ field: 'file_1', path: 'docs/diagram.png' },
|
|
122
|
-
],
|
|
123
|
-
});
|
|
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);
|
|
131
|
-
});
|
|
132
|
-
});
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
2
|
-
import { VertesiaClient } from './client.js';
|
|
3
|
-
|
|
4
|
-
describe('EnvironmentsApi', () => {
|
|
5
|
-
it('encodes model IDs in disableModel paths', async () => {
|
|
6
|
-
const requests: Request[] = [];
|
|
7
|
-
const fetchMock = vi.fn(async () => {
|
|
8
|
-
return new Response(
|
|
9
|
-
JSON.stringify({
|
|
10
|
-
id: 'env-id',
|
|
11
|
-
name: 'Test Environment',
|
|
12
|
-
provider: 'test',
|
|
13
|
-
account: 'account-id',
|
|
14
|
-
created_by: 'user:test',
|
|
15
|
-
updated_by: 'user:test',
|
|
16
|
-
created_at: new Date(0).toISOString(),
|
|
17
|
-
updated_at: new Date(0).toISOString(),
|
|
18
|
-
}),
|
|
19
|
-
{
|
|
20
|
-
status: 200,
|
|
21
|
-
headers: { 'content-type': 'application/json' },
|
|
22
|
-
},
|
|
23
|
-
);
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
const client = new VertesiaClient({
|
|
27
|
-
serverUrl: 'https://api.example.com',
|
|
28
|
-
storeUrl: 'https://api.example.com',
|
|
29
|
-
fetch: fetchMock,
|
|
30
|
-
onRequest: (request) => requests.push(request),
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
await client.environments.disableModel('env-id', 'provider/model#v?1');
|
|
34
|
-
|
|
35
|
-
expect(requests[0]?.url).toBe(
|
|
36
|
-
'https://api.example.com/api/v1/environments/env-id/models/enabled/provider%2Fmodel%23v%3F1',
|
|
37
|
-
);
|
|
38
|
-
});
|
|
39
|
-
});
|
|
@@ -1,338 +0,0 @@
|
|
|
1
|
-
import type { CompletionResult } from '@llumiverse/common';
|
|
2
|
-
import { describe, expect, it } from 'vitest';
|
|
3
|
-
import { InteractionOutput, IS_INTERACTION_OUTPUT } from './InteractionOutput.js';
|
|
4
|
-
|
|
5
|
-
describe('InteractionOutput', () => {
|
|
6
|
-
it('exposes audio metadata and URI without treating it as text or JSON', () => {
|
|
7
|
-
const audio = {
|
|
8
|
-
type: 'audio' as const,
|
|
9
|
-
value: 'gs://bucket/speech.mp3',
|
|
10
|
-
mime_type: 'audio/mpeg',
|
|
11
|
-
container: 'mp3',
|
|
12
|
-
};
|
|
13
|
-
const output = InteractionOutput.from([audio]);
|
|
14
|
-
expect(output.hasAudio()).toBe(true);
|
|
15
|
-
expect(output.audio()).toEqual(audio);
|
|
16
|
-
expect(output.audios()).toEqual([audio]);
|
|
17
|
-
expect(output.text()).toBe('');
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
const sampleResults: CompletionResult[] = [
|
|
21
|
-
{ type: 'text', value: 'Hello, ' },
|
|
22
|
-
{ type: 'text', value: 'World!' },
|
|
23
|
-
{ type: 'json', value: { name: 'Alice', age: 30 } },
|
|
24
|
-
{ type: 'json', value: { title: 'Engineer', level: 'Senior' } },
|
|
25
|
-
{ type: 'image', value: 'data:image/png;base64,iVBORw0K...' },
|
|
26
|
-
{ type: 'image', value: 'https://example.com/image.jpg' },
|
|
27
|
-
{ type: 'video', value: 'gs://project-bucket/runs/run-1/media/video.mp4' },
|
|
28
|
-
];
|
|
29
|
-
|
|
30
|
-
describe('text accessors', () => {
|
|
31
|
-
it('should concatenate all text results', () => {
|
|
32
|
-
const output = InteractionOutput.from(sampleResults);
|
|
33
|
-
expect(output.text('')).toBe('Hello, World!');
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
it('should return empty string when no text results exist', () => {
|
|
37
|
-
const output = InteractionOutput.from([{ type: 'json', value: { foo: 'bar' } }]);
|
|
38
|
-
expect(output.text()).toBe('');
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it('should return all text values as array', () => {
|
|
42
|
-
const output = InteractionOutput.from(sampleResults);
|
|
43
|
-
expect(output.texts()).toEqual(['Hello, ', 'World!']);
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
describe('thought accessors', () => {
|
|
48
|
-
it('keeps thoughts separate from normal answer text', () => {
|
|
49
|
-
const output = InteractionOutput.from([
|
|
50
|
-
{ type: 'thoughts', value: 'First reason' },
|
|
51
|
-
{ type: 'thoughts', value: 'Second reason' },
|
|
52
|
-
{ type: 'text', value: 'Answer' },
|
|
53
|
-
]);
|
|
54
|
-
|
|
55
|
-
expect(output.hasThoughts()).toBe(true);
|
|
56
|
-
expect(output.thoughts(' | ')).toBe('First reason | Second reason');
|
|
57
|
-
expect(output.thoughtParts()).toEqual(['First reason', 'Second reason']);
|
|
58
|
-
expect(output.text()).toBe('Answer');
|
|
59
|
-
expect(output.stringify()).toBe('Answer');
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
describe('object accessors', () => {
|
|
64
|
-
it('should return first JSON object', () => {
|
|
65
|
-
const output = InteractionOutput.from<{ name: string; age: number }>(sampleResults);
|
|
66
|
-
const obj = output.object();
|
|
67
|
-
expect(obj).toEqual({ name: 'Alice', age: 30 });
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
it('should return all JSON objects', () => {
|
|
71
|
-
const output = InteractionOutput.from(sampleResults);
|
|
72
|
-
const objects = output.objects();
|
|
73
|
-
expect(objects).toEqual([
|
|
74
|
-
{ name: 'Alice', age: 30 },
|
|
75
|
-
{ title: 'Engineer', level: 'Senior' },
|
|
76
|
-
]);
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
it('should parse text as JSON when no JSON result exists', () => {
|
|
80
|
-
const output = InteractionOutput.from([{ type: 'text', value: '{"foo":"bar"}' }]);
|
|
81
|
-
expect(output.object()).toEqual({ foo: 'bar' });
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
it('should throw error when no JSON result and text is not valid JSON', () => {
|
|
85
|
-
const output = InteractionOutput.from([{ type: 'text', value: 'not json' }]);
|
|
86
|
-
expect(() => output.object()).toThrow();
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
it('should throw error when no JSON result and no text', () => {
|
|
90
|
-
const output = InteractionOutput.from([{ type: 'image', value: 'data:image/png;base64,abc' }]);
|
|
91
|
-
expect(() => output.object()).toThrow('No JSON result found and no text available to parse');
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
describe('image accessors', () => {
|
|
96
|
-
it('should return first image', () => {
|
|
97
|
-
const output = InteractionOutput.from(sampleResults);
|
|
98
|
-
expect(output.image()).toBe('data:image/png;base64,iVBORw0K...');
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
it('should return all images', () => {
|
|
102
|
-
const output = InteractionOutput.from(sampleResults);
|
|
103
|
-
expect(output.images()).toEqual(['data:image/png;base64,iVBORw0K...', 'https://example.com/image.jpg']);
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
it('should throw error when no image result exists', () => {
|
|
107
|
-
const output = InteractionOutput.from([{ type: 'text', value: 'hello' }]);
|
|
108
|
-
expect(() => output.image()).toThrow('No image result found');
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
describe('video accessors', () => {
|
|
113
|
-
it('should return video results', () => {
|
|
114
|
-
const output = InteractionOutput.from(sampleResults);
|
|
115
|
-
|
|
116
|
-
expect(output.hasVideo()).toBe(true);
|
|
117
|
-
expect(output.video()).toBe('gs://project-bucket/runs/run-1/media/video.mp4');
|
|
118
|
-
expect(output.videos()).toEqual(['gs://project-bucket/runs/run-1/media/video.mp4']);
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
it('should throw when no video result exists', () => {
|
|
122
|
-
const output = InteractionOutput.from([{ type: 'text', value: 'hello' }]);
|
|
123
|
-
|
|
124
|
-
expect(output.hasVideo()).toBe(false);
|
|
125
|
-
expect(output.videos()).toEqual([]);
|
|
126
|
-
expect(() => output.video()).toThrow('No video result found');
|
|
127
|
-
});
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
describe('utility methods', () => {
|
|
131
|
-
it('should convert to string (concatenated text)', () => {
|
|
132
|
-
const output = InteractionOutput.from(sampleResults);
|
|
133
|
-
expect(output.toString()).toBe('Hello, \nWorld!');
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
it('should convert to JSON the resuilts array', () => {
|
|
137
|
-
const output = InteractionOutput.from(sampleResults);
|
|
138
|
-
expect(output.toJSON()).toEqual(sampleResults);
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
it('should stringify all parts with default separator and compact JSON', () => {
|
|
142
|
-
const output = InteractionOutput.from(sampleResults);
|
|
143
|
-
const result = output.stringify('\n', 0); // Explicitly request compact JSON
|
|
144
|
-
|
|
145
|
-
expect(result).toBe(
|
|
146
|
-
'Hello, \n' +
|
|
147
|
-
'World!\n' +
|
|
148
|
-
'{"name":"Alice","age":30}\n' +
|
|
149
|
-
'{"title":"Engineer","level":"Senior"}\n' +
|
|
150
|
-
'data:image/png;base64,iVBORw0K...\n' +
|
|
151
|
-
'https://example.com/image.jpg\n' +
|
|
152
|
-
'gs://project-bucket/runs/run-1/media/video.mp4',
|
|
153
|
-
);
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
it('should stringify all parts with formatted JSON', () => {
|
|
157
|
-
const mixed: CompletionResult[] = [
|
|
158
|
-
{ type: 'text', value: 'Result:' },
|
|
159
|
-
{ type: 'json', value: { score: 95, status: 'pass' } },
|
|
160
|
-
];
|
|
161
|
-
const output = InteractionOutput.from(mixed);
|
|
162
|
-
const result = output.stringify('\n', 2);
|
|
163
|
-
|
|
164
|
-
expect(result).toBe('Result:\n' + '{\n' + ' "score": 95,\n' + ' "status": "pass"\n' + '}');
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
it('should stringify with custom separator', () => {
|
|
168
|
-
const mixed: CompletionResult[] = [
|
|
169
|
-
{ type: 'text', value: 'A' },
|
|
170
|
-
{ type: 'json', value: { x: 1 } },
|
|
171
|
-
{ type: 'text', value: 'B' },
|
|
172
|
-
];
|
|
173
|
-
const output = InteractionOutput.from(mixed);
|
|
174
|
-
const result = output.stringify(' | ', 0); // Explicitly request compact JSON
|
|
175
|
-
|
|
176
|
-
expect(result).toBe('A | {"x":1} | B');
|
|
177
|
-
});
|
|
178
|
-
|
|
179
|
-
it('should stringify with empty separator', () => {
|
|
180
|
-
const mixed: CompletionResult[] = [
|
|
181
|
-
{ type: 'text', value: 'Hello' },
|
|
182
|
-
{ type: 'text', value: 'World' },
|
|
183
|
-
];
|
|
184
|
-
const output = InteractionOutput.from(mixed);
|
|
185
|
-
const result = output.stringify('');
|
|
186
|
-
|
|
187
|
-
expect(result).toBe('HelloWorld');
|
|
188
|
-
});
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
describe('Proxy functionality', () => {
|
|
192
|
-
it('should work as an array', () => {
|
|
193
|
-
const output = InteractionOutput.from(sampleResults);
|
|
194
|
-
|
|
195
|
-
// Array access
|
|
196
|
-
expect(output[0]).toEqual({ type: 'text', value: 'Hello, ' });
|
|
197
|
-
expect(output[1]).toEqual({ type: 'text', value: 'World!' });
|
|
198
|
-
|
|
199
|
-
// Array properties
|
|
200
|
-
expect(output.length).toBe(7);
|
|
201
|
-
|
|
202
|
-
// Array methods
|
|
203
|
-
const types = output.map((r) => r.type);
|
|
204
|
-
expect(types).toEqual(['text', 'text', 'json', 'json', 'image', 'image', 'video']);
|
|
205
|
-
|
|
206
|
-
const textResults = output.filter((r) => r.type === 'text');
|
|
207
|
-
expect(textResults).toHaveLength(2);
|
|
208
|
-
});
|
|
209
|
-
|
|
210
|
-
it('should have convenience methods on the array', () => {
|
|
211
|
-
const output = InteractionOutput.from<{ name: string; age: number }>(sampleResults);
|
|
212
|
-
|
|
213
|
-
// Should work as array AND have custom methods
|
|
214
|
-
expect(output.length).toBe(7);
|
|
215
|
-
expect(output.text('')).toBe('Hello, World!');
|
|
216
|
-
expect(output.object()).toEqual({ name: 'Alice', age: 30 });
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
it('should be marked with IS_INTERACTION_OUTPUT symbol', () => {
|
|
220
|
-
const output = InteractionOutput.from(sampleResults);
|
|
221
|
-
const markedOutput = output as { [IS_INTERACTION_OUTPUT]?: boolean };
|
|
222
|
-
|
|
223
|
-
// Check that the symbol marker is present
|
|
224
|
-
expect(markedOutput[IS_INTERACTION_OUTPUT]).toBe(true);
|
|
225
|
-
});
|
|
226
|
-
|
|
227
|
-
it('should return the same instance when calling from() on an already wrapped array', () => {
|
|
228
|
-
const output1 = InteractionOutput.from(sampleResults);
|
|
229
|
-
|
|
230
|
-
// Calling from() again should return the same instance
|
|
231
|
-
const output2 = InteractionOutput.from(output1);
|
|
232
|
-
|
|
233
|
-
// Should be the exact same reference
|
|
234
|
-
expect(output2).toBe(output1);
|
|
235
|
-
|
|
236
|
-
// Verify it still works correctly
|
|
237
|
-
expect(output2.text()).toBe('Hello, \nWorld!');
|
|
238
|
-
expect(output2.length).toBe(7);
|
|
239
|
-
});
|
|
240
|
-
|
|
241
|
-
it('should not double-wrap when passing an InteractionOutputArray', () => {
|
|
242
|
-
const output1 = InteractionOutput.from<{ name: string; age: number }>(sampleResults);
|
|
243
|
-
const output2 = InteractionOutput.from(output1);
|
|
244
|
-
const output3 = InteractionOutput.from(output2);
|
|
245
|
-
|
|
246
|
-
// All should be the same reference
|
|
247
|
-
expect(output1).toBe(output2);
|
|
248
|
-
expect(output2).toBe(output3);
|
|
249
|
-
|
|
250
|
-
// Functionality should remain intact
|
|
251
|
-
expect(output3.object()).toEqual({ name: 'Alice', age: 30 });
|
|
252
|
-
});
|
|
253
|
-
});
|
|
254
|
-
|
|
255
|
-
describe('Direct class usage', () => {
|
|
256
|
-
it('should work when using class directly', () => {
|
|
257
|
-
const wrapper = new InteractionOutput<{ name: string; age: number }>(sampleResults);
|
|
258
|
-
|
|
259
|
-
expect(wrapper.text('')).toBe('Hello, World!');
|
|
260
|
-
expect(wrapper.object()).toEqual({ name: 'Alice', age: 30 });
|
|
261
|
-
expect(wrapper.results).toBe(sampleResults);
|
|
262
|
-
});
|
|
263
|
-
});
|
|
264
|
-
|
|
265
|
-
describe('Edge cases', () => {
|
|
266
|
-
it('should handle empty results array', () => {
|
|
267
|
-
const output = InteractionOutput.from([]);
|
|
268
|
-
|
|
269
|
-
expect(output.text()).toBe('');
|
|
270
|
-
expect(output.texts()).toEqual([]);
|
|
271
|
-
expect(output.objects()).toEqual([]);
|
|
272
|
-
expect(output.images()).toEqual([]);
|
|
273
|
-
expect(() => output.object()).toThrow();
|
|
274
|
-
expect(() => output.image()).toThrow();
|
|
275
|
-
});
|
|
276
|
-
|
|
277
|
-
it('should handle mixed content types', () => {
|
|
278
|
-
const mixed: CompletionResult[] = [
|
|
279
|
-
{ type: 'text', value: 'Start' },
|
|
280
|
-
{ type: 'json', value: { count: 5 } },
|
|
281
|
-
{ type: 'text', value: 'End' },
|
|
282
|
-
];
|
|
283
|
-
|
|
284
|
-
const output = InteractionOutput.from(mixed);
|
|
285
|
-
expect(output.text()).toBe('Start\nEnd');
|
|
286
|
-
expect(output.object()).toEqual({ count: 5 });
|
|
287
|
-
});
|
|
288
|
-
|
|
289
|
-
it('should handle results with only one type', () => {
|
|
290
|
-
const textOnly: CompletionResult[] = [{ type: 'text', value: 'Only text here' }];
|
|
291
|
-
|
|
292
|
-
const output = InteractionOutput.from(textOnly);
|
|
293
|
-
expect(output.text()).toBe('Only text here');
|
|
294
|
-
expect(output.objects()).toEqual([]);
|
|
295
|
-
expect(output.images()).toEqual([]);
|
|
296
|
-
});
|
|
297
|
-
});
|
|
298
|
-
|
|
299
|
-
describe('Type safety with generics', () => {
|
|
300
|
-
it('should provide type safety with generic parameter', () => {
|
|
301
|
-
interface User {
|
|
302
|
-
name: string;
|
|
303
|
-
age: number;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
const results: CompletionResult[] = [{ type: 'json', value: { name: 'Bob', age: 25 } }];
|
|
307
|
-
|
|
308
|
-
const output = InteractionOutput.from<User>(results);
|
|
309
|
-
const user = output.object(); // TypeScript knows this is User
|
|
310
|
-
|
|
311
|
-
expect(user.name).toBe('Bob');
|
|
312
|
-
expect(user.age).toBe(25);
|
|
313
|
-
});
|
|
314
|
-
|
|
315
|
-
it('should allow type override at method level', () => {
|
|
316
|
-
interface Person {
|
|
317
|
-
name: string;
|
|
318
|
-
age: number;
|
|
319
|
-
}
|
|
320
|
-
interface Address {
|
|
321
|
-
street: string;
|
|
322
|
-
city: string;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
const results: CompletionResult[] = [
|
|
326
|
-
{ type: 'json', value: { name: 'Alice', age: 30 } },
|
|
327
|
-
{ type: 'json', value: { street: '123 Main', city: 'NYC' } },
|
|
328
|
-
];
|
|
329
|
-
|
|
330
|
-
const output = InteractionOutput.from<Person>(results);
|
|
331
|
-
const person = output.objectAt<Person>(0);
|
|
332
|
-
const address = output.objectAt<Address>(1);
|
|
333
|
-
|
|
334
|
-
expect(person.name).toBe('Alice');
|
|
335
|
-
expect(address.city).toBe('NYC');
|
|
336
|
-
});
|
|
337
|
-
});
|
|
338
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ApiTopic, type ClientBase } from '@vertesia/api-fetch-client';
|
|
2
|
-
import type { AccountApiVersionPolicy } from '@vertesia/common';
|
|
3
|
-
|
|
4
|
-
export default class InternalAccountsApi extends ApiTopic {
|
|
5
|
-
constructor(parent: ClientBase) {
|
|
6
|
-
super(parent, '/internal/accounts');
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
getApiVersionPolicy(accountId: string): Promise<AccountApiVersionPolicy> {
|
|
10
|
-
return this.get(`/${encodeURIComponent(accountId)}/api-version-policy`);
|
|
11
|
-
}
|
|
12
|
-
}
|