@cubist-labs/cubesigner-sdk 0.4.276 → 0.4.280

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.
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "url": "git+https://github.com/cubist-labs/CubeSigner-TypeScript-SDK.git",
6
6
  "directory": "packages/sdk"
7
7
  },
8
- "version": "0.4.276",
8
+ "version": "0.4.280",
9
9
  "type": "module",
10
10
  "description": "CubeSigner TypeScript SDK",
11
11
  "license": "MIT OR Apache-2.0",
package/src/acl.ts CHANGED
@@ -7,7 +7,9 @@ export type Ace<TAction, TCtx> = {
7
7
  subjects: AceAttribute<string>;
8
8
  /** The actions being performed */
9
9
  actions: AceAttribute<TAction>;
10
+ /** The effect of this access control entry. */
11
+ effect?: "Allow" | "Deny";
10
12
  } & TCtx;
11
13
 
12
14
  /** An attribute of an access control entry. */
13
- export type AceAttribute<T> = "*" | T | T[];
15
+ export type AceAttribute<T> = "*" | T | T[] | { except: T[] };
@@ -224,6 +224,55 @@ export type SessionSelector =
224
224
  role?: string;
225
225
  };
226
226
 
227
+ /**
228
+ * Options for listing the users in an org.
229
+ */
230
+ export interface ListUsersOptions {
231
+ /** Pagination options. Defaults to fetching the entire result set. */
232
+ page?: PageOpts;
233
+
234
+ /**
235
+ * If defined, all returned users will contain this string in their name or email.
236
+ */
237
+ searchQuery?: string;
238
+
239
+ /**
240
+ * If defined, only users with one of these roles in the org are returned,
241
+ * grouped by role in descending role order (owners first, aliens last).
242
+ */
243
+ membership?: MemberRole[];
244
+ }
245
+
246
+ /**
247
+ * Options for listing the pending invitations in an org.
248
+ */
249
+ export interface ListInvitationsOptions {
250
+ /** Pagination options. Defaults to fetching the entire result set. */
251
+ page?: PageOpts;
252
+
253
+ /**
254
+ * If defined, only invitations for one of these roles are returned,
255
+ * grouped by role in descending role order (owners first, aliens last).
256
+ */
257
+ membership?: MemberRole[];
258
+ }
259
+
260
+ /**
261
+ * Distinguishes the `ListUsersOptions` argument of {@link ApiClient.orgUsersList}
262
+ * from its deprecated leading `PageOpts` argument. This works because the two types
263
+ * have disjoint keys: any of the `PageOpts` keys being present identifies a `PageOpts`,
264
+ * so everything else is a `ListUsersOptions`. An argument with none of those keys
265
+ * (e.g. `{}`) is reported as `ListUsersOptions`, which is harmless: neither
266
+ * interpretation restricts the result set.
267
+ *
268
+ * @param arg The first argument passed to `orgUsersList`.
269
+ * @returns Whether `arg` is a `ListUsersOptions` (as opposed to `PageOpts`).
270
+ */
271
+ function isListUsersOptions(arg: ListUsersOptions | PageOpts | undefined): arg is ListUsersOptions {
272
+ if (arg === undefined) return false;
273
+ return !("size" in arg || "start" in arg || "all" in arg);
274
+ }
275
+
227
276
  /**
228
277
  * An extension of BaseClient that adds specialized methods for api endpoints
229
278
  */
@@ -391,23 +440,19 @@ export class ApiClient extends BaseClient {
391
440
  * that must be answered either by calling {@link TotpChallenge.answer} (or
392
441
  * {@link ApiClient.userTotpResetComplete}).
393
442
  *
394
- * @param issuer Optional issuer; defaults to "Cubist"
443
+ * @param request Optional request parameters (or just an issuer string); defaults to using "Cubist" as the issuer.
395
444
  * @param mfaReceipt MFA receipt(s) to include in HTTP headers
396
445
  * @returns A TOTP challenge that must be answered
397
446
  */
398
447
  async userTotpResetInit(
399
- issuer?: string,
448
+ request?: string | schemas["TotpResetRequest"],
400
449
  mfaReceipt?: MfaReceipts,
401
450
  ): Promise<CubeSignerResponse<TotpChallenge>> {
402
451
  const o = op("/v0/org/{org_id}/user/me/totp", "post");
403
452
  const resetTotpFn = async (headers?: HeadersInit) => {
404
453
  const data = await this.exec(o, {
405
454
  headers,
406
- body: issuer
407
- ? {
408
- issuer,
409
- }
410
- : null,
455
+ body: typeof request === "string" ? { issuer: request } : request,
411
456
  });
412
457
  return mapResponse(data, (totpInfo) => new TotpChallenge(this, totpInfo));
413
458
  };
@@ -422,10 +467,14 @@ export class ApiClient extends BaseClient {
422
467
  *
423
468
  * @param totpId The ID of the TOTP challenge
424
469
  * @param code The TOTP code that should verify against the TOTP configuration from the challenge.
470
+ * @returns TOTP registration response
425
471
  */
426
- async userTotpResetComplete(totpId: string, code: string): Promise<void> {
472
+ async userTotpResetComplete(
473
+ totpId: string,
474
+ code: string,
475
+ ): Promise<schemas["TotpRegisterResponse"]> {
427
476
  const o = op("/v0/org/{org_id}/user/me/totp", "patch");
428
- await this.exec(o, {
477
+ return await this.exec(o, {
429
478
  body: { totp_id: totpId, code },
430
479
  });
431
480
  }
@@ -494,12 +543,12 @@ export class ApiClient extends BaseClient {
494
543
  *
495
544
  * @param challengeId The ID of the challenge returned by the remote end.
496
545
  * @param credential The answer to the challenge.
497
- * @returns An empty response
546
+ * @returns A FIDO registration response
498
547
  */
499
548
  async userFidoRegisterComplete(
500
549
  challengeId: string,
501
550
  credential: PublicKeyCredential,
502
- ): Promise<Empty> {
551
+ ): Promise<schemas["FidoRegisterResponse"]> {
503
552
  const o = op("/v0/org/{org_id}/user/me/fido", "patch");
504
553
 
505
554
  return this.exec(o, {
@@ -785,17 +834,18 @@ export class ApiClient extends BaseClient {
785
834
  * List pending invitations in the org, i.e., those that have neither been
786
835
  * accepted nor canceled, and have not expired.
787
836
  *
788
- * @param page Pagination options. Defaults to fetching the entire result set.
837
+ * @param opts Pagination and filtering options. Defaults to fetching the entire result set.
789
838
  * @returns Paginator for iterating over the pending invitations in the org.
790
839
  */
791
840
  orgInvitationsList(
792
- page?: PageOpts,
841
+ opts?: ListInvitationsOptions,
793
842
  ): Paginator<PaginatedListInvitationsResponse, InvitationInfo[]> {
794
843
  const o = op("/v0/org/{org_id}/invitations", "get");
795
844
 
796
845
  return Paginator.items(
797
- page ?? Page.default(),
798
- (pageQuery) => this.exec(o, { params: { query: { ...pageQuery } } }),
846
+ opts?.page ?? Page.default(),
847
+ (pageQuery) =>
848
+ this.exec(o, { params: { query: { membership: opts?.membership, ...pageQuery } } }),
799
849
  (r) => r.invitations,
800
850
  (r) => r.last_evaluated_key,
801
851
  );
@@ -840,19 +890,44 @@ export class ApiClient extends BaseClient {
840
890
  /**
841
891
  * List users in the org.
842
892
  *
893
+ * @overload
894
+ * @param opts Pagination and filtering options. Defaults to fetching the entire result set.
895
+ * @returns Paginator for iterating over the users in the org.
896
+ */
897
+ orgUsersList(opts?: ListUsersOptions): Paginator<GetUsersInOrgResponse, UserInOrgInfo[]>;
898
+ /**
899
+ * List users in the org.
900
+ *
901
+ * @overload
843
902
  * @param page Pagination options. Defaults to fetching the entire result set.
844
- * @param searchQuery Optional query string. If defined, all returned users will contain this string in their name or email.
903
+ * @param searchQuery Query string. If defined, all returned users will contain this string in their name or email.
845
904
  * @returns Paginator for iterating over the users in the org.
905
+ * @deprecated Use the `ListUsersOptions` parameter overload instead.
846
906
  */
847
907
  orgUsersList(
848
908
  page?: PageOpts,
849
909
  searchQuery?: string,
910
+ ): Paginator<GetUsersInOrgResponse, UserInOrgInfo[]>;
911
+ /**
912
+ * List users in the org.
913
+ *
914
+ * @param opts Either pagination and filtering options, or (deprecated) just pagination options.
915
+ * @param searchQuery Deprecated search query string; only used with the deprecated overload.
916
+ * @returns Paginator for iterating over the users in the org.
917
+ */
918
+ orgUsersList(
919
+ opts?: ListUsersOptions | PageOpts,
920
+ searchQuery?: string,
850
921
  ): Paginator<GetUsersInOrgResponse, UserInOrgInfo[]> {
922
+ const luOpts: ListUsersOptions = isListUsersOptions(opts) ? opts : { page: opts, searchQuery };
851
923
  const o = op("/v0/org/{org_id}/users", "get");
852
924
 
853
925
  return Paginator.items(
854
- page ?? Page.default(),
855
- (pageQuery) => this.exec(o, { params: { query: { q: searchQuery, ...pageQuery } } }),
926
+ luOpts.page ?? Page.default(),
927
+ (pageQuery) =>
928
+ this.exec(o, {
929
+ params: { query: { q: luOpts.searchQuery, membership: luOpts.membership, ...pageQuery } },
930
+ }),
856
931
  (r) => r.users.map(ApiClient.#processUserInOrgInfo),
857
932
  (r) => r.last_evaluated_key,
858
933
  );
@@ -2232,6 +2307,9 @@ export class ApiClient extends BaseClient {
2232
2307
  /**
2233
2308
  * List pending MFA requests accessible to the current user.
2234
2309
  *
2310
+ * Note that legacy MFA requests are not paginated: every accessible one is
2311
+ * returned in the first page, on top of the requested page limit.
2312
+ *
2235
2313
  * @param page Pagination options. Defaults to fetching the entire result set.
2236
2314
  * @returns Paginator for iterating over the MFA requests.
2237
2315
  */
package/src/mfa.ts CHANGED
@@ -260,13 +260,14 @@ export class TotpChallenge {
260
260
  * Answer the challenge with the code that corresponds to `this.totpUrl`.
261
261
  *
262
262
  * @param code 6-digit code that corresponds to `this.totpUrl`.
263
+ * @returns TOTP registration response
263
264
  */
264
265
  async answer(code: string) {
265
266
  if (!/^\d{1,6}$/.test(code)) {
266
267
  throw new Error(`Invalid TOTP code: ${code}; it must be a 6-digit string`);
267
268
  }
268
269
 
269
- await this.#api.userTotpResetComplete(this.id, code);
270
+ return await this.#api.userTotpResetComplete(this.id, code);
270
271
  }
271
272
  }
272
273
 
@@ -294,10 +295,12 @@ export class AddFidoChallenge {
294
295
  /**
295
296
  * Answers this challenge by using the `CredentialsContainer` API to create a credential
296
297
  * based on the the public key credential creation options from this challenge.
298
+ *
299
+ * @returns FIDO registration response
297
300
  */
298
301
  async createCredentialAndAnswer() {
299
302
  const cred = await navigator.credentials.create({ publicKey: this.options });
300
- await this.answer(cred);
303
+ return await this.answer(cred);
301
304
  }
302
305
 
303
306
  /**
@@ -310,10 +313,11 @@ export class AddFidoChallenge {
310
313
  *
311
314
  * @param cred Credential created by calling the `CredentialContainer`'s `create` method
312
315
  * based on the public key creation options from this challenge.
316
+ * @returns FIDO registration response
313
317
  */
314
318
  async answer(cred: any) {
315
319
  const answer = credentialToJSON(cred);
316
- await this.#api.userFidoRegisterComplete(this.challengeId, answer);
320
+ return await this.#api.userFidoRegisterComplete(this.challengeId, answer);
317
321
  }
318
322
  }
319
323
 
package/src/org.ts CHANGED
@@ -32,6 +32,8 @@ import type {
32
32
  AuditLogRequest,
33
33
  MfaReceipts,
34
34
  InvitationInfo,
35
+ ListUsersOptions,
36
+ ListInvitationsOptions,
35
37
  } from "./index.ts";
36
38
  import { Contact } from "./contact.ts";
37
39
  import { C2FFunction, Key, MfaRequest, Role } from "./index.ts";
@@ -541,10 +543,11 @@ export class Org {
541
543
  * List all pending invitations in the organization, i.e., those that have
542
544
  * neither been accepted nor canceled, and have not expired.
543
545
  *
546
+ * @param opts Pagination and filtering options. Defaults to fetching the entire result set.
544
547
  * @returns The list of pending invitations
545
548
  */
546
- async invitations(): Promise<InvitationInfo[]> {
547
- return await this.#apiClient.orgInvitationsList().fetchAll();
549
+ async invitations(opts?: ListInvitationsOptions): Promise<InvitationInfo[]> {
550
+ return await this.#apiClient.orgInvitationsList(opts).fetchAll();
548
551
  }
549
552
 
550
553
  /**
@@ -617,11 +620,32 @@ export class Org {
617
620
  /**
618
621
  * List all users in the organization.
619
622
  *
620
- * @param searchQuery Optional query string. If defined, all returned users will contain this string in their name or email.
623
+ * @overload
624
+ * @param opts Additional options for filtering the users.
621
625
  * @returns The list of users
622
626
  */
623
- async users(searchQuery?: string): Promise<UserInOrgInfo[]> {
624
- return await this.#apiClient.orgUsersList(undefined, searchQuery).fetchAll();
627
+ async users(opts?: ListUsersOptions): Promise<UserInOrgInfo[]>;
628
+ /**
629
+ * List all users in the organization.
630
+ *
631
+ * @overload
632
+ * @param searchQuery Query string. If defined, all returned users will contain this string in their name or email.
633
+ * @returns The list of users
634
+ * @deprecated Use the `ListUsersOptions` parameter overload instead.
635
+ */
636
+ async users(searchQuery?: string): Promise<UserInOrgInfo[]>;
637
+ /**
638
+ * List all users in the organization.
639
+ *
640
+ * @param optsOrSearchQuery Either additional options for filtering the users, or (deprecated) a search query string.
641
+ * @returns The list of users
642
+ */
643
+ async users(optsOrSearchQuery?: ListUsersOptions | string): Promise<UserInOrgInfo[]> {
644
+ const opts: ListUsersOptions =
645
+ typeof optsOrSearchQuery === "string"
646
+ ? { searchQuery: optsOrSearchQuery }
647
+ : (optsOrSearchQuery ?? {});
648
+ return await this.#apiClient.orgUsersList(opts).fetchAll();
625
649
  }
626
650
 
627
651
  /**
package/src/policy.ts CHANGED
@@ -78,7 +78,7 @@ export type PolicyCtx = {
78
78
  * The resources (keys, roles, and key-in-roles) that the access control entry
79
79
  * applies to.
80
80
  */
81
- resources: AceAttribute<PolicyResource>;
81
+ resources?: AceAttribute<PolicyResource>;
82
82
  };
83
83
 
84
84
  /** A resource a policy is invoked with or attached to. */
package/src/schema.ts CHANGED
@@ -755,6 +755,8 @@ export interface paths {
755
755
  *
756
756
  * NOTE that if pagination is used and a page limit is set, the returned result
757
757
  * set may contain either FEWER or MORE elements than the requested page limit.
758
+ * In particular, legacy MFA requests are not paginated: every accessible one
759
+ * is returned in the first page, on top of the page limit.
758
760
  */
759
761
  get: operations["mfaList"];
760
762
  };
@@ -2880,6 +2882,9 @@ export interface components {
2880
2882
  /** @enum {string} */
2881
2883
  BadRequestErrorCode:
2882
2884
  | "GenericBadRequest"
2885
+ | "CannotVoteOnRedeemedRequest"
2886
+ | "PendingOpAlreadyVetoed"
2887
+ | "MultiplePendingOpsReferenced"
2883
2888
  | "DisallowedAllowRuleReference"
2884
2889
  | "InvalidPaginationToken"
2885
2890
  | "InvalidEmail"
@@ -6178,7 +6183,7 @@ export interface components {
6178
6183
  /** @default null */
6179
6184
  Empty: unknown;
6180
6185
  EmptyImpl: {
6181
- status: string;
6186
+ status: components["schemas"]["StatusOk"];
6182
6187
  };
6183
6188
  /**
6184
6189
  * @description Request to create a set of EOTS nonces for a specified chain-id, starting
@@ -6940,6 +6945,19 @@ export interface components {
6940
6945
  };
6941
6946
  /** @description Declares intent to register a new FIDO key */
6942
6947
  FidoCreateRequest: {
6948
+ /**
6949
+ * @description If set, the attestation answering this registration challenge additionally counts as an
6950
+ * approving vote on pending MFA request `mfa_id`.
6951
+ *
6952
+ * This exists so that a user who must register their first second factor in order to complete
6953
+ * an operation (most commonly logging in) does not have to perform two authenticator
6954
+ * ceremonies back to back: one to enroll the credential and another to immediately prove
6955
+ * possession of it. The attestation is a full WebAuthn ceremony over a server-issued
6956
+ * challenge, so it is no weaker than the separate assertion it replaces.
6957
+ *
6958
+ * Requires the 'manage:mfa:vote:fido' scope in addition to 'manage:mfa:register:fido'.
6959
+ */
6960
+ approve_mfa?: string | null;
6943
6961
  /** @description Whether this key can be used for passwordless login */
6944
6962
  discoverable?: boolean;
6945
6963
  /**
@@ -6956,6 +6974,11 @@ export interface components {
6956
6974
  */
6957
6975
  request_device_identifier?: boolean;
6958
6976
  };
6977
+ /** @description Result of registering a FIDO key */
6978
+ FidoRegisterResponse: {
6979
+ mfa?: components["schemas"]["MfaRequestInfo"];
6980
+ status: components["schemas"]["StatusOk"];
6981
+ };
6959
6982
  /** @enum {string} */
6960
6983
  ForbiddenErrorCode:
6961
6984
  | "AlienKeyCreate"
@@ -7018,10 +7041,10 @@ export interface components {
7018
7041
  | "SessionPossiblyStolenToken"
7019
7042
  | "MfaDisallowedIdentity"
7020
7043
  | "MfaDisallowedApprover"
7044
+ | "PendingOpDisallowedApprover"
7021
7045
  | "MfaTypeNotAllowed"
7022
7046
  | "MfaNotApprovedYet"
7023
7047
  | "MfaConfirmationCodeMismatch"
7024
- | "MfaHttpRequestMismatch"
7025
7048
  | "MfaRemoveBelowMin"
7026
7049
  | "MfaOrgRequirementNotMet"
7027
7050
  | "MfaRegistrationDisallowed"
@@ -7985,13 +8008,16 @@ export interface components {
7985
8008
  * }
7986
8009
  */
7987
8010
  MfaPolicy: {
7988
- /** @description Users who are allowed to approve. If empty at creation time, default to the current user. */
8011
+ /**
8012
+ * @description Users who are allowed to approve. If empty, the current user
8013
+ * will be inserted by default.
8014
+ */
7989
8015
  allowed_approvers?: string[];
7990
8016
  /** @description Allowed approval types. When omitted, defaults to any. */
7991
8017
  allowed_mfa_types?: components["schemas"]["MfaType"][] | null;
7992
8018
  /**
7993
8019
  * Format: int32
7994
- * @description How many users to require to approve (defaults to 1).
8020
+ * @description How many users must approve (defaults to 1).
7995
8021
  */
7996
8022
  count?: number;
7997
8023
  lifetime?: components["schemas"]["Seconds"];
@@ -8054,7 +8080,7 @@ export interface components {
8054
8080
  MfaRequiredArgs: {
8055
8081
  /** @description Always set to first MFA id from `Self::ids` */
8056
8082
  id: string;
8057
- /** @description Non-empty MFA request IDs */
8083
+ /** @description Non-empty MFA request IDs or [`PendingOpPolicyRef`]-form refs */
8058
8084
  ids: string[];
8059
8085
  /** @description Organization id */
8060
8086
  org_id: string;
@@ -9347,6 +9373,8 @@ export interface components {
9347
9373
  | components["schemas"]["EvmTxDepositErrorCode"];
9348
9374
  /** @enum {string} */
9349
9375
  PolicyErrorOwnCodes:
9376
+ | "MfaHttpRequestMismatch"
9377
+ | "MfaExpired"
9350
9378
  | "Inapplicable"
9351
9379
  | "SuiTxReceiversDisallowedTransactionKind"
9352
9380
  | "SuiTxReceiversDisallowedTransferAddress"
@@ -9423,6 +9451,7 @@ export interface components {
9423
9451
  | "WasmPolicyFailed"
9424
9452
  | "WebhookPoliciesDisabled"
9425
9453
  | "DeniedByWebhook"
9454
+ | "MfaApprovalsNotYetValid"
9426
9455
  | "ExplicitlyDenied";
9427
9456
  /** @description A struct containing all the information about a specific version of a policy. */
9428
9457
  PolicyInfo: {
@@ -9523,8 +9552,7 @@ export interface components {
9523
9552
  | "ConcurrentSigningWhenTimeLimitPolicyIsDefined"
9524
9553
  | "BabylonEotsConcurrentSigning"
9525
9554
  | "TendermintStateError"
9526
- | "TendermintConcurrentSigning"
9527
- | "MfaApprovalsNotYetValid";
9555
+ | "TendermintConcurrentSigning";
9528
9556
  /** @description Contains outputs of previous transactions. */
9529
9557
  PrevOutputs: OneOf<
9530
9558
  [
@@ -10676,29 +10704,47 @@ export interface components {
10676
10704
  */
10677
10705
  created_validator_key_id: string;
10678
10706
  };
10707
+ /**
10708
+ * @description Approval state for a [`MfaRequest`] in [`MfaRequestSource::Legacy`] mode:
10709
+ * the per-policy [`ApprovalConstraints`] plus an inline `approved_by` map.
10710
+ * Pooled MfaRequests carry only [`ApprovalConstraints`] — their approvals live
10711
+ * on the linked [`PendingOp`] — so the type system enforces "no pooled
10712
+ * MfaRequest has an `approved_by`."
10713
+ */
10679
10714
  Status: {
10680
10715
  /** @description Users who are allowed to approve. Must be non-empty. */
10681
10716
  allowed_approvers: string[];
10682
10717
  /** @description Allowed approval types. When omitted, defaults to any. */
10683
10718
  allowed_mfa_types?: components["schemas"]["MfaType"][] | null;
10684
- /** @description Users who have already approved */
10685
- approved_by: {
10686
- [key: string]: {
10687
- [key: string]: components["schemas"]["ApprovalInfo"];
10688
- };
10689
- };
10690
10719
  /**
10691
10720
  * Format: int32
10692
- * @description How many users must approve
10721
+ * @description How many users must approve (defaults to 1).
10693
10722
  */
10694
10723
  count: number;
10695
10724
  /**
10696
10725
  * Format: int32
10697
- * @description How many auth factors to require per user
10726
+ * @description How many auth factors to require per user (defaults to 1).
10698
10727
  */
10699
10728
  num_auth_factors: number;
10700
10729
  request_comparer?: components["schemas"]["HttpRequestCmp"];
10730
+ } & {
10731
+ /** @description Users who have already approved. */
10732
+ approved_by: {
10733
+ [key: string]: {
10734
+ [key: string]: components["schemas"]["ApprovalInfo"];
10735
+ };
10736
+ };
10701
10737
  };
10738
+ /**
10739
+ * @description The `status` field carried by [`Empty`] responses. Always serializes as `"ok"`.
10740
+ *
10741
+ * Endpoints that used to return [`Empty`] and now return something richer must keep emitting
10742
+ * this field, because generated clients bind [`Empty`] to a struct with a *required* `status`
10743
+ * and would otherwise fail to deserialize a successful response. Use this type rather than a
10744
+ * bare `String` so the one acceptable value is not something anyone has to remember.
10745
+ * @enum {string}
10746
+ */
10747
+ StatusOk: "ok";
10702
10748
  /**
10703
10749
  * @description A single asset balance entry returned by [`SubAccountAssetsResponse`].
10704
10750
  *
@@ -11119,8 +11165,25 @@ export interface components {
11119
11165
  */
11120
11166
  totp_url: string;
11121
11167
  };
11168
+ /** @description Result of registering (resetting) TOTP */
11169
+ TotpRegisterResponse: {
11170
+ mfa?: components["schemas"]["MfaRequestInfo"];
11171
+ status: components["schemas"]["StatusOk"];
11172
+ };
11122
11173
  /** @description Request to reset TOTP. */
11123
11174
  TotpResetRequest: {
11175
+ /**
11176
+ * @description If set, the code answering this challenge additionally counts as an approving vote on
11177
+ * pending MFA request `mfa_id`.
11178
+ *
11179
+ * This exists so that a user who must register their first second factor in order to complete
11180
+ * an operation (most commonly logging in) does not have to enter two TOTP codes back to back:
11181
+ * one to confirm enrollment and another to immediately approve the pending request. Answering
11182
+ * the challenge already proves possession of the new secret.
11183
+ *
11184
+ * Requires the 'manage:mfa:vote:totp' scope in addition to 'manage:mfa:register:totp'.
11185
+ */
11186
+ approve_mfa?: string | null;
11124
11187
  /** @description The name of the issuer; defaults to "Cubist". */
11125
11188
  issuer?: string | null;
11126
11189
  };
@@ -12756,7 +12819,7 @@ export interface components {
12756
12819
  EmptyImpl: {
12757
12820
  content: {
12758
12821
  "application/json": {
12759
- status: string;
12822
+ status: components["schemas"]["StatusOk"];
12760
12823
  };
12761
12824
  };
12762
12825
  };
@@ -12822,6 +12885,15 @@ export interface components {
12822
12885
  };
12823
12886
  };
12824
12887
  };
12888
+ /** @description Result of registering a FIDO key */
12889
+ FidoRegisterResponse: {
12890
+ content: {
12891
+ "application/json": {
12892
+ mfa?: components["schemas"]["MfaRequestInfo"];
12893
+ status: components["schemas"]["StatusOk"];
12894
+ };
12895
+ };
12896
+ };
12825
12897
  /** @description The email sender configuration (without sensitive auth details) */
12826
12898
  GetEmailConfigResponse: {
12827
12899
  content: {
@@ -14012,6 +14084,15 @@ export interface components {
14012
14084
  };
14013
14085
  };
14014
14086
  };
14087
+ /** @description Result of registering (resetting) TOTP */
14088
+ TotpRegisterResponse: {
14089
+ content: {
14090
+ "application/json": {
14091
+ mfa?: components["schemas"]["MfaRequestInfo"];
14092
+ status: components["schemas"]["StatusOk"];
14093
+ };
14094
+ };
14095
+ };
14015
14096
  /** @description A response to sign an eth2 unstake request. */
14016
14097
  UnstakeResponse: {
14017
14098
  content: {
@@ -16229,6 +16310,8 @@ export interface operations {
16229
16310
  * the exact value previously returned as 'last_evaluated_key' from the same endpoint.
16230
16311
  */
16231
16312
  "page.start"?: string | null;
16313
+ /** @description Membership roles. If defined, only invitations for one of these roles are returned, grouped by role in descending role order (owners first, aliens last). */
16314
+ membership?: components["schemas"]["MemberRole"][] | null;
16232
16315
  };
16233
16316
  path: {
16234
16317
  /**
@@ -16735,6 +16818,8 @@ export interface operations {
16735
16818
  *
16736
16819
  * NOTE that if pagination is used and a page limit is set, the returned result
16737
16820
  * set may contain either FEWER or MORE elements than the requested page limit.
16821
+ * In particular, legacy MFA requests are not paginated: every accessible one
16822
+ * is returned in the first page, on top of the page limit.
16738
16823
  */
16739
16824
  mfaList: {
16740
16825
  parameters: {
@@ -19478,7 +19563,7 @@ export interface operations {
19478
19563
  };
19479
19564
  };
19480
19565
  responses: {
19481
- 200: components["responses"]["EmptyImpl"];
19566
+ 200: components["responses"]["FidoRegisterResponse"];
19482
19567
  default: {
19483
19568
  content: {
19484
19569
  "application/json": components["schemas"]["ErrorResponse"];
@@ -19625,7 +19710,7 @@ export interface operations {
19625
19710
  };
19626
19711
  };
19627
19712
  responses: {
19628
- 200: components["responses"]["EmptyImpl"];
19713
+ 200: components["responses"]["TotpRegisterResponse"];
19629
19714
  default: {
19630
19715
  content: {
19631
19716
  "application/json": components["schemas"]["ErrorResponse"];
@@ -19691,6 +19776,8 @@ export interface operations {
19691
19776
  "page.start"?: string | null;
19692
19777
  /** @description A query string. If defined, all returned users will contain this string in their name or email. */
19693
19778
  q?: string | null;
19779
+ /** @description Membership roles. If defined, only users with one of these roles in the org are returned, grouped by role in descending role order (owners first, aliens last). */
19780
+ membership?: components["schemas"]["MemberRole"][] | null;
19694
19781
  };
19695
19782
  path: {
19696
19783
  /**