@vibexp/api-client 0.97.0 → 0.99.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.
@@ -6291,7 +6291,13 @@ export type AdminInstanceEmailSettings = {
6291
6291
  * only `has_credential` and, on an upsert's `after`, a `secret` marker
6292
6292
  * saying whether the credential was `changed` or `unchanged`; the `search`
6293
6293
  * and `ai_summary` snapshots are the settings' values, which hold no
6294
- * credential.
6294
+ * credential. For `auth_providers` each entry is one provider, reporting
6295
+ * only `has_client_secret` and, on an upsert's `after`, a `client_secret`
6296
+ * marker (`changed` or `unchanged`); `auth_allowlist`, `instance_admins`
6297
+ * and `auth_setup` snapshots hold no credential (the setup token and its
6298
+ * hash are never recorded). A snapshot of any of these four settings
6299
+ * carries `source: cli` when the change was made by the `vibexp admin auth`
6300
+ * commands rather than through this API.
6295
6301
  *
6296
6302
  */
6297
6303
  export type AdminInstanceSettingsAuditEntry = {
@@ -6302,7 +6308,7 @@ export type AdminInstanceSettingsAuditEntry = {
6302
6308
  /**
6303
6309
  * The instance setting the entry describes.
6304
6310
  */
6305
- setting: 'email_provider' | 'search' | 'ai_summary';
6311
+ setting: 'email_provider' | 'search' | 'ai_summary' | 'auth_providers' | 'auth_allowlist' | 'instance_admins' | 'auth_setup';
6306
6312
  /**
6307
6313
  * `upsert` (created or replaced by an admin), `delete` (removed by an
6308
6314
  * admin) or `import` (the boot-time import from config.yaml, which has no
@@ -6431,18 +6437,22 @@ export type AdminInstanceSearchSettings = {
6431
6437
  updated_by_name: string | null;
6432
6438
  /**
6433
6439
  * The stored row's optimistic-lock version; null when nothing is stored.
6434
- * Send it back as `expected_version` to reject a save that would
6435
- * overwrite someone else's change.
6440
+ * Send it back as `expected_version` (`0` when it is null) to reject a
6441
+ * save that would overwrite someone else's change.
6436
6442
  *
6437
6443
  */
6438
6444
  version: number | null;
6439
6445
  };
6440
6446
  /**
6441
6447
  * A whole replacement of the instance search ranking defaults. Every value is
6442
- * required. `expected_version` is optional: when present, the save is
6443
- * rejected with 409 unless it equals the stored version (and when nothing is
6444
- * stored, any `expected_version` other than null is a conflict). Omit it for
6445
- * last-write-wins.
6448
+ * required. `expected_version` is optional and makes the save a
6449
+ * compare-and-set:
6450
+ *
6451
+ * - omitted or null: last-write-wins, never a conflict.
6452
+ * - `0`: nothing may be stored yet; the save is rejected with 409 when a row
6453
+ * is stored. Send it when the `version` last read was null.
6454
+ * - a positive value: the save is rejected with 409 unless it equals the
6455
+ * stored `version`, and also when nothing is stored.
6446
6456
  *
6447
6457
  */
6448
6458
  export type AdminInstanceSearchSettingsUpdate = {
@@ -6453,7 +6463,10 @@ export type AdminInstanceSearchSettingsUpdate = {
6453
6463
  rank_half_life_days: number;
6454
6464
  rank_candidate_cap: number;
6455
6465
  /**
6456
- * The `version` the caller last read; omit or null for last-write-wins.
6466
+ * The `version` the caller last read. Send `0` when that `version` was
6467
+ * null, to save only while nothing is stored. Omit it or send null for
6468
+ * last-write-wins. A negative value matches nothing and is a 409.
6469
+ *
6457
6470
  */
6458
6471
  expected_version?: number | null;
6459
6472
  };
@@ -6536,18 +6549,22 @@ export type AdminInstanceAiSummarySettings = {
6536
6549
  updated_by_name: string | null;
6537
6550
  /**
6538
6551
  * The stored row's optimistic-lock version; null when nothing is stored.
6539
- * Send it back as `expected_version` to reject a save that would
6540
- * overwrite someone else's change.
6552
+ * Send it back as `expected_version` (`0` when it is null) to reject a
6553
+ * save that would overwrite someone else's change.
6541
6554
  *
6542
6555
  */
6543
6556
  version: number | null;
6544
6557
  };
6545
6558
  /**
6546
6559
  * A whole replacement of the instance AI summary settings. Every value is
6547
- * required. `expected_version` is optional: when present, the save is
6548
- * rejected with 409 unless it equals the stored version (and when nothing is
6549
- * stored, any `expected_version` other than null is a conflict). Omit it for
6550
- * last-write-wins.
6560
+ * required. `expected_version` is optional and makes the save a
6561
+ * compare-and-set:
6562
+ *
6563
+ * - omitted or null: last-write-wins, never a conflict.
6564
+ * - `0`: nothing may be stored yet; the save is rejected with 409 when a row
6565
+ * is stored. Send it when the `version` last read was null.
6566
+ * - a positive value: the save is rejected with 409 unless it equals the
6567
+ * stored `version`, and also when nothing is stored.
6551
6568
  *
6552
6569
  */
6553
6570
  export type AdminInstanceAiSummarySettingsUpdate = {
@@ -6559,10 +6576,371 @@ export type AdminInstanceAiSummarySettingsUpdate = {
6559
6576
  total_context_chars: number;
6560
6577
  request_timeout_ms: number;
6561
6578
  /**
6562
- * The `version` the caller last read; omit or null for last-write-wins.
6579
+ * The `version` the caller last read. Send `0` when that `version` was
6580
+ * null, to save only while nothing is stored. Omit it or send null for
6581
+ * last-write-wins. A negative value matches nothing and is a 409.
6582
+ *
6583
+ */
6584
+ expected_version?: number | null;
6585
+ };
6586
+ /**
6587
+ * The kind of sign-in identity provider. At most one `google` and one
6588
+ * `github` provider can be stored; any number of `oidc` providers.
6589
+ *
6590
+ */
6591
+ export type AdminAuthProviderType = 'google' | 'github' | 'oidc';
6592
+ /**
6593
+ * The provider's build outcome on the replica that served the request:
6594
+ * `healthy` (built and offered for sign-in), `unhealthy` (enabled but it
6595
+ * failed to build, so it is excluded from sign-in), `disabled` (not enabled,
6596
+ * so never built) or `unknown` (enabled, but this replica could not resolve
6597
+ * it for this request).
6598
+ *
6599
+ */
6600
+ export type AdminAuthProviderHealthStatus = 'healthy' | 'unhealthy' | 'disabled' | 'unknown';
6601
+ /**
6602
+ * The provider's health as seen by the replica that served the request.
6603
+ * Health is held in memory per replica and is not persisted.
6604
+ *
6605
+ */
6606
+ export type AdminAuthProviderHealth = {
6607
+ status: AdminAuthProviderHealthStatus;
6608
+ /**
6609
+ * Why an `unhealthy` provider failed to build; null otherwise.
6610
+ */
6611
+ last_error: string | null;
6612
+ /**
6613
+ * When the provider was last built (or tried); null for `disabled` and `unknown`.
6614
+ */
6615
+ checked_at: string | null;
6616
+ };
6617
+ /**
6618
+ * One sign-in identity provider. The client secret is write-only: it is never
6619
+ * returned, and `has_client_secret` reports only whether one is stored.
6620
+ *
6621
+ */
6622
+ export type AdminAuthProvider = {
6623
+ /**
6624
+ * Provider id.
6625
+ */
6626
+ id: string;
6627
+ type: AdminAuthProviderType;
6628
+ /**
6629
+ * The provider's url-safe name, used in the sign-in URL. Immutable.
6630
+ */
6631
+ slug: string;
6632
+ /**
6633
+ * The name shown on the sign-in button.
6634
+ */
6635
+ display_name: string;
6636
+ /**
6637
+ * Whether the provider is offered for sign-in.
6638
+ */
6639
+ enabled: boolean;
6640
+ /**
6641
+ * Position on the sign-in page, ascending.
6642
+ */
6643
+ sort_order: number;
6644
+ /**
6645
+ * The OAuth client id.
6646
+ */
6647
+ client_id: string;
6648
+ /**
6649
+ * Whether a client secret is stored.
6650
+ */
6651
+ has_client_secret: boolean;
6652
+ /**
6653
+ * The OIDC issuer URL; null for `google` and `github`.
6654
+ */
6655
+ issuer_url: string | null;
6656
+ /**
6657
+ * The redirect URI to register in the identity provider's console. It is
6658
+ * derived from the instance's own URL, is the same for every provider and
6659
+ * cannot be changed here.
6660
+ *
6661
+ */
6662
+ redirect_uri: string;
6663
+ health: AdminAuthProviderHealth;
6664
+ created_at: string;
6665
+ updated_at: string;
6666
+ /**
6667
+ * Who last saved the provider. Null for the boot-time config import, a
6668
+ * save made on a setup session, or once that user has been deleted.
6669
+ *
6670
+ */
6671
+ updated_by_user_id: string | null;
6672
+ };
6673
+ /**
6674
+ * Every stored sign-in identity provider, in sign-in page order, with the
6675
+ * `version` of the instance authentication settings. Send that `version` back
6676
+ * as `expected_version` when changing a provider.
6677
+ *
6678
+ */
6679
+ export type AdminAuthProviderList = {
6680
+ providers: Array<AdminAuthProvider>;
6681
+ /**
6682
+ * The shared version of the authentication settings. Every provider and
6683
+ * allowlist change increments it.
6684
+ *
6685
+ */
6686
+ version: number;
6687
+ };
6688
+ /**
6689
+ * A provider as stored by a create or an update, with the settings `version`
6690
+ * after the change. `provider.health` is resolved after the change, so the
6691
+ * response waits for the provider to be built (for `oidc` and `google`, one
6692
+ * bounded discovery request) and reports whether sign-in can use it.
6693
+ *
6694
+ */
6695
+ export type AdminAuthProviderSaved = {
6696
+ provider: AdminAuthProvider;
6697
+ /**
6698
+ * The shared authentication settings version after the change.
6699
+ */
6700
+ version: number;
6701
+ };
6702
+ /**
6703
+ * A new sign-in identity provider. `type` and `slug` cannot be changed later.
6704
+ * `expected_version` is optional: when present, the create is rejected with
6705
+ * 409 unless it equals the current authentication settings `version`.
6706
+ *
6707
+ */
6708
+ export type AdminAuthProviderCreate = {
6709
+ type: AdminAuthProviderType;
6710
+ /**
6711
+ * 1-63 lower-case letters, digits or hyphens, not starting with a hyphen.
6712
+ */
6713
+ slug: string;
6714
+ display_name: string;
6715
+ /**
6716
+ * Whether the provider is offered for sign-in. Defaults to true.
6717
+ */
6718
+ enabled?: boolean;
6719
+ /**
6720
+ * Position on the sign-in page, ascending. Defaults to 0.
6721
+ */
6722
+ sort_order?: number;
6723
+ client_id: string;
6724
+ /**
6725
+ * The OAuth client secret. Stored encrypted and never returned.
6726
+ */
6727
+ client_secret: string;
6728
+ /**
6729
+ * Required for `oidc` and rejected for `google` and `github`. An absolute
6730
+ * `https://` URL (`http://` only for localhost) with no query or fragment.
6731
+ *
6732
+ */
6733
+ issuer_url?: string;
6734
+ /**
6735
+ * The `version` the caller last read; omit or null to apply to the current version.
6736
+ */
6737
+ expected_version?: number | null;
6738
+ };
6739
+ /**
6740
+ * A whole replacement of a provider's editable fields; `type` and `slug` are
6741
+ * immutable and are rejected as unknown fields. `display_name`, `enabled`,
6742
+ * `sort_order`, `client_id` and `expected_version` are required.
6743
+ *
6744
+ * `client_secret` is write-only. Omit it to keep the stored secret; an empty
6745
+ * string is rejected. It cannot be omitted when `issuer_url` changes: the
6746
+ * stored secret is only ever kept for the issuer it was saved with.
6747
+ *
6748
+ * A change that disables the last enabled provider, or the provider the
6749
+ * calling admin signed in with, is rejected with 409 `lockout_risk` unless
6750
+ * `confirm_lockout_risk` is true.
6751
+ *
6752
+ */
6753
+ export type AdminAuthProviderUpdate = {
6754
+ display_name: string;
6755
+ enabled: boolean;
6756
+ sort_order: number;
6757
+ client_id: string;
6758
+ /**
6759
+ * A new client secret. Omit to keep the stored one. Never returned.
6760
+ */
6761
+ client_secret?: string;
6762
+ /**
6763
+ * Required for `oidc`, rejected for `google` and `github`.
6764
+ */
6765
+ issuer_url?: string;
6766
+ /**
6767
+ * The authentication settings `version` the caller last read.
6768
+ */
6769
+ expected_version: number;
6770
+ /**
6771
+ * Set to true to apply a change that was rejected with `lockout_risk`.
6772
+ */
6773
+ confirm_lockout_risk?: boolean;
6774
+ };
6775
+ /**
6776
+ * What to test. Nothing is stored and nothing is audited.
6777
+ *
6778
+ * - `id` alone tests the STORED provider with its stored secret.
6779
+ * - Without `id`, the body is an unsaved candidate: `type`, `client_id` and
6780
+ * `client_secret` are required (and `issuer_url` for `oidc`).
6781
+ * - `id` with other fields tests the stored provider with those fields
6782
+ * replaced, as an edit form does before saving. `type` cannot differ from
6783
+ * the stored one. When `client_secret` is omitted the stored secret is
6784
+ * used: it is never sent to a candidate-chosen endpoint (OIDC discovery
6785
+ * sends no secret, and the GitHub credential check goes only to GitHub).
6786
+ *
6787
+ */
6788
+ export type AdminAuthProviderTestRequest = {
6789
+ /**
6790
+ * A stored provider's id.
6791
+ */
6792
+ id?: string;
6793
+ type?: AdminAuthProviderType;
6794
+ client_id?: string;
6795
+ /**
6796
+ * The candidate client secret. Never returned.
6797
+ */
6798
+ client_secret?: string;
6799
+ issuer_url?: string;
6800
+ };
6801
+ /**
6802
+ * The outcome of a provider test: OIDC discovery for `oidc` and `google`, a
6803
+ * credential check against GitHub for `github`.
6804
+ *
6805
+ */
6806
+ export type AdminAuthProviderTestResult = {
6807
+ /**
6808
+ * Whether the provider could be built with the tested configuration.
6809
+ */
6810
+ is_valid: boolean;
6811
+ /**
6812
+ * Why the test failed; null when it passed.
6813
+ */
6814
+ message: string | null;
6815
+ };
6816
+ /**
6817
+ * The instance's sign-in access allowlist. A user may sign in when their
6818
+ * email's domain is in `domains` or the address is in `emails`. With both
6819
+ * lists empty, or nothing stored, access is open: every user may sign in
6820
+ * (`active` is false). Root instance admins are always exempt.
6821
+ *
6822
+ */
6823
+ export type AdminAuthAllowlist = {
6824
+ domains: Array<string>;
6825
+ emails: Array<string>;
6826
+ /**
6827
+ * Whether the allowlist restricts sign-in (at least one domain or email).
6828
+ */
6829
+ active: boolean;
6830
+ /**
6831
+ * The stored allowlist's own version; null when nothing is stored. Send
6832
+ * it back as `expected_version` (`0` when it is null) to reject a save
6833
+ * that would overwrite someone else's change.
6834
+ *
6835
+ */
6836
+ version: number | null;
6837
+ /**
6838
+ * When the allowlist was last saved; null when nothing is stored.
6839
+ */
6840
+ updated_at: string | null;
6841
+ /**
6842
+ * Who last saved the allowlist. Null when nothing is stored, for the
6843
+ * boot-time config import, a save made on a setup session, or once that
6844
+ * user has been deleted.
6845
+ *
6846
+ */
6847
+ updated_by_user_id: string | null;
6848
+ };
6849
+ /**
6850
+ * A whole replacement of the access allowlist. Both lists are required (send
6851
+ * `[]` for none). Entries are trimmed, lower-cased and de-duplicated; a domain
6852
+ * is a DNS name of at least two labels with no leading `@`. Storing two empty
6853
+ * lists means open access.
6854
+ *
6855
+ * `expected_version` is optional and makes the save a compare-and-set:
6856
+ *
6857
+ * - omitted or null: last-write-wins, never a conflict.
6858
+ * - `0`: no allowlist may be stored yet; the save is rejected with 409 when
6859
+ * one is. Send it when the `version` last read was null.
6860
+ * - a positive value: the save is rejected with 409 unless it equals the
6861
+ * stored allowlist's `version`, and also when nothing is stored.
6862
+ *
6863
+ */
6864
+ export type AdminAuthAllowlistUpdate = {
6865
+ domains: Array<string>;
6866
+ emails: Array<string>;
6867
+ /**
6868
+ * The `version` the caller last read. Send `0` when that `version` was
6869
+ * null, to save only while nothing is stored. Omit it or send null for
6870
+ * last-write-wins. A negative value matches nothing and is a 409.
6871
+ *
6563
6872
  */
6564
6873
  expected_version?: number | null;
6565
6874
  };
6875
+ /**
6876
+ * A candidate allowlist to preview. Both lists are required (send `[]` for none).
6877
+ */
6878
+ export type AdminAuthAllowlistPreviewRequest = {
6879
+ domains: Array<string>;
6880
+ emails: Array<string>;
6881
+ };
6882
+ /**
6883
+ * What replacing the allowlist with a candidate would do: the active
6884
+ * (non-suspended) users who would stop matching it. Root instance admins are
6885
+ * exempt and never counted. An open-access candidate affects nobody.
6886
+ *
6887
+ */
6888
+ export type AdminAuthAllowlistImpact = {
6889
+ /**
6890
+ * How many active users match neither list of the candidate.
6891
+ */
6892
+ count: number;
6893
+ /**
6894
+ * Up to 20 of their emails, in alphabetical order.
6895
+ */
6896
+ sample: Array<string>;
6897
+ /**
6898
+ * Whether `count` exceeds the number of emails in `sample`.
6899
+ */
6900
+ sample_truncated: boolean;
6901
+ };
6902
+ /**
6903
+ * One instance admin granted in the database.
6904
+ */
6905
+ export type AdminInstanceAdmin = {
6906
+ user_id: string;
6907
+ email: string;
6908
+ /**
6909
+ * The admin's display name, when set.
6910
+ */
6911
+ name: string | null;
6912
+ /**
6913
+ * The root admin who granted it; null once that user has been deleted.
6914
+ */
6915
+ granted_by_user_id: string | null;
6916
+ granted_at: string;
6917
+ };
6918
+ /**
6919
+ * The instance's admins. `root_admins` are the emails named in config.yaml's
6920
+ * `auth.instance_admins`: read-only here, they cannot be granted or revoked.
6921
+ * `admins` are the users granted in the database, oldest first.
6922
+ *
6923
+ */
6924
+ export type AdminInstanceAdminList = {
6925
+ /**
6926
+ * The root admins' normalized emails, sorted.
6927
+ */
6928
+ root_admins: Array<string>;
6929
+ admins: Array<AdminInstanceAdmin>;
6930
+ };
6931
+ /**
6932
+ * The existing user to make an instance admin, named by exactly one of
6933
+ * `user_id` or `email`.
6934
+ *
6935
+ */
6936
+ export type AdminInstanceAdminGrant = {
6937
+ user_id?: string;
6938
+ email?: string;
6939
+ };
6940
+ /**
6941
+ * Which authentication setting's audit log to read.
6942
+ */
6943
+ export type AdminAuthSettingsAuditSetting = 'auth_providers' | 'auth_allowlist' | 'instance_admins' | 'auth_setup';
6566
6944
  export type ProjectResponse = Project & {
6567
6945
  /**
6568
6946
  * Whether the project's git URL matches a repository accessible via the team's GitHub App installation
@@ -15564,6 +15942,448 @@ export type ListAdminAiSummarySettingsAuditResponses = {
15564
15942
  200: AdminInstanceSettingsAuditPage;
15565
15943
  };
15566
15944
  export type ListAdminAiSummarySettingsAuditResponse = ListAdminAiSummarySettingsAuditResponses[keyof ListAdminAiSummarySettingsAuditResponses];
15945
+ export type ListAdminAuthProvidersData = {
15946
+ body?: never;
15947
+ path?: never;
15948
+ query?: never;
15949
+ url: '/api/v1/admin/settings/auth/providers';
15950
+ };
15951
+ export type ListAdminAuthProvidersErrors = {
15952
+ /**
15953
+ * Not found — the caller is neither an instance admin nor on a setup session
15954
+ */
15955
+ 404: ErrorResponse;
15956
+ /**
15957
+ * Internal server error
15958
+ */
15959
+ 500: ErrorResponse;
15960
+ };
15961
+ export type ListAdminAuthProvidersError = ListAdminAuthProvidersErrors[keyof ListAdminAuthProvidersErrors];
15962
+ export type ListAdminAuthProvidersResponses = {
15963
+ /**
15964
+ * The stored providers and the settings version
15965
+ */
15966
+ 200: AdminAuthProviderList;
15967
+ };
15968
+ export type ListAdminAuthProvidersResponse = ListAdminAuthProvidersResponses[keyof ListAdminAuthProvidersResponses];
15969
+ export type CreateAdminAuthProviderData = {
15970
+ body: AdminAuthProviderCreate;
15971
+ path?: never;
15972
+ query?: never;
15973
+ url: '/api/v1/admin/settings/auth/providers';
15974
+ };
15975
+ export type CreateAdminAuthProviderErrors = {
15976
+ /**
15977
+ * Bad request — a field is invalid (`INSTANCE_SETTINGS_VALIDATION_FAILED`, with
15978
+ * `validation_errors` naming it), or the body is malformed or carries an
15979
+ * unknown field
15980
+ *
15981
+ */
15982
+ 400: ErrorResponse;
15983
+ /**
15984
+ * Not found — the caller is neither an instance admin nor on a setup session
15985
+ */
15986
+ 404: ErrorResponse;
15987
+ /**
15988
+ * Conflict — `expected_version` does not match the current version
15989
+ * (`INSTANCE_SETTINGS_VERSION_CONFLICT`), or the slug is taken or a second
15990
+ * `google`/`github` provider was sent (`INSTANCE_AUTH_PROVIDER_CONFLICT`);
15991
+ * nothing was changed
15992
+ *
15993
+ */
15994
+ 409: ErrorResponse;
15995
+ /**
15996
+ * Internal server error
15997
+ */
15998
+ 500: ErrorResponse;
15999
+ };
16000
+ export type CreateAdminAuthProviderError = CreateAdminAuthProviderErrors[keyof CreateAdminAuthProviderErrors];
16001
+ export type CreateAdminAuthProviderResponses = {
16002
+ /**
16003
+ * The stored provider and the settings version after the change
16004
+ */
16005
+ 201: AdminAuthProviderSaved;
16006
+ };
16007
+ export type CreateAdminAuthProviderResponse = CreateAdminAuthProviderResponses[keyof CreateAdminAuthProviderResponses];
16008
+ export type TestAdminAuthProviderData = {
16009
+ body: AdminAuthProviderTestRequest;
16010
+ path?: never;
16011
+ query?: never;
16012
+ url: '/api/v1/admin/settings/auth/providers/test';
16013
+ };
16014
+ export type TestAdminAuthProviderErrors = {
16015
+ /**
16016
+ * Bad request — the candidate is invalid (`INSTANCE_SETTINGS_VALIDATION_FAILED`),
16017
+ * or the body is malformed or carries an unknown field
16018
+ *
16019
+ */
16020
+ 400: ErrorResponse;
16021
+ /**
16022
+ * Not found — no provider has that `id`, or the caller is neither an instance admin nor on a setup session
16023
+ */
16024
+ 404: ErrorResponse;
16025
+ /**
16026
+ * Internal server error
16027
+ */
16028
+ 500: ErrorResponse;
16029
+ };
16030
+ export type TestAdminAuthProviderError = TestAdminAuthProviderErrors[keyof TestAdminAuthProviderErrors];
16031
+ export type TestAdminAuthProviderResponses = {
16032
+ /**
16033
+ * The outcome of the test
16034
+ */
16035
+ 200: AdminAuthProviderTestResult;
16036
+ };
16037
+ export type TestAdminAuthProviderResponse = TestAdminAuthProviderResponses[keyof TestAdminAuthProviderResponses];
16038
+ export type DeleteAdminAuthProviderData = {
16039
+ body?: never;
16040
+ path: {
16041
+ /**
16042
+ * Provider id (UUID)
16043
+ */
16044
+ id: string;
16045
+ };
16046
+ query?: {
16047
+ /**
16048
+ * The authentication settings `version` the caller last read; omit to apply to the current version.
16049
+ */
16050
+ expected_version?: number;
16051
+ /**
16052
+ * Set to true to apply a delete that was rejected with `lockout_risk`.
16053
+ */
16054
+ confirm_lockout_risk?: boolean;
16055
+ };
16056
+ url: '/api/v1/admin/settings/auth/providers/{id}';
16057
+ };
16058
+ export type DeleteAdminAuthProviderErrors = {
16059
+ /**
16060
+ * Bad request — malformed provider id or query parameter
16061
+ */
16062
+ 400: ErrorResponse;
16063
+ /**
16064
+ * Not found — no provider has that id, or the caller is neither an instance admin nor on a setup session
16065
+ */
16066
+ 404: ErrorResponse;
16067
+ /**
16068
+ * Conflict — `expected_version` does not match the current version
16069
+ * (`INSTANCE_SETTINGS_VERSION_CONFLICT`), or the delete risks locking sign-in
16070
+ * out (`lockout_risk`); nothing was changed
16071
+ *
16072
+ */
16073
+ 409: ErrorResponse;
16074
+ /**
16075
+ * Internal server error
16076
+ */
16077
+ 500: ErrorResponse;
16078
+ };
16079
+ export type DeleteAdminAuthProviderError = DeleteAdminAuthProviderErrors[keyof DeleteAdminAuthProviderErrors];
16080
+ export type DeleteAdminAuthProviderResponses = {
16081
+ /**
16082
+ * The provider was deleted
16083
+ */
16084
+ 204: void;
16085
+ };
16086
+ export type DeleteAdminAuthProviderResponse = DeleteAdminAuthProviderResponses[keyof DeleteAdminAuthProviderResponses];
16087
+ export type UpdateAdminAuthProviderData = {
16088
+ body: AdminAuthProviderUpdate;
16089
+ path: {
16090
+ /**
16091
+ * Provider id (UUID)
16092
+ */
16093
+ id: string;
16094
+ };
16095
+ query?: never;
16096
+ url: '/api/v1/admin/settings/auth/providers/{id}';
16097
+ };
16098
+ export type UpdateAdminAuthProviderErrors = {
16099
+ /**
16100
+ * Bad request — a field is invalid (`INSTANCE_SETTINGS_VALIDATION_FAILED`, with
16101
+ * `validation_errors` naming it), the provider id is malformed, or the body is
16102
+ * malformed, omits or nulls a required field, or carries an unknown field
16103
+ *
16104
+ */
16105
+ 400: ErrorResponse;
16106
+ /**
16107
+ * Not found — no provider has that id, or the caller is neither an instance admin nor on a setup session
16108
+ */
16109
+ 404: ErrorResponse;
16110
+ /**
16111
+ * Conflict — `expected_version` does not match the current version
16112
+ * (`INSTANCE_SETTINGS_VERSION_CONFLICT`), or the change risks locking sign-in
16113
+ * out (`lockout_risk`); nothing was changed
16114
+ *
16115
+ */
16116
+ 409: ErrorResponse;
16117
+ /**
16118
+ * Internal server error
16119
+ */
16120
+ 500: ErrorResponse;
16121
+ };
16122
+ export type UpdateAdminAuthProviderError = UpdateAdminAuthProviderErrors[keyof UpdateAdminAuthProviderErrors];
16123
+ export type UpdateAdminAuthProviderResponses = {
16124
+ /**
16125
+ * The stored provider and the settings version after the change
16126
+ */
16127
+ 200: AdminAuthProviderSaved;
16128
+ };
16129
+ export type UpdateAdminAuthProviderResponse = UpdateAdminAuthProviderResponses[keyof UpdateAdminAuthProviderResponses];
16130
+ export type ResetAdminAuthAllowlistData = {
16131
+ body?: never;
16132
+ path?: never;
16133
+ query?: never;
16134
+ url: '/api/v1/admin/settings/auth/allowlist';
16135
+ };
16136
+ export type ResetAdminAuthAllowlistErrors = {
16137
+ /**
16138
+ * Not found — the caller is neither an instance admin nor on a setup session
16139
+ */
16140
+ 404: ErrorResponse;
16141
+ /**
16142
+ * Internal server error
16143
+ */
16144
+ 500: ErrorResponse;
16145
+ };
16146
+ export type ResetAdminAuthAllowlistError = ResetAdminAuthAllowlistErrors[keyof ResetAdminAuthAllowlistErrors];
16147
+ export type ResetAdminAuthAllowlistResponses = {
16148
+ /**
16149
+ * Access is now open
16150
+ */
16151
+ 204: void;
16152
+ };
16153
+ export type ResetAdminAuthAllowlistResponse = ResetAdminAuthAllowlistResponses[keyof ResetAdminAuthAllowlistResponses];
16154
+ export type GetAdminAuthAllowlistData = {
16155
+ body?: never;
16156
+ path?: never;
16157
+ query?: never;
16158
+ url: '/api/v1/admin/settings/auth/allowlist';
16159
+ };
16160
+ export type GetAdminAuthAllowlistErrors = {
16161
+ /**
16162
+ * Not found — the caller is neither an instance admin nor on a setup session
16163
+ */
16164
+ 404: ErrorResponse;
16165
+ /**
16166
+ * Internal server error
16167
+ */
16168
+ 500: ErrorResponse;
16169
+ };
16170
+ export type GetAdminAuthAllowlistError = GetAdminAuthAllowlistErrors[keyof GetAdminAuthAllowlistErrors];
16171
+ export type GetAdminAuthAllowlistResponses = {
16172
+ /**
16173
+ * The access allowlist
16174
+ */
16175
+ 200: AdminAuthAllowlist;
16176
+ };
16177
+ export type GetAdminAuthAllowlistResponse = GetAdminAuthAllowlistResponses[keyof GetAdminAuthAllowlistResponses];
16178
+ export type UpdateAdminAuthAllowlistData = {
16179
+ body: AdminAuthAllowlistUpdate;
16180
+ path?: never;
16181
+ query?: never;
16182
+ url: '/api/v1/admin/settings/auth/allowlist';
16183
+ };
16184
+ export type UpdateAdminAuthAllowlistErrors = {
16185
+ /**
16186
+ * Bad request — an entry is invalid (`INSTANCE_SETTINGS_VALIDATION_FAILED`, with
16187
+ * `validation_errors` naming the list), or the body is malformed, omits or
16188
+ * nulls a list, or carries an unknown field
16189
+ *
16190
+ */
16191
+ 400: ErrorResponse;
16192
+ /**
16193
+ * Not found — the caller is neither an instance admin nor on a setup session
16194
+ */
16195
+ 404: ErrorResponse;
16196
+ /**
16197
+ * Conflict — `expected_version` does not match the stored version (`INSTANCE_SETTINGS_VERSION_CONFLICT`); nothing was changed
16198
+ */
16199
+ 409: ErrorResponse;
16200
+ /**
16201
+ * Internal server error
16202
+ */
16203
+ 500: ErrorResponse;
16204
+ };
16205
+ export type UpdateAdminAuthAllowlistError = UpdateAdminAuthAllowlistErrors[keyof UpdateAdminAuthAllowlistErrors];
16206
+ export type UpdateAdminAuthAllowlistResponses = {
16207
+ /**
16208
+ * The stored allowlist
16209
+ */
16210
+ 200: AdminAuthAllowlist;
16211
+ };
16212
+ export type UpdateAdminAuthAllowlistResponse = UpdateAdminAuthAllowlistResponses[keyof UpdateAdminAuthAllowlistResponses];
16213
+ export type PreviewAdminAuthAllowlistData = {
16214
+ body: AdminAuthAllowlistPreviewRequest;
16215
+ path?: never;
16216
+ query?: never;
16217
+ url: '/api/v1/admin/settings/auth/allowlist/preview';
16218
+ };
16219
+ export type PreviewAdminAuthAllowlistErrors = {
16220
+ /**
16221
+ * Bad request — an entry is invalid (`INSTANCE_SETTINGS_VALIDATION_FAILED`), or
16222
+ * the body is malformed, omits or nulls a list, or carries an unknown field
16223
+ *
16224
+ */
16225
+ 400: ErrorResponse;
16226
+ /**
16227
+ * Not found — the caller is neither an instance admin nor on a setup session
16228
+ */
16229
+ 404: ErrorResponse;
16230
+ /**
16231
+ * Internal server error
16232
+ */
16233
+ 500: ErrorResponse;
16234
+ };
16235
+ export type PreviewAdminAuthAllowlistError = PreviewAdminAuthAllowlistErrors[keyof PreviewAdminAuthAllowlistErrors];
16236
+ export type PreviewAdminAuthAllowlistResponses = {
16237
+ /**
16238
+ * The impact of the candidate
16239
+ */
16240
+ 200: AdminAuthAllowlistImpact;
16241
+ };
16242
+ export type PreviewAdminAuthAllowlistResponse = PreviewAdminAuthAllowlistResponses[keyof PreviewAdminAuthAllowlistResponses];
16243
+ export type ListAdminInstanceAdminsData = {
16244
+ body?: never;
16245
+ path?: never;
16246
+ query?: never;
16247
+ url: '/api/v1/admin/settings/auth/admins';
16248
+ };
16249
+ export type ListAdminInstanceAdminsErrors = {
16250
+ /**
16251
+ * Not found — the caller is not an instance admin
16252
+ */
16253
+ 404: ErrorResponse;
16254
+ /**
16255
+ * Internal server error
16256
+ */
16257
+ 500: ErrorResponse;
16258
+ };
16259
+ export type ListAdminInstanceAdminsError = ListAdminInstanceAdminsErrors[keyof ListAdminInstanceAdminsErrors];
16260
+ export type ListAdminInstanceAdminsResponses = {
16261
+ /**
16262
+ * The instance admins
16263
+ */
16264
+ 200: AdminInstanceAdminList;
16265
+ };
16266
+ export type ListAdminInstanceAdminsResponse = ListAdminInstanceAdminsResponses[keyof ListAdminInstanceAdminsResponses];
16267
+ export type GrantAdminInstanceAdminData = {
16268
+ body: AdminInstanceAdminGrant;
16269
+ path?: never;
16270
+ query?: never;
16271
+ url: '/api/v1/admin/settings/auth/admins';
16272
+ };
16273
+ export type GrantAdminInstanceAdminErrors = {
16274
+ /**
16275
+ * Bad request — the body names neither or both of `user_id` and `email`, the
16276
+ * user is suspended, or the body is malformed or carries an unknown field
16277
+ *
16278
+ */
16279
+ 400: ErrorResponse;
16280
+ /**
16281
+ * Forbidden — the caller is an instance admin but not a root admin
16282
+ */
16283
+ 403: ErrorResponse;
16284
+ /**
16285
+ * Not found — no such user, or the caller is not an instance admin
16286
+ */
16287
+ 404: ErrorResponse;
16288
+ /**
16289
+ * Conflict — the user is a root admin, whose access comes from config.yaml
16290
+ */
16291
+ 409: ErrorResponse;
16292
+ /**
16293
+ * Internal server error
16294
+ */
16295
+ 500: ErrorResponse;
16296
+ };
16297
+ export type GrantAdminInstanceAdminError = GrantAdminInstanceAdminErrors[keyof GrantAdminInstanceAdminErrors];
16298
+ export type GrantAdminInstanceAdminResponses = {
16299
+ /**
16300
+ * The grant
16301
+ */
16302
+ 200: AdminInstanceAdmin;
16303
+ };
16304
+ export type GrantAdminInstanceAdminResponse = GrantAdminInstanceAdminResponses[keyof GrantAdminInstanceAdminResponses];
16305
+ export type RevokeAdminInstanceAdminData = {
16306
+ body?: never;
16307
+ path: {
16308
+ /**
16309
+ * The granted admin's user id (UUID)
16310
+ */
16311
+ user_id: string;
16312
+ };
16313
+ query?: never;
16314
+ url: '/api/v1/admin/settings/auth/admins/{user_id}';
16315
+ };
16316
+ export type RevokeAdminInstanceAdminErrors = {
16317
+ /**
16318
+ * Bad request — malformed user id
16319
+ */
16320
+ 400: ErrorResponse;
16321
+ /**
16322
+ * Forbidden — the caller is an instance admin but not a root admin
16323
+ */
16324
+ 403: ErrorResponse;
16325
+ /**
16326
+ * Not found — the user holds no grant, or the caller is not an instance admin
16327
+ */
16328
+ 404: ErrorResponse;
16329
+ /**
16330
+ * Conflict — the user is a root admin, whose access comes from config.yaml
16331
+ */
16332
+ 409: ErrorResponse;
16333
+ /**
16334
+ * Internal server error
16335
+ */
16336
+ 500: ErrorResponse;
16337
+ };
16338
+ export type RevokeAdminInstanceAdminError = RevokeAdminInstanceAdminErrors[keyof RevokeAdminInstanceAdminErrors];
16339
+ export type RevokeAdminInstanceAdminResponses = {
16340
+ /**
16341
+ * The grant was revoked
16342
+ */
16343
+ 204: void;
16344
+ };
16345
+ export type RevokeAdminInstanceAdminResponse = RevokeAdminInstanceAdminResponses[keyof RevokeAdminInstanceAdminResponses];
16346
+ export type ListAdminAuthSettingsAuditData = {
16347
+ body?: never;
16348
+ path?: never;
16349
+ query: {
16350
+ /**
16351
+ * Which authentication setting's audit log to read.
16352
+ */
16353
+ setting: AdminAuthSettingsAuditSetting;
16354
+ /**
16355
+ * Opaque cursor from a previous page's `next_cursor`.
16356
+ */
16357
+ cursor?: string;
16358
+ /**
16359
+ * Page size.
16360
+ */
16361
+ limit?: number;
16362
+ };
16363
+ url: '/api/v1/admin/settings/auth/audit';
16364
+ };
16365
+ export type ListAdminAuthSettingsAuditErrors = {
16366
+ /**
16367
+ * Bad request — missing or unknown `setting`, malformed cursor, or `limit` out of range
16368
+ */
16369
+ 400: ErrorResponse;
16370
+ /**
16371
+ * Not found — the caller is not an instance admin
16372
+ */
16373
+ 404: ErrorResponse;
16374
+ /**
16375
+ * Internal server error
16376
+ */
16377
+ 500: ErrorResponse;
16378
+ };
16379
+ export type ListAdminAuthSettingsAuditError = ListAdminAuthSettingsAuditErrors[keyof ListAdminAuthSettingsAuditErrors];
16380
+ export type ListAdminAuthSettingsAuditResponses = {
16381
+ /**
16382
+ * One page of audit entries, newest first
16383
+ */
16384
+ 200: AdminInstanceSettingsAuditPage;
16385
+ };
16386
+ export type ListAdminAuthSettingsAuditResponse = ListAdminAuthSettingsAuditResponses[keyof ListAdminAuthSettingsAuditResponses];
15567
16387
  export type ListCommentsData = {
15568
16388
  body?: never;
15569
16389
  path: {