@faable/auth-sdk 2.7.75 → 2.7.77

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.
@@ -447,6 +447,23 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
447
447
  default?: "email" | "sms" | "whatsapp" | "factor" | undefined;
448
448
  visible?: ("email" | "sms" | "whatsapp" | "factor")[] | undefined;
449
449
  } | undefined;
450
+ /**
451
+ * `GET /user/export` — operationId: `user/export`
452
+ *
453
+ * Export users, optionally with their password hashes
454
+ *
455
+ * Pages through every user of the tenant, 500 at a time, in the row shape `POST /user/import` takes. With `include_hashes` each row carries its `password_hash` (needs the `read:password_hashes` scope, is audited as `credentials.exported` and notifies its subscribers). Provider access and refresh tokens of linked identities are never exported. Available on every plan.
456
+ *
457
+ * @throws {FaableApiError} `invalid_connection` (400) — The connection does not exist, is disabled, or is not of the type this flow needs.
458
+ * @throws {FaableApiError} `validation_error` (400) — The body, query or path failed schema validation. `details.issues` lists each failing field.
459
+ * @throws {FaableApiError} `unauthorized` (401) — The request carries no valid credentials.
460
+ * @throws {FaableApiError} `forbidden` (403) — The credentials are valid but do not allow this operation.
461
+ * @throws {FaableApiError} `insufficient_scope` (403) — The token lacks a scope this operation requires. `message` names it.
462
+ * @throws {FaableApiError} `user_suspended` (403) — The user is suspended and cannot sign in or be modified.
463
+ * @throws {FaableApiError} `account_not_found` (404) — No Auth Account matches the request (domain, header or token).
464
+ * @throws {FaableApiError} `too_many_requests` (429) — Rate limit exceeded. Honour the `Retry-After` header.
465
+ * @throws {FaableApiError} `internal_error` (500) — Unexpected server error. Retry later; the request id is logged.
466
+ */
450
467
  default_country_iso?: string | null | undefined;
451
468
  webauthn_rp_id?: string | null | undefined;
452
469
  logout_confirm_required?: boolean | undefined;
@@ -508,6 +525,23 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
508
525
  default?: "email" | "sms" | "whatsapp" | "factor" | undefined;
509
526
  visible?: ("email" | "sms" | "whatsapp" | "factor")[] | undefined;
510
527
  } | undefined;
528
+ /**
529
+ * `GET /user/export` — operationId: `user/export`
530
+ *
531
+ * Export users, optionally with their password hashes
532
+ *
533
+ * Pages through every user of the tenant, 500 at a time, in the row shape `POST /user/import` takes. With `include_hashes` each row carries its `password_hash` (needs the `read:password_hashes` scope, is audited as `credentials.exported` and notifies its subscribers). Provider access and refresh tokens of linked identities are never exported. Available on every plan.
534
+ *
535
+ * @throws {FaableApiError} `invalid_connection` (400) — The connection does not exist, is disabled, or is not of the type this flow needs.
536
+ * @throws {FaableApiError} `validation_error` (400) — The body, query or path failed schema validation. `details.issues` lists each failing field.
537
+ * @throws {FaableApiError} `unauthorized` (401) — The request carries no valid credentials.
538
+ * @throws {FaableApiError} `forbidden` (403) — The credentials are valid but do not allow this operation.
539
+ * @throws {FaableApiError} `insufficient_scope` (403) — The token lacks a scope this operation requires. `message` names it.
540
+ * @throws {FaableApiError} `user_suspended` (403) — The user is suspended and cannot sign in or be modified.
541
+ * @throws {FaableApiError} `account_not_found` (404) — No Auth Account matches the request (domain, header or token).
542
+ * @throws {FaableApiError} `too_many_requests` (429) — Rate limit exceeded. Honour the `Retry-After` header.
543
+ * @throws {FaableApiError} `internal_error` (500) — Unexpected server error. Retry later; the request id is logged.
544
+ */
511
545
  default_country_iso?: string | null | undefined;
512
546
  webauthn_rp_id?: string | null | undefined;
513
547
  logout_confirm_required?: boolean | undefined;
@@ -572,6 +606,23 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
572
606
  default?: "email" | "sms" | "whatsapp" | "factor" | undefined;
573
607
  visible?: ("email" | "sms" | "whatsapp" | "factor")[] | undefined;
574
608
  } | undefined;
609
+ /**
610
+ * `GET /user/export` — operationId: `user/export`
611
+ *
612
+ * Export users, optionally with their password hashes
613
+ *
614
+ * Pages through every user of the tenant, 500 at a time, in the row shape `POST /user/import` takes. With `include_hashes` each row carries its `password_hash` (needs the `read:password_hashes` scope, is audited as `credentials.exported` and notifies its subscribers). Provider access and refresh tokens of linked identities are never exported. Available on every plan.
615
+ *
616
+ * @throws {FaableApiError} `invalid_connection` (400) — The connection does not exist, is disabled, or is not of the type this flow needs.
617
+ * @throws {FaableApiError} `validation_error` (400) — The body, query or path failed schema validation. `details.issues` lists each failing field.
618
+ * @throws {FaableApiError} `unauthorized` (401) — The request carries no valid credentials.
619
+ * @throws {FaableApiError} `forbidden` (403) — The credentials are valid but do not allow this operation.
620
+ * @throws {FaableApiError} `insufficient_scope` (403) — The token lacks a scope this operation requires. `message` names it.
621
+ * @throws {FaableApiError} `user_suspended` (403) — The user is suspended and cannot sign in or be modified.
622
+ * @throws {FaableApiError} `account_not_found` (404) — No Auth Account matches the request (domain, header or token).
623
+ * @throws {FaableApiError} `too_many_requests` (429) — Rate limit exceeded. Honour the `Retry-After` header.
624
+ * @throws {FaableApiError} `internal_error` (500) — Unexpected server error. Retry later; the request id is logged.
625
+ */
575
626
  default_country_iso?: string | null | undefined;
576
627
  webauthn_rp_id?: string | null | undefined;
577
628
  logout_confirm_required?: boolean | undefined;
@@ -4969,7 +5020,7 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
4969
5020
  *
4970
5021
  * Accept a team invite for a signed-in user
4971
5022
  *
4972
- * Accepts the invite whose secret is `token` on behalf of `user_id`, an existing user of this tenant. The user's email must be verified and equal to the invited one (`invite_email_mismatch` otherwise, with the invited address masked in `details`). Never creates a user. Use it from the page you gave as the invite's `accept_url`.
5023
+ * Accepts the invite — by the `token` of its link, or by `invite_id` — on behalf of `user_id`, an existing user of this tenant. The user's email must be verified and equal to the invited one (`invite_email_mismatch` otherwise, with the invited address masked in `details`). Never creates a user. Use `token` from the page you gave as the invite's `accept_url`, and `invite_id` from a pending-invitation notice in your app.
4973
5024
  *
4974
5025
  * @throws {FaableApiError} `invalid_ticket` (400) — The ticket does not exist or is not the kind this endpoint accepts.
4975
5026
  * @throws {FaableApiError} `ticket_used` (400) — The ticket was already consumed.
@@ -5080,6 +5131,31 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
5080
5131
  createdAt: string;
5081
5132
  updatedAt?: string | undefined;
5082
5133
  }>;
5134
+ /**
5135
+ * `POST /team/invite/decline` — operationId: `team/declineInvite`
5136
+ *
5137
+ * Decline a team invite for a signed-in user
5138
+ *
5139
+ * The invited user says no: the invite is spent (its link stops working) and `team.invite.revoked` is emitted with reason `declined`. Same checks as accepting.
5140
+ *
5141
+ * @throws {FaableApiError} `invalid_ticket` (400) — The ticket does not exist or is not the kind this endpoint accepts.
5142
+ * @throws {FaableApiError} `ticket_used` (400) — The ticket was already consumed.
5143
+ * @throws {FaableApiError} `ticket_expired` (400) — The ticket is past its expiry.
5144
+ * @throws {FaableApiError} `validation_error` (400) — The body, query or path failed schema validation. `details.issues` lists each failing field.
5145
+ * @throws {FaableApiError} `unauthorized` (401) — The request carries no valid credentials.
5146
+ * @throws {FaableApiError} `invite_email_mismatch` (403) — The invite is for another email address than the accepting user's. `details.invited_email` shows it masked.
5147
+ * @throws {FaableApiError} `invite_email_unverified` (403) — The accepting user's email matches the invite but is not verified yet.
5148
+ * @throws {FaableApiError} `forbidden` (403) — The credentials are valid but do not allow this operation.
5149
+ * @throws {FaableApiError} `insufficient_scope` (403) — The token lacks a scope this operation requires. `message` names it.
5150
+ * @throws {FaableApiError} `user_suspended` (403) — The user is suspended and cannot sign in or be modified.
5151
+ * @throws {FaableApiError} `not_found` (404) — The resource does not exist in this account.
5152
+ * @throws {FaableApiError} `account_not_found` (404) — No Auth Account matches the request (domain, header or token).
5153
+ * @throws {FaableApiError} `too_many_requests` (429) — Rate limit exceeded. Honour the `Retry-After` header.
5154
+ * @throws {FaableApiError} `internal_error` (500) — Unexpected server error. Retry later; the request id is logged.
5155
+ */
5156
+ teamDeclineInvite(data: OpBody<"team/declineInvite">): Promise<{
5157
+ status: "declined";
5158
+ }>;
5083
5159
  /**
5084
5160
  * `DELETE /team/{team_id}` — operationId: `team/delete`
5085
5161
  *
@@ -5270,6 +5346,42 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
5270
5346
  updatedAt?: string | undefined;
5271
5347
  }[];
5272
5348
  }>;
5349
+ /**
5350
+ * `GET /user/{user_id}/team-invites` — operationId: `team/listInvitesForUser`
5351
+ *
5352
+ * List a user's pending team invites
5353
+ *
5354
+ * Pending (not accepted, revoked, declined or expired) invites to any team of this tenant addressed to the user's email. Only when that email is verified; otherwise `email_verified: false` and an empty list.
5355
+ *
5356
+ * @throws {FaableApiError} `validation_error` (400) — The body, query or path failed schema validation. `details.issues` lists each failing field.
5357
+ * @throws {FaableApiError} `unauthorized` (401) — The request carries no valid credentials.
5358
+ * @throws {FaableApiError} `forbidden` (403) — The credentials are valid but do not allow this operation.
5359
+ * @throws {FaableApiError} `insufficient_scope` (403) — The token lacks a scope this operation requires. `message` names it.
5360
+ * @throws {FaableApiError} `user_suspended` (403) — The user is suspended and cannot sign in or be modified.
5361
+ * @throws {FaableApiError} `account_not_found` (404) — No Auth Account matches the request (domain, header or token).
5362
+ * @throws {FaableApiError} `too_many_requests` (429) — Rate limit exceeded. Honour the `Retry-After` header.
5363
+ * @throws {FaableApiError} `internal_error` (500) — Unexpected server error. Retry later; the request id is logged.
5364
+ */
5365
+ teamListInvitesForUser(user_id: string): Promise<{
5366
+ email_verified: boolean;
5367
+ data: {
5368
+ id: string;
5369
+ email: string;
5370
+ team: string;
5371
+ inviter?: string | undefined;
5372
+ roles: string[];
5373
+ mode: "auto" | "invite";
5374
+ redirect_uri?: string | undefined;
5375
+ expires_at: string;
5376
+ consume_date?: string | undefined;
5377
+ account: string;
5378
+ metadata: {
5379
+ [key: string]: unknown;
5380
+ };
5381
+ createdAt: string;
5382
+ updatedAt?: string | undefined;
5383
+ }[];
5384
+ }>;
5273
5385
  /**
5274
5386
  * `GET /team/{team_id}/member` — operationId: `team/listMembers`
5275
5387
  *
@@ -5345,7 +5457,7 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
5345
5457
  * @throws {FaableApiError} `too_many_requests` (429) — Rate limit exceeded. Honour the `Retry-After` header.
5346
5458
  * @throws {FaableApiError} `internal_error` (500) — Unexpected server error. Retry later; the request id is logged.
5347
5459
  */
5348
- teamRemoveMember(team_id: string, user_id: string): Promise<{
5460
+ teamRemoveMember(team_id: string, user_id: string, params?: OpQuery<"team/removeMember">): Promise<{
5349
5461
  id: string;
5350
5462
  deleted: true;
5351
5463
  }>;
@@ -1802,7 +1802,7 @@ export class GeneratedFaableAuthApi extends FaableApi {
1802
1802
  *
1803
1803
  * Accept a team invite for a signed-in user
1804
1804
  *
1805
- * Accepts the invite whose secret is `token` on behalf of `user_id`, an existing user of this tenant. The user's email must be verified and equal to the invited one (`invite_email_mismatch` otherwise, with the invited address masked in `details`). Never creates a user. Use it from the page you gave as the invite's `accept_url`.
1805
+ * Accepts the invite — by the `token` of its link, or by `invite_id` — on behalf of `user_id`, an existing user of this tenant. The user's email must be verified and equal to the invited one (`invite_email_mismatch` otherwise, with the invited address masked in `details`). Never creates a user. Use `token` from the page you gave as the invite's `accept_url`, and `invite_id` from a pending-invitation notice in your app.
1806
1806
  *
1807
1807
  * @throws {FaableApiError} `invalid_ticket` (400) — The ticket does not exist or is not the kind this endpoint accepts.
1808
1808
  * @throws {FaableApiError} `ticket_used` (400) — The ticket was already consumed.
@@ -1885,6 +1885,31 @@ export class GeneratedFaableAuthApi extends FaableApi {
1885
1885
  teamCreate(data) {
1886
1886
  return this.fetcher.post(`/team`, data);
1887
1887
  }
1888
+ /**
1889
+ * `POST /team/invite/decline` — operationId: `team/declineInvite`
1890
+ *
1891
+ * Decline a team invite for a signed-in user
1892
+ *
1893
+ * The invited user says no: the invite is spent (its link stops working) and `team.invite.revoked` is emitted with reason `declined`. Same checks as accepting.
1894
+ *
1895
+ * @throws {FaableApiError} `invalid_ticket` (400) — The ticket does not exist or is not the kind this endpoint accepts.
1896
+ * @throws {FaableApiError} `ticket_used` (400) — The ticket was already consumed.
1897
+ * @throws {FaableApiError} `ticket_expired` (400) — The ticket is past its expiry.
1898
+ * @throws {FaableApiError} `validation_error` (400) — The body, query or path failed schema validation. `details.issues` lists each failing field.
1899
+ * @throws {FaableApiError} `unauthorized` (401) — The request carries no valid credentials.
1900
+ * @throws {FaableApiError} `invite_email_mismatch` (403) — The invite is for another email address than the accepting user's. `details.invited_email` shows it masked.
1901
+ * @throws {FaableApiError} `invite_email_unverified` (403) — The accepting user's email matches the invite but is not verified yet.
1902
+ * @throws {FaableApiError} `forbidden` (403) — The credentials are valid but do not allow this operation.
1903
+ * @throws {FaableApiError} `insufficient_scope` (403) — The token lacks a scope this operation requires. `message` names it.
1904
+ * @throws {FaableApiError} `user_suspended` (403) — The user is suspended and cannot sign in or be modified.
1905
+ * @throws {FaableApiError} `not_found` (404) — The resource does not exist in this account.
1906
+ * @throws {FaableApiError} `account_not_found` (404) — No Auth Account matches the request (domain, header or token).
1907
+ * @throws {FaableApiError} `too_many_requests` (429) — Rate limit exceeded. Honour the `Retry-After` header.
1908
+ * @throws {FaableApiError} `internal_error` (500) — Unexpected server error. Retry later; the request id is logged.
1909
+ */
1910
+ teamDeclineInvite(data) {
1911
+ return this.fetcher.post(`/team/invite/decline`, data);
1912
+ }
1888
1913
  /**
1889
1914
  * `DELETE /team/{team_id}` — operationId: `team/delete`
1890
1915
  *
@@ -1989,6 +2014,26 @@ export class GeneratedFaableAuthApi extends FaableApi {
1989
2014
  requireId("team_id", team_id);
1990
2015
  return this.fetcher.request({ method: "GET", url: `/team/${team_id}/invite`, params });
1991
2016
  }
2017
+ /**
2018
+ * `GET /user/{user_id}/team-invites` — operationId: `team/listInvitesForUser`
2019
+ *
2020
+ * List a user's pending team invites
2021
+ *
2022
+ * Pending (not accepted, revoked, declined or expired) invites to any team of this tenant addressed to the user's email. Only when that email is verified; otherwise `email_verified: false` and an empty list.
2023
+ *
2024
+ * @throws {FaableApiError} `validation_error` (400) — The body, query or path failed schema validation. `details.issues` lists each failing field.
2025
+ * @throws {FaableApiError} `unauthorized` (401) — The request carries no valid credentials.
2026
+ * @throws {FaableApiError} `forbidden` (403) — The credentials are valid but do not allow this operation.
2027
+ * @throws {FaableApiError} `insufficient_scope` (403) — The token lacks a scope this operation requires. `message` names it.
2028
+ * @throws {FaableApiError} `user_suspended` (403) — The user is suspended and cannot sign in or be modified.
2029
+ * @throws {FaableApiError} `account_not_found` (404) — No Auth Account matches the request (domain, header or token).
2030
+ * @throws {FaableApiError} `too_many_requests` (429) — Rate limit exceeded. Honour the `Retry-After` header.
2031
+ * @throws {FaableApiError} `internal_error` (500) — Unexpected server error. Retry later; the request id is logged.
2032
+ */
2033
+ teamListInvitesForUser(user_id) {
2034
+ requireId("user_id", user_id);
2035
+ return this.fetcher.get(`/user/${user_id}/team-invites`);
2036
+ }
1992
2037
  /**
1993
2038
  * `GET /team/{team_id}/member` — operationId: `team/listMembers`
1994
2039
  *
@@ -2027,10 +2072,10 @@ export class GeneratedFaableAuthApi extends FaableApi {
2027
2072
  * @throws {FaableApiError} `too_many_requests` (429) — Rate limit exceeded. Honour the `Retry-After` header.
2028
2073
  * @throws {FaableApiError} `internal_error` (500) — Unexpected server error. Retry later; the request id is logged.
2029
2074
  */
2030
- teamRemoveMember(team_id, user_id) {
2075
+ teamRemoveMember(team_id, user_id, params) {
2031
2076
  requireId("team_id", team_id);
2032
2077
  requireId("user_id", user_id);
2033
- return this.fetcher.delete(`/team/${team_id}/member/${user_id}`);
2078
+ return this.fetcher.request({ method: "DELETE", url: `/team/${team_id}/member/${user_id}`, params });
2034
2079
  }
2035
2080
  /**
2036
2081
  * `DELETE /team/{team_id}/invite/{ticket_id}` — operationId: `team/revokeInvite`