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