@parallelworks/client 7.120.0 → 7.122.0
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/README.md +22 -3
- package/dist/credentials.d.ts +89 -0
- package/dist/credentials.js +321 -0
- package/dist/credentials.test.d.ts +1 -0
- package/dist/credentials.test.js +277 -0
- package/dist/index.d.ts +65 -24
- package/dist/index.js +130 -37
- package/dist/index.test.js +1 -20
- package/dist/types/api.d.ts +92 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { problemMiddleware } from '@parallelworks/problem';
|
|
2
2
|
import createClient from 'openapi-fetch';
|
|
3
|
+
import { CLIAuth, hostForUnnamedCredential, loadCredentialConfig, resolveIdentity, } from './credentials';
|
|
4
|
+
export * from './credentials';
|
|
3
5
|
export { ApiError, codeForStatus, FieldError, fromResponseBody, problemMediaType, toApiError, } from '@parallelworks/problem';
|
|
6
|
+
function withScheme(host) {
|
|
7
|
+
return host.startsWith('http://') || host.startsWith('https://')
|
|
8
|
+
? host
|
|
9
|
+
: `https://${host}`;
|
|
10
|
+
}
|
|
4
11
|
/**
|
|
5
12
|
* The language of the POSIX locale environment (LC_ALL, then LC_MESSAGES,
|
|
6
13
|
* then LANG) as a language tag: `ja_JP.UTF-8` is `ja-JP`. Undefined when none
|
|
@@ -32,10 +39,10 @@ export function problemTypeUrl(error, baseUrl) {
|
|
|
32
39
|
/** Prefix for Parallel Works API keys */
|
|
33
40
|
export const API_KEY_PREFIX = 'pwt_';
|
|
34
41
|
/**
|
|
35
|
-
* Prefix for opaque
|
|
36
|
-
*
|
|
42
|
+
* Prefix for opaque access tokens, such as the one `pw auth` saves. Sent as a
|
|
43
|
+
* Bearer token; it names no platform host.
|
|
37
44
|
*/
|
|
38
|
-
export const
|
|
45
|
+
export const OPAQUE_ACCESS_TOKEN_PREFIX = 'pwoa_';
|
|
39
46
|
/** Error thrown when credential parsing fails */
|
|
40
47
|
export class CredentialError extends Error {
|
|
41
48
|
constructor(message) {
|
|
@@ -43,6 +50,20 @@ export class CredentialError extends Error {
|
|
|
43
50
|
this.name = 'CredentialError';
|
|
44
51
|
}
|
|
45
52
|
}
|
|
53
|
+
/** Raised when a credential names no platform host and nothing else supplies one. */
|
|
54
|
+
export class NoPlatformHostError extends CredentialError {
|
|
55
|
+
constructor(message = 'could not extract platform host from credential') {
|
|
56
|
+
super(message);
|
|
57
|
+
this.name = 'NoPlatformHostError';
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/** Raised when the pw CLI cannot provide a token for a `pw auth` sign-in and no earlier one is still valid. */
|
|
61
|
+
export class SignInExpiredError extends CredentialError {
|
|
62
|
+
constructor(cause) {
|
|
63
|
+
super(`the pw CLI could not provide a token for the pw auth sign-in; run pw auth again, or install pw: ${cause instanceof Error ? cause.message : String(cause)}`);
|
|
64
|
+
this.name = 'SignInExpiredError';
|
|
65
|
+
}
|
|
66
|
+
}
|
|
46
67
|
/**
|
|
47
68
|
* Check if a credential is an API key.
|
|
48
69
|
*
|
|
@@ -55,52 +76,51 @@ export function isApiKey(credential) {
|
|
|
55
76
|
return credential.trim().startsWith(API_KEY_PREFIX);
|
|
56
77
|
}
|
|
57
78
|
/**
|
|
58
|
-
* Check if a credential is
|
|
59
|
-
*
|
|
60
|
-
* Tokens are opaque user tokens (starting with "pwut_") or JWTs, which have
|
|
61
|
-
* three base64-encoded parts separated by dots.
|
|
79
|
+
* Check if a credential is sent as a Bearer token: a JWT, whose three
|
|
80
|
+
* base64-encoded parts are separated by dots, or an opaque access token.
|
|
62
81
|
*
|
|
63
82
|
* @param credential - The credential string to check
|
|
64
83
|
* @returns True if the credential appears to be a token
|
|
65
84
|
*/
|
|
66
85
|
export function isToken(credential) {
|
|
67
86
|
const trimmed = credential.trim();
|
|
68
|
-
if (trimmed.startsWith(
|
|
87
|
+
if (trimmed.startsWith(OPAQUE_ACCESS_TOKEN_PREFIX)) {
|
|
69
88
|
return true;
|
|
70
89
|
}
|
|
71
90
|
const parts = trimmed.split('.');
|
|
72
91
|
return parts.length === 3 && !trimmed.startsWith(API_KEY_PREFIX);
|
|
73
92
|
}
|
|
74
93
|
/**
|
|
75
|
-
* Extract the platform host from an API key or token.
|
|
94
|
+
* Extract the platform host from an API key or JWT token.
|
|
76
95
|
*
|
|
77
|
-
* For API keys (pwt_xxxx.yyyy)
|
|
78
|
-
* the first part after the prefix to get the host
|
|
96
|
+
* For API keys (pwt_xxxx.yyyy): decodes the first part after pwt_ to get the host
|
|
79
97
|
* For JWT tokens: decodes the payload (second segment) and reads platform_host field
|
|
80
98
|
*
|
|
81
|
-
* @param credential - The API key or token
|
|
99
|
+
* @param credential - The API key or JWT token
|
|
82
100
|
* @returns The platform host (e.g., "activate.parallel.works")
|
|
101
|
+
* @throws NoPlatformHostError for an opaque access token, which names no host
|
|
83
102
|
* @throws CredentialError if the credential format is invalid
|
|
84
103
|
*/
|
|
85
104
|
export function extractPlatformHost(credential) {
|
|
86
105
|
credential = credential.trim();
|
|
87
106
|
if (isApiKey(credential)) {
|
|
88
|
-
return
|
|
107
|
+
return extractHostFromApiKey(credential);
|
|
89
108
|
}
|
|
90
|
-
if (credential.startsWith(
|
|
91
|
-
|
|
109
|
+
if (credential.startsWith(OPAQUE_ACCESS_TOKEN_PREFIX)) {
|
|
110
|
+
throw new NoPlatformHostError();
|
|
92
111
|
}
|
|
93
112
|
if (isToken(credential)) {
|
|
94
113
|
return extractHostFromToken(credential);
|
|
95
114
|
}
|
|
96
115
|
throw new CredentialError('Invalid credential format');
|
|
97
116
|
}
|
|
98
|
-
function
|
|
99
|
-
|
|
117
|
+
function extractHostFromApiKey(apiKey) {
|
|
118
|
+
// Remove pwt_ prefix
|
|
119
|
+
const withoutPrefix = apiKey.slice(API_KEY_PREFIX.length);
|
|
100
120
|
// Split by dot
|
|
101
121
|
const dotIndex = withoutPrefix.indexOf('.');
|
|
102
122
|
if (dotIndex === -1) {
|
|
103
|
-
throw new CredentialError('Invalid
|
|
123
|
+
throw new CredentialError('Invalid API key format');
|
|
104
124
|
}
|
|
105
125
|
const encodedHost = withoutPrefix.slice(0, dotIndex);
|
|
106
126
|
// Decode base64 (handle both browser and Node.js)
|
|
@@ -127,11 +147,11 @@ function extractEncodedHost(credential, prefix) {
|
|
|
127
147
|
}
|
|
128
148
|
}
|
|
129
149
|
catch (e) {
|
|
130
|
-
throw new CredentialError(`Could not decode
|
|
150
|
+
throw new CredentialError(`Could not decode API key host: ${e}`);
|
|
131
151
|
}
|
|
132
152
|
}
|
|
133
153
|
if (!host) {
|
|
134
|
-
throw new CredentialError('No platform host in
|
|
154
|
+
throw new CredentialError('No platform host in API key');
|
|
135
155
|
}
|
|
136
156
|
return host;
|
|
137
157
|
}
|
|
@@ -178,13 +198,12 @@ function extractHostFromToken(token) {
|
|
|
178
198
|
* ```ts
|
|
179
199
|
* import { Client } from '@parallelworks/client'
|
|
180
200
|
*
|
|
181
|
-
* //
|
|
182
|
-
* const client =
|
|
183
|
-
* .withApiKey('pwt_...')
|
|
201
|
+
* // Signed in with `pw auth`: the client asks the pw CLI to renew the token
|
|
202
|
+
* const client = Client.fromCredentialConfig()
|
|
184
203
|
*
|
|
185
|
-
* // Using
|
|
204
|
+
* // Using API Key (Basic Auth) - for unattended jobs such as CI
|
|
186
205
|
* const client = new Client('https://activate.parallel.works')
|
|
187
|
-
* .
|
|
206
|
+
* .withApiKey('pwt_...')
|
|
188
207
|
*
|
|
189
208
|
* // Or let the client extract the host from your credential
|
|
190
209
|
* const client = Client.fromCredential(process.env.PW_API_KEY!)
|
|
@@ -202,10 +221,12 @@ export class Client {
|
|
|
202
221
|
* Create a client using only a credential.
|
|
203
222
|
*
|
|
204
223
|
* The platform host is automatically extracted from the credential:
|
|
205
|
-
* - For API keys
|
|
224
|
+
* - For API keys: host is decoded from the first part after pwt_
|
|
206
225
|
* - For JWT tokens: host is read from the platform_host claim
|
|
226
|
+
* - For access tokens (pwoa_), which name no host: PW_PLATFORM_HOST, else
|
|
227
|
+
* the server of the credentials file's selected context (Node.js only)
|
|
207
228
|
*
|
|
208
|
-
* @param credential - Your API key or
|
|
229
|
+
* @param credential - Your API key or token
|
|
209
230
|
* @param options - Additional client options
|
|
210
231
|
* @returns Configured API client ready to make requests
|
|
211
232
|
* @throws CredentialError if the credential format is invalid
|
|
@@ -217,12 +238,61 @@ export class Client {
|
|
|
217
238
|
* ```
|
|
218
239
|
*/
|
|
219
240
|
static fromCredential(credential, options = {}) {
|
|
220
|
-
let host
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
241
|
+
let host;
|
|
242
|
+
try {
|
|
243
|
+
host = extractPlatformHost(credential);
|
|
244
|
+
}
|
|
245
|
+
catch (e) {
|
|
246
|
+
const fallback = e instanceof NoPlatformHostError
|
|
247
|
+
? hostForUnnamedCredential()
|
|
248
|
+
: undefined;
|
|
249
|
+
if (!fallback) {
|
|
250
|
+
throw e;
|
|
251
|
+
}
|
|
252
|
+
host = fallback;
|
|
224
253
|
}
|
|
225
|
-
return new Client(host, options).withCredential(credential);
|
|
254
|
+
return new Client(withScheme(host), options).withCredential(credential);
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Create a client from the pw credentials file (Node.js only), picking the
|
|
258
|
+
* credential as the CLI and the Go SDK do: PW_API_KEY, then the `context`
|
|
259
|
+
* option, PW_CONTEXT, and the file's current context.
|
|
260
|
+
*
|
|
261
|
+
* A context signed in with `pw auth` stays signed in: when its access token
|
|
262
|
+
* nears expiry the client runs `pw auth token --print` for a renewed one
|
|
263
|
+
* (see `CLIAuth`), so sign in once and let scripts run. Unattended jobs such
|
|
264
|
+
* as CI should use an API key in PW_API_KEY instead.
|
|
265
|
+
*
|
|
266
|
+
* @example
|
|
267
|
+
* ```ts
|
|
268
|
+
* const client = Client.fromCredentialConfig()
|
|
269
|
+
* const { data } = await client.GET('/api/buckets')
|
|
270
|
+
* ```
|
|
271
|
+
*/
|
|
272
|
+
static fromCredentialConfig(options = {}) {
|
|
273
|
+
const { context, platformHost, cliCommand, cliTimeoutMs, ...clientOptions } = options;
|
|
274
|
+
const config = loadCredentialConfig();
|
|
275
|
+
const { context: name, identity } = resolveIdentity(config, {
|
|
276
|
+
context,
|
|
277
|
+
platformHost,
|
|
278
|
+
});
|
|
279
|
+
const client = new Client(withScheme(identity.server), clientOptions);
|
|
280
|
+
if (identity.apikey) {
|
|
281
|
+
return isToken(identity.apikey)
|
|
282
|
+
? client.withToken(identity.apikey)
|
|
283
|
+
: client.withApiKey(identity.apikey);
|
|
284
|
+
}
|
|
285
|
+
if (!identity.token) {
|
|
286
|
+
throw new CredentialError('you must first authenticate using "pw auth"');
|
|
287
|
+
}
|
|
288
|
+
if (identity.oauth) {
|
|
289
|
+
return client.withTokenProvider(new CLIAuth({
|
|
290
|
+
command: cliCommand,
|
|
291
|
+
context: name,
|
|
292
|
+
timeoutMs: cliTimeoutMs,
|
|
293
|
+
}));
|
|
294
|
+
}
|
|
295
|
+
return client.withToken(identity.token);
|
|
226
296
|
}
|
|
227
297
|
/**
|
|
228
298
|
* Authenticate with an API Key using Basic Auth
|
|
@@ -241,20 +311,22 @@ export class Client {
|
|
|
241
311
|
? btoa(`${apiKey}:`)
|
|
242
312
|
: Buffer.from(`${apiKey}:`).toString('base64');
|
|
243
313
|
this.authHeader = `Basic ${encoded}`;
|
|
314
|
+
this.tokenProvider = undefined;
|
|
244
315
|
return this.build();
|
|
245
316
|
}
|
|
246
317
|
/**
|
|
247
|
-
* Authenticate with a Bearer
|
|
318
|
+
* Authenticate with a Bearer token, sent as is and never renewed.
|
|
248
319
|
*
|
|
249
|
-
*
|
|
250
|
-
*
|
|
320
|
+
* For a script, sign in once with `pw auth` and use `fromCredentialConfig`,
|
|
321
|
+
* which renews the token; for an unattended job such as CI, use an API key.
|
|
251
322
|
*
|
|
252
|
-
* @param token -
|
|
323
|
+
* @param token - A token, such as one `pw auth token --print` printed
|
|
253
324
|
* @returns Configured API client ready to make requests
|
|
254
325
|
*/
|
|
255
326
|
withToken(token) {
|
|
256
327
|
// Trim whitespace to handle env vars with trailing newlines
|
|
257
328
|
this.authHeader = `Bearer ${token.trim()}`;
|
|
329
|
+
this.tokenProvider = undefined;
|
|
258
330
|
return this.build();
|
|
259
331
|
}
|
|
260
332
|
/**
|
|
@@ -263,7 +335,7 @@ export class Client {
|
|
|
263
335
|
* Automatically detects whether the credential is an API key (starts with "pwt_")
|
|
264
336
|
* or a token and configures the appropriate authentication method.
|
|
265
337
|
*
|
|
266
|
-
* @param credential - Your API key or
|
|
338
|
+
* @param credential - Your API key or token
|
|
267
339
|
* @returns Configured API client ready to make requests
|
|
268
340
|
*/
|
|
269
341
|
withCredential(credential) {
|
|
@@ -272,6 +344,18 @@ export class Client {
|
|
|
272
344
|
}
|
|
273
345
|
return this.withToken(credential);
|
|
274
346
|
}
|
|
347
|
+
/**
|
|
348
|
+
* Authenticate each request with a Bearer token the provider supplies, such
|
|
349
|
+
* as a `CLIAuth` that renews a `pw auth` sign-in.
|
|
350
|
+
*
|
|
351
|
+
* @param provider - Supplies the current token
|
|
352
|
+
* @returns Configured API client ready to make requests
|
|
353
|
+
*/
|
|
354
|
+
withTokenProvider(provider) {
|
|
355
|
+
this.authHeader = undefined;
|
|
356
|
+
this.tokenProvider = provider;
|
|
357
|
+
return this.build();
|
|
358
|
+
}
|
|
275
359
|
/**
|
|
276
360
|
* Build the openapi-fetch client with configured options.
|
|
277
361
|
*
|
|
@@ -290,6 +374,15 @@ export class Client {
|
|
|
290
374
|
...(this.authHeader && { Authorization: this.authHeader }),
|
|
291
375
|
},
|
|
292
376
|
});
|
|
377
|
+
const provider = this.tokenProvider;
|
|
378
|
+
if (provider) {
|
|
379
|
+
client.use({
|
|
380
|
+
async onRequest({ request }) {
|
|
381
|
+
request.headers.set('Authorization', `Bearer ${await provider.token()}`);
|
|
382
|
+
return request;
|
|
383
|
+
},
|
|
384
|
+
});
|
|
385
|
+
}
|
|
293
386
|
client.use(problemMiddleware);
|
|
294
387
|
// Attach HTTP status code to error response bodies so consumers
|
|
295
388
|
// (e.g. SWR hooks) can distinguish 404s from other errors.
|
package/dist/index.test.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest';
|
|
2
|
-
import { acceptLanguageFromEnv, Client,
|
|
2
|
+
import { acceptLanguageFromEnv, Client, problemMediaType, problemTypeUrl, toApiError, } from './index';
|
|
3
3
|
function respond(status, body, contentType) {
|
|
4
4
|
const requests = [];
|
|
5
5
|
const fetch = async (input) => {
|
|
@@ -106,22 +106,3 @@ describe('acceptLanguageFromEnv', () => {
|
|
|
106
106
|
expect(acceptLanguageFromEnv(env)).toBe(want);
|
|
107
107
|
});
|
|
108
108
|
});
|
|
109
|
-
describe('opaque user tokens', () => {
|
|
110
|
-
const token = `${USER_TOKEN_PREFIX}${btoa('activate.parallel.works')}.${btoa('raw')}`;
|
|
111
|
-
it('is a token, not an API key', () => {
|
|
112
|
-
expect(isToken(token)).toBe(true);
|
|
113
|
-
expect(isApiKey(token)).toBe(false);
|
|
114
|
-
});
|
|
115
|
-
it('names its platform host', () => {
|
|
116
|
-
expect(extractPlatformHost(token)).toBe('activate.parallel.works');
|
|
117
|
-
expect(() => extractPlatformHost(`${USER_TOKEN_PREFIX}no-dot`)).toThrow();
|
|
118
|
-
});
|
|
119
|
-
it('is sent as a Bearer token to the host it names', async () => {
|
|
120
|
-
const { fetch, requests } = respond(200, '[]', 'application/json');
|
|
121
|
-
const client = Client.fromCredential(token, { fetch });
|
|
122
|
-
await client.GET('/api/workflows');
|
|
123
|
-
const request = requests[0];
|
|
124
|
-
expect(new URL(request.url).host).toBe('activate.parallel.works');
|
|
125
|
-
expect(request.headers.get('Authorization')).toBe(`Bearer ${token}`);
|
|
126
|
-
});
|
|
127
|
-
});
|
package/dist/types/api.d.ts
CHANGED
|
@@ -2654,9 +2654,12 @@ export interface paths {
|
|
|
2654
2654
|
};
|
|
2655
2655
|
/**
|
|
2656
2656
|
* Generate a user token
|
|
2657
|
+
* @deprecated
|
|
2657
2658
|
* @description > This is a user-centric route, so the response will always be in the context of the currently authenticated user.
|
|
2658
2659
|
*
|
|
2659
2660
|
* Generates a token for the authenticated user. The token can be used for API authentication.
|
|
2661
|
+
*
|
|
2662
|
+
* This route is deprecated: sign in with `pw auth login` instead, and use an API key for automation.
|
|
2660
2663
|
*/
|
|
2661
2664
|
get: operations["get-auth-token"];
|
|
2662
2665
|
put?: never;
|
|
@@ -6863,6 +6866,28 @@ export interface paths {
|
|
|
6863
6866
|
patch: operations["update-organization-cloud-account-network"];
|
|
6864
6867
|
trace?: never;
|
|
6865
6868
|
};
|
|
6869
|
+
"/api/organizations/{organization}/cloud-accounts/{name}/networks/{networkName}/retry": {
|
|
6870
|
+
parameters: {
|
|
6871
|
+
query?: never;
|
|
6872
|
+
header?: never;
|
|
6873
|
+
path?: never;
|
|
6874
|
+
cookie?: never;
|
|
6875
|
+
};
|
|
6876
|
+
get?: never;
|
|
6877
|
+
put?: never;
|
|
6878
|
+
/**
|
|
6879
|
+
* Retry a failed network
|
|
6880
|
+
* @description > This is a system-level route, so the response will be independent of the currently authenticated user.
|
|
6881
|
+
*
|
|
6882
|
+
* Provisions a failed network again on the same record once its cloud resources have been rolled back, using the submitted settings.
|
|
6883
|
+
*/
|
|
6884
|
+
post: operations["retry-organization-cloud-account-network"];
|
|
6885
|
+
delete?: never;
|
|
6886
|
+
options?: never;
|
|
6887
|
+
head?: never;
|
|
6888
|
+
patch?: never;
|
|
6889
|
+
trace?: never;
|
|
6890
|
+
};
|
|
6866
6891
|
"/api/organizations/{organization}/cloud-accounts/{name}/openstack/flavors": {
|
|
6867
6892
|
parameters: {
|
|
6868
6893
|
query?: never;
|
|
@@ -19020,6 +19045,7 @@ export interface components {
|
|
|
19020
19045
|
question?: string;
|
|
19021
19046
|
reason?: string;
|
|
19022
19047
|
subagentId?: string;
|
|
19048
|
+
tool?: string;
|
|
19023
19049
|
};
|
|
19024
19050
|
AppsOutputBody: {
|
|
19025
19051
|
apps: components["schemas"]["App"][];
|
|
@@ -21434,9 +21460,13 @@ export interface components {
|
|
|
21434
21460
|
provisioningMode?: string;
|
|
21435
21461
|
rdmaProfile?: string;
|
|
21436
21462
|
regions: components["schemas"]["ConfigRegion"][] | null;
|
|
21463
|
+
/** @description True when the network can be provisioned again: it was deleted, or its failed attempt's cloud resources were rolled back */
|
|
21464
|
+
retryable: boolean;
|
|
21437
21465
|
status: string;
|
|
21466
|
+
transitGatewayId?: string;
|
|
21438
21467
|
/** Format: date-time */
|
|
21439
21468
|
updatedAt: string;
|
|
21469
|
+
zone?: string;
|
|
21440
21470
|
};
|
|
21441
21471
|
CloudAccountNetworkSummary: {
|
|
21442
21472
|
id: string;
|
|
@@ -21444,6 +21474,8 @@ export interface components {
|
|
|
21444
21474
|
provisioningMode?: string;
|
|
21445
21475
|
rdmaProfile?: string;
|
|
21446
21476
|
regions: components["schemas"]["ConfigRegion"][] | null;
|
|
21477
|
+
/** @description True when the network can be provisioned again: it was deleted, or its failed attempt's cloud resources were rolled back */
|
|
21478
|
+
retryable: boolean;
|
|
21447
21479
|
status: string;
|
|
21448
21480
|
};
|
|
21449
21481
|
CloudAccountPermissionsEntry: {
|
|
@@ -22365,10 +22397,15 @@ export interface components {
|
|
|
22365
22397
|
CreateAPIKeyInputBody: {
|
|
22366
22398
|
/** @description Budget allocation name (required for AI keys) */
|
|
22367
22399
|
allocation?: string;
|
|
22368
|
-
/** @description Days before the key expires, at most the organization's maximum API key lifetime, which is 730 days when no policy sets it. Empty or 0 creates a key that does not expire, which only an Unlimited policy allows. */
|
|
22400
|
+
/** @description Days before the key expires, at most the organization's maximum API key lifetime, which is 730 days when no policy sets it. Empty or 0 creates a key that does not expire, which only an Unlimited policy allows. Not allowed with expiresIn. */
|
|
22369
22401
|
duration?: string;
|
|
22370
|
-
/**
|
|
22371
|
-
|
|
22402
|
+
/**
|
|
22403
|
+
* Format: int64
|
|
22404
|
+
* @description Seconds before the key expires, as in OAuth 2.0 expires_in, for lifetimes that are not whole days. At least 900 (15 minutes) and at most the organization's maximum API key lifetime. Not allowed with duration.
|
|
22405
|
+
*/
|
|
22406
|
+
expiresIn?: number;
|
|
22407
|
+
/** @description Display name for the API key, unique among your keys. When omitted, the key is named token-YYYYMMDD-HHMMSS-xxxx, the time in UTC with a random suffix. */
|
|
22408
|
+
title?: string;
|
|
22372
22409
|
/**
|
|
22373
22410
|
* @description Key type
|
|
22374
22411
|
* @default platform
|
|
@@ -22625,10 +22662,14 @@ export interface components {
|
|
|
22625
22662
|
title?: string;
|
|
22626
22663
|
};
|
|
22627
22664
|
CreateDiskSnapshotBody: {
|
|
22665
|
+
/** @description Store the snapshot in the multi-region location covering the source region, making it usable in every region there (Google only) */
|
|
22666
|
+
multiRegion?: boolean;
|
|
22628
22667
|
/** @description Name of the snapshot */
|
|
22629
22668
|
snapshotName: string;
|
|
22630
22669
|
};
|
|
22631
22670
|
CreateEnvironmentBody: {
|
|
22671
|
+
/** @description Whether an account must be supplied to submit. Slurm only, ignored when fields are supplied. */
|
|
22672
|
+
accountRequired?: boolean;
|
|
22632
22673
|
/** @description Default wall time. */
|
|
22633
22674
|
defaultTime?: string;
|
|
22634
22675
|
/** @description Default values for fields. */
|
|
@@ -22639,7 +22680,7 @@ export interface components {
|
|
|
22639
22680
|
description?: string;
|
|
22640
22681
|
/** @description Display name. */
|
|
22641
22682
|
displayName?: string;
|
|
22642
|
-
/** @description Custom form fields. */
|
|
22683
|
+
/** @description Custom form fields. Omit to use the scheduler's default schema. */
|
|
22643
22684
|
fields?: components["schemas"]["EnvironmentField"][] | null;
|
|
22644
22685
|
/** @description Maximum wall time. */
|
|
22645
22686
|
maxTime?: string;
|
|
@@ -22647,6 +22688,8 @@ export interface components {
|
|
|
22647
22688
|
name: string;
|
|
22648
22689
|
/** @description Scheduler partition name. */
|
|
22649
22690
|
partitionName: string;
|
|
22691
|
+
/** @description Whether a QoS must be supplied to submit. Slurm only, ignored when fields are supplied. */
|
|
22692
|
+
qosRequired?: boolean;
|
|
22650
22693
|
/**
|
|
22651
22694
|
* @description Scheduler type.
|
|
22652
22695
|
* @enum {string}
|
|
@@ -22760,6 +22803,8 @@ export interface components {
|
|
|
22760
22803
|
created: number;
|
|
22761
22804
|
};
|
|
22762
22805
|
CreateInstanceSnapshotBody: {
|
|
22806
|
+
/** @description Store the snapshot in the multi-region location covering the source region, making it usable in every region there (Google only) */
|
|
22807
|
+
multiRegion?: boolean;
|
|
22763
22808
|
/** @description Name of the snapshot */
|
|
22764
22809
|
snapshotName: string;
|
|
22765
22810
|
};
|
|
@@ -23191,6 +23236,8 @@ export interface components {
|
|
|
23191
23236
|
CreateSnapshotBody: {
|
|
23192
23237
|
/** @description Mount point of the inline disk to snapshot; omit to snapshot the cluster root disk */
|
|
23193
23238
|
mountPoint?: string;
|
|
23239
|
+
/** @description Store the snapshot in the multi-region location covering the source region, making it usable in every region there (Google only) */
|
|
23240
|
+
multiRegion?: boolean;
|
|
23194
23241
|
/** @description Name of the snapshot */
|
|
23195
23242
|
snapshotName: string;
|
|
23196
23243
|
};
|
|
@@ -33847,7 +33894,6 @@ export interface components {
|
|
|
33847
33894
|
inputTokens?: number;
|
|
33848
33895
|
model: string;
|
|
33849
33896
|
name?: string;
|
|
33850
|
-
noToolsMode?: boolean;
|
|
33851
33897
|
/** Format: int64 */
|
|
33852
33898
|
outputTokens?: number;
|
|
33853
33899
|
pendingSubagentWork?: boolean;
|
|
@@ -48804,6 +48850,46 @@ export interface operations {
|
|
|
48804
48850
|
};
|
|
48805
48851
|
};
|
|
48806
48852
|
};
|
|
48853
|
+
"retry-organization-cloud-account-network": {
|
|
48854
|
+
parameters: {
|
|
48855
|
+
query?: never;
|
|
48856
|
+
header?: never;
|
|
48857
|
+
path: {
|
|
48858
|
+
/** @description The name of the organization. */
|
|
48859
|
+
organization: string;
|
|
48860
|
+
/** @description Name of the cloud account */
|
|
48861
|
+
name: string;
|
|
48862
|
+
/** @description Name of the network */
|
|
48863
|
+
networkName: string;
|
|
48864
|
+
};
|
|
48865
|
+
cookie?: never;
|
|
48866
|
+
};
|
|
48867
|
+
requestBody: {
|
|
48868
|
+
content: {
|
|
48869
|
+
"application/json": components["schemas"]["CreateNetworkBody"];
|
|
48870
|
+
};
|
|
48871
|
+
};
|
|
48872
|
+
responses: {
|
|
48873
|
+
/** @description OK */
|
|
48874
|
+
200: {
|
|
48875
|
+
headers: {
|
|
48876
|
+
[name: string]: unknown;
|
|
48877
|
+
};
|
|
48878
|
+
content: {
|
|
48879
|
+
"application/json": components["schemas"]["CloudAccountNetwork"];
|
|
48880
|
+
};
|
|
48881
|
+
};
|
|
48882
|
+
/** @description Error */
|
|
48883
|
+
default: {
|
|
48884
|
+
headers: {
|
|
48885
|
+
[name: string]: unknown;
|
|
48886
|
+
};
|
|
48887
|
+
content: {
|
|
48888
|
+
"application/json": components["schemas"]["Error"];
|
|
48889
|
+
};
|
|
48890
|
+
};
|
|
48891
|
+
};
|
|
48892
|
+
};
|
|
48807
48893
|
"get-openstack-flavors": {
|
|
48808
48894
|
parameters: {
|
|
48809
48895
|
query?: never;
|
|
@@ -69733,7 +69819,7 @@ export interface operations {
|
|
|
69733
69819
|
/** @description Filter by workflow name */
|
|
69734
69820
|
workflow?: string;
|
|
69735
69821
|
/** @description Filter by status */
|
|
69736
|
-
status?: ("running" | "completed" | "error" | "canceled")[] | null;
|
|
69822
|
+
status?: ("running" | "completed" | "error" | "canceling" | "canceled")[] | null;
|
|
69737
69823
|
/** @description Search runs by name or slug */
|
|
69738
69824
|
search?: string;
|
|
69739
69825
|
/** @description Maximum number of runs to return */
|