@vertesia/client 1.6.0-dev.20261009.095813Z → 1.6.0-dev.20261019.172735Z

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.
Files changed (43) hide show
  1. package/lib/AppsApi.d.ts +35 -2
  2. package/lib/AppsApi.d.ts.map +1 -1
  3. package/lib/AppsApi.js +76 -1
  4. package/lib/AppsApi.js.map +1 -1
  5. package/lib/OAuthServerApi.d.ts +7 -1
  6. package/lib/OAuthServerApi.d.ts.map +1 -1
  7. package/lib/OAuthServerApi.js +21 -0
  8. package/lib/OAuthServerApi.js.map +1 -1
  9. package/lib/OidcFederationApi.d.ts +11 -0
  10. package/lib/OidcFederationApi.d.ts.map +1 -0
  11. package/lib/OidcFederationApi.js +22 -0
  12. package/lib/OidcFederationApi.js.map +1 -0
  13. package/lib/client.d.ts +2 -0
  14. package/lib/client.d.ts.map +1 -1
  15. package/lib/client.js +3 -0
  16. package/lib/client.js.map +1 -1
  17. package/lib/index.d.ts +1 -0
  18. package/lib/index.d.ts.map +1 -1
  19. package/lib/index.js +1 -0
  20. package/lib/index.js.map +1 -1
  21. package/lib/store/ObjectsApi.d.ts +8 -1
  22. package/lib/store/ObjectsApi.d.ts.map +1 -1
  23. package/lib/store/ObjectsApi.js +11 -0
  24. package/lib/store/ObjectsApi.js.map +1 -1
  25. package/lib/store/ProcessApi.d.ts +8 -0
  26. package/lib/store/ProcessApi.d.ts.map +1 -1
  27. package/lib/store/ProcessApi.js +16 -2
  28. package/lib/store/ProcessApi.js.map +1 -1
  29. package/lib/store/ProcessTestRunApi.d.ts +3 -0
  30. package/lib/store/ProcessTestRunApi.d.ts.map +1 -1
  31. package/lib/store/ProcessTestRunApi.js +9 -5
  32. package/lib/store/ProcessTestRunApi.js.map +1 -1
  33. package/lib/vertesia-client.js +2 -2
  34. package/lib/vertesia-client.js.map +1 -1
  35. package/package.json +8 -8
  36. package/src/AppsApi.ts +106 -0
  37. package/src/OAuthServerApi.ts +31 -0
  38. package/src/OidcFederationApi.ts +23 -0
  39. package/src/client.ts +3 -0
  40. package/src/index.ts +1 -0
  41. package/src/store/ObjectsApi.ts +13 -0
  42. package/src/store/ProcessApi.ts +16 -2
  43. package/src/store/ProcessTestRunApi.ts +9 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertesia/client",
3
- "version": "1.6.0-dev.20261009.095813Z",
3
+ "version": "1.6.0-dev.20261019.172735Z",
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.19.0",
15
+ "@types/node": "^24.19.1",
16
16
  "@vertesia/tsconfig": "0.1.0",
17
- "rolldown": "1.2.11",
17
+ "rolldown": "1.2.12",
18
18
  "typescript": "7.0.2",
19
- "vitest": "5.0.2"
19
+ "vitest": "5.0.3"
20
20
  },
21
21
  "dependencies": {
22
- "@llumiverse/common": "1.6.0-dev.20261009.095504Z",
23
- "@vertesia/api-fetch-client": "1.6.0-dev.20261009.095813Z",
24
- "@vertesia/common": "1.6.0-dev.20261009.095813Z",
22
+ "@llumiverse/common": "1.6.0-dev.20261019.165531Z",
23
+ "@vertesia/api-fetch-client": "1.6.0-dev.20261019.172735Z",
24
+ "@vertesia/common": "1.6.0-dev.20261019.172735Z",
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": "e45bc09ecf2de4c8fe8a8d39fb52c1521980e7b9",
52
+ "gitHead": "85a3010750ab97192d236928b1fca55015a18000",
53
53
  "scripts": {
54
54
  "lint": "biome lint src",
55
55
  "clean:lib": "rimraf ./lib ./tsconfig.tsbuildinfo",
package/src/AppsApi.ts CHANGED
@@ -6,12 +6,16 @@ import type {
6
6
  AppDeleteSummary,
7
7
  AppDevelopmentTaskDetails,
8
8
  AppDevelopmentTaskList,
9
+ AppGithubConfiguration,
10
+ AppGithubRepositoryList,
11
+ AppGithubRepositorySetup,
9
12
  AppInspectionResult,
10
13
  AppInstallation,
11
14
  AppInstallationKind,
12
15
  AppInstallationListEntry,
13
16
  AppInstallationPayload,
14
17
  AppInstallationWithManifest,
18
+ AppInstanceAvailability,
15
19
  AppManifest,
16
20
  AppManifestData,
17
21
  AppPackage,
@@ -29,6 +33,7 @@ import type {
29
33
  CountResult,
30
34
  CreateAppRepoBranchRequest,
31
35
  DeleteAppVersionResponse,
36
+ ExchangeAppGithubAuthorizationResponse,
32
37
  McpApiKeyStatus,
33
38
  ProjectRef,
34
39
  PromoteAppVersionResponse,
@@ -37,6 +42,7 @@ import type {
37
42
  StartAppBuildRequest,
38
43
  StartAppBuildResponse,
39
44
  StartAppDevelopmentTaskRequest,
45
+ StartAppGithubAuthorizationResponse,
40
46
  StartAppScaffoldRequest,
41
47
  StartAppScaffoldResponse,
42
48
  UpdateAppInstallationOAuthApprovalPayload,
@@ -75,6 +81,27 @@ export default class AppsApi extends ApiTopic {
75
81
  * The key is write-only: it is encrypted server-side and never returned by any endpoint,
76
82
  * so the response carries only the configured flag and a masked hint.
77
83
  */
84
+ setInstallationMcpApiKey(installationId: string, collectionId: string, apiKey: string): Promise<McpApiKeyStatus> {
85
+ return this.put(
86
+ `/installations/${encodeURIComponent(installationId)}/collections/${encodeURIComponent(collectionId)}/api-key`,
87
+ {
88
+ payload: { api_key: apiKey },
89
+ },
90
+ );
91
+ }
92
+
93
+ getInstallationMcpApiKeyStatus(installationId: string, collectionId: string): Promise<McpApiKeyStatus> {
94
+ return this.get(
95
+ `/installations/${encodeURIComponent(installationId)}/collections/${encodeURIComponent(collectionId)}/api-key`,
96
+ );
97
+ }
98
+
99
+ deleteInstallationMcpApiKey(installationId: string, collectionId: string): Promise<McpApiKeyStatus> {
100
+ return this.del(
101
+ `/installations/${encodeURIComponent(installationId)}/collections/${encodeURIComponent(collectionId)}/api-key`,
102
+ );
103
+ }
104
+
78
105
  setMcpCollectionApiKey(appId: string, collectionId: string, apiKey: string): Promise<McpApiKeyStatus> {
79
106
  return this.put(`/${encodeURIComponent(appId)}/collections/${encodeURIComponent(collectionId)}/api-key`, {
80
107
  payload: { api_key: apiKey } satisfies SetMcpApiKeyRequest,
@@ -149,6 +176,63 @@ export default class AppsApi extends ApiTopic {
149
176
  return this.get(`/scaffolds/${encodeURIComponent(workflowId)}/${encodeURIComponent(runId)}/progress`);
150
177
  }
151
178
 
179
+ /**
180
+ * Return whether the global App Builder GitHub App is configured, together with its slug and
181
+ * installation URL when available.
182
+ */
183
+ getGithubConfiguration(): Promise<AppGithubConfiguration> {
184
+ return this.get('/source-providers/github');
185
+ }
186
+
187
+ /**
188
+ * Start GitHub user authorization. The server creates a short-lived, single-use OAuth state
189
+ * bound to the current Vertesia user/account/project and returns the GitHub authorization URL.
190
+ */
191
+ startGithubAuthorization(): Promise<StartAppGithubAuthorizationResponse> {
192
+ return this.post('/source-providers/github/authorize', {});
193
+ }
194
+
195
+ /**
196
+ * Complete GitHub authorization with the callback code and state. The server consumes the state,
197
+ * verifies the current user's writable GitHub App installations, discards the GitHub user token,
198
+ * and returns those installations plus an opaque `connection_id`. That id references a
199
+ * short-lived server-side snapshot of the writable repositories verified for this Vertesia
200
+ * user/account/project; selecting a repository consumes it once.
201
+ */
202
+ exchangeGithubAuthorization(code: string, state: string): Promise<ExchangeAppGithubAuthorizationResponse> {
203
+ return this.post('/source-providers/github/exchange', { payload: { code, state } });
204
+ }
205
+
206
+ /**
207
+ * List repositories with push access for one installation verified during authorization. The
208
+ * connection id is scoped to the current Vertesia user/account/project and expires shortly.
209
+ */
210
+ listGithubRepositories(connectionId: string, installationId: string): Promise<AppGithubRepositoryList> {
211
+ return this.get('/source-providers/github/repositories', {
212
+ query: { connection_id: connectionId, installation_id: installationId },
213
+ });
214
+ }
215
+
216
+ /**
217
+ * List branches and verify whether a selected branch can safely receive generated source.
218
+ * The verified connection remains reusable until app creation consumes it.
219
+ */
220
+ getGithubRepositorySetup(
221
+ connectionId: string,
222
+ installationId: string,
223
+ repository: string,
224
+ branch: string,
225
+ ): Promise<AppGithubRepositorySetup> {
226
+ return this.get('/source-providers/github/repository-setup', {
227
+ query: {
228
+ connection_id: connectionId,
229
+ installation_id: installationId,
230
+ repository,
231
+ branch,
232
+ },
233
+ });
234
+ }
235
+
152
236
  /**
153
237
  * Get the list if tools provided by the given app.
154
238
  * @param appId
@@ -328,14 +412,20 @@ export default class AppsApi extends ApiTopic {
328
412
  oauthParams?: Record<string, { client_id?: string; client_secret?: string; scopes?: string[] }>,
329
413
  oauthProviderParams?: Record<string, { client_id?: string; client_secret?: string; scopes?: string[] }>,
330
414
  apiKeyParams?: AppApiKeyCollectionParams,
415
+ mcpParameters?: AppInstallationPayload['mcp_parameters'],
416
+ mcpSharedParameters?: AppInstallationPayload['mcp_shared_parameters'],
417
+ instance?: Pick<AppInstallationPayload, 'instance_key' | 'display_name' | 'namespace_overrides'>,
331
418
  ): Promise<AppInstallation> {
332
419
  return this.post(`/install`, {
333
420
  payload: {
334
421
  app_id: appId,
422
+ ...instance,
335
423
  settings,
336
424
  oauth_params: oauthParams,
337
425
  oauth_provider_params: oauthProviderParams,
338
426
  api_key_params: apiKeyParams,
427
+ mcp_parameters: mcpParameters,
428
+ mcp_shared_parameters: mcpSharedParameters,
339
429
  } satisfies AppInstallationPayload,
340
430
  });
341
431
  }
@@ -353,6 +443,14 @@ export default class AppsApi extends ApiTopic {
353
443
  * get an app unstallation given its name or null if the app is not installed
354
444
  * @returns
355
445
  */
446
+ getAppInstanceAvailability(): Promise<AppInstanceAvailability> {
447
+ return this.get('/instance-availability');
448
+ }
449
+
450
+ getAppInstallation(installationId: string): Promise<AppInstallationWithManifest> {
451
+ return this.get(`/installations/id/${encodeURIComponent(installationId)}`);
452
+ }
453
+
356
454
  getAppInstallationByName(appName: string): Promise<AppInstallationWithManifest | null> {
357
455
  return this.get<AppInstallationWithManifest>(`/installations/name/${appName}`).catch((err: ServerError) => {
358
456
  if (err.status === 404) {
@@ -426,6 +524,14 @@ export default class AppsApi extends ApiTopic {
426
524
  // clear an override). The server uses `'access_control' in payload` to distinguish
427
525
  // "leave unchanged" from "clear", so only spread the key when it was supplied.
428
526
  ...('access_control' in settingsPayload ? { access_control: settingsPayload.access_control } : {}),
527
+ ...('display_name' in settingsPayload ? { display_name: settingsPayload.display_name } : {}),
528
+ ...('namespace_overrides' in settingsPayload
529
+ ? { namespace_overrides: settingsPayload.namespace_overrides }
530
+ : {}),
531
+ ...('mcp_parameters' in settingsPayload ? { mcp_parameters: settingsPayload.mcp_parameters } : {}),
532
+ ...('mcp_shared_parameters' in settingsPayload
533
+ ? { mcp_shared_parameters: settingsPayload.mcp_shared_parameters }
534
+ : {}),
429
535
  } satisfies AppInstallationPayload,
430
536
  });
431
537
  }
@@ -9,6 +9,9 @@ import type {
9
9
  OAuthGrantableScopesResponse,
10
10
  OAuthLoginDecisionResponse,
11
11
  OAuthLoginPayload,
12
+ OAuthTokenExchangeRequest,
13
+ OAuthTokenExchangeResponse,
14
+ ProjectRef,
12
15
  } from '@vertesia/common';
13
16
 
14
17
  export default class OAuthServerApi extends ClientBase {
@@ -22,6 +25,30 @@ export default class OAuthServerApi extends ClientBase {
22
25
  this.verboseErrors = parent.verboseErrors;
23
26
  }
24
27
 
28
+ /** Exchange a signed IdP assertion; optional client authentication follows the connection policy. */
29
+ exchangeToken(
30
+ payload: OAuthTokenExchangeRequest,
31
+ basic?: { client_id: string; client_secret: string },
32
+ ): Promise<OAuthTokenExchangeResponse> {
33
+ if (
34
+ basic &&
35
+ (payload.client_secret !== undefined ||
36
+ payload.client_assertion !== undefined ||
37
+ (payload.client_id !== undefined && payload.client_id !== basic.client_id))
38
+ )
39
+ throw new Error('Use exactly one client authentication method');
40
+ return this.post('/token', {
41
+ payload,
42
+ ...(basic
43
+ ? {
44
+ headers: {
45
+ Authorization: `Basic ${btoa(`${encodeURIComponent(basic.client_id)}:${encodeURIComponent(basic.client_secret)}`)}`,
46
+ },
47
+ }
48
+ : {}),
49
+ });
50
+ }
51
+
25
52
  login(requestId: string, payload: OAuthLoginPayload): Promise<OAuthLoginDecisionResponse> {
26
53
  return this.post(`/requests/${encodeURIComponent(requestId)}/login`, { payload });
27
54
  }
@@ -76,6 +103,10 @@ export default class OAuthServerApi extends ClientBase {
76
103
  return this.get(`/requests/${requestId}`);
77
104
  }
78
105
 
106
+ retrieveGrantableProjects(requestId: string): Promise<ProjectRef[]> {
107
+ return this.get(`/requests/${encodeURIComponent(requestId)}/grantable-projects`);
108
+ }
109
+
79
110
  retrieveGrantableScopes(requestId: string, projectId: string): Promise<OAuthGrantableScopesResponse> {
80
111
  return this.get(`/requests/${requestId}/grantable-scopes`, { query: { project_id: projectId } });
81
112
  }
@@ -0,0 +1,23 @@
1
+ import { ApiTopic, type ClientBase } from '@vertesia/api-fetch-client';
2
+ import type { OidcFederationConnection, OidcFederationConnectionPayload, SuccessResponse } from '@vertesia/common';
3
+
4
+ export default class OidcFederationApi extends ApiTopic {
5
+ constructor(parent: ClientBase) {
6
+ super(parent, '/api/v1/oidc-federation');
7
+ }
8
+ retrieve(id: string): Promise<OidcFederationConnection> {
9
+ return this.get(`/${encodeURIComponent(id)}`);
10
+ }
11
+ list(): Promise<OidcFederationConnection[]> {
12
+ return this.get('/');
13
+ }
14
+ create(payload: OidcFederationConnectionPayload): Promise<OidcFederationConnection> {
15
+ return this.post('/', { payload });
16
+ }
17
+ update(id: string, payload: OidcFederationConnectionPayload): Promise<OidcFederationConnection> {
18
+ return this.put(`/${encodeURIComponent(id)}`, { payload });
19
+ }
20
+ remove(id: string): Promise<SuccessResponse> {
21
+ return this.del(`/${encodeURIComponent(id)}`);
22
+ }
23
+ }
package/src/client.ts CHANGED
@@ -18,6 +18,7 @@ import OAuthClientsApi from './OAuthClientsApi.js';
18
18
  import OAuthGrantsApi from './OAuthGrantsApi.js';
19
19
  import OAuthProvidersApi from './OAuthProvidersApi.js';
20
20
  import OAuthServerApi from './OAuthServerApi.js';
21
+ import OidcFederationApi from './OidcFederationApi.js';
21
22
  import ProjectsApi from './ProjectsApi.js';
22
23
  import PromptsApi from './PromptsApi.js';
23
24
  import QuotaApi from './QuotaApi.js';
@@ -120,6 +121,7 @@ export class VertesiaClient extends AbstractFetchClient<VertesiaClient> {
120
121
  */
121
122
  tokenServerUrl: string;
122
123
 
124
+ oidcFederation: OidcFederationApi;
123
125
  oauthClients: OAuthClientsApi;
124
126
  oauthGrants: OAuthGrantsApi;
125
127
  oauthServer: OAuthServerApi;
@@ -251,6 +253,7 @@ export class VertesiaClient extends AbstractFetchClient<VertesiaClient> {
251
253
  this.onRequest = opts.onRequest;
252
254
  this.onResponse = opts.onResponse;
253
255
  this.sessionTags = opts.sessionTags;
256
+ this.oidcFederation = new OidcFederationApi(this);
254
257
  this.oauthClients = new OAuthClientsApi(this);
255
258
  this.oauthGrants = new OAuthGrantsApi(this);
256
259
  this.oauthServer = new OAuthServerApi(this, this.tokenServerUrl);
package/src/index.ts CHANGED
@@ -12,6 +12,7 @@ export { default as OAuthClientsApi } from './OAuthClientsApi.js';
12
12
  export { default as OAuthGrantsApi } from './OAuthGrantsApi.js';
13
13
  export { default as OAuthProvidersApi } from './OAuthProvidersApi.js';
14
14
  export { default as OAuthServerApi } from './OAuthServerApi.js';
15
+ export { default as OidcFederationApi } from './OidcFederationApi.js';
15
16
  export type { ComputePromptFacetsResponse, ListInteractionsResponse } from './PromptsApi.js';
16
17
  export { default as RemoteMcpConnectionsApi } from './RemoteMcpConnectionsApi.js';
17
18
  export type { ComputeRunFacetsResponse, FilterOption } from './RunsApi.js';
@@ -39,6 +39,7 @@ import {
39
39
  type ObjectSearchResponse,
40
40
  type ProjectedContentObjectApiResponse,
41
41
  type SetObjectEmbeddingsResponse,
42
+ type SetObjectTextPayload,
42
43
  type StartContentObjectExportRequest,
43
44
  type StartContentObjectExportResponse,
44
45
  type SupportedEmbeddingTypes,
@@ -280,6 +281,18 @@ export class ObjectsApi extends ApiTopic {
280
281
  return this.get(`/${id}/text`);
281
282
  }
282
283
 
284
+ /**
285
+ * Store the extracted text of an object as a text artifact.
286
+ *
287
+ * Pass the content etag the text was extracted from so the server records it as the
288
+ * object `text_etag`, allowing extraction to be skipped while the content is unchanged.
289
+ */
290
+ setObjectText(id: string, payload: SetObjectTextPayload): Promise<ContentObjectTextResponse> {
291
+ return this.put(`/${id}/text`, {
292
+ payload,
293
+ });
294
+ }
295
+
283
296
  async upload(source: StreamSource | File) {
284
297
  const isStream = source instanceof StreamSource;
285
298
  // get a signed URL to upload the file a computed mimeType and the file object id.
@@ -50,8 +50,15 @@ export class ProcessApi extends ApiTopic {
50
50
  return this.get(`/${id}/versions`);
51
51
  }
52
52
 
53
+ /**
54
+ * Publish a draft revision. Set `idempotency_key` to make the call safe to retry: without one, a
55
+ * replay of a publish that already succeeded is rejected, so no client retry applies.
56
+ */
53
57
  publish(id: string, payload: PublishProcessDefinitionPayload): Promise<ProcessDefinition> {
54
- return this.post(`/${id}/publish`, { payload });
58
+ return this.post(`/${id}/publish`, {
59
+ payload,
60
+ retryPolicy: payload.idempotency_key ? undefined : false,
61
+ });
55
62
  }
56
63
 
57
64
  revert(id: string, payload: RevertProcessDefinitionPayload): Promise<ProcessDefinition> {
@@ -82,8 +89,15 @@ export class ProcessApi extends ApiTopic {
82
89
  return this.del(`/${processId}/test-suites/${suiteId}`);
83
90
  }
84
91
 
92
+ /**
93
+ * Start a test run against a stored process revision. Set `idempotency_key` to make the call
94
+ * safe to retry: without one, a replay would start a second run, so no client retry applies.
95
+ */
85
96
  startTestRun(processId: string, payload: StartProcessTestRunPayload): Promise<ProcessTestRun> {
86
- return this.post(`/${processId}/test-runs`, { payload });
97
+ return this.post(`/${processId}/test-runs`, {
98
+ payload,
99
+ retryPolicy: payload.idempotency_key ? undefined : false,
100
+ });
87
101
  }
88
102
 
89
103
  listTestRuns(processId: string, query?: ListProcessTestRunsQuery): Promise<ProcessTestRun[]> {
@@ -17,13 +17,17 @@ export class ProcessTestRunApi extends ApiTopic {
17
17
  * Start a test run against an in-code process or an inline definition, with the scenarios
18
18
  * supplied in the request instead of a stored suite. Use
19
19
  * `client.store.processes.startTestRun()` for stored process definitions and their suites.
20
+ *
21
+ * Set `idempotency_key` to make the call safe to retry: the client's retry policy then applies,
22
+ * and a replayed request returns the run the first one started.
20
23
  */
21
24
  submit(payload: SubmitProcessTestRunPayload): Promise<ProcessTestRun> {
22
- // Starting a run is not idempotent and the contract carries no request key, so a replay
23
- // would create a second run. Opt out of any client-level retry policy explicitly rather
24
- // than relying on POST being absent from its method list. Rate-limiter pacing retries are
25
- // unaffected: those happen before the request reaches the handler.
26
- return this.post('/', { payload, retryPolicy: false });
25
+ // Without a key, starting a run is not idempotent: a request abandoned client-side can still
26
+ // complete server-side, so a replay would create a second run. Opt out of any client-level
27
+ // retry policy explicitly rather than relying on POST being absent from its method list.
28
+ // Rate-limiter pacing retries are unaffected: those happen before the request reaches the
29
+ // handler.
30
+ return this.post('/', { payload, retryPolicy: payload.idempotency_key ? undefined : false });
27
31
  }
28
32
 
29
33
  retrieve(runId: string): Promise<ProcessTestRun> {