@keycloak/keycloak-admin-client 21.0.2 → 21.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.
Files changed (263) hide show
  1. package/README.md +59 -62
  2. package/lib/client.d.ts +22 -25
  3. package/lib/client.js +53 -33
  4. package/lib/defs/AccessTokenAccess.js +0 -1
  5. package/lib/defs/PermissonRepresentation.js +0 -1
  6. package/lib/defs/accessTokenCertConf.d.ts +1 -1
  7. package/lib/defs/accessTokenCertConf.js +0 -1
  8. package/lib/defs/accessTokenRepresentation.d.ts +6 -6
  9. package/lib/defs/accessTokenRepresentation.js +0 -1
  10. package/lib/defs/addressClaimSet.js +0 -1
  11. package/lib/defs/adminEventRepresentation.d.ts +1 -1
  12. package/lib/defs/adminEventRepresentation.js +0 -1
  13. package/lib/defs/authDetailsRepresentation.js +0 -1
  14. package/lib/defs/authenticationExecutionExportRepresentation.d.ts +3 -0
  15. package/lib/defs/authenticationExecutionExportRepresentation.js +0 -1
  16. package/lib/defs/authenticationExecutionInfoRepresentation.d.ts +3 -0
  17. package/lib/defs/authenticationExecutionInfoRepresentation.js +0 -1
  18. package/lib/defs/authenticationFlowRepresentation.d.ts +4 -1
  19. package/lib/defs/authenticationFlowRepresentation.js +0 -1
  20. package/lib/defs/authenticatorConfigInfoRepresentation.d.ts +3 -0
  21. package/lib/defs/authenticatorConfigInfoRepresentation.js +0 -1
  22. package/lib/defs/authenticatorConfigRepresentation.d.ts +3 -0
  23. package/lib/defs/authenticatorConfigRepresentation.js +0 -1
  24. package/lib/defs/certificateRepresentation.d.ts +3 -0
  25. package/lib/defs/certificateRepresentation.js +0 -1
  26. package/lib/defs/clientInitialAccessPresentation.d.ts +3 -0
  27. package/lib/defs/clientInitialAccessPresentation.js +0 -1
  28. package/lib/defs/clientPoliciesRepresentation.d.ts +4 -1
  29. package/lib/defs/clientPoliciesRepresentation.js +0 -1
  30. package/lib/defs/clientPolicyConditionRepresentation.d.ts +3 -0
  31. package/lib/defs/clientPolicyConditionRepresentation.js +0 -1
  32. package/lib/defs/clientPolicyExecutorRepresentation.d.ts +3 -0
  33. package/lib/defs/clientPolicyExecutorRepresentation.js +0 -1
  34. package/lib/defs/clientPolicyRepresentation.d.ts +4 -1
  35. package/lib/defs/clientPolicyRepresentation.js +0 -1
  36. package/lib/defs/clientProfileRepresentation.d.ts +4 -1
  37. package/lib/defs/clientProfileRepresentation.js +0 -1
  38. package/lib/defs/clientProfilesRepresentation.d.ts +4 -1
  39. package/lib/defs/clientProfilesRepresentation.js +0 -1
  40. package/lib/defs/clientRepresentation.d.ts +5 -2
  41. package/lib/defs/clientRepresentation.js +0 -1
  42. package/lib/defs/clientScopeRepresentation.d.ts +4 -1
  43. package/lib/defs/clientScopeRepresentation.js +0 -1
  44. package/lib/defs/clientSessionStat.d.ts +6 -0
  45. package/lib/defs/clientSessionStat.js +1 -0
  46. package/lib/defs/componentExportRepresentation.d.ts +3 -0
  47. package/lib/defs/componentExportRepresentation.js +3 -1
  48. package/lib/defs/componentRepresentation.d.ts +3 -0
  49. package/lib/defs/componentRepresentation.js +3 -1
  50. package/lib/defs/componentTypeRepresentation.d.ts +4 -1
  51. package/lib/defs/componentTypeRepresentation.js +0 -1
  52. package/lib/defs/configPropertyRepresentation.d.ts +3 -0
  53. package/lib/defs/configPropertyRepresentation.js +0 -1
  54. package/lib/defs/credentialRepresentation.d.ts +3 -0
  55. package/lib/defs/credentialRepresentation.js +3 -1
  56. package/lib/defs/evaluationResultRepresentation.d.ts +4 -4
  57. package/lib/defs/evaluationResultRepresentation.js +0 -1
  58. package/lib/defs/eventRepresentation.d.ts +4 -1
  59. package/lib/defs/eventRepresentation.js +0 -1
  60. package/lib/defs/eventTypes.d.ts +1 -1
  61. package/lib/defs/eventTypes.js +0 -1
  62. package/lib/defs/federatedIdentityRepresentation.d.ts +3 -0
  63. package/lib/defs/federatedIdentityRepresentation.js +3 -1
  64. package/lib/defs/globalRequestResult.d.ts +3 -0
  65. package/lib/defs/globalRequestResult.js +0 -1
  66. package/lib/defs/groupRepresentation.d.ts +3 -0
  67. package/lib/defs/groupRepresentation.js +3 -1
  68. package/lib/defs/identityProviderMapperRepresentation.d.ts +3 -0
  69. package/lib/defs/identityProviderMapperRepresentation.js +3 -1
  70. package/lib/defs/identityProviderMapperTypeRepresentation.d.ts +1 -1
  71. package/lib/defs/identityProviderMapperTypeRepresentation.js +0 -1
  72. package/lib/defs/identityProviderRepresentation.d.ts +3 -0
  73. package/lib/defs/identityProviderRepresentation.js +3 -1
  74. package/lib/defs/keyMetadataRepresentation.d.ts +3 -0
  75. package/lib/defs/keyMetadataRepresentation.js +0 -1
  76. package/lib/defs/keystoreConfig.d.ts +3 -0
  77. package/lib/defs/keystoreConfig.js +0 -1
  78. package/lib/defs/managementPermissionReference.js +0 -1
  79. package/lib/defs/mappingsRepresentation.d.ts +4 -1
  80. package/lib/defs/mappingsRepresentation.js +0 -1
  81. package/lib/defs/passwordPolicyTypeRepresentation.d.ts +3 -0
  82. package/lib/defs/passwordPolicyTypeRepresentation.js +0 -1
  83. package/lib/defs/policyEvaluationResponse.d.ts +3 -3
  84. package/lib/defs/policyEvaluationResponse.js +0 -1
  85. package/lib/defs/policyProviderRepresentation.js +0 -1
  86. package/lib/defs/policyRepresentation.d.ts +3 -0
  87. package/lib/defs/policyRepresentation.js +3 -1
  88. package/lib/defs/policyResultRepresentation.d.ts +2 -2
  89. package/lib/defs/policyResultRepresentation.js +0 -1
  90. package/lib/defs/profileInfoRepresentation.d.ts +3 -0
  91. package/lib/defs/profileInfoRepresentation.js +0 -1
  92. package/lib/defs/protocolMapperRepresentation.d.ts +3 -0
  93. package/lib/defs/protocolMapperRepresentation.js +3 -1
  94. package/lib/defs/realmEventsConfigRepresentation.d.ts +3 -0
  95. package/lib/defs/realmEventsConfigRepresentation.js +3 -1
  96. package/lib/defs/realmRepresentation.d.ts +20 -14
  97. package/lib/defs/realmRepresentation.js +0 -1
  98. package/lib/defs/requiredActionProviderRepresentation.d.ts +4 -1
  99. package/lib/defs/requiredActionProviderRepresentation.js +4 -2
  100. package/lib/defs/requiredActionProviderSimpleRepresentation.js +0 -1
  101. package/lib/defs/resourceEvaluation.d.ts +1 -1
  102. package/lib/defs/resourceEvaluation.js +0 -1
  103. package/lib/defs/resourceRepresentation.d.ts +5 -2
  104. package/lib/defs/resourceRepresentation.js +0 -1
  105. package/lib/defs/resourceServerRepresentation.d.ts +10 -7
  106. package/lib/defs/resourceServerRepresentation.js +0 -1
  107. package/lib/defs/roleRepresentation.d.ts +3 -0
  108. package/lib/defs/roleRepresentation.js +3 -1
  109. package/lib/defs/rolesRepresentation.d.ts +4 -1
  110. package/lib/defs/rolesRepresentation.js +3 -1
  111. package/lib/defs/scopeRepresentation.d.ts +5 -2
  112. package/lib/defs/scopeRepresentation.js +0 -1
  113. package/lib/defs/serverInfoRepesentation.d.ts +14 -6
  114. package/lib/defs/serverInfoRepesentation.js +0 -1
  115. package/lib/defs/synchronizationResultRepresentation.d.ts +3 -0
  116. package/lib/defs/synchronizationResultRepresentation.js +3 -1
  117. package/lib/defs/systemInfoRepersantation.d.ts +3 -0
  118. package/lib/defs/systemInfoRepersantation.js +3 -1
  119. package/lib/defs/testLdapConnection.d.ts +3 -0
  120. package/lib/defs/testLdapConnection.js +3 -1
  121. package/lib/defs/userConsentRepresentation.d.ts +3 -0
  122. package/lib/defs/userConsentRepresentation.js +3 -1
  123. package/lib/defs/userProfileConfig.js +0 -1
  124. package/lib/defs/userRepresentation.d.ts +4 -4
  125. package/lib/defs/userRepresentation.js +0 -1
  126. package/lib/defs/userSessionRepresentation.js +0 -1
  127. package/lib/defs/whoAmIRepresentation.d.ts +1 -1
  128. package/lib/defs/whoAmIRepresentation.js +0 -1
  129. package/lib/index.d.ts +4 -2
  130. package/lib/index.js +3 -3
  131. package/lib/resources/agent.d.ts +9 -5
  132. package/lib/resources/agent.js +80 -41
  133. package/lib/resources/attackDetection.d.ts +2 -2
  134. package/lib/resources/attackDetection.js +17 -18
  135. package/lib/resources/authenticationManagement.d.ts +13 -9
  136. package/lib/resources/authenticationManagement.js +165 -154
  137. package/lib/resources/cache.d.ts +2 -2
  138. package/lib/resources/cache.js +6 -7
  139. package/lib/resources/clientPolicies.d.ts +7 -4
  140. package/lib/resources/clientPolicies.js +27 -23
  141. package/lib/resources/clientScopes.d.ts +30 -6
  142. package/lib/resources/clientScopes.js +172 -149
  143. package/lib/resources/clients.d.ts +65 -26
  144. package/lib/resources/clients.js +557 -506
  145. package/lib/resources/components.d.ts +8 -4
  146. package/lib/resources/components.js +35 -32
  147. package/lib/resources/groups.d.ts +29 -8
  148. package/lib/resources/groups.js +132 -111
  149. package/lib/resources/identityProviders.d.ts +10 -6
  150. package/lib/resources/identityProviders.js +83 -80
  151. package/lib/resources/realms.d.ts +40 -17
  152. package/lib/resources/realms.js +227 -204
  153. package/lib/resources/resource.d.ts +3 -3
  154. package/lib/resources/resource.js +9 -8
  155. package/lib/resources/roles.d.ts +17 -5
  156. package/lib/resources/roles.js +96 -85
  157. package/lib/resources/serverInfo.d.ts +3 -3
  158. package/lib/resources/serverInfo.js +6 -7
  159. package/lib/resources/userStorageProvider.d.ts +6 -6
  160. package/lib/resources/userStorageProvider.js +29 -30
  161. package/lib/resources/users.d.ts +78 -18
  162. package/lib/resources/users.js +281 -227
  163. package/lib/resources/whoAmI.d.ts +3 -3
  164. package/lib/resources/whoAmI.js +6 -7
  165. package/lib/utils/auth.d.ts +5 -3
  166. package/lib/utils/auth.js +26 -18
  167. package/lib/utils/constants.d.ts +1 -1
  168. package/lib/utils/constants.js +2 -3
  169. package/lib/utils/fetchWithError.d.ts +11 -0
  170. package/lib/utils/fetchWithError.js +32 -0
  171. package/lib/utils/stringifyQueryParams.js +3 -5
  172. package/package.json +44 -36
  173. package/lib/client.js.map +0 -1
  174. package/lib/defs/AccessTokenAccess.js.map +0 -1
  175. package/lib/defs/PermissonRepresentation.js.map +0 -1
  176. package/lib/defs/accessTokenCertConf.js.map +0 -1
  177. package/lib/defs/accessTokenRepresentation.js.map +0 -1
  178. package/lib/defs/addressClaimSet.js.map +0 -1
  179. package/lib/defs/adminEventRepresentation.js.map +0 -1
  180. package/lib/defs/authDetailsRepresentation.js.map +0 -1
  181. package/lib/defs/authenticationExecutionExportRepresentation.js.map +0 -1
  182. package/lib/defs/authenticationExecutionInfoRepresentation.js.map +0 -1
  183. package/lib/defs/authenticationFlowRepresentation.js.map +0 -1
  184. package/lib/defs/authenticatorConfigInfoRepresentation.js.map +0 -1
  185. package/lib/defs/authenticatorConfigRepresentation.js.map +0 -1
  186. package/lib/defs/certificateRepresentation.js.map +0 -1
  187. package/lib/defs/clientInitialAccessPresentation.js.map +0 -1
  188. package/lib/defs/clientPoliciesRepresentation.js.map +0 -1
  189. package/lib/defs/clientPolicyConditionRepresentation.js.map +0 -1
  190. package/lib/defs/clientPolicyExecutorRepresentation.js.map +0 -1
  191. package/lib/defs/clientPolicyRepresentation.js.map +0 -1
  192. package/lib/defs/clientProfileRepresentation.js.map +0 -1
  193. package/lib/defs/clientProfilesRepresentation.js.map +0 -1
  194. package/lib/defs/clientRepresentation.js.map +0 -1
  195. package/lib/defs/clientScopeRepresentation.js.map +0 -1
  196. package/lib/defs/componentExportRepresentation.js.map +0 -1
  197. package/lib/defs/componentRepresentation.js.map +0 -1
  198. package/lib/defs/componentTypeRepresentation.js.map +0 -1
  199. package/lib/defs/configPropertyRepresentation.js.map +0 -1
  200. package/lib/defs/credentialRepresentation.js.map +0 -1
  201. package/lib/defs/evaluationResultRepresentation.js.map +0 -1
  202. package/lib/defs/eventRepresentation.js.map +0 -1
  203. package/lib/defs/eventTypes.js.map +0 -1
  204. package/lib/defs/federatedIdentityRepresentation.js.map +0 -1
  205. package/lib/defs/globalRequestResult.js.map +0 -1
  206. package/lib/defs/groupRepresentation.js.map +0 -1
  207. package/lib/defs/identityProviderMapperRepresentation.js.map +0 -1
  208. package/lib/defs/identityProviderMapperTypeRepresentation.js.map +0 -1
  209. package/lib/defs/identityProviderRepresentation.js.map +0 -1
  210. package/lib/defs/keyMetadataRepresentation.js.map +0 -1
  211. package/lib/defs/keystoreConfig.js.map +0 -1
  212. package/lib/defs/managementPermissionReference.js.map +0 -1
  213. package/lib/defs/mappingsRepresentation.js.map +0 -1
  214. package/lib/defs/passwordPolicyTypeRepresentation.js.map +0 -1
  215. package/lib/defs/policyEvaluationResponse.js.map +0 -1
  216. package/lib/defs/policyProviderRepresentation.js.map +0 -1
  217. package/lib/defs/policyRepresentation.js.map +0 -1
  218. package/lib/defs/policyResultRepresentation.js.map +0 -1
  219. package/lib/defs/profileInfoRepresentation.js.map +0 -1
  220. package/lib/defs/protocolMapperRepresentation.js.map +0 -1
  221. package/lib/defs/realmEventsConfigRepresentation.js.map +0 -1
  222. package/lib/defs/realmRepresentation.js.map +0 -1
  223. package/lib/defs/requiredActionProviderRepresentation.js.map +0 -1
  224. package/lib/defs/requiredActionProviderSimpleRepresentation.js.map +0 -1
  225. package/lib/defs/resourceEvaluation.js.map +0 -1
  226. package/lib/defs/resourceRepresentation.js.map +0 -1
  227. package/lib/defs/resourceServerRepresentation.js.map +0 -1
  228. package/lib/defs/roleRepresentation.js.map +0 -1
  229. package/lib/defs/rolesRepresentation.js.map +0 -1
  230. package/lib/defs/scopeRepresentation.js.map +0 -1
  231. package/lib/defs/serverInfoRepesentation.js.map +0 -1
  232. package/lib/defs/synchronizationResultRepresentation.js.map +0 -1
  233. package/lib/defs/systemInfoRepersantation.js.map +0 -1
  234. package/lib/defs/testLdapConnection.js.map +0 -1
  235. package/lib/defs/userConsentRepresentation.js.map +0 -1
  236. package/lib/defs/userProfileConfig.js.map +0 -1
  237. package/lib/defs/userRepresentation.js.map +0 -1
  238. package/lib/defs/userSessionRepresentation.js.map +0 -1
  239. package/lib/defs/whoAmIRepresentation.js.map +0 -1
  240. package/lib/index.js.map +0 -1
  241. package/lib/resources/agent.js.map +0 -1
  242. package/lib/resources/attackDetection.js.map +0 -1
  243. package/lib/resources/authenticationManagement.js.map +0 -1
  244. package/lib/resources/cache.js.map +0 -1
  245. package/lib/resources/clientPolicies.js.map +0 -1
  246. package/lib/resources/clientScopes.js.map +0 -1
  247. package/lib/resources/clients.js.map +0 -1
  248. package/lib/resources/components.js.map +0 -1
  249. package/lib/resources/groups.js.map +0 -1
  250. package/lib/resources/identityProviders.js.map +0 -1
  251. package/lib/resources/realms.js.map +0 -1
  252. package/lib/resources/resource.js.map +0 -1
  253. package/lib/resources/roles.js.map +0 -1
  254. package/lib/resources/serverInfo.js.map +0 -1
  255. package/lib/resources/sessions.d.ts +0 -10
  256. package/lib/resources/sessions.js +0 -16
  257. package/lib/resources/sessions.js.map +0 -1
  258. package/lib/resources/userStorageProvider.js.map +0 -1
  259. package/lib/resources/users.js.map +0 -1
  260. package/lib/resources/whoAmI.js.map +0 -1
  261. package/lib/utils/auth.js.map +0 -1
  262. package/lib/utils/constants.js.map +0 -1
  263. package/lib/utils/stringifyQueryParams.js.map +0 -1
@@ -1,7 +1,7 @@
1
- import Resource from './resource.js';
2
- import type ComponentRepresentation from '../defs/componentRepresentation.js';
3
- import type ComponentTypeRepresentation from '../defs/componentTypeRepresentation.js';
4
- import type { KeycloakAdminClient } from '../client.js';
1
+ import Resource from "./resource.js";
2
+ import type ComponentRepresentation from "../defs/componentRepresentation.js";
3
+ import type ComponentTypeRepresentation from "../defs/componentTypeRepresentation.js";
4
+ import type { KeycloakAdminClient } from "../client.js";
5
5
  export interface ComponentQuery {
6
6
  name?: string;
7
7
  parent?: string;
@@ -10,6 +10,10 @@ export interface ComponentQuery {
10
10
  export declare class Components extends Resource<{
11
11
  realm?: string;
12
12
  }> {
13
+ /**
14
+ * components
15
+ * https://www.keycloak.org/docs-api/11.0/rest-api/#_component_resource
16
+ */
13
17
  find: (payload?: (ComponentQuery & {
14
18
  realm?: string | undefined;
15
19
  }) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<ComponentRepresentation[]>;
@@ -1,42 +1,45 @@
1
- import Resource from './resource.js';
1
+ import Resource from "./resource.js";
2
2
  export class Components extends Resource {
3
+ /**
4
+ * components
5
+ * https://www.keycloak.org/docs-api/11.0/rest-api/#_component_resource
6
+ */
7
+ find = this.makeRequest({
8
+ method: "GET",
9
+ });
10
+ create = this.makeRequest({
11
+ method: "POST",
12
+ returnResourceIdInLocationHeader: { field: "id" },
13
+ });
14
+ findOne = this.makeRequest({
15
+ method: "GET",
16
+ path: "/{id}",
17
+ urlParamKeys: ["id"],
18
+ catchNotFound: true,
19
+ });
20
+ update = this.makeUpdateRequest({
21
+ method: "PUT",
22
+ path: "/{id}",
23
+ urlParamKeys: ["id"],
24
+ });
25
+ del = this.makeRequest({
26
+ method: "DELETE",
27
+ path: "/{id}",
28
+ urlParamKeys: ["id"],
29
+ });
30
+ listSubComponents = this.makeRequest({
31
+ method: "GET",
32
+ path: "/{id}/sub-component-types",
33
+ urlParamKeys: ["id"],
34
+ queryParamKeys: ["type"],
35
+ });
3
36
  constructor(client) {
4
37
  super(client, {
5
- path: '/admin/realms/{realm}/components',
38
+ path: "/admin/realms/{realm}/components",
6
39
  getUrlParams: () => ({
7
40
  realm: client.realmName,
8
41
  }),
9
42
  getBaseUrl: () => client.baseUrl,
10
43
  });
11
- this.find = this.makeRequest({
12
- method: 'GET',
13
- });
14
- this.create = this.makeRequest({
15
- method: 'POST',
16
- returnResourceIdInLocationHeader: { field: 'id' },
17
- });
18
- this.findOne = this.makeRequest({
19
- method: 'GET',
20
- path: '/{id}',
21
- urlParamKeys: ['id'],
22
- catchNotFound: true,
23
- });
24
- this.update = this.makeUpdateRequest({
25
- method: 'PUT',
26
- path: '/{id}',
27
- urlParamKeys: ['id'],
28
- });
29
- this.del = this.makeRequest({
30
- method: 'DELETE',
31
- path: '/{id}',
32
- urlParamKeys: ['id'],
33
- });
34
- this.listSubComponents = this.makeRequest({
35
- method: 'GET',
36
- path: '/{id}/sub-component-types',
37
- urlParamKeys: ['id'],
38
- queryParamKeys: ['type'],
39
- });
40
44
  }
41
45
  }
42
- //# sourceMappingURL=components.js.map
@@ -1,11 +1,11 @@
1
- import type { KeycloakAdminClient } from '../client.js';
2
- import type GroupRepresentation from '../defs/groupRepresentation.js';
3
- import type { ManagementPermissionReference } from '../defs/managementPermissionReference.js';
4
- import type MappingsRepresentation from '../defs/mappingsRepresentation.js';
5
- import type RoleRepresentation from '../defs/roleRepresentation.js';
6
- import type { RoleMappingPayload } from '../defs/roleRepresentation.js';
7
- import type UserRepresentation from '../defs/userRepresentation.js';
8
- import Resource from './resource.js';
1
+ import type { KeycloakAdminClient } from "../client.js";
2
+ import type GroupRepresentation from "../defs/groupRepresentation.js";
3
+ import type { ManagementPermissionReference } from "../defs/managementPermissionReference.js";
4
+ import type MappingsRepresentation from "../defs/mappingsRepresentation.js";
5
+ import type RoleRepresentation from "../defs/roleRepresentation.js";
6
+ import type { RoleMappingPayload } from "../defs/roleRepresentation.js";
7
+ import type UserRepresentation from "../defs/userRepresentation.js";
8
+ import Resource from "./resource.js";
9
9
  export interface GroupQuery {
10
10
  first?: number;
11
11
  max?: number;
@@ -27,6 +27,9 @@ export declare class Groups extends Resource<{
27
27
  }) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<{
28
28
  id: string;
29
29
  }>;
30
+ /**
31
+ * Single user
32
+ */
30
33
  findOne: (payload?: ({
31
34
  id: string;
32
35
  } & {
@@ -47,6 +50,10 @@ export declare class Groups extends Resource<{
47
50
  }) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<{
48
51
  count: number;
49
52
  }>;
53
+ /**
54
+ * Set or create child.
55
+ * This will just set the parent if it exists. Create it and set the parent if the group doesn’t exist.
56
+ */
50
57
  setOrCreateChild: (query: {
51
58
  id: string;
52
59
  } & {
@@ -54,6 +61,9 @@ export declare class Groups extends Resource<{
54
61
  }, payload: GroupRepresentation) => Promise<{
55
62
  id: string;
56
63
  }>;
64
+ /**
65
+ * Members
66
+ */
57
67
  listMembers: (payload?: ({
58
68
  id: string;
59
69
  first?: number | undefined;
@@ -61,6 +71,10 @@ export declare class Groups extends Resource<{
61
71
  } & {
62
72
  realm?: string | undefined;
63
73
  }) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<UserRepresentation[]>;
74
+ /**
75
+ * Role mappings
76
+ * https://www.keycloak.org/docs-api/11.0/rest-api/#_role_mapper_resource
77
+ */
64
78
  listRoleMappings: (payload?: ({
65
79
  id: string;
66
80
  } & {
@@ -93,6 +107,10 @@ export declare class Groups extends Resource<{
93
107
  } & {
94
108
  realm?: string | undefined;
95
109
  }) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<RoleRepresentation[]>;
110
+ /**
111
+ * Client role mappings
112
+ * https://www.keycloak.org/docs-api/11.0/rest-api/#_client_role_mappings_resource
113
+ */
96
114
  listClientRoleMappings: (payload?: ({
97
115
  id: string;
98
116
  clientUniqueId: string;
@@ -125,6 +143,9 @@ export declare class Groups extends Resource<{
125
143
  } & {
126
144
  realm?: string | undefined;
127
145
  }) | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<RoleRepresentation[]>;
146
+ /**
147
+ * Authorization permissions
148
+ */
128
149
  updatePermission: (query: {
129
150
  id: string;
130
151
  } & {
@@ -1,121 +1,142 @@
1
- import Resource from './resource.js';
1
+ import Resource from "./resource.js";
2
2
  export class Groups extends Resource {
3
+ find = this.makeRequest({
4
+ method: "GET",
5
+ });
6
+ create = this.makeRequest({
7
+ method: "POST",
8
+ returnResourceIdInLocationHeader: { field: "id" },
9
+ });
10
+ /**
11
+ * Single user
12
+ */
13
+ findOne = this.makeRequest({
14
+ method: "GET",
15
+ path: "/{id}",
16
+ urlParamKeys: ["id"],
17
+ catchNotFound: true,
18
+ });
19
+ update = this.makeUpdateRequest({
20
+ method: "PUT",
21
+ path: "/{id}",
22
+ urlParamKeys: ["id"],
23
+ });
24
+ del = this.makeRequest({
25
+ method: "DELETE",
26
+ path: "/{id}",
27
+ urlParamKeys: ["id"],
28
+ });
29
+ count = this.makeRequest({
30
+ method: "GET",
31
+ path: "/count",
32
+ });
33
+ /**
34
+ * Set or create child.
35
+ * This will just set the parent if it exists. Create it and set the parent if the group doesn’t exist.
36
+ */
37
+ setOrCreateChild = this.makeUpdateRequest({
38
+ method: "POST",
39
+ path: "/{id}/children",
40
+ urlParamKeys: ["id"],
41
+ returnResourceIdInLocationHeader: { field: "id" },
42
+ });
43
+ /**
44
+ * Members
45
+ */
46
+ listMembers = this.makeRequest({
47
+ method: "GET",
48
+ path: "/{id}/members",
49
+ urlParamKeys: ["id"],
50
+ catchNotFound: true,
51
+ });
52
+ /**
53
+ * Role mappings
54
+ * https://www.keycloak.org/docs-api/11.0/rest-api/#_role_mapper_resource
55
+ */
56
+ listRoleMappings = this.makeRequest({
57
+ method: "GET",
58
+ path: "/{id}/role-mappings",
59
+ urlParamKeys: ["id"],
60
+ });
61
+ addRealmRoleMappings = this.makeRequest({
62
+ method: "POST",
63
+ path: "/{id}/role-mappings/realm",
64
+ urlParamKeys: ["id"],
65
+ payloadKey: "roles",
66
+ });
67
+ listRealmRoleMappings = this.makeRequest({
68
+ method: "GET",
69
+ path: "/{id}/role-mappings/realm",
70
+ urlParamKeys: ["id"],
71
+ });
72
+ delRealmRoleMappings = this.makeRequest({
73
+ method: "DELETE",
74
+ path: "/{id}/role-mappings/realm",
75
+ urlParamKeys: ["id"],
76
+ payloadKey: "roles",
77
+ });
78
+ listAvailableRealmRoleMappings = this.makeRequest({
79
+ method: "GET",
80
+ path: "/{id}/role-mappings/realm/available",
81
+ urlParamKeys: ["id"],
82
+ });
83
+ // Get effective realm-level role mappings This will recurse all composite roles to get the result.
84
+ listCompositeRealmRoleMappings = this.makeRequest({
85
+ method: "GET",
86
+ path: "/{id}/role-mappings/realm/composite",
87
+ urlParamKeys: ["id"],
88
+ });
89
+ /**
90
+ * Client role mappings
91
+ * https://www.keycloak.org/docs-api/11.0/rest-api/#_client_role_mappings_resource
92
+ */
93
+ listClientRoleMappings = this.makeRequest({
94
+ method: "GET",
95
+ path: "/{id}/role-mappings/clients/{clientUniqueId}",
96
+ urlParamKeys: ["id", "clientUniqueId"],
97
+ });
98
+ addClientRoleMappings = this.makeRequest({
99
+ method: "POST",
100
+ path: "/{id}/role-mappings/clients/{clientUniqueId}",
101
+ urlParamKeys: ["id", "clientUniqueId"],
102
+ payloadKey: "roles",
103
+ });
104
+ delClientRoleMappings = this.makeRequest({
105
+ method: "DELETE",
106
+ path: "/{id}/role-mappings/clients/{clientUniqueId}",
107
+ urlParamKeys: ["id", "clientUniqueId"],
108
+ payloadKey: "roles",
109
+ });
110
+ listAvailableClientRoleMappings = this.makeRequest({
111
+ method: "GET",
112
+ path: "/{id}/role-mappings/clients/{clientUniqueId}/available",
113
+ urlParamKeys: ["id", "clientUniqueId"],
114
+ });
115
+ listCompositeClientRoleMappings = this.makeRequest({
116
+ method: "GET",
117
+ path: "/{id}/role-mappings/clients/{clientUniqueId}/composite",
118
+ urlParamKeys: ["id", "clientUniqueId"],
119
+ });
120
+ /**
121
+ * Authorization permissions
122
+ */
123
+ updatePermission = this.makeUpdateRequest({
124
+ method: "PUT",
125
+ path: "/{id}/management/permissions",
126
+ urlParamKeys: ["id"],
127
+ });
128
+ listPermissions = this.makeRequest({
129
+ method: "GET",
130
+ path: "/{id}/management/permissions",
131
+ urlParamKeys: ["id"],
132
+ });
3
133
  constructor(client) {
4
134
  super(client, {
5
- path: '/admin/realms/{realm}/groups',
135
+ path: "/admin/realms/{realm}/groups",
6
136
  getUrlParams: () => ({
7
137
  realm: client.realmName,
8
138
  }),
9
139
  getBaseUrl: () => client.baseUrl,
10
140
  });
11
- this.find = this.makeRequest({
12
- method: 'GET',
13
- });
14
- this.create = this.makeRequest({
15
- method: 'POST',
16
- returnResourceIdInLocationHeader: { field: 'id' },
17
- });
18
- this.findOne = this.makeRequest({
19
- method: 'GET',
20
- path: '/{id}',
21
- urlParamKeys: ['id'],
22
- catchNotFound: true,
23
- });
24
- this.update = this.makeUpdateRequest({
25
- method: 'PUT',
26
- path: '/{id}',
27
- urlParamKeys: ['id'],
28
- });
29
- this.del = this.makeRequest({
30
- method: 'DELETE',
31
- path: '/{id}',
32
- urlParamKeys: ['id'],
33
- });
34
- this.count = this.makeRequest({
35
- method: 'GET',
36
- path: '/count',
37
- });
38
- this.setOrCreateChild = this.makeUpdateRequest({
39
- method: 'POST',
40
- path: '/{id}/children',
41
- urlParamKeys: ['id'],
42
- returnResourceIdInLocationHeader: { field: 'id' },
43
- });
44
- this.listMembers = this.makeRequest({
45
- method: 'GET',
46
- path: '/{id}/members',
47
- urlParamKeys: ['id'],
48
- catchNotFound: true,
49
- });
50
- this.listRoleMappings = this.makeRequest({
51
- method: 'GET',
52
- path: '/{id}/role-mappings',
53
- urlParamKeys: ['id'],
54
- });
55
- this.addRealmRoleMappings = this.makeRequest({
56
- method: 'POST',
57
- path: '/{id}/role-mappings/realm',
58
- urlParamKeys: ['id'],
59
- payloadKey: 'roles',
60
- });
61
- this.listRealmRoleMappings = this.makeRequest({
62
- method: 'GET',
63
- path: '/{id}/role-mappings/realm',
64
- urlParamKeys: ['id'],
65
- });
66
- this.delRealmRoleMappings = this.makeRequest({
67
- method: 'DELETE',
68
- path: '/{id}/role-mappings/realm',
69
- urlParamKeys: ['id'],
70
- payloadKey: 'roles',
71
- });
72
- this.listAvailableRealmRoleMappings = this.makeRequest({
73
- method: 'GET',
74
- path: '/{id}/role-mappings/realm/available',
75
- urlParamKeys: ['id'],
76
- });
77
- this.listCompositeRealmRoleMappings = this.makeRequest({
78
- method: 'GET',
79
- path: '/{id}/role-mappings/realm/composite',
80
- urlParamKeys: ['id'],
81
- });
82
- this.listClientRoleMappings = this.makeRequest({
83
- method: 'GET',
84
- path: '/{id}/role-mappings/clients/{clientUniqueId}',
85
- urlParamKeys: ['id', 'clientUniqueId'],
86
- });
87
- this.addClientRoleMappings = this.makeRequest({
88
- method: 'POST',
89
- path: '/{id}/role-mappings/clients/{clientUniqueId}',
90
- urlParamKeys: ['id', 'clientUniqueId'],
91
- payloadKey: 'roles',
92
- });
93
- this.delClientRoleMappings = this.makeRequest({
94
- method: 'DELETE',
95
- path: '/{id}/role-mappings/clients/{clientUniqueId}',
96
- urlParamKeys: ['id', 'clientUniqueId'],
97
- payloadKey: 'roles',
98
- });
99
- this.listAvailableClientRoleMappings = this.makeRequest({
100
- method: 'GET',
101
- path: '/{id}/role-mappings/clients/{clientUniqueId}/available',
102
- urlParamKeys: ['id', 'clientUniqueId'],
103
- });
104
- this.listCompositeClientRoleMappings = this.makeRequest({
105
- method: 'GET',
106
- path: '/{id}/role-mappings/clients/{clientUniqueId}/composite',
107
- urlParamKeys: ['id', 'clientUniqueId'],
108
- });
109
- this.updatePermission = this.makeUpdateRequest({
110
- method: 'PUT',
111
- path: '/{id}/management/permissions',
112
- urlParamKeys: ['id'],
113
- });
114
- this.listPermissions = this.makeRequest({
115
- method: 'GET',
116
- path: '/{id}/management/permissions',
117
- urlParamKeys: ['id'],
118
- });
119
141
  }
120
142
  }
121
- //# sourceMappingURL=groups.js.map
@@ -1,12 +1,16 @@
1
- import type { KeycloakAdminClient } from '../client.js';
2
- import type IdentityProviderMapperRepresentation from '../defs/identityProviderMapperRepresentation.js';
3
- import type { IdentityProviderMapperTypeRepresentation } from '../defs/identityProviderMapperTypeRepresentation.js';
4
- import type IdentityProviderRepresentation from '../defs/identityProviderRepresentation.js';
5
- import type { ManagementPermissionReference } from '../defs/managementPermissionReference.js';
6
- import Resource from './resource.js';
1
+ import type { KeycloakAdminClient } from "../client.js";
2
+ import type IdentityProviderMapperRepresentation from "../defs/identityProviderMapperRepresentation.js";
3
+ import type { IdentityProviderMapperTypeRepresentation } from "../defs/identityProviderMapperTypeRepresentation.js";
4
+ import type IdentityProviderRepresentation from "../defs/identityProviderRepresentation.js";
5
+ import type { ManagementPermissionReference } from "../defs/managementPermissionReference.js";
6
+ import Resource from "./resource.js";
7
7
  export declare class IdentityProviders extends Resource<{
8
8
  realm?: string;
9
9
  }> {
10
+ /**
11
+ * Identity provider
12
+ * https://www.keycloak.org/docs-api/11.0/rest-api/#_identity_providers_resource
13
+ */
10
14
  find: (payload?: {
11
15
  realm?: string | undefined;
12
16
  } | undefined, options?: Pick<import("./agent.js").RequestArgs, "catchNotFound"> | undefined) => Promise<IdentityProviderRepresentation[]>;
@@ -1,90 +1,93 @@
1
- import Resource from './resource.js';
1
+ import Resource from "./resource.js";
2
2
  export class IdentityProviders extends Resource {
3
+ /**
4
+ * Identity provider
5
+ * https://www.keycloak.org/docs-api/11.0/rest-api/#_identity_providers_resource
6
+ */
7
+ find = this.makeRequest({
8
+ method: "GET",
9
+ path: "/instances",
10
+ });
11
+ create = this.makeRequest({
12
+ method: "POST",
13
+ path: "/instances",
14
+ returnResourceIdInLocationHeader: { field: "id" },
15
+ });
16
+ findOne = this.makeRequest({
17
+ method: "GET",
18
+ path: "/instances/{alias}",
19
+ urlParamKeys: ["alias"],
20
+ catchNotFound: true,
21
+ });
22
+ update = this.makeUpdateRequest({
23
+ method: "PUT",
24
+ path: "/instances/{alias}",
25
+ urlParamKeys: ["alias"],
26
+ });
27
+ del = this.makeRequest({
28
+ method: "DELETE",
29
+ path: "/instances/{alias}",
30
+ urlParamKeys: ["alias"],
31
+ });
32
+ findFactory = this.makeRequest({
33
+ method: "GET",
34
+ path: "/providers/{providerId}",
35
+ urlParamKeys: ["providerId"],
36
+ });
37
+ findMappers = this.makeRequest({
38
+ method: "GET",
39
+ path: "/instances/{alias}/mappers",
40
+ urlParamKeys: ["alias"],
41
+ });
42
+ findOneMapper = this.makeRequest({
43
+ method: "GET",
44
+ path: "/instances/{alias}/mappers/{id}",
45
+ urlParamKeys: ["alias", "id"],
46
+ catchNotFound: true,
47
+ });
48
+ createMapper = this.makeRequest({
49
+ method: "POST",
50
+ path: "/instances/{alias}/mappers",
51
+ urlParamKeys: ["alias"],
52
+ payloadKey: "identityProviderMapper",
53
+ returnResourceIdInLocationHeader: { field: "id" },
54
+ });
55
+ updateMapper = this.makeUpdateRequest({
56
+ method: "PUT",
57
+ path: "/instances/{alias}/mappers/{id}",
58
+ urlParamKeys: ["alias", "id"],
59
+ });
60
+ delMapper = this.makeRequest({
61
+ method: "DELETE",
62
+ path: "/instances/{alias}/mappers/{id}",
63
+ urlParamKeys: ["alias", "id"],
64
+ });
65
+ findMapperTypes = this.makeRequest({
66
+ method: "GET",
67
+ path: "/instances/{alias}/mapper-types",
68
+ urlParamKeys: ["alias"],
69
+ });
70
+ importFromUrl = this.makeRequest({
71
+ method: "POST",
72
+ path: "/import-config",
73
+ });
74
+ updatePermission = this.makeUpdateRequest({
75
+ method: "PUT",
76
+ path: "/instances/{alias}/management/permissions",
77
+ urlParamKeys: ["alias"],
78
+ });
79
+ listPermissions = this.makeRequest({
80
+ method: "GET",
81
+ path: "/instances/{alias}/management/permissions",
82
+ urlParamKeys: ["alias"],
83
+ });
3
84
  constructor(client) {
4
85
  super(client, {
5
- path: '/admin/realms/{realm}/identity-provider',
86
+ path: "/admin/realms/{realm}/identity-provider",
6
87
  getUrlParams: () => ({
7
88
  realm: client.realmName,
8
89
  }),
9
90
  getBaseUrl: () => client.baseUrl,
10
91
  });
11
- this.find = this.makeRequest({
12
- method: 'GET',
13
- path: '/instances',
14
- });
15
- this.create = this.makeRequest({
16
- method: 'POST',
17
- path: '/instances',
18
- returnResourceIdInLocationHeader: { field: 'id' },
19
- });
20
- this.findOne = this.makeRequest({
21
- method: 'GET',
22
- path: '/instances/{alias}',
23
- urlParamKeys: ['alias'],
24
- catchNotFound: true,
25
- });
26
- this.update = this.makeUpdateRequest({
27
- method: 'PUT',
28
- path: '/instances/{alias}',
29
- urlParamKeys: ['alias'],
30
- });
31
- this.del = this.makeRequest({
32
- method: 'DELETE',
33
- path: '/instances/{alias}',
34
- urlParamKeys: ['alias'],
35
- });
36
- this.findFactory = this.makeRequest({
37
- method: 'GET',
38
- path: '/providers/{providerId}',
39
- urlParamKeys: ['providerId'],
40
- });
41
- this.findMappers = this.makeRequest({
42
- method: 'GET',
43
- path: '/instances/{alias}/mappers',
44
- urlParamKeys: ['alias'],
45
- });
46
- this.findOneMapper = this.makeRequest({
47
- method: 'GET',
48
- path: '/instances/{alias}/mappers/{id}',
49
- urlParamKeys: ['alias', 'id'],
50
- catchNotFound: true,
51
- });
52
- this.createMapper = this.makeRequest({
53
- method: 'POST',
54
- path: '/instances/{alias}/mappers',
55
- urlParamKeys: ['alias'],
56
- payloadKey: 'identityProviderMapper',
57
- returnResourceIdInLocationHeader: { field: 'id' },
58
- });
59
- this.updateMapper = this.makeUpdateRequest({
60
- method: 'PUT',
61
- path: '/instances/{alias}/mappers/{id}',
62
- urlParamKeys: ['alias', 'id'],
63
- });
64
- this.delMapper = this.makeRequest({
65
- method: 'DELETE',
66
- path: '/instances/{alias}/mappers/{id}',
67
- urlParamKeys: ['alias', 'id'],
68
- });
69
- this.findMapperTypes = this.makeRequest({
70
- method: 'GET',
71
- path: '/instances/{alias}/mapper-types',
72
- urlParamKeys: ['alias'],
73
- });
74
- this.importFromUrl = this.makeRequest({
75
- method: 'POST',
76
- path: '/import-config',
77
- });
78
- this.updatePermission = this.makeUpdateRequest({
79
- method: 'PUT',
80
- path: '/instances/{alias}/management/permissions',
81
- urlParamKeys: ['alias'],
82
- });
83
- this.listPermissions = this.makeRequest({
84
- method: 'GET',
85
- path: '/instances/{alias}/management/permissions',
86
- urlParamKeys: ['alias'],
87
- });
88
92
  }
89
93
  }
90
- //# sourceMappingURL=identityProviders.js.map