@keycloak/keycloak-admin-client 25.0.2 → 25.0.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.
Files changed (38) hide show
  1. package/README.md +3 -3
  2. package/lib/client.d.ts +0 -3
  3. package/lib/client.js +0 -5
  4. package/lib/defs/authenticatorConfigRepresentation.d.ts +0 -1
  5. package/lib/defs/clientPoliciesRepresentation.d.ts +0 -1
  6. package/lib/defs/effectiveMessageBundleRepresentation.d.ts +4 -3
  7. package/lib/defs/realmRepresentation.d.ts +0 -2
  8. package/lib/defs/userProfileMetadata.d.ts +1 -10
  9. package/lib/defs/userProfileMetadata.js +1 -7
  10. package/lib/defs/userSessionRepresentation.d.ts +0 -1
  11. package/lib/resources/agent.js +6 -11
  12. package/lib/resources/authenticationManagement.d.ts +44 -130
  13. package/lib/resources/authenticationManagement.js +0 -24
  14. package/lib/resources/clientPolicies.d.ts +2 -4
  15. package/lib/resources/clientPolicies.js +0 -4
  16. package/lib/resources/clients.d.ts +1 -2
  17. package/lib/resources/groups.d.ts +2 -3
  18. package/lib/resources/groups.js +2 -9
  19. package/lib/resources/identityProviders.d.ts +2 -14
  20. package/lib/resources/identityProviders.js +0 -5
  21. package/lib/resources/realms.d.ts +0 -1
  22. package/lib/resources/realms.js +0 -1
  23. package/lib/resources/resource.d.ts +2 -2
  24. package/lib/resources/serverInfo.d.ts +7 -8
  25. package/lib/resources/users.d.ts +2 -7
  26. package/lib/resources/users.js +0 -5
  27. package/lib/utils/auth.d.ts +0 -1
  28. package/package.json +11 -12
  29. package/lib/defs/organizationDomainRepresentation.d.ts +0 -4
  30. package/lib/defs/organizationDomainRepresentation.js +0 -1
  31. package/lib/defs/organizationRepresentation.d.ts +0 -9
  32. package/lib/defs/organizationRepresentation.js +0 -1
  33. package/lib/defs/requiredActionConfigInfoRepresentation.d.ts +0 -4
  34. package/lib/defs/requiredActionConfigInfoRepresentation.js +0 -1
  35. package/lib/defs/requiredActionConfigRepresentation.d.ts +0 -5
  36. package/lib/defs/requiredActionConfigRepresentation.js +0 -1
  37. package/lib/resources/organizations.d.ts +0 -86
  38. package/lib/resources/organizations.js +0 -76
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 kcAdminClient.users.create({
56
+ await this.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 build
110
+ pnpm run build
111
111
  ```
112
112
 
113
113
  Start the Keycloak server:
114
114
 
115
115
  ```bash
116
- pnpm server:start
116
+ pnpm run 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,7 +9,6 @@ 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";
13
12
  import { Roles } from "./resources/roles.js";
14
13
  import { ServerInfo } from "./resources/serverInfo.js";
15
14
  import { Users } from "./resources/users.js";
@@ -31,7 +30,6 @@ export declare class KeycloakAdminClient {
31
30
  userStorageProvider: UserStorageProvider;
32
31
  groups: Groups;
33
32
  roles: Roles;
34
- organizations: Organizations;
35
33
  clients: Clients;
36
34
  realms: Realms;
37
35
  clientScopes: ClientScopes;
@@ -45,7 +43,6 @@ export declare class KeycloakAdminClient {
45
43
  cache: Cache;
46
44
  baseUrl: string;
47
45
  realmName: string;
48
- scope?: string;
49
46
  accessToken?: string;
50
47
  refreshToken?: string;
51
48
  constructor(connectionConfig?: ConnectionConfig);
package/lib/client.js CHANGED
@@ -8,7 +8,6 @@ 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";
12
11
  import { Roles } from "./resources/roles.js";
13
12
  import { ServerInfo } from "./resources/serverInfo.js";
14
13
  import { Users } from "./resources/users.js";
@@ -22,7 +21,6 @@ export class KeycloakAdminClient {
22
21
  userStorageProvider;
23
22
  groups;
24
23
  roles;
25
- organizations;
26
24
  clients;
27
25
  realms;
28
26
  clientScopes;
@@ -37,7 +35,6 @@ export class KeycloakAdminClient {
37
35
  // Members
38
36
  baseUrl;
39
37
  realmName;
40
- scope;
41
38
  accessToken;
42
39
  refreshToken;
43
40
  #requestOptions;
@@ -53,7 +50,6 @@ export class KeycloakAdminClient {
53
50
  this.userStorageProvider = new UserStorageProvider(this);
54
51
  this.groups = new Groups(this);
55
52
  this.roles = new Roles(this);
56
- this.organizations = new Organizations(this);
57
53
  this.clients = new Clients(this);
58
54
  this.realms = new Realms(this);
59
55
  this.clientScopes = new ClientScopes(this);
@@ -70,7 +66,6 @@ export class KeycloakAdminClient {
70
66
  const { accessToken, refreshToken } = await getToken({
71
67
  baseUrl: this.baseUrl,
72
68
  realmName: this.realmName,
73
- scope: this.scope,
74
69
  credentials,
75
70
  requestOptions: this.#requestOptions,
76
71
  });
@@ -12,5 +12,4 @@ export interface AuthenticationProviderRepresentation {
12
12
  id?: string;
13
13
  displayName?: string;
14
14
  description?: string;
15
- supportsSecret?: boolean;
16
15
  }
@@ -3,6 +3,5 @@ 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[];
7
6
  policies?: ClientPolicyRepresentation[];
8
7
  }
@@ -1,5 +1,6 @@
1
1
  export default interface EffectiveMessageBundleRepresentation {
2
- key: string;
3
- value: string;
4
- source: "THEME" | "REALM";
2
+ theme?: string;
3
+ themeType?: string;
4
+ locale?: string;
5
+ source?: boolean;
5
6
  }
@@ -69,7 +69,6 @@ export default interface RealmRepresentation {
69
69
  loginWithEmailAllowed?: boolean;
70
70
  maxDeltaTimeSeconds?: number;
71
71
  maxFailureWaitSeconds?: number;
72
- maxTemporaryLockouts?: number;
73
72
  minimumQuickLoginWaitSeconds?: number;
74
73
  notBefore?: number;
75
74
  oauth2DeviceCodeLifespan?: number;
@@ -77,7 +76,6 @@ export default interface RealmRepresentation {
77
76
  offlineSessionIdleTimeout?: number;
78
77
  offlineSessionMaxLifespan?: number;
79
78
  offlineSessionMaxLifespanEnabled?: boolean;
80
- organizationsEnabled?: boolean;
81
79
  otpPolicyAlgorithm?: string;
82
80
  otpPolicyDigits?: number;
83
81
  otpPolicyInitialCounter?: number;
@@ -1,7 +1,6 @@
1
- export interface UserProfileConfig {
1
+ export default interface UserProfileConfig {
2
2
  attributes?: UserProfileAttribute[];
3
3
  groups?: UserProfileGroup[];
4
- unmanagedAttributePolicy?: UnmanagedAttributePolicy;
5
4
  }
6
5
  export interface UserProfileAttribute {
7
6
  name?: string;
@@ -14,7 +13,6 @@ export interface UserProfileAttribute {
14
13
  selector?: UserProfileAttributeSelector;
15
14
  displayName?: string;
16
15
  group?: string;
17
- multivalued?: boolean;
18
16
  }
19
17
  export interface UserProfileAttributeRequired {
20
18
  roles?: string[];
@@ -41,7 +39,6 @@ export interface UserProfileAttributeMetadata {
41
39
  group?: string;
42
40
  annotations?: Record<string, unknown>;
43
41
  validators?: Record<string, Record<string, unknown>>;
44
- multivalued?: boolean;
45
42
  }
46
43
  export interface UserProfileAttributeGroupMetadata {
47
44
  name?: string;
@@ -53,9 +50,3 @@ export interface UserProfileMetadata {
53
50
  attributes?: UserProfileAttributeMetadata[];
54
51
  groups?: UserProfileAttributeGroupMetadata[];
55
52
  }
56
- export declare enum UnmanagedAttributePolicy {
57
- Disabled = "DISABLED",
58
- Enabled = "ENABLED",
59
- AdminView = "ADMIN_VIEW",
60
- AdminEdit = "ADMIN_EDIT"
61
- }
@@ -1,7 +1 @@
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 = {}));
1
+ export {};
@@ -6,5 +6,4 @@ export default interface UserSessionRepresentation {
6
6
  start?: number;
7
7
  userId?: string;
8
8
  username?: string;
9
- transientUser?: boolean;
10
9
  }
@@ -1,11 +1,10 @@
1
+ import { isUndefined, last, omit, pick } from "lodash-es";
1
2
  import urlJoin from "url-join";
2
3
  import { parseTemplate } from "url-template";
3
4
  import { fetchWithError, NetworkError, parseResponse, } from "../utils/fetchWithError.js";
4
5
  import { stringifyQueryParams } from "../utils/stringifyQueryParams.js";
5
6
  // constants
6
7
  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)));
9
8
  export class Agent {
10
9
  #client;
11
10
  #basePath;
@@ -21,9 +20,7 @@ export class Agent {
21
20
  return async (payload = {}, options) => {
22
21
  const baseParams = this.#getBaseParams?.() ?? {};
23
22
  // Filter query parameters by queryParamKeys
24
- const queryParams = queryParamKeys.length > 0
25
- ? pick(payload, queryParamKeys)
26
- : undefined;
23
+ const queryParams = queryParamKeys.length > 0 ? pick(payload, queryParamKeys) : undefined;
27
24
  // Add filtered payload parameters to base parameters
28
25
  const allUrlParamKeys = [...Object.keys(baseParams), ...urlParamKeys];
29
26
  const urlParams = { ...baseParams, ...pick(payload, allUrlParamKeys) };
@@ -111,10 +108,7 @@ export class Agent {
111
108
  }
112
109
  else {
113
110
  // Otherwise assume it's JSON and stringify it.
114
- requestOptions.body =
115
- payloadKey && typeof payload[payloadKey] === "string"
116
- ? payload[payloadKey]
117
- : JSON.stringify(payloadKey ? payload[payloadKey] : payload);
111
+ requestOptions.body = JSON.stringify(payloadKey ? payload[payloadKey] : payload);
118
112
  }
119
113
  if (!requestHeaders.has("content-type") && !(payload instanceof FormData)) {
120
114
  requestHeaders.set("content-type", "application/json");
@@ -138,7 +132,7 @@ export class Agent {
138
132
  if (typeof locationHeader !== "string") {
139
133
  throw new Error(`location header is not found in request: ${res.url}`);
140
134
  }
141
- const resourceId = locationHeader.split(SLASH).pop();
135
+ const resourceId = last(locationHeader.split(SLASH));
142
136
  if (!resourceId) {
143
137
  // throw an error to let users know the response is not expected
144
138
  throw new Error(`resourceId is not found in Location header from request: ${res.url}`);
@@ -167,7 +161,8 @@ export class Agent {
167
161
  return;
168
162
  }
169
163
  Object.keys(keyMapping).some((key) => {
170
- if (typeof payload[key] === "undefined") {
164
+ if (isUndefined(payload[key])) {
165
+ // Skip if undefined
171
166
  return false;
172
167
  }
173
168
  const newKey = keyMapping[key];
@@ -7,173 +7,87 @@ 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
- 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
- }> {
10
+ export declare class AuthenticationManagement extends Resource {
15
11
  /**
16
12
  * Authentication Management
17
13
  * https://www.keycloak.org/docs-api/8.0/rest-api/index.html#_authentication_management_resource
18
14
  */
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?: ({
15
+ registerRequiredAction: (payload?: Record<string, any> | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<any>;
16
+ getRequiredActions: (payload?: (void & {}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<RequiredActionProviderRepresentation[]>;
17
+ getRequiredActionForAlias: (payload?: {
26
18
  alias: string;
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[]>;
19
+ } | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<any>;
20
+ getClientAuthenticatorProviders: (payload?: (void & {}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<AuthenticationProviderRepresentation[]>;
21
+ getAuthenticatorProviders: (payload?: (void & {}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<AuthenticationProviderRepresentation[]>;
22
+ getFormActionProviders: (payload?: (void & {}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<AuthenticationProviderRepresentation[]>;
39
23
  updateRequiredAction: (query: {
40
24
  alias: string;
41
- } & {
42
- realm?: string | undefined;
43
25
  }, payload: RequiredActionProviderRepresentation) => Promise<void>;
44
- deleteRequiredAction: (payload?: ({
26
+ deleteRequiredAction: (payload?: {
45
27
  alias: string;
46
- } & {
47
- realm?: string | undefined;
48
- }) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<void>;
49
- lowerRequiredActionPriority: (payload?: ({
28
+ } | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<void>;
29
+ lowerRequiredActionPriority: (payload?: {
50
30
  alias: string;
51
- } & {
52
- realm?: string | undefined;
53
- }) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<any>;
54
- raiseRequiredActionPriority: (payload?: ({
31
+ } | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<any>;
32
+ raiseRequiredActionPriority: (payload?: {
55
33
  alias: string;
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?: ({
34
+ } | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<any>;
35
+ getUnregisteredRequiredActions: (payload?: (void & {}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<RequiredActionProviderSimpleRepresentation[]>;
36
+ getFlows: (payload?: {} | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<AuthenticationFlowRepresentation[]>;
37
+ getFlow: (payload?: {
66
38
  flowId: string;
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?: ({
39
+ } | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<AuthenticationFlowRepresentation>;
40
+ getFormProviders: (payload?: (void & {}) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<AuthenticationProviderRepresentation[]>;
41
+ createFlow: (payload?: AuthenticationFlowRepresentation | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<AuthenticationFlowRepresentation>;
42
+ copyFlow: (payload?: {
77
43
  flow: string;
78
44
  newName: string;
79
- } & {
80
- realm?: string | undefined;
81
- }) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<any>;
82
- deleteFlow: (payload?: ({
45
+ } | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<any>;
46
+ deleteFlow: (payload?: {
83
47
  flowId: string;
84
- } & {
85
- realm?: string | undefined;
86
- }) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<any>;
48
+ } | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<any>;
87
49
  updateFlow: (query: {
88
50
  flowId: string;
89
- } & {
90
- realm?: string | undefined;
91
51
  }, payload: AuthenticationFlowRepresentation) => Promise<any>;
92
- getExecutions: (payload?: ({
52
+ getExecutions: (payload?: {
93
53
  flow: string;
94
- } & {
95
- realm?: string | undefined;
96
- }) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<AuthenticationExecutionInfoRepresentation[]>;
54
+ } | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<AuthenticationExecutionInfoRepresentation[]>;
97
55
  addExecution: (query: {
98
56
  flow: string;
99
- } & {
100
- realm?: string | undefined;
101
57
  }, payload: AuthenticationExecutionInfoRepresentation) => Promise<any>;
102
- addExecutionToFlow: (payload?: ({
58
+ addExecutionToFlow: (payload?: {
103
59
  flow: string;
104
60
  provider: string;
105
- } & {
106
- realm?: string | undefined;
107
- }) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<AuthenticationExecutionInfoRepresentation>;
108
- addFlowToFlow: (payload?: ({
61
+ } | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<AuthenticationExecutionInfoRepresentation>;
62
+ addFlowToFlow: (payload?: {
109
63
  flow: string;
110
64
  alias: string;
111
65
  type: string;
112
66
  provider: string;
113
67
  description: string;
114
- } & {
115
- realm?: string | undefined;
116
- }) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<AuthenticationFlowRepresentation>;
68
+ } | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<AuthenticationFlowRepresentation>;
117
69
  updateExecution: (query: {
118
70
  flow: string;
119
- } & {
120
- realm?: string | undefined;
121
71
  }, payload: AuthenticationExecutionInfoRepresentation) => Promise<any>;
122
- delExecution: (payload?: ({
72
+ delExecution: (payload?: {
123
73
  id: string;
124
- } & {
125
- realm?: string | undefined;
126
- }) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<any>;
127
- lowerPriorityExecution: (payload?: ({
74
+ } | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<any>;
75
+ lowerPriorityExecution: (payload?: {
128
76
  id: string;
129
- } & {
130
- realm?: string | undefined;
131
- }) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<any>;
132
- raisePriorityExecution: (payload?: ({
77
+ } | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<any>;
78
+ raisePriorityExecution: (payload?: {
133
79
  id: string;
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?: ({
80
+ } | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<any>;
81
+ getConfigDescription: (payload?: {
158
82
  providerId: string;
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?: ({
83
+ } | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<AuthenticatorConfigInfoRepresentation>;
84
+ createConfig: (payload?: AuthenticatorConfigRepresentation | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<AuthenticatorConfigRepresentation>;
85
+ updateConfig: (payload?: AuthenticatorConfigRepresentation | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<void>;
86
+ getConfig: (payload?: {
169
87
  id: string;
170
- } & {
171
- realm?: string | undefined;
172
- }) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<AuthenticatorConfigRepresentation>;
173
- delConfig: (payload?: ({
88
+ } | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<AuthenticatorConfigRepresentation>;
89
+ delConfig: (payload?: {
174
90
  id: string;
175
- } & {
176
- realm?: string | undefined;
177
- }) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<any>;
91
+ } | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<any>;
178
92
  constructor(client: KeycloakAdminClient);
179
93
  }
@@ -137,30 +137,6 @@ 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
- });
164
140
  getConfigDescription = this.makeRequest({
165
141
  method: "GET",
166
142
  path: "config-description/{providerId}",
@@ -17,11 +17,9 @@ 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?: ({
21
- includeGlobalPolicies?: boolean | undefined;
22
- } & {
20
+ listPolicies: (payload?: {
23
21
  realm?: string | undefined;
24
- }) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<ClientPoliciesRepresentation>;
22
+ } | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<ClientPoliciesRepresentation>;
25
23
  updatePolicy: (payload?: (ClientPoliciesRepresentation & {
26
24
  realm?: string | undefined;
27
25
  }) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<void>;
@@ -29,10 +29,6 @@ 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
- },
36
32
  });
37
33
  updatePolicy = this.makeRequest({
38
34
  method: "PUT",
@@ -27,7 +27,6 @@ export interface ClientQuery extends PaginatedQuery {
27
27
  clientId?: string;
28
28
  viewableOnly?: boolean;
29
29
  search?: boolean;
30
- q?: string;
31
30
  }
32
31
  export interface ResourceQuery extends PaginatedQuery {
33
32
  id?: string;
@@ -94,7 +93,7 @@ export declare class Clients extends Resource<{
94
93
  roleName: string;
95
94
  } & {
96
95
  realm?: string | undefined;
97
- }) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<RoleRepresentation | null>;
96
+ }) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<RoleRepresentation>;
98
97
  updateRole: (query: {
99
98
  id: string;
100
99
  roleName: string;
@@ -7,7 +7,6 @@ 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;
11
10
  search?: string;
12
11
  exact?: boolean;
13
12
  }
@@ -19,7 +18,7 @@ interface SummarizedQuery {
19
18
  briefRepresentation?: boolean;
20
19
  }
21
20
  export type GroupQuery = Query & PaginatedQuery & SummarizedQuery;
22
- export type SubGroupQuery = Query & PaginatedQuery & SummarizedQuery & {
21
+ export type SubGroupQuery = PaginatedQuery & SummarizedQuery & {
23
22
  parentId: string;
24
23
  };
25
24
  export interface GroupCountQuery {
@@ -97,7 +96,7 @@ export declare class Groups extends Resource<{
97
96
  /**
98
97
  * Finds all subgroups on the specified parent group matching the provided parameters.
99
98
  */
100
- listSubGroups: (payload?: (Query & PaginatedQuery & SummarizedQuery & {
99
+ listSubGroups: (payload?: (PaginatedQuery & SummarizedQuery & {
101
100
  parentId: string;
102
101
  } & {
103
102
  realm?: string | undefined;
@@ -2,14 +2,7 @@ import Resource from "./resource.js";
2
2
  export class Groups extends Resource {
3
3
  find = this.makeRequest({
4
4
  method: "GET",
5
- queryParamKeys: [
6
- "search",
7
- "q",
8
- "exact",
9
- "briefRepresentation",
10
- "first",
11
- "max",
12
- ],
5
+ queryParamKeys: ["search", "exact", "briefRepresentation", "first", "max"],
13
6
  });
14
7
  create = this.makeRequest({
15
8
  method: "POST",
@@ -77,7 +70,7 @@ export class Groups extends Resource {
77
70
  method: "GET",
78
71
  path: "/{parentId}/children",
79
72
  urlParamKeys: ["parentId"],
80
- queryParamKeys: ["search", "first", "max", "briefRepresentation"],
73
+ queryParamKeys: ["first", "max", "briefRepresentation"],
81
74
  catchNotFound: true,
82
75
  });
83
76
  /**
@@ -4,13 +4,6 @@ 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
- }
14
7
  export declare class IdentityProviders extends Resource<{
15
8
  realm?: string;
16
9
  }> {
@@ -18,9 +11,9 @@ export declare class IdentityProviders extends Resource<{
18
11
  * Identity provider
19
12
  * https://www.keycloak.org/docs-api/11.0/rest-api/#_identity_providers_resource
20
13
  */
21
- find: (payload?: (IdentityProvidersQuery & {
14
+ find: (payload?: {
22
15
  realm?: string | undefined;
23
- }) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<IdentityProviderRepresentation[]>;
16
+ } | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<IdentityProviderRepresentation[]>;
24
17
  create: (payload?: (IdentityProviderRepresentation & {
25
18
  realm?: string | undefined;
26
19
  }) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<{
@@ -98,10 +91,5 @@ export declare class IdentityProviders extends Resource<{
98
91
  } & {
99
92
  realm?: string | undefined;
100
93
  }) | 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>;
106
94
  constructor(client: KeycloakAdminClient);
107
95
  }
@@ -81,11 +81,6 @@ 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
- });
89
84
  constructor(client) {
90
85
  super(client, {
91
86
  path: "/admin/realms/{realm}/identity-provider",
@@ -146,7 +146,6 @@ export declare class Realms extends Resource {
146
146
  deleteSession: (payload?: {
147
147
  realm: string;
148
148
  session: string;
149
- isOffline: boolean;
150
149
  } | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<void>;
151
150
  pushRevocation: (payload?: {
152
151
  realm: string;
@@ -177,7 +177,6 @@ export class Realms extends Resource {
177
177
  method: "DELETE",
178
178
  path: "/{realm}/sessions/{session}",
179
179
  urlParamKeys: ["realm", "session"],
180
- queryParamKeys: ["isOffline"],
181
180
  });
182
181
  pushRevocation = this.makeRequest({
183
182
  method: "POST",
@@ -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, 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>);
10
+ makeRequest: <PayloadType = any, ResponseType_1 = any>(args: RequestArgs) => (payload?: (PayloadType & ParamType) | undefined, options?: Pick<RequestArgs, "catchNotFound">) => Promise<ResponseType_1>;
11
+ makeUpdateRequest: <QueryType = any, PayloadType = any, ResponseType_1 = any>(args: RequestArgs) => (query: QueryType & ParamType, payload: PayloadType) => Promise<ResponseType_1>;
12
12
  }
@@ -2,15 +2,14 @@ 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
- }
12
5
  export declare class ServerInfo extends Resource {
13
6
  constructor(client: KeycloakAdminClient);
14
7
  find: (payload?: {} | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<ServerInfoRepresentation>;
15
- findEffectiveMessageBundles: (payload?: MessageBundleQuery | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<EffectiveMessageBundleRepresentation[]>;
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[]>;
16
15
  }
@@ -6,7 +6,8 @@ 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, UserProfileMetadata } from "../defs/userProfileMetadata.js";
9
+ import type UserProfileConfig from "../defs/userProfileMetadata.js";
10
+ import type { UserProfileMetadata } from "../defs/userProfileMetadata.js";
10
11
  import type UserRepresentation from "../defs/userRepresentation.js";
11
12
  import type UserSessionRepresentation from "../defs/userSessionRepresentation.js";
12
13
  import Resource from "./resource.js";
@@ -22,7 +23,6 @@ interface UserBaseQuery {
22
23
  firstName?: string;
23
24
  lastName?: string;
24
25
  username?: string;
25
- q?: string;
26
26
  }
27
27
  export interface UserQuery extends PaginationQuery, SearchQuery, UserBaseQuery {
28
28
  exact?: boolean;
@@ -325,11 +325,6 @@ 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[]>>;
333
328
  constructor(client: KeycloakAdminClient);
334
329
  }
335
330
  export {};
@@ -283,11 +283,6 @@ 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
- });
291
286
  constructor(client) {
292
287
  super(client, {
293
288
  path: "/admin/realms/{realm}/users",
@@ -13,7 +13,6 @@ export interface Credentials {
13
13
  export interface Settings {
14
14
  realmName?: string;
15
15
  baseUrl?: string;
16
- scope?: string;
17
16
  credentials: Credentials;
18
17
  requestOptions?: RequestInit;
19
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keycloak/keycloak-admin-client",
3
- "version": "25.0.2",
3
+ "version": "25.0.3",
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 . --ext js,jsx,mjs,ts,tsx"
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",
35
36
  "url-join": "^5.0.0",
36
- "url-template": "^3.1.1"
37
+ "url-template": "^3.1.0"
37
38
  },
38
39
  "devDependencies": {
39
- "@faker-js/faker": "^8.4.1",
40
- "@types/chai": "^4.3.16",
40
+ "@faker-js/faker": "^8.3.1",
41
+ "@types/chai": "^4.3.11",
41
42
  "@types/lodash-es": "^4.17.12",
42
43
  "@types/mocha": "^10.0.6",
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"
44
+ "@types/node": "^20.9.4",
45
+ "chai": "^4.3.10",
46
+ "mocha": "^10.2.0",
47
+ "ts-node": "^10.9.1"
48
48
  },
49
49
  "author": {
50
50
  "name": "Red Hat, Inc.",
@@ -53,8 +53,7 @@
53
53
  "license": "Apache-2.0",
54
54
  "repository": {
55
55
  "type": "git",
56
- "url": "https://github.com/keycloak/keycloak.git",
57
- "directory": "js/libs/keycloak-admin-client"
56
+ "url": "https://github.com/keycloak/keycloak.git"
58
57
  },
59
58
  "homepage": "https://www.keycloak.org/",
60
59
  "scripts": {
@@ -1,4 +0,0 @@
1
- export default interface OrganizationDomainRepresentation {
2
- name?: string;
3
- verified?: boolean;
4
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,9 +0,0 @@
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
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- import { ConfigPropertyRepresentation } from "./configPropertyRepresentation.js";
2
- export default interface RequiredActionConfigInfoRepresentation {
3
- properties?: ConfigPropertyRepresentation[];
4
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- export default interface RequiredActionConfigRepresentation {
2
- config?: {
3
- [index: string]: string;
4
- };
5
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,86 +0,0 @@
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 {};
@@ -1,76 +0,0 @@
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
- }