keycloak-api 0.2.2 → 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 +6 -0
- package/dist/index.cjs +52 -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 +52 -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
|
@@ -87,18 +87,21 @@ class KeycloakAdminApi {
|
|
|
87
87
|
}
|
|
88
88
|
class KeycloakAccountApi {
|
|
89
89
|
#baseUrl;
|
|
90
|
+
#realm;
|
|
90
91
|
#token;
|
|
91
92
|
#fetch;
|
|
92
93
|
constructor(options) {
|
|
93
94
|
this.#baseUrl = options.baseUrl;
|
|
95
|
+
this.#realm = options.realm;
|
|
94
96
|
this.#token = options.token;
|
|
95
97
|
this.#fetch = options.fetch || fetch;
|
|
96
98
|
if (!this.#fetch) throw new Error("Fetch is required");
|
|
97
99
|
}
|
|
98
100
|
async request(endpoint, params) {
|
|
101
|
+
const baseUrl = `${this.#baseUrl}/realms/${this.#realm}`;
|
|
99
102
|
const [method = "", url = ""] = endpoint.split(" ");
|
|
100
103
|
const extraParams = params || {};
|
|
101
|
-
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 });
|
|
102
105
|
return result;
|
|
103
106
|
}
|
|
104
107
|
}
|
|
@@ -1659,125 +1662,135 @@ const extra$1 = {
|
|
|
1659
1662
|
};
|
|
1660
1663
|
|
|
1661
1664
|
const getAccount = (variables, signal) => fetch$1({
|
|
1662
|
-
url: "/
|
|
1665
|
+
url: "/account/",
|
|
1663
1666
|
method: "get",
|
|
1664
1667
|
...variables,
|
|
1665
1668
|
signal
|
|
1666
1669
|
});
|
|
1667
1670
|
const updateAccount = (variables, signal) => fetch$1({
|
|
1668
|
-
url: "/
|
|
1671
|
+
url: "/account/",
|
|
1669
1672
|
method: "post",
|
|
1670
1673
|
...variables,
|
|
1671
1674
|
signal
|
|
1672
1675
|
});
|
|
1673
|
-
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
|
+
});
|
|
1674
1682
|
const getConsent = (variables, signal) => fetch$1({
|
|
1675
|
-
url: "/
|
|
1683
|
+
url: "/account/applications/{clientId}/consent",
|
|
1676
1684
|
method: "get",
|
|
1677
1685
|
...variables,
|
|
1678
1686
|
signal
|
|
1679
1687
|
});
|
|
1680
1688
|
const createConsent = (variables, signal) => fetch$1({
|
|
1681
|
-
url: "/
|
|
1689
|
+
url: "/account/applications/{clientId}/consent",
|
|
1682
1690
|
method: "post",
|
|
1683
1691
|
...variables,
|
|
1684
1692
|
signal
|
|
1685
1693
|
});
|
|
1686
1694
|
const updateConsent = (variables, signal) => fetch$1({
|
|
1687
|
-
url: "/
|
|
1695
|
+
url: "/account/applications/{clientId}/consent",
|
|
1688
1696
|
method: "put",
|
|
1689
1697
|
...variables,
|
|
1690
1698
|
signal
|
|
1691
1699
|
});
|
|
1692
1700
|
const deleteConsent = (variables, signal) => fetch$1({
|
|
1693
|
-
url: "/
|
|
1701
|
+
url: "/account/applications/{clientId}/consent",
|
|
1694
1702
|
method: "delete",
|
|
1695
1703
|
...variables,
|
|
1696
1704
|
signal
|
|
1697
1705
|
});
|
|
1698
|
-
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
|
+
});
|
|
1699
1712
|
const deleteCredential = (variables, signal) => fetch$1({
|
|
1700
|
-
url: "/
|
|
1713
|
+
url: "/account/credentials/{credentialId}",
|
|
1701
1714
|
method: "delete",
|
|
1702
1715
|
...variables,
|
|
1703
1716
|
signal
|
|
1704
1717
|
});
|
|
1705
1718
|
const updateCredentialLabel = (variables, signal) => fetch$1({
|
|
1706
|
-
url: "/
|
|
1719
|
+
url: "/account/credentials/{credentialId}/label",
|
|
1707
1720
|
method: "put",
|
|
1708
1721
|
...variables,
|
|
1709
1722
|
signal
|
|
1710
1723
|
});
|
|
1711
1724
|
const getSessions = (variables, signal) => fetch$1({
|
|
1712
|
-
url: "/
|
|
1725
|
+
url: "/account/sessions",
|
|
1713
1726
|
method: "get",
|
|
1714
1727
|
...variables,
|
|
1715
1728
|
signal
|
|
1716
1729
|
});
|
|
1717
1730
|
const deleteCurrentSession = (variables, signal) => fetch$1({
|
|
1718
|
-
url: "/
|
|
1731
|
+
url: "/account/sessions",
|
|
1719
1732
|
method: "delete",
|
|
1720
1733
|
...variables,
|
|
1721
1734
|
signal
|
|
1722
1735
|
});
|
|
1723
1736
|
const getDevices = (variables, signal) => fetch$1({
|
|
1724
|
-
url: "/
|
|
1737
|
+
url: "/account/sessions/devices",
|
|
1725
1738
|
method: "get",
|
|
1726
1739
|
...variables,
|
|
1727
1740
|
signal
|
|
1728
1741
|
});
|
|
1729
1742
|
const deleteSession = (variables, signal) => fetch$1({
|
|
1730
|
-
url: "/
|
|
1743
|
+
url: "/account/sessions/{sessionId}",
|
|
1731
1744
|
method: "delete",
|
|
1732
1745
|
...variables,
|
|
1733
1746
|
signal
|
|
1734
1747
|
});
|
|
1735
1748
|
const getLinkedAccounts = (variables, signal) => fetch$1({
|
|
1736
|
-
url: "/
|
|
1749
|
+
url: "/account/linked-accounts",
|
|
1737
1750
|
method: "get",
|
|
1738
1751
|
...variables,
|
|
1739
1752
|
signal
|
|
1740
1753
|
});
|
|
1741
|
-
const buildLinkingUri = (variables, signal) => fetch$1({ url: "/
|
|
1754
|
+
const buildLinkingUri = (variables, signal) => fetch$1({ url: "/account/linked-accounts/{providerId}", method: "get", ...variables, signal });
|
|
1742
1755
|
const deleteLinkedProvider = (variables, signal) => fetch$1({
|
|
1743
|
-
url: "/
|
|
1756
|
+
url: "/account/linked-accounts/{providerId}",
|
|
1744
1757
|
method: "delete",
|
|
1745
1758
|
...variables,
|
|
1746
1759
|
signal
|
|
1747
1760
|
});
|
|
1748
1761
|
const getGroups = (variables, signal) => fetch$1({
|
|
1749
|
-
url: "/
|
|
1762
|
+
url: "/account/groups",
|
|
1750
1763
|
method: "get",
|
|
1751
1764
|
...variables,
|
|
1752
1765
|
signal
|
|
1753
1766
|
});
|
|
1754
1767
|
const getOrganizations = (variables, signal) => fetch$1({
|
|
1755
|
-
url: "/
|
|
1768
|
+
url: "/account/organizations",
|
|
1756
1769
|
method: "get",
|
|
1757
1770
|
...variables,
|
|
1758
1771
|
signal
|
|
1759
1772
|
});
|
|
1760
1773
|
|
|
1761
1774
|
const operationsByPath = {
|
|
1762
|
-
"GET /
|
|
1763
|
-
"POST /
|
|
1764
|
-
"GET /
|
|
1765
|
-
"GET /
|
|
1766
|
-
"POST /
|
|
1767
|
-
"PUT /
|
|
1768
|
-
"DELETE /
|
|
1769
|
-
"GET /
|
|
1770
|
-
"DELETE /
|
|
1771
|
-
"PUT /
|
|
1772
|
-
"GET /
|
|
1773
|
-
"DELETE /
|
|
1774
|
-
"GET /
|
|
1775
|
-
"DELETE /
|
|
1776
|
-
"GET /
|
|
1777
|
-
"GET /
|
|
1778
|
-
"DELETE /
|
|
1779
|
-
"GET /
|
|
1780
|
-
"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
|
|
1781
1794
|
};
|
|
1782
1795
|
|
|
1783
1796
|
const extra = {
|