@reduck-ai/sdk 2.0.1 → 3.0.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.
@@ -360,32 +360,40 @@ export declare const ClientSurface: {
360
360
  export type ClientSurface = typeof ClientSurface[keyof typeof ClientSurface];
361
361
  export type Connector = {
362
362
  /**
363
- * The identity a probe script or the SSO sign-in reported (usually an email). Null until one has; it is never set by hand.
363
+ * The account the last check that found the session signed in named (usually an email). Null until one has, or when that check named none; it is never set by hand.
364
364
  */
365
365
  account: string | null;
366
+ /**
367
+ * When the last check of its account that answered started. A check that failed or did not end leaves it. Null until one has answered. Cookies synced after it may be signed in to another account.
368
+ */
369
+ checked_at: string | null;
366
370
  created_at: string;
367
371
  /**
368
- * The website, bare: no scheme, no leading "www.", e.g. "linkedin.com". For an SSO connector this is the identity provider, e.g. "accounts.google.com".
372
+ * The website, bare: no scheme, no leading "www.", e.g. "linkedin.com".
369
373
  */
370
374
  host: string;
371
375
  id: string;
372
376
  /**
373
- * True when this is an identity-provider session usable for "Continue with <provider>".
377
+ * Whether that check found the session signed in. Null until one has answered.
374
378
  */
375
- is_sso: boolean;
379
+ logged_in: boolean | null;
376
380
  /**
377
- * The name a person gave this connector, to tell it apart from the host's others.
381
+ * The profile it sits in; null for none.
378
382
  */
379
- label: string | null;
383
+ profile_id: string | null;
380
384
  /**
381
- * The end-user this connector is kept for, as the developer named them. Empty for the account's own connectors.
385
+ * The subdomains of its host that its cookies are set on, without Chrome's leading dot, in alphabetical order. Names only, never a value.
382
386
  */
383
- profile_id: string;
387
+ subdomains: Array<string>;
384
388
  /**
385
- * For a connector created through an SSO connector: that SSO's account (email). The reference autoreconnect follows. Null otherwise.
389
+ * When its cookies were last saved: from a sign-in or a save through the API. A run writing back the cookies it refreshed does not move it.
386
390
  */
387
- sso_account: string | null;
391
+ synced_at: string;
388
392
  updated_at: string;
393
+ /**
394
+ * When a run last used it. Null until one has.
395
+ */
396
+ used_at: string | null;
389
397
  };
390
398
  export type ConnectorCookie = {
391
399
  domain: string;
@@ -400,58 +408,183 @@ export type ConnectorCookie = {
400
408
  secure: boolean;
401
409
  value: string;
402
410
  };
403
- export type ConnectorLoginCredential = {
404
- password?: string;
405
- username?: string;
406
- };
407
- export type ConnectorLoginHost = {
411
+ export type ConnectorLink = {
412
+ /**
413
+ * The ID of the Auth session cookies the login saved, once the link is `done`. Absent before, and once those Auth session cookies are deleted.
414
+ */
415
+ connector_id?: string;
416
+ created_at: string;
417
+ /**
418
+ * Why the browser closed with nothing saved, when something went wrong.
419
+ */
420
+ error?: string;
421
+ /**
422
+ * While nobody has opened the link, when it stops opening. While its browser is open, when the browser closes, saving what it holds by then.
423
+ */
424
+ expires_at: string;
408
425
  /**
409
- * Cookies stored for this site; 0 until the sign-in lands.
426
+ * The site whose cookies become the Auth session cookies, bare (e.g. "linkedin.com").
410
427
  */
411
- cookies: number;
412
428
  host: string;
413
- stored: boolean;
429
+ id: string;
430
+ /**
431
+ * Where the open browser stands, so a person watching can tell whether the login has moved.
432
+ */
433
+ page_url?: string;
434
+ /**
435
+ * The profile the Auth session cookies are saved into; absent for none.
436
+ */
437
+ profile_id?: string;
438
+ /**
439
+ * Where the page sends the person once the login ends, or when its browser cannot open, with `link_id` and `status` added to its query. Absent: the page tells them they can close it.
440
+ */
441
+ return_url?: string;
442
+ /**
443
+ * Where the browser opens.
444
+ */
445
+ start_url: string;
446
+ /**
447
+ * `waiting`: the browser is not closed yet. `done`: the browser closed with the cookies saved. `failed`: it closed with nothing saved. `expired`: nobody opened the link in time.
448
+ */
449
+ status: ConnectorLinkStatus;
414
450
  };
415
- export declare const ConnectorLoginStatus: {
416
- readonly WAITING: "waiting";
417
- readonly STORED: "stored";
451
+ export declare const ConnectorLinkStatus: {
418
452
  readonly DONE: "done";
453
+ readonly EXPIRED: "expired";
419
454
  readonly FAILED: "failed";
455
+ readonly WAITING: "waiting";
420
456
  };
421
- export type ConnectorLoginStatus = typeof ConnectorLoginStatus[keyof typeof ConnectorLoginStatus];
457
+ export type ConnectorLinkStatus = typeof ConnectorLinkStatus[keyof typeof ConnectorLinkStatus];
422
458
  export type ConnectorProfile = {
423
- connectors: number;
424
- profile_id: string;
459
+ created_at: string;
460
+ id: string;
461
+ /**
462
+ * Unique among the user's profiles.
463
+ */
464
+ name: string;
465
+ updated_at: string;
466
+ };
467
+ export type ConnectorSummary = {
468
+ /**
469
+ * The account the last check that found the session signed in named (usually an email). Null until one has, or when that check named none; it is never set by hand.
470
+ */
471
+ account: string | null;
472
+ /**
473
+ * When the last check of its account that answered started. A check that failed or did not end leaves it. Null until one has answered. Cookies synced after it may be signed in to another account.
474
+ */
475
+ checked_at: string | null;
476
+ created_at: string;
477
+ /**
478
+ * The website, bare: no scheme, no leading "www.", e.g. "linkedin.com".
479
+ */
480
+ host: string;
481
+ id: string;
482
+ /**
483
+ * Whether that check found the session signed in. Null until one has answered.
484
+ */
485
+ logged_in: boolean | null;
486
+ /**
487
+ * The profile it sits in; null for none.
488
+ */
489
+ profile_id: string | null;
490
+ /**
491
+ * How many subdomains of its host its cookies are set on.
492
+ */
493
+ subdomain_count: number;
494
+ /**
495
+ * When its cookies were last saved: from a sign-in or a save through the API. A run writing back the cookies it refreshed does not move it.
496
+ */
497
+ synced_at: string;
498
+ updated_at: string;
499
+ /**
500
+ * When a run last used it. Null until one has.
501
+ */
502
+ used_at: string | null;
425
503
  };
426
504
  export type ConnectorWithCookies = {
427
505
  /**
428
- * The identity a probe script or the SSO sign-in reported (usually an email). Null until one has; it is never set by hand.
506
+ * The account the last check that found the session signed in named (usually an email). Null until one has, or when that check named none; it is never set by hand.
429
507
  */
430
508
  account: string | null;
509
+ /**
510
+ * When the last check of its account that answered started. A check that failed or did not end leaves it. Null until one has answered. Cookies synced after it may be signed in to another account.
511
+ */
512
+ checked_at: string | null;
431
513
  cookies: Array<ConnectorCookie>;
432
514
  created_at: string;
433
515
  /**
434
- * The website, bare: no scheme, no leading "www.", e.g. "linkedin.com". For an SSO connector this is the identity provider, e.g. "accounts.google.com".
516
+ * The website, bare: no scheme, no leading "www.", e.g. "linkedin.com".
435
517
  */
436
518
  host: string;
437
519
  id: string;
438
520
  /**
439
- * True when this is an identity-provider session usable for "Continue with <provider>".
521
+ * Whether that check found the session signed in. Null until one has answered.
440
522
  */
441
- is_sso: boolean;
523
+ logged_in: boolean | null;
442
524
  /**
443
- * The name a person gave this connector, to tell it apart from the host's others.
525
+ * The profile it sits in; null for none.
444
526
  */
445
- label: string | null;
527
+ profile_id: string | null;
446
528
  /**
447
- * The end-user this connector is kept for, as the developer named them. Empty for the account's own connectors.
529
+ * The subdomains of its host that its cookies are set on, without Chrome's leading dot, in alphabetical order. Names only, never a value.
448
530
  */
449
- profile_id: string;
531
+ subdomains: Array<string>;
450
532
  /**
451
- * For a connector created through an SSO connector: that SSO's account (email). The reference autoreconnect follows. Null otherwise.
533
+ * When its cookies were last saved: from a sign-in or a save through the API. A run writing back the cookies it refreshed does not move it.
452
534
  */
453
- sso_account: string | null;
535
+ synced_at: string;
454
536
  updated_at: string;
537
+ /**
538
+ * When a run last used it. Null until one has.
539
+ */
540
+ used_at: string | null;
541
+ };
542
+ /**
543
+ * A link as its creation answers it, the one time its address is given.
544
+ */
545
+ export type CreatedConnectorLink = {
546
+ /**
547
+ * The ID of the Auth session cookies the login saved, once the link is `done`. Absent before, and once those Auth session cookies are deleted.
548
+ */
549
+ connector_id?: string;
550
+ created_at: string;
551
+ /**
552
+ * Why the browser closed with nothing saved, when something went wrong.
553
+ */
554
+ error?: string;
555
+ /**
556
+ * While nobody has opened the link, when it stops opening. While its browser is open, when the browser closes, saving what it holds by then.
557
+ */
558
+ expires_at: string;
559
+ /**
560
+ * The site whose cookies become the Auth session cookies, bare (e.g. "linkedin.com").
561
+ */
562
+ host: string;
563
+ id: string;
564
+ /**
565
+ * Where the open browser stands, so a person watching can tell whether the login has moved.
566
+ */
567
+ page_url?: string;
568
+ /**
569
+ * The profile the Auth session cookies are saved into; absent for none.
570
+ */
571
+ profile_id?: string;
572
+ /**
573
+ * Where the page sends the person once the login ends, or when its browser cannot open, with `link_id` and `status` added to its query. Absent: the page tells them they can close it.
574
+ */
575
+ return_url?: string;
576
+ /**
577
+ * Where the browser opens.
578
+ */
579
+ start_url: string;
580
+ /**
581
+ * `waiting`: the browser is not closed yet. `done`: the browser closed with the cookies saved. `failed`: it closed with nothing saved. `expired`: nobody opened the link in time.
582
+ */
583
+ status: ConnectorLinkStatus;
584
+ /**
585
+ * The page to sign in on. Only the creation of the link gives it: keep it. Anyone who has it can use it, with or without a Reduck account, until the link is over: give it only to the person who must sign in.
586
+ */
587
+ url: string;
455
588
  };
456
589
  /**
457
590
  * How the call proved who you are: `session` is a sign-in on reduck.ai, `api_key` is one of your API keys, `oauth` is the access token of an app that you authorized, and `delegated` is a Reduck service that calls for you, such as the MCP server.
@@ -498,7 +631,7 @@ export type ErrorResponse = {
498
631
  /**
499
632
  * Identifies the error. Use this value in your code. New values can be added: for a value that you do not know, use the status.
500
633
  */
501
- code: 'invalid_request' | 'unauthenticated' | 'forbidden' | 'not_found' | 'method_not_allowed' | 'request_timeout' | 'conflict' | 'content_too_large' | 'unsupported_media_type' | 'unprocessable_content' | 'dependency_failed' | 'rate_limited' | 'internal_error' | 'upstream_failed' | 'unavailable' | 'device_not_found' | 'feature_locked' | 'name_taken' | 'archived' | 'no_changes' | 'empty_patch' | 'not_draft' | 'no_promoted_version' | 'stale_version' | 'draft_changed' | 'noncompliant' | 'eval_args_invalid' | 'evals_failing' | 'type_errors' | 'typecheck_unavailable' | 'release_not_published' | 'no_release' | 'migration_missing' | 'migration_edited' | 'connector_ambiguous';
634
+ code: 'invalid_request' | 'unauthenticated' | 'forbidden' | 'not_found' | 'method_not_allowed' | 'request_timeout' | 'conflict' | 'gone' | 'content_too_large' | 'unsupported_media_type' | 'unprocessable_content' | 'dependency_failed' | 'rate_limited' | 'internal_error' | 'upstream_failed' | 'unavailable' | 'upstream_timeout' | 'device_not_found' | 'feature_locked' | 'name_taken' | 'archived' | 'no_changes' | 'empty_patch' | 'not_draft' | 'no_promoted_version' | 'stale_version' | 'draft_changed' | 'noncompliant' | 'whoami_format' | 'eval_args_invalid' | 'evals_failing' | 'type_errors' | 'typecheck_unavailable' | 'release_not_published' | 'no_release' | 'migration_missing' | 'migration_edited';
502
635
  /**
503
636
  * Describes the error for a person. The text can change: do not use it in your code.
504
637
  */
@@ -545,6 +678,13 @@ export type ManagedQuota = {
545
678
  limit: number | null;
546
679
  used: number;
547
680
  };
681
+ export declare const ManagedRegion: {
682
+ readonly EU_CENTRAL_1: "eu-central-1";
683
+ readonly US_EAST_1: "us-east-1";
684
+ readonly US_WEST_2: "us-west-2";
685
+ readonly AP_SOUTHEAST_1: "ap-southeast-1";
686
+ };
687
+ export type ManagedRegion = typeof ManagedRegion[keyof typeof ManagedRegion];
548
688
  export type ManagedUsage = {
549
689
  browser_minutes: ManagedQuota;
550
690
  period_end: string;
@@ -571,6 +711,21 @@ export type PaginatedResponseAppUpdate = {
571
711
  has_next_page: boolean;
572
712
  total_count?: number;
573
713
  };
714
+ export type PaginatedResponseConnectorLink = {
715
+ data: Array<ConnectorLink>;
716
+ has_next_page: boolean;
717
+ total_count?: number;
718
+ };
719
+ export type PaginatedResponseConnectorProfile = {
720
+ data: Array<ConnectorProfile>;
721
+ has_next_page: boolean;
722
+ total_count?: number;
723
+ };
724
+ export type PaginatedResponseConnectorSummary = {
725
+ data: Array<ConnectorSummary>;
726
+ has_next_page: boolean;
727
+ total_count?: number;
728
+ };
574
729
  export type PaginatedResponseRun = {
575
730
  data: Array<Run>;
576
731
  has_next_page: boolean;
@@ -605,6 +760,14 @@ export type Run = {
605
760
  * The batch of scripts the run is part of, to read them all with GET /api/runs?batch_id=. Null for a run of one script.
606
761
  */
607
762
  batch_id: string | null;
763
+ /**
764
+ * The run's place in its batch, from 1, in the order the scripts were given. Null for a run of one script.
765
+ */
766
+ batch_index: number | null;
767
+ /**
768
+ * How many scripts its batch was given. Null for a run of one script.
769
+ */
770
+ batch_total: number | null;
608
771
  browser: RunDevice;
609
772
  /**
610
773
  * What caused the failure: the script, your request, the site, your device, or Reduck. Null when the run did not fail, or when Reduck could not find the cause.
@@ -710,7 +873,10 @@ export type ScriptEval = {
710
873
  */
711
874
  latest: EvalVerdict | null;
712
875
  note: string | null;
713
- region: string;
876
+ /**
877
+ * The datacenter of a managed browser; "" for the default one.
878
+ */
879
+ region: ManagedRegion | '';
714
880
  validation_code: string | null;
715
881
  };
716
882
  export type ScriptLib = {
@@ -752,7 +918,6 @@ export type ScriptSummary = {
752
918
  description: string;
753
919
  execution_count: number;
754
920
  host: string;
755
- human_required: boolean;
756
921
  id: string;
757
922
  last_run_at: string | null;
758
923
  name: string;
@@ -838,7 +1003,6 @@ export type ScriptWithVersion = {
838
1003
  description: string;
839
1004
  execution_count: number;
840
1005
  host: string;
841
- human_required: boolean;
842
1006
  id: string;
843
1007
  last_run_at: string | null;
844
1008
  name: string;
@@ -1267,6 +1431,7 @@ export type ListAppImageReleasesErrors = {
1267
1431
  * Forbidden
1268
1432
  */
1269
1433
  403: ErrorResponse & {
1434
+ code?: 'forbidden' | 'feature_locked';
1270
1435
  status?: 403;
1271
1436
  };
1272
1437
  /**
@@ -1470,6 +1635,7 @@ export type GetAppImageReleaseErrors = {
1470
1635
  * Forbidden
1471
1636
  */
1472
1637
  403: ErrorResponse & {
1638
+ code?: 'forbidden' | 'feature_locked';
1473
1639
  status?: 403;
1474
1640
  };
1475
1641
  /**
@@ -2107,10 +2273,32 @@ export type ListConnectorsData = {
2107
2273
  body?: never;
2108
2274
  path?: never;
2109
2275
  query?: {
2276
+ page?: number;
2277
+ page_size?: number;
2278
+ /**
2279
+ * Only the Auth session cookies of the site this host belongs to: mail.google.com names google.com.
2280
+ */
2281
+ host?: string;
2282
+ /**
2283
+ * The profile whose Auth session cookies to list, by ID, or "all" for every profile. Left out, the Auth session cookies in no profile.
2284
+ */
2285
+ profile_id?: string | 'all';
2110
2286
  /**
2111
- * The end-user this connector is kept for, in your own naming (for example your user id). Omit, or leave empty, for your own account's connectors. Only an API key or an OAuth token can read or create an end-user's connector.
2287
+ * Only the Auth session cookies signed in to this account on the site.
2112
2288
  */
2113
- profile?: string;
2289
+ account?: string;
2290
+ /**
2291
+ * Only the Auth session cookies whose host or one of whose subdomains contains this text.
2292
+ */
2293
+ q?: string;
2294
+ /**
2295
+ * The field to sort by: "host" (the default), "account" or "used_at".
2296
+ */
2297
+ sort_by?: 'host' | 'account' | 'used_at';
2298
+ /**
2299
+ * "asc" (the default) or "desc".
2300
+ */
2301
+ order?: 'asc' | 'desc';
2114
2302
  };
2115
2303
  url: '/api/connectors';
2116
2304
  };
@@ -2127,17 +2315,106 @@ export type ListConnectorsErrors = {
2127
2315
  403: ErrorResponse & {
2128
2316
  status?: 403;
2129
2317
  };
2318
+ /**
2319
+ * No such profile.
2320
+ */
2321
+ 404: ErrorResponse & {
2322
+ status?: 404;
2323
+ };
2130
2324
  };
2131
2325
  export type ListConnectorsError = ListConnectorsErrors[keyof ListConnectorsErrors];
2132
2326
  export type ListConnectorsResponses = {
2133
2327
  /**
2134
2328
  * OK
2135
2329
  */
2136
- 200: Array<Connector>;
2330
+ 200: PaginatedResponseConnectorSummary;
2137
2331
  };
2138
2332
  export type ListConnectorsResponse = ListConnectorsResponses[keyof ListConnectorsResponses];
2139
- export type CreateConnectorData = {
2333
+ export type BatchDeleteConnectorsData = {
2140
2334
  body: {
2335
+ /**
2336
+ * The IDs of the Auth session cookies to delete. An ID that is not yours is skipped.
2337
+ */
2338
+ ids: Array<string>;
2339
+ };
2340
+ path?: never;
2341
+ query?: never;
2342
+ url: '/api/connectors/delete';
2343
+ };
2344
+ export type BatchDeleteConnectorsErrors = {
2345
+ /**
2346
+ * Invalid request
2347
+ */
2348
+ 400: ErrorResponse & {
2349
+ status?: 400;
2350
+ };
2351
+ /**
2352
+ * Not authenticated
2353
+ */
2354
+ 401: ErrorResponse & {
2355
+ status?: 401;
2356
+ };
2357
+ /**
2358
+ * Forbidden
2359
+ */
2360
+ 403: ErrorResponse & {
2361
+ status?: 403;
2362
+ };
2363
+ };
2364
+ export type BatchDeleteConnectorsError = BatchDeleteConnectorsErrors[keyof BatchDeleteConnectorsErrors];
2365
+ export type BatchDeleteConnectorsResponses = {
2366
+ /**
2367
+ * No content
2368
+ */
2369
+ 204: void;
2370
+ };
2371
+ export type BatchDeleteConnectorsResponse = BatchDeleteConnectorsResponses[keyof BatchDeleteConnectorsResponses];
2372
+ export type ResolveConnectorData = {
2373
+ body?: never;
2374
+ path: {
2375
+ host: string;
2376
+ };
2377
+ query?: {
2378
+ /**
2379
+ * The profile to work in, by ID. Left out, the Auth session cookies that are in no profile. A profile holds one set of Auth session cookies per site.
2380
+ */
2381
+ profile_id?: string;
2382
+ };
2383
+ url: '/api/connectors/hosts/{host}';
2384
+ };
2385
+ export type ResolveConnectorErrors = {
2386
+ /**
2387
+ * Not authenticated
2388
+ */
2389
+ 401: ErrorResponse & {
2390
+ status?: 401;
2391
+ };
2392
+ /**
2393
+ * Forbidden
2394
+ */
2395
+ 403: ErrorResponse & {
2396
+ status?: 403;
2397
+ };
2398
+ /**
2399
+ * No such profile, or the host's website has no Auth session cookies in it.
2400
+ */
2401
+ 404: ErrorResponse & {
2402
+ status?: 404;
2403
+ };
2404
+ };
2405
+ export type ResolveConnectorError = ResolveConnectorErrors[keyof ResolveConnectorErrors];
2406
+ export type ResolveConnectorResponses = {
2407
+ /**
2408
+ * OK
2409
+ */
2410
+ 200: ConnectorWithCookies;
2411
+ };
2412
+ export type ResolveConnectorResponse = ResolveConnectorResponses[keyof ResolveConnectorResponses];
2413
+ export type SaveConnectorData = {
2414
+ body: {
2415
+ /**
2416
+ * Every cookie belongs to the site of `host`: its domain or one of the domain's subdomains.
2417
+ */
2141
2418
  cookies: Array<{
2142
2419
  domain: string;
2143
2420
  expires: number;
@@ -2149,23 +2426,240 @@ export type CreateConnectorData = {
2149
2426
  value: string;
2150
2427
  [key: string]: unknown;
2151
2428
  }>;
2429
+ /**
2430
+ * The profile to work in, by ID. Left out, the Auth session cookies that are in no profile. A profile holds one set of Auth session cookies per site.
2431
+ */
2432
+ profile_id?: string;
2433
+ };
2434
+ path: {
2435
+ /**
2436
+ * A host of the site, which names its Auth session cookies: cookies saved for mail.google.com are stored on google.com.
2437
+ */
2438
+ host: string;
2439
+ };
2440
+ query?: never;
2441
+ url: '/api/connectors/hosts/{host}';
2442
+ };
2443
+ export type SaveConnectorErrors = {
2444
+ /**
2445
+ * Invalid request
2446
+ */
2447
+ 400: ErrorResponse & {
2448
+ status?: 400;
2449
+ };
2450
+ /**
2451
+ * Not authenticated
2452
+ */
2453
+ 401: ErrorResponse & {
2454
+ status?: 401;
2455
+ };
2456
+ /**
2457
+ * Forbidden
2458
+ */
2459
+ 403: ErrorResponse & {
2460
+ status?: 403;
2461
+ };
2462
+ /**
2463
+ * No such profile.
2464
+ */
2465
+ 404: ErrorResponse & {
2466
+ status?: 404;
2467
+ };
2468
+ };
2469
+ export type SaveConnectorError = SaveConnectorErrors[keyof SaveConnectorErrors];
2470
+ export type SaveConnectorResponses = {
2471
+ /**
2472
+ * OK
2473
+ */
2474
+ 200: Connector;
2475
+ /**
2476
+ * Created
2477
+ */
2478
+ 201: Connector;
2479
+ };
2480
+ export type SaveConnectorResponse = SaveConnectorResponses[keyof SaveConnectorResponses];
2481
+ export type IdentifyConnectorAccountData = {
2482
+ body: {
2483
+ /**
2484
+ * The profile to work in, by ID. Left out, the Auth session cookies that are in no profile. A profile holds one set of Auth session cookies per site.
2485
+ */
2486
+ profile_id?: string;
2487
+ /**
2488
+ * The whoami script to run, on a host of the same site and marked `logged_in`. It returns an object with `loggedIn` (a boolean) and, when signed in, `account`, `email` or `username`: the first one set is the account. It can also return `name`, `userId` and `workspace` ({ id, name }). When the session is signed out, it returns `loggedIn: false` or throws a `SignedOutError`. Left out, the official whoami script for the site.
2489
+ */
2490
+ script?: {
2491
+ /**
2492
+ * The owner a resource is addressed under: "@username" for a personal scope, or a bare slug for a project.
2493
+ */
2494
+ handle: string;
2495
+ /**
2496
+ * The site the script automates, as a hostname.
2497
+ */
2498
+ host: string;
2499
+ /**
2500
+ * The script's unique identifier within its host, unique per owner.
2501
+ */
2502
+ slug: string;
2503
+ };
2504
+ };
2505
+ path: {
2506
+ /**
2507
+ * A host of the site whose Auth session cookies to check: mail.google.com checks the Auth session cookies of google.com.
2508
+ */
2152
2509
  host: string;
2510
+ };
2511
+ query?: never;
2512
+ url: '/api/connectors/hosts/{host}/whoami';
2513
+ };
2514
+ export type IdentifyConnectorAccountErrors = {
2515
+ /**
2516
+ * The request is malformed, the script is on another website, or the script is not marked `logged_in`.
2517
+ */
2518
+ 400: ErrorResponse & {
2519
+ status?: 400;
2520
+ };
2521
+ /**
2522
+ * Not authenticated
2523
+ */
2524
+ 401: ErrorResponse & {
2525
+ status?: 401;
2526
+ };
2527
+ /**
2528
+ * This account is out of runs or of cloud browser time for this period.
2529
+ */
2530
+ 403: ErrorResponse & {
2531
+ status?: 403;
2532
+ };
2533
+ /**
2534
+ * No such profile, the website has no Auth session cookies in it, no such script or it has no current version, or there is no official whoami script for the website.
2535
+ */
2536
+ 404: ErrorResponse & {
2537
+ status?: 404;
2538
+ };
2539
+ /**
2540
+ * Too many requests. Wait for the time `Retry-After` gives, then try again.
2541
+ */
2542
+ 429: ErrorResponse & {
2543
+ status?: 429;
2544
+ };
2545
+ /**
2546
+ * The run did not start, Reduck could not confirm that it started, the whoami script failed, or its answer does not have the shape `script` describes. The message gives the run id when there is one.
2547
+ */
2548
+ 502: ErrorResponse & {
2549
+ status?: 502;
2550
+ };
2551
+ /**
2552
+ * The whoami script did not end in time. The run goes on and is billed, but what it finds is not recorded. The message gives the run id.
2553
+ */
2554
+ 504: ErrorResponse & {
2555
+ status?: 504;
2556
+ };
2557
+ };
2558
+ export type IdentifyConnectorAccountError = IdentifyConnectorAccountErrors[keyof IdentifyConnectorAccountErrors];
2559
+ export type IdentifyConnectorAccountResponses = {
2560
+ /**
2561
+ * OK
2562
+ */
2563
+ 200: {
2564
+ /**
2565
+ * The account the script found: `account`, else `email`, else `username`. When the session is signed in, the Auth session cookies record it. Null when the script names none.
2566
+ */
2567
+ account: string | null;
2568
+ /**
2569
+ * When the check started, as recorded with the Auth session cookies. Cookies synced after it may be signed in to another account.
2570
+ */
2571
+ checked_at: string;
2572
+ /**
2573
+ * The email address the site shows for the person.
2574
+ */
2575
+ email: string | null;
2576
+ /**
2577
+ * Whether the session is signed in.
2578
+ */
2579
+ logged_in: boolean;
2580
+ /**
2581
+ * The name the site shows for the person.
2582
+ */
2583
+ name: string | null;
2584
+ /**
2585
+ * The run of the whoami script, to read its trace.
2586
+ */
2587
+ run_id: string;
2588
+ /**
2589
+ * The site's own id for the person.
2590
+ */
2591
+ user_id: string | null;
2592
+ /**
2593
+ * The handle or the login name on the site.
2594
+ */
2595
+ username: string | null;
2596
+ /**
2597
+ * The organization, team or store the session acts in, on a site where one account holds several.
2598
+ */
2599
+ workspace: {
2600
+ id: string | null;
2601
+ name: string | null;
2602
+ } | null;
2603
+ };
2604
+ };
2605
+ export type IdentifyConnectorAccountResponse = IdentifyConnectorAccountResponses[keyof IdentifyConnectorAccountResponses];
2606
+ export type ListConnectorLinksData = {
2607
+ body?: never;
2608
+ path?: never;
2609
+ query?: {
2610
+ page?: number;
2611
+ page_size?: number;
2612
+ };
2613
+ url: '/api/connectors/links';
2614
+ };
2615
+ export type ListConnectorLinksErrors = {
2616
+ /**
2617
+ * Not authenticated
2618
+ */
2619
+ 401: ErrorResponse & {
2620
+ status?: 401;
2621
+ };
2622
+ /**
2623
+ * Forbidden
2624
+ */
2625
+ 403: ErrorResponse & {
2626
+ status?: 403;
2627
+ };
2628
+ };
2629
+ export type ListConnectorLinksError = ListConnectorLinksErrors[keyof ListConnectorLinksErrors];
2630
+ export type ListConnectorLinksResponses = {
2631
+ /**
2632
+ * OK
2633
+ */
2634
+ 200: PaginatedResponseConnectorLink;
2635
+ };
2636
+ export type ListConnectorLinksResponse = ListConnectorLinksResponses[keyof ListConnectorLinksResponses];
2637
+ export type CreateConnectorLinkData = {
2638
+ body: {
2153
2639
  /**
2154
- * A name for the connector, to tell it apart from the site's other connectors.
2640
+ * The site whose cookies become the Auth session cookies. The start URL's own site when omitted. The Auth session cookies of a site also serve its subdomains.
2155
2641
  */
2156
- label?: string;
2642
+ host?: string;
2643
+ /**
2644
+ * The profile to work in, by ID. Left out, the Auth session cookies that are in no profile. A profile holds one set of Auth session cookies per site.
2645
+ */
2646
+ profile_id?: string;
2647
+ /**
2648
+ * The page of your product where the person goes when the login ends: an https URL, or an http URL on localhost. Reduck adds `link_id` and `status` to its query: `done`, `failed` or `expired`, or `waiting` when the person goes back before the login ends (the cloud browser could not open). Do not trust `status`: anyone can open this URL. Read the link to know its outcome.
2649
+ */
2650
+ return_url?: string;
2157
2651
  /**
2158
- * The end-user this connector is kept for, in your own naming (for example your user id). Omit, or leave empty, for your own account's connectors. Only an API key or an OAuth token can read or create an end-user's connector.
2652
+ * The site's login page, where the browser opens.
2159
2653
  */
2160
- profile?: string;
2654
+ start_url: string;
2161
2655
  };
2162
2656
  path?: never;
2163
2657
  query?: never;
2164
- url: '/api/connectors';
2658
+ url: '/api/connectors/links';
2165
2659
  };
2166
- export type CreateConnectorErrors = {
2660
+ export type CreateConnectorLinkErrors = {
2167
2661
  /**
2168
- * Invalid request
2662
+ * The request is malformed, or the start URL's host is not a site that Auth session cookies can be stored under: name it with `host`.
2169
2663
  */
2170
2664
  400: ErrorResponse & {
2171
2665
  status?: 400;
@@ -2177,42 +2671,35 @@ export type CreateConnectorErrors = {
2177
2671
  status?: 401;
2178
2672
  };
2179
2673
  /**
2180
- * An end-user's connector is created with an API key or an OAuth token, not from a browser session.
2674
+ * This account is out of cloud browser time for this period.
2181
2675
  */
2182
2676
  403: ErrorResponse & {
2183
2677
  status?: 403;
2184
2678
  };
2185
2679
  /**
2186
- * The site already has a connector with that label, or one with neither an account nor a label, for this profile.
2187
- */
2188
- 409: ErrorResponse & {
2189
- code?: 'conflict' | 'name_taken';
2190
- status?: 409;
2191
- };
2192
- /**
2193
- * This environment stores no connectors.
2680
+ * No such profile.
2194
2681
  */
2195
- 503: ErrorResponse & {
2196
- status?: 503;
2682
+ 404: ErrorResponse & {
2683
+ status?: 404;
2197
2684
  };
2198
2685
  };
2199
- export type CreateConnectorError = CreateConnectorErrors[keyof CreateConnectorErrors];
2200
- export type CreateConnectorResponses = {
2686
+ export type CreateConnectorLinkError = CreateConnectorLinkErrors[keyof CreateConnectorLinkErrors];
2687
+ export type CreateConnectorLinkResponses = {
2201
2688
  /**
2202
2689
  * Created
2203
2690
  */
2204
- 201: Connector;
2691
+ 201: CreatedConnectorLink;
2205
2692
  };
2206
- export type CreateConnectorResponse = CreateConnectorResponses[keyof CreateConnectorResponses];
2207
- export type DeleteConnectorByIdData = {
2693
+ export type CreateConnectorLinkResponse = CreateConnectorLinkResponses[keyof CreateConnectorLinkResponses];
2694
+ export type DeleteConnectorLinkData = {
2208
2695
  body?: never;
2209
2696
  path: {
2210
- id: string;
2697
+ link_id: string;
2211
2698
  };
2212
2699
  query?: never;
2213
- url: '/api/connectors/by-id/{id}';
2700
+ url: '/api/connectors/links/{link_id}';
2214
2701
  };
2215
- export type DeleteConnectorByIdErrors = {
2702
+ export type DeleteConnectorLinkErrors = {
2216
2703
  /**
2217
2704
  * Invalid request
2218
2705
  */
@@ -2232,44 +2719,29 @@ export type DeleteConnectorByIdErrors = {
2232
2719
  status?: 403;
2233
2720
  };
2234
2721
  /**
2235
- * Not found
2722
+ * No such link.
2236
2723
  */
2237
2724
  404: ErrorResponse & {
2238
2725
  status?: 404;
2239
2726
  };
2240
2727
  };
2241
- export type DeleteConnectorByIdError = DeleteConnectorByIdErrors[keyof DeleteConnectorByIdErrors];
2242
- export type DeleteConnectorByIdResponses = {
2728
+ export type DeleteConnectorLinkError = DeleteConnectorLinkErrors[keyof DeleteConnectorLinkErrors];
2729
+ export type DeleteConnectorLinkResponses = {
2243
2730
  /**
2244
2731
  * No content
2245
2732
  */
2246
2733
  204: void;
2247
2734
  };
2248
- export type DeleteConnectorByIdResponse = DeleteConnectorByIdResponses[keyof DeleteConnectorByIdResponses];
2249
- export type PatchConnectorData = {
2250
- body: {
2251
- /**
2252
- * The account a probe reported. Only Reduck's own run service sets it.
2253
- */
2254
- account?: string;
2255
- /**
2256
- * The new label, or null to remove it.
2257
- */
2258
- label?: string | null;
2259
- };
2735
+ export type DeleteConnectorLinkResponse = DeleteConnectorLinkResponses[keyof DeleteConnectorLinkResponses];
2736
+ export type GetConnectorLinkData = {
2737
+ body?: never;
2260
2738
  path: {
2261
- id: string;
2739
+ link_id: string;
2262
2740
  };
2263
2741
  query?: never;
2264
- url: '/api/connectors/by-id/{id}';
2742
+ url: '/api/connectors/links/{link_id}';
2265
2743
  };
2266
- export type PatchConnectorErrors = {
2267
- /**
2268
- * The request is malformed, or it sets an account: only a probe script records one.
2269
- */
2270
- 400: ErrorResponse & {
2271
- status?: 400;
2272
- };
2744
+ export type GetConnectorLinkErrors = {
2273
2745
  /**
2274
2746
  * Not authenticated
2275
2747
  */
@@ -2283,55 +2755,40 @@ export type PatchConnectorErrors = {
2283
2755
  status?: 403;
2284
2756
  };
2285
2757
  /**
2286
- * Not found
2758
+ * No such link.
2287
2759
  */
2288
2760
  404: ErrorResponse & {
2289
2761
  status?: 404;
2290
2762
  };
2291
2763
  /**
2292
- * Another connector on the site already has that label for this profile.
2764
+ * Where its browser stands could not be read.
2293
2765
  */
2294
- 409: ErrorResponse & {
2295
- code?: 'conflict' | 'name_taken';
2296
- status?: 409;
2766
+ 502: ErrorResponse & {
2767
+ status?: 502;
2297
2768
  };
2298
2769
  };
2299
- export type PatchConnectorError = PatchConnectorErrors[keyof PatchConnectorErrors];
2300
- export type PatchConnectorResponses = {
2770
+ export type GetConnectorLinkError = GetConnectorLinkErrors[keyof GetConnectorLinkErrors];
2771
+ export type GetConnectorLinkResponses = {
2301
2772
  /**
2302
2773
  * OK
2303
2774
  */
2304
- 200: Connector;
2775
+ 200: ConnectorLink;
2305
2776
  };
2306
- export type PatchConnectorResponse = PatchConnectorResponses[keyof PatchConnectorResponses];
2307
- export type PutConnectorByIdData = {
2308
- body: {
2309
- cookies: Array<{
2310
- domain: string;
2311
- expires: number;
2312
- httpOnly: boolean;
2313
- name: string;
2314
- path: string;
2315
- sameSite?: 'Strict' | 'Lax' | 'None';
2316
- secure: boolean;
2317
- value: string;
2318
- [key: string]: unknown;
2319
- }>;
2320
- sso_account?: string;
2321
- };
2322
- path: {
2323
- id: string;
2777
+ export type GetConnectorLinkResponse = GetConnectorLinkResponses[keyof GetConnectorLinkResponses];
2778
+ export type ListConnectorProfilesData = {
2779
+ body?: never;
2780
+ path?: never;
2781
+ query?: {
2782
+ page?: number;
2783
+ page_size?: number;
2784
+ /**
2785
+ * Only the profile with this name. A name is unique among your profiles.
2786
+ */
2787
+ name?: string;
2324
2788
  };
2325
- query?: never;
2326
- url: '/api/connectors/by-id/{id}';
2789
+ url: '/api/connectors/profiles';
2327
2790
  };
2328
- export type PutConnectorByIdErrors = {
2329
- /**
2330
- * Invalid request
2331
- */
2332
- 400: ErrorResponse & {
2333
- status?: 400;
2334
- };
2791
+ export type ListConnectorProfilesErrors = {
2335
2792
  /**
2336
2793
  * Not authenticated
2337
2794
  */
@@ -2339,56 +2796,32 @@ export type PutConnectorByIdErrors = {
2339
2796
  status?: 401;
2340
2797
  };
2341
2798
  /**
2342
- * An end-user's connector is written with an API key or an OAuth token, not from a browser session.
2799
+ * Forbidden
2343
2800
  */
2344
2801
  403: ErrorResponse & {
2345
2802
  status?: 403;
2346
2803
  };
2347
- /**
2348
- * Not found
2349
- */
2350
- 404: ErrorResponse & {
2351
- status?: 404;
2352
- };
2353
- /**
2354
- * This environment stores no connectors.
2355
- */
2356
- 503: ErrorResponse & {
2357
- status?: 503;
2358
- };
2359
2804
  };
2360
- export type PutConnectorByIdError = PutConnectorByIdErrors[keyof PutConnectorByIdErrors];
2361
- export type PutConnectorByIdResponses = {
2805
+ export type ListConnectorProfilesError = ListConnectorProfilesErrors[keyof ListConnectorProfilesErrors];
2806
+ export type ListConnectorProfilesResponses = {
2362
2807
  /**
2363
2808
  * OK
2364
2809
  */
2365
- 200: Connector;
2810
+ 200: PaginatedResponseConnectorProfile;
2366
2811
  };
2367
- export type PutConnectorByIdResponse = PutConnectorByIdResponses[keyof PutConnectorByIdResponses];
2368
- export type StartConnectorLoginData = {
2812
+ export type ListConnectorProfilesResponse = ListConnectorProfilesResponses[keyof ListConnectorProfilesResponses];
2813
+ export type CreateConnectorProfileData = {
2369
2814
  body: {
2370
2815
  /**
2371
- * Also answer `endUserUrl`: a link for the end-user of `profile` to sign in on, with no Reduck account. Anyone holding it drives this one sign-in browser until it ends.
2372
- */
2373
- endUserLink?: boolean;
2374
- hosts?: Array<string>;
2375
- /**
2376
- * The label of the connector the sign-in stores into. Needed when the site already holds several connectors for the profile; without it the site's only one is refreshed.
2816
+ * The profile's name, unique among your profiles.
2377
2817
  */
2378
- label?: string;
2379
- loginUrl: string;
2380
- /**
2381
- * The end-user this connector is kept for, in your own naming (for example your user id). Omit, or leave empty, for your own account's connectors. Only an API key or an OAuth token can read or create an end-user's connector.
2382
- */
2383
- profile?: string;
2384
- sso?: boolean;
2385
- ssoAccount?: string;
2818
+ name: string;
2386
2819
  };
2387
2820
  path?: never;
2388
2821
  query?: never;
2389
- url: '/api/connectors/login';
2822
+ url: '/api/connectors/profiles';
2390
2823
  };
2391
- export type StartConnectorLoginErrors = {
2824
+ export type CreateConnectorProfileErrors = {
2392
2825
  /**
2393
2826
  * Invalid request
2394
2827
  */
@@ -2402,83 +2835,42 @@ export type StartConnectorLoginErrors = {
2402
2835
  status?: 401;
2403
2836
  };
2404
2837
  /**
2405
- * Out of cloud browser time for this period, or an end-user's sign-in was started from a browser session instead of with an API key or an OAuth token.
2838
+ * Forbidden
2406
2839
  */
2407
2840
  403: ErrorResponse & {
2408
2841
  status?: 403;
2409
2842
  };
2410
2843
  /**
2411
- * A site already holds several connectors for the profile and the sign-in names none: give it a `label`.
2844
+ * You already have a profile with that name.
2412
2845
  */
2413
2846
  409: ErrorResponse & {
2414
- code?: 'conflict';
2847
+ code?: 'conflict' | 'name_taken';
2415
2848
  status?: 409;
2416
2849
  };
2417
- /**
2418
- * Too many sign-ins already open on this account.
2419
- */
2420
- 429: ErrorResponse & {
2421
- status?: 429;
2422
- };
2423
- /**
2424
- * The browser could not be opened.
2425
- */
2426
- 502: ErrorResponse & {
2427
- status?: 502;
2428
- };
2429
- /**
2430
- * This environment stores no connectors, or provisions no browsers.
2431
- */
2432
- 503: ErrorResponse & {
2433
- status?: 503;
2434
- };
2435
2850
  };
2436
- export type StartConnectorLoginError = StartConnectorLoginErrors[keyof StartConnectorLoginErrors];
2437
- export type StartConnectorLoginResponses = {
2851
+ export type CreateConnectorProfileError = CreateConnectorProfileErrors[keyof CreateConnectorProfileErrors];
2852
+ export type CreateConnectorProfileResponses = {
2438
2853
  /**
2439
- * OK
2854
+ * Created
2440
2855
  */
2441
- 200: {
2442
- /**
2443
- * With `endUserLink`: the page the end-user signs in on, no Reduck account needed. It opens this one sign-in only, and stops working when the sign-in ends.
2444
- */
2445
- endUserUrl?: string;
2446
- /**
2447
- * When the browser closes on its own, storing whatever the jar holds by then.
2448
- */
2449
- expiresAt: string;
2450
- /**
2451
- * The sites that become connectors, canonical — the login URL's own when none were named.
2452
- */
2453
- hosts: Array<string>;
2454
- /**
2455
- * The sign-in's id. Nothing has to be called with it: it identifies this one in a log.
2456
- */
2457
- loginId: string;
2458
- /**
2459
- * Where the browser was sent, echoed back.
2460
- */
2461
- loginUrl: string;
2462
- /**
2463
- * The end-user profile the connectors are stored into; absent for your own account.
2464
- */
2465
- profile?: string;
2466
- /**
2467
- * Where the person signs in: a Reduck page showing the live browser. Give it to the account's owner — the page opens for them and for nobody else, so a link that leaks is a dead end rather than somebody else's browser.
2468
- */
2469
- signInUrl: string;
2470
- };
2856
+ 201: ConnectorProfile;
2471
2857
  };
2472
- export type StartConnectorLoginResponse = StartConnectorLoginResponses[keyof StartConnectorLoginResponses];
2473
- export type GetConnectorLoginData = {
2858
+ export type CreateConnectorProfileResponse = CreateConnectorProfileResponses[keyof CreateConnectorProfileResponses];
2859
+ export type DeleteConnectorProfileData = {
2474
2860
  body?: never;
2475
2861
  path: {
2476
- login_id: string;
2862
+ profile_id: string;
2477
2863
  };
2478
2864
  query?: never;
2479
- url: '/api/connectors/login/{login_id}';
2865
+ url: '/api/connectors/profiles/{profile_id}';
2480
2866
  };
2481
- export type GetConnectorLoginErrors = {
2867
+ export type DeleteConnectorProfileErrors = {
2868
+ /**
2869
+ * Invalid request
2870
+ */
2871
+ 400: ErrorResponse & {
2872
+ status?: 400;
2873
+ };
2482
2874
  /**
2483
2875
  * Not authenticated
2484
2876
  */
@@ -2492,61 +2884,29 @@ export type GetConnectorLoginErrors = {
2492
2884
  status?: 403;
2493
2885
  };
2494
2886
  /**
2495
- * No such sign-in on this account.
2887
+ * No such profile.
2496
2888
  */
2497
2889
  404: ErrorResponse & {
2498
2890
  status?: 404;
2499
2891
  };
2500
2892
  };
2501
- export type GetConnectorLoginError = GetConnectorLoginErrors[keyof GetConnectorLoginErrors];
2502
- export type GetConnectorLoginResponses = {
2893
+ export type DeleteConnectorProfileError = DeleteConnectorProfileErrors[keyof DeleteConnectorProfileErrors];
2894
+ export type DeleteConnectorProfileResponses = {
2503
2895
  /**
2504
- * OK
2896
+ * No content
2505
2897
  */
2506
- 200: {
2507
- /**
2508
- * The username and password to offer to save, when the detector recognised them. Never answered for an end-user's sign-in: their password is not yours to keep.
2509
- */
2510
- credential?: ConnectorLoginCredential;
2511
- /**
2512
- * Why nothing more will happen, when something went wrong.
2513
- */
2514
- error?: string;
2515
- expiresAt: string;
2516
- hosts: Array<ConnectorLoginHost>;
2517
- /**
2518
- * The label of the connector the sign-in stores into, when it was given one.
2519
- */
2520
- label?: string;
2521
- loginId: string;
2522
- loginUrl: string;
2523
- /**
2524
- * Where the browser stands, so the page can say whether the sign-in has moved.
2525
- */
2526
- pageUrl?: string;
2527
- /**
2528
- * The end-user profile the connectors are stored into; absent for your own account.
2529
- */
2530
- profile?: string;
2531
- status: ConnectorLoginStatus;
2532
- };
2898
+ 204: void;
2533
2899
  };
2534
- export type GetConnectorLoginResponse = GetConnectorLoginResponses[keyof GetConnectorLoginResponses];
2535
- export type FinishConnectorLoginData = {
2900
+ export type DeleteConnectorProfileResponse = DeleteConnectorProfileResponses[keyof DeleteConnectorProfileResponses];
2901
+ export type GetConnectorProfileData = {
2536
2902
  body?: never;
2537
2903
  path: {
2538
- login_id: string;
2904
+ profile_id: string;
2539
2905
  };
2540
2906
  query?: never;
2541
- url: '/api/connectors/login/{login_id}/finish';
2907
+ url: '/api/connectors/profiles/{profile_id}';
2542
2908
  };
2543
- export type FinishConnectorLoginErrors = {
2544
- /**
2545
- * Invalid request
2546
- */
2547
- 400: ErrorResponse & {
2548
- status?: 400;
2549
- };
2909
+ export type GetConnectorProfileErrors = {
2550
2910
  /**
2551
2911
  * Not authenticated
2552
2912
  */
@@ -2560,53 +2920,40 @@ export type FinishConnectorLoginErrors = {
2560
2920
  status?: 403;
2561
2921
  };
2562
2922
  /**
2563
- * No such sign-in on this account.
2923
+ * No such profile.
2564
2924
  */
2565
2925
  404: ErrorResponse & {
2566
2926
  status?: 404;
2567
2927
  };
2568
2928
  };
2569
- export type FinishConnectorLoginError = FinishConnectorLoginErrors[keyof FinishConnectorLoginErrors];
2570
- export type FinishConnectorLoginResponses = {
2929
+ export type GetConnectorProfileError = GetConnectorProfileErrors[keyof GetConnectorProfileErrors];
2930
+ export type GetConnectorProfileResponses = {
2571
2931
  /**
2572
2932
  * OK
2573
2933
  */
2574
- 200: {
2575
- /**
2576
- * The username and password to offer to save, when the detector recognised them. Never answered for an end-user's sign-in: their password is not yours to keep.
2577
- */
2578
- credential?: ConnectorLoginCredential;
2579
- /**
2580
- * Why nothing more will happen, when something went wrong.
2581
- */
2582
- error?: string;
2583
- expiresAt: string;
2584
- hosts: Array<ConnectorLoginHost>;
2585
- /**
2586
- * The label of the connector the sign-in stores into, when it was given one.
2587
- */
2588
- label?: string;
2589
- loginId: string;
2590
- loginUrl: string;
2591
- /**
2592
- * Where the browser stands, so the page can say whether the sign-in has moved.
2593
- */
2594
- pageUrl?: string;
2934
+ 200: ConnectorProfile;
2935
+ };
2936
+ export type GetConnectorProfileResponse = GetConnectorProfileResponses[keyof GetConnectorProfileResponses];
2937
+ export type PatchConnectorProfileData = {
2938
+ body: {
2595
2939
  /**
2596
- * The end-user profile the connectors are stored into; absent for your own account.
2940
+ * The profile's name, unique among your profiles.
2597
2941
  */
2598
- profile?: string;
2599
- status: ConnectorLoginStatus;
2942
+ name: string;
2943
+ };
2944
+ path: {
2945
+ profile_id: string;
2600
2946
  };
2601
- };
2602
- export type FinishConnectorLoginResponse = FinishConnectorLoginResponses[keyof FinishConnectorLoginResponses];
2603
- export type ListConnectorProfilesData = {
2604
- body?: never;
2605
- path?: never;
2606
2947
  query?: never;
2607
- url: '/api/connectors/profiles';
2948
+ url: '/api/connectors/profiles/{profile_id}';
2608
2949
  };
2609
- export type ListConnectorProfilesErrors = {
2950
+ export type PatchConnectorProfileErrors = {
2951
+ /**
2952
+ * Invalid request
2953
+ */
2954
+ 400: ErrorResponse & {
2955
+ status?: 400;
2956
+ };
2610
2957
  /**
2611
2958
  * Not authenticated
2612
2959
  */
@@ -2619,35 +2966,35 @@ export type ListConnectorProfilesErrors = {
2619
2966
  403: ErrorResponse & {
2620
2967
  status?: 403;
2621
2968
  };
2969
+ /**
2970
+ * No such profile.
2971
+ */
2972
+ 404: ErrorResponse & {
2973
+ status?: 404;
2974
+ };
2975
+ /**
2976
+ * You already have a profile with that name.
2977
+ */
2978
+ 409: ErrorResponse & {
2979
+ code?: 'conflict' | 'name_taken';
2980
+ status?: 409;
2981
+ };
2622
2982
  };
2623
- export type ListConnectorProfilesError = ListConnectorProfilesErrors[keyof ListConnectorProfilesErrors];
2624
- export type ListConnectorProfilesResponses = {
2983
+ export type PatchConnectorProfileError = PatchConnectorProfileErrors[keyof PatchConnectorProfileErrors];
2984
+ export type PatchConnectorProfileResponses = {
2625
2985
  /**
2626
2986
  * OK
2627
2987
  */
2628
- 200: Array<ConnectorProfile>;
2988
+ 200: ConnectorProfile;
2629
2989
  };
2630
- export type ListConnectorProfilesResponse = ListConnectorProfilesResponses[keyof ListConnectorProfilesResponses];
2990
+ export type PatchConnectorProfileResponse = PatchConnectorProfileResponses[keyof PatchConnectorProfileResponses];
2631
2991
  export type DeleteConnectorData = {
2632
2992
  body?: never;
2633
2993
  path: {
2634
- host: string;
2635
- };
2636
- query?: {
2637
- /**
2638
- * The end-user this connector is kept for, in your own naming (for example your user id). Omit, or leave empty, for your own account's connectors. Only an API key or an OAuth token can read or create an end-user's connector.
2639
- */
2640
- profile?: string;
2641
- /**
2642
- * The connector whose account (as its probe or SSO sign-in reported it) is this one.
2643
- */
2644
- account?: string;
2645
- /**
2646
- * The connector with this label, or "" for the one without a label.
2647
- */
2648
- label?: string;
2994
+ connector_id: string;
2649
2995
  };
2650
- url: '/api/connectors/{host}';
2996
+ query?: never;
2997
+ url: '/api/connectors/{connector_id}';
2651
2998
  };
2652
2999
  export type DeleteConnectorErrors = {
2653
3000
  /**
@@ -2669,18 +3016,11 @@ export type DeleteConnectorErrors = {
2669
3016
  status?: 403;
2670
3017
  };
2671
3018
  /**
2672
- * Not found
3019
+ * No such Auth session cookies.
2673
3020
  */
2674
3021
  404: ErrorResponse & {
2675
3022
  status?: 404;
2676
3023
  };
2677
- /**
2678
- * Several connectors match; the body's `connectors` lists them. Name one with `account` or `label`.
2679
- */
2680
- 409: ErrorResponse & {
2681
- code?: 'conflict' | 'connector_ambiguous';
2682
- status?: 409;
2683
- };
2684
3024
  };
2685
3025
  export type DeleteConnectorError = DeleteConnectorErrors[keyof DeleteConnectorErrors];
2686
3026
  export type DeleteConnectorResponses = {
@@ -2693,23 +3033,10 @@ export type DeleteConnectorResponse = DeleteConnectorResponses[keyof DeleteConne
2693
3033
  export type GetConnectorData = {
2694
3034
  body?: never;
2695
3035
  path: {
2696
- host: string;
2697
- };
2698
- query?: {
2699
- /**
2700
- * The end-user this connector is kept for, in your own naming (for example your user id). Omit, or leave empty, for your own account's connectors. Only an API key or an OAuth token can read or create an end-user's connector.
2701
- */
2702
- profile?: string;
2703
- /**
2704
- * The connector whose account (as its probe or SSO sign-in reported it) is this one.
2705
- */
2706
- account?: string;
2707
- /**
2708
- * The connector with this label, or "" for the one without a label.
2709
- */
2710
- label?: string;
3036
+ connector_id: string;
2711
3037
  };
2712
- url: '/api/connectors/{host}';
3038
+ query?: never;
3039
+ url: '/api/connectors/{connector_id}';
2713
3040
  };
2714
3041
  export type GetConnectorErrors = {
2715
3042
  /**
@@ -2719,39 +3046,31 @@ export type GetConnectorErrors = {
2719
3046
  status?: 401;
2720
3047
  };
2721
3048
  /**
2722
- * An end-user's connector is read with an API key or an OAuth token, not from a browser session.
3049
+ * Forbidden
2723
3050
  */
2724
3051
  403: ErrorResponse & {
2725
3052
  status?: 403;
2726
3053
  };
2727
3054
  /**
2728
- * Not found
3055
+ * No such Auth session cookies.
2729
3056
  */
2730
3057
  404: ErrorResponse & {
2731
3058
  status?: 404;
2732
3059
  };
2733
- /**
2734
- * Several connectors match; the body's `connectors` lists them. Name one with `account` or `label`.
2735
- */
2736
- 409: ErrorResponse & {
2737
- code?: 'conflict' | 'connector_ambiguous';
2738
- status?: 409;
2739
- };
2740
3060
  };
2741
3061
  export type GetConnectorError = GetConnectorErrors[keyof GetConnectorErrors];
2742
3062
  export type GetConnectorResponses = {
2743
3063
  /**
2744
3064
  * OK
2745
3065
  */
2746
- 200: ConnectorWithCookies;
3066
+ 200: Connector;
2747
3067
  };
2748
3068
  export type GetConnectorResponse = GetConnectorResponses[keyof GetConnectorResponses];
2749
- export type PutConnectorData = {
3069
+ export type ReplaceConnectorCookiesData = {
2750
3070
  body: {
2751
3071
  /**
2752
- * The connector whose account (as its probe or SSO sign-in reported it) is this one.
3072
+ * Every cookie belongs to the site of these Auth session cookies: its domain or one of the domain's subdomains.
2753
3073
  */
2754
- account?: string;
2755
3074
  cookies: Array<{
2756
3075
  domain: string;
2757
3076
  expires: number;
@@ -2763,26 +3082,16 @@ export type PutConnectorData = {
2763
3082
  value: string;
2764
3083
  [key: string]: unknown;
2765
3084
  }>;
2766
- is_sso?: boolean;
2767
- /**
2768
- * The connector with this label, or "" for the one without a label.
2769
- */
2770
- label?: string;
2771
- /**
2772
- * The end-user this connector is kept for, in your own naming (for example your user id). Omit, or leave empty, for your own account's connectors. Only an API key or an OAuth token can read or create an end-user's connector.
2773
- */
2774
- profile?: string;
2775
- sso_account?: string;
2776
3085
  };
2777
3086
  path: {
2778
- host: string;
3087
+ connector_id: string;
2779
3088
  };
2780
3089
  query?: never;
2781
- url: '/api/connectors/{host}';
3090
+ url: '/api/connectors/{connector_id}';
2782
3091
  };
2783
- export type PutConnectorErrors = {
3092
+ export type ReplaceConnectorCookiesErrors = {
2784
3093
  /**
2785
- * The request is malformed, or it names an account no connector holds: an account is only ever recorded by a probe script.
3094
+ * The request is malformed, or a cookie belongs to another site than the Auth session cookies.
2786
3095
  */
2787
3096
  400: ErrorResponse & {
2788
3097
  status?: 400;
@@ -2794,33 +3103,26 @@ export type PutConnectorErrors = {
2794
3103
  status?: 401;
2795
3104
  };
2796
3105
  /**
2797
- * An end-user's connector is written with an API key or an OAuth token, not from a browser session.
3106
+ * Forbidden
2798
3107
  */
2799
3108
  403: ErrorResponse & {
2800
3109
  status?: 403;
2801
3110
  };
2802
3111
  /**
2803
- * Not found
3112
+ * No such Auth session cookies.
2804
3113
  */
2805
3114
  404: ErrorResponse & {
2806
3115
  status?: 404;
2807
3116
  };
2808
- /**
2809
- * Several connectors match; the body's `connectors` lists them. Or the label is already taken.
2810
- */
2811
- 409: ErrorResponse & {
2812
- code?: 'conflict' | 'connector_ambiguous' | 'name_taken';
2813
- status?: 409;
2814
- };
2815
3117
  };
2816
- export type PutConnectorError = PutConnectorErrors[keyof PutConnectorErrors];
2817
- export type PutConnectorResponses = {
3118
+ export type ReplaceConnectorCookiesError = ReplaceConnectorCookiesErrors[keyof ReplaceConnectorCookiesErrors];
3119
+ export type ReplaceConnectorCookiesResponses = {
2818
3120
  /**
2819
3121
  * OK
2820
3122
  */
2821
3123
  200: Connector;
2822
3124
  };
2823
- export type PutConnectorResponse = PutConnectorResponses[keyof PutConnectorResponses];
3125
+ export type ReplaceConnectorCookiesResponse = ReplaceConnectorCookiesResponses[keyof ReplaceConnectorCookiesResponses];
2824
3126
  export type ListDevicesData = {
2825
3127
  body?: never;
2826
3128
  path?: never;
@@ -2941,11 +3243,15 @@ export type GetMeResponses = {
2941
3243
  */
2942
3244
  name: string | null;
2943
3245
  };
3246
+ /**
3247
+ * Whether this account builds a product on Reduck for its own users, which publishes to it the MCP tools for Auth session cookies. False until the account says so.
3248
+ */
3249
+ developer_mode: boolean;
2944
3250
  email: string;
2945
3251
  /**
2946
3252
  * Experimental features this account has been let into, whether granted to it directly or to one of its projects.
2947
3253
  */
2948
- experimental_features: Array<'flock_apps'>;
3254
+ experimental_features: Array<'flock_apps' | 'reduck_backend'>;
2949
3255
  /**
2950
3256
  * The handle this account is addressed by, null until it picks a username.
2951
3257
  */
@@ -3038,10 +3344,14 @@ export type RunScriptsData = {
3038
3344
  * The paired device to run on. Use it when you have more than one device.
3039
3345
  */
3040
3346
  device_id?: string;
3347
+ /**
3348
+ * The profile to use for a `loggedIn` script on a cloud browser. When you do not give it, the script uses your Auth session cookies that are in no profile.
3349
+ */
3350
+ profile_id?: string;
3041
3351
  /**
3042
3352
  * The datacenter region of the managed browser. Select the region nearest to the site. If Reduck does not know the region, it refuses the request and gives the regions that it knows.
3043
3353
  */
3044
- region?: string;
3354
+ region?: 'eu-central-1' | 'us-east-1' | 'us-west-2' | 'ap-southeast-1';
3045
3355
  /**
3046
3356
  * The scripts to run, each in its own browser and at the same time as the others. A failure does not stop the other scripts. A request can have a maximum of 20 scripts.
3047
3357
  */
@@ -3461,7 +3771,6 @@ export type CreateScriptData = {
3461
3771
  * The site the script automates, as a hostname.
3462
3772
  */
3463
3773
  host: string;
3464
- human_required?: boolean;
3465
3774
  input_schema: {
3466
3775
  [key: string]: unknown;
3467
3776
  };
@@ -3529,7 +3838,7 @@ export type CreateScriptErrors = {
3529
3838
  * Unprocessable content
3530
3839
  */
3531
3840
  422: ErrorResponse & {
3532
- code?: 'unprocessable_content' | 'noncompliant' | 'type_errors';
3841
+ code?: 'unprocessable_content' | 'whoami_format' | 'noncompliant' | 'type_errors';
3533
3842
  status?: 422;
3534
3843
  };
3535
3844
  /**
@@ -4057,7 +4366,6 @@ export type GetScriptResponse = GetScriptResponses[keyof GetScriptResponses];
4057
4366
  export type PatchScriptData = {
4058
4367
  body: {
4059
4368
  description?: string;
4060
- human_required?: boolean;
4061
4369
  name?: string;
4062
4370
  };
4063
4371
  path: {
@@ -4248,9 +4556,9 @@ export type AddScriptEvalsData = {
4248
4556
  */
4249
4557
  note?: string | null;
4250
4558
  /**
4251
- * Managed datacenter. Managed only; omit for the default region.
4559
+ * Managed datacenter. Managed only; omit it, or send "", for the default region.
4252
4560
  */
4253
- region?: string;
4561
+ region?: 'eu-central-1' | 'us-east-1' | 'us-west-2' | 'ap-southeast-1' | '';
4254
4562
  /**
4255
4563
  * Optional JavaScript function body run against the output as `result`; a falsy return or a throw fails the eval. Runs in a Deno sandbox with no browser and no network, for 2 s at most. When `expect_error` is true, it receives the error message as `error` instead.
4256
4564
  */
@@ -4333,7 +4641,10 @@ export type AddScriptEvalsResponses = {
4333
4641
  */
4334
4642
  latest: EvalVerdict | null;
4335
4643
  note: string | null;
4336
- region: string;
4644
+ /**
4645
+ * The datacenter of a managed browser; "" for the default one.
4646
+ */
4647
+ region: ManagedRegion | '';
4337
4648
  validation_code: string | null;
4338
4649
  }>;
4339
4650
  };
@@ -4668,10 +4979,14 @@ export type RunScriptData = {
4668
4979
  mime?: string;
4669
4980
  };
4670
4981
  };
4982
+ /**
4983
+ * The profile to use for a `loggedIn` script on a cloud browser. When you do not give it, the script uses your Auth session cookies that are in no profile.
4984
+ */
4985
+ profile_id?: string;
4671
4986
  /**
4672
4987
  * The datacenter region of the managed browser. Select the region nearest to the site. If Reduck does not know the region, it refuses the request and gives the regions that it knows.
4673
4988
  */
4674
- region?: string;
4989
+ region?: 'eu-central-1' | 'us-east-1' | 'us-west-2' | 'ap-southeast-1';
4675
4990
  /**
4676
4991
  * The version to run. If you do not give it, the current version runs.
4677
4992
  */
@@ -5410,7 +5725,7 @@ export type PromoteScriptVersionErrors = {
5410
5725
  * Unprocessable content
5411
5726
  */
5412
5727
  422: ErrorResponse & {
5413
- code?: 'unprocessable_content' | 'noncompliant' | 'type_errors' | 'eval_args_invalid' | 'evals_failing';
5728
+ code?: 'unprocessable_content' | 'whoami_format' | 'noncompliant' | 'type_errors' | 'eval_args_invalid' | 'evals_failing';
5414
5729
  status?: 422;
5415
5730
  };
5416
5731
  /**