@keycloak/keycloak-admin-client 16.0.0-dev.6 → 16.0.0-dev.63

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 (77) hide show
  1. package/README.md +32 -1
  2. package/lib/client.d.ts +8 -6
  3. package/lib/client.js +14 -6
  4. package/lib/client.js.map +1 -1
  5. package/lib/defs/clientPoliciesRepresentation.d.ts +4 -0
  6. package/lib/defs/clientPoliciesRepresentation.js +3 -0
  7. package/lib/defs/clientPoliciesRepresentation.js.map +1 -0
  8. package/lib/defs/clientPolicyConditionRepresentation.d.ts +4 -0
  9. package/lib/defs/clientPolicyConditionRepresentation.js +3 -0
  10. package/lib/defs/clientPolicyConditionRepresentation.js.map +1 -0
  11. package/lib/defs/clientPolicyExecutorRepresentation.d.ts +4 -0
  12. package/lib/defs/clientPolicyExecutorRepresentation.js +3 -0
  13. package/lib/defs/clientPolicyExecutorRepresentation.js.map +1 -0
  14. package/lib/defs/clientPolicyRepresentation.d.ts +8 -0
  15. package/lib/defs/clientPolicyRepresentation.js +3 -0
  16. package/lib/defs/clientPolicyRepresentation.js.map +1 -0
  17. package/lib/defs/clientProfileRepresentation.d.ts +6 -0
  18. package/lib/defs/clientProfileRepresentation.js +3 -0
  19. package/lib/defs/clientProfileRepresentation.js.map +1 -0
  20. package/lib/defs/clientProfilesRepresentation.d.ts +5 -0
  21. package/lib/defs/clientProfilesRepresentation.js +3 -0
  22. package/lib/defs/clientProfilesRepresentation.js.map +1 -0
  23. package/lib/defs/credentialRepresentation.d.ts +5 -9
  24. package/lib/defs/identityProviderMapperTypeRepresentation.d.ts +8 -0
  25. package/lib/defs/identityProviderMapperTypeRepresentation.js +3 -0
  26. package/lib/defs/identityProviderMapperTypeRepresentation.js.map +1 -0
  27. package/lib/defs/realmRepresentation.d.ts +21 -0
  28. package/lib/defs/requiredActionProviderRepresentation.d.ts +1 -1
  29. package/lib/defs/requiredActionProviderSimpleRepresentation.d.ts +5 -0
  30. package/lib/defs/requiredActionProviderSimpleRepresentation.js +3 -0
  31. package/lib/defs/requiredActionProviderSimpleRepresentation.js.map +1 -0
  32. package/lib/defs/resourceRepresentation.d.ts +10 -6
  33. package/lib/defs/resourceServerRepresentation.d.ts +25 -8
  34. package/lib/defs/resourceServerRepresentation.js +0 -7
  35. package/lib/defs/resourceServerRepresentation.js.map +1 -1
  36. package/lib/resources/agent.d.ts +4 -3
  37. package/lib/resources/agent.js +33 -28
  38. package/lib/resources/agent.js.map +1 -1
  39. package/lib/resources/attackDetection.d.ts +8 -8
  40. package/lib/resources/attackDetection.js.map +1 -1
  41. package/lib/resources/authenticationManagement.d.ts +28 -27
  42. package/lib/resources/authenticationManagement.js.map +1 -1
  43. package/lib/resources/cache.d.ts +2 -2
  44. package/lib/resources/clientPolicies.d.ts +23 -0
  45. package/lib/resources/clientPolicies.js +58 -0
  46. package/lib/resources/clientPolicies.js.map +1 -0
  47. package/lib/resources/clientScopes.d.ts +72 -72
  48. package/lib/resources/clientScopes.js +4 -6
  49. package/lib/resources/clientScopes.js.map +1 -1
  50. package/lib/resources/clients.d.ts +250 -195
  51. package/lib/resources/clients.js +42 -3
  52. package/lib/resources/clients.js.map +1 -1
  53. package/lib/resources/components.d.ts +20 -13
  54. package/lib/resources/components.js +6 -0
  55. package/lib/resources/components.js.map +1 -1
  56. package/lib/resources/groups.d.ts +64 -53
  57. package/lib/resources/groups.js +10 -0
  58. package/lib/resources/groups.js.map +1 -1
  59. package/lib/resources/identityProviders.d.ts +36 -35
  60. package/lib/resources/identityProviders.js.map +1 -1
  61. package/lib/resources/realms.d.ts +55 -47
  62. package/lib/resources/realms.js +8 -1
  63. package/lib/resources/realms.js.map +1 -1
  64. package/lib/resources/resource.d.ts +1 -1
  65. package/lib/resources/roles.d.ts +44 -36
  66. package/lib/resources/roles.js.map +1 -1
  67. package/lib/resources/serverInfo.d.ts +1 -1
  68. package/lib/resources/sessions.d.ts +2 -2
  69. package/lib/resources/userStorageProvider.d.ts +17 -17
  70. package/lib/resources/users.d.ts +136 -105
  71. package/lib/resources/users.js +26 -0
  72. package/lib/resources/users.js.map +1 -1
  73. package/lib/resources/whoAmI.d.ts +2 -2
  74. package/lib/utils/auth.d.ts +10 -0
  75. package/lib/utils/auth.js +3 -3
  76. package/lib/utils/auth.js.map +1 -1
  77. package/package.json +12 -6
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ## Keycloak Admin Client
2
2
 
3
- [![Github Actions](https://github.com/keycloak/keycloak-nodejs-admin-client/workflows/Node.js%20CI/badge.svg)](https://github.com/keycloak/keycloak-nodejs-admin-client/actions)
3
+ [![Github Actions](https://github.com/keycloak/keycloak-nodejs-admin-client/workflows/CI/badge.svg)](https://github.com/keycloak/keycloak-nodejs-admin-client/actions/workflows/main.yaml)
4
4
  [![npm version](https://badge.fury.io/js/%40keycloak%2Fkeycloak-admin-client.svg)](https://badge.fury.io/js/%40keycloak%2Fkeycloak-admin-client)
5
5
 
6
6
  ## Features
@@ -102,6 +102,27 @@ await kcAdminClient.auth(credentials);
102
102
  setInterval(() => kcAdminClient.auth(credentials), 58 * 1000); // 58 seconds
103
103
  ```
104
104
 
105
+ ## Building and running the tests
106
+
107
+ To build the source do a build:
108
+
109
+ ```bash
110
+ npm run build
111
+ ```
112
+
113
+ Start keycloak in a docker container or run it locally:
114
+
115
+ ```bash
116
+ docker run --name keycloak -d -p 127.0.0.1:8080:8080 -e KEYCLOAK_USER=wwwy3y3 -e KEYCLOAK_PASSWORD=wwwy3y3 quay.io/keycloak/keycloak:latest
117
+ ```
118
+
119
+ If you started your container manually make sure there is an admin user named www3y3 with password www3y3 as admin on master realm.
120
+ Then start the tests with:
121
+
122
+ ```bash
123
+ npm run test
124
+ ```
125
+
105
126
  ## Supported APIs
106
127
 
107
128
  ### [Realm admin](https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_realms_admin_resource)
@@ -119,6 +140,10 @@ Demo code: https://github.com/keycloak/keycloak-nodejs-admin-client/blob/master/
119
140
  - Get admin events (`GET /{realm}/admin-events`)
120
141
  - Remove all user sessions (`POST /{realm}/logout-all`)
121
142
  - Remove a specific user session (`DELETE /{realm}/sessions/{session}`)
143
+ - Get client policies policies (`GET /{realm}/client-policies/policies`)
144
+ - Update client policies policies (`PUT /{realm}/client-policies/policies`)
145
+ - Get client policies profiles (`GET /{realm}/client-policies/profiles`)
146
+ - Update client policies profiles (`PUT /{realm}/client-policies/profiles`)
122
147
 
123
148
  ### [Role](https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_roles_resource)
124
149
 
@@ -159,6 +184,9 @@ Demo code: https://github.com/keycloak/keycloak-nodejs-admin-client/blob/master/
159
184
  - Remove TOTP from the user (`PUT /{realm}/users/{id}/remove-totp`)
160
185
  - Set up a temporary password for the user User will have to reset the temporary password next time they log in. (`PUT /{realm}/users/{id}/reset-password`)
161
186
  - Send an email-verification email to the user An email contains a link the user can click to verify their email address. (`PUT /{realm}/users/{id}/send-verify-email`)
187
+ - Update a credential label for a user (`PUT /{realm}/users/{id}/credentials/{credentialId}/userLabel`)
188
+ - Move a credential to a position behind another credential (`POST /{realm}/users/{id}/credentials/{credentialId}/moveAfter/{newPreviousCredentialId}`)
189
+ - Move a credential to a first position in the credentials list of the user (`PUT /{realm}/users/{id}/credentials/{credentialId}/moveToFirst`)
162
190
 
163
191
  ### User group-mapping
164
192
 
@@ -202,6 +230,7 @@ Demo code: https://github.com/keycloak/keycloak-nodejs-admin-client/blob/master/
202
230
  - Get realm-level role mappings (`GET /{realm}/groups/{id}/role-mappings/realm`)
203
231
  - Delete realm-level role mappings (`DELETE /{realm}/groups/{id}/role-mappings/realm`)
204
232
  - Get realm-level roles that can be mapped (`GET /{realm}/groups/{id}/role-mappings/realm/available`)
233
+ - Get effective realm-level role mappings This will recurse all composite roles to get the result. (`GET /{realm}/groups/{id}/role-mappings/realm/composite`)
205
234
 
206
235
  ### [Client](https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_clients_resource)
207
236
 
@@ -231,6 +260,7 @@ Demo code: https://github.com/keycloak/keycloak-nodejs-admin-client/blob/master/
231
260
  - Get client-level role mappings for the group (`GET /{realm}/groups/{id}/role-mappings/clients/{client}`)
232
261
  - Delete client-level roles from group role mapping (`DELETE /{realm}/groups/{id}/role-mappings/clients/{client}`)
233
262
  - Get available client-level roles that can be mapped to the group (`GET /{realm}/groups/{id}/role-mappings/clients/{client}/available`)
263
+ - Get effective client-level role mappings This will recurse all composite roles to get the result. (`GET /{realm}/groups/{id}/role-mappings/clients/{client}/composite`)
234
264
 
235
265
  ### [Client role-mapping for user](https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_client_role_mappings_resource)
236
266
 
@@ -240,6 +270,7 @@ Demo code: https://github.com/keycloak/keycloak-nodejs-admin-client/blob/master/
240
270
  - Get client-level role mappings for the user (`GET /{realm}/users/{id}/role-mappings/clients/{client}`)
241
271
  - Delete client-level roles from user role mapping (`DELETE /{realm}/users/{id}/role-mappings/clients/{client}`)
242
272
  - Get available client-level roles that can be mapped to the user (`GET /{realm}/users/{id}/role-mappings/clients/{client}/available`)
273
+ - Get effective client-level role mappings This will recurse all composite roles to get the result. (`GET /{realm}/users/{id}/role-mappings/clients/{client}/composite`)
243
274
 
244
275
  ### [Client Attribute Certificate](https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_client_attribute_certificate_resource)
245
276
 
package/lib/client.d.ts CHANGED
@@ -6,6 +6,7 @@ import { Roles } from './resources/roles';
6
6
  import { Clients } from './resources/clients';
7
7
  import { Realms } from './resources/realms';
8
8
  import { ClientScopes } from './resources/clientScopes';
9
+ import { ClientPolicies } from './resources/clientPolicies';
9
10
  import { IdentityProviders } from './resources/identityProviders';
10
11
  import { Components } from './resources/components';
11
12
  import { AuthenticationManagement } from './resources/authenticationManagement';
@@ -15,7 +16,7 @@ import { AttackDetection } from './resources/attackDetection';
15
16
  import { AxiosRequestConfig } from 'axios';
16
17
  import { Sessions } from './resources/sessions';
17
18
  import { UserStorageProvider } from './resources/userStorageProvider';
18
- import type { KeycloakInstance } from 'keycloak-js';
19
+ import type { KeycloakInstance, KeycloakInitOptions, KeycloakConfig } from 'keycloak-js';
19
20
  export interface ConnectionConfig {
20
21
  baseUrl?: string;
21
22
  realmName?: string;
@@ -29,6 +30,7 @@ export declare class KeycloakAdminClient {
29
30
  clients: Clients;
30
31
  realms: Realms;
31
32
  clientScopes: ClientScopes;
33
+ clientPolicies: ClientPolicies;
32
34
  identityProviders: IdentityProviders;
33
35
  components: Components;
34
36
  serverInfo: ServerInfo;
@@ -39,15 +41,15 @@ export declare class KeycloakAdminClient {
39
41
  cache: Cache;
40
42
  baseUrl: string;
41
43
  realmName: string;
42
- accessToken: string;
43
- refreshToken: string;
44
+ accessToken?: string;
45
+ refreshToken?: string;
44
46
  keycloak?: KeycloakInstance;
45
47
  private requestConfig?;
46
48
  constructor(connectionConfig?: ConnectionConfig);
47
49
  auth(credentials: Credentials): Promise<void>;
48
- init(init?: any, config?: any): Promise<void>;
50
+ init(init?: KeycloakInitOptions, config?: KeycloakConfig): Promise<void>;
49
51
  setAccessToken(token: string): void;
50
- getAccessToken(): Promise<string>;
51
- getRequestConfig(): AxiosRequestConfig;
52
+ getAccessToken(): Promise<string | undefined>;
53
+ getRequestConfig(): AxiosRequestConfig<any> | undefined;
52
54
  setConfig(connectionConfig: ConnectionConfig): void;
53
55
  }
package/lib/client.js CHANGED
@@ -65,6 +65,7 @@ var roles_1 = require("./resources/roles");
65
65
  var clients_1 = require("./resources/clients");
66
66
  var realms_1 = require("./resources/realms");
67
67
  var clientScopes_1 = require("./resources/clientScopes");
68
+ var clientPolicies_1 = require("./resources/clientPolicies");
68
69
  var identityProviders_1 = require("./resources/identityProviders");
69
70
  var components_1 = require("./resources/components");
70
71
  var authenticationManagement_1 = require("./resources/authenticationManagement");
@@ -87,6 +88,7 @@ var KeycloakAdminClient = (function () {
87
88
  this.clients = new clients_1.Clients(this);
88
89
  this.realms = new realms_1.Realms(this);
89
90
  this.clientScopes = new clientScopes_1.ClientScopes(this);
91
+ this.clientPolicies = new clientPolicies_1.ClientPolicies(this);
90
92
  this.identityProviders = new identityProviders_1.IdentityProviders(this);
91
93
  this.components = new components_1.Components(this);
92
94
  this.authenticationManagement = new authenticationManagement_1.AuthenticationManagement(this);
@@ -118,21 +120,27 @@ var KeycloakAdminClient = (function () {
118
120
  };
119
121
  KeycloakAdminClient.prototype.init = function (init, config) {
120
122
  return __awaiter(this, void 0, void 0, function () {
121
- var Keycloak_1;
123
+ var Keycloak;
122
124
  return __generator(this, function (_a) {
123
125
  switch (_a.label) {
124
126
  case 0:
125
- if (!window) return [3, 3];
127
+ if (typeof window === 'undefined') {
128
+ return [2];
129
+ }
126
130
  return [4, Promise.resolve().then(function () { return __importStar(require('keycloak-js')); })];
127
131
  case 1:
128
- Keycloak_1 = (_a.sent())["default"];
129
- this.keycloak = Keycloak_1(config);
132
+ Keycloak = (_a.sent())["default"];
133
+ this.keycloak = Keycloak(config);
134
+ if (!init) return [3, 3];
130
135
  return [4, this.keycloak.init(init)];
131
136
  case 2:
132
137
  _a.sent();
133
- this.baseUrl = this.keycloak.authServerUrl;
134
138
  _a.label = 3;
135
- case 3: return [2];
139
+ case 3:
140
+ if (this.keycloak.authServerUrl) {
141
+ this.baseUrl = this.keycloak.authServerUrl;
142
+ }
143
+ return [2];
136
144
  }
137
145
  });
138
146
  });
package/lib/client.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAmD;AACnD,+CAA+D;AAC/D,2CAAwC;AACxC,2CAAwC;AACxC,6CAA0C;AAC1C,2CAAwC;AACxC,+CAA4C;AAC5C,6CAA0C;AAC1C,yDAAsD;AACtD,mEAAgE;AAChE,qDAAkD;AAClD,iFAA8E;AAC9E,qDAAkD;AAClD,6CAA0C;AAC1C,+DAA4D;AAG5D,iDAA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AEM,8CAAgB,GAAvB;QACE,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAEM,uCAAS,GAAhB,UAAiB,gBAAkC;QACjD,IACE,OAAO,gBAAgB,CAAC,OAAO,KAAK,QAAQ;YAC5C,gBAAgB,CAAC,OAAO,EACxB;YACA,IAAI,CAAC,OAAO,GAAG,gBAAgB,CAAC,OAAO,CAAC;SACzC;QAED,IACE,OAAO,gBAAgB,CAAC,SAAS,KAAK,QAAQ;YAC9C,gBAAgB,CAAC,SAAS,EAC1B;YACA,IAAI,CAAC,SAAS,GAAG,gBAAgB,CAAC,SAAS,CAAC;SAC7C;QACD,IAAI,CAAC,aAAa,GAAG,gBAAgB,CAAC,aAAa,CAAC;IACtD,CAAC;IACH,0BAAC;AAAD,CAAC,AAtHD,IAsHC;AAtHY,kDAAmB"}
@@ -0,0 +1,4 @@
1
+ import ClientPolicyRepresentation from './clientPolicyRepresentation';
2
+ export default interface ClientPoliciesRepresentation {
3
+ policies?: ClientPolicyRepresentation[];
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ //# sourceMappingURL=clientPoliciesRepresentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientPoliciesRepresentation.js","sourceRoot":"","sources":["../../src/defs/clientPoliciesRepresentation.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export default interface ClientPolicyConditionRepresentation {
2
+ condition?: string;
3
+ configuration?: object;
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ //# sourceMappingURL=clientPolicyConditionRepresentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientPolicyConditionRepresentation.js","sourceRoot":"","sources":["../../src/defs/clientPolicyConditionRepresentation.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export default interface ClientPolicyExecutorRepresentation {
2
+ configuration?: object;
3
+ executor?: string;
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ //# sourceMappingURL=clientPolicyExecutorRepresentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientPolicyExecutorRepresentation.js","sourceRoot":"","sources":["../../src/defs/clientPolicyExecutorRepresentation.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ import ClientPolicyConditionRepresentation from './clientPolicyConditionRepresentation';
2
+ export default interface ClientPolicyRepresentation {
3
+ conditions?: ClientPolicyConditionRepresentation[];
4
+ description?: string;
5
+ enabled?: boolean;
6
+ name?: string;
7
+ profiles?: string[];
8
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ //# sourceMappingURL=clientPolicyRepresentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientPolicyRepresentation.js","sourceRoot":"","sources":["../../src/defs/clientPolicyRepresentation.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import ClientPolicyExecutorRepresentation from './clientPolicyExecutorRepresentation';
2
+ export default interface ClientProfileRepresentation {
3
+ description?: string;
4
+ executors?: ClientPolicyExecutorRepresentation[];
5
+ name?: string;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ //# sourceMappingURL=clientProfileRepresentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientProfileRepresentation.js","sourceRoot":"","sources":["../../src/defs/clientProfileRepresentation.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import ClientProfileRepresentation from './clientProfileRepresentation';
2
+ export default interface ClientProfilesRepresentation {
3
+ globalProfiles?: ClientProfileRepresentation[];
4
+ profiles?: ClientProfileRepresentation[];
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ //# sourceMappingURL=clientProfilesRepresentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientProfilesRepresentation.js","sourceRoot":"","sources":["../../src/defs/clientProfilesRepresentation.ts"],"names":[],"mappings":""}
@@ -1,15 +1,11 @@
1
1
  export default interface CredentialRepresentation {
2
- algorithm?: string;
3
- config?: Record<string, any>;
4
- counter?: number;
5
2
  createdDate?: number;
6
- device?: string;
7
- digits?: number;
8
- hashIterations?: number;
9
- hashedSaltedValue?: string;
10
- period?: number;
11
- salt?: string;
3
+ credentialData?: string;
4
+ id?: string;
5
+ priority?: number;
6
+ secretData?: string;
12
7
  temporary?: boolean;
13
8
  type?: string;
9
+ userLabel?: string;
14
10
  value?: string;
15
11
  }
@@ -0,0 +1,8 @@
1
+ import { ConfigPropertyRepresentation } from './configPropertyRepresentation';
2
+ export interface IdentityProviderMapperTypeRepresentation {
3
+ id?: string;
4
+ name?: string;
5
+ category?: string;
6
+ helpText?: string;
7
+ properties?: ConfigPropertyRepresentation[];
8
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ //# sourceMappingURL=identityProviderMapperTypeRepresentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identityProviderMapperTypeRepresentation.js","sourceRoot":"","sources":["../../src/defs/identityProviderMapperTypeRepresentation.ts"],"names":[],"mappings":""}
@@ -5,6 +5,9 @@ import GroupRepresentation from './groupRepresentation';
5
5
  import IdentityProviderRepresentation from './identityProviderRepresentation';
6
6
  import RequiredActionProviderRepresentation from './requiredActionProviderRepresentation';
7
7
  import RolesRepresentation from './rolesRepresentation';
8
+ import ClientProfilesRepresentation from './clientProfilesRepresentation';
9
+ import ClientPoliciesRepresentation from './clientPoliciesRepresentation';
10
+ import RoleRepresentation from './roleRepresentation';
8
11
  export default interface RealmRepresentation {
9
12
  accessCodeLifespan?: number;
10
13
  accessCodeLifespanLogin?: number;
@@ -27,6 +30,8 @@ export default interface RealmRepresentation {
27
30
  clientScopeMappings?: Record<string, any>;
28
31
  clientScopes?: any[];
29
32
  clients?: ClientRepresentation[];
33
+ clientPolicies?: ClientPoliciesRepresentation;
34
+ clientProfiles?: ClientProfilesRepresentation;
30
35
  components?: {
31
36
  [index: string]: ComponentExportRepresentation;
32
37
  };
@@ -35,6 +40,7 @@ export default interface RealmRepresentation {
35
40
  defaultLocale?: string;
36
41
  defaultOptionalClientScopes?: string[];
37
42
  defaultRoles?: string[];
43
+ defaultRole?: RoleRepresentation;
38
44
  directGrantFlow?: string;
39
45
  displayName?: string;
40
46
  displayNameHtml?: string;
@@ -99,3 +105,18 @@ export default interface RealmRepresentation {
99
105
  verifyEmail?: boolean;
100
106
  waitIncrementSeconds?: number;
101
107
  }
108
+ export declare type PartialImportRealmRepresentation = RealmRepresentation & {
109
+ ifResourceExists: 'FAIL' | 'SKIP' | 'OVERWRITE';
110
+ };
111
+ export declare type PartialImportResponse = {
112
+ overwritten: number;
113
+ added: number;
114
+ skipped: number;
115
+ results: PartialImportResult[];
116
+ };
117
+ export declare type PartialImportResult = {
118
+ action: string;
119
+ resourceType: string;
120
+ resourceName: string;
121
+ id: string;
122
+ };
@@ -11,6 +11,6 @@ export default interface RequiredActionProviderRepresentation {
11
11
  defaultAction?: boolean;
12
12
  enabled?: boolean;
13
13
  name?: string;
14
- provider?: string;
14
+ providerId?: string;
15
15
  priority?: number;
16
16
  }
@@ -0,0 +1,5 @@
1
+ export default interface RequiredActionProviderSimpleRepresentation {
2
+ id?: string;
3
+ name?: string;
4
+ providerId?: string;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ //# sourceMappingURL=requiredActionProviderSimpleRepresentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requiredActionProviderSimpleRepresentation.js","sourceRoot":"","sources":["../../src/defs/requiredActionProviderSimpleRepresentation.ts"],"names":[],"mappings":""}
@@ -1,12 +1,16 @@
1
+ import { ResourceOwnerRepresentation } from './resourceServerRepresentation';
1
2
  import ScopeRepresentation from './scopeRepresentation';
2
3
  export default interface ResourceRepresentation {
3
- id?: string;
4
- attributes?: Record<string, any>;
5
- displayName?: string;
6
- icon_uri?: string;
7
4
  name?: string;
5
+ type?: string;
6
+ owner?: ResourceOwnerRepresentation;
8
7
  ownerManagedAccess?: boolean;
8
+ displayName?: string;
9
+ attributes?: {
10
+ [index: string]: string[];
11
+ };
12
+ _id?: string;
13
+ uris?: string[];
9
14
  scopes?: ScopeRepresentation[];
10
- type?: string;
11
- uri?: string;
15
+ icon_uri?: string;
12
16
  }
@@ -1,18 +1,35 @@
1
1
  import PolicyRepresentation from './policyRepresentation';
2
2
  import ResourceRepresentation from './resourceRepresentation';
3
3
  import ScopeRepresentation from './scopeRepresentation';
4
- export declare enum PolicyEnforcementMode {
5
- ENFORCING = "ENFORCING",
6
- PERMISSIVE = "PERMISSIVE",
7
- DISABLED = "DISABLED"
8
- }
9
4
  export default interface ResourceServerRepresentation {
10
- allowRemoteResourceManagement?: boolean;
11
- clientId?: string;
12
5
  id?: string;
6
+ clientId?: string;
13
7
  name?: string;
14
- policies?: PolicyRepresentation[];
8
+ allowRemoteResourceManagement?: boolean;
15
9
  policyEnforcementMode?: PolicyEnforcementMode;
16
10
  resources?: ResourceRepresentation[];
11
+ policies?: PolicyRepresentation[];
17
12
  scopes?: ScopeRepresentation[];
13
+ decisionStrategy?: DecisionStrategy;
14
+ }
15
+ export interface ResourceOwnerRepresentation {
16
+ id?: string;
17
+ name?: string;
18
+ }
19
+ export interface AbstractPolicyRepresentation {
20
+ id?: string;
21
+ name?: string;
22
+ description?: string;
23
+ type?: string;
24
+ policies?: string[];
25
+ resources?: string[];
26
+ scopes?: string[];
27
+ logic?: Logic;
28
+ decisionStrategy?: DecisionStrategy;
29
+ owner?: string;
30
+ resourcesData?: ResourceRepresentation[];
31
+ scopesData?: ScopeRepresentation[];
18
32
  }
33
+ export declare type PolicyEnforcementMode = 'ENFORCING' | 'PERMISSIVE' | 'DISABLED';
34
+ export declare type DecisionStrategy = 'AFFIRMATIVE' | 'UNANIMOUS' | 'CONSENSUS';
35
+ export declare type Logic = 'POSITIVE' | 'NEGATIVE';
@@ -1,10 +1,3 @@
1
1
  "use strict";
2
2
  exports.__esModule = true;
3
- exports.PolicyEnforcementMode = void 0;
4
- var PolicyEnforcementMode;
5
- (function (PolicyEnforcementMode) {
6
- PolicyEnforcementMode["ENFORCING"] = "ENFORCING";
7
- PolicyEnforcementMode["PERMISSIVE"] = "PERMISSIVE";
8
- PolicyEnforcementMode["DISABLED"] = "DISABLED";
9
- })(PolicyEnforcementMode = exports.PolicyEnforcementMode || (exports.PolicyEnforcementMode = {}));
10
3
  //# sourceMappingURL=resourceServerRepresentation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resourceServerRepresentation.js","sourceRoot":"","sources":["../../src/defs/resourceServerRepresentation.ts"],"names":[],"mappings":";;;AAOA,IAAY,qBAIX;AAJD,WAAY,qBAAqB;IAC/B,gDAAuB,CAAA;IACvB,kDAAyB,CAAA;IACzB,8CAAqB,CAAA;AACvB,CAAC,EAJW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAIhC"}
1
+ {"version":3,"file":"resourceServerRepresentation.js","sourceRoot":"","sources":["../../src/defs/resourceServerRepresentation.ts"],"names":[],"mappings":""}
@@ -1,4 +1,4 @@
1
- import { Method } from 'axios';
1
+ import { AxiosRequestHeaders, Method } from 'axios';
2
2
  import { KeycloakAdminClient } from '../client';
3
3
  export interface RequestArgs {
4
4
  method: Method;
@@ -12,6 +12,7 @@ export interface RequestArgs {
12
12
  field: string;
13
13
  };
14
14
  ignoredKeys?: string[];
15
+ headers?: AxiosRequestHeaders;
15
16
  }
16
17
  export declare class Agent {
17
18
  private client;
@@ -24,8 +25,8 @@ export declare class Agent {
24
25
  getUrlParams?: () => Record<string, any>;
25
26
  getBaseUrl?: () => string;
26
27
  });
27
- request({ method, path, urlParamKeys, queryParamKeys, catchNotFound, keyTransform, payloadKey, returnResourceIdInLocationHeader, ignoredKeys, }: RequestArgs): (payload?: any) => Promise<any>;
28
- updateRequest({ method, path, urlParamKeys, queryParamKeys, catchNotFound, keyTransform, payloadKey, returnResourceIdInLocationHeader, }: RequestArgs): (query?: any, payload?: any) => Promise<any>;
28
+ request({ method, path, urlParamKeys, queryParamKeys, catchNotFound, keyTransform, payloadKey, returnResourceIdInLocationHeader, ignoredKeys, headers, }: RequestArgs): (payload?: any) => Promise<any>;
29
+ updateRequest({ method, path, urlParamKeys, queryParamKeys, catchNotFound, keyTransform, payloadKey, returnResourceIdInLocationHeader, headers }: RequestArgs): (query?: any, payload?: any) => Promise<any>;
29
30
  private requestWithParams;
30
31
  private transformKey;
31
32
  }