@faable/auth-sdk 2.7.81 → 2.7.83

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.
@@ -1534,6 +1534,227 @@ export class GeneratedFaableAuthApi extends FaableApi {
1534
1534
  requireId("notificationsubscription_id", notificationsubscription_id);
1535
1535
  return this.fetcher.post(`/notificationsubscription/${notificationsubscription_id}`, data);
1536
1536
  }
1537
+ /**
1538
+ * `POST /organization/{organization_id}/admin` — operationId: `organization/addAdmin`
1539
+ *
1540
+ * Add an admin to an Organization
1541
+ *
1542
+ * Makes a user of this tenant an admin of the Organization. Idempotent. Being an admin does not grant access to any team of the organization. Emits `organization.updated`.
1543
+ *
1544
+ * @throws {FaableApiError} `invalid_user` (400) — The user does not exist in this account.
1545
+ * @throws {FaableApiError} `validation_error` (400) — The body, query or path failed schema validation. `details.issues` lists each failing field.
1546
+ * @throws {FaableApiError} `unauthorized` (401) — The request carries no valid credentials.
1547
+ * @throws {FaableApiError} `forbidden` (403) — The credentials are valid but do not allow this operation.
1548
+ * @throws {FaableApiError} `insufficient_scope` (403) — The token lacks a scope this operation requires. `message` names it.
1549
+ * @throws {FaableApiError} `user_suspended` (403) — The user is suspended and cannot sign in or be modified.
1550
+ * @throws {FaableApiError} `organization_not_found` (404) — No organization with that id in this account.
1551
+ * @throws {FaableApiError} `account_not_found` (404) — No Auth Account matches the request (domain, header or token).
1552
+ * @throws {FaableApiError} `too_many_requests` (429) — Rate limit exceeded. Honour the `Retry-After` header.
1553
+ * @throws {FaableApiError} `internal_error` (500) — Unexpected server error. Retry later; the request id is logged.
1554
+ */
1555
+ organizationAddAdmin(organization_id, data) {
1556
+ requireId("organization_id", organization_id);
1557
+ return this.fetcher.post(`/organization/${organization_id}/admin`, data);
1558
+ }
1559
+ /**
1560
+ * `POST /organization/{organization_id}/domain` — operationId: `organization/addDomain`
1561
+ *
1562
+ * Claim an email domain for an Organization
1563
+ *
1564
+ * Adds the domain unverified, with the `verification_token` its TXT record must hold. Idempotent. Nothing changes for anyone until the domain is verified.
1565
+ *
1566
+ * @throws {FaableApiError} `invalid_email_domain` (400) — Not an email domain this organization can claim: it must be a plain domain name (`acme.com`), lowercase, without scheme, path or wildcard.
1567
+ * @throws {FaableApiError} `public_email_domain` (400) — A public email provider (gmail.com, outlook.com…) cannot belong to an organization: anyone can have an address there.
1568
+ * @throws {FaableApiError} `validation_error` (400) — The body, query or path failed schema validation. `details.issues` lists each failing field.
1569
+ * @throws {FaableApiError} `unauthorized` (401) — The request carries no valid credentials.
1570
+ * @throws {FaableApiError} `forbidden` (403) — The credentials are valid but do not allow this operation.
1571
+ * @throws {FaableApiError} `insufficient_scope` (403) — The token lacks a scope this operation requires. `message` names it.
1572
+ * @throws {FaableApiError} `user_suspended` (403) — The user is suspended and cannot sign in or be modified.
1573
+ * @throws {FaableApiError} `organization_not_found` (404) — No organization with that id in this account.
1574
+ * @throws {FaableApiError} `account_not_found` (404) — No Auth Account matches the request (domain, header or token).
1575
+ * @throws {FaableApiError} `too_many_requests` (429) — Rate limit exceeded. Honour the `Retry-After` header.
1576
+ * @throws {FaableApiError} `internal_error` (500) — Unexpected server error. Retry later; the request id is logged.
1577
+ */
1578
+ organizationAddDomain(organization_id, data) {
1579
+ requireId("organization_id", organization_id);
1580
+ return this.fetcher.post(`/organization/${organization_id}/domain`, data);
1581
+ }
1582
+ /**
1583
+ * `POST /organization` — operationId: `organization/create`
1584
+ *
1585
+ * Create Organization
1586
+ *
1587
+ * @throws {FaableApiError} `already_exists` (400) — A resource with the same unique field already exists (for a user, usually `email`). `details.fields` names the field.
1588
+ * @throws {FaableApiError} `validation_error` (400) — The body, query or path failed schema validation. `details.issues` lists each failing field.
1589
+ * @throws {FaableApiError} `unauthorized` (401) — The request carries no valid credentials.
1590
+ * @throws {FaableApiError} `forbidden` (403) — The credentials are valid but do not allow this operation.
1591
+ * @throws {FaableApiError} `insufficient_scope` (403) — The token lacks a scope this operation requires. `message` names it.
1592
+ * @throws {FaableApiError} `user_suspended` (403) — The user is suspended and cannot sign in or be modified.
1593
+ * @throws {FaableApiError} `account_not_found` (404) — No Auth Account matches the request (domain, header or token).
1594
+ * @throws {FaableApiError} `too_many_requests` (429) — Rate limit exceeded. Honour the `Retry-After` header.
1595
+ * @throws {FaableApiError} `internal_error` (500) — Unexpected server error. Retry later; the request id is logged.
1596
+ */
1597
+ organizationCreate(data) {
1598
+ return this.fetcher.post(`/organization`, data);
1599
+ }
1600
+ /**
1601
+ * `DELETE /organization/{organization_id}` — operationId: `organization/delete`
1602
+ *
1603
+ * Delete Organization
1604
+ *
1605
+ * @throws {FaableApiError} `invalid_id` (400) — The id in the path is not a valid id for this resource.
1606
+ * @throws {FaableApiError} `validation_error` (400) — The body, query or path failed schema validation. `details.issues` lists each failing field.
1607
+ * @throws {FaableApiError} `unauthorized` (401) — The request carries no valid credentials.
1608
+ * @throws {FaableApiError} `forbidden` (403) — The credentials are valid but do not allow this operation.
1609
+ * @throws {FaableApiError} `insufficient_scope` (403) — The token lacks a scope this operation requires. `message` names it.
1610
+ * @throws {FaableApiError} `user_suspended` (403) — The user is suspended and cannot sign in or be modified.
1611
+ * @throws {FaableApiError} `not_found` (404) — The resource does not exist in this account.
1612
+ * @throws {FaableApiError} `account_not_found` (404) — No Auth Account matches the request (domain, header or token).
1613
+ * @throws {FaableApiError} `too_many_requests` (429) — Rate limit exceeded. Honour the `Retry-After` header.
1614
+ * @throws {FaableApiError} `internal_error` (500) — Unexpected server error. Retry later; the request id is logged.
1615
+ */
1616
+ organizationDelete(organization_id) {
1617
+ requireId("organization_id", organization_id);
1618
+ return this.fetcher.delete(`/organization/${organization_id}`);
1619
+ }
1620
+ /**
1621
+ * `GET /organization/{organization_id}` — operationId: `organization/get`
1622
+ *
1623
+ * Get Organization
1624
+ *
1625
+ * @throws {FaableApiError} `invalid_id` (400) — The id in the path is not a valid id for this resource.
1626
+ * @throws {FaableApiError} `invalid_expand` (400) — An `?expand=` path is not allowed on this resource.
1627
+ * @throws {FaableApiError} `validation_error` (400) — The body, query or path failed schema validation. `details.issues` lists each failing field.
1628
+ * @throws {FaableApiError} `unauthorized` (401) — The request carries no valid credentials.
1629
+ * @throws {FaableApiError} `forbidden` (403) — The credentials are valid but do not allow this operation.
1630
+ * @throws {FaableApiError} `insufficient_scope` (403) — The token lacks a scope this operation requires. `message` names it.
1631
+ * @throws {FaableApiError} `user_suspended` (403) — The user is suspended and cannot sign in or be modified.
1632
+ * @throws {FaableApiError} `not_found` (404) — The resource does not exist in this account.
1633
+ * @throws {FaableApiError} `account_not_found` (404) — No Auth Account matches the request (domain, header or token).
1634
+ * @throws {FaableApiError} `too_many_requests` (429) — Rate limit exceeded. Honour the `Retry-After` header.
1635
+ * @throws {FaableApiError} `internal_error` (500) — Unexpected server error. Retry later; the request id is logged.
1636
+ */
1637
+ organizationGet(organization_id) {
1638
+ requireId("organization_id", organization_id);
1639
+ return this.fetcher.get(`/organization/${organization_id}`);
1640
+ }
1641
+ /**
1642
+ * `GET /organization` — operationId: `organization/list`
1643
+ *
1644
+ * List Organizations
1645
+ *
1646
+ * @throws {FaableApiError} `invalid_query` (400) — The `?query=` FaableQL expression could not be parsed.
1647
+ * @throws {FaableApiError} `invalid_expand` (400) — An `?expand=` path is not allowed on this resource.
1648
+ * @throws {FaableApiError} `search_not_supported` (400) — This resource does not support `?search=`.
1649
+ * @throws {FaableApiError} `validation_error` (400) — The body, query or path failed schema validation. `details.issues` lists each failing field.
1650
+ * @throws {FaableApiError} `unauthorized` (401) — The request carries no valid credentials.
1651
+ * @throws {FaableApiError} `forbidden` (403) — The credentials are valid but do not allow this operation.
1652
+ * @throws {FaableApiError} `insufficient_scope` (403) — The token lacks a scope this operation requires. `message` names it.
1653
+ * @throws {FaableApiError} `user_suspended` (403) — The user is suspended and cannot sign in or be modified.
1654
+ * @throws {FaableApiError} `account_not_found` (404) — No Auth Account matches the request (domain, header or token).
1655
+ * @throws {FaableApiError} `too_many_requests` (429) — Rate limit exceeded. Honour the `Retry-After` header.
1656
+ * @throws {FaableApiError} `internal_error` (500) — Unexpected server error. Retry later; the request id is logged.
1657
+ */
1658
+ organizationList(params) {
1659
+ return this.paginator({ url: `/organization`, params });
1660
+ }
1661
+ /**
1662
+ * `DELETE /organization/{organization_id}/admin/{user_id}` — operationId: `organization/removeAdmin`
1663
+ *
1664
+ * Remove an admin from an Organization
1665
+ *
1666
+ * Removes the user from the admins of the Organization (the user is not deleted). An organization keeps at least one admin: removing the last one is `last_organization_admin`. Emits `organization.updated`.
1667
+ *
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} `organization_not_found` (404) — No organization with that id in this account.
1674
+ * @throws {FaableApiError} `not_an_organization_admin` (404) — The user is not an admin of the organization.
1675
+ * @throws {FaableApiError} `account_not_found` (404) — No Auth Account matches the request (domain, header or token).
1676
+ * @throws {FaableApiError} `last_organization_admin` (409) — An organization keeps at least one admin. Add another admin before removing this one.
1677
+ * @throws {FaableApiError} `too_many_requests` (429) — Rate limit exceeded. Honour the `Retry-After` header.
1678
+ * @throws {FaableApiError} `internal_error` (500) — Unexpected server error. Retry later; the request id is logged.
1679
+ */
1680
+ organizationRemoveAdmin(organization_id, user_id) {
1681
+ requireId("organization_id", organization_id);
1682
+ requireId("user_id", user_id);
1683
+ return this.fetcher.delete(`/organization/${organization_id}/admin/${user_id}`);
1684
+ }
1685
+ /**
1686
+ * `DELETE /organization/{organization_id}/domain/{domain}` — operationId: `organization/removeDomain`
1687
+ *
1688
+ * Remove an email domain from an Organization
1689
+ *
1690
+ * Removes the domain, verified or not. Logins of people already in the organization are unaffected.
1691
+ *
1692
+ * @throws {FaableApiError} `validation_error` (400) — The body, query or path failed schema validation. `details.issues` lists each failing field.
1693
+ * @throws {FaableApiError} `unauthorized` (401) — The request carries no valid credentials.
1694
+ * @throws {FaableApiError} `forbidden` (403) — The credentials are valid but do not allow this operation.
1695
+ * @throws {FaableApiError} `insufficient_scope` (403) — The token lacks a scope this operation requires. `message` names it.
1696
+ * @throws {FaableApiError} `user_suspended` (403) — The user is suspended and cannot sign in or be modified.
1697
+ * @throws {FaableApiError} `organization_not_found` (404) — No organization with that id in this account.
1698
+ * @throws {FaableApiError} `organization_domain_not_found` (404) — The organization has no such domain.
1699
+ * @throws {FaableApiError} `account_not_found` (404) — No Auth Account matches the request (domain, header or token).
1700
+ * @throws {FaableApiError} `too_many_requests` (429) — Rate limit exceeded. Honour the `Retry-After` header.
1701
+ * @throws {FaableApiError} `internal_error` (500) — Unexpected server error. Retry later; the request id is logged.
1702
+ */
1703
+ organizationRemoveDomain(organization_id, domain) {
1704
+ requireId("organization_id", organization_id);
1705
+ requireId("domain", domain);
1706
+ return this.fetcher.delete(`/organization/${organization_id}/domain/${domain}`);
1707
+ }
1708
+ /**
1709
+ * `POST /organization/{organization_id}` — operationId: `organization/update`
1710
+ *
1711
+ * Update Organization
1712
+ *
1713
+ * @throws {FaableApiError} `invalid_id` (400) — The id in the path is not a valid id for this resource.
1714
+ * @throws {FaableApiError} `already_exists` (400) — A resource with the same unique field already exists (for a user, usually `email`). `details.fields` names the field.
1715
+ * @throws {FaableApiError} `validation_error` (400) — The body, query or path failed schema validation. `details.issues` lists each failing field.
1716
+ * @throws {FaableApiError} `unauthorized` (401) — The request carries no valid credentials.
1717
+ * @throws {FaableApiError} `forbidden` (403) — The credentials are valid but do not allow this operation.
1718
+ * @throws {FaableApiError} `insufficient_scope` (403) — The token lacks a scope this operation requires. `message` names it.
1719
+ * @throws {FaableApiError} `user_suspended` (403) — The user is suspended and cannot sign in or be modified.
1720
+ * @throws {FaableApiError} `not_found` (404) — The resource does not exist in this account.
1721
+ * @throws {FaableApiError} `account_not_found` (404) — No Auth Account matches the request (domain, header or token).
1722
+ * @throws {FaableApiError} `too_many_requests` (429) — Rate limit exceeded. Honour the `Retry-After` header.
1723
+ * @throws {FaableApiError} `internal_error` (500) — Unexpected server error. Retry later; the request id is logged.
1724
+ */
1725
+ organizationUpdate(organization_id, data) {
1726
+ requireId("organization_id", organization_id);
1727
+ return this.fetcher.post(`/organization/${organization_id}`, data);
1728
+ }
1729
+ /**
1730
+ * `POST /organization/{organization_id}/domain/{domain}/verify` — operationId: `organization/verifyDomain`
1731
+ *
1732
+ * Verify an Organization's email domain
1733
+ *
1734
+ * Looks up the TXT record `_faable-challenge.<domain>` and, when it holds `faable-verification=<verification_token>`, marks the domain verified. Pro plan (`plan_required`; `plan_unavailable` when the plan cannot be checked). A domain is verified by one organization of the tenant at most (`organization_domain_taken`).
1735
+ *
1736
+ * @throws {FaableApiError} `organization_domain_unverified` (400) — The TXT record was not found or does not hold the expected value yet. `details.record` says what was expected and what resolves now; DNS can take a few minutes to propagate.
1737
+ * @throws {FaableApiError} `invalid_email_domain` (400) — Not an email domain this organization can claim: it must be a plain domain name (`acme.com`), lowercase, without scheme, path or wildcard.
1738
+ * @throws {FaableApiError} `public_email_domain` (400) — A public email provider (gmail.com, outlook.com…) cannot belong to an organization: anyone can have an address there.
1739
+ * @throws {FaableApiError} `validation_error` (400) — The body, query or path failed schema validation. `details.issues` lists each failing field.
1740
+ * @throws {FaableApiError} `unauthorized` (401) — The request carries no valid credentials.
1741
+ * @throws {FaableApiError} `plan_required` (402) — The setting requires a higher plan. `message` says which.
1742
+ * @throws {FaableApiError} `forbidden` (403) — The credentials are valid but do not allow this operation.
1743
+ * @throws {FaableApiError} `insufficient_scope` (403) — The token lacks a scope this operation requires. `message` names it.
1744
+ * @throws {FaableApiError} `user_suspended` (403) — The user is suspended and cannot sign in or be modified.
1745
+ * @throws {FaableApiError} `organization_not_found` (404) — No organization with that id in this account.
1746
+ * @throws {FaableApiError} `organization_domain_not_found` (404) — The organization has no such domain.
1747
+ * @throws {FaableApiError} `account_not_found` (404) — No Auth Account matches the request (domain, header or token).
1748
+ * @throws {FaableApiError} `organization_domain_taken` (409) — Another organization of this tenant already verified this domain. A domain belongs to one organization.
1749
+ * @throws {FaableApiError} `too_many_requests` (429) — Rate limit exceeded. Honour the `Retry-After` header.
1750
+ * @throws {FaableApiError} `internal_error` (500) — Unexpected server error. Retry later; the request id is logged.
1751
+ * @throws {FaableApiError} `plan_unavailable` (503) — The plan could not be checked right now, and this setting is only for paid plans. Try again in a minute.
1752
+ */
1753
+ organizationVerifyDomain(organization_id, domain) {
1754
+ requireId("organization_id", organization_id);
1755
+ requireId("domain", domain);
1756
+ return this.fetcher.post(`/organization/${organization_id}/domain/${domain}/verify`, {});
1757
+ }
1537
1758
  /**
1538
1759
  * `POST /role/{role_id}/users` — operationId: `role/assign_users`
1539
1760
  *