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