@onkernel/sdk 0.23.0 → 0.24.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/CHANGELOG.md +9 -0
- package/client.d.mts +5 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +5 -2
- package/client.d.ts.map +1 -1
- package/client.js +3 -0
- package/client.js.map +1 -1
- package/client.mjs +3 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/agents/agents.d.mts +2 -2
- package/resources/agents/agents.d.mts.map +1 -1
- package/resources/agents/agents.d.ts +2 -2
- package/resources/agents/agents.d.ts.map +1 -1
- package/resources/agents/agents.js.map +1 -1
- package/resources/agents/agents.mjs.map +1 -1
- package/resources/agents/auth/auth.d.mts +113 -15
- package/resources/agents/auth/auth.d.mts.map +1 -1
- package/resources/agents/auth/auth.d.ts +113 -15
- package/resources/agents/auth/auth.d.ts.map +1 -1
- package/resources/agents/auth/auth.js +35 -0
- package/resources/agents/auth/auth.js.map +1 -1
- package/resources/agents/auth/auth.mjs +35 -0
- package/resources/agents/auth/auth.mjs.map +1 -1
- package/resources/agents/auth/index.d.mts +1 -1
- package/resources/agents/auth/index.d.mts.map +1 -1
- package/resources/agents/auth/index.d.ts +1 -1
- package/resources/agents/auth/index.d.ts.map +1 -1
- package/resources/agents/auth/index.js.map +1 -1
- package/resources/agents/auth/index.mjs.map +1 -1
- package/resources/agents/auth/invocations.d.mts +6 -0
- package/resources/agents/auth/invocations.d.mts.map +1 -1
- package/resources/agents/auth/invocations.d.ts +6 -0
- package/resources/agents/auth/invocations.d.ts.map +1 -1
- package/resources/agents/index.d.mts +1 -1
- package/resources/agents/index.d.mts.map +1 -1
- package/resources/agents/index.d.ts +1 -1
- package/resources/agents/index.d.ts.map +1 -1
- package/resources/agents/index.js.map +1 -1
- package/resources/agents/index.mjs.map +1 -1
- package/resources/browser-pools.d.mts +63 -98
- package/resources/browser-pools.d.mts.map +1 -1
- package/resources/browser-pools.d.ts +63 -98
- package/resources/browser-pools.d.ts.map +1 -1
- package/resources/credentials.d.mts +163 -0
- package/resources/credentials.d.mts.map +1 -0
- package/resources/credentials.d.ts +163 -0
- package/resources/credentials.d.ts.map +1 -0
- package/resources/credentials.js +82 -0
- package/resources/credentials.js.map +1 -0
- package/resources/credentials.mjs +78 -0
- package/resources/credentials.mjs.map +1 -0
- package/resources/index.d.mts +2 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/src/client.ts +23 -8
- package/src/resources/agents/agents.ts +2 -0
- package/src/resources/agents/auth/auth.ts +138 -14
- package/src/resources/agents/auth/index.ts +1 -0
- package/src/resources/agents/auth/invocations.ts +7 -0
- package/src/resources/agents/index.ts +1 -0
- package/src/resources/browser-pools.ts +72 -115
- package/src/resources/credentials.ts +205 -0
- package/src/resources/index.ts +10 -4
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
} from './invocations';
|
|
13
13
|
import { APIPromise } from '../../../core/api-promise';
|
|
14
14
|
import { OffsetPagination, type OffsetPaginationParams, PagePromise } from '../../../core/pagination';
|
|
15
|
+
import { buildHeaders } from '../../../internal/headers';
|
|
15
16
|
import { RequestOptions } from '../../../internal/request-options';
|
|
16
17
|
import { path } from '../../../internal/utils/path';
|
|
17
18
|
|
|
@@ -66,6 +67,42 @@ export class Auth extends APIResource {
|
|
|
66
67
|
): PagePromise<AuthAgentsOffsetPagination, AuthAgent> {
|
|
67
68
|
return this._client.getAPIList('/agents/auth', OffsetPagination<AuthAgent>, { query, ...options });
|
|
68
69
|
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Deletes an auth agent and terminates its workflow. This will:
|
|
73
|
+
*
|
|
74
|
+
* - Soft delete the auth agent record
|
|
75
|
+
* - Gracefully terminate the agent's Temporal workflow
|
|
76
|
+
* - Cancel any in-progress invocations
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```ts
|
|
80
|
+
* await client.agents.auth.delete('id');
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
delete(id: string, options?: RequestOptions): APIPromise<void> {
|
|
84
|
+
return this._client.delete(path`/agents/auth/${id}`, {
|
|
85
|
+
...options,
|
|
86
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Triggers automatic re-authentication for an auth agent using stored credentials.
|
|
92
|
+
* Requires the auth agent to have a linked credential, stored selectors, and
|
|
93
|
+
* login_url. Returns immediately with status indicating whether re-auth was
|
|
94
|
+
* started.
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```ts
|
|
98
|
+
* const reauthResponse = await client.agents.auth.reauth(
|
|
99
|
+
* 'id',
|
|
100
|
+
* );
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
reauth(id: string, options?: RequestOptions): APIPromise<ReauthResponse> {
|
|
104
|
+
return this._client.post(path`/agents/auth/${id}/reauth`, options);
|
|
105
|
+
}
|
|
69
106
|
}
|
|
70
107
|
|
|
71
108
|
export type AuthAgentsOffsetPagination = OffsetPagination<AuthAgent>;
|
|
@@ -196,6 +233,27 @@ export interface AuthAgent {
|
|
|
196
233
|
*/
|
|
197
234
|
status: 'AUTHENTICATED' | 'NEEDS_AUTH';
|
|
198
235
|
|
|
236
|
+
/**
|
|
237
|
+
* Whether automatic re-authentication is possible (has credential_id, selectors,
|
|
238
|
+
* and login_url)
|
|
239
|
+
*/
|
|
240
|
+
can_reauth?: boolean;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* ID of the linked credential for automatic re-authentication
|
|
244
|
+
*/
|
|
245
|
+
credential_id?: string;
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Name of the linked credential for automatic re-authentication
|
|
249
|
+
*/
|
|
250
|
+
credential_name?: string;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Whether this auth agent has stored selectors for deterministic re-authentication
|
|
254
|
+
*/
|
|
255
|
+
has_selectors?: boolean;
|
|
256
|
+
|
|
199
257
|
/**
|
|
200
258
|
* When the last authentication check was performed
|
|
201
259
|
*/
|
|
@@ -216,6 +274,13 @@ export interface AuthAgentCreateRequest {
|
|
|
216
274
|
*/
|
|
217
275
|
target_domain: string;
|
|
218
276
|
|
|
277
|
+
/**
|
|
278
|
+
* Optional name of an existing credential to use for this auth agent. If provided,
|
|
279
|
+
* the credential will be linked to the agent and its values will be used to
|
|
280
|
+
* auto-fill the login form on invocation.
|
|
281
|
+
*/
|
|
282
|
+
credential_name?: string;
|
|
283
|
+
|
|
219
284
|
/**
|
|
220
285
|
* Optional login page URL. If provided, will be stored on the agent and used to
|
|
221
286
|
* skip discovery in future invocations.
|
|
@@ -248,31 +313,62 @@ export interface AuthAgentInvocationCreateRequest {
|
|
|
248
313
|
* ID of the auth agent to create an invocation for
|
|
249
314
|
*/
|
|
250
315
|
auth_agent_id: string;
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* If provided, saves the submitted credentials under this name upon successful
|
|
319
|
+
* login. The credential will be linked to the auth agent for automatic
|
|
320
|
+
* re-authentication.
|
|
321
|
+
*/
|
|
322
|
+
save_credential_as?: string;
|
|
251
323
|
}
|
|
252
324
|
|
|
253
325
|
/**
|
|
254
|
-
* Response
|
|
326
|
+
* Response when the agent is already authenticated.
|
|
255
327
|
*/
|
|
256
|
-
export
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
*/
|
|
260
|
-
expires_at: string;
|
|
328
|
+
export type AuthAgentInvocationCreateResponse =
|
|
329
|
+
| AuthAgentInvocationCreateResponse.AuthAgentAlreadyAuthenticated
|
|
330
|
+
| AuthAgentInvocationCreateResponse.AuthAgentInvocationCreated;
|
|
261
331
|
|
|
332
|
+
export namespace AuthAgentInvocationCreateResponse {
|
|
262
333
|
/**
|
|
263
|
-
*
|
|
334
|
+
* Response when the agent is already authenticated.
|
|
264
335
|
*/
|
|
265
|
-
|
|
336
|
+
export interface AuthAgentAlreadyAuthenticated {
|
|
337
|
+
/**
|
|
338
|
+
* Indicates the agent is already authenticated and no invocation was created.
|
|
339
|
+
*/
|
|
340
|
+
status: 'already_authenticated';
|
|
341
|
+
}
|
|
266
342
|
|
|
267
343
|
/**
|
|
268
|
-
*
|
|
344
|
+
* Response when a new invocation was created.
|
|
269
345
|
*/
|
|
270
|
-
|
|
346
|
+
export interface AuthAgentInvocationCreated {
|
|
347
|
+
/**
|
|
348
|
+
* When the handoff code expires.
|
|
349
|
+
*/
|
|
350
|
+
expires_at: string;
|
|
271
351
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
352
|
+
/**
|
|
353
|
+
* One-time code for handoff.
|
|
354
|
+
*/
|
|
355
|
+
handoff_code: string;
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* URL to redirect user to.
|
|
359
|
+
*/
|
|
360
|
+
hosted_url: string;
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* Unique identifier for the invocation.
|
|
364
|
+
*/
|
|
365
|
+
invocation_id: string;
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* Indicates an invocation was created.
|
|
369
|
+
*/
|
|
370
|
+
status: 'invocation_created';
|
|
371
|
+
}
|
|
276
372
|
}
|
|
277
373
|
|
|
278
374
|
/**
|
|
@@ -310,6 +406,26 @@ export interface DiscoveredField {
|
|
|
310
406
|
required?: boolean;
|
|
311
407
|
}
|
|
312
408
|
|
|
409
|
+
/**
|
|
410
|
+
* Response from triggering re-authentication
|
|
411
|
+
*/
|
|
412
|
+
export interface ReauthResponse {
|
|
413
|
+
/**
|
|
414
|
+
* Result of the re-authentication attempt
|
|
415
|
+
*/
|
|
416
|
+
status: 'reauth_started' | 'already_authenticated' | 'cannot_reauth';
|
|
417
|
+
|
|
418
|
+
/**
|
|
419
|
+
* ID of the re-auth invocation if one was created
|
|
420
|
+
*/
|
|
421
|
+
invocation_id?: string;
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* Human-readable description of the result
|
|
425
|
+
*/
|
|
426
|
+
message?: string;
|
|
427
|
+
}
|
|
428
|
+
|
|
313
429
|
export interface AuthCreateParams {
|
|
314
430
|
/**
|
|
315
431
|
* Name of the profile to use for this auth agent
|
|
@@ -321,6 +437,13 @@ export interface AuthCreateParams {
|
|
|
321
437
|
*/
|
|
322
438
|
target_domain: string;
|
|
323
439
|
|
|
440
|
+
/**
|
|
441
|
+
* Optional name of an existing credential to use for this auth agent. If provided,
|
|
442
|
+
* the credential will be linked to the agent and its values will be used to
|
|
443
|
+
* auto-fill the login form on invocation.
|
|
444
|
+
*/
|
|
445
|
+
credential_name?: string;
|
|
446
|
+
|
|
324
447
|
/**
|
|
325
448
|
* Optional login page URL. If provided, will be stored on the agent and used to
|
|
326
449
|
* skip discovery in future invocations.
|
|
@@ -369,6 +492,7 @@ export declare namespace Auth {
|
|
|
369
492
|
type AuthAgentInvocationCreateRequest as AuthAgentInvocationCreateRequest,
|
|
370
493
|
type AuthAgentInvocationCreateResponse as AuthAgentInvocationCreateResponse,
|
|
371
494
|
type DiscoveredField as DiscoveredField,
|
|
495
|
+
type ReauthResponse as ReauthResponse,
|
|
372
496
|
type AuthAgentsOffsetPagination as AuthAgentsOffsetPagination,
|
|
373
497
|
type AuthCreateParams as AuthCreateParams,
|
|
374
498
|
type AuthListParams as AuthListParams,
|
|
@@ -132,6 +132,13 @@ export interface InvocationCreateParams {
|
|
|
132
132
|
* ID of the auth agent to create an invocation for
|
|
133
133
|
*/
|
|
134
134
|
auth_agent_id: string;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* If provided, saves the submitted credentials under this name upon successful
|
|
138
|
+
* login. The credential will be linked to the auth agent for automatic
|
|
139
|
+
* re-authentication.
|
|
140
|
+
*/
|
|
141
|
+
save_credential_as?: string;
|
|
135
142
|
}
|
|
136
143
|
|
|
137
144
|
export interface InvocationDiscoverParams {
|
|
@@ -162,7 +162,7 @@ export interface BrowserPool {
|
|
|
162
162
|
/**
|
|
163
163
|
* Configuration used to create all browsers in this pool
|
|
164
164
|
*/
|
|
165
|
-
browser_pool_config:
|
|
165
|
+
browser_pool_config: BrowserPool.BrowserPoolConfig;
|
|
166
166
|
|
|
167
167
|
/**
|
|
168
168
|
* Timestamp when the browser pool was created
|
|
@@ -175,118 +175,79 @@ export interface BrowserPool {
|
|
|
175
175
|
name?: string;
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
|
|
179
|
-
* Request body for acquiring a browser from the pool.
|
|
180
|
-
*/
|
|
181
|
-
export interface BrowserPoolAcquireRequest {
|
|
182
|
-
/**
|
|
183
|
-
* Maximum number of seconds to wait for a browser to be available. Defaults to the
|
|
184
|
-
* calculated time it would take to fill the pool at the currently configured fill
|
|
185
|
-
* rate.
|
|
186
|
-
*/
|
|
187
|
-
acquire_timeout_seconds?: number;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* Request body for releasing a browser back to the pool.
|
|
192
|
-
*/
|
|
193
|
-
export interface BrowserPoolReleaseRequest {
|
|
194
|
-
/**
|
|
195
|
-
* Browser session ID to release back to the pool
|
|
196
|
-
*/
|
|
197
|
-
session_id: string;
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* Whether to reuse the browser instance or destroy it and create a new one.
|
|
201
|
-
* Defaults to true.
|
|
202
|
-
*/
|
|
203
|
-
reuse?: boolean;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* Parameters for creating a browser pool. All browsers in the pool will be created
|
|
208
|
-
* with the same configuration.
|
|
209
|
-
*/
|
|
210
|
-
export interface BrowserPoolRequest {
|
|
211
|
-
/**
|
|
212
|
-
* Number of browsers to create in the pool
|
|
213
|
-
*/
|
|
214
|
-
size: number;
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* List of browser extensions to load into the session. Provide each by id or name.
|
|
218
|
-
*/
|
|
219
|
-
extensions?: Array<Shared.BrowserExtension>;
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* Percentage of the pool to fill per minute. Defaults to 10%.
|
|
223
|
-
*/
|
|
224
|
-
fill_rate_per_minute?: number;
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* If true, launches the browser using a headless image. Defaults to false.
|
|
228
|
-
*/
|
|
229
|
-
headless?: boolean;
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* If true, launches the browser in kiosk mode to hide address bar and tabs in live
|
|
233
|
-
* view.
|
|
234
|
-
*/
|
|
235
|
-
kiosk_mode?: boolean;
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
* Optional name for the browser pool. Must be unique within the organization.
|
|
239
|
-
*/
|
|
240
|
-
name?: string;
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* Profile selection for the browser session. Provide either id or name. If
|
|
244
|
-
* specified, the matching profile will be loaded into the browser session.
|
|
245
|
-
* Profiles must be created beforehand.
|
|
246
|
-
*/
|
|
247
|
-
profile?: Shared.BrowserProfile;
|
|
248
|
-
|
|
178
|
+
export namespace BrowserPool {
|
|
249
179
|
/**
|
|
250
|
-
*
|
|
251
|
-
* belonging to the caller's org.
|
|
252
|
-
*/
|
|
253
|
-
proxy_id?: string;
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* If true, launches the browser in stealth mode to reduce detection by anti-bot
|
|
257
|
-
* mechanisms.
|
|
258
|
-
*/
|
|
259
|
-
stealth?: boolean;
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* Default idle timeout in seconds for browsers acquired from this pool before they
|
|
263
|
-
* are destroyed. Defaults to 600 seconds if not specified
|
|
264
|
-
*/
|
|
265
|
-
timeout_seconds?: number;
|
|
266
|
-
|
|
267
|
-
/**
|
|
268
|
-
* Initial browser window size in pixels with optional refresh rate. If omitted,
|
|
269
|
-
* image defaults apply (1920x1080@25). Only specific viewport configurations are
|
|
270
|
-
* supported. The server will reject unsupported combinations. Supported
|
|
271
|
-
* resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25,
|
|
272
|
-
* 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will be
|
|
273
|
-
* automatically determined from the width and height if they match a supported
|
|
274
|
-
* configuration exactly. Note: Higher resolutions may affect the responsiveness of
|
|
275
|
-
* live view browser
|
|
276
|
-
*/
|
|
277
|
-
viewport?: Shared.BrowserViewport;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
/**
|
|
281
|
-
* Parameters for updating a browser pool. All browsers in the pool will be created
|
|
282
|
-
* with the same configuration.
|
|
283
|
-
*/
|
|
284
|
-
export interface BrowserPoolUpdateRequest extends BrowserPoolRequest {
|
|
285
|
-
/**
|
|
286
|
-
* Whether to discard all idle browsers and rebuild the pool immediately. Defaults
|
|
287
|
-
* to false.
|
|
180
|
+
* Configuration used to create all browsers in this pool
|
|
288
181
|
*/
|
|
289
|
-
|
|
182
|
+
export interface BrowserPoolConfig {
|
|
183
|
+
/**
|
|
184
|
+
* Number of browsers to create in the pool
|
|
185
|
+
*/
|
|
186
|
+
size: number;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* List of browser extensions to load into the session. Provide each by id or name.
|
|
190
|
+
*/
|
|
191
|
+
extensions?: Array<Shared.BrowserExtension>;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Percentage of the pool to fill per minute. Defaults to 10%.
|
|
195
|
+
*/
|
|
196
|
+
fill_rate_per_minute?: number;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* If true, launches the browser using a headless image. Defaults to false.
|
|
200
|
+
*/
|
|
201
|
+
headless?: boolean;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* If true, launches the browser in kiosk mode to hide address bar and tabs in live
|
|
205
|
+
* view.
|
|
206
|
+
*/
|
|
207
|
+
kiosk_mode?: boolean;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Optional name for the browser pool. Must be unique within the organization.
|
|
211
|
+
*/
|
|
212
|
+
name?: string;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Profile selection for the browser session. Provide either id or name. If
|
|
216
|
+
* specified, the matching profile will be loaded into the browser session.
|
|
217
|
+
* Profiles must be created beforehand.
|
|
218
|
+
*/
|
|
219
|
+
profile?: Shared.BrowserProfile;
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Optional proxy to associate to the browser session. Must reference a proxy
|
|
223
|
+
* belonging to the caller's org.
|
|
224
|
+
*/
|
|
225
|
+
proxy_id?: string;
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* If true, launches the browser in stealth mode to reduce detection by anti-bot
|
|
229
|
+
* mechanisms.
|
|
230
|
+
*/
|
|
231
|
+
stealth?: boolean;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Default idle timeout in seconds for browsers acquired from this pool before they
|
|
235
|
+
* are destroyed. Defaults to 600 seconds if not specified
|
|
236
|
+
*/
|
|
237
|
+
timeout_seconds?: number;
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Initial browser window size in pixels with optional refresh rate. If omitted,
|
|
241
|
+
* image defaults apply (1920x1080@25). Only specific viewport configurations are
|
|
242
|
+
* supported. The server will reject unsupported combinations. Supported
|
|
243
|
+
* resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25,
|
|
244
|
+
* 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will be
|
|
245
|
+
* automatically determined from the width and height if they match a supported
|
|
246
|
+
* configuration exactly. Note: Higher resolutions may affect the responsiveness of
|
|
247
|
+
* live view browser
|
|
248
|
+
*/
|
|
249
|
+
viewport?: Shared.BrowserViewport;
|
|
250
|
+
}
|
|
290
251
|
}
|
|
291
252
|
|
|
292
253
|
export type BrowserPoolListResponse = Array<BrowserPool>;
|
|
@@ -546,10 +507,6 @@ export interface BrowserPoolReleaseParams {
|
|
|
546
507
|
export declare namespace BrowserPools {
|
|
547
508
|
export {
|
|
548
509
|
type BrowserPool as BrowserPool,
|
|
549
|
-
type BrowserPoolAcquireRequest as BrowserPoolAcquireRequest,
|
|
550
|
-
type BrowserPoolReleaseRequest as BrowserPoolReleaseRequest,
|
|
551
|
-
type BrowserPoolRequest as BrowserPoolRequest,
|
|
552
|
-
type BrowserPoolUpdateRequest as BrowserPoolUpdateRequest,
|
|
553
510
|
type BrowserPoolListResponse as BrowserPoolListResponse,
|
|
554
511
|
type BrowserPoolAcquireResponse as BrowserPoolAcquireResponse,
|
|
555
512
|
type BrowserPoolCreateParams as BrowserPoolCreateParams,
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { OffsetPagination, type OffsetPaginationParams, PagePromise } from '../core/pagination';
|
|
6
|
+
import { buildHeaders } from '../internal/headers';
|
|
7
|
+
import { RequestOptions } from '../internal/request-options';
|
|
8
|
+
import { path } from '../internal/utils/path';
|
|
9
|
+
|
|
10
|
+
export class Credentials extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* Create a new credential for storing login information. Values are encrypted at
|
|
13
|
+
* rest.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const credential = await client.credentials.create({
|
|
18
|
+
* domain: 'netflix.com',
|
|
19
|
+
* name: 'my-netflix-login',
|
|
20
|
+
* values: {
|
|
21
|
+
* username: 'user@example.com',
|
|
22
|
+
* password: 'mysecretpassword',
|
|
23
|
+
* },
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
create(body: CredentialCreateParams, options?: RequestOptions): APIPromise<Credential> {
|
|
28
|
+
return this._client.post('/credentials', { body, ...options });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Retrieve a credential by its ID. Credential values are not returned.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* const credential = await client.credentials.retrieve('id');
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<Credential> {
|
|
40
|
+
return this._client.get(path`/credentials/${id}`, options);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Update a credential's name or values. Values are encrypted at rest.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* const credential = await client.credentials.update('id');
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
update(id: string, body: CredentialUpdateParams, options?: RequestOptions): APIPromise<Credential> {
|
|
52
|
+
return this._client.patch(path`/credentials/${id}`, { body, ...options });
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* List credentials owned by the caller's organization. Credential values are not
|
|
57
|
+
* returned.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* // Automatically fetches more pages as needed.
|
|
62
|
+
* for await (const credential of client.credentials.list()) {
|
|
63
|
+
* // ...
|
|
64
|
+
* }
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
list(
|
|
68
|
+
query: CredentialListParams | null | undefined = {},
|
|
69
|
+
options?: RequestOptions,
|
|
70
|
+
): PagePromise<CredentialsOffsetPagination, Credential> {
|
|
71
|
+
return this._client.getAPIList('/credentials', OffsetPagination<Credential>, { query, ...options });
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Delete a credential by its ID.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* await client.credentials.delete('id');
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
delete(id: string, options?: RequestOptions): APIPromise<void> {
|
|
83
|
+
return this._client.delete(path`/credentials/${id}`, {
|
|
84
|
+
...options,
|
|
85
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export type CredentialsOffsetPagination = OffsetPagination<Credential>;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Request to create a new credential
|
|
94
|
+
*/
|
|
95
|
+
export interface CreateCredentialRequest {
|
|
96
|
+
/**
|
|
97
|
+
* Target domain this credential is for
|
|
98
|
+
*/
|
|
99
|
+
domain: string;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Unique name for the credential within the organization
|
|
103
|
+
*/
|
|
104
|
+
name: string;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Field name to value mapping (e.g., username, password)
|
|
108
|
+
*/
|
|
109
|
+
values: { [key: string]: string };
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* A stored credential for automatic re-authentication
|
|
114
|
+
*/
|
|
115
|
+
export interface Credential {
|
|
116
|
+
/**
|
|
117
|
+
* Unique identifier for the credential
|
|
118
|
+
*/
|
|
119
|
+
id: string;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* When the credential was created
|
|
123
|
+
*/
|
|
124
|
+
created_at: string;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Target domain this credential is for
|
|
128
|
+
*/
|
|
129
|
+
domain: string;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Unique name for the credential within the organization
|
|
133
|
+
*/
|
|
134
|
+
name: string;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* When the credential was last updated
|
|
138
|
+
*/
|
|
139
|
+
updated_at: string;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Request to update an existing credential
|
|
144
|
+
*/
|
|
145
|
+
export interface UpdateCredentialRequest {
|
|
146
|
+
/**
|
|
147
|
+
* New name for the credential
|
|
148
|
+
*/
|
|
149
|
+
name?: string;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Field name to value mapping (e.g., username, password). Replaces all existing
|
|
153
|
+
* values.
|
|
154
|
+
*/
|
|
155
|
+
values?: { [key: string]: string };
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export interface CredentialCreateParams {
|
|
159
|
+
/**
|
|
160
|
+
* Target domain this credential is for
|
|
161
|
+
*/
|
|
162
|
+
domain: string;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Unique name for the credential within the organization
|
|
166
|
+
*/
|
|
167
|
+
name: string;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Field name to value mapping (e.g., username, password)
|
|
171
|
+
*/
|
|
172
|
+
values: { [key: string]: string };
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export interface CredentialUpdateParams {
|
|
176
|
+
/**
|
|
177
|
+
* New name for the credential
|
|
178
|
+
*/
|
|
179
|
+
name?: string;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Field name to value mapping (e.g., username, password). Replaces all existing
|
|
183
|
+
* values.
|
|
184
|
+
*/
|
|
185
|
+
values?: { [key: string]: string };
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export interface CredentialListParams extends OffsetPaginationParams {
|
|
189
|
+
/**
|
|
190
|
+
* Filter by domain
|
|
191
|
+
*/
|
|
192
|
+
domain?: string;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export declare namespace Credentials {
|
|
196
|
+
export {
|
|
197
|
+
type CreateCredentialRequest as CreateCredentialRequest,
|
|
198
|
+
type Credential as Credential,
|
|
199
|
+
type UpdateCredentialRequest as UpdateCredentialRequest,
|
|
200
|
+
type CredentialsOffsetPagination as CredentialsOffsetPagination,
|
|
201
|
+
type CredentialCreateParams as CredentialCreateParams,
|
|
202
|
+
type CredentialUpdateParams as CredentialUpdateParams,
|
|
203
|
+
type CredentialListParams as CredentialListParams,
|
|
204
|
+
};
|
|
205
|
+
}
|
package/src/resources/index.ts
CHANGED
|
@@ -11,10 +11,6 @@ export {
|
|
|
11
11
|
export {
|
|
12
12
|
BrowserPools,
|
|
13
13
|
type BrowserPool,
|
|
14
|
-
type BrowserPoolAcquireRequest,
|
|
15
|
-
type BrowserPoolReleaseRequest,
|
|
16
|
-
type BrowserPoolRequest,
|
|
17
|
-
type BrowserPoolUpdateRequest,
|
|
18
14
|
type BrowserPoolListResponse,
|
|
19
15
|
type BrowserPoolAcquireResponse,
|
|
20
16
|
type BrowserPoolCreateParams,
|
|
@@ -36,6 +32,16 @@ export {
|
|
|
36
32
|
type BrowserLoadExtensionsParams,
|
|
37
33
|
type BrowserListResponsesOffsetPagination,
|
|
38
34
|
} from './browsers/browsers';
|
|
35
|
+
export {
|
|
36
|
+
Credentials,
|
|
37
|
+
type CreateCredentialRequest,
|
|
38
|
+
type Credential,
|
|
39
|
+
type UpdateCredentialRequest,
|
|
40
|
+
type CredentialCreateParams,
|
|
41
|
+
type CredentialUpdateParams,
|
|
42
|
+
type CredentialListParams,
|
|
43
|
+
type CredentialsOffsetPagination,
|
|
44
|
+
} from './credentials';
|
|
39
45
|
export {
|
|
40
46
|
Deployments,
|
|
41
47
|
type DeploymentStateEvent,
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.24.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.24.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.24.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|