@onkernel/sdk 0.30.0 → 0.33.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.
Files changed (154) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/client.d.mts +8 -7
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +8 -7
  5. package/client.d.ts.map +1 -1
  6. package/client.js +12 -5
  7. package/client.js.map +1 -1
  8. package/client.mjs +12 -5
  9. package/client.mjs.map +1 -1
  10. package/package.json +3 -2
  11. package/resources/auth/auth.d.mts +10 -0
  12. package/resources/auth/auth.d.mts.map +1 -0
  13. package/resources/auth/auth.d.ts +10 -0
  14. package/resources/auth/auth.d.ts.map +1 -0
  15. package/resources/auth/auth.js +17 -0
  16. package/resources/auth/auth.js.map +1 -0
  17. package/resources/auth/auth.mjs +12 -0
  18. package/resources/auth/auth.mjs.map +1 -0
  19. package/resources/auth/connections.d.mts +793 -0
  20. package/resources/auth/connections.d.mts.map +1 -0
  21. package/resources/auth/connections.d.ts +793 -0
  22. package/resources/auth/connections.d.ts.map +1 -0
  23. package/resources/auth/connections.js +118 -0
  24. package/resources/auth/connections.js.map +1 -0
  25. package/resources/auth/connections.mjs +114 -0
  26. package/resources/auth/connections.mjs.map +1 -0
  27. package/resources/auth/index.d.mts +3 -0
  28. package/resources/auth/index.d.mts.map +1 -0
  29. package/resources/auth/index.d.ts +3 -0
  30. package/resources/auth/index.d.ts.map +1 -0
  31. package/resources/{agents/auth → auth}/index.js +3 -3
  32. package/resources/auth/index.js.map +1 -0
  33. package/resources/auth/index.mjs +4 -0
  34. package/resources/auth/index.mjs.map +1 -0
  35. package/resources/{agents/auth.d.mts.map → auth.d.mts.map} +1 -1
  36. package/resources/auth.d.ts.map +1 -0
  37. package/resources/{agents/auth.js → auth.js} +1 -1
  38. package/resources/auth.js.map +1 -0
  39. package/resources/auth.mjs.map +1 -0
  40. package/resources/browsers/browsers.d.mts +2 -2
  41. package/resources/browsers/browsers.d.mts.map +1 -1
  42. package/resources/browsers/browsers.d.ts +2 -2
  43. package/resources/browsers/browsers.d.ts.map +1 -1
  44. package/resources/browsers/browsers.js.map +1 -1
  45. package/resources/browsers/browsers.mjs.map +1 -1
  46. package/resources/browsers/computer.d.mts +199 -1
  47. package/resources/browsers/computer.d.mts.map +1 -1
  48. package/resources/browsers/computer.d.ts +199 -1
  49. package/resources/browsers/computer.d.ts.map +1 -1
  50. package/resources/browsers/computer.js +31 -0
  51. package/resources/browsers/computer.js.map +1 -1
  52. package/resources/browsers/computer.mjs +31 -0
  53. package/resources/browsers/computer.mjs.map +1 -1
  54. package/resources/browsers/index.d.mts +1 -1
  55. package/resources/browsers/index.d.mts.map +1 -1
  56. package/resources/browsers/index.d.ts +1 -1
  57. package/resources/browsers/index.d.ts.map +1 -1
  58. package/resources/browsers/index.js.map +1 -1
  59. package/resources/browsers/index.mjs.map +1 -1
  60. package/resources/credential-providers.d.mts +66 -1
  61. package/resources/credential-providers.d.mts.map +1 -1
  62. package/resources/credential-providers.d.ts +66 -1
  63. package/resources/credential-providers.d.ts.map +1 -1
  64. package/resources/credential-providers.js +21 -6
  65. package/resources/credential-providers.js.map +1 -1
  66. package/resources/credential-providers.mjs +21 -6
  67. package/resources/credential-providers.mjs.map +1 -1
  68. package/resources/credentials.d.mts +4 -0
  69. package/resources/credentials.d.mts.map +1 -1
  70. package/resources/credentials.d.ts +4 -0
  71. package/resources/credentials.d.ts.map +1 -1
  72. package/resources/index.d.mts +2 -2
  73. package/resources/index.d.mts.map +1 -1
  74. package/resources/index.d.ts +2 -2
  75. package/resources/index.d.ts.map +1 -1
  76. package/resources/index.js +3 -3
  77. package/resources/index.js.map +1 -1
  78. package/resources/index.mjs +1 -1
  79. package/resources/index.mjs.map +1 -1
  80. package/src/client.ts +24 -9
  81. package/src/resources/auth/auth.ts +41 -0
  82. package/src/resources/auth/connections.ts +973 -0
  83. package/src/resources/auth/index.ts +17 -0
  84. package/src/resources/browsers/browsers.ts +4 -0
  85. package/src/resources/browsers/computer.ts +257 -0
  86. package/src/resources/browsers/index.ts +2 -0
  87. package/src/resources/credential-providers.ts +88 -6
  88. package/src/resources/credentials.ts +5 -0
  89. package/src/resources/index.ts +3 -1
  90. package/src/version.ts +1 -1
  91. package/version.d.mts +1 -1
  92. package/version.d.ts +1 -1
  93. package/version.js +1 -1
  94. package/version.mjs +1 -1
  95. package/resources/agents/agents.d.mts +0 -10
  96. package/resources/agents/agents.d.mts.map +0 -1
  97. package/resources/agents/agents.d.ts +0 -10
  98. package/resources/agents/agents.d.ts.map +0 -1
  99. package/resources/agents/agents.js +0 -17
  100. package/resources/agents/agents.js.map +0 -1
  101. package/resources/agents/agents.mjs +0 -12
  102. package/resources/agents/agents.mjs.map +0 -1
  103. package/resources/agents/auth/auth.d.mts +0 -405
  104. package/resources/agents/auth/auth.d.mts.map +0 -1
  105. package/resources/agents/auth/auth.d.ts +0 -405
  106. package/resources/agents/auth/auth.d.ts.map +0 -1
  107. package/resources/agents/auth/auth.js +0 -81
  108. package/resources/agents/auth/auth.js.map +0 -1
  109. package/resources/agents/auth/auth.mjs +0 -76
  110. package/resources/agents/auth/auth.mjs.map +0 -1
  111. package/resources/agents/auth/index.d.mts +0 -3
  112. package/resources/agents/auth/index.d.mts.map +0 -1
  113. package/resources/agents/auth/index.d.ts +0 -3
  114. package/resources/agents/auth/index.d.ts.map +0 -1
  115. package/resources/agents/auth/index.js.map +0 -1
  116. package/resources/agents/auth/index.mjs +0 -4
  117. package/resources/agents/auth/index.mjs.map +0 -1
  118. package/resources/agents/auth/invocations.d.mts +0 -125
  119. package/resources/agents/auth/invocations.d.mts.map +0 -1
  120. package/resources/agents/auth/invocations.d.ts +0 -125
  121. package/resources/agents/auth/invocations.d.ts.map +0 -1
  122. package/resources/agents/auth/invocations.js +0 -79
  123. package/resources/agents/auth/invocations.js.map +0 -1
  124. package/resources/agents/auth/invocations.mjs +0 -75
  125. package/resources/agents/auth/invocations.mjs.map +0 -1
  126. package/resources/agents/auth.d.ts.map +0 -1
  127. package/resources/agents/auth.js.map +0 -1
  128. package/resources/agents/auth.mjs.map +0 -1
  129. package/resources/agents/index.d.mts +0 -3
  130. package/resources/agents/index.d.mts.map +0 -1
  131. package/resources/agents/index.d.ts +0 -3
  132. package/resources/agents/index.d.ts.map +0 -1
  133. package/resources/agents/index.js +0 -9
  134. package/resources/agents/index.js.map +0 -1
  135. package/resources/agents/index.mjs +0 -4
  136. package/resources/agents/index.mjs.map +0 -1
  137. package/resources/agents.d.mts +0 -2
  138. package/resources/agents.d.mts.map +0 -1
  139. package/resources/agents.d.ts +0 -2
  140. package/resources/agents.d.ts.map +0 -1
  141. package/resources/agents.js +0 -6
  142. package/resources/agents.js.map +0 -1
  143. package/resources/agents.mjs +0 -3
  144. package/resources/agents.mjs.map +0 -1
  145. package/src/resources/agents/agents.ts +0 -39
  146. package/src/resources/agents/auth/auth.ts +0 -524
  147. package/src/resources/agents/auth/index.ts +0 -22
  148. package/src/resources/agents/auth/invocations.ts +0 -166
  149. package/src/resources/agents/index.ts +0 -16
  150. package/src/resources/agents.ts +0 -3
  151. /package/resources/{agents/auth.d.mts → auth.d.mts} +0 -0
  152. /package/resources/{agents/auth.d.ts → auth.d.ts} +0 -0
  153. /package/resources/{agents/auth.mjs → auth.mjs} +0 -0
  154. /package/src/resources/{agents/auth.ts → auth.ts} +0 -0
@@ -0,0 +1,973 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as Shared from '../shared';
5
+ import { APIPromise } from '../../core/api-promise';
6
+ import { OffsetPagination, type OffsetPaginationParams, PagePromise } from '../../core/pagination';
7
+ import { Stream } from '../../core/streaming';
8
+ import { buildHeaders } from '../../internal/headers';
9
+ import { RequestOptions } from '../../internal/request-options';
10
+ import { path } from '../../internal/utils/path';
11
+
12
+ export class Connections extends APIResource {
13
+ /**
14
+ * Creates an auth connection for a profile and domain combination. Returns 409
15
+ * Conflict if an auth connection already exists for the given profile and domain.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const managedAuth = await client.auth.connections.create({
20
+ * domain: 'netflix.com',
21
+ * profile_name: 'user-123',
22
+ * });
23
+ * ```
24
+ */
25
+ create(body: ConnectionCreateParams, options?: RequestOptions): APIPromise<ManagedAuth> {
26
+ return this._client.post('/auth/connections', { body, ...options });
27
+ }
28
+
29
+ /**
30
+ * Retrieve an auth connection by its ID. Includes current flow state if a login is
31
+ * in progress.
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const managedAuth = await client.auth.connections.retrieve(
36
+ * 'id',
37
+ * );
38
+ * ```
39
+ */
40
+ retrieve(id: string, options?: RequestOptions): APIPromise<ManagedAuth> {
41
+ return this._client.get(path`/auth/connections/${id}`, options);
42
+ }
43
+
44
+ /**
45
+ * List auth connections with optional filters for profile_name and domain.
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * // Automatically fetches more pages as needed.
50
+ * for await (const managedAuth of client.auth.connections.list()) {
51
+ * // ...
52
+ * }
53
+ * ```
54
+ */
55
+ list(
56
+ query: ConnectionListParams | null | undefined = {},
57
+ options?: RequestOptions,
58
+ ): PagePromise<ManagedAuthsOffsetPagination, ManagedAuth> {
59
+ return this._client.getAPIList('/auth/connections', OffsetPagination<ManagedAuth>, { query, ...options });
60
+ }
61
+
62
+ /**
63
+ * Deletes an auth connection and terminates its workflow. This will:
64
+ *
65
+ * - Delete the auth connection record
66
+ * - Terminate the Temporal workflow
67
+ * - Cancel any in-progress login flows
68
+ *
69
+ * @example
70
+ * ```ts
71
+ * await client.auth.connections.delete('id');
72
+ * ```
73
+ */
74
+ delete(id: string, options?: RequestOptions): APIPromise<void> {
75
+ return this._client.delete(path`/auth/connections/${id}`, {
76
+ ...options,
77
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
78
+ });
79
+ }
80
+
81
+ /**
82
+ * Establishes a Server-Sent Events (SSE) stream that delivers real-time login flow
83
+ * state updates. The stream terminates automatically once the flow reaches a
84
+ * terminal state (SUCCESS, FAILED, EXPIRED, CANCELED).
85
+ *
86
+ * @example
87
+ * ```ts
88
+ * const response = await client.auth.connections.follow('id');
89
+ * ```
90
+ */
91
+ follow(id: string, options?: RequestOptions): APIPromise<Stream<ConnectionFollowResponse>> {
92
+ return this._client.get(path`/auth/connections/${id}/events`, {
93
+ ...options,
94
+ headers: buildHeaders([{ Accept: 'text/event-stream' }, options?.headers]),
95
+ stream: true,
96
+ }) as APIPromise<Stream<ConnectionFollowResponse>>;
97
+ }
98
+
99
+ /**
100
+ * Starts a login flow for the auth connection. Returns immediately with a hosted
101
+ * URL for the user to complete authentication, or triggers automatic re-auth if
102
+ * credentials are stored.
103
+ *
104
+ * @example
105
+ * ```ts
106
+ * const loginResponse = await client.auth.connections.login(
107
+ * 'id',
108
+ * );
109
+ * ```
110
+ */
111
+ login(
112
+ id: string,
113
+ body: ConnectionLoginParams | null | undefined = {},
114
+ options?: RequestOptions,
115
+ ): APIPromise<LoginResponse> {
116
+ return this._client.post(path`/auth/connections/${id}/login`, { body, ...options });
117
+ }
118
+
119
+ /**
120
+ * Submits field values for the login form. Poll the auth connection to track
121
+ * progress and get results.
122
+ *
123
+ * @example
124
+ * ```ts
125
+ * const submitFieldsResponse =
126
+ * await client.auth.connections.submit('id');
127
+ * ```
128
+ */
129
+ submit(
130
+ id: string,
131
+ body: ConnectionSubmitParams,
132
+ options?: RequestOptions,
133
+ ): APIPromise<SubmitFieldsResponse> {
134
+ return this._client.post(path`/auth/connections/${id}/submit`, { body, ...options });
135
+ }
136
+ }
137
+
138
+ export type ManagedAuthsOffsetPagination = OffsetPagination<ManagedAuth>;
139
+
140
+ /**
141
+ * Response from starting a login flow
142
+ */
143
+ export interface LoginResponse {
144
+ /**
145
+ * Auth connection ID
146
+ */
147
+ id: string;
148
+
149
+ /**
150
+ * When the login flow expires
151
+ */
152
+ flow_expires_at: string;
153
+
154
+ /**
155
+ * Type of login flow started
156
+ */
157
+ flow_type: 'LOGIN' | 'REAUTH';
158
+
159
+ /**
160
+ * URL to redirect user to for login
161
+ */
162
+ hosted_url: string;
163
+
164
+ /**
165
+ * One-time code for handoff (internal use)
166
+ */
167
+ handoff_code?: string;
168
+
169
+ /**
170
+ * Browser live view URL for watching the login flow
171
+ */
172
+ live_view_url?: string;
173
+ }
174
+
175
+ /**
176
+ * Managed authentication that keeps a profile logged into a specific domain. Flow
177
+ * fields (flow_status, flow_step, discovered_fields, mfa_options) reflect the most
178
+ * recent login flow and are null when no flow has been initiated.
179
+ */
180
+ export interface ManagedAuth {
181
+ /**
182
+ * Unique identifier for the auth connection
183
+ */
184
+ id: string;
185
+
186
+ /**
187
+ * Target domain for authentication
188
+ */
189
+ domain: string;
190
+
191
+ /**
192
+ * Name of the profile associated with this auth connection
193
+ */
194
+ profile_name: string;
195
+
196
+ /**
197
+ * Whether credentials are saved after every successful login. One-time codes
198
+ * (TOTP, SMS, etc.) are not saved.
199
+ */
200
+ save_credentials: boolean;
201
+
202
+ /**
203
+ * Current authentication status of the managed profile
204
+ */
205
+ status: 'AUTHENTICATED' | 'NEEDS_AUTH';
206
+
207
+ /**
208
+ * Additional domains that are valid for this auth flow (besides the primary
209
+ * domain). Useful when login pages redirect to different domains.
210
+ *
211
+ * The following SSO/OAuth provider domains are automatically allowed by default
212
+ * and do not need to be specified:
213
+ *
214
+ * - Google: accounts.google.com
215
+ * - Microsoft/Azure AD: login.microsoftonline.com, login.live.com
216
+ * - Okta: _.okta.com, _.oktapreview.com
217
+ * - Auth0: _.auth0.com, _.us.auth0.com, _.eu.auth0.com, _.au.auth0.com
218
+ * - Apple: appleid.apple.com
219
+ * - GitHub: github.com
220
+ * - Facebook/Meta: www.facebook.com
221
+ * - LinkedIn: www.linkedin.com
222
+ * - Amazon Cognito: \*.amazoncognito.com
223
+ * - OneLogin: \*.onelogin.com
224
+ * - Ping Identity: _.pingone.com, _.pingidentity.com
225
+ */
226
+ allowed_domains?: Array<string>;
227
+
228
+ /**
229
+ * Whether automatic re-authentication is possible (has credential, selectors, and
230
+ * login_url)
231
+ */
232
+ can_reauth?: boolean;
233
+
234
+ /**
235
+ * Reason why automatic re-authentication is or is not possible
236
+ */
237
+ can_reauth_reason?: string;
238
+
239
+ /**
240
+ * Reference to credentials for the auth connection. Use one of:
241
+ *
242
+ * - { name } for Kernel credentials
243
+ * - { provider, path } for external provider item
244
+ * - { provider, auto: true } for external provider domain lookup
245
+ */
246
+ credential?: ManagedAuth.Credential;
247
+
248
+ /**
249
+ * Fields awaiting input (present when flow_step=awaiting_input)
250
+ */
251
+ discovered_fields?: Array<ManagedAuth.DiscoveredField> | null;
252
+
253
+ /**
254
+ * Error message (present when flow_status=failed)
255
+ */
256
+ error_message?: string | null;
257
+
258
+ /**
259
+ * Instructions for external action (present when
260
+ * flow_step=awaiting_external_action)
261
+ */
262
+ external_action_message?: string | null;
263
+
264
+ /**
265
+ * When the current flow expires (null when no flow in progress)
266
+ */
267
+ flow_expires_at?: string | null;
268
+
269
+ /**
270
+ * Current flow status (null when no flow in progress)
271
+ */
272
+ flow_status?: 'IN_PROGRESS' | 'SUCCESS' | 'FAILED' | 'EXPIRED' | 'CANCELED' | null;
273
+
274
+ /**
275
+ * Current step in the flow (null when no flow in progress)
276
+ */
277
+ flow_step?:
278
+ | 'DISCOVERING'
279
+ | 'AWAITING_INPUT'
280
+ | 'AWAITING_EXTERNAL_ACTION'
281
+ | 'SUBMITTING'
282
+ | 'COMPLETED'
283
+ | null;
284
+
285
+ /**
286
+ * Type of the current flow (null when no flow in progress)
287
+ */
288
+ flow_type?: 'LOGIN' | 'REAUTH' | null;
289
+
290
+ /**
291
+ * Interval in seconds between automatic health checks. When set, the system
292
+ * periodically verifies the authentication status and triggers re-authentication
293
+ * if needed. Maximum is 86400 (24 hours). Default is 3600 (1 hour). The minimum
294
+ * depends on your plan: Enterprise: 300 (5 minutes), Startup: 1200 (20 minutes),
295
+ * Hobbyist: 3600 (1 hour).
296
+ */
297
+ health_check_interval?: number | null;
298
+
299
+ /**
300
+ * URL to redirect user to for hosted login (present when flow in progress)
301
+ */
302
+ hosted_url?: string | null;
303
+
304
+ /**
305
+ * When the profile was last successfully authenticated
306
+ */
307
+ last_auth_at?: string;
308
+
309
+ /**
310
+ * Browser live view URL for debugging (present when flow in progress)
311
+ */
312
+ live_view_url?: string | null;
313
+
314
+ /**
315
+ * MFA method options (present when flow_step=awaiting_input and MFA selection
316
+ * required)
317
+ */
318
+ mfa_options?: Array<ManagedAuth.MfaOption> | null;
319
+
320
+ /**
321
+ * SSO buttons available (present when flow_step=awaiting_input)
322
+ */
323
+ pending_sso_buttons?: Array<ManagedAuth.PendingSSOButton> | null;
324
+
325
+ /**
326
+ * URL where the browser landed after successful login
327
+ */
328
+ post_login_url?: string;
329
+
330
+ /**
331
+ * ID of the proxy associated with this connection, if any.
332
+ */
333
+ proxy_id?: string;
334
+
335
+ /**
336
+ * SSO provider being used (e.g., google, github, microsoft)
337
+ */
338
+ sso_provider?: string | null;
339
+
340
+ /**
341
+ * Visible error message from the website (e.g., 'Incorrect password'). Present
342
+ * when the website displays an error during login.
343
+ */
344
+ website_error?: string | null;
345
+ }
346
+
347
+ export namespace ManagedAuth {
348
+ /**
349
+ * Reference to credentials for the auth connection. Use one of:
350
+ *
351
+ * - { name } for Kernel credentials
352
+ * - { provider, path } for external provider item
353
+ * - { provider, auto: true } for external provider domain lookup
354
+ */
355
+ export interface Credential {
356
+ /**
357
+ * If true, lookup by domain from the specified provider
358
+ */
359
+ auto?: boolean;
360
+
361
+ /**
362
+ * Kernel credential name
363
+ */
364
+ name?: string;
365
+
366
+ /**
367
+ * Provider-specific path (e.g., "VaultName/ItemName" for 1Password)
368
+ */
369
+ path?: string;
370
+
371
+ /**
372
+ * External provider name (e.g., "my-1p")
373
+ */
374
+ provider?: string;
375
+ }
376
+
377
+ /**
378
+ * A discovered form field
379
+ */
380
+ export interface DiscoveredField {
381
+ /**
382
+ * Field label
383
+ */
384
+ label: string;
385
+
386
+ /**
387
+ * Field name
388
+ */
389
+ name: string;
390
+
391
+ /**
392
+ * CSS selector for the field
393
+ */
394
+ selector: string;
395
+
396
+ /**
397
+ * Field type
398
+ */
399
+ type: 'text' | 'email' | 'password' | 'tel' | 'number' | 'url' | 'code' | 'totp';
400
+
401
+ /**
402
+ * If this field is associated with an MFA option, the type of that option (e.g.,
403
+ * password field linked to "Enter password" option)
404
+ */
405
+ linked_mfa_type?: 'sms' | 'call' | 'email' | 'totp' | 'push' | 'password' | null;
406
+
407
+ /**
408
+ * Field placeholder
409
+ */
410
+ placeholder?: string;
411
+
412
+ /**
413
+ * Whether field is required
414
+ */
415
+ required?: boolean;
416
+ }
417
+
418
+ /**
419
+ * An MFA method option for verification
420
+ */
421
+ export interface MfaOption {
422
+ /**
423
+ * The visible option text
424
+ */
425
+ label: string;
426
+
427
+ /**
428
+ * The MFA delivery method type (includes password for auth method selection pages)
429
+ */
430
+ type: 'sms' | 'call' | 'email' | 'totp' | 'push' | 'password';
431
+
432
+ /**
433
+ * Additional instructions from the site
434
+ */
435
+ description?: string | null;
436
+
437
+ /**
438
+ * The masked destination (phone/email) if shown
439
+ */
440
+ target?: string | null;
441
+ }
442
+
443
+ /**
444
+ * An SSO button for signing in with an external identity provider
445
+ */
446
+ export interface PendingSSOButton {
447
+ /**
448
+ * Visible button text
449
+ */
450
+ label: string;
451
+
452
+ /**
453
+ * Identity provider name
454
+ */
455
+ provider: string;
456
+
457
+ /**
458
+ * XPath selector for the button
459
+ */
460
+ selector: string;
461
+ }
462
+ }
463
+
464
+ /**
465
+ * Request to create an auth connection for a profile and domain
466
+ */
467
+ export interface ManagedAuthCreateRequest {
468
+ /**
469
+ * Domain for authentication
470
+ */
471
+ domain: string;
472
+
473
+ /**
474
+ * Name of the profile to manage authentication for
475
+ */
476
+ profile_name: string;
477
+
478
+ /**
479
+ * Additional domains valid for this auth flow (besides the primary domain). Useful
480
+ * when login pages redirect to different domains.
481
+ *
482
+ * The following SSO/OAuth provider domains are automatically allowed by default
483
+ * and do not need to be specified:
484
+ *
485
+ * - Google: accounts.google.com
486
+ * - Microsoft/Azure AD: login.microsoftonline.com, login.live.com
487
+ * - Okta: _.okta.com, _.oktapreview.com
488
+ * - Auth0: _.auth0.com, _.us.auth0.com, _.eu.auth0.com, _.au.auth0.com
489
+ * - Apple: appleid.apple.com
490
+ * - GitHub: github.com
491
+ * - Facebook/Meta: www.facebook.com
492
+ * - LinkedIn: www.linkedin.com
493
+ * - Amazon Cognito: \*.amazoncognito.com
494
+ * - OneLogin: \*.onelogin.com
495
+ * - Ping Identity: _.pingone.com, _.pingidentity.com
496
+ */
497
+ allowed_domains?: Array<string>;
498
+
499
+ /**
500
+ * Reference to credentials for the auth connection. Use one of:
501
+ *
502
+ * - { name } for Kernel credentials
503
+ * - { provider, path } for external provider item
504
+ * - { provider, auto: true } for external provider domain lookup
505
+ */
506
+ credential?: ManagedAuthCreateRequest.Credential;
507
+
508
+ /**
509
+ * Interval in seconds between automatic health checks. When set, the system
510
+ * periodically verifies the authentication status and triggers re-authentication
511
+ * if needed. Maximum is 86400 (24 hours). Default is 3600 (1 hour). The minimum
512
+ * depends on your plan: Enterprise: 300 (5 minutes), Startup: 1200 (20 minutes),
513
+ * Hobbyist: 3600 (1 hour).
514
+ */
515
+ health_check_interval?: number;
516
+
517
+ /**
518
+ * Optional login page URL to skip discovery
519
+ */
520
+ login_url?: string;
521
+
522
+ /**
523
+ * Proxy selection. Provide either id or name. The proxy must belong to the
524
+ * caller's org.
525
+ */
526
+ proxy?: ManagedAuthCreateRequest.Proxy;
527
+
528
+ /**
529
+ * Whether to save credentials after every successful login. Defaults to true.
530
+ * One-time codes (TOTP, SMS, etc.) are not saved.
531
+ */
532
+ save_credentials?: boolean;
533
+ }
534
+
535
+ export namespace ManagedAuthCreateRequest {
536
+ /**
537
+ * Reference to credentials for the auth connection. Use one of:
538
+ *
539
+ * - { name } for Kernel credentials
540
+ * - { provider, path } for external provider item
541
+ * - { provider, auto: true } for external provider domain lookup
542
+ */
543
+ export interface Credential {
544
+ /**
545
+ * If true, lookup by domain from the specified provider
546
+ */
547
+ auto?: boolean;
548
+
549
+ /**
550
+ * Kernel credential name
551
+ */
552
+ name?: string;
553
+
554
+ /**
555
+ * Provider-specific path (e.g., "VaultName/ItemName" for 1Password)
556
+ */
557
+ path?: string;
558
+
559
+ /**
560
+ * External provider name (e.g., "my-1p")
561
+ */
562
+ provider?: string;
563
+ }
564
+
565
+ /**
566
+ * Proxy selection. Provide either id or name. The proxy must belong to the
567
+ * caller's org.
568
+ */
569
+ export interface Proxy {
570
+ /**
571
+ * Proxy ID
572
+ */
573
+ id?: string;
574
+
575
+ /**
576
+ * Proxy name
577
+ */
578
+ name?: string;
579
+ }
580
+ }
581
+
582
+ /**
583
+ * Request to submit field values, click an SSO button, or select an MFA method.
584
+ * Provide exactly one of fields, sso_button_selector, or mfa_option_id.
585
+ */
586
+ export interface SubmitFieldsRequest {
587
+ /**
588
+ * Map of field name to value
589
+ */
590
+ fields?: { [key: string]: string };
591
+
592
+ /**
593
+ * Optional MFA option ID if user selected an MFA method
594
+ */
595
+ mfa_option_id?: string;
596
+
597
+ /**
598
+ * Optional XPath selector if user chose to click an SSO button instead
599
+ */
600
+ sso_button_selector?: string;
601
+ }
602
+
603
+ /**
604
+ * Response from submitting field values
605
+ */
606
+ export interface SubmitFieldsResponse {
607
+ /**
608
+ * Whether the submission was accepted for processing
609
+ */
610
+ accepted: boolean;
611
+ }
612
+
613
+ /**
614
+ * Union type representing any managed auth event.
615
+ */
616
+ export type ConnectionFollowResponse =
617
+ | ConnectionFollowResponse.ManagedAuthStateEvent
618
+ | Shared.ErrorEvent
619
+ | Shared.HeartbeatEvent;
620
+
621
+ export namespace ConnectionFollowResponse {
622
+ /**
623
+ * An event representing the current state of a managed auth flow.
624
+ */
625
+ export interface ManagedAuthStateEvent {
626
+ /**
627
+ * Event type identifier (always "managed_auth_state").
628
+ */
629
+ event: 'managed_auth_state';
630
+
631
+ /**
632
+ * Current flow status.
633
+ */
634
+ flow_status: 'IN_PROGRESS' | 'SUCCESS' | 'FAILED' | 'EXPIRED' | 'CANCELED';
635
+
636
+ /**
637
+ * Current step in the flow.
638
+ */
639
+ flow_step: 'DISCOVERING' | 'AWAITING_INPUT' | 'AWAITING_EXTERNAL_ACTION' | 'SUBMITTING' | 'COMPLETED';
640
+
641
+ /**
642
+ * Time the state was reported.
643
+ */
644
+ timestamp: string;
645
+
646
+ /**
647
+ * Fields awaiting input (present when flow_step=AWAITING_INPUT).
648
+ */
649
+ discovered_fields?: Array<ManagedAuthStateEvent.DiscoveredField>;
650
+
651
+ /**
652
+ * Error message (present when flow_status=FAILED).
653
+ */
654
+ error_message?: string;
655
+
656
+ /**
657
+ * Instructions for external action (present when
658
+ * flow_step=AWAITING_EXTERNAL_ACTION).
659
+ */
660
+ external_action_message?: string;
661
+
662
+ /**
663
+ * Type of the current flow.
664
+ */
665
+ flow_type?: 'LOGIN' | 'REAUTH';
666
+
667
+ /**
668
+ * URL to redirect user to for hosted login.
669
+ */
670
+ hosted_url?: string;
671
+
672
+ /**
673
+ * Browser live view URL for debugging.
674
+ */
675
+ live_view_url?: string;
676
+
677
+ /**
678
+ * MFA method options (present when flow_step=AWAITING_INPUT and MFA selection
679
+ * required).
680
+ */
681
+ mfa_options?: Array<ManagedAuthStateEvent.MfaOption>;
682
+
683
+ /**
684
+ * SSO buttons available (present when flow_step=AWAITING_INPUT).
685
+ */
686
+ pending_sso_buttons?: Array<ManagedAuthStateEvent.PendingSSOButton>;
687
+
688
+ /**
689
+ * URL where the browser landed after successful login.
690
+ */
691
+ post_login_url?: string;
692
+
693
+ /**
694
+ * Visible error message from the website (e.g., 'Incorrect password'). Present
695
+ * when the website displays an error during login.
696
+ */
697
+ website_error?: string;
698
+ }
699
+
700
+ export namespace ManagedAuthStateEvent {
701
+ /**
702
+ * A discovered form field
703
+ */
704
+ export interface DiscoveredField {
705
+ /**
706
+ * Field label
707
+ */
708
+ label: string;
709
+
710
+ /**
711
+ * Field name
712
+ */
713
+ name: string;
714
+
715
+ /**
716
+ * CSS selector for the field
717
+ */
718
+ selector: string;
719
+
720
+ /**
721
+ * Field type
722
+ */
723
+ type: 'text' | 'email' | 'password' | 'tel' | 'number' | 'url' | 'code' | 'totp';
724
+
725
+ /**
726
+ * If this field is associated with an MFA option, the type of that option (e.g.,
727
+ * password field linked to "Enter password" option)
728
+ */
729
+ linked_mfa_type?: 'sms' | 'call' | 'email' | 'totp' | 'push' | 'password' | null;
730
+
731
+ /**
732
+ * Field placeholder
733
+ */
734
+ placeholder?: string;
735
+
736
+ /**
737
+ * Whether field is required
738
+ */
739
+ required?: boolean;
740
+ }
741
+
742
+ /**
743
+ * An MFA method option for verification
744
+ */
745
+ export interface MfaOption {
746
+ /**
747
+ * The visible option text
748
+ */
749
+ label: string;
750
+
751
+ /**
752
+ * The MFA delivery method type (includes password for auth method selection pages)
753
+ */
754
+ type: 'sms' | 'call' | 'email' | 'totp' | 'push' | 'password';
755
+
756
+ /**
757
+ * Additional instructions from the site
758
+ */
759
+ description?: string | null;
760
+
761
+ /**
762
+ * The masked destination (phone/email) if shown
763
+ */
764
+ target?: string | null;
765
+ }
766
+
767
+ /**
768
+ * An SSO button for signing in with an external identity provider
769
+ */
770
+ export interface PendingSSOButton {
771
+ /**
772
+ * Visible button text
773
+ */
774
+ label: string;
775
+
776
+ /**
777
+ * Identity provider name
778
+ */
779
+ provider: string;
780
+
781
+ /**
782
+ * XPath selector for the button
783
+ */
784
+ selector: string;
785
+ }
786
+ }
787
+ }
788
+
789
+ export interface ConnectionCreateParams {
790
+ /**
791
+ * Domain for authentication
792
+ */
793
+ domain: string;
794
+
795
+ /**
796
+ * Name of the profile to manage authentication for
797
+ */
798
+ profile_name: string;
799
+
800
+ /**
801
+ * Additional domains valid for this auth flow (besides the primary domain). Useful
802
+ * when login pages redirect to different domains.
803
+ *
804
+ * The following SSO/OAuth provider domains are automatically allowed by default
805
+ * and do not need to be specified:
806
+ *
807
+ * - Google: accounts.google.com
808
+ * - Microsoft/Azure AD: login.microsoftonline.com, login.live.com
809
+ * - Okta: _.okta.com, _.oktapreview.com
810
+ * - Auth0: _.auth0.com, _.us.auth0.com, _.eu.auth0.com, _.au.auth0.com
811
+ * - Apple: appleid.apple.com
812
+ * - GitHub: github.com
813
+ * - Facebook/Meta: www.facebook.com
814
+ * - LinkedIn: www.linkedin.com
815
+ * - Amazon Cognito: \*.amazoncognito.com
816
+ * - OneLogin: \*.onelogin.com
817
+ * - Ping Identity: _.pingone.com, _.pingidentity.com
818
+ */
819
+ allowed_domains?: Array<string>;
820
+
821
+ /**
822
+ * Reference to credentials for the auth connection. Use one of:
823
+ *
824
+ * - { name } for Kernel credentials
825
+ * - { provider, path } for external provider item
826
+ * - { provider, auto: true } for external provider domain lookup
827
+ */
828
+ credential?: ConnectionCreateParams.Credential;
829
+
830
+ /**
831
+ * Interval in seconds between automatic health checks. When set, the system
832
+ * periodically verifies the authentication status and triggers re-authentication
833
+ * if needed. Maximum is 86400 (24 hours). Default is 3600 (1 hour). The minimum
834
+ * depends on your plan: Enterprise: 300 (5 minutes), Startup: 1200 (20 minutes),
835
+ * Hobbyist: 3600 (1 hour).
836
+ */
837
+ health_check_interval?: number;
838
+
839
+ /**
840
+ * Optional login page URL to skip discovery
841
+ */
842
+ login_url?: string;
843
+
844
+ /**
845
+ * Proxy selection. Provide either id or name. The proxy must belong to the
846
+ * caller's org.
847
+ */
848
+ proxy?: ConnectionCreateParams.Proxy;
849
+
850
+ /**
851
+ * Whether to save credentials after every successful login. Defaults to true.
852
+ * One-time codes (TOTP, SMS, etc.) are not saved.
853
+ */
854
+ save_credentials?: boolean;
855
+ }
856
+
857
+ export namespace ConnectionCreateParams {
858
+ /**
859
+ * Reference to credentials for the auth connection. Use one of:
860
+ *
861
+ * - { name } for Kernel credentials
862
+ * - { provider, path } for external provider item
863
+ * - { provider, auto: true } for external provider domain lookup
864
+ */
865
+ export interface Credential {
866
+ /**
867
+ * If true, lookup by domain from the specified provider
868
+ */
869
+ auto?: boolean;
870
+
871
+ /**
872
+ * Kernel credential name
873
+ */
874
+ name?: string;
875
+
876
+ /**
877
+ * Provider-specific path (e.g., "VaultName/ItemName" for 1Password)
878
+ */
879
+ path?: string;
880
+
881
+ /**
882
+ * External provider name (e.g., "my-1p")
883
+ */
884
+ provider?: string;
885
+ }
886
+
887
+ /**
888
+ * Proxy selection. Provide either id or name. The proxy must belong to the
889
+ * caller's org.
890
+ */
891
+ export interface Proxy {
892
+ /**
893
+ * Proxy ID
894
+ */
895
+ id?: string;
896
+
897
+ /**
898
+ * Proxy name
899
+ */
900
+ name?: string;
901
+ }
902
+ }
903
+
904
+ export interface ConnectionListParams extends OffsetPaginationParams {
905
+ /**
906
+ * Filter by domain
907
+ */
908
+ domain?: string;
909
+
910
+ /**
911
+ * Filter by profile name
912
+ */
913
+ profile_name?: string;
914
+ }
915
+
916
+ export interface ConnectionLoginParams {
917
+ /**
918
+ * Proxy selection. Provide either id or name. The proxy must belong to the
919
+ * caller's org.
920
+ */
921
+ proxy?: ConnectionLoginParams.Proxy;
922
+ }
923
+
924
+ export namespace ConnectionLoginParams {
925
+ /**
926
+ * Proxy selection. Provide either id or name. The proxy must belong to the
927
+ * caller's org.
928
+ */
929
+ export interface Proxy {
930
+ /**
931
+ * Proxy ID
932
+ */
933
+ id?: string;
934
+
935
+ /**
936
+ * Proxy name
937
+ */
938
+ name?: string;
939
+ }
940
+ }
941
+
942
+ export interface ConnectionSubmitParams {
943
+ /**
944
+ * Map of field name to value
945
+ */
946
+ fields?: { [key: string]: string };
947
+
948
+ /**
949
+ * Optional MFA option ID if user selected an MFA method
950
+ */
951
+ mfa_option_id?: string;
952
+
953
+ /**
954
+ * Optional XPath selector if user chose to click an SSO button instead
955
+ */
956
+ sso_button_selector?: string;
957
+ }
958
+
959
+ export declare namespace Connections {
960
+ export {
961
+ type LoginResponse as LoginResponse,
962
+ type ManagedAuth as ManagedAuth,
963
+ type ManagedAuthCreateRequest as ManagedAuthCreateRequest,
964
+ type SubmitFieldsRequest as SubmitFieldsRequest,
965
+ type SubmitFieldsResponse as SubmitFieldsResponse,
966
+ type ConnectionFollowResponse as ConnectionFollowResponse,
967
+ type ManagedAuthsOffsetPagination as ManagedAuthsOffsetPagination,
968
+ type ConnectionCreateParams as ConnectionCreateParams,
969
+ type ConnectionListParams as ConnectionListParams,
970
+ type ConnectionLoginParams as ConnectionLoginParams,
971
+ type ConnectionSubmitParams as ConnectionSubmitParams,
972
+ };
973
+ }