keycloak-api 0.2.1 → 0.2.3
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/.turbo/turbo-build.log +2 -2
- package/CHANGELOG.md +12 -0
- package/dist/index.cjs +53 -39
- package/dist/index.d.cts +54 -169
- package/dist/index.d.mts +54 -169
- package/dist/index.d.ts +54 -169
- package/dist/index.mjs +53 -39
- package/package.json +1 -1
- package/specs/account.yaml +13 -112
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> keycloak-api@0.2.
|
|
2
|
+
> keycloak-api@0.2.3 build /home/runner/work/openapi-clients/openapi-clients/packages/keycloak-api
|
|
3
3
|
> unbuild
|
|
4
4
|
|
|
5
5
|
[info] Automatically detected entries: src/index [esm] [cjs] [dts]
|
|
@@ -10,5 +10,5 @@
|
|
|
10
10
|
|
|
11
11
|
[log] dist/index.mjs (total size: 132 kB, chunk size: 132 kB, exports: AccountExtra, AdminExtra, KeycloakAccountApi, KeycloakAdminApi)
|
|
12
12
|
|
|
13
|
-
Σ Total dist size (byte size): 3.
|
|
13
|
+
Σ Total dist size (byte size): 3.59 MB
|
|
14
14
|
[log]
|
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -23,6 +23,7 @@ async function fetch$1({
|
|
|
23
23
|
const requestHeaders = compactObject({
|
|
24
24
|
"Content-Type": "application/json",
|
|
25
25
|
Authorization: token ? `Bearer ${token}` : void 0,
|
|
26
|
+
Accept: "application/json",
|
|
26
27
|
...headers
|
|
27
28
|
});
|
|
28
29
|
if (requestHeaders["Content-Type"]?.toLowerCase().includes("multipart/form-data")) {
|
|
@@ -86,18 +87,21 @@ class KeycloakAdminApi {
|
|
|
86
87
|
}
|
|
87
88
|
class KeycloakAccountApi {
|
|
88
89
|
#baseUrl;
|
|
90
|
+
#realm;
|
|
89
91
|
#token;
|
|
90
92
|
#fetch;
|
|
91
93
|
constructor(options) {
|
|
92
94
|
this.#baseUrl = options.baseUrl;
|
|
95
|
+
this.#realm = options.realm;
|
|
93
96
|
this.#token = options.token;
|
|
94
97
|
this.#fetch = options.fetch || fetch;
|
|
95
98
|
if (!this.#fetch) throw new Error("Fetch is required");
|
|
96
99
|
}
|
|
97
100
|
async request(endpoint, params) {
|
|
101
|
+
const baseUrl = `${this.#baseUrl}/realms/${this.#realm}`;
|
|
98
102
|
const [method = "", url = ""] = endpoint.split(" ");
|
|
99
103
|
const extraParams = params || {};
|
|
100
|
-
const result = await fetch$1({ ...extraParams, method, url, baseUrl
|
|
104
|
+
const result = await fetch$1({ ...extraParams, method, url, baseUrl, token: this.#token, fetchImpl: this.#fetch });
|
|
101
105
|
return result;
|
|
102
106
|
}
|
|
103
107
|
}
|
|
@@ -1658,125 +1662,135 @@ const extra$1 = {
|
|
|
1658
1662
|
};
|
|
1659
1663
|
|
|
1660
1664
|
const getAccount = (variables, signal) => fetch$1({
|
|
1661
|
-
url: "/
|
|
1665
|
+
url: "/account/",
|
|
1662
1666
|
method: "get",
|
|
1663
1667
|
...variables,
|
|
1664
1668
|
signal
|
|
1665
1669
|
});
|
|
1666
1670
|
const updateAccount = (variables, signal) => fetch$1({
|
|
1667
|
-
url: "/
|
|
1671
|
+
url: "/account/",
|
|
1668
1672
|
method: "post",
|
|
1669
1673
|
...variables,
|
|
1670
1674
|
signal
|
|
1671
1675
|
});
|
|
1672
|
-
const getApplications = (variables, signal) => fetch$1({
|
|
1676
|
+
const getApplications = (variables, signal) => fetch$1({
|
|
1677
|
+
url: "/account/applications",
|
|
1678
|
+
method: "get",
|
|
1679
|
+
...variables,
|
|
1680
|
+
signal
|
|
1681
|
+
});
|
|
1673
1682
|
const getConsent = (variables, signal) => fetch$1({
|
|
1674
|
-
url: "/
|
|
1683
|
+
url: "/account/applications/{clientId}/consent",
|
|
1675
1684
|
method: "get",
|
|
1676
1685
|
...variables,
|
|
1677
1686
|
signal
|
|
1678
1687
|
});
|
|
1679
1688
|
const createConsent = (variables, signal) => fetch$1({
|
|
1680
|
-
url: "/
|
|
1689
|
+
url: "/account/applications/{clientId}/consent",
|
|
1681
1690
|
method: "post",
|
|
1682
1691
|
...variables,
|
|
1683
1692
|
signal
|
|
1684
1693
|
});
|
|
1685
1694
|
const updateConsent = (variables, signal) => fetch$1({
|
|
1686
|
-
url: "/
|
|
1695
|
+
url: "/account/applications/{clientId}/consent",
|
|
1687
1696
|
method: "put",
|
|
1688
1697
|
...variables,
|
|
1689
1698
|
signal
|
|
1690
1699
|
});
|
|
1691
1700
|
const deleteConsent = (variables, signal) => fetch$1({
|
|
1692
|
-
url: "/
|
|
1701
|
+
url: "/account/applications/{clientId}/consent",
|
|
1693
1702
|
method: "delete",
|
|
1694
1703
|
...variables,
|
|
1695
1704
|
signal
|
|
1696
1705
|
});
|
|
1697
|
-
const getCredentials = (variables, signal) => fetch$1({
|
|
1706
|
+
const getCredentials = (variables, signal) => fetch$1({
|
|
1707
|
+
url: "/account/credentials",
|
|
1708
|
+
method: "get",
|
|
1709
|
+
...variables,
|
|
1710
|
+
signal
|
|
1711
|
+
});
|
|
1698
1712
|
const deleteCredential = (variables, signal) => fetch$1({
|
|
1699
|
-
url: "/
|
|
1713
|
+
url: "/account/credentials/{credentialId}",
|
|
1700
1714
|
method: "delete",
|
|
1701
1715
|
...variables,
|
|
1702
1716
|
signal
|
|
1703
1717
|
});
|
|
1704
1718
|
const updateCredentialLabel = (variables, signal) => fetch$1({
|
|
1705
|
-
url: "/
|
|
1719
|
+
url: "/account/credentials/{credentialId}/label",
|
|
1706
1720
|
method: "put",
|
|
1707
1721
|
...variables,
|
|
1708
1722
|
signal
|
|
1709
1723
|
});
|
|
1710
1724
|
const getSessions = (variables, signal) => fetch$1({
|
|
1711
|
-
url: "/
|
|
1725
|
+
url: "/account/sessions",
|
|
1712
1726
|
method: "get",
|
|
1713
1727
|
...variables,
|
|
1714
1728
|
signal
|
|
1715
1729
|
});
|
|
1716
1730
|
const deleteCurrentSession = (variables, signal) => fetch$1({
|
|
1717
|
-
url: "/
|
|
1731
|
+
url: "/account/sessions",
|
|
1718
1732
|
method: "delete",
|
|
1719
1733
|
...variables,
|
|
1720
1734
|
signal
|
|
1721
1735
|
});
|
|
1722
1736
|
const getDevices = (variables, signal) => fetch$1({
|
|
1723
|
-
url: "/
|
|
1737
|
+
url: "/account/sessions/devices",
|
|
1724
1738
|
method: "get",
|
|
1725
1739
|
...variables,
|
|
1726
1740
|
signal
|
|
1727
1741
|
});
|
|
1728
1742
|
const deleteSession = (variables, signal) => fetch$1({
|
|
1729
|
-
url: "/
|
|
1743
|
+
url: "/account/sessions/{sessionId}",
|
|
1730
1744
|
method: "delete",
|
|
1731
1745
|
...variables,
|
|
1732
1746
|
signal
|
|
1733
1747
|
});
|
|
1734
1748
|
const getLinkedAccounts = (variables, signal) => fetch$1({
|
|
1735
|
-
url: "/
|
|
1749
|
+
url: "/account/linked-accounts",
|
|
1736
1750
|
method: "get",
|
|
1737
1751
|
...variables,
|
|
1738
1752
|
signal
|
|
1739
1753
|
});
|
|
1740
|
-
const buildLinkingUri = (variables, signal) => fetch$1({ url: "/
|
|
1754
|
+
const buildLinkingUri = (variables, signal) => fetch$1({ url: "/account/linked-accounts/{providerId}", method: "get", ...variables, signal });
|
|
1741
1755
|
const deleteLinkedProvider = (variables, signal) => fetch$1({
|
|
1742
|
-
url: "/
|
|
1756
|
+
url: "/account/linked-accounts/{providerId}",
|
|
1743
1757
|
method: "delete",
|
|
1744
1758
|
...variables,
|
|
1745
1759
|
signal
|
|
1746
1760
|
});
|
|
1747
1761
|
const getGroups = (variables, signal) => fetch$1({
|
|
1748
|
-
url: "/
|
|
1762
|
+
url: "/account/groups",
|
|
1749
1763
|
method: "get",
|
|
1750
1764
|
...variables,
|
|
1751
1765
|
signal
|
|
1752
1766
|
});
|
|
1753
1767
|
const getOrganizations = (variables, signal) => fetch$1({
|
|
1754
|
-
url: "/
|
|
1768
|
+
url: "/account/organizations",
|
|
1755
1769
|
method: "get",
|
|
1756
1770
|
...variables,
|
|
1757
1771
|
signal
|
|
1758
1772
|
});
|
|
1759
1773
|
|
|
1760
1774
|
const operationsByPath = {
|
|
1761
|
-
"GET /
|
|
1762
|
-
"POST /
|
|
1763
|
-
"GET /
|
|
1764
|
-
"GET /
|
|
1765
|
-
"POST /
|
|
1766
|
-
"PUT /
|
|
1767
|
-
"DELETE /
|
|
1768
|
-
"GET /
|
|
1769
|
-
"DELETE /
|
|
1770
|
-
"PUT /
|
|
1771
|
-
"GET /
|
|
1772
|
-
"DELETE /
|
|
1773
|
-
"GET /
|
|
1774
|
-
"DELETE /
|
|
1775
|
-
"GET /
|
|
1776
|
-
"GET /
|
|
1777
|
-
"DELETE /
|
|
1778
|
-
"GET /
|
|
1779
|
-
"GET /
|
|
1775
|
+
"GET /account/": getAccount,
|
|
1776
|
+
"POST /account/": updateAccount,
|
|
1777
|
+
"GET /account/applications": getApplications,
|
|
1778
|
+
"GET /account/applications/{clientId}/consent": getConsent,
|
|
1779
|
+
"POST /account/applications/{clientId}/consent": createConsent,
|
|
1780
|
+
"PUT /account/applications/{clientId}/consent": updateConsent,
|
|
1781
|
+
"DELETE /account/applications/{clientId}/consent": deleteConsent,
|
|
1782
|
+
"GET /account/credentials": getCredentials,
|
|
1783
|
+
"DELETE /account/credentials/{credentialId}": deleteCredential,
|
|
1784
|
+
"PUT /account/credentials/{credentialId}/label": updateCredentialLabel,
|
|
1785
|
+
"GET /account/sessions": getSessions,
|
|
1786
|
+
"DELETE /account/sessions": deleteCurrentSession,
|
|
1787
|
+
"GET /account/sessions/devices": getDevices,
|
|
1788
|
+
"DELETE /account/sessions/{sessionId}": deleteSession,
|
|
1789
|
+
"GET /account/linked-accounts": getLinkedAccounts,
|
|
1790
|
+
"GET /account/linked-accounts/{providerId}": buildLinkingUri,
|
|
1791
|
+
"DELETE /account/linked-accounts/{providerId}": deleteLinkedProvider,
|
|
1792
|
+
"GET /account/groups": getGroups,
|
|
1793
|
+
"GET /account/organizations": getOrganizations
|
|
1780
1794
|
};
|
|
1781
1795
|
|
|
1782
1796
|
const extra = {
|