@keycloak/keycloak-admin-client 25.0.3 → 25.0.4
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/README.md +3 -3
- package/lib/client.d.ts +3 -0
- package/lib/client.js +5 -0
- package/lib/defs/authenticatorConfigRepresentation.d.ts +1 -0
- package/lib/defs/clientPoliciesRepresentation.d.ts +1 -0
- package/lib/defs/effectiveMessageBundleRepresentation.d.ts +3 -4
- package/lib/defs/organizationDomainRepresentation.d.ts +4 -0
- package/lib/defs/organizationDomainRepresentation.js +1 -0
- package/lib/defs/organizationRepresentation.d.ts +9 -0
- package/lib/defs/organizationRepresentation.js +1 -0
- package/lib/defs/realmRepresentation.d.ts +2 -0
- package/lib/defs/requiredActionConfigInfoRepresentation.d.ts +4 -0
- package/lib/defs/requiredActionConfigInfoRepresentation.js +1 -0
- package/lib/defs/requiredActionConfigRepresentation.d.ts +5 -0
- package/lib/defs/requiredActionConfigRepresentation.js +1 -0
- package/lib/defs/userProfileMetadata.d.ts +10 -1
- package/lib/defs/userProfileMetadata.js +7 -1
- package/lib/defs/userSessionRepresentation.d.ts +1 -0
- package/lib/resources/agent.js +11 -6
- package/lib/resources/authenticationManagement.d.ts +130 -44
- package/lib/resources/authenticationManagement.js +24 -0
- package/lib/resources/clientPolicies.d.ts +4 -2
- package/lib/resources/clientPolicies.js +4 -0
- package/lib/resources/clients.d.ts +2 -1
- package/lib/resources/groups.d.ts +3 -2
- package/lib/resources/groups.js +9 -2
- package/lib/resources/identityProviders.d.ts +14 -2
- package/lib/resources/identityProviders.js +5 -0
- package/lib/resources/organizations.d.ts +86 -0
- package/lib/resources/organizations.js +76 -0
- package/lib/resources/realms.d.ts +1 -0
- package/lib/resources/realms.js +1 -0
- package/lib/resources/resource.d.ts +2 -2
- package/lib/resources/serverInfo.d.ts +8 -7
- package/lib/resources/users.d.ts +7 -2
- package/lib/resources/users.js +5 -0
- package/lib/utils/auth.d.ts +1 -0
- package/package.json +12 -11
package/README.md
CHANGED
|
@@ -53,7 +53,7 @@ const groups = await kcAdminClient.groups.find();
|
|
|
53
53
|
|
|
54
54
|
// Set a `realm` property to override the realm for only a single operation.
|
|
55
55
|
// For example, creating a user in another realm:
|
|
56
|
-
await
|
|
56
|
+
await kcAdminClient.users.create({
|
|
57
57
|
realm: 'a-third-realm',
|
|
58
58
|
username: 'username',
|
|
59
59
|
email: 'user@example.com',
|
|
@@ -107,13 +107,13 @@ setInterval(() => kcAdminClient.auth(credentials), 58 * 1000); // 58 seconds
|
|
|
107
107
|
To build the source do a build:
|
|
108
108
|
|
|
109
109
|
```bash
|
|
110
|
-
pnpm
|
|
110
|
+
pnpm build
|
|
111
111
|
```
|
|
112
112
|
|
|
113
113
|
Start the Keycloak server:
|
|
114
114
|
|
|
115
115
|
```bash
|
|
116
|
-
pnpm
|
|
116
|
+
pnpm server:start
|
|
117
117
|
```
|
|
118
118
|
|
|
119
119
|
If you started your container manually make sure there is an admin user named 'admin' with password 'admin'.
|
package/lib/client.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { Components } from "./resources/components.js";
|
|
|
9
9
|
import { Groups } from "./resources/groups.js";
|
|
10
10
|
import { IdentityProviders } from "./resources/identityProviders.js";
|
|
11
11
|
import { Realms } from "./resources/realms.js";
|
|
12
|
+
import { Organizations } from "./resources/organizations.js";
|
|
12
13
|
import { Roles } from "./resources/roles.js";
|
|
13
14
|
import { ServerInfo } from "./resources/serverInfo.js";
|
|
14
15
|
import { Users } from "./resources/users.js";
|
|
@@ -30,6 +31,7 @@ export declare class KeycloakAdminClient {
|
|
|
30
31
|
userStorageProvider: UserStorageProvider;
|
|
31
32
|
groups: Groups;
|
|
32
33
|
roles: Roles;
|
|
34
|
+
organizations: Organizations;
|
|
33
35
|
clients: Clients;
|
|
34
36
|
realms: Realms;
|
|
35
37
|
clientScopes: ClientScopes;
|
|
@@ -43,6 +45,7 @@ export declare class KeycloakAdminClient {
|
|
|
43
45
|
cache: Cache;
|
|
44
46
|
baseUrl: string;
|
|
45
47
|
realmName: string;
|
|
48
|
+
scope?: string;
|
|
46
49
|
accessToken?: string;
|
|
47
50
|
refreshToken?: string;
|
|
48
51
|
constructor(connectionConfig?: ConnectionConfig);
|
package/lib/client.js
CHANGED
|
@@ -8,6 +8,7 @@ import { Components } from "./resources/components.js";
|
|
|
8
8
|
import { Groups } from "./resources/groups.js";
|
|
9
9
|
import { IdentityProviders } from "./resources/identityProviders.js";
|
|
10
10
|
import { Realms } from "./resources/realms.js";
|
|
11
|
+
import { Organizations } from "./resources/organizations.js";
|
|
11
12
|
import { Roles } from "./resources/roles.js";
|
|
12
13
|
import { ServerInfo } from "./resources/serverInfo.js";
|
|
13
14
|
import { Users } from "./resources/users.js";
|
|
@@ -21,6 +22,7 @@ export class KeycloakAdminClient {
|
|
|
21
22
|
userStorageProvider;
|
|
22
23
|
groups;
|
|
23
24
|
roles;
|
|
25
|
+
organizations;
|
|
24
26
|
clients;
|
|
25
27
|
realms;
|
|
26
28
|
clientScopes;
|
|
@@ -35,6 +37,7 @@ export class KeycloakAdminClient {
|
|
|
35
37
|
// Members
|
|
36
38
|
baseUrl;
|
|
37
39
|
realmName;
|
|
40
|
+
scope;
|
|
38
41
|
accessToken;
|
|
39
42
|
refreshToken;
|
|
40
43
|
#requestOptions;
|
|
@@ -50,6 +53,7 @@ export class KeycloakAdminClient {
|
|
|
50
53
|
this.userStorageProvider = new UserStorageProvider(this);
|
|
51
54
|
this.groups = new Groups(this);
|
|
52
55
|
this.roles = new Roles(this);
|
|
56
|
+
this.organizations = new Organizations(this);
|
|
53
57
|
this.clients = new Clients(this);
|
|
54
58
|
this.realms = new Realms(this);
|
|
55
59
|
this.clientScopes = new ClientScopes(this);
|
|
@@ -66,6 +70,7 @@ export class KeycloakAdminClient {
|
|
|
66
70
|
const { accessToken, refreshToken } = await getToken({
|
|
67
71
|
baseUrl: this.baseUrl,
|
|
68
72
|
realmName: this.realmName,
|
|
73
|
+
scope: this.scope,
|
|
69
74
|
credentials,
|
|
70
75
|
requestOptions: this.#requestOptions,
|
|
71
76
|
});
|
|
@@ -3,5 +3,6 @@ import type ClientPolicyRepresentation from "./clientPolicyRepresentation.js";
|
|
|
3
3
|
* https://www.keycloak.org/docs-api/15.0/rest-api/#_clientpoliciesrepresentation
|
|
4
4
|
*/
|
|
5
5
|
export default interface ClientPoliciesRepresentation {
|
|
6
|
+
globalPolicies?: ClientPolicyRepresentation[];
|
|
6
7
|
policies?: ClientPolicyRepresentation[];
|
|
7
8
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type OrganizationDomainRepresentation from "./organizationDomainRepresentation.js";
|
|
2
|
+
export default interface OrganizationRepresentation {
|
|
3
|
+
id?: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
enabled?: boolean;
|
|
7
|
+
attributes?: Record<string, string[]>;
|
|
8
|
+
domains?: OrganizationDomainRepresentation[];
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -69,6 +69,7 @@ export default interface RealmRepresentation {
|
|
|
69
69
|
loginWithEmailAllowed?: boolean;
|
|
70
70
|
maxDeltaTimeSeconds?: number;
|
|
71
71
|
maxFailureWaitSeconds?: number;
|
|
72
|
+
maxTemporaryLockouts?: number;
|
|
72
73
|
minimumQuickLoginWaitSeconds?: number;
|
|
73
74
|
notBefore?: number;
|
|
74
75
|
oauth2DeviceCodeLifespan?: number;
|
|
@@ -76,6 +77,7 @@ export default interface RealmRepresentation {
|
|
|
76
77
|
offlineSessionIdleTimeout?: number;
|
|
77
78
|
offlineSessionMaxLifespan?: number;
|
|
78
79
|
offlineSessionMaxLifespanEnabled?: boolean;
|
|
80
|
+
organizationsEnabled?: boolean;
|
|
79
81
|
otpPolicyAlgorithm?: string;
|
|
80
82
|
otpPolicyDigits?: number;
|
|
81
83
|
otpPolicyInitialCounter?: number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export
|
|
1
|
+
export interface UserProfileConfig {
|
|
2
2
|
attributes?: UserProfileAttribute[];
|
|
3
3
|
groups?: UserProfileGroup[];
|
|
4
|
+
unmanagedAttributePolicy?: UnmanagedAttributePolicy;
|
|
4
5
|
}
|
|
5
6
|
export interface UserProfileAttribute {
|
|
6
7
|
name?: string;
|
|
@@ -13,6 +14,7 @@ export interface UserProfileAttribute {
|
|
|
13
14
|
selector?: UserProfileAttributeSelector;
|
|
14
15
|
displayName?: string;
|
|
15
16
|
group?: string;
|
|
17
|
+
multivalued?: boolean;
|
|
16
18
|
}
|
|
17
19
|
export interface UserProfileAttributeRequired {
|
|
18
20
|
roles?: string[];
|
|
@@ -39,6 +41,7 @@ export interface UserProfileAttributeMetadata {
|
|
|
39
41
|
group?: string;
|
|
40
42
|
annotations?: Record<string, unknown>;
|
|
41
43
|
validators?: Record<string, Record<string, unknown>>;
|
|
44
|
+
multivalued?: boolean;
|
|
42
45
|
}
|
|
43
46
|
export interface UserProfileAttributeGroupMetadata {
|
|
44
47
|
name?: string;
|
|
@@ -50,3 +53,9 @@ export interface UserProfileMetadata {
|
|
|
50
53
|
attributes?: UserProfileAttributeMetadata[];
|
|
51
54
|
groups?: UserProfileAttributeGroupMetadata[];
|
|
52
55
|
}
|
|
56
|
+
export declare enum UnmanagedAttributePolicy {
|
|
57
|
+
Disabled = "DISABLED",
|
|
58
|
+
Enabled = "ENABLED",
|
|
59
|
+
AdminView = "ADMIN_VIEW",
|
|
60
|
+
AdminEdit = "ADMIN_EDIT"
|
|
61
|
+
}
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
export
|
|
1
|
+
export var UnmanagedAttributePolicy;
|
|
2
|
+
(function (UnmanagedAttributePolicy) {
|
|
3
|
+
UnmanagedAttributePolicy["Disabled"] = "DISABLED";
|
|
4
|
+
UnmanagedAttributePolicy["Enabled"] = "ENABLED";
|
|
5
|
+
UnmanagedAttributePolicy["AdminView"] = "ADMIN_VIEW";
|
|
6
|
+
UnmanagedAttributePolicy["AdminEdit"] = "ADMIN_EDIT";
|
|
7
|
+
})(UnmanagedAttributePolicy || (UnmanagedAttributePolicy = {}));
|
package/lib/resources/agent.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { isUndefined, last, omit, pick } from "lodash-es";
|
|
2
1
|
import urlJoin from "url-join";
|
|
3
2
|
import { parseTemplate } from "url-template";
|
|
4
3
|
import { fetchWithError, NetworkError, parseResponse, } from "../utils/fetchWithError.js";
|
|
5
4
|
import { stringifyQueryParams } from "../utils/stringifyQueryParams.js";
|
|
6
5
|
// constants
|
|
7
6
|
const SLASH = "/";
|
|
7
|
+
const pick = (value, keys) => Object.fromEntries(Object.entries(value).filter(([key]) => keys.includes(key)));
|
|
8
|
+
const omit = (value, keys) => Object.fromEntries(Object.entries(value).filter(([key]) => !keys.includes(key)));
|
|
8
9
|
export class Agent {
|
|
9
10
|
#client;
|
|
10
11
|
#basePath;
|
|
@@ -20,7 +21,9 @@ export class Agent {
|
|
|
20
21
|
return async (payload = {}, options) => {
|
|
21
22
|
const baseParams = this.#getBaseParams?.() ?? {};
|
|
22
23
|
// Filter query parameters by queryParamKeys
|
|
23
|
-
const queryParams = queryParamKeys.length > 0
|
|
24
|
+
const queryParams = queryParamKeys.length > 0
|
|
25
|
+
? pick(payload, queryParamKeys)
|
|
26
|
+
: undefined;
|
|
24
27
|
// Add filtered payload parameters to base parameters
|
|
25
28
|
const allUrlParamKeys = [...Object.keys(baseParams), ...urlParamKeys];
|
|
26
29
|
const urlParams = { ...baseParams, ...pick(payload, allUrlParamKeys) };
|
|
@@ -108,7 +111,10 @@ export class Agent {
|
|
|
108
111
|
}
|
|
109
112
|
else {
|
|
110
113
|
// Otherwise assume it's JSON and stringify it.
|
|
111
|
-
requestOptions.body =
|
|
114
|
+
requestOptions.body =
|
|
115
|
+
payloadKey && typeof payload[payloadKey] === "string"
|
|
116
|
+
? payload[payloadKey]
|
|
117
|
+
: JSON.stringify(payloadKey ? payload[payloadKey] : payload);
|
|
112
118
|
}
|
|
113
119
|
if (!requestHeaders.has("content-type") && !(payload instanceof FormData)) {
|
|
114
120
|
requestHeaders.set("content-type", "application/json");
|
|
@@ -132,7 +138,7 @@ export class Agent {
|
|
|
132
138
|
if (typeof locationHeader !== "string") {
|
|
133
139
|
throw new Error(`location header is not found in request: ${res.url}`);
|
|
134
140
|
}
|
|
135
|
-
const resourceId =
|
|
141
|
+
const resourceId = locationHeader.split(SLASH).pop();
|
|
136
142
|
if (!resourceId) {
|
|
137
143
|
// throw an error to let users know the response is not expected
|
|
138
144
|
throw new Error(`resourceId is not found in Location header from request: ${res.url}`);
|
|
@@ -161,8 +167,7 @@ export class Agent {
|
|
|
161
167
|
return;
|
|
162
168
|
}
|
|
163
169
|
Object.keys(keyMapping).some((key) => {
|
|
164
|
-
if (
|
|
165
|
-
// Skip if undefined
|
|
170
|
+
if (typeof payload[key] === "undefined") {
|
|
166
171
|
return false;
|
|
167
172
|
}
|
|
168
173
|
const newKey = keyMapping[key];
|
|
@@ -7,87 +7,173 @@ import type AuthenticatorConfigRepresentation from "../defs/authenticatorConfigR
|
|
|
7
7
|
import type { AuthenticationProviderRepresentation } from "../defs/authenticatorConfigRepresentation.js";
|
|
8
8
|
import type AuthenticatorConfigInfoRepresentation from "../defs/authenticatorConfigInfoRepresentation.js";
|
|
9
9
|
import type RequiredActionProviderSimpleRepresentation from "../defs/requiredActionProviderSimpleRepresentation.js";
|
|
10
|
-
|
|
10
|
+
import type RequiredActionConfigInfoRepresentation from "../defs/requiredActionConfigInfoRepresentation.js";
|
|
11
|
+
import type RequiredActionConfigRepresentation from "../defs/requiredActionConfigRepresentation.js";
|
|
12
|
+
export declare class AuthenticationManagement extends Resource<{
|
|
13
|
+
realm?: string;
|
|
14
|
+
}> {
|
|
11
15
|
/**
|
|
12
16
|
* Authentication Management
|
|
13
17
|
* https://www.keycloak.org/docs-api/8.0/rest-api/index.html#_authentication_management_resource
|
|
14
18
|
*/
|
|
15
|
-
registerRequiredAction: (payload?: Record<string, any>
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
registerRequiredAction: (payload?: (Record<string, any> & {
|
|
20
|
+
realm?: string | undefined;
|
|
21
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<any>;
|
|
22
|
+
getRequiredActions: (payload?: (void & {
|
|
23
|
+
realm?: string | undefined;
|
|
24
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<RequiredActionProviderRepresentation[]>;
|
|
25
|
+
getRequiredActionForAlias: (payload?: ({
|
|
18
26
|
alias: string;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
27
|
+
} & {
|
|
28
|
+
realm?: string | undefined;
|
|
29
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<any>;
|
|
30
|
+
getClientAuthenticatorProviders: (payload?: (void & {
|
|
31
|
+
realm?: string | undefined;
|
|
32
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<AuthenticationProviderRepresentation[]>;
|
|
33
|
+
getAuthenticatorProviders: (payload?: (void & {
|
|
34
|
+
realm?: string | undefined;
|
|
35
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<AuthenticationProviderRepresentation[]>;
|
|
36
|
+
getFormActionProviders: (payload?: (void & {
|
|
37
|
+
realm?: string | undefined;
|
|
38
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<AuthenticationProviderRepresentation[]>;
|
|
23
39
|
updateRequiredAction: (query: {
|
|
24
40
|
alias: string;
|
|
41
|
+
} & {
|
|
42
|
+
realm?: string | undefined;
|
|
25
43
|
}, payload: RequiredActionProviderRepresentation) => Promise<void>;
|
|
26
|
-
deleteRequiredAction: (payload?: {
|
|
44
|
+
deleteRequiredAction: (payload?: ({
|
|
27
45
|
alias: string;
|
|
28
|
-
}
|
|
29
|
-
|
|
46
|
+
} & {
|
|
47
|
+
realm?: string | undefined;
|
|
48
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<void>;
|
|
49
|
+
lowerRequiredActionPriority: (payload?: ({
|
|
30
50
|
alias: string;
|
|
31
|
-
}
|
|
32
|
-
|
|
51
|
+
} & {
|
|
52
|
+
realm?: string | undefined;
|
|
53
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<any>;
|
|
54
|
+
raiseRequiredActionPriority: (payload?: ({
|
|
33
55
|
alias: string;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
56
|
+
} & {
|
|
57
|
+
realm?: string | undefined;
|
|
58
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<any>;
|
|
59
|
+
getUnregisteredRequiredActions: (payload?: (void & {
|
|
60
|
+
realm?: string | undefined;
|
|
61
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<RequiredActionProviderSimpleRepresentation[]>;
|
|
62
|
+
getFlows: (payload?: {
|
|
63
|
+
realm?: string | undefined;
|
|
64
|
+
} | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<AuthenticationFlowRepresentation[]>;
|
|
65
|
+
getFlow: (payload?: ({
|
|
38
66
|
flowId: string;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
67
|
+
} & {
|
|
68
|
+
realm?: string | undefined;
|
|
69
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<AuthenticationFlowRepresentation>;
|
|
70
|
+
getFormProviders: (payload?: (void & {
|
|
71
|
+
realm?: string | undefined;
|
|
72
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<AuthenticationProviderRepresentation[]>;
|
|
73
|
+
createFlow: (payload?: (AuthenticationFlowRepresentation & {
|
|
74
|
+
realm?: string | undefined;
|
|
75
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<AuthenticationFlowRepresentation>;
|
|
76
|
+
copyFlow: (payload?: ({
|
|
43
77
|
flow: string;
|
|
44
78
|
newName: string;
|
|
45
|
-
}
|
|
46
|
-
|
|
79
|
+
} & {
|
|
80
|
+
realm?: string | undefined;
|
|
81
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<any>;
|
|
82
|
+
deleteFlow: (payload?: ({
|
|
47
83
|
flowId: string;
|
|
48
|
-
}
|
|
84
|
+
} & {
|
|
85
|
+
realm?: string | undefined;
|
|
86
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<any>;
|
|
49
87
|
updateFlow: (query: {
|
|
50
88
|
flowId: string;
|
|
89
|
+
} & {
|
|
90
|
+
realm?: string | undefined;
|
|
51
91
|
}, payload: AuthenticationFlowRepresentation) => Promise<any>;
|
|
52
|
-
getExecutions: (payload?: {
|
|
92
|
+
getExecutions: (payload?: ({
|
|
53
93
|
flow: string;
|
|
54
|
-
}
|
|
94
|
+
} & {
|
|
95
|
+
realm?: string | undefined;
|
|
96
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<AuthenticationExecutionInfoRepresentation[]>;
|
|
55
97
|
addExecution: (query: {
|
|
56
98
|
flow: string;
|
|
99
|
+
} & {
|
|
100
|
+
realm?: string | undefined;
|
|
57
101
|
}, payload: AuthenticationExecutionInfoRepresentation) => Promise<any>;
|
|
58
|
-
addExecutionToFlow: (payload?: {
|
|
102
|
+
addExecutionToFlow: (payload?: ({
|
|
59
103
|
flow: string;
|
|
60
104
|
provider: string;
|
|
61
|
-
}
|
|
62
|
-
|
|
105
|
+
} & {
|
|
106
|
+
realm?: string | undefined;
|
|
107
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<AuthenticationExecutionInfoRepresentation>;
|
|
108
|
+
addFlowToFlow: (payload?: ({
|
|
63
109
|
flow: string;
|
|
64
110
|
alias: string;
|
|
65
111
|
type: string;
|
|
66
112
|
provider: string;
|
|
67
113
|
description: string;
|
|
68
|
-
}
|
|
114
|
+
} & {
|
|
115
|
+
realm?: string | undefined;
|
|
116
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<AuthenticationFlowRepresentation>;
|
|
69
117
|
updateExecution: (query: {
|
|
70
118
|
flow: string;
|
|
119
|
+
} & {
|
|
120
|
+
realm?: string | undefined;
|
|
71
121
|
}, payload: AuthenticationExecutionInfoRepresentation) => Promise<any>;
|
|
72
|
-
delExecution: (payload?: {
|
|
122
|
+
delExecution: (payload?: ({
|
|
73
123
|
id: string;
|
|
74
|
-
}
|
|
75
|
-
|
|
124
|
+
} & {
|
|
125
|
+
realm?: string | undefined;
|
|
126
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<any>;
|
|
127
|
+
lowerPriorityExecution: (payload?: ({
|
|
76
128
|
id: string;
|
|
77
|
-
}
|
|
78
|
-
|
|
129
|
+
} & {
|
|
130
|
+
realm?: string | undefined;
|
|
131
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<any>;
|
|
132
|
+
raisePriorityExecution: (payload?: ({
|
|
79
133
|
id: string;
|
|
80
|
-
}
|
|
81
|
-
|
|
134
|
+
} & {
|
|
135
|
+
realm?: string | undefined;
|
|
136
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<any>;
|
|
137
|
+
getRequiredActionConfigDescription: (payload?: ({
|
|
138
|
+
alias: string;
|
|
139
|
+
} & {
|
|
140
|
+
realm?: string | undefined;
|
|
141
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<RequiredActionConfigInfoRepresentation>;
|
|
142
|
+
getRequiredActionConfig: (payload?: ({
|
|
143
|
+
alias: string;
|
|
144
|
+
} & {
|
|
145
|
+
realm?: string | undefined;
|
|
146
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<RequiredActionConfigRepresentation>;
|
|
147
|
+
removeRequiredActionConfig: (payload?: ({
|
|
148
|
+
alias: string;
|
|
149
|
+
} & {
|
|
150
|
+
realm?: string | undefined;
|
|
151
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<any>;
|
|
152
|
+
updateRequiredActionConfig: (query: {
|
|
153
|
+
alias: string;
|
|
154
|
+
} & {
|
|
155
|
+
realm?: string | undefined;
|
|
156
|
+
}, payload: RequiredActionConfigRepresentation) => Promise<void>;
|
|
157
|
+
getConfigDescription: (payload?: ({
|
|
82
158
|
providerId: string;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
159
|
+
} & {
|
|
160
|
+
realm?: string | undefined;
|
|
161
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<AuthenticatorConfigInfoRepresentation>;
|
|
162
|
+
createConfig: (payload?: (AuthenticatorConfigRepresentation & {
|
|
163
|
+
realm?: string | undefined;
|
|
164
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<AuthenticatorConfigRepresentation>;
|
|
165
|
+
updateConfig: (payload?: (AuthenticatorConfigRepresentation & {
|
|
166
|
+
realm?: string | undefined;
|
|
167
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<void>;
|
|
168
|
+
getConfig: (payload?: ({
|
|
87
169
|
id: string;
|
|
88
|
-
}
|
|
89
|
-
|
|
170
|
+
} & {
|
|
171
|
+
realm?: string | undefined;
|
|
172
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<AuthenticatorConfigRepresentation>;
|
|
173
|
+
delConfig: (payload?: ({
|
|
90
174
|
id: string;
|
|
91
|
-
}
|
|
175
|
+
} & {
|
|
176
|
+
realm?: string | undefined;
|
|
177
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<any>;
|
|
92
178
|
constructor(client: KeycloakAdminClient);
|
|
93
179
|
}
|
|
@@ -137,6 +137,30 @@ export class AuthenticationManagement extends Resource {
|
|
|
137
137
|
path: "/executions/{id}/raise-priority",
|
|
138
138
|
urlParamKeys: ["id"],
|
|
139
139
|
});
|
|
140
|
+
// Get required actions provider's configuration description
|
|
141
|
+
getRequiredActionConfigDescription = this.makeRequest({
|
|
142
|
+
method: "GET",
|
|
143
|
+
path: "/required-actions/{alias}/config-description",
|
|
144
|
+
urlParamKeys: ["alias"],
|
|
145
|
+
});
|
|
146
|
+
// Get the configuration of the RequiredAction provider in the current Realm.
|
|
147
|
+
getRequiredActionConfig = this.makeRequest({
|
|
148
|
+
method: "GET",
|
|
149
|
+
path: "/required-actions/{alias}/config",
|
|
150
|
+
urlParamKeys: ["alias"],
|
|
151
|
+
});
|
|
152
|
+
// Remove the configuration from the RequiredAction provider in the current Realm.
|
|
153
|
+
removeRequiredActionConfig = this.makeRequest({
|
|
154
|
+
method: "DELETE",
|
|
155
|
+
path: "/required-actions/{alias}/config",
|
|
156
|
+
urlParamKeys: ["alias"],
|
|
157
|
+
});
|
|
158
|
+
// Update the configuration from the RequiredAction provider in the current Realm.
|
|
159
|
+
updateRequiredActionConfig = this.makeUpdateRequest({
|
|
160
|
+
method: "PUT",
|
|
161
|
+
path: "/required-actions/{alias}/config",
|
|
162
|
+
urlParamKeys: ["alias"],
|
|
163
|
+
});
|
|
140
164
|
getConfigDescription = this.makeRequest({
|
|
141
165
|
method: "GET",
|
|
142
166
|
path: "config-description/{providerId}",
|
|
@@ -17,9 +17,11 @@ export declare class ClientPolicies extends Resource<{
|
|
|
17
17
|
createProfiles: (payload?: (ClientProfilesRepresentation & {
|
|
18
18
|
realm?: string | undefined;
|
|
19
19
|
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<void>;
|
|
20
|
-
listPolicies: (payload?: {
|
|
20
|
+
listPolicies: (payload?: ({
|
|
21
|
+
includeGlobalPolicies?: boolean | undefined;
|
|
22
|
+
} & {
|
|
21
23
|
realm?: string | undefined;
|
|
22
|
-
} | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<ClientPoliciesRepresentation>;
|
|
24
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<ClientPoliciesRepresentation>;
|
|
23
25
|
updatePolicy: (payload?: (ClientPoliciesRepresentation & {
|
|
24
26
|
realm?: string | undefined;
|
|
25
27
|
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<void>;
|
|
@@ -29,6 +29,10 @@ export class ClientPolicies extends Resource {
|
|
|
29
29
|
listPolicies = this.makeRequest({
|
|
30
30
|
method: "GET",
|
|
31
31
|
path: "/policies",
|
|
32
|
+
queryParamKeys: ["include-global-policies"],
|
|
33
|
+
keyTransform: {
|
|
34
|
+
includeGlobalPolicies: "include-global-policies",
|
|
35
|
+
},
|
|
32
36
|
});
|
|
33
37
|
updatePolicy = this.makeRequest({
|
|
34
38
|
method: "PUT",
|
|
@@ -27,6 +27,7 @@ export interface ClientQuery extends PaginatedQuery {
|
|
|
27
27
|
clientId?: string;
|
|
28
28
|
viewableOnly?: boolean;
|
|
29
29
|
search?: boolean;
|
|
30
|
+
q?: string;
|
|
30
31
|
}
|
|
31
32
|
export interface ResourceQuery extends PaginatedQuery {
|
|
32
33
|
id?: string;
|
|
@@ -93,7 +94,7 @@ export declare class Clients extends Resource<{
|
|
|
93
94
|
roleName: string;
|
|
94
95
|
} & {
|
|
95
96
|
realm?: string | undefined;
|
|
96
|
-
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<RoleRepresentation>;
|
|
97
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<RoleRepresentation | null>;
|
|
97
98
|
updateRole: (query: {
|
|
98
99
|
id: string;
|
|
99
100
|
roleName: string;
|
|
@@ -7,6 +7,7 @@ import type { RoleMappingPayload } from "../defs/roleRepresentation.js";
|
|
|
7
7
|
import type UserRepresentation from "../defs/userRepresentation.js";
|
|
8
8
|
import Resource from "./resource.js";
|
|
9
9
|
interface Query {
|
|
10
|
+
q?: string;
|
|
10
11
|
search?: string;
|
|
11
12
|
exact?: boolean;
|
|
12
13
|
}
|
|
@@ -18,7 +19,7 @@ interface SummarizedQuery {
|
|
|
18
19
|
briefRepresentation?: boolean;
|
|
19
20
|
}
|
|
20
21
|
export type GroupQuery = Query & PaginatedQuery & SummarizedQuery;
|
|
21
|
-
export type SubGroupQuery = PaginatedQuery & SummarizedQuery & {
|
|
22
|
+
export type SubGroupQuery = Query & PaginatedQuery & SummarizedQuery & {
|
|
22
23
|
parentId: string;
|
|
23
24
|
};
|
|
24
25
|
export interface GroupCountQuery {
|
|
@@ -96,7 +97,7 @@ export declare class Groups extends Resource<{
|
|
|
96
97
|
/**
|
|
97
98
|
* Finds all subgroups on the specified parent group matching the provided parameters.
|
|
98
99
|
*/
|
|
99
|
-
listSubGroups: (payload?: (PaginatedQuery & SummarizedQuery & {
|
|
100
|
+
listSubGroups: (payload?: (Query & PaginatedQuery & SummarizedQuery & {
|
|
100
101
|
parentId: string;
|
|
101
102
|
} & {
|
|
102
103
|
realm?: string | undefined;
|
package/lib/resources/groups.js
CHANGED
|
@@ -2,7 +2,14 @@ import Resource from "./resource.js";
|
|
|
2
2
|
export class Groups extends Resource {
|
|
3
3
|
find = this.makeRequest({
|
|
4
4
|
method: "GET",
|
|
5
|
-
queryParamKeys: [
|
|
5
|
+
queryParamKeys: [
|
|
6
|
+
"search",
|
|
7
|
+
"q",
|
|
8
|
+
"exact",
|
|
9
|
+
"briefRepresentation",
|
|
10
|
+
"first",
|
|
11
|
+
"max",
|
|
12
|
+
],
|
|
6
13
|
});
|
|
7
14
|
create = this.makeRequest({
|
|
8
15
|
method: "POST",
|
|
@@ -70,7 +77,7 @@ export class Groups extends Resource {
|
|
|
70
77
|
method: "GET",
|
|
71
78
|
path: "/{parentId}/children",
|
|
72
79
|
urlParamKeys: ["parentId"],
|
|
73
|
-
queryParamKeys: ["first", "max", "briefRepresentation"],
|
|
80
|
+
queryParamKeys: ["search", "first", "max", "briefRepresentation"],
|
|
74
81
|
catchNotFound: true,
|
|
75
82
|
});
|
|
76
83
|
/**
|
|
@@ -4,6 +4,13 @@ import type { IdentityProviderMapperTypeRepresentation } from "../defs/identityP
|
|
|
4
4
|
import type IdentityProviderRepresentation from "../defs/identityProviderRepresentation.js";
|
|
5
5
|
import type { ManagementPermissionReference } from "../defs/managementPermissionReference.js";
|
|
6
6
|
import Resource from "./resource.js";
|
|
7
|
+
export interface PaginatedQuery {
|
|
8
|
+
first?: number;
|
|
9
|
+
max?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface IdentityProvidersQuery extends PaginatedQuery {
|
|
12
|
+
search?: string;
|
|
13
|
+
}
|
|
7
14
|
export declare class IdentityProviders extends Resource<{
|
|
8
15
|
realm?: string;
|
|
9
16
|
}> {
|
|
@@ -11,9 +18,9 @@ export declare class IdentityProviders extends Resource<{
|
|
|
11
18
|
* Identity provider
|
|
12
19
|
* https://www.keycloak.org/docs-api/11.0/rest-api/#_identity_providers_resource
|
|
13
20
|
*/
|
|
14
|
-
find: (payload?: {
|
|
21
|
+
find: (payload?: (IdentityProvidersQuery & {
|
|
15
22
|
realm?: string | undefined;
|
|
16
|
-
} | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<IdentityProviderRepresentation[]>;
|
|
23
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<IdentityProviderRepresentation[]>;
|
|
17
24
|
create: (payload?: (IdentityProviderRepresentation & {
|
|
18
25
|
realm?: string | undefined;
|
|
19
26
|
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<{
|
|
@@ -91,5 +98,10 @@ export declare class IdentityProviders extends Resource<{
|
|
|
91
98
|
} & {
|
|
92
99
|
realm?: string | undefined;
|
|
93
100
|
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<ManagementPermissionReference>;
|
|
101
|
+
reloadKeys: (payload?: ({
|
|
102
|
+
alias: string;
|
|
103
|
+
} & {
|
|
104
|
+
realm?: string | undefined;
|
|
105
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<boolean>;
|
|
94
106
|
constructor(client: KeycloakAdminClient);
|
|
95
107
|
}
|
|
@@ -81,6 +81,11 @@ export class IdentityProviders extends Resource {
|
|
|
81
81
|
path: "/instances/{alias}/management/permissions",
|
|
82
82
|
urlParamKeys: ["alias"],
|
|
83
83
|
});
|
|
84
|
+
reloadKeys = this.makeRequest({
|
|
85
|
+
method: "GET",
|
|
86
|
+
path: "/instances/{alias}/reload-keys",
|
|
87
|
+
urlParamKeys: ["alias"],
|
|
88
|
+
});
|
|
84
89
|
constructor(client) {
|
|
85
90
|
super(client, {
|
|
86
91
|
path: "/admin/realms/{realm}/identity-provider",
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { KeycloakAdminClient } from "../client.js";
|
|
2
|
+
import IdentityProviderRepresentation from "../defs/identityProviderRepresentation.js";
|
|
3
|
+
import type OrganizationRepresentation from "../defs/organizationRepresentation.js";
|
|
4
|
+
import UserRepresentation from "../defs/userRepresentation.js";
|
|
5
|
+
import Resource from "./resource.js";
|
|
6
|
+
interface PaginatedQuery {
|
|
7
|
+
first?: number;
|
|
8
|
+
max?: number;
|
|
9
|
+
search?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface OrganizationQuery extends PaginatedQuery {
|
|
12
|
+
q?: string;
|
|
13
|
+
exact?: boolean;
|
|
14
|
+
}
|
|
15
|
+
interface MemberQuery extends PaginatedQuery {
|
|
16
|
+
orgId: string;
|
|
17
|
+
}
|
|
18
|
+
export declare class Organizations extends Resource<{
|
|
19
|
+
realm?: string;
|
|
20
|
+
}> {
|
|
21
|
+
/**
|
|
22
|
+
* Organizations
|
|
23
|
+
*/
|
|
24
|
+
constructor(client: KeycloakAdminClient);
|
|
25
|
+
find: (payload?: (OrganizationQuery & {
|
|
26
|
+
realm?: string | undefined;
|
|
27
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<OrganizationRepresentation[]>;
|
|
28
|
+
findOne: (payload?: ({
|
|
29
|
+
id: string;
|
|
30
|
+
} & {
|
|
31
|
+
realm?: string | undefined;
|
|
32
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<OrganizationRepresentation>;
|
|
33
|
+
create: (payload?: (OrganizationRepresentation & {
|
|
34
|
+
realm?: string | undefined;
|
|
35
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<{
|
|
36
|
+
id: string;
|
|
37
|
+
}>;
|
|
38
|
+
delById: (payload?: ({
|
|
39
|
+
id: string;
|
|
40
|
+
} & {
|
|
41
|
+
realm?: string | undefined;
|
|
42
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<void>;
|
|
43
|
+
updateById: (query: {
|
|
44
|
+
id: string;
|
|
45
|
+
} & {
|
|
46
|
+
realm?: string | undefined;
|
|
47
|
+
}, payload: OrganizationRepresentation) => Promise<void>;
|
|
48
|
+
listMembers: (payload?: (MemberQuery & {
|
|
49
|
+
realm?: string | undefined;
|
|
50
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<UserRepresentation[]>;
|
|
51
|
+
addMember: (payload?: ({
|
|
52
|
+
orgId: string;
|
|
53
|
+
userId: string;
|
|
54
|
+
} & {
|
|
55
|
+
realm?: string | undefined;
|
|
56
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<string>;
|
|
57
|
+
delMember: (payload?: ({
|
|
58
|
+
orgId: string;
|
|
59
|
+
userId: string;
|
|
60
|
+
} & {
|
|
61
|
+
realm?: string | undefined;
|
|
62
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<string>;
|
|
63
|
+
invite: (query: {
|
|
64
|
+
orgId: string;
|
|
65
|
+
} & {
|
|
66
|
+
realm?: string | undefined;
|
|
67
|
+
}, payload: FormData) => Promise<any>;
|
|
68
|
+
listIdentityProviders: (payload?: ({
|
|
69
|
+
orgId: string;
|
|
70
|
+
} & {
|
|
71
|
+
realm?: string | undefined;
|
|
72
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<IdentityProviderRepresentation[]>;
|
|
73
|
+
linkIdp: (payload?: ({
|
|
74
|
+
orgId: string;
|
|
75
|
+
alias: string;
|
|
76
|
+
} & {
|
|
77
|
+
realm?: string | undefined;
|
|
78
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<string>;
|
|
79
|
+
unLinkIdp: (payload?: ({
|
|
80
|
+
orgId: string;
|
|
81
|
+
alias: string;
|
|
82
|
+
} & {
|
|
83
|
+
realm?: string | undefined;
|
|
84
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<string>;
|
|
85
|
+
}
|
|
86
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import Resource from "./resource.js";
|
|
2
|
+
export class Organizations extends Resource {
|
|
3
|
+
/**
|
|
4
|
+
* Organizations
|
|
5
|
+
*/
|
|
6
|
+
constructor(client) {
|
|
7
|
+
super(client, {
|
|
8
|
+
path: "/admin/realms/{realm}/organizations",
|
|
9
|
+
getUrlParams: () => ({
|
|
10
|
+
realm: client.realmName,
|
|
11
|
+
}),
|
|
12
|
+
getBaseUrl: () => client.baseUrl,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
find = this.makeRequest({
|
|
16
|
+
method: "GET",
|
|
17
|
+
path: "/",
|
|
18
|
+
});
|
|
19
|
+
findOne = this.makeRequest({
|
|
20
|
+
method: "GET",
|
|
21
|
+
path: "/{id}",
|
|
22
|
+
urlParamKeys: ["id"],
|
|
23
|
+
});
|
|
24
|
+
create = this.makeRequest({
|
|
25
|
+
method: "POST",
|
|
26
|
+
path: "/",
|
|
27
|
+
returnResourceIdInLocationHeader: { field: "id" },
|
|
28
|
+
});
|
|
29
|
+
delById = this.makeRequest({
|
|
30
|
+
method: "DELETE",
|
|
31
|
+
path: "/{id}",
|
|
32
|
+
urlParamKeys: ["id"],
|
|
33
|
+
});
|
|
34
|
+
updateById = this.makeUpdateRequest({
|
|
35
|
+
method: "PUT",
|
|
36
|
+
path: "/{id}",
|
|
37
|
+
urlParamKeys: ["id"],
|
|
38
|
+
});
|
|
39
|
+
listMembers = this.makeRequest({
|
|
40
|
+
method: "GET",
|
|
41
|
+
path: "/{orgId}/members",
|
|
42
|
+
urlParamKeys: ["orgId"],
|
|
43
|
+
});
|
|
44
|
+
addMember = this.makeRequest({
|
|
45
|
+
method: "POST",
|
|
46
|
+
path: "/{orgId}/members",
|
|
47
|
+
urlParamKeys: ["orgId"],
|
|
48
|
+
payloadKey: "userId",
|
|
49
|
+
});
|
|
50
|
+
delMember = this.makeRequest({
|
|
51
|
+
method: "DELETE",
|
|
52
|
+
path: "/{orgId}/members/{userId}",
|
|
53
|
+
urlParamKeys: ["orgId", "userId"],
|
|
54
|
+
});
|
|
55
|
+
invite = this.makeUpdateRequest({
|
|
56
|
+
method: "POST",
|
|
57
|
+
path: "/{orgId}/members/invite-user",
|
|
58
|
+
urlParamKeys: ["orgId"],
|
|
59
|
+
});
|
|
60
|
+
listIdentityProviders = this.makeRequest({
|
|
61
|
+
method: "GET",
|
|
62
|
+
path: "/{orgId}/identity-providers",
|
|
63
|
+
urlParamKeys: ["orgId"],
|
|
64
|
+
});
|
|
65
|
+
linkIdp = this.makeRequest({
|
|
66
|
+
method: "POST",
|
|
67
|
+
path: "/{orgId}/identity-providers",
|
|
68
|
+
urlParamKeys: ["orgId"],
|
|
69
|
+
payloadKey: "alias",
|
|
70
|
+
});
|
|
71
|
+
unLinkIdp = this.makeRequest({
|
|
72
|
+
method: "DELETE",
|
|
73
|
+
path: "/{orgId}/identity-providers/{alias}",
|
|
74
|
+
urlParamKeys: ["orgId", "alias"],
|
|
75
|
+
});
|
|
76
|
+
}
|
|
@@ -146,6 +146,7 @@ export declare class Realms extends Resource {
|
|
|
146
146
|
deleteSession: (payload?: {
|
|
147
147
|
realm: string;
|
|
148
148
|
session: string;
|
|
149
|
+
isOffline: boolean;
|
|
149
150
|
} | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<void>;
|
|
150
151
|
pushRevocation: (payload?: {
|
|
151
152
|
realm: string;
|
package/lib/resources/realms.js
CHANGED
|
@@ -7,6 +7,6 @@ export default class Resource<ParamType = {}> {
|
|
|
7
7
|
getUrlParams?: () => Record<string, any>;
|
|
8
8
|
getBaseUrl?: () => string;
|
|
9
9
|
});
|
|
10
|
-
makeRequest: <PayloadType = any,
|
|
11
|
-
makeUpdateRequest: <QueryType = any, PayloadType = any,
|
|
10
|
+
makeRequest: <PayloadType = any, ResponseType = any>(args: RequestArgs) => ((payload?: PayloadType & ParamType, options?: Pick<RequestArgs, "catchNotFound">) => Promise<ResponseType>);
|
|
11
|
+
makeUpdateRequest: <QueryType = any, PayloadType = any, ResponseType = any>(args: RequestArgs) => ((query: QueryType & ParamType, payload: PayloadType) => Promise<ResponseType>);
|
|
12
12
|
}
|
|
@@ -2,14 +2,15 @@ import Resource from "./resource.js";
|
|
|
2
2
|
import type { ServerInfoRepresentation } from "../defs/serverInfoRepesentation.js";
|
|
3
3
|
import type KeycloakAdminClient from "../index.js";
|
|
4
4
|
import type EffectiveMessageBundleRepresentation from "../defs/effectiveMessageBundleRepresentation.js";
|
|
5
|
+
export interface MessageBundleQuery {
|
|
6
|
+
realm: string;
|
|
7
|
+
theme?: string;
|
|
8
|
+
themeType?: string;
|
|
9
|
+
locale?: string;
|
|
10
|
+
source?: boolean;
|
|
11
|
+
}
|
|
5
12
|
export declare class ServerInfo extends Resource {
|
|
6
13
|
constructor(client: KeycloakAdminClient);
|
|
7
14
|
find: (payload?: {} | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<ServerInfoRepresentation>;
|
|
8
|
-
findEffectiveMessageBundles: (payload?:
|
|
9
|
-
realm: string;
|
|
10
|
-
theme?: string | undefined;
|
|
11
|
-
themeType?: string | undefined;
|
|
12
|
-
locale?: string | undefined;
|
|
13
|
-
source?: boolean | undefined;
|
|
14
|
-
} | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<EffectiveMessageBundleRepresentation[]>;
|
|
15
|
+
findEffectiveMessageBundles: (payload?: MessageBundleQuery | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<EffectiveMessageBundleRepresentation[]>;
|
|
15
16
|
}
|
package/lib/resources/users.d.ts
CHANGED
|
@@ -6,8 +6,7 @@ import type MappingsRepresentation from "../defs/mappingsRepresentation.js";
|
|
|
6
6
|
import type RoleRepresentation from "../defs/roleRepresentation.js";
|
|
7
7
|
import type { RoleMappingPayload } from "../defs/roleRepresentation.js";
|
|
8
8
|
import type UserConsentRepresentation from "../defs/userConsentRepresentation.js";
|
|
9
|
-
import type UserProfileConfig from "../defs/userProfileMetadata.js";
|
|
10
|
-
import type { UserProfileMetadata } from "../defs/userProfileMetadata.js";
|
|
9
|
+
import type { UserProfileConfig, UserProfileMetadata } from "../defs/userProfileMetadata.js";
|
|
11
10
|
import type UserRepresentation from "../defs/userRepresentation.js";
|
|
12
11
|
import type UserSessionRepresentation from "../defs/userSessionRepresentation.js";
|
|
13
12
|
import Resource from "./resource.js";
|
|
@@ -23,6 +22,7 @@ interface UserBaseQuery {
|
|
|
23
22
|
firstName?: string;
|
|
24
23
|
lastName?: string;
|
|
25
24
|
username?: string;
|
|
25
|
+
q?: string;
|
|
26
26
|
}
|
|
27
27
|
export interface UserQuery extends PaginationQuery, SearchQuery, UserBaseQuery {
|
|
28
28
|
exact?: boolean;
|
|
@@ -325,6 +325,11 @@ export declare class Users extends Resource<{
|
|
|
325
325
|
} & {
|
|
326
326
|
realm?: string | undefined;
|
|
327
327
|
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<void>;
|
|
328
|
+
getUnmanagedAttributes: (payload?: ({
|
|
329
|
+
id: string;
|
|
330
|
+
} & {
|
|
331
|
+
realm?: string | undefined;
|
|
332
|
+
}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<Record<string, string[]>>;
|
|
328
333
|
constructor(client: KeycloakAdminClient);
|
|
329
334
|
}
|
|
330
335
|
export {};
|
package/lib/resources/users.js
CHANGED
|
@@ -283,6 +283,11 @@ export class Users extends Resource {
|
|
|
283
283
|
path: "/{id}/consents/{clientId}",
|
|
284
284
|
urlParamKeys: ["id", "clientId"],
|
|
285
285
|
});
|
|
286
|
+
getUnmanagedAttributes = this.makeRequest({
|
|
287
|
+
method: "GET",
|
|
288
|
+
path: "/{id}/unmanagedAttributes",
|
|
289
|
+
urlParamKeys: ["id"],
|
|
290
|
+
});
|
|
286
291
|
constructor(client) {
|
|
287
292
|
super(client, {
|
|
288
293
|
path: "/admin/realms/{realm}/users",
|
package/lib/utils/auth.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keycloak/keycloak-admin-client",
|
|
3
|
-
"version": "25.0.
|
|
3
|
+
"version": "25.0.4",
|
|
4
4
|
"description": "A client to interact with Keycloak's Administration API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
]
|
|
25
25
|
},
|
|
26
26
|
"lint": {
|
|
27
|
-
"command": "eslint .
|
|
27
|
+
"command": "eslint ."
|
|
28
28
|
},
|
|
29
29
|
"test": {
|
|
30
30
|
"command": "TS_NODE_PROJECT=tsconfig.test.json mocha --recursive \"test/**/*.spec.ts\" --timeout 10000"
|
|
@@ -32,19 +32,19 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"camelize-ts": "^3.0.0",
|
|
35
|
-
"lodash-es": "^4.17.21",
|
|
36
35
|
"url-join": "^5.0.0",
|
|
37
|
-
"url-template": "^3.1.
|
|
36
|
+
"url-template": "^3.1.1"
|
|
38
37
|
},
|
|
39
38
|
"devDependencies": {
|
|
40
|
-
"@faker-js/faker": "^8.
|
|
41
|
-
"@types/chai": "^4.3.
|
|
39
|
+
"@faker-js/faker": "^8.4.1",
|
|
40
|
+
"@types/chai": "^4.3.16",
|
|
42
41
|
"@types/lodash-es": "^4.17.12",
|
|
43
42
|
"@types/mocha": "^10.0.6",
|
|
44
|
-
"@types/node": "^20.
|
|
45
|
-
"chai": "^
|
|
46
|
-
"
|
|
47
|
-
"
|
|
43
|
+
"@types/node": "^20.14.2",
|
|
44
|
+
"chai": "^5.1.1",
|
|
45
|
+
"lodash-es": "^4.17.21",
|
|
46
|
+
"mocha": "^10.4.0",
|
|
47
|
+
"ts-node": "^10.9.2"
|
|
48
48
|
},
|
|
49
49
|
"author": {
|
|
50
50
|
"name": "Red Hat, Inc.",
|
|
@@ -53,7 +53,8 @@
|
|
|
53
53
|
"license": "Apache-2.0",
|
|
54
54
|
"repository": {
|
|
55
55
|
"type": "git",
|
|
56
|
-
"url": "https://github.com/keycloak/keycloak.git"
|
|
56
|
+
"url": "https://github.com/keycloak/keycloak.git",
|
|
57
|
+
"directory": "js/libs/keycloak-admin-client"
|
|
57
58
|
},
|
|
58
59
|
"homepage": "https://www.keycloak.org/",
|
|
59
60
|
"scripts": {
|