@faable/auth-sdk 2.7.41 → 2.7.43

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.
@@ -84,6 +84,8 @@ export type RoleMemberMetadata = components["schemas"]["RoleMemberMetadata"];
84
84
  export type RoleMetadata = components["schemas"]["RoleMetadata"];
85
85
  export type RoleMetadataCreate = components["schemas"]["RoleMetadataCreate"];
86
86
  export type RoleUpdate = components["schemas"]["RoleUpdate"];
87
+ export type Session = components["schemas"]["Session"];
88
+ export type SessionMetadata = components["schemas"]["SessionMetadata"];
87
89
  export type Team = components["schemas"]["Team"];
88
90
  export type TeamCreate = components["schemas"]["TeamCreate"];
89
91
  export type TeamMember = components["schemas"]["TeamMember"];
@@ -2862,6 +2862,28 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
2862
2862
  sent: number;
2863
2863
  }[];
2864
2864
  }>;
2865
+ /**
2866
+ * `GET /internal/usage/sms/range` — operationId: `internal/smsUsageRange`
2867
+ *
2868
+ * SMS a project sent in a time range (platform)
2869
+ *
2870
+ * Sum of the hourly counters of SMS and WhatsApp messages one project handed to the provider between `from` (first full hour after it) and `to`. At most 40 days back. Platform token with `read:usage`.
2871
+ *
2872
+ * @throws {FaableApiError} `validation_error` (400) — The body, query or path failed schema validation. `details.issues` lists each failing field.
2873
+ * @throws {FaableApiError} `unauthorized` (401) — The request carries no valid credentials.
2874
+ * @throws {FaableApiError} `forbidden` (403) — The credentials are valid but do not allow this operation.
2875
+ * @throws {FaableApiError} `insufficient_scope` (403) — The token lacks a scope this operation requires. `message` names it.
2876
+ * @throws {FaableApiError} `user_suspended` (403) — The user is suspended and cannot sign in or be modified.
2877
+ * @throws {FaableApiError} `account_not_found` (404) — No Auth Account matches the request (domain, header or token).
2878
+ * @throws {FaableApiError} `too_many_requests` (429) — Rate limit exceeded. Honour the `Retry-After` header.
2879
+ * @throws {FaableApiError} `internal_error` (500) — Unexpected server error. Retry later; the request id is logged.
2880
+ */
2881
+ internalSmsUsageRange(params?: OpQuery<"internal/smsUsageRange">): Promise<{
2882
+ team: string;
2883
+ from: string;
2884
+ to: string;
2885
+ sent: number;
2886
+ }>;
2865
2887
  /**
2866
2888
  * `GET /log/{log_id}` — operationId: `log/get`
2867
2889
  *
@@ -4571,6 +4593,168 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
4571
4593
  updatedAt?: string | undefined;
4572
4594
  }>>;
4573
4595
  };
4596
+ /**
4597
+ * `GET /session/{session_id}` — operationId: `session/get`
4598
+ *
4599
+ * Get Session
4600
+ *
4601
+ * @throws {FaableApiError} `invalid_id` (400) — The id in the path is not a valid id for this resource.
4602
+ * @throws {FaableApiError} `invalid_expand` (400) — An `?expand=` path is not allowed on this resource.
4603
+ * @throws {FaableApiError} `validation_error` (400) — The body, query or path failed schema validation. `details.issues` lists each failing field.
4604
+ * @throws {FaableApiError} `unauthorized` (401) — The request carries no valid credentials.
4605
+ * @throws {FaableApiError} `forbidden` (403) — The credentials are valid but do not allow this operation.
4606
+ * @throws {FaableApiError} `insufficient_scope` (403) — The token lacks a scope this operation requires. `message` names it.
4607
+ * @throws {FaableApiError} `user_suspended` (403) — The user is suspended and cannot sign in or be modified.
4608
+ * @throws {FaableApiError} `not_found` (404) — The resource does not exist in this account.
4609
+ * @throws {FaableApiError} `account_not_found` (404) — No Auth Account matches the request (domain, header or token).
4610
+ * @throws {FaableApiError} `too_many_requests` (429) — Rate limit exceeded. Honour the `Retry-After` header.
4611
+ * @throws {FaableApiError} `internal_error` (500) — Unexpected server error. Retry later; the request id is logged.
4612
+ */
4613
+ sessionGet(session_id: string, params?: OpQuery<"session/get">): Promise<{
4614
+ id: string;
4615
+ user: unknown;
4616
+ sid: string;
4617
+ status: "active" | "revoked";
4618
+ ip?: string | undefined;
4619
+ user_agent?: string | undefined;
4620
+ client?: unknown;
4621
+ connection?: unknown;
4622
+ issuer?: string | undefined;
4623
+ last_seen_at: string;
4624
+ expires_at: string;
4625
+ revoked_at?: string | undefined;
4626
+ revoked_reason?: "user" | "admin" | "logout" | undefined;
4627
+ account: string;
4628
+ metadata: {
4629
+ [key: string]: unknown;
4630
+ };
4631
+ createdAt: string;
4632
+ updatedAt?: string | undefined;
4633
+ }>;
4634
+ /**
4635
+ * `GET /session` — operationId: `session/list`
4636
+ *
4637
+ * List Sessions
4638
+ *
4639
+ * @throws {FaableApiError} `invalid_query` (400) — The `?query=` FaableQL expression could not be parsed.
4640
+ * @throws {FaableApiError} `invalid_expand` (400) — An `?expand=` path is not allowed on this resource.
4641
+ * @throws {FaableApiError} `search_not_supported` (400) — This resource does not support `?search=`.
4642
+ * @throws {FaableApiError} `validation_error` (400) — The body, query or path failed schema validation. `details.issues` lists each failing field.
4643
+ * @throws {FaableApiError} `unauthorized` (401) — The request carries no valid credentials.
4644
+ * @throws {FaableApiError} `forbidden` (403) — The credentials are valid but do not allow this operation.
4645
+ * @throws {FaableApiError} `insufficient_scope` (403) — The token lacks a scope this operation requires. `message` names it.
4646
+ * @throws {FaableApiError} `user_suspended` (403) — The user is suspended and cannot sign in or be modified.
4647
+ * @throws {FaableApiError} `account_not_found` (404) — No Auth Account matches the request (domain, header or token).
4648
+ * @throws {FaableApiError} `too_many_requests` (429) — Rate limit exceeded. Honour the `Retry-After` header.
4649
+ * @throws {FaableApiError} `internal_error` (500) — Unexpected server error. Retry later; the request id is logged.
4650
+ */
4651
+ sessionList(params?: Omit<OpQuery<"session/list">, "cursor" | "next">): {
4652
+ all: () => Promise<{
4653
+ id: string;
4654
+ user: unknown;
4655
+ sid: string;
4656
+ status: "active" | "revoked";
4657
+ ip?: string | undefined;
4658
+ user_agent?: string | undefined;
4659
+ client?: unknown;
4660
+ connection?: unknown;
4661
+ issuer?: string | undefined;
4662
+ last_seen_at: string;
4663
+ expires_at: string;
4664
+ revoked_at?: string | undefined;
4665
+ revoked_reason?: "user" | "admin" | "logout" | undefined;
4666
+ account: string;
4667
+ metadata: {
4668
+ [key: string]: unknown;
4669
+ };
4670
+ createdAt: string;
4671
+ updatedAt?: string | undefined;
4672
+ }[]>;
4673
+ first: () => Promise<import("@faable/sdk-base/dist/helpers/paginator.js").Page<{
4674
+ id: string;
4675
+ user: unknown;
4676
+ sid: string;
4677
+ status: "active" | "revoked";
4678
+ ip?: string | undefined;
4679
+ user_agent?: string | undefined;
4680
+ client?: unknown;
4681
+ connection?: unknown;
4682
+ issuer?: string | undefined;
4683
+ last_seen_at: string;
4684
+ expires_at: string;
4685
+ revoked_at?: string | undefined;
4686
+ revoked_reason?: "user" | "admin" | "logout" | undefined;
4687
+ account: string;
4688
+ metadata: {
4689
+ [key: string]: unknown;
4690
+ };
4691
+ createdAt: string;
4692
+ updatedAt?: string | undefined;
4693
+ }>>;
4694
+ pass: (params?: {
4695
+ cursor?: string | undefined;
4696
+ pageSize?: string | undefined;
4697
+ } | undefined) => Promise<import("@faable/sdk-base/dist/helpers/paginator.js").Page<{
4698
+ id: string;
4699
+ user: unknown;
4700
+ sid: string;
4701
+ status: "active" | "revoked";
4702
+ ip?: string | undefined;
4703
+ user_agent?: string | undefined;
4704
+ client?: unknown;
4705
+ connection?: unknown;
4706
+ issuer?: string | undefined;
4707
+ last_seen_at: string;
4708
+ expires_at: string;
4709
+ revoked_at?: string | undefined;
4710
+ revoked_reason?: "user" | "admin" | "logout" | undefined;
4711
+ account: string;
4712
+ metadata: {
4713
+ [key: string]: unknown;
4714
+ };
4715
+ createdAt: string;
4716
+ updatedAt?: string | undefined;
4717
+ }>>;
4718
+ };
4719
+ /**
4720
+ * `POST /session/{session_id}/revoke` — operationId: `session/revoke`
4721
+ *
4722
+ * Revoke a session
4723
+ *
4724
+ * Ends the session for good: the browser cookie behind it stops working, every refresh token issued through it is refused on its next use (`invalid_grant`), and the relying parties that took part in it are notified. Access and id tokens already issued keep working until they expire. The row stays, marked `revoked`, for the device history.
4725
+ *
4726
+ * @throws {FaableApiError} `validation_error` (400) — The body, query or path failed schema validation. `details.issues` lists each failing field.
4727
+ * @throws {FaableApiError} `unauthorized` (401) — The request carries no valid credentials.
4728
+ * @throws {FaableApiError} `forbidden` (403) — The credentials are valid but do not allow this operation.
4729
+ * @throws {FaableApiError} `insufficient_scope` (403) — The token lacks a scope this operation requires. `message` names it.
4730
+ * @throws {FaableApiError} `user_suspended` (403) — The user is suspended and cannot sign in or be modified.
4731
+ * @throws {FaableApiError} `not_found` (404) — The resource does not exist in this account.
4732
+ * @throws {FaableApiError} `account_not_found` (404) — No Auth Account matches the request (domain, header or token).
4733
+ * @throws {FaableApiError} `session_already_revoked` (409) — The session was already revoked.
4734
+ * @throws {FaableApiError} `too_many_requests` (429) — Rate limit exceeded. Honour the `Retry-After` header.
4735
+ * @throws {FaableApiError} `internal_error` (500) — Unexpected server error. Retry later; the request id is logged.
4736
+ */
4737
+ sessionRevoke(session_id: string): Promise<{
4738
+ id: string;
4739
+ user: unknown;
4740
+ sid: string;
4741
+ status: "active" | "revoked";
4742
+ ip?: string | undefined;
4743
+ user_agent?: string | undefined;
4744
+ client?: unknown;
4745
+ connection?: unknown;
4746
+ issuer?: string | undefined;
4747
+ last_seen_at: string;
4748
+ expires_at: string;
4749
+ revoked_at?: string | undefined;
4750
+ revoked_reason?: "user" | "admin" | "logout" | undefined;
4751
+ account: string;
4752
+ metadata: {
4753
+ [key: string]: unknown;
4754
+ };
4755
+ createdAt: string;
4756
+ updatedAt?: string | undefined;
4757
+ }>;
4574
4758
  /**
4575
4759
  * `POST /team/{team_id}/member` — operationId: `team/addMembers`
4576
4760
  *
@@ -1062,6 +1062,25 @@ export class GeneratedFaableAuthApi extends FaableApi {
1062
1062
  internalSmsUsage(params) {
1063
1063
  return this.fetcher.request({ method: "GET", url: `/internal/usage/sms`, params });
1064
1064
  }
1065
+ /**
1066
+ * `GET /internal/usage/sms/range` — operationId: `internal/smsUsageRange`
1067
+ *
1068
+ * SMS a project sent in a time range (platform)
1069
+ *
1070
+ * Sum of the hourly counters of SMS and WhatsApp messages one project handed to the provider between `from` (first full hour after it) and `to`. At most 40 days back. Platform token with `read:usage`.
1071
+ *
1072
+ * @throws {FaableApiError} `validation_error` (400) — The body, query or path failed schema validation. `details.issues` lists each failing field.
1073
+ * @throws {FaableApiError} `unauthorized` (401) — The request carries no valid credentials.
1074
+ * @throws {FaableApiError} `forbidden` (403) — The credentials are valid but do not allow this operation.
1075
+ * @throws {FaableApiError} `insufficient_scope` (403) — The token lacks a scope this operation requires. `message` names it.
1076
+ * @throws {FaableApiError} `user_suspended` (403) — The user is suspended and cannot sign in or be modified.
1077
+ * @throws {FaableApiError} `account_not_found` (404) — No Auth Account matches the request (domain, header or token).
1078
+ * @throws {FaableApiError} `too_many_requests` (429) — Rate limit exceeded. Honour the `Retry-After` header.
1079
+ * @throws {FaableApiError} `internal_error` (500) — Unexpected server error. Retry later; the request id is logged.
1080
+ */
1081
+ internalSmsUsageRange(params) {
1082
+ return this.fetcher.request({ method: "GET", url: `/internal/usage/sms/range`, params });
1083
+ }
1065
1084
  /**
1066
1085
  * `GET /log/{log_id}` — operationId: `log/get`
1067
1086
  *
@@ -1639,6 +1658,69 @@ export class GeneratedFaableAuthApi extends FaableApi {
1639
1658
  rolememberList(params) {
1640
1659
  return this.paginator({ url: `/rolemember`, params });
1641
1660
  }
1661
+ /**
1662
+ * `GET /session/{session_id}` — operationId: `session/get`
1663
+ *
1664
+ * Get Session
1665
+ *
1666
+ * @throws {FaableApiError} `invalid_id` (400) — The id in the path is not a valid id for this resource.
1667
+ * @throws {FaableApiError} `invalid_expand` (400) — An `?expand=` path is not allowed on this resource.
1668
+ * @throws {FaableApiError} `validation_error` (400) — The body, query or path failed schema validation. `details.issues` lists each failing field.
1669
+ * @throws {FaableApiError} `unauthorized` (401) — The request carries no valid credentials.
1670
+ * @throws {FaableApiError} `forbidden` (403) — The credentials are valid but do not allow this operation.
1671
+ * @throws {FaableApiError} `insufficient_scope` (403) — The token lacks a scope this operation requires. `message` names it.
1672
+ * @throws {FaableApiError} `user_suspended` (403) — The user is suspended and cannot sign in or be modified.
1673
+ * @throws {FaableApiError} `not_found` (404) — The resource does not exist in this account.
1674
+ * @throws {FaableApiError} `account_not_found` (404) — No Auth Account matches the request (domain, header or token).
1675
+ * @throws {FaableApiError} `too_many_requests` (429) — Rate limit exceeded. Honour the `Retry-After` header.
1676
+ * @throws {FaableApiError} `internal_error` (500) — Unexpected server error. Retry later; the request id is logged.
1677
+ */
1678
+ sessionGet(session_id, params) {
1679
+ requireId("session_id", session_id);
1680
+ return this.fetcher.request({ method: "GET", url: `/session/${session_id}`, params });
1681
+ }
1682
+ /**
1683
+ * `GET /session` — operationId: `session/list`
1684
+ *
1685
+ * List Sessions
1686
+ *
1687
+ * @throws {FaableApiError} `invalid_query` (400) — The `?query=` FaableQL expression could not be parsed.
1688
+ * @throws {FaableApiError} `invalid_expand` (400) — An `?expand=` path is not allowed on this resource.
1689
+ * @throws {FaableApiError} `search_not_supported` (400) — This resource does not support `?search=`.
1690
+ * @throws {FaableApiError} `validation_error` (400) — The body, query or path failed schema validation. `details.issues` lists each failing field.
1691
+ * @throws {FaableApiError} `unauthorized` (401) — The request carries no valid credentials.
1692
+ * @throws {FaableApiError} `forbidden` (403) — The credentials are valid but do not allow this operation.
1693
+ * @throws {FaableApiError} `insufficient_scope` (403) — The token lacks a scope this operation requires. `message` names it.
1694
+ * @throws {FaableApiError} `user_suspended` (403) — The user is suspended and cannot sign in or be modified.
1695
+ * @throws {FaableApiError} `account_not_found` (404) — No Auth Account matches the request (domain, header or token).
1696
+ * @throws {FaableApiError} `too_many_requests` (429) — Rate limit exceeded. Honour the `Retry-After` header.
1697
+ * @throws {FaableApiError} `internal_error` (500) — Unexpected server error. Retry later; the request id is logged.
1698
+ */
1699
+ sessionList(params) {
1700
+ return this.paginator({ url: `/session`, params });
1701
+ }
1702
+ /**
1703
+ * `POST /session/{session_id}/revoke` — operationId: `session/revoke`
1704
+ *
1705
+ * Revoke a session
1706
+ *
1707
+ * Ends the session for good: the browser cookie behind it stops working, every refresh token issued through it is refused on its next use (`invalid_grant`), and the relying parties that took part in it are notified. Access and id tokens already issued keep working until they expire. The row stays, marked `revoked`, for the device history.
1708
+ *
1709
+ * @throws {FaableApiError} `validation_error` (400) — The body, query or path failed schema validation. `details.issues` lists each failing field.
1710
+ * @throws {FaableApiError} `unauthorized` (401) — The request carries no valid credentials.
1711
+ * @throws {FaableApiError} `forbidden` (403) — The credentials are valid but do not allow this operation.
1712
+ * @throws {FaableApiError} `insufficient_scope` (403) — The token lacks a scope this operation requires. `message` names it.
1713
+ * @throws {FaableApiError} `user_suspended` (403) — The user is suspended and cannot sign in or be modified.
1714
+ * @throws {FaableApiError} `not_found` (404) — The resource does not exist in this account.
1715
+ * @throws {FaableApiError} `account_not_found` (404) — No Auth Account matches the request (domain, header or token).
1716
+ * @throws {FaableApiError} `session_already_revoked` (409) — The session was already revoked.
1717
+ * @throws {FaableApiError} `too_many_requests` (429) — Rate limit exceeded. Honour the `Retry-After` header.
1718
+ * @throws {FaableApiError} `internal_error` (500) — Unexpected server error. Retry later; the request id is logged.
1719
+ */
1720
+ sessionRevoke(session_id) {
1721
+ requireId("session_id", session_id);
1722
+ return this.fetcher.post(`/session/${session_id}/revoke`, {});
1723
+ }
1642
1724
  /**
1643
1725
  * `POST /team/{team_id}/member` — operationId: `team/addMembers`
1644
1726
  *