keycloak-api 1.2.0 → 3.1.0
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/LICENSE +15 -0
- package/README.md +6 -2
- package/dist/account/components.cjs +19 -19
- package/dist/account/components.d.cts +252 -0
- package/dist/account/components.d.cts.map +1 -0
- package/dist/account/components.d.mts +17 -46
- package/dist/account/components.d.mts.map +1 -1
- package/dist/account/components.mjs +19 -19
- package/dist/account/schemas.cjs +15 -1
- package/dist/account/schemas.d.cts +2 -0
- package/dist/account/schemas.d.cts.map +1 -0
- package/dist/account/schemas.d.mts +1 -658
- package/dist/account/schemas.d.mts.map +1 -1
- package/dist/account/schemas.mjs +1 -1
- package/dist/account/types.d.cts +2 -0
- package/dist/account/types.d.cts.map +1 -0
- package/dist/account/types.d.mts +1 -488
- package/dist/account/types.d.mts.map +1 -1
- package/dist/admin/components.cjs +1414 -1307
- package/dist/admin/components.d.cts +5357 -0
- package/dist/admin/components.d.cts.map +1 -0
- package/dist/admin/components.d.mts +667 -2369
- package/dist/admin/components.d.mts.map +1 -1
- package/dist/admin/components.mjs +1414 -1307
- package/dist/admin/schemas.cjs +506 -1
- package/dist/admin/schemas.d.cts +2 -0
- package/dist/admin/schemas.d.cts.map +1 -0
- package/dist/admin/schemas.d.mts +1 -38304
- package/dist/admin/schemas.d.mts.map +1 -1
- package/dist/admin/schemas.mjs +1 -1
- package/dist/admin/types.cjs +3 -1
- package/dist/admin/types.d.cts +2 -0
- package/dist/admin/types.d.cts.map +1 -0
- package/dist/admin/types.d.mts +1 -14736
- package/dist/admin/types.d.mts.map +1 -1
- package/dist/admin/types.mjs +1 -1
- package/dist/{fetcher-caoilmfh.d.ts → fetcher-gzwr3hvv.d.ts} +6 -4
- package/dist/fetcher-gzwr3hvv.d.ts.map +1 -0
- package/dist/fetcher-jnxrupw5.cjs +117 -0
- package/dist/fetcher-jvvyxhrh.js +117 -0
- package/dist/index.cjs +27 -22
- package/dist/index.d.cts +483 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +483 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.d.ts +9178 -7344
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +32 -25
- package/dist/{schemas-hxf19s75.cjs → schemas-c2a8hojk.cjs} +3424 -140
- package/dist/schemas-c2hogfk8.d.ts +877 -0
- package/dist/schemas-c2hogfk8.d.ts.map +1 -0
- package/dist/{schemas-u9zsxojw.js → schemas-eezr3mke.js} +2920 -141
- package/dist/schemas-jz60alpw.d.ts +47666 -0
- package/dist/schemas-jz60alpw.d.ts.map +1 -0
- package/dist/{schemas-jfivc3px.cjs → schemas-l4t53apr.cjs} +74 -3
- package/dist/{schemas-mx94q7di.js → schemas-oe6lnvlj.js} +61 -4
- package/dist/{types-fb17fnxy.cjs → types-f8akg0ce.cjs} +12 -0
- package/dist/types-hfm9r5a8.d.ts +602 -0
- package/dist/types-hfm9r5a8.d.ts.map +1 -0
- package/dist/{types-pvupsyob.js → types-j1j8d5i8.js} +11 -1
- package/dist/types-wu4zpk4a.d.ts +17601 -0
- package/dist/types-wu4zpk4a.d.ts.map +1 -0
- package/package.json +70 -32
- package/dist/fetcher-aq8636lm.cjs +0 -65
- package/dist/fetcher-caoilmfh.d.ts.map +0 -1
- package/dist/fetcher-letfyywe.js +0 -65
package/dist/index.mjs
CHANGED
|
@@ -1,14 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
|
|
1
|
+
import { operationsByPath } from './account/components.mjs';
|
|
2
|
+
export { operationsByTag as accountOperationsByTag, tagDictionary as accountTagDictionary } from './account/components.mjs';
|
|
3
|
+
export { av as accountSchemas } from './schemas-oe6lnvlj.js';
|
|
4
|
+
import { operationsByPath as operationsByPath$1 } from './admin/components.mjs';
|
|
5
|
+
export { operationsByTag as adminOperationsByTag, tagDictionary as adminTagDictionary } from './admin/components.mjs';
|
|
6
|
+
export { $h as adminSchemas } from './schemas-eezr3mke.js';
|
|
7
|
+
export { t as adminTypes } from './types-j1j8d5i8.js';
|
|
7
8
|
|
|
8
9
|
var types = {
|
|
9
10
|
__proto__: null
|
|
10
11
|
};
|
|
11
12
|
|
|
13
|
+
function findOperation(operations, endpoint) {
|
|
14
|
+
if (!Object.hasOwn(operations, endpoint)) throw new Error(`Unknown endpoint: ${endpoint}`);
|
|
15
|
+
return operations[endpoint];
|
|
16
|
+
}
|
|
17
|
+
// The caller's per-call config, such as extra headers, layers over the client's own.
|
|
18
|
+
function withConfig(params, clientConfig) {
|
|
19
|
+
const { config, ...rest } = params ?? {};
|
|
20
|
+
return {
|
|
21
|
+
...rest,
|
|
22
|
+
config: {
|
|
23
|
+
...clientConfig,
|
|
24
|
+
...config
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
12
28
|
class KeycloakAdminApi {
|
|
13
29
|
#baseUrl;
|
|
14
30
|
#token;
|
|
@@ -19,17 +35,13 @@ class KeycloakAdminApi {
|
|
|
19
35
|
this.#fetch = options.fetch || fetch;
|
|
20
36
|
if (!this.#fetch) throw new Error("Fetch is required");
|
|
21
37
|
}
|
|
22
|
-
async request(endpoint, params) {
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const result = await client({
|
|
26
|
-
...extraParams,
|
|
27
|
-
method,
|
|
28
|
-
url,
|
|
38
|
+
async request(endpoint, ...[params]) {
|
|
39
|
+
const operation = findOperation(operationsByPath$1, endpoint);
|
|
40
|
+
const result = await operation(withConfig(params, {
|
|
29
41
|
baseUrl: this.#baseUrl,
|
|
30
42
|
token: this.#token,
|
|
31
43
|
fetchImpl: this.#fetch
|
|
32
|
-
});
|
|
44
|
+
}));
|
|
33
45
|
return result;
|
|
34
46
|
}
|
|
35
47
|
}
|
|
@@ -45,20 +57,15 @@ class KeycloakAccountApi {
|
|
|
45
57
|
this.#fetch = options.fetch || fetch;
|
|
46
58
|
if (!this.#fetch) throw new Error("Fetch is required");
|
|
47
59
|
}
|
|
48
|
-
async request(endpoint, params) {
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
const result = await client({
|
|
53
|
-
...extraParams,
|
|
54
|
-
method,
|
|
55
|
-
url,
|
|
56
|
-
baseUrl,
|
|
60
|
+
async request(endpoint, ...[params]) {
|
|
61
|
+
const operation = findOperation(operationsByPath, endpoint);
|
|
62
|
+
const result = await operation(withConfig(params, {
|
|
63
|
+
baseUrl: `${this.#baseUrl.replace(/\/+$/, "")}/realms/${this.#realm}`,
|
|
57
64
|
token: this.#token,
|
|
58
65
|
fetchImpl: this.#fetch
|
|
59
|
-
});
|
|
66
|
+
}));
|
|
60
67
|
return result;
|
|
61
68
|
}
|
|
62
69
|
}
|
|
63
70
|
|
|
64
|
-
export { KeycloakAccountApi, KeycloakAdminApi, types as accountTypes };
|
|
71
|
+
export { KeycloakAccountApi, KeycloakAdminApi, operationsByPath as accountOperationsByPath, types as accountTypes, operationsByPath$1 as adminOperationsByPath };
|