@authup/client-web-kit 1.0.0-beta.19 → 1.0.0-beta.21

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 (182) hide show
  1. package/dist/components/AEntityDelete.d.ts +6 -6
  2. package/dist/components/AEntityDelete.d.ts.map +1 -1
  3. package/dist/components/client/AClient.d.ts +4 -4
  4. package/dist/components/client/AClient.d.ts.map +1 -1
  5. package/dist/components/client/AClientForm.d.ts +7 -7
  6. package/dist/components/client/AClientForm.d.ts.map +1 -1
  7. package/dist/components/client/AClientRedirectUris.d.ts +6 -6
  8. package/dist/components/client/AClientRedirectUris.d.ts.map +1 -1
  9. package/dist/components/client/AClientRedirectUrisItem.d.ts +6 -6
  10. package/dist/components/client/AClientRedirectUrisItem.d.ts.map +1 -1
  11. package/dist/components/client/AClients.d.ts +6 -6
  12. package/dist/components/client/AClients.d.ts.map +1 -1
  13. package/dist/components/client-scope/AClientScope.d.ts +4 -4
  14. package/dist/components/client-scope/AClientScope.d.ts.map +1 -1
  15. package/dist/components/client-scope/AClientScopeAssignment.d.ts +5 -5
  16. package/dist/components/client-scope/AClientScopeAssignment.d.ts.map +1 -1
  17. package/dist/components/client-scope/AClientScopeAssignments.d.ts +4 -4
  18. package/dist/components/client-scope/AClientScopeAssignments.d.ts.map +1 -1
  19. package/dist/components/client-scope/AClientScopes.d.ts +6 -6
  20. package/dist/components/client-scope/AClientScopes.d.ts.map +1 -1
  21. package/dist/components/identity-provider/AIdentityProvider.d.ts +4 -4
  22. package/dist/components/identity-provider/AIdentityProvider.d.ts.map +1 -1
  23. package/dist/components/identity-provider/AIdentityProviderBasicFields.d.ts +5 -5
  24. package/dist/components/identity-provider/AIdentityProviderBasicFields.d.ts.map +1 -1
  25. package/dist/components/identity-provider/AIdentityProviderForm.d.ts +5 -5
  26. package/dist/components/identity-provider/AIdentityProviderForm.d.ts.map +1 -1
  27. package/dist/components/identity-provider/AIdentityProviderIcon.d.ts +4 -4
  28. package/dist/components/identity-provider/AIdentityProviderIcon.d.ts.map +1 -1
  29. package/dist/components/identity-provider/AIdentityProviderLdapConnectionFields.d.ts +6 -6
  30. package/dist/components/identity-provider/AIdentityProviderLdapConnectionFields.d.ts.map +1 -1
  31. package/dist/components/identity-provider/AIdentityProviderLdapCredentialsFields.d.ts +6 -6
  32. package/dist/components/identity-provider/AIdentityProviderLdapCredentialsFields.d.ts.map +1 -1
  33. package/dist/components/identity-provider/AIdentityProviderLdapForm.d.ts +6 -6
  34. package/dist/components/identity-provider/AIdentityProviderLdapForm.d.ts.map +1 -1
  35. package/dist/components/identity-provider/AIdentityProviderLdapGroupFields.d.ts +6 -6
  36. package/dist/components/identity-provider/AIdentityProviderLdapGroupFields.d.ts.map +1 -1
  37. package/dist/components/identity-provider/AIdentityProviderLdapUserFields.d.ts +6 -6
  38. package/dist/components/identity-provider/AIdentityProviderLdapUserFields.d.ts.map +1 -1
  39. package/dist/components/identity-provider/AIdentityProviderOAuth2ClientFields.d.ts +5 -5
  40. package/dist/components/identity-provider/AIdentityProviderOAuth2ClientFields.d.ts.map +1 -1
  41. package/dist/components/identity-provider/AIdentityProviderOAuth2Discovery.d.ts +2 -2
  42. package/dist/components/identity-provider/AIdentityProviderOAuth2Discovery.d.ts.map +1 -1
  43. package/dist/components/identity-provider/AIdentityProviderOAuth2EndpointFields.d.ts +5 -5
  44. package/dist/components/identity-provider/AIdentityProviderOAuth2EndpointFields.d.ts.map +1 -1
  45. package/dist/components/identity-provider/AIdentityProviderOAuth2Form.d.ts +35 -8
  46. package/dist/components/identity-provider/AIdentityProviderOAuth2Form.d.ts.map +1 -1
  47. package/dist/components/identity-provider/AIdentityProviderPicker.d.ts +4 -4
  48. package/dist/components/identity-provider/AIdentityProviderPicker.d.ts.map +1 -1
  49. package/dist/components/identity-provider/AIdentityProviderPreset.d.ts +4 -4
  50. package/dist/components/identity-provider/AIdentityProviderPreset.d.ts.map +1 -1
  51. package/dist/components/identity-provider/AIdentityProviderProtocol.d.ts +4 -4
  52. package/dist/components/identity-provider/AIdentityProviderProtocol.d.ts.map +1 -1
  53. package/dist/components/identity-provider/AIdentityProviders.d.ts +6 -6
  54. package/dist/components/identity-provider/AIdentityProviders.d.ts.map +1 -1
  55. package/dist/components/identity-provider-role/AIdentityProviderRoleAssignment.d.ts +5 -5
  56. package/dist/components/identity-provider-role/AIdentityProviderRoleAssignment.d.ts.map +1 -1
  57. package/dist/components/identity-provider-role/AIdentityProviderRoleAssignments.d.ts +4 -4
  58. package/dist/components/identity-provider-role/AIdentityProviderRoleAssignments.d.ts.map +1 -1
  59. package/dist/components/permission/APermission.d.ts +4 -4
  60. package/dist/components/permission/APermission.d.ts.map +1 -1
  61. package/dist/components/permission/APermissionCheck.d.ts +30 -0
  62. package/dist/components/permission/APermissionCheck.d.ts.map +1 -0
  63. package/dist/components/permission/APermissionForm.d.ts +5 -5
  64. package/dist/components/permission/APermissionForm.d.ts.map +1 -1
  65. package/dist/components/permission/APermissions.d.ts +6 -6
  66. package/dist/components/permission/APermissions.d.ts.map +1 -1
  67. package/dist/components/permission/index.d.ts +1 -0
  68. package/dist/components/permission/index.d.ts.map +1 -1
  69. package/dist/components/permission-robot/APermissionRobotAssignments.d.ts +4 -4
  70. package/dist/components/permission-robot/APermissionRobotAssignments.d.ts.map +1 -1
  71. package/dist/components/permission-role/APermissionRoleAssignments.d.ts +4 -4
  72. package/dist/components/permission-role/APermissionRoleAssignments.d.ts.map +1 -1
  73. package/dist/components/permission-user/APermissionUserAssignments.d.ts +4 -4
  74. package/dist/components/permission-user/APermissionUserAssignments.d.ts.map +1 -1
  75. package/dist/components/realm/ARealm.d.ts +4 -4
  76. package/dist/components/realm/ARealm.d.ts.map +1 -1
  77. package/dist/components/realm/ARealmForm.d.ts +6 -6
  78. package/dist/components/realm/ARealmForm.d.ts.map +1 -1
  79. package/dist/components/realm/ARealms.d.ts +6 -6
  80. package/dist/components/realm/ARealms.d.ts.map +1 -1
  81. package/dist/components/robot/ARobot.d.ts +4 -4
  82. package/dist/components/robot/ARobot.d.ts.map +1 -1
  83. package/dist/components/robot/ARobotForm.d.ts +7 -7
  84. package/dist/components/robot/ARobotForm.d.ts.map +1 -1
  85. package/dist/components/robot/ARobots.d.ts +6 -6
  86. package/dist/components/robot/ARobots.d.ts.map +1 -1
  87. package/dist/components/robot-permission/ARobotPermissionAssignment.d.ts +5 -5
  88. package/dist/components/robot-permission/ARobotPermissionAssignment.d.ts.map +1 -1
  89. package/dist/components/robot-permission/ARobotPermissionAssignments.d.ts +4 -4
  90. package/dist/components/robot-permission/ARobotPermissionAssignments.d.ts.map +1 -1
  91. package/dist/components/robot-role/ARobotRoleAssignment.d.ts +5 -5
  92. package/dist/components/robot-role/ARobotRoleAssignment.d.ts.map +1 -1
  93. package/dist/components/robot-role/ARobotRoleAssignments.d.ts +4 -4
  94. package/dist/components/robot-role/ARobotRoleAssignments.d.ts.map +1 -1
  95. package/dist/components/role/ARole.d.ts +4 -4
  96. package/dist/components/role/ARole.d.ts.map +1 -1
  97. package/dist/components/role/ARoleForm.d.ts +6 -6
  98. package/dist/components/role/ARoleForm.d.ts.map +1 -1
  99. package/dist/components/role/ARoles.d.ts +6 -6
  100. package/dist/components/role/ARoles.d.ts.map +1 -1
  101. package/dist/components/role-permission/ARolePermissionAssignment.d.ts +5 -5
  102. package/dist/components/role-permission/ARolePermissionAssignment.d.ts.map +1 -1
  103. package/dist/components/role-permission/ARolePermissionAssignments.d.ts +4 -4
  104. package/dist/components/role-permission/ARolePermissionAssignments.d.ts.map +1 -1
  105. package/dist/components/role-robot/ARoleRobotAssignments.d.ts +4 -4
  106. package/dist/components/role-robot/ARoleRobotAssignments.d.ts.map +1 -1
  107. package/dist/components/role-user/ARoleUserAssignments.d.ts +4 -4
  108. package/dist/components/role-user/ARoleUserAssignments.d.ts.map +1 -1
  109. package/dist/components/scope/AScope.d.ts +4 -4
  110. package/dist/components/scope/AScope.d.ts.map +1 -1
  111. package/dist/components/scope/AScopeForm.d.ts +6 -6
  112. package/dist/components/scope/AScopeForm.d.ts.map +1 -1
  113. package/dist/components/scope/AScopes.d.ts +6 -6
  114. package/dist/components/scope/AScopes.d.ts.map +1 -1
  115. package/dist/components/scope-client/AScopeClientAssignments.d.ts +4 -4
  116. package/dist/components/scope-client/AScopeClientAssignments.d.ts.map +1 -1
  117. package/dist/components/user/AUser.d.ts +4 -4
  118. package/dist/components/user/AUser.d.ts.map +1 -1
  119. package/dist/components/user/AUserForm.d.ts +6 -6
  120. package/dist/components/user/AUserForm.d.ts.map +1 -1
  121. package/dist/components/user/AUserPasswordForm.d.ts +5 -5
  122. package/dist/components/user/AUserPasswordForm.d.ts.map +1 -1
  123. package/dist/components/user/AUsers.d.ts +6 -6
  124. package/dist/components/user/AUsers.d.ts.map +1 -1
  125. package/dist/components/user-permission/AUserPermissionAssignment.d.ts +5 -5
  126. package/dist/components/user-permission/AUserPermissionAssignment.d.ts.map +1 -1
  127. package/dist/components/user-permission/AUserPermissionAssignments.d.ts +4 -4
  128. package/dist/components/user-permission/AUserPermissionAssignments.d.ts.map +1 -1
  129. package/dist/components/user-role/AUserRoleAssignment.d.ts +5 -5
  130. package/dist/components/user-role/AUserRoleAssignment.d.ts.map +1 -1
  131. package/dist/components/user-role/AUserRoleAssignments.d.ts +4 -4
  132. package/dist/components/user-role/AUserRoleAssignments.d.ts.map +1 -1
  133. package/dist/components/utility/LanguageSwitcherDropdown.d.ts +5 -5
  134. package/dist/components/utility/LanguageSwitcherDropdown.d.ts.map +1 -1
  135. package/dist/components/utility/pagination/APagination.d.ts +4 -4
  136. package/dist/components/utility/pagination/APagination.d.ts.map +1 -1
  137. package/dist/components/utility/search/ASearch.d.ts +5 -5
  138. package/dist/components/utility/search/ASearch.d.ts.map +1 -1
  139. package/dist/components/utility/title/ATitle.d.ts +5 -5
  140. package/dist/components/utility/title/ATitle.d.ts.map +1 -1
  141. package/dist/composables/index.d.ts +1 -1
  142. package/dist/composables/index.d.ts.map +1 -1
  143. package/dist/composables/use-permission-check.d.ts +4 -0
  144. package/dist/composables/use-permission-check.d.ts.map +1 -0
  145. package/dist/core/http-client/install.d.ts.map +1 -1
  146. package/dist/core/http-client/types.d.ts +1 -0
  147. package/dist/core/http-client/types.d.ts.map +1 -1
  148. package/dist/core/index.d.ts +1 -0
  149. package/dist/core/index.d.ts.map +1 -1
  150. package/dist/core/permission-check/index.d.ts +3 -0
  151. package/dist/core/permission-check/index.d.ts.map +1 -0
  152. package/dist/core/permission-check/module.d.ts +3 -0
  153. package/dist/core/permission-check/module.d.ts.map +1 -0
  154. package/dist/core/permission-check/types.d.ts +11 -0
  155. package/dist/core/permission-check/types.d.ts.map +1 -0
  156. package/dist/core/store/create.d.ts +84 -39
  157. package/dist/core/store/create.d.ts.map +1 -1
  158. package/dist/core/store/install.d.ts.map +1 -1
  159. package/dist/core/store/singleton.d.ts +3 -3
  160. package/dist/core/store/singleton.d.ts.map +1 -1
  161. package/dist/core/store/utils.d.ts +1 -2
  162. package/dist/core/store/utils.d.ts.map +1 -1
  163. package/dist/index.cjs +800 -448
  164. package/dist/index.cjs.map +1 -1
  165. package/dist/index.mjs +603 -258
  166. package/dist/index.mjs.map +1 -1
  167. package/dist/module.d.ts.map +1 -1
  168. package/dist/security/index.d.ts +2 -0
  169. package/dist/security/index.d.ts.map +1 -0
  170. package/dist/security/policy/index.d.ts +3 -0
  171. package/dist/security/policy/index.d.ts.map +1 -0
  172. package/dist/security/policy/module.d.ts +5 -0
  173. package/dist/security/policy/module.d.ts.map +1 -0
  174. package/dist/security/policy/variants/evaluator.d.ts +11 -0
  175. package/dist/security/policy/variants/evaluator.d.ts.map +1 -0
  176. package/dist/security/policy/variants/index.d.ts +2 -0
  177. package/dist/security/policy/variants/index.d.ts.map +1 -0
  178. package/dist/types.d.ts +13 -2
  179. package/dist/types.d.ts.map +1 -1
  180. package/package.json +21 -20
  181. package/dist/composables/use-ability-check.d.ts +0 -3
  182. package/dist/composables/use-ability-check.d.ts.map +0 -1
package/dist/index.mjs CHANGED
@@ -2,8 +2,8 @@ import { REALM_MASTER_NAME, DomainEventName, buildDomainChannelName, DomainType,
2
2
  import { hasInjectionContext, inject as inject$2, provide as provide$1, ref, computed, getCurrentScope, onScopeDispose, toRaw, isRef, isReactive, toRef, unref, h, onMounted, onUnmounted, watch, shallowRef, watchEffect, defineComponent, reactive, nextTick, getCurrentInstance, resolveDynamicComponent, mergeProps } from 'vue';
3
3
  import { Client, isClientTokenExpiredError, CookieName, ClientResponseErrorTokenHook } from '@authup/core-http-kit';
4
4
  import { defineStore, storeToRefs as storeToRefs$1 } from 'pinia';
5
- import { Abilities, buildEventFullName, EventNameSuffix, hasOwnProperty, createNanoID, isOAuth2OpenIDProviderMetadata, isObject as isObject$1 } from '@authup/kit';
6
- import { merge, isObject, createMerger } from 'smob';
5
+ import { BuiltInPolicyType, PolicyError, maybeInvertPolicyOutcome, PermissionBindingPolicyValidator, PolicyEngine as PolicyEngine$1, PermissionMemoryProvider, PermissionChecker, TokenError, buildEventFullName, EventNameSuffix, hasOwnProperty, createNanoID, isOAuth2OpenIDProviderMetadata, isObject as isObject$2 } from '@authup/kit';
6
+ import { isObject as isObject$1, merge, createMerger } from 'smob';
7
7
  import { buildList, SlotName } from '@vuecs/list-controls';
8
8
  import { ClientManager } from '@authup/core-realtime-kit';
9
9
  import { SortDirection } from 'rapiq';
@@ -61,6 +61,52 @@ function injectHTTPClient(app) {
61
61
  * view the LICENSE file that was distributed with this source code.
62
62
  */ const STORE_ID = 'authup';
63
63
 
64
+ class PermissionBindingPolicyEvaluator {
65
+ async can(ctx) {
66
+ return ctx.spec.type === BuiltInPolicyType.PERMISSION_BINDING;
67
+ }
68
+ async validateSpecification(ctx) {
69
+ return this.validator.run(ctx.spec);
70
+ }
71
+ async validateData(ctx) {
72
+ if (!isObject$1(ctx.data.identity) && !isObject$1(ctx.data.permission)) {
73
+ throw PolicyError.evaluatorContextInvalid();
74
+ }
75
+ return ctx.data;
76
+ }
77
+ async evaluate(ctx) {
78
+ // todo: this must be changed when the permission-checker not only checks owned permissions.
79
+ return maybeInvertPolicyOutcome(true, ctx.spec.invert);
80
+ }
81
+ constructor(){
82
+ this.validator = new PermissionBindingPolicyValidator();
83
+ }
84
+ }
85
+
86
+ class PolicyEngine extends PolicyEngine$1 {
87
+ constructor(){
88
+ super();
89
+ this.registerEvaluator(BuiltInPolicyType.PERMISSION_BINDING, new PermissionBindingPolicyEvaluator());
90
+ }
91
+ }
92
+
93
+ function createPromiseShareWrapperFn(fn) {
94
+ let promise;
95
+ return (...args)=>{
96
+ if (promise) {
97
+ return promise;
98
+ }
99
+ promise = new Promise((resolve, reject)=>{
100
+ fn(...args).then((r)=>resolve(r)).catch((e)=>reject(e));
101
+ });
102
+ promise.finally(()=>{
103
+ setTimeout(()=>{
104
+ promise = undefined;
105
+ }, 0);
106
+ });
107
+ return promise;
108
+ };
109
+ }
64
110
  function createStore(context = {}) {
65
111
  const client = new Client({
66
112
  baseURL: context.baseURL
@@ -89,38 +135,10 @@ function createStore(context = {}) {
89
135
  refreshToken.value = input;
90
136
  };
91
137
  // --------------------------------------------------------------------
92
- const handleTokenGrantResponse = (response)=>{
93
- const expireDate = new Date(Date.now() + response.expires_in * 1000);
94
- setAccessTokenExpireDate(expireDate);
95
- setAccessToken(response.access_token);
96
- setRefreshToken(response.refresh_token);
97
- };
98
- // --------------------------------------------------------------------
99
- let refreshTokenPromise;
100
- const attemptRefreshToken = ()=>{
101
- if (!refreshToken.value) {
102
- return Promise.reject(new Error('No refresh token is present.'));
103
- }
104
- if (refreshTokenPromise) {
105
- return refreshTokenPromise;
106
- }
107
- refreshTokenPromise = client.token.createWithRefreshToken({
108
- refresh_token: refreshToken.value
109
- }).then((r)=>{
110
- handleTokenGrantResponse(r);
111
- return r;
112
- }).finally(()=>{
113
- refreshTokenPromise = undefined;
114
- });
115
- return refreshTokenPromise;
116
- };
117
- // --------------------------------------------------------------------
118
138
  const user = ref(undefined);
119
139
  const userId = computed(()=>user.value ? user.value.id : undefined);
120
- const userResolved = ref(false);
121
140
  const setUser = (entity)=>{
122
141
  user.value = entity;
123
- userResolved.value = !!entity;
124
142
  };
125
143
  // --------------------------------------------------------------------
126
144
  const realm = ref(undefined);
@@ -141,68 +159,100 @@ function createStore(context = {}) {
141
159
  const setRealmManagement = (entity)=>{
142
160
  realmManagement.value = entity;
143
161
  };
144
- const abilities = new Abilities();
145
- const tokenInfo = ref(undefined);
146
- const tokenResolved = ref(false);
147
- const setTokenInfo = (entity)=>{
148
- tokenResolved.value = !!entity;
149
- tokenInfo.value = entity;
150
- if (!entity) {
151
- setRealm(undefined);
152
- setRealmManagement(undefined);
153
- abilities.set([]);
154
- return;
162
+ // --------------------------------------------------------------------
163
+ const permissionRepository = new PermissionMemoryProvider();
164
+ const permissionChecker = new PermissionChecker({
165
+ provider: permissionRepository,
166
+ policyEngine: new PolicyEngine()
167
+ });
168
+ // --------------------------------------------------------------------
169
+ const userResolved = ref(false);
170
+ const resolveUser = async ()=>{
171
+ if (!accessToken.value || userResolved.value) {
172
+ return Promise.resolve();
155
173
  }
156
- if (entity.exp) {
157
- const expireDate = new Date(entity.exp * 1000);
158
- setAccessTokenExpireDate(expireDate);
174
+ userResolved.value = true;
175
+ return client.userInfo.get(`Bearer ${accessToken.value}`).then((response)=>{
176
+ setUser(response);
177
+ });
178
+ };
179
+ // --------------------------------------------------------------------
180
+ const tokenResolved = ref(false);
181
+ const resolveToken = async ()=>{
182
+ if (!accessToken.value || tokenResolved.value) {
183
+ return Promise.resolve();
159
184
  }
160
- if (entity.realm_id && entity.realm_name) {
161
- realm.value = {
162
- id: entity.realm_id,
163
- name: entity.realm_name
164
- };
165
- if (typeof realmManagement.value === 'undefined') {
166
- setRealmManagement(realm.value);
185
+ tokenResolved.value = true;
186
+ return client.token.introspect({
187
+ token: accessToken.value
188
+ }, {
189
+ authorizationHeader: {
190
+ type: 'Bearer',
191
+ token: accessToken.value
167
192
  }
168
- }
169
- if (entity.permissions) {
170
- abilities.set(entity.permissions);
171
- }
193
+ }).then((response)=>{
194
+ if (response.exp) {
195
+ const expireDate = new Date(response.exp * 1000);
196
+ setAccessTokenExpireDate(expireDate);
197
+ }
198
+ if (response.realm_id && response.realm_name) {
199
+ realm.value = {
200
+ id: response.realm_id,
201
+ name: response.realm_name
202
+ };
203
+ if (!realmManagement.value) {
204
+ setRealmManagement(realm.value);
205
+ }
206
+ }
207
+ if (response.permissions) {
208
+ permissionRepository.setMany(response.permissions);
209
+ }
210
+ });
211
+ };
212
+ // --------------------------------------------------------------------
213
+ const handleTokenGrantResponse = (response)=>{
214
+ const expireDate = new Date(Date.now() + response.expires_in * 1000);
215
+ setAccessTokenExpireDate(expireDate);
216
+ setAccessToken(response.access_token);
217
+ setRefreshToken(response.refresh_token);
172
218
  };
173
219
  // --------------------------------------------------------------------
174
- const resolve = async (ctx = {})=>{
175
- if (!accessToken.value || ctx.attempts && ctx.attempts > 3) return;
220
+ const refreshSession = createPromiseShareWrapperFn(async ()=>{
221
+ if (!refreshToken.value) {
222
+ throw new TokenError('The access token can not be renewed.');
223
+ }
224
+ return client.token.createWithRefreshToken({
225
+ refresh_token: refreshToken.value
226
+ }).then((r)=>handleTokenGrantResponse(r)).catch((e)=>{
227
+ logout();
228
+ return Promise.reject(e);
229
+ }).finally(()=>{
230
+ tokenResolved.value = false;
231
+ userResolved.value = false;
232
+ });
233
+ });
234
+ // --------------------------------------------------------------------
235
+ const resolveInternal = async ()=>{
176
236
  try {
177
- if (!tokenResolved.value || ctx.refresh) {
178
- const token = await client.token.introspect({
179
- token: accessToken.value
180
- }, {
181
- authorizationHeader: {
182
- type: 'Bearer',
183
- token: accessToken.value
184
- }
185
- });
186
- setTokenInfo(token);
187
- tokenResolved.value = true;
237
+ if (!accessToken.value && refreshToken.value) {
238
+ await refreshSession();
188
239
  }
189
- if (!userResolved.value || ctx.refresh) {
190
- const entity = await client.userInfo.get(`Bearer ${accessToken.value}`);
191
- setUser(entity);
192
- userResolved.value = true;
240
+ if (accessToken.value) {
241
+ await resolveToken();
242
+ if (!user.value) {
243
+ await resolveUser();
244
+ }
193
245
  }
194
246
  } catch (e) {
195
- if (isClientTokenExpiredError(e)) {
196
- await attemptRefreshToken();
197
- await resolve({
198
- refresh: true,
199
- attempts: ctx.attempts ? ctx.attempts++ : 1
200
- });
201
- return;
247
+ if (isClientTokenExpiredError(e) && refreshToken.value) {
248
+ await refreshSession();
249
+ return resolveInternal();
202
250
  }
203
251
  throw e;
204
252
  }
253
+ return Promise.resolve();
205
254
  };
255
+ const resolve = createPromiseShareWrapperFn(resolveInternal);
206
256
  const loggedIn = computed(()=>!!accessToken.value);
207
257
  const login = async (ctx)=>{
208
258
  try {
@@ -216,7 +266,7 @@ function createStore(context = {}) {
216
266
  handleTokenGrantResponse(response);
217
267
  await resolve();
218
268
  } catch (e) {
219
- setUser(undefined);
269
+ logout();
220
270
  throw e;
221
271
  }
222
272
  };
@@ -225,12 +275,15 @@ function createStore(context = {}) {
225
275
  setAccessTokenExpireDate(undefined);
226
276
  setRefreshToken(undefined);
227
277
  setUser(undefined);
228
- setTokenInfo(undefined);
278
+ setRealm(undefined);
279
+ setRealmManagement(undefined);
280
+ tokenResolved.value = false;
281
+ userResolved.value = false;
229
282
  };
230
283
  return {
231
284
  initialized,
232
285
  setInitialized,
233
- abilities,
286
+ permissionChecker,
234
287
  login,
235
288
  logout,
236
289
  loggedIn,
@@ -242,8 +295,6 @@ function createStore(context = {}) {
242
295
  setAccessTokenExpireDate,
243
296
  refreshToken,
244
297
  setRefreshToken,
245
- tokenInfo,
246
- setTokenInfo,
247
298
  realm,
248
299
  realmId,
249
300
  realmIsRoot,
@@ -326,34 +377,34 @@ function shouldUpdate(dependencies, newCookies, oldCookies) {
326
377
 
327
378
  const StoreSymbol = Symbol.for('AuthupStore');
328
379
  function useStore(pinia, app) {
329
- const instance = injectStore(app);
380
+ const instance = injectStoreFactory(app);
330
381
  if (!instance) {
331
382
  throw new Error('The store has not been injected in the app context.');
332
383
  }
333
384
  return instance(pinia);
334
385
  }
335
- function injectStore(app) {
386
+ function injectStoreFactory(app) {
336
387
  const instance = inject$1(StoreSymbol, app);
337
388
  if (!instance) {
338
- throw new Error('The store has not been injected in the app context.');
389
+ throw new Error('The store factory has not been injected in the app context.');
339
390
  }
340
391
  return instance;
341
392
  }
342
- function hasStore(app) {
393
+ function hasStoreFactory(app) {
343
394
  return !!inject$1(StoreSymbol, app);
344
395
  }
345
- function provideStore(store, app) {
396
+ function provideStoreFactory(store, app) {
346
397
  provide(StoreSymbol, store, app);
347
398
  }
348
399
 
349
400
  function installStore(app, options = {}) {
350
- if (hasStore(app)) {
401
+ if (hasStoreFactory(app)) {
351
402
  return;
352
403
  }
353
- const storeCreator = defineStore(STORE_ID, ()=>createStore({
404
+ const storeFactory = defineStore(STORE_ID, ()=>createStore({
354
405
  baseURL: options.baseURL
355
406
  }));
356
- const store = storeCreator(options.pinia);
407
+ const store = storeFactory(options.pinia);
357
408
  let cookieGet;
358
409
  if (options.cookieGet) {
359
410
  cookieGet = options.cookieGet;
@@ -372,8 +423,8 @@ function installStore(app, options = {}) {
372
423
  if (options.cookieUnset) {
373
424
  cookieUnset = options.cookieUnset;
374
425
  } else if (options.cookieSet) {
375
- cookieUnset = (key)=>{
376
- options.cookieSet(key, null);
426
+ cookieUnset = (key, opts)=>{
427
+ options.cookieSet(key, null, opts);
377
428
  };
378
429
  } else {
379
430
  const cookies = useCookies();
@@ -430,12 +481,12 @@ function installStore(app, options = {}) {
430
481
  return;
431
482
  }
432
483
  if (action.name === 'logout') {
433
- cookieUnset(CookieName.ACCESS_TOKEN);
434
- cookieUnset(CookieName.ACCESS_TOKEN_EXPIRE_DATE);
435
- cookieUnset(CookieName.REFRESH_TOKEN);
436
- cookieUnset(CookieName.USER);
437
- cookieUnset(CookieName.REALM);
438
- cookieUnset(CookieName.REALM_MANAGEMENT);
484
+ cookieUnset(CookieName.ACCESS_TOKEN, {});
485
+ cookieUnset(CookieName.ACCESS_TOKEN_EXPIRE_DATE, {});
486
+ cookieUnset(CookieName.REFRESH_TOKEN, {});
487
+ cookieUnset(CookieName.USER, {});
488
+ cookieUnset(CookieName.REALM, {});
489
+ cookieUnset(CookieName.REALM_MANAGEMENT, {});
439
490
  }
440
491
  });
441
492
  initStore();
@@ -443,26 +494,34 @@ function installStore(app, options = {}) {
443
494
  if (mutation.storeId !== STORE_ID) {
444
495
  return;
445
496
  }
497
+ let maxAge;
498
+ if (state.accessTokenExpireDate) {
499
+ maxAge = Math.floor(Math.max(1000, new Date(`${state.accessTokenExpireDate}`).getTime() - Date.now()) / 1000);
500
+ }
446
501
  if (state.accessToken) {
447
- cookieSet(CookieName.ACCESS_TOKEN, state.accessToken);
502
+ cookieSet(CookieName.ACCESS_TOKEN, state.accessToken, {
503
+ maxAge
504
+ });
448
505
  }
449
506
  if (state.accessTokenExpireDate) {
450
- cookieSet(CookieName.ACCESS_TOKEN_EXPIRE_DATE, state.accessTokenExpireDate);
507
+ cookieSet(CookieName.ACCESS_TOKEN_EXPIRE_DATE, state.accessTokenExpireDate, {
508
+ maxAge
509
+ });
451
510
  }
452
511
  if (state.refreshToken) {
453
- cookieSet(CookieName.REFRESH_TOKEN, state.refreshToken);
512
+ cookieSet(CookieName.REFRESH_TOKEN, state.refreshToken, {});
454
513
  }
455
514
  if (state.user) {
456
- cookieSet(CookieName.USER, state.user);
515
+ cookieSet(CookieName.USER, state.user, {});
457
516
  }
458
517
  if (state.realm) {
459
- cookieSet(CookieName.REALM, state.realm);
518
+ cookieSet(CookieName.REALM, state.realm, {});
460
519
  }
461
520
  if (state.realmManagement) {
462
- cookieSet(CookieName.REALM_MANAGEMENT, state.realmManagement);
521
+ cookieSet(CookieName.REALM_MANAGEMENT, state.realmManagement, {});
463
522
  }
464
523
  });
465
- provideStore(storeCreator, app);
524
+ provideStoreFactory(storeFactory, app);
466
525
  }
467
526
 
468
527
  function storeToRefs(store) {
@@ -485,8 +544,8 @@ function installHTTPClient(app, options = {}) {
485
544
  const client = new Client({
486
545
  baseURL: options.baseURL
487
546
  });
488
- const storeCreator = injectStore(app);
489
- const store = storeCreator(options.pinia);
547
+ const storeFactory = injectStoreFactory(app);
548
+ const store = storeFactory(options.pinia);
490
549
  const { refreshToken } = storeToRefs$1(store);
491
550
  const tokenHook = new ClientResponseErrorTokenHook(client, {
492
551
  baseURL: options.baseURL,
@@ -503,7 +562,8 @@ function installHTTPClient(app, options = {}) {
503
562
  },
504
563
  tokenFailed: ()=>{
505
564
  store.logout();
506
- }
565
+ },
566
+ timer: !options.isServer
507
567
  });
508
568
  store.$subscribe((mutation, state)=>{
509
569
  if (mutation.storeId !== STORE_ID) return;
@@ -519,10 +579,7 @@ function installHTTPClient(app, options = {}) {
519
579
  }
520
580
  if (state.refreshToken && state.accessTokenExpireDate) {
521
581
  const expiresIn = Math.floor((state.accessTokenExpireDate.getTime() - Date.now()) / 1000);
522
- tokenHook.setTimer({
523
- refresh_token: ()=>refreshToken.value,
524
- expires_in: expiresIn
525
- });
582
+ tokenHook.setTimer(expiresIn, ()=>refreshToken.value);
526
583
  }
527
584
  });
528
585
  provideHTTPClient(client, app);
@@ -662,7 +719,7 @@ function buildListCreatedHandler(items, cb) {
662
719
  return (item, options)=>{
663
720
  options = options || {};
664
721
  let index;
665
- if (isObject(item)) {
722
+ if (isObject$1(item)) {
666
723
  index = items.value.findIndex((el)=>el.id === item.id);
667
724
  } else {
668
725
  index = -1;
@@ -681,7 +738,7 @@ function buildListCreatedHandler(items, cb) {
681
738
  }
682
739
  function buildListUpdatedHandler(items, cb) {
683
740
  return (item)=>{
684
- if (!isObject(item)) {
741
+ if (!isObject$1(item)) {
685
742
  return;
686
743
  }
687
744
  const index = items.value.findIndex((el)=>el.id === item.id);
@@ -698,7 +755,7 @@ function buildListUpdatedHandler(items, cb) {
698
755
  }
699
756
  function buildListDeletedHandler(items, cb) {
700
757
  return (item)=>{
701
- if (!isObject(item)) {
758
+ if (!isObject$1(item)) {
702
759
  return undefined;
703
760
  }
704
761
  const index = items.value.findIndex((el)=>el.id === item.id);
@@ -740,7 +797,7 @@ function injectSocketManager(app) {
740
797
  }
741
798
 
742
799
  function installSocketManager(app, options) {
743
- const storeCreator = injectStore(app);
800
+ const storeCreator = injectStoreFactory(app);
744
801
  const store = storeCreator(options.pinia);
745
802
  const { accessToken } = storeToRefs(store);
746
803
  const manager = new ClientManager({
@@ -883,7 +940,7 @@ function isQuerySortedDescByDate(input) {
883
940
  if (Array.isArray(input)) {
884
941
  return input.some((el)=>isQuerySortedDescByDate(el));
885
942
  }
886
- if (isObject(input)) {
943
+ if (isObject$1(input)) {
887
944
  return input.created_at === SortDirection.DESC || input.updated_at === SortDirection.DESC;
888
945
  }
889
946
  return typeof input === 'string' && (input === '-created_at' || input === '-updated_at');
@@ -1053,7 +1110,7 @@ function createList(context) {
1053
1110
  if (typeof context.socket !== 'boolean' || typeof context.socket === 'undefined' || context.socket) {
1054
1111
  const socketContext = {
1055
1112
  type: context.type,
1056
- ...isObject(context.socket) ? context.socket : {}
1113
+ ...isObject$1(context.socket) ? context.socket : {}
1057
1114
  };
1058
1115
  socketContext.onCreated = (entity)=>{
1059
1116
  const isSorted = query && query.sort && isQuerySortedDescByDate(query.sort) && meta.value?.pagination?.offset === 0;
@@ -1318,7 +1375,7 @@ function createEntityManager(ctx) {
1318
1375
  let socketContext = {
1319
1376
  type: ctx.type
1320
1377
  };
1321
- if (isObject(ctx.socket)) {
1378
+ if (isObject$1(ctx.socket)) {
1322
1379
  socketContext = {
1323
1380
  ...socketContext,
1324
1381
  ...ctx.socket
@@ -1476,7 +1533,7 @@ function createEntityManager(ctx) {
1476
1533
  if (!ctx.setup || !ctx.setup.slots) {
1477
1534
  return undefined;
1478
1535
  }
1479
- if (isObject(error) && hasNormalizedSlot('error', ctx.setup.slots)) {
1536
+ if (isObject$1(error) && hasNormalizedSlot('error', ctx.setup.slots)) {
1480
1537
  return normalizeSlot('error', error, ctx.setup.slots);
1481
1538
  }
1482
1539
  return undefined;
@@ -1506,26 +1563,25 @@ function createEntityManager(ctx) {
1506
1563
  * Author Peter Placzek (tada5hi)
1507
1564
  * For the full copyright and license information,
1508
1565
  * view the LICENSE file that was distributed with this source code.
1509
- */ var TranslatorTranslationGroup;
1510
- (function(TranslatorTranslationGroup) {
1566
+ */ var TranslatorTranslationGroup = /*#__PURE__*/ function(TranslatorTranslationGroup) {
1511
1567
  TranslatorTranslationGroup["DEFAULT"] = "default";
1512
1568
  TranslatorTranslationGroup["CLIENT"] = "authupClient";
1513
1569
  TranslatorTranslationGroup["VUECS"] = "vuecs";
1514
1570
  TranslatorTranslationGroup["VUELIDATE"] = "vuelidate";
1515
- })(TranslatorTranslationGroup || (TranslatorTranslationGroup = {}));
1516
- var TranslatorTranslationVuecsKey;
1517
- (function(TranslatorTranslationVuecsKey) {
1571
+ return TranslatorTranslationGroup;
1572
+ }({});
1573
+ var TranslatorTranslationVuecsKey = /*#__PURE__*/ function(TranslatorTranslationVuecsKey) {
1518
1574
  TranslatorTranslationVuecsKey["NO_MORE"] = "noMore";
1519
- })(TranslatorTranslationVuecsKey || (TranslatorTranslationVuecsKey = {}));
1520
- var TranslatorTranslationClientKey;
1521
- (function(TranslatorTranslationClientKey) {
1575
+ return TranslatorTranslationVuecsKey;
1576
+ }({});
1577
+ var TranslatorTranslationClientKey = /*#__PURE__*/ function(TranslatorTranslationClientKey) {
1522
1578
  TranslatorTranslationClientKey["NAME_HINT"] = "nameHint";
1523
1579
  TranslatorTranslationClientKey["DESCRIPTION_HINT"] = "descriptionHint";
1524
1580
  TranslatorTranslationClientKey["REDIRECT_URI_HINT"] = "redirectURIHint";
1525
1581
  TranslatorTranslationClientKey["IS_CONFIDENTIAL"] = "isConfidential";
1526
- })(TranslatorTranslationClientKey || (TranslatorTranslationClientKey = {}));
1527
- var TranslatorTranslationDefaultKey;
1528
- (function(TranslatorTranslationDefaultKey) {
1582
+ return TranslatorTranslationClientKey;
1583
+ }({});
1584
+ var TranslatorTranslationDefaultKey = /*#__PURE__*/ function(TranslatorTranslationDefaultKey) {
1529
1585
  TranslatorTranslationDefaultKey["ADD"] = "add";
1530
1586
  TranslatorTranslationDefaultKey["CREATE"] = "create";
1531
1587
  TranslatorTranslationDefaultKey["DELETE"] = "delete";
@@ -1556,40 +1612,118 @@ var TranslatorTranslationDefaultKey;
1556
1612
  TranslatorTranslationDefaultKey["SECRET"] = "secret";
1557
1613
  TranslatorTranslationDefaultKey["REDIRECT_URIS"] = "redirectUris";
1558
1614
  TranslatorTranslationDefaultKey["USERS"] = "users";
1559
- })(TranslatorTranslationDefaultKey || (TranslatorTranslationDefaultKey = {}));
1615
+ return TranslatorTranslationDefaultKey;
1616
+ }({});
1560
1617
 
1561
- function setObjectPathProperty(record, key, value) {
1562
- const parts = key.split('.');
1563
- if (parts.length === 1) {
1564
- record[key] = value;
1565
- return;
1566
- }
1567
- const prefix = parts.shift();
1568
- if (prefix) {
1569
- if (!Object.prototype.hasOwnProperty.call(record, prefix) || !isObject(record[prefix])) {
1570
- record[prefix] = {};
1618
+ /*
1619
+ * Copyright (c) 2024-2024.
1620
+ * Author Peter Placzek (tada5hi)
1621
+ * For the full copyright and license information,
1622
+ * view the LICENSE file that was distributed with this source code.
1623
+ */ const BRACKET_NUMBER_REGEX = RegExp("(?<!\\\\)\\[(\\d+)]$");
1624
+ /**
1625
+ * Convert string to property path array.
1626
+ *
1627
+ * @see https://github.com/lodash/lodash/blob/main/src/.internal/stringToPath.ts
1628
+ * @see https://github.com/chaijs/pathval
1629
+ *
1630
+ * @param segment
1631
+ */ function pathToArray(segment) {
1632
+ const str = segment.replace(/([^\\])\[/g, '$1.[');
1633
+ const parts = str.match(/(\\\.|[^.]+?)+/g);
1634
+ if (!parts) {
1635
+ return [];
1636
+ }
1637
+ const result = [];
1638
+ for(let i = 0; i < parts.length; i++){
1639
+ if (parts[i] === 'constructor' || parts[i] === '__proto__' || parts[i] === 'prototype') {
1640
+ continue;
1641
+ }
1642
+ const regex = BRACKET_NUMBER_REGEX.exec(parts[i]);
1643
+ if (regex) {
1644
+ result.push(regex[1]);
1645
+ } else {
1646
+ result.push(parts[i].replace(/\\([.[\]])/g, '$1'));
1571
1647
  }
1572
- setObjectPathProperty(record[prefix], parts.join('.'), value);
1573
1648
  }
1649
+ return result;
1650
+ }
1651
+ /*
1652
+ * Copyright (c) 2024.
1653
+ * Author Peter Placzek (tada5hi)
1654
+ * For the full copyright and license information,
1655
+ * view the LICENSE file that was distributed with this source code.
1656
+ */ var Character;
1657
+ (function(Character) {
1658
+ Character["WILDCARD"] = "*";
1659
+ Character["GLOBSTAR"] = "**";
1660
+ })(Character || (Character = {}));
1661
+ /*
1662
+ * Copyright (c) 2024.
1663
+ * Author Peter Placzek (tada5hi)
1664
+ * For the full copyright and license information,
1665
+ * view the LICENSE file that was distributed with this source code.
1666
+ */ function isObject(input) {
1667
+ return !!input && typeof input === 'object' && !Array.isArray(input);
1574
1668
  }
1575
- function getObjectPathProperty(data, key) {
1576
- const dotIndex = key.indexOf('.');
1577
- const currentKey = dotIndex === -1 ? key : key.substring(0, dotIndex);
1578
- if (dotIndex === -1) {
1579
- return data[currentKey];
1669
+ function getPathValue(data, path) {
1670
+ const parts = Array.isArray(path) ? path : pathToArray(path);
1671
+ let res;
1672
+ let temp = data;
1673
+ let index = 0;
1674
+ while(index < parts.length){
1675
+ if (temp === null || typeof temp === 'undefined') {
1676
+ break;
1677
+ }
1678
+ if (parts[index] in Object(temp)) {
1679
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1680
+ // @ts-expect-error
1681
+ temp = temp[parts[index]];
1682
+ } else {
1683
+ break;
1684
+ }
1685
+ if (index === parts.length - 1) {
1686
+ res = temp;
1687
+ }
1688
+ index++;
1580
1689
  }
1581
- if (!isObject(data[currentKey])) {
1582
- return undefined;
1690
+ return res;
1691
+ }
1692
+ const NUMBER_REGEX = /^\d+$/;
1693
+ function setPathValue(data, path, value) {
1694
+ const parts = Array.isArray(path) ? path : pathToArray(path);
1695
+ let temp = data;
1696
+ let index = 0;
1697
+ while(index < parts.length){
1698
+ /* istanbul ignore next */ if (!Array.isArray(temp) && !isObject(temp)) {
1699
+ break;
1700
+ }
1701
+ const key = parts[index];
1702
+ // [foo, '0']
1703
+ if (typeof temp[key] === 'undefined') {
1704
+ const match = NUMBER_REGEX.test(key);
1705
+ if (match) {
1706
+ temp[key] = [];
1707
+ } else {
1708
+ temp[key] = {};
1709
+ }
1710
+ }
1711
+ if (index === parts.length - 1) {
1712
+ temp[key] = value;
1713
+ break;
1714
+ }
1715
+ index++;
1716
+ temp = temp[key];
1583
1717
  }
1584
- const nextKey = key.substring(currentKey.length + 1);
1585
- return getObjectPathProperty(data[currentKey], nextKey);
1718
+ return data;
1586
1719
  }
1720
+
1587
1721
  class MemoryStore {
1588
1722
  async get(context) {
1589
1723
  if (!this.data[context.locale] || !this.data[context.locale][context.group]) {
1590
1724
  return undefined;
1591
1725
  }
1592
- const output = getObjectPathProperty(this.data[context.locale][context.group], context.key);
1726
+ const output = getPathValue(this.data[context.locale][context.group], context.key);
1593
1727
  if (typeof output === 'string') {
1594
1728
  return output;
1595
1729
  }
@@ -1597,7 +1731,7 @@ class MemoryStore {
1597
1731
  }
1598
1732
  async set(context) {
1599
1733
  this.initLines(context.group, context.locale);
1600
- setObjectPathProperty(this.data[context.locale][context.group], context.key, context.value);
1734
+ setPathValue(this.data[context.locale][context.group], context.key, context.value);
1601
1735
  }
1602
1736
  initLines(group, locale) {
1603
1737
  if (typeof this.data[locale] === 'undefined') {
@@ -1805,11 +1939,11 @@ const TranslatorTranslationDefaultGerman = {
1805
1939
  [TranslatorTranslationDefaultKey.USERS]: 'Benutzer'
1806
1940
  };
1807
1941
 
1808
- var VuelidateCustomRuleKey;
1809
- (function(VuelidateCustomRuleKey) {
1942
+ var VuelidateCustomRuleKey = /*#__PURE__*/ function(VuelidateCustomRuleKey) {
1810
1943
  VuelidateCustomRuleKey["ALPHA_NUM_HYPHEN_UNDERSCORE"] = "alphaNumHyphenUnderscore";
1811
1944
  VuelidateCustomRuleKey["ALPHA_UPPER_NUM_HYPHEN_UNDERSCORE"] = "alphaUpperNumHyphenUnderscore";
1812
- })(VuelidateCustomRuleKey || (VuelidateCustomRuleKey = {}));
1945
+ return VuelidateCustomRuleKey;
1946
+ }({});
1813
1947
  const VuelidateCustomRule = {
1814
1948
  ["alphaNumHyphenUnderscore"]: helpers.regex(/^[a-z0-9-_]*$/),
1815
1949
  ["alphaUpperNumHyphenUnderscore"]: helpers.regex(/^[a-zA-Z0-9-_]*$/)
@@ -1949,6 +2083,65 @@ function buildFormSubmitWithTranslations(options, translations) {
1949
2083
  };
1950
2084
  }
1951
2085
 
2086
+ function createPermissionCheckerReactiveFn(ctx = {}) {
2087
+ let store;
2088
+ if (ctx.store) {
2089
+ store = ctx.store;
2090
+ } else {
2091
+ store = useStore(ctx.pinia, ctx.app);
2092
+ }
2093
+ const storeRefs = storeToRefs(store);
2094
+ return (ctx)=>{
2095
+ const data = ref(false);
2096
+ let computePromise;
2097
+ const compute = async ()=>{
2098
+ if (computePromise) {
2099
+ return computePromise;
2100
+ }
2101
+ let identity;
2102
+ if (storeRefs.userId.value) {
2103
+ identity = {
2104
+ type: 'user',
2105
+ id: storeRefs.userId.value
2106
+ };
2107
+ }
2108
+ let outcome;
2109
+ try {
2110
+ computePromise = store.permissionChecker.preCheckOneOf({
2111
+ ...ctx,
2112
+ data: {
2113
+ ...ctx.data || {},
2114
+ identity
2115
+ }
2116
+ }).then(()=>true).catch(()=>false);
2117
+ outcome = await computePromise;
2118
+ } catch (e) {
2119
+ outcome = false;
2120
+ } finally{
2121
+ computePromise = undefined;
2122
+ }
2123
+ return outcome;
2124
+ };
2125
+ Promise.resolve().then(()=>compute()).then((outcome)=>{
2126
+ data.value = outcome;
2127
+ });
2128
+ let removeListener;
2129
+ onMounted(()=>{
2130
+ removeListener = watch(storeRefs.loggedIn, ()=>{
2131
+ Promise.resolve().then(()=>compute()).then((outcome)=>{
2132
+ data.value = outcome;
2133
+ });
2134
+ });
2135
+ });
2136
+ onUnmounted(()=>{
2137
+ if (typeof removeListener !== 'undefined') {
2138
+ removeListener();
2139
+ }
2140
+ });
2141
+ return data;
2142
+ };
2143
+ }
2144
+
1952
2145
  const AClient = defineComponent({
1953
2146
  props: defineEntityManagerProps(),
1954
2147
  emits: defineEntityManagerEvents(),
@@ -1996,22 +2189,9 @@ function useUpdatedAt(input) {
1996
2189
  });
1997
2190
  }
1998
2191
 
1999
- function useAbilityCheck(name) {
2000
- const { abilities } = useStore();
2001
- const data = ref(false);
2002
- data.value = abilities.has(name);
2003
- let removeListener;
2004
- onMounted(()=>{
2005
- removeListener = abilities.on('updated', ()=>{
2006
- data.value = abilities.has(name);
2007
- });
2008
- });
2009
- onUnmounted(()=>{
2010
- if (typeof removeListener !== 'undefined') {
2011
- removeListener();
2012
- }
2013
- });
2014
- return data;
2192
+ function usePermissionCheck(ctx) {
2193
+ const checkFn = createPermissionCheckerReactiveFn();
2194
+ return checkFn(ctx);
2015
2195
  }
2016
2196
 
2017
2197
  function useRealmResourceWritableCheck(realmId) {
@@ -2055,6 +2235,7 @@ const ARealmForm = defineComponent({
2055
2235
  const busy = ref(false);
2056
2236
  const form = reactive({
2057
2237
  name: '',
2238
+ display_name: '',
2058
2239
  description: ''
2059
2240
  });
2060
2241
  const $v = useVuelidate({
@@ -2063,6 +2244,10 @@ const ARealmForm = defineComponent({
2063
2244
  minLength: minLength(3),
2064
2245
  maxLength: maxLength(128)
2065
2246
  },
2247
+ display_name: {
2248
+ minLength: minLength(3),
2249
+ maxLength: maxLength(256)
2250
+ },
2066
2251
  description: {
2067
2252
  minLength: minLength(5),
2068
2253
  maxLength: maxLength(4096)
@@ -2107,12 +2292,16 @@ const ARealmForm = defineComponent({
2107
2292
  {
2108
2293
  key: TranslatorTranslationDefaultKey.NAME
2109
2294
  },
2295
+ {
2296
+ key: TranslatorTranslationDefaultKey.DISPLAY_NAME
2297
+ },
2110
2298
  {
2111
2299
  key: TranslatorTranslationDefaultKey.DESCRIPTION
2112
2300
  }
2113
2301
  ]);
2114
2302
  const render = ()=>{
2115
- const id = buildFormGroup({
2303
+ const children = [];
2304
+ children.push(buildFormGroup({
2116
2305
  validationMessages: translationsValidation.name.value,
2117
2306
  validationSeverity: getVuelidateSeverity($v.value.name),
2118
2307
  label: true,
@@ -2126,10 +2315,9 @@ const ARealmForm = defineComponent({
2126
2315
  disabled: manager.data.value && manager.data.value.name === REALM_MASTER_NAME
2127
2316
  }
2128
2317
  })
2129
- });
2130
- let idHint = [];
2318
+ }));
2131
2319
  if (!manager.data.value || !manager.data.value.id) {
2132
- idHint = [
2320
+ children.push([
2133
2321
  h('div', {
2134
2322
  class: 'mb-3'
2135
2323
  }, [
@@ -2153,9 +2341,21 @@ const ARealmForm = defineComponent({
2153
2341
  translationsDefault[TranslatorTranslationDefaultKey.GENERATE].value
2154
2342
  ])
2155
2343
  ])
2156
- ];
2344
+ ]);
2157
2345
  }
2158
- const description = buildFormGroup({
2346
+ children.push(buildFormGroup({
2347
+ validationMessages: translationsValidation.display_name.value,
2348
+ validationSeverity: getVuelidateSeverity($v.value.display_name),
2349
+ label: true,
2350
+ labelContent: translationsDefault[TranslatorTranslationDefaultKey.DISPLAY_NAME].value,
2351
+ content: buildFormInput({
2352
+ value: $v.value.display_name.$model,
2353
+ onChange (input) {
2354
+ $v.value.display_name.$model = input;
2355
+ }
2356
+ })
2357
+ }));
2358
+ children.push(buildFormGroup({
2159
2359
  validationMessages: translationsValidation.description.value,
2160
2360
  validationSeverity: getVuelidateSeverity($v.value.description),
2161
2361
  label: true,
@@ -2169,26 +2369,19 @@ const ARealmForm = defineComponent({
2169
2369
  rows: 4
2170
2370
  }
2171
2371
  })
2172
- });
2173
- const submitButton = buildFormSubmitWithTranslations({
2372
+ }));
2373
+ children.push(buildFormSubmitWithTranslations({
2174
2374
  submit,
2175
2375
  busy: busy.value,
2176
2376
  isEditing: isEditing.value,
2177
2377
  invalid: $v.value.$invalid
2178
- }, translationsSubmit);
2378
+ }, translationsSubmit));
2179
2379
  return h('form', {
2180
2380
  onSubmit ($event) {
2181
2381
  $event.preventDefault();
2182
2382
  return submit.apply(null);
2183
2383
  }
2184
- }, [
2185
- id,
2186
- idHint,
2187
- h('hr'),
2188
- description,
2189
- h('hr'),
2190
- submitButton
2191
- ]);
2384
+ }, children);
2192
2385
  };
2193
2386
  return ()=>render();
2194
2387
  }
@@ -2369,6 +2562,7 @@ const AClientForm = defineComponent({
2369
2562
  const busy = ref(false);
2370
2563
  const form = reactive({
2371
2564
  name: '',
2565
+ display_name: '',
2372
2566
  description: '',
2373
2567
  realm_id: '',
2374
2568
  redirect_uri: '',
@@ -2384,6 +2578,10 @@ const AClientForm = defineComponent({
2384
2578
  minLength: minLength(3),
2385
2579
  maxLength: maxLength(256)
2386
2580
  },
2581
+ display_name: {
2582
+ minLength: minLength(3),
2583
+ maxLength: maxLength(256)
2584
+ },
2387
2585
  description: {
2388
2586
  minLength: minLength(3),
2389
2587
  maxLength: maxLength(256)
@@ -2461,6 +2659,9 @@ const AClientForm = defineComponent({
2461
2659
  {
2462
2660
  key: TranslatorTranslationDefaultKey.NAME
2463
2661
  },
2662
+ {
2663
+ key: TranslatorTranslationDefaultKey.DISPLAY_NAME
2664
+ },
2464
2665
  {
2465
2666
  key: TranslatorTranslationDefaultKey.DESCRIPTION
2466
2667
  },
@@ -2493,37 +2694,53 @@ const AClientForm = defineComponent({
2493
2694
  }),
2494
2695
  h('small', translationsClient[TranslatorTranslationClientKey.NAME_HINT].value)
2495
2696
  ];
2697
+ const displayName = buildFormGroup({
2698
+ validationMessages: translationsValidation.display_name.value,
2699
+ validationSeverity: getVuelidateSeverity($v.value.display_name),
2700
+ label: true,
2701
+ labelContent: translationsDefault[TranslatorTranslationDefaultKey.DISPLAY_NAME].value,
2702
+ content: buildFormInput({
2703
+ value: $v.value.display_name.$model,
2704
+ onChange (input) {
2705
+ $v.value.display_name.$model = input;
2706
+ }
2707
+ })
2708
+ });
2496
2709
  const description = [
2497
- buildFormGroup({
2498
- validationMessages: translationsValidation.description.value,
2499
- validationSeverity: getVuelidateSeverity($v.value.description),
2500
- label: true,
2501
- labelContent: translationsDefault[TranslatorTranslationDefaultKey.DESCRIPTION].value,
2502
- content: buildFormTextarea({
2503
- value: $v.value.description.$model,
2504
- onChange (input) {
2505
- $v.value.description.$model = input;
2506
- },
2507
- props: {
2508
- rows: 7
2509
- }
2510
- })
2511
- }),
2512
- h('small', translationsClient[TranslatorTranslationClientKey.DESCRIPTION_HINT].value)
2710
+ h('div', [
2711
+ buildFormGroup({
2712
+ validationMessages: translationsValidation.description.value,
2713
+ validationSeverity: getVuelidateSeverity($v.value.description),
2714
+ label: true,
2715
+ labelContent: translationsDefault[TranslatorTranslationDefaultKey.DESCRIPTION].value,
2716
+ content: buildFormTextarea({
2717
+ value: $v.value.description.$model,
2718
+ onChange (input) {
2719
+ $v.value.description.$model = input;
2720
+ },
2721
+ props: {
2722
+ rows: 7
2723
+ }
2724
+ })
2725
+ }),
2726
+ h('small', translationsClient[TranslatorTranslationClientKey.DESCRIPTION_HINT].value)
2727
+ ])
2513
2728
  ];
2514
2729
  const redirectUri = [
2515
- h('label', {
2516
- class: 'form-label'
2517
- }, [
2518
- translationsDefault[TranslatorTranslationDefaultKey.REDIRECT_URIS].value
2519
- ]),
2520
- h(AClientRedirectUris, {
2521
- uri: form.redirect_uri,
2522
- onUpdated: (value)=>{
2523
- form.redirect_uri = value;
2524
- }
2525
- }),
2526
- h('small', translationsClient[TranslatorTranslationClientKey.REDIRECT_URI_HINT].value)
2730
+ h('div', [
2731
+ h('label', {
2732
+ class: 'form-label'
2733
+ }, [
2734
+ translationsDefault[TranslatorTranslationDefaultKey.REDIRECT_URIS].value
2735
+ ]),
2736
+ h(AClientRedirectUris, {
2737
+ uri: form.redirect_uri,
2738
+ onUpdated: (value)=>{
2739
+ form.redirect_uri = value;
2740
+ }
2741
+ }),
2742
+ h('small', translationsClient[TranslatorTranslationClientKey.REDIRECT_URI_HINT].value)
2743
+ ])
2527
2744
  ];
2528
2745
  const isConfidential = buildFormGroup({
2529
2746
  validationMessages: translationsValidation.is_confidential.value,
@@ -2549,7 +2766,8 @@ const AClientForm = defineComponent({
2549
2766
  disabled: true
2550
2767
  }
2551
2768
  })
2552
- })
2769
+ }),
2770
+ h('hr')
2553
2771
  ];
2554
2772
  }
2555
2773
  const secret = [
@@ -2616,9 +2834,10 @@ const AClientForm = defineComponent({
2616
2834
  class: 'col'
2617
2835
  }, [
2618
2836
  id,
2619
- h('hr'),
2620
2837
  name,
2621
2838
  h('hr'),
2839
+ displayName,
2840
+ h('hr'),
2622
2841
  secret,
2623
2842
  realm
2624
2843
  ]);
@@ -2626,11 +2845,11 @@ const AClientForm = defineComponent({
2626
2845
  h('div', {
2627
2846
  class: 'col'
2628
2847
  }, [
2629
- description,
2848
+ isConfidential,
2630
2849
  h('hr'),
2631
2850
  redirectUri,
2632
2851
  h('hr'),
2633
- isConfidential,
2852
+ description,
2634
2853
  submitForm
2635
2854
  ])
2636
2855
  ];
@@ -2763,6 +2982,7 @@ const AScopeForm = defineComponent({
2763
2982
  const busy = ref(false);
2764
2983
  const form = reactive({
2765
2984
  name: '',
2985
+ display_name: '',
2766
2986
  description: '',
2767
2987
  realm_id: ''
2768
2988
  });
@@ -2773,6 +2993,10 @@ const AScopeForm = defineComponent({
2773
2993
  minLength: minLength(3),
2774
2994
  maxLength: maxLength(256)
2775
2995
  },
2996
+ display_name: {
2997
+ minLength: minLength(3),
2998
+ maxLength: maxLength(256)
2999
+ },
2776
3000
  description: {
2777
3001
  minLength: minLength(3),
2778
3002
  maxLength: maxLength(4096)
@@ -2825,6 +3049,9 @@ const AScopeForm = defineComponent({
2825
3049
  {
2826
3050
  key: TranslatorTranslationDefaultKey.NAME
2827
3051
  },
3052
+ {
3053
+ key: TranslatorTranslationDefaultKey.DISPLAY_NAME
3054
+ },
2828
3055
  {
2829
3056
  key: TranslatorTranslationDefaultKey.DESCRIPTION
2830
3057
  },
@@ -2849,6 +3076,18 @@ const AScopeForm = defineComponent({
2849
3076
  }
2850
3077
  })
2851
3078
  }),
3079
+ buildFormGroup({
3080
+ validationMessages: translationsValidation.display_name.value,
3081
+ validationSeverity: getVuelidateSeverity($v.value.display_name),
3082
+ label: true,
3083
+ labelContent: translationsDefault[TranslatorTranslationDefaultKey.DISPLAY_NAME].value,
3084
+ content: buildFormInput({
3085
+ value: $v.value.display_name.$model,
3086
+ onChange (input) {
3087
+ $v.value.display_name.$model = input;
3088
+ }
3089
+ })
3090
+ }),
2852
3091
  buildFormGroup({
2853
3092
  validationMessages: translationsValidation.description.value,
2854
3093
  validationSeverity: getVuelidateSeverity($v.value.description),
@@ -3018,6 +3257,7 @@ const AIdentityProviderBasicFields = defineComponent({
3018
3257
  setup (props, setup) {
3019
3258
  const form = reactive({
3020
3259
  name: '',
3260
+ display_name: '',
3021
3261
  slug: '',
3022
3262
  enabled: true
3023
3263
  });
@@ -3027,6 +3267,10 @@ const AIdentityProviderBasicFields = defineComponent({
3027
3267
  minLength: minLength(5),
3028
3268
  maxLength: maxLength(128)
3029
3269
  },
3270
+ display_name: {
3271
+ minLength: minLength(3),
3272
+ maxLength: maxLength(256)
3273
+ },
3030
3274
  slug: {
3031
3275
  required,
3032
3276
  [VuelidateCustomRuleKey.ALPHA_NUM_HYPHEN_UNDERSCORE]: VuelidateCustomRule[VuelidateCustomRuleKey.ALPHA_NUM_HYPHEN_UNDERSCORE],
@@ -3054,7 +3298,7 @@ const AIdentityProviderBasicFields = defineComponent({
3054
3298
  valid: !$v.value.$invalid
3055
3299
  });
3056
3300
  };
3057
- function assign(data) {
3301
+ function assign(data = {}) {
3058
3302
  extendObjectProperties(form, data);
3059
3303
  if (isSlugEmpty.value) {
3060
3304
  generateId();
@@ -3066,13 +3310,24 @@ const AIdentityProviderBasicFields = defineComponent({
3066
3310
  const updatedAt = useUpdatedAt(props.entity);
3067
3311
  onChange(updatedAt, ()=>assign(props.entity));
3068
3312
  assign(props.entity);
3069
- const validationMessages = useTranslationsForNestedValidation($v.value);
3313
+ const translationsDefault = useTranslationsForGroup(TranslatorTranslationGroup.DEFAULT, [
3314
+ {
3315
+ key: TranslatorTranslationDefaultKey.DISPLAY_NAME
3316
+ },
3317
+ {
3318
+ key: TranslatorTranslationDefaultKey.NAME
3319
+ },
3320
+ {
3321
+ key: TranslatorTranslationDefaultKey.DESCRIPTION
3322
+ }
3323
+ ]);
3324
+ const translationsValidation = useTranslationsForNestedValidation($v.value);
3070
3325
  return ()=>{
3071
3326
  const name = buildFormGroup({
3072
- validationMessages: validationMessages.name.value,
3327
+ validationMessages: translationsValidation.name.value,
3073
3328
  validationSeverity: getVuelidateSeverity($v.value.name),
3074
3329
  label: true,
3075
- labelContent: 'Name',
3330
+ labelContent: translationsDefault[TranslatorTranslationDefaultKey.NAME].value,
3076
3331
  content: buildFormInput({
3077
3332
  value: $v.value.name.$model,
3078
3333
  onChange (input) {
@@ -3080,8 +3335,20 @@ const AIdentityProviderBasicFields = defineComponent({
3080
3335
  }
3081
3336
  })
3082
3337
  });
3338
+ const displayName = buildFormGroup({
3339
+ validationMessages: translationsValidation.display_name.value,
3340
+ validationSeverity: getVuelidateSeverity($v.value.display_name),
3341
+ label: true,
3342
+ labelContent: translationsDefault[TranslatorTranslationDefaultKey.DISPLAY_NAME].value,
3343
+ content: buildFormInput({
3344
+ value: $v.value.display_name.$model,
3345
+ onChange (input) {
3346
+ $v.value.display_name.$model = input;
3347
+ }
3348
+ })
3349
+ });
3083
3350
  const slug = buildFormGroup({
3084
- validationMessages: validationMessages.slug.value,
3351
+ validationMessages: translationsValidation.slug.value,
3085
3352
  validationSeverity: getVuelidateSeverity($v.value.slug),
3086
3353
  label: true,
3087
3354
  labelContent: 'Slug',
@@ -3122,6 +3389,7 @@ const AIdentityProviderBasicFields = defineComponent({
3122
3389
  });
3123
3390
  return [
3124
3391
  name,
3392
+ displayName,
3125
3393
  slug,
3126
3394
  slugGenerator,
3127
3395
  enabled
@@ -4824,6 +5092,7 @@ const ARoleForm = defineComponent({
4824
5092
  const busy = ref(false);
4825
5093
  const form = reactive({
4826
5094
  name: '',
5095
+ display_name: '',
4827
5096
  description: '',
4828
5097
  realm_id: ''
4829
5098
  });
@@ -4833,6 +5102,10 @@ const ARoleForm = defineComponent({
4833
5102
  minLength: minLength(3),
4834
5103
  maxLength: maxLength(30)
4835
5104
  },
5105
+ display_name: {
5106
+ minLength: minLength(3),
5107
+ maxLength: maxLength(256)
5108
+ },
4836
5109
  description: {
4837
5110
  minLength: minLength(5),
4838
5111
  maxLength: maxLength(4096)
@@ -4876,6 +5149,9 @@ const ARoleForm = defineComponent({
4876
5149
  {
4877
5150
  key: TranslatorTranslationDefaultKey.NAME
4878
5151
  },
5152
+ {
5153
+ key: TranslatorTranslationDefaultKey.DISPLAY_NAME
5154
+ },
4879
5155
  {
4880
5156
  key: TranslatorTranslationDefaultKey.DESCRIPTION
4881
5157
  }
@@ -4894,6 +5170,18 @@ const ARoleForm = defineComponent({
4894
5170
  }
4895
5171
  })
4896
5172
  }));
5173
+ children.push(buildFormGroup({
5174
+ validationMessages: translationsValidation.display_name.value,
5175
+ validationSeverity: getVuelidateSeverity($v.value.display_name),
5176
+ label: true,
5177
+ labelContent: translationsDefault[TranslatorTranslationDefaultKey.DISPLAY_NAME].value,
5178
+ content: buildFormInput({
5179
+ value: $v.value.display_name.$model,
5180
+ onChange (input) {
5181
+ $v.value.display_name.$model = input;
5182
+ }
5183
+ })
5184
+ }));
4897
5185
  children.push(buildFormGroup({
4898
5186
  validationMessages: translationsValidation.description.value,
4899
5187
  validationSeverity: getVuelidateSeverity($v.value.description),
@@ -5017,6 +5305,38 @@ const APermission = defineComponent({
5017
5305
  }
5018
5306
  });
5019
5307
 
5308
+ const APermissionCheck = defineComponent({
5309
+ props: {
5310
+ name: {
5311
+ type: [
5312
+ String,
5313
+ Array
5314
+ ],
5315
+ required: true
5316
+ },
5317
+ data: {
5318
+ type: Object
5319
+ },
5320
+ options: {
5321
+ type: Object
5322
+ }
5323
+ },
5324
+ setup (props, { slots }) {
5325
+ const fn = createPermissionCheckerReactiveFn();
5326
+ const isPermitted = computed(()=>fn({
5327
+ name: props.name,
5328
+ data: props.data,
5329
+ options: props.options
5330
+ }));
5331
+ return ()=>{
5332
+ if (isPermitted.value && hasNormalizedSlot(SlotName.DEFAULT, slots)) {
5333
+ return normalizeSlot(SlotName.DEFAULT, {}, slots);
5334
+ }
5335
+ return [];
5336
+ };
5337
+ }
5338
+ });
5339
+
5020
5340
  const APermissionForm = defineComponent({
5021
5341
  props: {
5022
5342
  entity: {
@@ -5028,6 +5348,7 @@ const APermissionForm = defineComponent({
5028
5348
  const busy = ref(false);
5029
5349
  const form = reactive({
5030
5350
  name: '',
5351
+ display_name: '',
5031
5352
  description: '',
5032
5353
  realm_id: ''
5033
5354
  });
@@ -5037,6 +5358,10 @@ const APermissionForm = defineComponent({
5037
5358
  minLength: minLength(3),
5038
5359
  maxLength: maxLength(128)
5039
5360
  },
5361
+ display_name: {
5362
+ minLength: minLength(3),
5363
+ maxLength: maxLength(256)
5364
+ },
5040
5365
  description: {
5041
5366
  minLength: minLength(5),
5042
5367
  maxLength: maxLength(4096)
@@ -5080,6 +5405,9 @@ const APermissionForm = defineComponent({
5080
5405
  {
5081
5406
  key: TranslatorTranslationDefaultKey.NAME
5082
5407
  },
5408
+ {
5409
+ key: TranslatorTranslationDefaultKey.DISPLAY_NAME
5410
+ },
5083
5411
  {
5084
5412
  key: TranslatorTranslationDefaultKey.DESCRIPTION
5085
5413
  }
@@ -5101,6 +5429,18 @@ const APermissionForm = defineComponent({
5101
5429
  }
5102
5430
  })
5103
5431
  }));
5432
+ children.push(buildFormGroup({
5433
+ validationMessages: translationsValidation.display_name.value,
5434
+ validationSeverity: getVuelidateSeverity($v.value.display_name),
5435
+ label: true,
5436
+ labelContent: translationsDefault[TranslatorTranslationDefaultKey.DISPLAY_NAME].value,
5437
+ content: buildFormInput({
5438
+ value: $v.value.display_name.$model,
5439
+ onChange (input) {
5440
+ $v.value.display_name.$model = input;
5441
+ }
5442
+ })
5443
+ }));
5104
5444
  children.push(buildFormGroup({
5105
5445
  validationMessages: translationsValidation.description.value,
5106
5446
  validationSeverity: getVuelidateSeverity($v.value.description),
@@ -5240,6 +5580,7 @@ const ARobotForm = defineComponent({
5240
5580
  const busy = ref(false);
5241
5581
  const form = reactive({
5242
5582
  name: '',
5583
+ display_name: '',
5243
5584
  realm_id: '',
5244
5585
  secret: ''
5245
5586
  });
@@ -5249,6 +5590,10 @@ const ARobotForm = defineComponent({
5249
5590
  minLength: minLength(3),
5250
5591
  maxLength: maxLength(128)
5251
5592
  },
5593
+ display_name: {
5594
+ minLength: minLength(3),
5595
+ maxLength: maxLength(256)
5596
+ },
5252
5597
  realm_id: {
5253
5598
  required
5254
5599
  },
@@ -5268,7 +5613,7 @@ const ARobotForm = defineComponent({
5268
5613
  const isRealmLocked = computed(()=>!!props.realmId);
5269
5614
  const isSecretHashed = computed(()=>manager.data.value && manager.data.value.secret === form.secret && form.secret.startsWith('$'));
5270
5615
  const generateSecret = ()=>{
5271
- form.secret = createNanoID('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_!.', 64);
5616
+ form.secret = createNanoID(64);
5272
5617
  };
5273
5618
  function initForm() {
5274
5619
  if (props.name) {
@@ -5310,6 +5655,9 @@ const ARobotForm = defineComponent({
5310
5655
  {
5311
5656
  key: TranslatorTranslationDefaultKey.NAME
5312
5657
  },
5658
+ {
5659
+ key: TranslatorTranslationDefaultKey.DISPLAY_NAME
5660
+ },
5313
5661
  {
5314
5662
  key: TranslatorTranslationDefaultKey.DESCRIPTION
5315
5663
  },
@@ -5333,6 +5681,18 @@ const ARobotForm = defineComponent({
5333
5681
  }
5334
5682
  })
5335
5683
  });
5684
+ const displayName = buildFormGroup({
5685
+ validationMessages: translationsValidation.display_name.value,
5686
+ validationSeverity: getVuelidateSeverity($v.value.display_name),
5687
+ label: true,
5688
+ labelContent: translationsDefault[TranslatorTranslationDefaultKey.DISPLAY_NAME].value,
5689
+ content: buildFormInput({
5690
+ value: $v.value.display_name.$model,
5691
+ onChange (input) {
5692
+ $v.value.display_name.$model = input;
5693
+ }
5694
+ })
5695
+ });
5336
5696
  let id = [];
5337
5697
  if (manager.data.value) {
5338
5698
  id = [
@@ -5397,6 +5757,7 @@ const ARobotForm = defineComponent({
5397
5757
  }, [
5398
5758
  id,
5399
5759
  name,
5760
+ displayName,
5400
5761
  secret,
5401
5762
  secretInfo,
5402
5763
  h('hr'),
@@ -5656,7 +6017,6 @@ const AUserForm = defineComponent({
5656
6017
  emits: defineEntityManagerEvents(),
5657
6018
  async setup (props, ctx) {
5658
6019
  const busy = ref(false);
5659
- const displayNameChanged = ref(false);
5660
6020
  const form = reactive({
5661
6021
  active: true,
5662
6022
  name: '',
@@ -5674,9 +6034,8 @@ const AUserForm = defineComponent({
5674
6034
  },
5675
6035
  name_locked: {},
5676
6036
  display_name: {
5677
- required,
5678
6037
  minLength: minLength(3),
5679
- maxLength: maxLength(128)
6038
+ maxLength: maxLength(256)
5680
6039
  },
5681
6040
  email: {
5682
6041
  minLength: minLength(5),
@@ -5717,14 +6076,6 @@ const AUserForm = defineComponent({
5717
6076
  }
5718
6077
  await manager.createOrUpdate(form);
5719
6078
  };
5720
- const updateDisplayName = (value)=>{
5721
- if (!displayNameChanged.value) {
5722
- form.display_name = value;
5723
- }
5724
- };
5725
- const handleDisplayNameChanged = (value)=>{
5726
- displayNameChanged.value = value.length !== 0;
5727
- };
5728
6079
  const translationsValidation = useTranslationsForNestedValidation($v.value);
5729
6080
  const translationsSubmit = createFormSubmitTranslations();
5730
6081
  const translationsDefault = useTranslationsForGroup(TranslatorTranslationGroup.DEFAULT, [
@@ -5763,7 +6114,6 @@ const AUserForm = defineComponent({
5763
6114
  value: $v.value.name.$model,
5764
6115
  onChange (input) {
5765
6116
  $v.value.name.$model = input;
5766
- updateDisplayName.call(null, input);
5767
6117
  },
5768
6118
  props: {
5769
6119
  disabled: form.name_locked
@@ -5779,7 +6129,6 @@ const AUserForm = defineComponent({
5779
6129
  value: $v.value.display_name.$model,
5780
6130
  onChange (input) {
5781
6131
  $v.value.display_name.$model = input;
5782
- handleDisplayNameChanged.call(null, input);
5783
6132
  }
5784
6133
  })
5785
6134
  });
@@ -6290,11 +6639,11 @@ const APagination = defineComponent({
6290
6639
  * Author Peter Placzek (tada5hi)
6291
6640
  * For the full copyright and license information,
6292
6641
  * view the LICENSE file that was distributed with this source code.
6293
- */ var TitleSlotName;
6294
- (function(TitleSlotName) {
6642
+ */ var TitleSlotName = /*#__PURE__*/ function(TitleSlotName) {
6295
6643
  TitleSlotName["DEFAULT"] = "default";
6296
6644
  TitleSlotName["ICON"] = "icon";
6297
- })(TitleSlotName || (TitleSlotName = {}));
6645
+ return TitleSlotName;
6646
+ }({});
6298
6647
 
6299
6648
  function buildTitle(ctx) {
6300
6649
  ctx.tag = ctx.tag || 'h6';
@@ -6380,11 +6729,11 @@ const ATitle = defineComponent({
6380
6729
  * Author Peter Placzek (tada5hi)
6381
6730
  * For the full copyright and license information,
6382
6731
  * view the LICENSE file that was distributed with this source code.
6383
- */ var ListSearchSlotName;
6384
- (function(ListSearchSlotName) {
6732
+ */ var ListSearchSlotName = /*#__PURE__*/ function(ListSearchSlotName) {
6385
6733
  ListSearchSlotName["DEFAULT"] = "default";
6386
6734
  ListSearchSlotName["ICON"] = "icon";
6387
- })(ListSearchSlotName || (ListSearchSlotName = {}));
6735
+ return ListSearchSlotName;
6736
+ }({});
6388
6737
 
6389
6738
  function debounce(func, timeout = 200) {
6390
6739
  let timer;
@@ -6554,12 +6903,6 @@ const LanguageSwitcherDropdown = defineComponent({
6554
6903
  }
6555
6904
  });
6556
6905
 
6557
- var ElementType;
6558
- (function(ElementType) {
6559
- ElementType["BUTTON"] = "button";
6560
- ElementType["LINK"] = "link";
6561
- ElementType["DROP_DOWN_ITEM"] = "dropDownItem";
6562
- })(ElementType || (ElementType = {}));
6563
6906
  const AEntityDelete = defineComponent({
6564
6907
  props: {
6565
6908
  elementIcon: {
@@ -6597,7 +6940,7 @@ const AEntityDelete = defineComponent({
6597
6940
  const busy = ref(false);
6598
6941
  const submit = wrapFnWithBusyState(busy, async ()=>{
6599
6942
  const domainAPI = apiClient[props.entityType];
6600
- if (!isObject$1(domainAPI)) {
6943
+ if (!isObject$2(domainAPI)) {
6601
6944
  return;
6602
6945
  }
6603
6946
  if (typeof domainAPI.delete !== 'function') {
@@ -6686,6 +7029,7 @@ var components = /*#__PURE__*/Object.freeze({
6686
7029
  AIdentityProviders: AIdentityProviders,
6687
7030
  APagination: APagination,
6688
7031
  APermission: APermission,
7032
+ APermissionCheck: APermissionCheck,
6689
7033
  APermissionForm: APermissionForm,
6690
7034
  APermissionRobotAssignments: APermissionRobotAssignments,
6691
7035
  APermissionRoleAssignments: APermissionRoleAssignments,
@@ -6757,7 +7101,8 @@ function install(app1, options) {
6757
7101
  });
6758
7102
  installHTTPClient(app1, {
6759
7103
  pinia: options.pinia,
6760
- baseURL: options.baseURL
7104
+ baseURL: options.baseURL,
7105
+ isServer: options.isServer
6761
7106
  });
6762
7107
  installTranslator(app1, {
6763
7108
  locale: options.translatorLocale
@@ -6769,5 +7114,5 @@ var index = {
6769
7114
  install
6770
7115
  };
6771
7116
 
6772
- export { AClient, AClientForm, AClientRedirectUris, AClientRedirectUrisItem, AClientScope, AClientScopeAssignment, AClientScopeAssignments, AClientScopes, AClients, AEntityDelete, AIdentityProvider, AIdentityProviderForm, AIdentityProviderIcon, AIdentityProviderLdapForm, AIdentityProviderOAuth2Form, AIdentityProviderPreset, AIdentityProviderProtocol, AIdentityProviderRoleAssignment, AIdentityProviderRoleAssignments, AIdentityProviders, APagination, APermission, APermissionForm, APermissionRobotAssignments, APermissionRoleAssignments, APermissionUserAssignments, APermissions, ARealm, ARealmForm, ARealms, ARobot, ARobotForm, ARobotPermissionAssignment, ARobotPermissionAssignments, ARobotRoleAssignment, ARobotRoleAssignments, ARobots, ARole, ARoleForm, ARolePermissionAssignment, ARolePermissionAssignments, ARoleRobotAssignments, ARoleUserAssignments, ARoles, AScope, AScopeClientAssignments, AScopeForm, AScopes, ASearch, ATitle, AUser, AUserForm, AUserPasswordForm, AUserPermissionAssignment, AUserPermissionAssignments, AUserRoleAssignment, AUserRoleAssignments, AUsers, EntityManagerError, HTTPClientSymbol, LanguageSwitcherDropdown, STORE_ID, SocketClientSymbol, StoreSymbol, TranslatorTranslationClientKey, TranslatorTranslationDefaultKey, TranslatorTranslationGroup, TranslatorTranslationVuecsKey, VuelidateCustomRule, VuelidateCustomRuleKey, buildEntityManagerSlotProps, buildFormSubmitWithTranslations, buildListCreatedHandler, buildListDeletedHandler, buildListUpdatedHandler, createEntityManager, createFormSubmitTranslations, createList, createStore, index as default, defineEntityManagerEvents, defineEntityManagerProps, defineListEvents, defineListProps, extendObjectProperties, extractVuelidateResultsFromChild, getVuelidateSeverity, hasHTTPClient, hasNormalizedSlot, hasStore, initFormAttributesFromSource, inject$1 as inject, injectHTTPClient, injectSocketManager, injectStore, injectTranslatorLocale, install, installHTTPClient, installSocketManager, installStore, installTranslator, isQuerySortedDescByDate, isSocketManagerUsable, mergeListOptions, normalizeSlot, onChange, provide, provideHTTPClient, provideSocketManager, provideStore, renderEntityAssignAction, storeToRefs, useAbilityCheck, useIsEditing, useRealmResourceWritableCheck, useStore, useTranslation, useTranslationsForBaseValidation, useTranslationsForGroup, useTranslationsForNestedValidation, useUpdatedAt, wrapFnWithBusyState };
7117
+ export { AClient, AClientForm, AClientRedirectUris, AClientRedirectUrisItem, AClientScope, AClientScopeAssignment, AClientScopeAssignments, AClientScopes, AClients, AEntityDelete, AIdentityProvider, AIdentityProviderForm, AIdentityProviderIcon, AIdentityProviderLdapForm, AIdentityProviderOAuth2Form, AIdentityProviderPreset, AIdentityProviderProtocol, AIdentityProviderRoleAssignment, AIdentityProviderRoleAssignments, AIdentityProviders, APagination, APermission, APermissionCheck, APermissionForm, APermissionRobotAssignments, APermissionRoleAssignments, APermissionUserAssignments, APermissions, ARealm, ARealmForm, ARealms, ARobot, ARobotForm, ARobotPermissionAssignment, ARobotPermissionAssignments, ARobotRoleAssignment, ARobotRoleAssignments, ARobots, ARole, ARoleForm, ARolePermissionAssignment, ARolePermissionAssignments, ARoleRobotAssignments, ARoleUserAssignments, ARoles, AScope, AScopeClientAssignments, AScopeForm, AScopes, ASearch, ATitle, AUser, AUserForm, AUserPasswordForm, AUserPermissionAssignment, AUserPermissionAssignments, AUserRoleAssignment, AUserRoleAssignments, AUsers, EntityManagerError, HTTPClientSymbol, LanguageSwitcherDropdown, STORE_ID, SocketClientSymbol, StoreSymbol, TranslatorTranslationClientKey, TranslatorTranslationDefaultKey, TranslatorTranslationGroup, TranslatorTranslationVuecsKey, VuelidateCustomRule, VuelidateCustomRuleKey, buildEntityManagerSlotProps, buildFormSubmitWithTranslations, buildListCreatedHandler, buildListDeletedHandler, buildListUpdatedHandler, createEntityManager, createFormSubmitTranslations, createList, createPermissionCheckerReactiveFn, createStore, index as default, defineEntityManagerEvents, defineEntityManagerProps, defineListEvents, defineListProps, extendObjectProperties, extractVuelidateResultsFromChild, getVuelidateSeverity, hasHTTPClient, hasNormalizedSlot, hasStoreFactory, initFormAttributesFromSource, inject$1 as inject, injectHTTPClient, injectSocketManager, injectStoreFactory, injectTranslatorLocale, install, installHTTPClient, installSocketManager, installStore, installTranslator, isQuerySortedDescByDate, isSocketManagerUsable, mergeListOptions, normalizeSlot, onChange, provide, provideHTTPClient, provideSocketManager, provideStoreFactory, renderEntityAssignAction, storeToRefs, useIsEditing, usePermissionCheck, useRealmResourceWritableCheck, useStore, useTranslation, useTranslationsForBaseValidation, useTranslationsForGroup, useTranslationsForNestedValidation, useUpdatedAt, wrapFnWithBusyState };
6773
7118
  //# sourceMappingURL=index.mjs.map