@vertesia/client 1.6.0-dev.20261004.085740Z → 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/client.d.ts +0 -4
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +0 -6
- 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 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +0 -3
- 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.map +1 -1
- package/lib/store/AgentsApi.js +5 -4
- package/lib/store/AgentsApi.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/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 +2 -2
- package/lib/vertesia-client.js.map +1 -1
- package/package.json +8 -8
- package/src/AuditTrailApi.ts +12 -0
- package/src/client.ts +0 -6
- package/src/execute.ts +15 -4
- package/src/index.ts +0 -3
- package/src/managed-sse.ts +2 -5
- package/src/store/AgentsApi.ts +5 -4
- package/src/store/WorkflowsApi.ts +5 -1
- 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/InternalRunBudgetsApi.d.ts +0 -8
- package/lib/InternalRunBudgetsApi.d.ts.map +0 -1
- package/lib/InternalRunBudgetsApi.js +0 -11
- package/lib/InternalRunBudgetsApi.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/InternalAccountsApi.ts +0 -12
- package/src/InternalRunBudgetsApi.ts +0 -13
- package/src/InternalSecretsApi.ts +0 -63
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertesia/client",
|
|
3
|
-
"version": "1.6.0-dev.
|
|
3
|
+
"version": "1.6.0-dev.20261008.064737Z",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -12,16 +12,16 @@
|
|
|
12
12
|
],
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@types/node": "^24.
|
|
15
|
+
"@types/node": "^24.19.0",
|
|
16
16
|
"@vertesia/tsconfig": "0.1.0",
|
|
17
|
-
"rolldown": "1.2.
|
|
17
|
+
"rolldown": "1.2.11",
|
|
18
18
|
"typescript": "7.0.2",
|
|
19
|
-
"vitest": "5.0.
|
|
19
|
+
"vitest": "5.0.2"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@llumiverse/common": "1.6.0-dev.
|
|
23
|
-
"@vertesia/api-fetch-client": "1.6.0-dev.
|
|
24
|
-
"@vertesia/common": "1.6.0-dev.
|
|
22
|
+
"@llumiverse/common": "1.6.0-dev.20261008.064411Z",
|
|
23
|
+
"@vertesia/api-fetch-client": "1.6.0-dev.20261008.064737Z",
|
|
24
|
+
"@vertesia/common": "1.6.0-dev.20261008.064737Z",
|
|
25
25
|
"eventsource": "^5.1.2"
|
|
26
26
|
},
|
|
27
27
|
"exports": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"ai",
|
|
50
50
|
"typescript"
|
|
51
51
|
],
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "8ee3a33e9a7c3dbcd13937e971cbdcc5fad56717",
|
|
53
53
|
"scripts": {
|
|
54
54
|
"lint": "biome lint src",
|
|
55
55
|
"clean:lib": "rimraf ./lib ./tsconfig.tsbuildinfo",
|
package/src/AuditTrailApi.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { ApiTopic, type ClientBase } from '@vertesia/api-fetch-client';
|
|
2
2
|
import type {
|
|
3
|
+
AuditAdoptionQuery,
|
|
4
|
+
AuditAdoptionResponse,
|
|
3
5
|
AuditAggregationQuery,
|
|
4
6
|
AuditAggregationResponse,
|
|
5
7
|
AuditTrailQuery,
|
|
6
8
|
AuditTrailResponse,
|
|
9
|
+
AuditUsageQuery,
|
|
10
|
+
AuditUsageResponse,
|
|
7
11
|
} from '@vertesia/common';
|
|
8
12
|
|
|
9
13
|
export default class AuditTrailApi extends ApiTopic {
|
|
@@ -33,4 +37,12 @@ export default class AuditTrailApi extends ApiTopic {
|
|
|
33
37
|
aggregate(query: AuditAggregationQuery): Promise<AuditAggregationResponse> {
|
|
34
38
|
return this.post('/aggregate', { payload: query });
|
|
35
39
|
}
|
|
40
|
+
|
|
41
|
+
adoption(query: AuditAdoptionQuery = {}): Promise<AuditAdoptionResponse> {
|
|
42
|
+
return this.post('/adoption', { payload: query });
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
usage(query: AuditUsageQuery = {}): Promise<AuditUsageResponse> {
|
|
46
|
+
return this.post('/usage', { payload: query });
|
|
47
|
+
}
|
|
36
48
|
}
|
package/src/client.ts
CHANGED
|
@@ -14,8 +14,6 @@ import { IamApi } from './IamApi.js';
|
|
|
14
14
|
import InferenceProfilesApi from './InferenceProfilesApi.js';
|
|
15
15
|
import InteractionConfigurationsApi from './InteractionConfigurationsApi.js';
|
|
16
16
|
import InteractionsApi from './InteractionsApi.js';
|
|
17
|
-
import InternalRunBudgetsApi from './InternalRunBudgetsApi.js';
|
|
18
|
-
import InternalSecretsApi from './InternalSecretsApi.js';
|
|
19
17
|
import OAuthClientsApi from './OAuthClientsApi.js';
|
|
20
18
|
import OAuthGrantsApi from './OAuthGrantsApi.js';
|
|
21
19
|
import OAuthProvidersApi from './OAuthProvidersApi.js';
|
|
@@ -128,8 +126,6 @@ export class VertesiaClient extends AbstractFetchClient<VertesiaClient> {
|
|
|
128
126
|
oauthProviders: OAuthProvidersApi;
|
|
129
127
|
remoteMcpConnections: RemoteMcpConnectionsApi;
|
|
130
128
|
secrets: SecretsApi;
|
|
131
|
-
internalSecrets: InternalSecretsApi;
|
|
132
|
-
internalRunBudgets: InternalRunBudgetsApi;
|
|
133
129
|
|
|
134
130
|
/**
|
|
135
131
|
* Create a client from the given token.
|
|
@@ -261,8 +257,6 @@ export class VertesiaClient extends AbstractFetchClient<VertesiaClient> {
|
|
|
261
257
|
this.oauthProviders = new OAuthProvidersApi(this);
|
|
262
258
|
this.remoteMcpConnections = new RemoteMcpConnectionsApi(this);
|
|
263
259
|
this.secrets = new SecretsApi(this);
|
|
264
|
-
this.internalSecrets = new InternalSecretsApi(this);
|
|
265
|
-
this.internalRunBudgets = new InternalRunBudgetsApi(this);
|
|
266
260
|
}
|
|
267
261
|
|
|
268
262
|
withApiVersion(version: string | number | null) {
|
package/src/execute.ts
CHANGED
|
@@ -62,7 +62,7 @@ export async function executeInteraction<P = unknown>(
|
|
|
62
62
|
if (response.status === ExecutionRunStatus.failed) {
|
|
63
63
|
return response;
|
|
64
64
|
}
|
|
65
|
-
|
|
65
|
+
return handleStreaming<P>(client, response.id, onChunk);
|
|
66
66
|
}
|
|
67
67
|
return response;
|
|
68
68
|
}
|
|
@@ -105,13 +105,17 @@ export async function executeInteractionByName<P = unknown>(
|
|
|
105
105
|
if (response.status === ExecutionRunStatus.failed) {
|
|
106
106
|
return response;
|
|
107
107
|
}
|
|
108
|
-
|
|
108
|
+
return handleStreaming<P>(client, response.id, onChunk);
|
|
109
109
|
}
|
|
110
110
|
return response;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
function handleStreaming(
|
|
114
|
-
|
|
113
|
+
function handleStreaming<P>(
|
|
114
|
+
client: VertesiaClient,
|
|
115
|
+
runId: string,
|
|
116
|
+
onChunk: (chunk: string) => void,
|
|
117
|
+
): Promise<InteractionExecutionResult<P>> {
|
|
118
|
+
return new Promise<InteractionExecutionResult<P>>((resolve, reject) => {
|
|
115
119
|
void (async () => {
|
|
116
120
|
try {
|
|
117
121
|
const EventSourceImpl = await EventSourceProvider();
|
|
@@ -133,6 +137,7 @@ function handleStreaming(client: VertesiaClient, runId: string, onChunk: (chunk:
|
|
|
133
137
|
onChunk?.(data);
|
|
134
138
|
}
|
|
135
139
|
} catch (err) {
|
|
140
|
+
sse.close();
|
|
136
141
|
reject(err);
|
|
137
142
|
}
|
|
138
143
|
});
|
|
@@ -145,6 +150,12 @@ function handleStreaming(client: VertesiaClient, runId: string, onChunk: (chunk:
|
|
|
145
150
|
reject(err);
|
|
146
151
|
}
|
|
147
152
|
});
|
|
153
|
+
sse.addEventListener('error', () => {
|
|
154
|
+
if (sse.readyState === EventSourceImpl.CLOSED) {
|
|
155
|
+
sse.close();
|
|
156
|
+
reject(new Error('Interaction result stream closed before completion'));
|
|
157
|
+
}
|
|
158
|
+
});
|
|
148
159
|
} catch (err) {
|
|
149
160
|
reject(err);
|
|
150
161
|
}
|
package/src/index.ts
CHANGED
|
@@ -7,9 +7,6 @@ export { default as DelegationGrantsApi } from './DelegationGrantsApi.js';
|
|
|
7
7
|
export type { GroupsQueryOptions } from './GroupsApi.js';
|
|
8
8
|
export * from './InteractionBase.js';
|
|
9
9
|
export * from './InteractionOutput.js';
|
|
10
|
-
export { default as InternalAccountsApi } from './InternalAccountsApi.js';
|
|
11
|
-
export { default as InternalRunBudgetsApi } from './InternalRunBudgetsApi.js';
|
|
12
|
-
export { default as InternalSecretsApi } from './InternalSecretsApi.js';
|
|
13
10
|
export * from './managed-sse.js';
|
|
14
11
|
export { default as OAuthClientsApi } from './OAuthClientsApi.js';
|
|
15
12
|
export { default as OAuthGrantsApi } from './OAuthGrantsApi.js';
|
package/src/managed-sse.ts
CHANGED
|
@@ -101,6 +101,7 @@ export function openManagedEventSource<T>(options: ManagedEventSourceOptions<T>)
|
|
|
101
101
|
}
|
|
102
102
|
cleanupCurrentSource();
|
|
103
103
|
const connectionDuration = connectionOpenedAt ? Date.now() - connectionOpenedAt : 0;
|
|
104
|
+
connectionOpenedAt = 0;
|
|
104
105
|
if (connectionDuration > 5000) {
|
|
105
106
|
reconnectAttempts = 0;
|
|
106
107
|
}
|
|
@@ -147,11 +148,7 @@ export function openManagedEventSource<T>(options: ManagedEventSourceOptions<T>)
|
|
|
147
148
|
return;
|
|
148
149
|
}
|
|
149
150
|
const url = await resolveUrl(options.url);
|
|
150
|
-
if (
|
|
151
|
-
lastEventId &&
|
|
152
|
-
options.last_event_id_query_param &&
|
|
153
|
-
!url.searchParams.has(options.last_event_id_query_param)
|
|
154
|
-
) {
|
|
151
|
+
if (lastEventId && options.last_event_id_query_param) {
|
|
155
152
|
url.searchParams.set(options.last_event_id_query_param, lastEventId);
|
|
156
153
|
}
|
|
157
154
|
withAccessToken(url, await options.get_access_token?.());
|
package/src/store/AgentsApi.ts
CHANGED
|
@@ -406,7 +406,7 @@ export class AgentsApi extends ApiTopic {
|
|
|
406
406
|
currentSse.close();
|
|
407
407
|
currentSse = null;
|
|
408
408
|
}
|
|
409
|
-
if (signal && abortHandler) {
|
|
409
|
+
if (isClosed && signal && abortHandler) {
|
|
410
410
|
signal.removeEventListener('abort', abortHandler);
|
|
411
411
|
abortHandler = null;
|
|
412
412
|
}
|
|
@@ -459,13 +459,14 @@ export class AgentsApi extends ApiTopic {
|
|
|
459
459
|
try {
|
|
460
460
|
// Resume from the last message we handed to the caller, whether it came from
|
|
461
461
|
// history, SSE, or an earlier poll. The server returns messages with ts > since.
|
|
462
|
-
const
|
|
462
|
+
const previousMessageTimestamp = lastMessageTimestamp;
|
|
463
|
+
const recent = await this.retrieveMessages(id, previousMessageTimestamp || undefined);
|
|
463
464
|
polledMessages = true;
|
|
464
465
|
for (const msg of recent) {
|
|
465
466
|
if (isClosed) return;
|
|
466
467
|
const timestamp = msg.timestamp || 0;
|
|
467
|
-
if (timestamp <=
|
|
468
|
-
lastMessageTimestamp = timestamp;
|
|
468
|
+
if (timestamp <= previousMessageTimestamp) continue;
|
|
469
|
+
lastMessageTimestamp = Math.max(lastMessageTimestamp, timestamp);
|
|
469
470
|
if (onMessage) onMessage(msg, exit);
|
|
470
471
|
if (isClosed) return;
|
|
471
472
|
if (shouldCloseAgentRunStream(msg, id, options?.closeOnIdle)) {
|
|
@@ -212,7 +212,7 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
212
212
|
currentSse.close();
|
|
213
213
|
currentSse = null;
|
|
214
214
|
}
|
|
215
|
-
if (signal && abortHandler) {
|
|
215
|
+
if (isClosed && signal && abortHandler) {
|
|
216
216
|
signal.removeEventListener('abort', abortHandler);
|
|
217
217
|
abortHandler = null;
|
|
218
218
|
}
|
|
@@ -349,12 +349,14 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
349
349
|
`Failed to reconnect to SSE stream for run ${runId} after ${maxReconnectAttempts} attempts`,
|
|
350
350
|
);
|
|
351
351
|
isClosed = true;
|
|
352
|
+
cleanup();
|
|
352
353
|
reject(
|
|
353
354
|
new Error(`SSE connection failed after ${maxReconnectAttempts} reconnection attempts`),
|
|
354
355
|
);
|
|
355
356
|
}
|
|
356
357
|
};
|
|
357
358
|
} catch (err) {
|
|
359
|
+
if (isClosed) return;
|
|
358
360
|
console.error('Error setting up SSE stream:', err);
|
|
359
361
|
if (reconnectAttempts < maxReconnectAttempts) {
|
|
360
362
|
const delay = calculateBackoffDelay(reconnectAttempts);
|
|
@@ -366,6 +368,8 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
366
368
|
}
|
|
367
369
|
}, delay);
|
|
368
370
|
} else {
|
|
371
|
+
isClosed = true;
|
|
372
|
+
cleanup();
|
|
369
373
|
reject(err);
|
|
370
374
|
}
|
|
371
375
|
}
|
package/src/store/signed-url.ts
CHANGED
|
@@ -36,6 +36,33 @@ export interface SignedUrlFetchOptions {
|
|
|
36
36
|
retryableStatuses?: ReadonlySet<number>;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
const AZURE_BLOB_HOST_SUFFIX = '.blob.core.windows.net';
|
|
40
|
+
|
|
41
|
+
/** Whether a signed URL points at Azure Blob Storage (a SAS URL on `<account>.blob.core.windows.net`). */
|
|
42
|
+
export function isAzureBlobUrl(url: string): boolean {
|
|
43
|
+
try {
|
|
44
|
+
return new URL(url).hostname.toLowerCase().endsWith(AZURE_BLOB_HOST_SUFFIX);
|
|
45
|
+
} catch {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The headers for a `PUT` of file content to a signed upload URL.
|
|
52
|
+
*
|
|
53
|
+
* Azure's Put Blob rejects a request without `x-ms-blob-type`, so it is added for Azure Blob URLs
|
|
54
|
+
* only. GCS and S3 requests are left untouched: from a browser every extra header must be allowed
|
|
55
|
+
* by the bucket's CORS policy, and a header those backends do not expect would fail the preflight.
|
|
56
|
+
*/
|
|
57
|
+
export function signedUrlUploadHeaders(
|
|
58
|
+
url: string,
|
|
59
|
+
headers?: Record<string, string>,
|
|
60
|
+
): Record<string, string> | undefined {
|
|
61
|
+
if (!isAzureBlobUrl(url)) return headers;
|
|
62
|
+
if (headers && Object.keys(headers).some((name) => name.toLowerCase() === 'x-ms-blob-type')) return headers;
|
|
63
|
+
return { ...headers, 'x-ms-blob-type': 'BlockBlob' };
|
|
64
|
+
}
|
|
65
|
+
|
|
39
66
|
function sleep(ms: number): Promise<void> {
|
|
40
67
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
41
68
|
}
|
|
@@ -145,6 +172,9 @@ async function toReplayableBody(body: BodyInit | null | undefined): Promise<Body
|
|
|
145
172
|
* `Retry-After` response header up to 60 seconds. Longer delays return the response
|
|
146
173
|
* without retrying so the caller can schedule recovery outside this request.
|
|
147
174
|
*
|
|
175
|
+
* A `PUT` to an Azure Blob SAS URL gets the `x-ms-blob-type` header it requires (see
|
|
176
|
+
* {@link signedUrlUploadHeaders}).
|
|
177
|
+
*
|
|
148
178
|
* The returned `Response` is only guaranteed to be retried while it carries a
|
|
149
179
|
* retryable status; a non-retryable error response (e.g. 403, 404) is returned
|
|
150
180
|
* as-is for the caller to handle.
|
|
@@ -160,12 +190,13 @@ export async function fetchSignedUrl(url: string, options: SignedUrlFetchOptions
|
|
|
160
190
|
} = options;
|
|
161
191
|
|
|
162
192
|
const body = await toReplayableBody(options.body);
|
|
193
|
+
const requestHeaders = method.toUpperCase() === 'PUT' ? signedUrlUploadHeaders(url, headers) : headers;
|
|
163
194
|
|
|
164
195
|
let lastError: unknown;
|
|
165
196
|
for (let attempt = 0; attempt < attempts; attempt++) {
|
|
166
197
|
const isLastAttempt = attempt === attempts - 1;
|
|
167
198
|
try {
|
|
168
|
-
const res = await fetch(url, { method, headers, body });
|
|
199
|
+
const res = await fetch(url, { method, headers: requestHeaders, body });
|
|
169
200
|
if (res.ok || !retryableStatuses.has(res.status) || isLastAttempt) {
|
|
170
201
|
return res;
|
|
171
202
|
}
|
|
@@ -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,8 +0,0 @@
|
|
|
1
|
-
import { ApiTopic, type ClientBase } from '@vertesia/api-fetch-client';
|
|
2
|
-
import type { ReadRunBudgetUsagePayload, RunBudgetTotals } from '@vertesia/common';
|
|
3
|
-
/** Workload-authenticated accounting operations. Ordinary user tokens are not accepted. */
|
|
4
|
-
export default class InternalRunBudgetsApi extends ApiTopic {
|
|
5
|
-
constructor(parent: ClientBase);
|
|
6
|
-
usage(payload: ReadRunBudgetUsagePayload): Promise<RunBudgetTotals>;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=InternalRunBudgetsApi.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InternalRunBudgetsApi.d.ts","sourceRoot":"","sources":["../src/InternalRunBudgetsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,KAAK,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnF,2FAA2F;AAC3F,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,QAAQ;IACvD,YAAY,MAAM,EAAE,UAAU,EAE7B;IAED,KAAK,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,eAAe,CAAC,CAElE;CACJ"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ApiTopic } from '@vertesia/api-fetch-client';
|
|
2
|
-
/** Workload-authenticated accounting operations. Ordinary user tokens are not accepted. */
|
|
3
|
-
export default class InternalRunBudgetsApi extends ApiTopic {
|
|
4
|
-
constructor(parent) {
|
|
5
|
-
super(parent, '/internal/run-budget');
|
|
6
|
-
}
|
|
7
|
-
usage(payload) {
|
|
8
|
-
return this.post('/usage', { payload });
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=InternalRunBudgetsApi.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InternalRunBudgetsApi.js","sourceRoot":"","sources":["../src/InternalRunBudgetsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAmB,MAAM,4BAA4B,CAAC;AAGvE,2FAA2F;AAC3F,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,QAAQ;IACvD,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;IAC1C,CAAC;IAED,KAAK,CAAC,OAAkC;QACpC,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAC5C,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"}
|
|
@@ -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
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ApiTopic, type ClientBase } from '@vertesia/api-fetch-client';
|
|
2
|
-
import type { ReadRunBudgetUsagePayload, RunBudgetTotals } from '@vertesia/common';
|
|
3
|
-
|
|
4
|
-
/** Workload-authenticated accounting operations. Ordinary user tokens are not accepted. */
|
|
5
|
-
export default class InternalRunBudgetsApi extends ApiTopic {
|
|
6
|
-
constructor(parent: ClientBase) {
|
|
7
|
-
super(parent, '/internal/run-budget');
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
usage(payload: ReadRunBudgetUsagePayload): Promise<RunBudgetTotals> {
|
|
11
|
-
return this.post('/usage', { payload });
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { ApiTopic, type ClientBase } from '@vertesia/api-fetch-client';
|
|
2
|
-
import type {
|
|
3
|
-
EventIngestSigningSecretRequest,
|
|
4
|
-
EventIngestSigningSecretResponse,
|
|
5
|
-
EventWebhookSigningSecretRequest,
|
|
6
|
-
EventWebhookSigningSecretResponse,
|
|
7
|
-
GithubInstallationTokenRequest,
|
|
8
|
-
GithubInstallationTokenResponse,
|
|
9
|
-
SignEventWebhookRequest,
|
|
10
|
-
SignEventWebhookResponse,
|
|
11
|
-
VerifyEventIngestSignatureRequest,
|
|
12
|
-
VerifyEventIngestSignatureResponse,
|
|
13
|
-
} from '@vertesia/common';
|
|
14
|
-
|
|
15
|
-
export default class InternalSecretsApi extends ApiTopic {
|
|
16
|
-
constructor(parent: ClientBase) {
|
|
17
|
-
super(parent, '/internal/secrets');
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
rotateEventWebhookSigningSecret(
|
|
21
|
-
subscriptionId: string,
|
|
22
|
-
payload: EventWebhookSigningSecretRequest,
|
|
23
|
-
): Promise<EventWebhookSigningSecretResponse> {
|
|
24
|
-
return this.post(`/event-webhooks/${subscriptionId}/rotate`, { payload });
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
deleteEventWebhookSigningSecret(
|
|
28
|
-
subscriptionId: string,
|
|
29
|
-
payload: EventWebhookSigningSecretRequest,
|
|
30
|
-
): Promise<{ deleted: true }> {
|
|
31
|
-
return this.post(`/event-webhooks/${subscriptionId}/delete`, { payload });
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
signEventWebhook(subscriptionId: string, payload: SignEventWebhookRequest): Promise<SignEventWebhookResponse> {
|
|
35
|
-
return this.post(`/event-webhooks/${subscriptionId}/sign`, { payload });
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
rotateEventIngestChannelSigningSecret(
|
|
39
|
-
channelId: string,
|
|
40
|
-
payload: EventIngestSigningSecretRequest,
|
|
41
|
-
): Promise<EventIngestSigningSecretResponse> {
|
|
42
|
-
return this.post(`/event-ingest-channels/${channelId}/rotate`, { payload });
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
deleteEventIngestChannelSigningSecret(
|
|
46
|
-
channelId: string,
|
|
47
|
-
payload: EventIngestSigningSecretRequest,
|
|
48
|
-
): Promise<{ deleted: true }> {
|
|
49
|
-
return this.post(`/event-ingest-channels/${channelId}/delete`, { payload });
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
verifyEventIngestSignature(
|
|
53
|
-
channelId: string,
|
|
54
|
-
payload: VerifyEventIngestSignatureRequest,
|
|
55
|
-
): Promise<VerifyEventIngestSignatureResponse> {
|
|
56
|
-
return this.post(`/event-ingest-channels/${channelId}/verify`, { payload });
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/** Mint a short-lived, repository-scoped GitHub App installation token for the project. */
|
|
60
|
-
mintGithubInstallationToken(payload: GithubInstallationTokenRequest): Promise<GithubInstallationTokenResponse> {
|
|
61
|
-
return this.post('/github/installation-token', { payload });
|
|
62
|
-
}
|
|
63
|
-
}
|