@authup/client-web-kit 1.0.0-beta.21 → 1.0.0-beta.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/client/AClient.d.ts +4 -4
- package/dist/components/client/AClient.d.ts.map +1 -1
- package/dist/components/client/AClientForm.d.ts +3 -3
- package/dist/components/client/AClients.d.ts +3 -3
- package/dist/components/client/AClients.d.ts.map +1 -1
- package/dist/components/client-scope/AClientScope.d.ts +4 -4
- package/dist/components/client-scope/AClientScope.d.ts.map +1 -1
- package/dist/components/client-scope/AClientScopeAssignment.d.ts +2 -2
- package/dist/components/client-scope/AClientScopes.d.ts +3 -3
- package/dist/components/client-scope/AClientScopes.d.ts.map +1 -1
- package/dist/components/identity-provider/AIdentityProvider.d.ts +4 -4
- package/dist/components/identity-provider/AIdentityProvider.d.ts.map +1 -1
- package/dist/components/identity-provider/AIdentityProviderForm.d.ts.map +1 -1
- package/dist/components/identity-provider/AIdentityProviderLdapForm.d.ts +2 -2
- package/dist/components/identity-provider/AIdentityProviderOAuth2Form.d.ts +2 -2
- package/dist/components/identity-provider/AIdentityProviderPicker.vue.d.ts +56 -0
- package/dist/components/identity-provider/AIdentityProviderPicker.vue.d.ts.map +1 -0
- package/dist/components/identity-provider/AIdentityProviders.d.ts +3 -3
- package/dist/components/identity-provider/AIdentityProviders.d.ts.map +1 -1
- package/dist/components/identity-provider-role/AIdentityProviderRoleAssignment.d.ts +2 -2
- package/dist/components/permission/APermission.d.ts +4 -4
- package/dist/components/permission/APermission.d.ts.map +1 -1
- package/dist/components/permission/APermissionForm.d.ts +2 -2
- package/dist/components/permission/APermissions.d.ts +3 -3
- package/dist/components/permission/APermissions.d.ts.map +1 -1
- package/dist/components/realm/ARealm.d.ts +4 -4
- package/dist/components/realm/ARealm.d.ts.map +1 -1
- package/dist/components/realm/ARealmForm.d.ts +2 -2
- package/dist/components/realm/ARealms.d.ts +3 -3
- package/dist/components/realm/ARealms.d.ts.map +1 -1
- package/dist/components/robot/ARobot.d.ts +4 -4
- package/dist/components/robot/ARobot.d.ts.map +1 -1
- package/dist/components/robot/ARobotForm.d.ts +3 -3
- package/dist/components/robot/ARobots.d.ts +3 -3
- package/dist/components/robot/ARobots.d.ts.map +1 -1
- package/dist/components/robot-permission/ARobotPermissionAssignment.d.ts +2 -2
- package/dist/components/robot-role/ARobotRoleAssignment.d.ts +2 -2
- package/dist/components/role/ARole.d.ts +4 -4
- package/dist/components/role/ARole.d.ts.map +1 -1
- package/dist/components/role/ARoleForm.d.ts +2 -2
- package/dist/components/role/ARoles.d.ts +3 -3
- package/dist/components/role/ARoles.d.ts.map +1 -1
- package/dist/components/role-permission/ARolePermissionAssignment.d.ts +2 -2
- package/dist/components/scope/AScope.d.ts +4 -4
- package/dist/components/scope/AScope.d.ts.map +1 -1
- package/dist/components/scope/AScopeForm.d.ts +2 -2
- package/dist/components/scope/AScopes.d.ts +3 -3
- package/dist/components/scope/AScopes.d.ts.map +1 -1
- package/dist/components/user/AUser.d.ts +4 -4
- package/dist/components/user/AUser.d.ts.map +1 -1
- package/dist/components/user/AUserForm.d.ts +2 -2
- package/dist/components/user/AUsers.d.ts +3 -3
- package/dist/components/user/AUsers.d.ts.map +1 -1
- package/dist/components/user-permission/AUserPermissionAssignment.d.ts +2 -2
- package/dist/components/user-role/AUserRoleAssignment.d.ts +2 -2
- package/dist/core/http-client/install.d.ts.map +1 -1
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/resource/collection/constants.d.ts.map +1 -0
- package/dist/core/resource/collection/index.d.ts +4 -0
- package/dist/core/resource/collection/index.d.ts.map +1 -0
- package/dist/core/resource/collection/module.d.ts +4 -0
- package/dist/core/resource/collection/module.d.ts.map +1 -0
- package/dist/core/{list/type.d.ts → resource/collection/types.d.ts} +21 -25
- package/dist/core/resource/collection/types.d.ts.map +1 -0
- package/dist/core/{list → resource/collection}/utils/component.d.ts +3 -3
- package/dist/core/resource/collection/utils/component.d.ts.map +1 -0
- package/dist/core/resource/collection/utils/handlers.d.ts.map +1 -0
- package/dist/core/resource/collection/utils/index.d.ts.map +1 -0
- package/dist/core/resource/collection/utils/options.d.ts +3 -0
- package/dist/core/resource/collection/utils/options.d.ts.map +1 -0
- package/dist/core/resource/index.d.ts +4 -0
- package/dist/core/resource/index.d.ts.map +1 -0
- package/dist/core/resource/record/error.d.ts +4 -0
- package/dist/core/resource/record/error.d.ts.map +1 -0
- package/dist/core/{entity-manager → resource/record}/index.d.ts +1 -1
- package/dist/core/resource/record/index.d.ts.map +1 -0
- package/dist/core/resource/record/module.d.ts +4 -0
- package/dist/core/resource/record/module.d.ts.map +1 -0
- package/dist/core/{entity-manager/type.d.ts → resource/record/types.d.ts} +19 -21
- package/dist/core/resource/record/types.d.ts.map +1 -0
- package/dist/core/{entity-manager → resource/record}/utils.d.ts +4 -4
- package/dist/core/resource/record/utils.d.ts.map +1 -0
- package/dist/core/resource/socket/index.d.ts.map +1 -0
- package/dist/core/resource/socket/module.d.ts +4 -0
- package/dist/core/resource/socket/module.d.ts.map +1 -0
- package/dist/core/resource/socket/type.d.ts +24 -0
- package/dist/core/resource/socket/type.d.ts.map +1 -0
- package/dist/core/store/create.d.ts +14 -13
- package/dist/core/store/create.d.ts.map +1 -1
- package/dist/core/store/dispatcher/constants.d.ts +15 -0
- package/dist/core/store/dispatcher/constants.d.ts.map +1 -0
- package/dist/core/store/dispatcher/index.d.ts +5 -0
- package/dist/core/store/dispatcher/index.d.ts.map +1 -0
- package/dist/core/store/dispatcher/module.d.ts +3 -0
- package/dist/core/store/dispatcher/module.d.ts.map +1 -0
- package/dist/core/store/dispatcher/singleton.d.ts +5 -0
- package/dist/core/store/dispatcher/singleton.d.ts.map +1 -0
- package/dist/core/store/dispatcher/types.d.ts +23 -0
- package/dist/core/store/dispatcher/types.d.ts.map +1 -0
- package/dist/core/store/index.d.ts +1 -0
- package/dist/core/store/index.d.ts.map +1 -1
- package/dist/core/store/install.d.ts.map +1 -1
- package/dist/core/store/singleton.d.ts +1 -2
- package/dist/core/store/singleton.d.ts.map +1 -1
- package/dist/core/store/types.d.ts +2 -4
- package/dist/core/store/types.d.ts.map +1 -1
- package/dist/index.cjs +529 -341
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +15 -0
- package/dist/index.mjs +518 -333
- package/dist/index.mjs.map +1 -1
- package/package.json +30 -28
- package/dist/components/identity-provider/AIdentityProviderPicker.d.ts +0 -18
- package/dist/components/identity-provider/AIdentityProviderPicker.d.ts.map +0 -1
- package/dist/core/entity-manager/error.d.ts +0 -4
- package/dist/core/entity-manager/error.d.ts.map +0 -1
- package/dist/core/entity-manager/index.d.ts.map +0 -1
- package/dist/core/entity-manager/module.d.ts +0 -6
- package/dist/core/entity-manager/module.d.ts.map +0 -1
- package/dist/core/entity-manager/type.d.ts.map +0 -1
- package/dist/core/entity-manager/utils.d.ts.map +0 -1
- package/dist/core/entity-socket/index.d.ts.map +0 -1
- package/dist/core/entity-socket/module.d.ts +0 -6
- package/dist/core/entity-socket/module.d.ts.map +0 -1
- package/dist/core/entity-socket/type.d.ts +0 -24
- package/dist/core/entity-socket/type.d.ts.map +0 -1
- package/dist/core/list/constants.d.ts.map +0 -1
- package/dist/core/list/index.d.ts +0 -4
- package/dist/core/list/index.d.ts.map +0 -1
- package/dist/core/list/module.d.ts +0 -6
- package/dist/core/list/module.d.ts.map +0 -1
- package/dist/core/list/type.d.ts.map +0 -1
- package/dist/core/list/utils/component.d.ts.map +0 -1
- package/dist/core/list/utils/handlers.d.ts.map +0 -1
- package/dist/core/list/utils/index.d.ts.map +0 -1
- package/dist/core/list/utils/options.d.ts +0 -3
- package/dist/core/list/utils/options.d.ts.map +0 -1
- /package/dist/core/{list → resource/collection}/constants.d.ts +0 -0
- /package/dist/core/{list → resource/collection}/utils/handlers.d.ts +0 -0
- /package/dist/core/{list → resource/collection}/utils/index.d.ts +0 -0
- /package/dist/core/{entity-socket → resource/socket}/index.d.ts +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { REALM_MASTER_NAME, DomainEventName, buildDomainChannelName, DomainType, isRealmResourceWritable, IdentityProviderProtocol, IdentityProviderPreset, getIdentityProviderProtocolForPreset } from '@authup/core-kit';
|
|
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';
|
|
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, resolveComponent, openBlock, createElementBlock, createElementVNode, Fragment, renderList, createBlock, withCtx, normalizeClass, withModifiers, toDisplayString, 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
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';
|
|
@@ -90,6 +90,91 @@ class PolicyEngine extends PolicyEngine$1 {
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
/*
|
|
94
|
+
* Copyright (c) 2024.
|
|
95
|
+
* Author Peter Placzek (tada5hi)
|
|
96
|
+
* For the full copyright and license information,
|
|
97
|
+
* view the LICENSE file that was distributed with this source code.
|
|
98
|
+
*/ var StoreDispatcherEventName = /*#__PURE__*/ function(StoreDispatcherEventName) {
|
|
99
|
+
StoreDispatcherEventName["LOGGING_IN"] = "loggingIn";
|
|
100
|
+
StoreDispatcherEventName["LOGGED_IN"] = "loggedIn";
|
|
101
|
+
StoreDispatcherEventName["LOGGING_OUT"] = "loggingOut";
|
|
102
|
+
StoreDispatcherEventName["LOGGED_OUT"] = "loggedOut";
|
|
103
|
+
StoreDispatcherEventName["RESOLVING"] = "resolving";
|
|
104
|
+
StoreDispatcherEventName["RESOLVED"] = "resolved";
|
|
105
|
+
StoreDispatcherEventName["ACCESS_TOKEN_UPDATED"] = "accessTokenUpdated";
|
|
106
|
+
StoreDispatcherEventName["ACCESS_TOKEN_EXPIRE_DATE_UPDATED"] = "accessTokenExpireDateUpdated";
|
|
107
|
+
StoreDispatcherEventName["REFRESH_TOKEN_UPDATED"] = "refreshTokenUpdated";
|
|
108
|
+
StoreDispatcherEventName["USER_UPDATED"] = "userUpdated";
|
|
109
|
+
StoreDispatcherEventName["REALM_UPDATED"] = "realmUpdated";
|
|
110
|
+
StoreDispatcherEventName["REALM_MANAGEMENT_UPDATED"] = "realmManagementUpdated";
|
|
111
|
+
return StoreDispatcherEventName;
|
|
112
|
+
}({});
|
|
113
|
+
|
|
114
|
+
// src/event-emitter.ts
|
|
115
|
+
var EventEmitter = class {
|
|
116
|
+
on(type, handler) {
|
|
117
|
+
if (!this.all.has(type)) {
|
|
118
|
+
this.all.set(type, []);
|
|
119
|
+
}
|
|
120
|
+
const handlers = this.all.get(type);
|
|
121
|
+
handlers.push(handler);
|
|
122
|
+
return ()=>handlers.splice(handlers.indexOf(handler) >>> 0, 1);
|
|
123
|
+
}
|
|
124
|
+
off(type, handler) {
|
|
125
|
+
if (!type) {
|
|
126
|
+
return this.all.clear();
|
|
127
|
+
}
|
|
128
|
+
const handlers = this.all.get(type);
|
|
129
|
+
if (handlers) {
|
|
130
|
+
if (handler) {
|
|
131
|
+
handlers.splice(handlers.indexOf(handler) >>> 0, 1);
|
|
132
|
+
} else {
|
|
133
|
+
this.all.delete(type);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Invoke all handlers for the given type.
|
|
139
|
+
* If present, `'*'` handlers are invoked after type-matched handlers.
|
|
140
|
+
*
|
|
141
|
+
* Note: Manually firing `'*'` handlers is not supported.
|
|
142
|
+
*
|
|
143
|
+
* @param type The event type to invoke
|
|
144
|
+
* @param payload Any value to each handler
|
|
145
|
+
*/ emit(type, ...payload) {
|
|
146
|
+
let handlers = this.all.get(type);
|
|
147
|
+
handlers?.slice().map((handler)=>{
|
|
148
|
+
handler(...payload);
|
|
149
|
+
});
|
|
150
|
+
handlers = this.all.get("*");
|
|
151
|
+
if (handlers) {
|
|
152
|
+
handlers.slice().map((handler)=>{
|
|
153
|
+
handler(type, payload);
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
constructor(all){
|
|
158
|
+
this.all = all || /* @__PURE__ */ new Map();
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
function createStoreDispatcher() {
|
|
163
|
+
return new EventEmitter();
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const sym$1 = Symbol.for('AuthupStoreEventBus');
|
|
167
|
+
function injectStoreDispatcher(app) {
|
|
168
|
+
const instance = inject$1(sym$1, app);
|
|
169
|
+
if (!instance) {
|
|
170
|
+
throw new Error('The store dispatcher has not been injected in the app context.');
|
|
171
|
+
}
|
|
172
|
+
return instance;
|
|
173
|
+
}
|
|
174
|
+
function provideStoreDispatcher(eventBus, app) {
|
|
175
|
+
provide(sym$1, eventBus, app);
|
|
176
|
+
}
|
|
177
|
+
|
|
93
178
|
function createPromiseShareWrapperFn(fn) {
|
|
94
179
|
let promise;
|
|
95
180
|
return (...args)=>{
|
|
@@ -107,41 +192,45 @@ function createPromiseShareWrapperFn(fn) {
|
|
|
107
192
|
return promise;
|
|
108
193
|
};
|
|
109
194
|
}
|
|
110
|
-
function createStore(context
|
|
195
|
+
function createStore(context) {
|
|
111
196
|
const client = new Client({
|
|
112
197
|
baseURL: context.baseURL
|
|
113
198
|
});
|
|
114
|
-
const
|
|
115
|
-
const
|
|
116
|
-
|
|
199
|
+
const cookiesRead = ref(false);
|
|
200
|
+
const setCookiesRead = (value)=>{
|
|
201
|
+
cookiesRead.value = value;
|
|
117
202
|
};
|
|
118
203
|
// --------------------------------------------------------------------
|
|
119
|
-
const accessToken = ref(
|
|
204
|
+
const accessToken = ref(null);
|
|
120
205
|
const setAccessToken = (input)=>{
|
|
121
206
|
accessToken.value = input;
|
|
207
|
+
context.dispatcher.emit(StoreDispatcherEventName.ACCESS_TOKEN_UPDATED, input);
|
|
122
208
|
};
|
|
123
209
|
// --------------------------------------------------------------------
|
|
124
|
-
const accessTokenExpireDate = ref(
|
|
210
|
+
const accessTokenExpireDate = ref(null);
|
|
125
211
|
const setAccessTokenExpireDate = (input)=>{
|
|
126
212
|
if (typeof input === 'number' || typeof input === 'string') {
|
|
127
213
|
accessTokenExpireDate.value = new Date(input); // verify microseconds or seconds
|
|
128
|
-
|
|
214
|
+
} else {
|
|
215
|
+
accessTokenExpireDate.value = input;
|
|
129
216
|
}
|
|
130
|
-
accessTokenExpireDate.value
|
|
217
|
+
context.dispatcher.emit(StoreDispatcherEventName.ACCESS_TOKEN_EXPIRE_DATE_UPDATED, accessTokenExpireDate.value);
|
|
131
218
|
};
|
|
132
219
|
// --------------------------------------------------------------------
|
|
133
|
-
const refreshToken = ref(
|
|
220
|
+
const refreshToken = ref(null);
|
|
134
221
|
const setRefreshToken = (input)=>{
|
|
135
222
|
refreshToken.value = input;
|
|
223
|
+
context.dispatcher.emit(StoreDispatcherEventName.REFRESH_TOKEN_UPDATED, input);
|
|
136
224
|
};
|
|
137
225
|
// --------------------------------------------------------------------
|
|
138
|
-
const user = ref(
|
|
139
|
-
const userId = computed(()=>user.value ? user.value.id :
|
|
140
|
-
const setUser = (
|
|
141
|
-
user.value =
|
|
226
|
+
const user = ref(null);
|
|
227
|
+
const userId = computed(()=>user.value ? user.value.id : null);
|
|
228
|
+
const setUser = (input)=>{
|
|
229
|
+
user.value = input;
|
|
230
|
+
context.dispatcher.emit(StoreDispatcherEventName.USER_UPDATED, input);
|
|
142
231
|
};
|
|
143
232
|
// --------------------------------------------------------------------
|
|
144
|
-
const realm = ref(
|
|
233
|
+
const realm = ref(null);
|
|
145
234
|
const realmId = computed(()=>realm.value ? realm.value.id : undefined);
|
|
146
235
|
const realmName = computed(()=>realm.value ? realm.value.name : undefined);
|
|
147
236
|
const realmIsRoot = computed(()=>{
|
|
@@ -150,14 +239,16 @@ function createStore(context = {}) {
|
|
|
150
239
|
}
|
|
151
240
|
return false;
|
|
152
241
|
});
|
|
153
|
-
const setRealm = (
|
|
154
|
-
realm.value =
|
|
242
|
+
const setRealm = (input)=>{
|
|
243
|
+
realm.value = input;
|
|
244
|
+
context.dispatcher.emit(StoreDispatcherEventName.REALM_UPDATED, input);
|
|
155
245
|
};
|
|
156
|
-
const realmManagement = ref(
|
|
246
|
+
const realmManagement = ref(null);
|
|
157
247
|
const realmManagementId = computed(()=>realmManagement.value ? realmManagement.value.id : realmId.value);
|
|
158
248
|
const realmManagementName = computed(()=>realmManagement.value ? realmManagement.value.name : realmName.value);
|
|
159
|
-
const setRealmManagement = (
|
|
160
|
-
realmManagement.value =
|
|
249
|
+
const setRealmManagement = (input)=>{
|
|
250
|
+
realmManagement.value = input;
|
|
251
|
+
context.dispatcher.emit(StoreDispatcherEventName.REALM_MANAGEMENT_UPDATED, input);
|
|
161
252
|
};
|
|
162
253
|
// --------------------------------------------------------------------
|
|
163
254
|
const permissionRepository = new PermissionMemoryProvider();
|
|
@@ -166,6 +257,38 @@ function createStore(context = {}) {
|
|
|
166
257
|
policyEngine: new PolicyEngine()
|
|
167
258
|
});
|
|
168
259
|
// --------------------------------------------------------------------
|
|
260
|
+
const cleanup = async ()=>{
|
|
261
|
+
const tempAccessToken = accessToken.value;
|
|
262
|
+
const tempRefreshToken = refreshToken.value;
|
|
263
|
+
setAccessToken(null);
|
|
264
|
+
setAccessTokenExpireDate(null);
|
|
265
|
+
setRefreshToken(null);
|
|
266
|
+
setUser(null);
|
|
267
|
+
setRealm(null);
|
|
268
|
+
setRealmManagement(null);
|
|
269
|
+
permissionRepository.setMany([]);
|
|
270
|
+
tokenResolved.value = false;
|
|
271
|
+
userResolved.value = false;
|
|
272
|
+
try {
|
|
273
|
+
if (tempAccessToken) {
|
|
274
|
+
await client.token.revoke({
|
|
275
|
+
token: tempAccessToken
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
} catch (e) {
|
|
279
|
+
// ...
|
|
280
|
+
}
|
|
281
|
+
try {
|
|
282
|
+
if (tempRefreshToken) {
|
|
283
|
+
await client.token.revoke({
|
|
284
|
+
token: tempRefreshToken
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
} catch (e) {
|
|
288
|
+
// ...
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
// --------------------------------------------------------------------
|
|
169
292
|
const userResolved = ref(false);
|
|
170
293
|
const resolveUser = async ()=>{
|
|
171
294
|
if (!accessToken.value || userResolved.value) {
|
|
@@ -210,29 +333,38 @@ function createStore(context = {}) {
|
|
|
210
333
|
});
|
|
211
334
|
};
|
|
212
335
|
// --------------------------------------------------------------------
|
|
213
|
-
const
|
|
336
|
+
const applyTokenGrantResponse = (response)=>{
|
|
214
337
|
const expireDate = new Date(Date.now() + response.expires_in * 1000);
|
|
215
338
|
setAccessTokenExpireDate(expireDate);
|
|
216
339
|
setAccessToken(response.access_token);
|
|
217
|
-
|
|
340
|
+
if (response.refresh_token) {
|
|
341
|
+
setRefreshToken(response.refresh_token);
|
|
342
|
+
} else {
|
|
343
|
+
setRefreshToken(null);
|
|
344
|
+
}
|
|
218
345
|
};
|
|
219
346
|
// --------------------------------------------------------------------
|
|
220
347
|
const refreshSession = createPromiseShareWrapperFn(async ()=>{
|
|
221
348
|
if (!refreshToken.value) {
|
|
222
349
|
throw new TokenError('The access token can not be renewed.');
|
|
223
350
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
}
|
|
351
|
+
try {
|
|
352
|
+
const response = await client.token.createWithRefreshToken({
|
|
353
|
+
refresh_token: refreshToken.value
|
|
354
|
+
});
|
|
355
|
+
applyTokenGrantResponse(response);
|
|
356
|
+
} catch (e) {
|
|
357
|
+
await cleanup();
|
|
358
|
+
throw e;
|
|
359
|
+
} finally{
|
|
230
360
|
tokenResolved.value = false;
|
|
231
361
|
userResolved.value = false;
|
|
232
|
-
}
|
|
362
|
+
}
|
|
233
363
|
});
|
|
234
364
|
// --------------------------------------------------------------------
|
|
365
|
+
// todo: rename to reload() ?
|
|
235
366
|
const resolveInternal = async ()=>{
|
|
367
|
+
context.dispatcher.emit(StoreDispatcherEventName.RESOLVING);
|
|
236
368
|
try {
|
|
237
369
|
if (!accessToken.value && refreshToken.value) {
|
|
238
370
|
await refreshSession();
|
|
@@ -246,49 +378,44 @@ function createStore(context = {}) {
|
|
|
246
378
|
} catch (e) {
|
|
247
379
|
if (isClientTokenExpiredError(e) && refreshToken.value) {
|
|
248
380
|
await refreshSession();
|
|
249
|
-
|
|
381
|
+
await resolveToken();
|
|
382
|
+
await resolveUser();
|
|
383
|
+
} else {
|
|
384
|
+
throw e;
|
|
250
385
|
}
|
|
251
|
-
throw e;
|
|
252
386
|
}
|
|
253
|
-
|
|
387
|
+
context.dispatcher.emit(StoreDispatcherEventName.RESOLVED);
|
|
254
388
|
};
|
|
255
389
|
const resolve = createPromiseShareWrapperFn(resolveInternal);
|
|
256
390
|
const loggedIn = computed(()=>!!accessToken.value);
|
|
257
391
|
const login = async (ctx)=>{
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
throw e;
|
|
271
|
-
}
|
|
392
|
+
context.dispatcher.emit(StoreDispatcherEventName.LOGGING_IN);
|
|
393
|
+
const response = await client.token.createWithPasswordGrant({
|
|
394
|
+
username: ctx.name,
|
|
395
|
+
password: ctx.password,
|
|
396
|
+
...realmId.value ? {
|
|
397
|
+
realm_id: ctx.realmId
|
|
398
|
+
} : {}
|
|
399
|
+
});
|
|
400
|
+
applyTokenGrantResponse(response);
|
|
401
|
+
await resolveToken();
|
|
402
|
+
await resolveUser();
|
|
403
|
+
context.dispatcher.emit(StoreDispatcherEventName.LOGGED_IN);
|
|
272
404
|
};
|
|
273
|
-
const logout = ()=>{
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
setUser(undefined);
|
|
278
|
-
setRealm(undefined);
|
|
279
|
-
setRealmManagement(undefined);
|
|
280
|
-
tokenResolved.value = false;
|
|
281
|
-
userResolved.value = false;
|
|
405
|
+
const logout = async ()=>{
|
|
406
|
+
context.dispatcher.emit(StoreDispatcherEventName.LOGGING_OUT);
|
|
407
|
+
await cleanup();
|
|
408
|
+
context.dispatcher.emit(StoreDispatcherEventName.LOGGED_OUT);
|
|
282
409
|
};
|
|
283
410
|
return {
|
|
284
|
-
|
|
285
|
-
|
|
411
|
+
cookiesRead,
|
|
412
|
+
setCookiesRead,
|
|
286
413
|
permissionChecker,
|
|
287
414
|
login,
|
|
288
415
|
logout,
|
|
289
416
|
loggedIn,
|
|
290
417
|
resolve,
|
|
291
|
-
|
|
418
|
+
applyTokenGrantResponse,
|
|
292
419
|
accessToken,
|
|
293
420
|
setAccessToken,
|
|
294
421
|
accessTokenExpireDate,
|
|
@@ -375,8 +502,8 @@ function shouldUpdate(dependencies, newCookies, oldCookies) {
|
|
|
375
502
|
return false;
|
|
376
503
|
}
|
|
377
504
|
|
|
378
|
-
const
|
|
379
|
-
function
|
|
505
|
+
const sym = Symbol.for('AuthupStore');
|
|
506
|
+
function injectStore(pinia, app) {
|
|
380
507
|
const instance = injectStoreFactory(app);
|
|
381
508
|
if (!instance) {
|
|
382
509
|
throw new Error('The store has not been injected in the app context.');
|
|
@@ -384,25 +511,28 @@ function useStore(pinia, app) {
|
|
|
384
511
|
return instance(pinia);
|
|
385
512
|
}
|
|
386
513
|
function injectStoreFactory(app) {
|
|
387
|
-
const instance = inject$1(
|
|
514
|
+
const instance = inject$1(sym, app);
|
|
388
515
|
if (!instance) {
|
|
389
516
|
throw new Error('The store factory has not been injected in the app context.');
|
|
390
517
|
}
|
|
391
518
|
return instance;
|
|
392
519
|
}
|
|
393
520
|
function hasStoreFactory(app) {
|
|
394
|
-
return !!inject$1(
|
|
521
|
+
return !!inject$1(sym, app);
|
|
395
522
|
}
|
|
396
523
|
function provideStoreFactory(store, app) {
|
|
397
|
-
provide(
|
|
524
|
+
provide(sym, store, app);
|
|
398
525
|
}
|
|
399
526
|
|
|
400
527
|
function installStore(app, options = {}) {
|
|
401
528
|
if (hasStoreFactory(app)) {
|
|
402
529
|
return;
|
|
403
530
|
}
|
|
531
|
+
const storeDispatcher = createStoreDispatcher();
|
|
532
|
+
provideStoreDispatcher(storeDispatcher, app);
|
|
404
533
|
const storeFactory = defineStore(STORE_ID, ()=>createStore({
|
|
405
|
-
baseURL: options.baseURL
|
|
534
|
+
baseURL: options.baseURL,
|
|
535
|
+
dispatcher: storeDispatcher
|
|
406
536
|
}));
|
|
407
537
|
const store = storeFactory(options.pinia);
|
|
408
538
|
let cookieGet;
|
|
@@ -430,11 +560,11 @@ function installStore(app, options = {}) {
|
|
|
430
560
|
const cookies = useCookies();
|
|
431
561
|
cookieUnset = cookies.remove;
|
|
432
562
|
}
|
|
433
|
-
const
|
|
434
|
-
if (store.
|
|
563
|
+
const readCookies = ()=>{
|
|
564
|
+
if (store.cookiesRead) {
|
|
435
565
|
return;
|
|
436
566
|
}
|
|
437
|
-
store.
|
|
567
|
+
store.setCookiesRead(true);
|
|
438
568
|
const keys = Object.values(CookieName);
|
|
439
569
|
let value;
|
|
440
570
|
for(let i = 0; i < keys.length; i++){
|
|
@@ -476,51 +606,60 @@ function installStore(app, options = {}) {
|
|
|
476
606
|
}
|
|
477
607
|
}
|
|
478
608
|
};
|
|
479
|
-
|
|
480
|
-
if (
|
|
481
|
-
return;
|
|
609
|
+
const maxAgeFn = ()=>{
|
|
610
|
+
if (!store.accessTokenExpireDate) {
|
|
611
|
+
return undefined;
|
|
482
612
|
}
|
|
483
|
-
|
|
484
|
-
|
|
613
|
+
return Math.floor(Math.max(1000, new Date(`${store.accessTokenExpireDate}`).getTime() - Date.now()) / 1000);
|
|
614
|
+
};
|
|
615
|
+
storeDispatcher.on(StoreDispatcherEventName.ACCESS_TOKEN_EXPIRE_DATE_UPDATED, (input)=>{
|
|
616
|
+
if (input) {
|
|
617
|
+
cookieSet(CookieName.ACCESS_TOKEN_EXPIRE_DATE, input, {
|
|
618
|
+
maxAge: maxAgeFn()
|
|
619
|
+
});
|
|
620
|
+
} else {
|
|
485
621
|
cookieUnset(CookieName.ACCESS_TOKEN_EXPIRE_DATE, {});
|
|
486
|
-
cookieUnset(CookieName.REFRESH_TOKEN, {});
|
|
487
|
-
cookieUnset(CookieName.USER, {});
|
|
488
|
-
cookieUnset(CookieName.REALM, {});
|
|
489
|
-
cookieUnset(CookieName.REALM_MANAGEMENT, {});
|
|
490
622
|
}
|
|
491
623
|
});
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
}
|
|
497
|
-
let maxAge;
|
|
498
|
-
if (state.accessTokenExpireDate) {
|
|
499
|
-
maxAge = Math.floor(Math.max(1000, new Date(`${state.accessTokenExpireDate}`).getTime() - Date.now()) / 1000);
|
|
500
|
-
}
|
|
501
|
-
if (state.accessToken) {
|
|
502
|
-
cookieSet(CookieName.ACCESS_TOKEN, state.accessToken, {
|
|
503
|
-
maxAge
|
|
504
|
-
});
|
|
505
|
-
}
|
|
506
|
-
if (state.accessTokenExpireDate) {
|
|
507
|
-
cookieSet(CookieName.ACCESS_TOKEN_EXPIRE_DATE, state.accessTokenExpireDate, {
|
|
624
|
+
storeDispatcher.on(StoreDispatcherEventName.ACCESS_TOKEN_UPDATED, (input)=>{
|
|
625
|
+
if (input) {
|
|
626
|
+
const maxAge = maxAgeFn();
|
|
627
|
+
cookieSet(CookieName.ACCESS_TOKEN, input, {
|
|
508
628
|
maxAge
|
|
509
629
|
});
|
|
630
|
+
} else {
|
|
631
|
+
cookieUnset(CookieName.ACCESS_TOKEN, {});
|
|
510
632
|
}
|
|
511
|
-
|
|
512
|
-
|
|
633
|
+
});
|
|
634
|
+
storeDispatcher.on(StoreDispatcherEventName.REFRESH_TOKEN_UPDATED, (input)=>{
|
|
635
|
+
if (input) {
|
|
636
|
+
cookieSet(CookieName.REFRESH_TOKEN, input, {});
|
|
637
|
+
} else {
|
|
638
|
+
cookieUnset(CookieName.REFRESH_TOKEN, {});
|
|
513
639
|
}
|
|
514
|
-
|
|
515
|
-
|
|
640
|
+
});
|
|
641
|
+
storeDispatcher.on(StoreDispatcherEventName.USER_UPDATED, (input)=>{
|
|
642
|
+
if (input) {
|
|
643
|
+
cookieSet(CookieName.USER, input, {});
|
|
644
|
+
} else {
|
|
645
|
+
cookieUnset(CookieName.USER, {});
|
|
516
646
|
}
|
|
517
|
-
|
|
518
|
-
|
|
647
|
+
});
|
|
648
|
+
storeDispatcher.on(StoreDispatcherEventName.REALM_UPDATED, (input)=>{
|
|
649
|
+
if (input) {
|
|
650
|
+
cookieSet(CookieName.REALM, input, {});
|
|
651
|
+
} else {
|
|
652
|
+
cookieUnset(CookieName.REALM, {});
|
|
519
653
|
}
|
|
520
|
-
|
|
521
|
-
|
|
654
|
+
});
|
|
655
|
+
storeDispatcher.on(StoreDispatcherEventName.REALM_MANAGEMENT_UPDATED, (input)=>{
|
|
656
|
+
if (input) {
|
|
657
|
+
cookieSet(CookieName.REALM_MANAGEMENT, input, {});
|
|
658
|
+
} else {
|
|
659
|
+
cookieUnset(CookieName.REALM_MANAGEMENT, {});
|
|
522
660
|
}
|
|
523
661
|
});
|
|
662
|
+
readCookies();
|
|
524
663
|
provideStoreFactory(storeFactory, app);
|
|
525
664
|
}
|
|
526
665
|
|
|
@@ -558,30 +697,36 @@ function installHTTPClient(app, options = {}) {
|
|
|
558
697
|
});
|
|
559
698
|
},
|
|
560
699
|
tokenCreated: (response)=>{
|
|
561
|
-
store.
|
|
700
|
+
store.applyTokenGrantResponse(response);
|
|
562
701
|
},
|
|
563
702
|
tokenFailed: ()=>{
|
|
564
|
-
store.logout();
|
|
703
|
+
Promise.resolve().then(()=>store.logout());
|
|
565
704
|
},
|
|
566
705
|
timer: !options.isServer
|
|
567
706
|
});
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
if (
|
|
707
|
+
const storeDispatcher = injectStoreDispatcher(app);
|
|
708
|
+
const handleAccessTokenEvent = ()=>{
|
|
709
|
+
if (store.accessToken) {
|
|
571
710
|
client.setAuthorizationHeader({
|
|
572
711
|
type: 'Bearer',
|
|
573
|
-
token:
|
|
712
|
+
token: store.accessToken
|
|
574
713
|
});
|
|
575
714
|
tokenHook.mount();
|
|
576
715
|
} else {
|
|
577
716
|
client.unsetAuthorizationHeader();
|
|
578
717
|
tokenHook.unmount();
|
|
579
718
|
}
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
719
|
+
};
|
|
720
|
+
const handleAccessTokenExpireDateEvent = ()=>{
|
|
721
|
+
if (store.accessTokenExpireDate) {
|
|
722
|
+
const expiresIn = Math.floor((store.accessTokenExpireDate.getTime() - Date.now()) / 1000);
|
|
723
|
+
tokenHook.setTimer(expiresIn, ()=>refreshToken.value || undefined);
|
|
583
724
|
}
|
|
584
|
-
}
|
|
725
|
+
};
|
|
726
|
+
storeDispatcher.on(StoreDispatcherEventName.ACCESS_TOKEN_UPDATED, ()=>handleAccessTokenEvent());
|
|
727
|
+
storeDispatcher.on(StoreDispatcherEventName.ACCESS_TOKEN_EXPIRE_DATE_UPDATED, ()=>handleAccessTokenExpireDateEvent());
|
|
728
|
+
handleAccessTokenEvent();
|
|
729
|
+
handleAccessTokenExpireDateEvent();
|
|
585
730
|
provideHTTPClient(client, app);
|
|
586
731
|
}
|
|
587
732
|
|
|
@@ -629,7 +774,7 @@ function renderEntityAssignAction(ctx) {
|
|
|
629
774
|
* Author Peter Placzek (tada5hi)
|
|
630
775
|
* For the full copyright and license information,
|
|
631
776
|
* view the LICENSE file that was distributed with this source code.
|
|
632
|
-
*/ function
|
|
777
|
+
*/ function defineResourceCollectionVEmitOptions() {
|
|
633
778
|
return {
|
|
634
779
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
635
780
|
created: (_item)=>true,
|
|
@@ -639,7 +784,7 @@ function renderEntityAssignAction(ctx) {
|
|
|
639
784
|
updated: (_item)=>true
|
|
640
785
|
};
|
|
641
786
|
}
|
|
642
|
-
function
|
|
787
|
+
function defineResourceCollectionVProps() {
|
|
643
788
|
return {
|
|
644
789
|
query: {
|
|
645
790
|
type: Object,
|
|
@@ -814,7 +959,7 @@ function installSocketManager(app, options) {
|
|
|
814
959
|
provideSocketManager(manager, app);
|
|
815
960
|
}
|
|
816
961
|
|
|
817
|
-
function
|
|
962
|
+
function create$2(ctx) {
|
|
818
963
|
if (!isSocketManagerUsable()) {
|
|
819
964
|
return {
|
|
820
965
|
mount () {},
|
|
@@ -822,7 +967,7 @@ function createEntitySocket(ctx) {
|
|
|
822
967
|
};
|
|
823
968
|
}
|
|
824
969
|
const socketManager = injectSocketManager();
|
|
825
|
-
const store =
|
|
970
|
+
const store = injectStore();
|
|
826
971
|
const storeRefs = storeToRefs(store);
|
|
827
972
|
const realmId = computed(()=>{
|
|
828
973
|
if (storeRefs.realmName.value === REALM_MASTER_NAME) {
|
|
@@ -926,8 +1071,7 @@ function createEntitySocket(ctx) {
|
|
|
926
1071
|
onUnmounted(()=>unmount());
|
|
927
1072
|
watch(targetId, (val, oldValue)=>{
|
|
928
1073
|
if (val !== oldValue) {
|
|
929
|
-
unmount();
|
|
930
|
-
mount();
|
|
1074
|
+
Promise.resolve().then(()=>unmount()).then(()=>mount());
|
|
931
1075
|
}
|
|
932
1076
|
});
|
|
933
1077
|
return {
|
|
@@ -935,6 +1079,9 @@ function createEntitySocket(ctx) {
|
|
|
935
1079
|
unmount
|
|
936
1080
|
};
|
|
937
1081
|
}
|
|
1082
|
+
function createResourceSocketManager(ctx) {
|
|
1083
|
+
return create$2(ctx);
|
|
1084
|
+
}
|
|
938
1085
|
|
|
939
1086
|
function isQuerySortedDescByDate(input) {
|
|
940
1087
|
if (Array.isArray(input)) {
|
|
@@ -951,7 +1098,7 @@ const merger = createMerger({
|
|
|
951
1098
|
inPlace: false,
|
|
952
1099
|
priority: 'left'
|
|
953
1100
|
});
|
|
954
|
-
function
|
|
1101
|
+
function create$1(context) {
|
|
955
1102
|
const data = ref([]);
|
|
956
1103
|
const busy = ref(false);
|
|
957
1104
|
const total = ref(0);
|
|
@@ -1036,7 +1183,7 @@ function createList(context) {
|
|
|
1036
1183
|
}
|
|
1037
1184
|
}
|
|
1038
1185
|
const handleCreated = buildListCreatedHandler(data, (cbEntity)=>{
|
|
1039
|
-
total.value
|
|
1186
|
+
total.value++;
|
|
1040
1187
|
if (context.onCreated) {
|
|
1041
1188
|
context.onCreated(cbEntity, meta.value);
|
|
1042
1189
|
}
|
|
@@ -1069,7 +1216,7 @@ function createList(context) {
|
|
|
1069
1216
|
noMore: renderOptions.noMore,
|
|
1070
1217
|
body: renderOptions.body,
|
|
1071
1218
|
loading: renderOptions.loading,
|
|
1072
|
-
total,
|
|
1219
|
+
total: total.value,
|
|
1073
1220
|
load,
|
|
1074
1221
|
busy: busy.value,
|
|
1075
1222
|
data: data.value,
|
|
@@ -1078,16 +1225,19 @@ function createList(context) {
|
|
|
1078
1225
|
if (context.setup.emit) {
|
|
1079
1226
|
context.setup.emit('created', value);
|
|
1080
1227
|
}
|
|
1228
|
+
handleCreated(value);
|
|
1081
1229
|
},
|
|
1082
1230
|
onDeleted: (value)=>{
|
|
1083
1231
|
if (context.setup.emit) {
|
|
1084
1232
|
context.setup.emit('deleted', value);
|
|
1085
1233
|
}
|
|
1234
|
+
handleDeleted(value);
|
|
1086
1235
|
},
|
|
1087
1236
|
onUpdated: (value)=>{
|
|
1088
1237
|
if (context.setup.emit) {
|
|
1089
1238
|
context.setup.emit('updated', value);
|
|
1090
1239
|
}
|
|
1240
|
+
handleUpdated(value);
|
|
1091
1241
|
},
|
|
1092
1242
|
slotItems: context.setup.slots || {}
|
|
1093
1243
|
});
|
|
@@ -1125,7 +1275,7 @@ function createList(context) {
|
|
|
1125
1275
|
handleDeleted(entity);
|
|
1126
1276
|
};
|
|
1127
1277
|
socketContext.realmId = realmId;
|
|
1128
|
-
|
|
1278
|
+
createResourceSocketManager(socketContext);
|
|
1129
1279
|
}
|
|
1130
1280
|
return {
|
|
1131
1281
|
data,
|
|
@@ -1139,13 +1289,16 @@ function createList(context) {
|
|
|
1139
1289
|
load
|
|
1140
1290
|
};
|
|
1141
1291
|
}
|
|
1292
|
+
function createResourceCollectionManager(context) {
|
|
1293
|
+
return create$1(context);
|
|
1294
|
+
}
|
|
1142
1295
|
|
|
1143
1296
|
/*
|
|
1144
1297
|
* Copyright (c) 2023.
|
|
1145
1298
|
* Author Peter Placzek (tada5hi)
|
|
1146
1299
|
* For the full copyright and license information,
|
|
1147
1300
|
* view the LICENSE file that was distributed with this source code.
|
|
1148
|
-
*/ class
|
|
1301
|
+
*/ class ResourceRecordError extends Error {
|
|
1149
1302
|
static unresolvable() {
|
|
1150
1303
|
return new this('Entity could not be resolved.');
|
|
1151
1304
|
}
|
|
@@ -1192,7 +1345,7 @@ function createList(context) {
|
|
|
1192
1345
|
return [];
|
|
1193
1346
|
}
|
|
1194
1347
|
|
|
1195
|
-
function
|
|
1348
|
+
function buildResourceVSlotProps(input) {
|
|
1196
1349
|
return {
|
|
1197
1350
|
...input,
|
|
1198
1351
|
error: unref(input.error),
|
|
@@ -1201,7 +1354,7 @@ function buildEntityManagerSlotProps(input) {
|
|
|
1201
1354
|
lockId: unref(input.lockId)
|
|
1202
1355
|
};
|
|
1203
1356
|
}
|
|
1204
|
-
function
|
|
1357
|
+
function defineResourceVEmitOptions() {
|
|
1205
1358
|
return {
|
|
1206
1359
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1207
1360
|
failed: (_item)=>true,
|
|
@@ -1215,7 +1368,7 @@ function defineEntityManagerEvents() {
|
|
|
1215
1368
|
resolved: (_item)=>true
|
|
1216
1369
|
};
|
|
1217
1370
|
}
|
|
1218
|
-
function
|
|
1371
|
+
function defineResourceVProps() {
|
|
1219
1372
|
return {
|
|
1220
1373
|
entity: {
|
|
1221
1374
|
type: Object
|
|
@@ -1235,7 +1388,7 @@ function defineEntityManagerProps() {
|
|
|
1235
1388
|
};
|
|
1236
1389
|
}
|
|
1237
1390
|
|
|
1238
|
-
function
|
|
1391
|
+
function create(ctx) {
|
|
1239
1392
|
const client = injectHTTPClient();
|
|
1240
1393
|
let domainAPI;
|
|
1241
1394
|
if (hasOwnProperty(client, ctx.type)) {
|
|
@@ -1387,7 +1540,7 @@ function createEntityManager(ctx) {
|
|
|
1387
1540
|
socketContext.realmId = realmId;
|
|
1388
1541
|
socketContext.target = true;
|
|
1389
1542
|
socketContext.targetId = entityId;
|
|
1390
|
-
socket =
|
|
1543
|
+
socket = createResourceSocketManager(socketContext);
|
|
1391
1544
|
}
|
|
1392
1545
|
const error = ref(undefined);
|
|
1393
1546
|
const resolveByProps = ()=>{
|
|
@@ -1496,7 +1649,7 @@ function createEntityManager(ctx) {
|
|
|
1496
1649
|
await resolve(resolveContext);
|
|
1497
1650
|
if (typeof entity.value === 'undefined') {
|
|
1498
1651
|
if (!error.value) {
|
|
1499
|
-
throw
|
|
1652
|
+
throw ResourceRecordError.unresolvable();
|
|
1500
1653
|
}
|
|
1501
1654
|
// eslint-disable-next-line no-throw-literal
|
|
1502
1655
|
throw error.value;
|
|
@@ -1525,7 +1678,7 @@ function createEntityManager(ctx) {
|
|
|
1525
1678
|
return typeof content === 'function' ? content() : content;
|
|
1526
1679
|
}
|
|
1527
1680
|
if (hasNormalizedSlot('default', ctx.setup.slots)) {
|
|
1528
|
-
return normalizeSlot('default',
|
|
1681
|
+
return normalizeSlot('default', buildResourceVSlotProps(manager), ctx.setup.slots);
|
|
1529
1682
|
}
|
|
1530
1683
|
return typeof content === 'function' ? content() : content;
|
|
1531
1684
|
};
|
|
@@ -1540,6 +1693,9 @@ function createEntityManager(ctx) {
|
|
|
1540
1693
|
};
|
|
1541
1694
|
return manager;
|
|
1542
1695
|
}
|
|
1696
|
+
function createResourceManager(ctx) {
|
|
1697
|
+
return create(ctx);
|
|
1698
|
+
}
|
|
1543
1699
|
|
|
1544
1700
|
/*
|
|
1545
1701
|
* Copyright (c) 2022.
|
|
@@ -2088,7 +2244,7 @@ function createPermissionCheckerReactiveFn(ctx = {}) {
|
|
|
2088
2244
|
if (ctx.store) {
|
|
2089
2245
|
store = ctx.store;
|
|
2090
2246
|
} else {
|
|
2091
|
-
store =
|
|
2247
|
+
store = injectStore(ctx.pinia, ctx.app);
|
|
2092
2248
|
}
|
|
2093
2249
|
const storeRefs = storeToRefs(store);
|
|
2094
2250
|
return (ctx)=>{
|
|
@@ -2143,11 +2299,11 @@ function createPermissionCheckerReactiveFn(ctx = {}) {
|
|
|
2143
2299
|
}
|
|
2144
2300
|
|
|
2145
2301
|
const AClient = defineComponent({
|
|
2146
|
-
props:
|
|
2147
|
-
emits:
|
|
2302
|
+
props: defineResourceVProps(),
|
|
2303
|
+
emits: defineResourceVEmitOptions(),
|
|
2148
2304
|
slots: Object,
|
|
2149
2305
|
async setup (props, setup) {
|
|
2150
|
-
const manager =
|
|
2306
|
+
const manager = createResourceManager({
|
|
2151
2307
|
type: `${DomainType.CLIENT}`,
|
|
2152
2308
|
setup,
|
|
2153
2309
|
props
|
|
@@ -2195,7 +2351,7 @@ function usePermissionCheck(ctx) {
|
|
|
2195
2351
|
}
|
|
2196
2352
|
|
|
2197
2353
|
function useRealmResourceWritableCheck(realmId) {
|
|
2198
|
-
const store =
|
|
2354
|
+
const store = injectStore();
|
|
2199
2355
|
const { realm } = storeToRefs$1(store);
|
|
2200
2356
|
return computed(()=>{
|
|
2201
2357
|
const realmIdRaw = unref(realmId);
|
|
@@ -2204,11 +2360,11 @@ function useRealmResourceWritableCheck(realmId) {
|
|
|
2204
2360
|
}
|
|
2205
2361
|
|
|
2206
2362
|
const ARealm = defineComponent({
|
|
2207
|
-
props:
|
|
2208
|
-
emits:
|
|
2363
|
+
props: defineResourceVProps(),
|
|
2364
|
+
emits: defineResourceVEmitOptions(),
|
|
2209
2365
|
slots: Object,
|
|
2210
2366
|
async setup (props, setup) {
|
|
2211
|
-
const manager =
|
|
2367
|
+
const manager = createResourceManager({
|
|
2212
2368
|
type: `${DomainType.REALM}`,
|
|
2213
2369
|
props,
|
|
2214
2370
|
setup
|
|
@@ -2230,7 +2386,7 @@ const ARealmForm = defineComponent({
|
|
|
2230
2386
|
default: undefined
|
|
2231
2387
|
}
|
|
2232
2388
|
},
|
|
2233
|
-
emits:
|
|
2389
|
+
emits: defineResourceVEmitOptions(),
|
|
2234
2390
|
setup (props, ctx) {
|
|
2235
2391
|
const busy = ref(false);
|
|
2236
2392
|
const form = reactive({
|
|
@@ -2253,7 +2409,7 @@ const ARealmForm = defineComponent({
|
|
|
2253
2409
|
maxLength: maxLength(4096)
|
|
2254
2410
|
}
|
|
2255
2411
|
}, form);
|
|
2256
|
-
const manager =
|
|
2412
|
+
const manager = createResourceManager({
|
|
2257
2413
|
type: `${DomainType.REALM}`,
|
|
2258
2414
|
setup: ctx,
|
|
2259
2415
|
props
|
|
@@ -2388,11 +2544,11 @@ const ARealmForm = defineComponent({
|
|
|
2388
2544
|
});
|
|
2389
2545
|
|
|
2390
2546
|
const ARealms = defineComponent({
|
|
2391
|
-
props:
|
|
2547
|
+
props: defineResourceCollectionVProps(),
|
|
2392
2548
|
slots: Object,
|
|
2393
|
-
emits:
|
|
2549
|
+
emits: defineResourceCollectionVEmitOptions(),
|
|
2394
2550
|
setup (props, ctx) {
|
|
2395
|
-
const { render } =
|
|
2551
|
+
const { render } = createResourceCollectionManager({
|
|
2396
2552
|
type: `${DomainType.REALM}`,
|
|
2397
2553
|
props,
|
|
2398
2554
|
setup: ctx
|
|
@@ -2557,7 +2713,7 @@ const AClientForm = defineComponent({
|
|
|
2557
2713
|
default: undefined
|
|
2558
2714
|
}
|
|
2559
2715
|
},
|
|
2560
|
-
emits:
|
|
2716
|
+
emits: defineResourceVEmitOptions(),
|
|
2561
2717
|
setup (props, ctx) {
|
|
2562
2718
|
const busy = ref(false);
|
|
2563
2719
|
const form = reactive({
|
|
@@ -2599,7 +2755,7 @@ const AClientForm = defineComponent({
|
|
|
2599
2755
|
maxLength: maxLength(256)
|
|
2600
2756
|
}
|
|
2601
2757
|
}, form);
|
|
2602
|
-
const manager =
|
|
2758
|
+
const manager = createResourceManager({
|
|
2603
2759
|
type: `${DomainType.CLIENT}`,
|
|
2604
2760
|
setup: ctx,
|
|
2605
2761
|
props
|
|
@@ -2872,11 +3028,11 @@ const AClientForm = defineComponent({
|
|
|
2872
3028
|
});
|
|
2873
3029
|
|
|
2874
3030
|
const AClients = defineComponent({
|
|
2875
|
-
props:
|
|
3031
|
+
props: defineResourceCollectionVProps(),
|
|
2876
3032
|
slots: Object,
|
|
2877
|
-
emits:
|
|
3033
|
+
emits: defineResourceCollectionVEmitOptions(),
|
|
2878
3034
|
setup (props, ctx) {
|
|
2879
|
-
const { render } =
|
|
3035
|
+
const { render } = createResourceCollectionManager({
|
|
2880
3036
|
type: `${DomainType.CLIENT}`,
|
|
2881
3037
|
props,
|
|
2882
3038
|
setup: ctx
|
|
@@ -2901,11 +3057,11 @@ const AClients = defineComponent({
|
|
|
2901
3057
|
});
|
|
2902
3058
|
|
|
2903
3059
|
const AClientScope = defineComponent({
|
|
2904
|
-
props:
|
|
2905
|
-
emits:
|
|
3060
|
+
props: defineResourceVProps(),
|
|
3061
|
+
emits: defineResourceVEmitOptions(),
|
|
2906
3062
|
slots: Object,
|
|
2907
3063
|
async setup (props, setup) {
|
|
2908
|
-
const manager =
|
|
3064
|
+
const manager = createResourceManager({
|
|
2909
3065
|
type: `${DomainType.CLIENT_SCOPE}`,
|
|
2910
3066
|
props,
|
|
2911
3067
|
setup
|
|
@@ -2920,11 +3076,11 @@ const AClientScope = defineComponent({
|
|
|
2920
3076
|
});
|
|
2921
3077
|
|
|
2922
3078
|
const AClientScopes = defineComponent({
|
|
2923
|
-
props:
|
|
3079
|
+
props: defineResourceCollectionVProps(),
|
|
2924
3080
|
slots: Object,
|
|
2925
|
-
emits:
|
|
3081
|
+
emits: defineResourceCollectionVEmitOptions(),
|
|
2926
3082
|
setup (props, ctx) {
|
|
2927
|
-
const { render } =
|
|
3083
|
+
const { render } = createResourceCollectionManager({
|
|
2928
3084
|
type: `${DomainType.CLIENT_SCOPE}`,
|
|
2929
3085
|
props,
|
|
2930
3086
|
setup: ctx
|
|
@@ -2977,7 +3133,7 @@ const AScopeForm = defineComponent({
|
|
|
2977
3133
|
type: Object
|
|
2978
3134
|
}
|
|
2979
3135
|
},
|
|
2980
|
-
emits:
|
|
3136
|
+
emits: defineResourceVEmitOptions(),
|
|
2981
3137
|
setup (props, ctx) {
|
|
2982
3138
|
const busy = ref(false);
|
|
2983
3139
|
const form = reactive({
|
|
@@ -3003,9 +3159,9 @@ const AScopeForm = defineComponent({
|
|
|
3003
3159
|
},
|
|
3004
3160
|
realm_id: {}
|
|
3005
3161
|
}, form);
|
|
3006
|
-
const store =
|
|
3162
|
+
const store = injectStore();
|
|
3007
3163
|
const storeRefs = storeToRefs(store);
|
|
3008
|
-
const manager =
|
|
3164
|
+
const manager = createResourceManager({
|
|
3009
3165
|
type: `${DomainType.SCOPE}`,
|
|
3010
3166
|
setup: ctx,
|
|
3011
3167
|
props
|
|
@@ -3124,11 +3280,11 @@ const AScopeForm = defineComponent({
|
|
|
3124
3280
|
});
|
|
3125
3281
|
|
|
3126
3282
|
const AScopes = defineComponent({
|
|
3127
|
-
props:
|
|
3283
|
+
props: defineResourceCollectionVProps(),
|
|
3128
3284
|
slots: Object,
|
|
3129
|
-
emits:
|
|
3285
|
+
emits: defineResourceCollectionVEmitOptions(),
|
|
3130
3286
|
setup (props, ctx) {
|
|
3131
|
-
const { render } =
|
|
3287
|
+
const { render } = createResourceCollectionManager({
|
|
3132
3288
|
type: DomainType.SCOPE,
|
|
3133
3289
|
props,
|
|
3134
3290
|
setup: ctx
|
|
@@ -3153,11 +3309,11 @@ const AScopes = defineComponent({
|
|
|
3153
3309
|
});
|
|
3154
3310
|
|
|
3155
3311
|
const AScope = defineComponent({
|
|
3156
|
-
props:
|
|
3157
|
-
emits:
|
|
3312
|
+
props: defineResourceVProps(),
|
|
3313
|
+
emits: defineResourceVEmitOptions(),
|
|
3158
3314
|
slots: Object,
|
|
3159
3315
|
async setup (props, setup) {
|
|
3160
|
-
const manager =
|
|
3316
|
+
const manager = createResourceManager({
|
|
3161
3317
|
type: `${DomainType.SCOPE}`,
|
|
3162
3318
|
props,
|
|
3163
3319
|
setup
|
|
@@ -3176,9 +3332,9 @@ const AClientScopeAssignment = defineComponent({
|
|
|
3176
3332
|
clientId: String,
|
|
3177
3333
|
scopeId: String
|
|
3178
3334
|
},
|
|
3179
|
-
emits:
|
|
3335
|
+
emits: defineResourceVEmitOptions(),
|
|
3180
3336
|
async setup (props, setup) {
|
|
3181
|
-
const manager =
|
|
3337
|
+
const manager = createResourceManager({
|
|
3182
3338
|
type: `${DomainType.CLIENT_SCOPE}`,
|
|
3183
3339
|
setup,
|
|
3184
3340
|
socket: {
|
|
@@ -3227,11 +3383,11 @@ const AClientScopeAssignments = defineComponent({
|
|
|
3227
3383
|
});
|
|
3228
3384
|
|
|
3229
3385
|
const AIdentityProvider = defineComponent({
|
|
3230
|
-
props:
|
|
3231
|
-
emits:
|
|
3386
|
+
props: defineResourceVProps(),
|
|
3387
|
+
emits: defineResourceVEmitOptions(),
|
|
3232
3388
|
slots: Object,
|
|
3233
3389
|
async setup (props, setup) {
|
|
3234
|
-
const manager =
|
|
3390
|
+
const manager = createResourceManager({
|
|
3235
3391
|
type: `${DomainType.IDENTITY_PROVIDER}`,
|
|
3236
3392
|
props,
|
|
3237
3393
|
setup
|
|
@@ -3850,9 +4006,9 @@ const AIdentityProviderLdapForm = defineComponent({
|
|
|
3850
4006
|
default: undefined
|
|
3851
4007
|
}
|
|
3852
4008
|
},
|
|
3853
|
-
emits:
|
|
4009
|
+
emits: defineResourceVEmitOptions(),
|
|
3854
4010
|
setup (props, ctx) {
|
|
3855
|
-
const manager =
|
|
4011
|
+
const manager = createResourceManager({
|
|
3856
4012
|
type: `${DomainType.IDENTITY_PROVIDER}`,
|
|
3857
4013
|
setup: ctx,
|
|
3858
4014
|
props
|
|
@@ -4067,7 +4223,11 @@ const AIdentityProviderPreset = defineComponent({
|
|
|
4067
4223
|
}
|
|
4068
4224
|
});
|
|
4069
4225
|
|
|
4070
|
-
|
|
4226
|
+
var _sfc_main = defineComponent({
|
|
4227
|
+
components: {
|
|
4228
|
+
AIdentityProviderPreset,
|
|
4229
|
+
AIdentityProviderProtocol
|
|
4230
|
+
},
|
|
4071
4231
|
props: {
|
|
4072
4232
|
protocol: {
|
|
4073
4233
|
type: String
|
|
@@ -4080,113 +4240,139 @@ const AIdentityProviderPicker = defineComponent({
|
|
|
4080
4240
|
'pick'
|
|
4081
4241
|
],
|
|
4082
4242
|
setup (props, setup) {
|
|
4083
|
-
const protocols =
|
|
4084
|
-
const presets =
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
id
|
|
4088
|
-
});
|
|
4089
|
-
return id;
|
|
4090
|
-
});
|
|
4091
|
-
Object.values(IdentityProviderPreset).map((id)=>{
|
|
4092
|
-
presets.push({
|
|
4093
|
-
id
|
|
4094
|
-
});
|
|
4095
|
-
return id;
|
|
4096
|
-
});
|
|
4097
|
-
const pick = (ctx)=>{
|
|
4098
|
-
setup.emit('pick', ctx);
|
|
4243
|
+
const protocols = Object.values(IdentityProviderProtocol);
|
|
4244
|
+
const presets = Object.values(IdentityProviderPreset);
|
|
4245
|
+
const pickProtocol = (protocol)=>{
|
|
4246
|
+
setup.emit('pick', 'protocol', protocol);
|
|
4099
4247
|
};
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
item: {
|
|
4109
|
-
class: [
|
|
4110
|
-
'me-1 list-item'
|
|
4111
|
-
],
|
|
4112
|
-
icon: false,
|
|
4113
|
-
content: (item)=>h(AIdentityProviderProtocol, {
|
|
4114
|
-
id: item.id
|
|
4115
|
-
}, {
|
|
4116
|
-
default: (element)=>[
|
|
4117
|
-
h('i', {
|
|
4118
|
-
class: [
|
|
4119
|
-
element.icon,
|
|
4120
|
-
'pe-1'
|
|
4121
|
-
]
|
|
4122
|
-
}),
|
|
4123
|
-
element.name,
|
|
4124
|
-
h('button', {
|
|
4125
|
-
class: 'btn btn-xs btn-dark ms-1',
|
|
4126
|
-
onClick ($event) {
|
|
4127
|
-
$event.preventDefault();
|
|
4128
|
-
pick({
|
|
4129
|
-
protocol: item.id
|
|
4130
|
-
});
|
|
4131
|
-
}
|
|
4132
|
-
}, [
|
|
4133
|
-
h('i', {
|
|
4134
|
-
class: 'fa fa-plus'
|
|
4135
|
-
})
|
|
4136
|
-
])
|
|
4137
|
-
]
|
|
4138
|
-
})
|
|
4139
|
-
}
|
|
4140
|
-
}
|
|
4141
|
-
});
|
|
4142
|
-
const protocolNodeConfigurationNode = buildList({
|
|
4143
|
-
data: presets,
|
|
4144
|
-
header: {
|
|
4145
|
-
content: h('h6', 'Presets')
|
|
4146
|
-
},
|
|
4147
|
-
body: {
|
|
4148
|
-
class: 'd-flex flex-row',
|
|
4149
|
-
item: {
|
|
4150
|
-
class: 'me-1 list-item',
|
|
4151
|
-
icon: false,
|
|
4152
|
-
content: (preset)=>h(AIdentityProviderPreset, {
|
|
4153
|
-
id: preset.id
|
|
4154
|
-
}, {
|
|
4155
|
-
default: (item)=>h('div', [
|
|
4156
|
-
h('i', {
|
|
4157
|
-
class: [
|
|
4158
|
-
item.icon,
|
|
4159
|
-
'pe-1'
|
|
4160
|
-
]
|
|
4161
|
-
}),
|
|
4162
|
-
item.name,
|
|
4163
|
-
h('button', {
|
|
4164
|
-
class: 'btn btn-xs btn-dark ms-1',
|
|
4165
|
-
onClick ($event) {
|
|
4166
|
-
$event.preventDefault();
|
|
4167
|
-
pick({
|
|
4168
|
-
preset: preset.id,
|
|
4169
|
-
protocol: getIdentityProviderProtocolForPreset(preset.id)
|
|
4170
|
-
});
|
|
4171
|
-
}
|
|
4172
|
-
}, [
|
|
4173
|
-
h('i', {
|
|
4174
|
-
class: 'fa fa-plus'
|
|
4175
|
-
})
|
|
4176
|
-
])
|
|
4177
|
-
])
|
|
4178
|
-
})
|
|
4179
|
-
}
|
|
4180
|
-
}
|
|
4181
|
-
});
|
|
4182
|
-
return [
|
|
4183
|
-
protocolNode,
|
|
4184
|
-
protocolNodeConfigurationNode
|
|
4185
|
-
];
|
|
4248
|
+
const pickPreset = (preset)=>{
|
|
4249
|
+
setup.emit('pick', 'preset', preset);
|
|
4250
|
+
};
|
|
4251
|
+
return {
|
|
4252
|
+
protocols,
|
|
4253
|
+
presets,
|
|
4254
|
+
pickProtocol,
|
|
4255
|
+
pickPreset
|
|
4186
4256
|
};
|
|
4187
4257
|
}
|
|
4188
4258
|
});
|
|
4189
4259
|
|
|
4260
|
+
var _export_sfc = (sfc, props) => {
|
|
4261
|
+
const target = sfc.__vccOpts || sfc;
|
|
4262
|
+
for (const [key, val] of props) {
|
|
4263
|
+
target[key] = val;
|
|
4264
|
+
}
|
|
4265
|
+
return target;
|
|
4266
|
+
};
|
|
4267
|
+
|
|
4268
|
+
const _hoisted_1 = {
|
|
4269
|
+
class: "d-flex flex-column gap-2"
|
|
4270
|
+
};
|
|
4271
|
+
const _hoisted_2 = {
|
|
4272
|
+
class: "d-flex flex-row gap-2 flex-wrap"
|
|
4273
|
+
};
|
|
4274
|
+
const _hoisted_3 = [
|
|
4275
|
+
"onClick"
|
|
4276
|
+
];
|
|
4277
|
+
const _hoisted_4 = {
|
|
4278
|
+
class: "d-flex flex-row gap-2 flex-wrap"
|
|
4279
|
+
};
|
|
4280
|
+
const _hoisted_5 = [
|
|
4281
|
+
"onClick"
|
|
4282
|
+
];
|
|
4283
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
4284
|
+
const _component_AIdentityProviderProtocol = resolveComponent("AIdentityProviderProtocol");
|
|
4285
|
+
const _component_AIdentityProviderPreset = resolveComponent("AIdentityProviderPreset");
|
|
4286
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
4287
|
+
createElementVNode("div", null, [
|
|
4288
|
+
_cache[0] || (_cache[0] = createElementVNode("h6", null, "Protocols", -1)),
|
|
4289
|
+
createElementVNode("div", _hoisted_2, [
|
|
4290
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.protocols, (item, key)=>{
|
|
4291
|
+
return openBlock(), createBlock(_component_AIdentityProviderProtocol, {
|
|
4292
|
+
key,
|
|
4293
|
+
id: item
|
|
4294
|
+
}, {
|
|
4295
|
+
default: withCtx((props)=>[
|
|
4296
|
+
createElementVNode("div", {
|
|
4297
|
+
class: normalizeClass([
|
|
4298
|
+
{
|
|
4299
|
+
"active": item === _ctx.protocol && !_ctx.preset
|
|
4300
|
+
},
|
|
4301
|
+
"d-flex flex-column gap-1 text-center identity-provider-picker-item"
|
|
4302
|
+
]),
|
|
4303
|
+
onClick: withModifiers(($event)=>_ctx.pickProtocol(item), [
|
|
4304
|
+
"prevent"
|
|
4305
|
+
])
|
|
4306
|
+
}, [
|
|
4307
|
+
createElementVNode("div", null, [
|
|
4308
|
+
createElementVNode("i", {
|
|
4309
|
+
class: normalizeClass([
|
|
4310
|
+
"fa-2x",
|
|
4311
|
+
props.icon
|
|
4312
|
+
])
|
|
4313
|
+
}, null, 2)
|
|
4314
|
+
]),
|
|
4315
|
+
createElementVNode("div", null, toDisplayString(props.name), 1)
|
|
4316
|
+
], 10, _hoisted_3)
|
|
4317
|
+
]),
|
|
4318
|
+
_: 2
|
|
4319
|
+
}, 1032, [
|
|
4320
|
+
"id"
|
|
4321
|
+
]);
|
|
4322
|
+
}), 128))
|
|
4323
|
+
])
|
|
4324
|
+
]),
|
|
4325
|
+
createElementVNode("div", null, [
|
|
4326
|
+
_cache[1] || (_cache[1] = createElementVNode("h6", null, "Presets", -1)),
|
|
4327
|
+
createElementVNode("div", _hoisted_4, [
|
|
4328
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.presets, (item, key)=>{
|
|
4329
|
+
return openBlock(), createBlock(_component_AIdentityProviderPreset, {
|
|
4330
|
+
key,
|
|
4331
|
+
id: item
|
|
4332
|
+
}, {
|
|
4333
|
+
default: withCtx((props)=>[
|
|
4334
|
+
createElementVNode("div", {
|
|
4335
|
+
class: normalizeClass([
|
|
4336
|
+
{
|
|
4337
|
+
"active": item === _ctx.preset
|
|
4338
|
+
},
|
|
4339
|
+
"d-flex flex-column gap-1 text-center identity-provider-picker-item"
|
|
4340
|
+
]),
|
|
4341
|
+
onClick: withModifiers(($event)=>_ctx.pickPreset(item), [
|
|
4342
|
+
"prevent"
|
|
4343
|
+
])
|
|
4344
|
+
}, [
|
|
4345
|
+
createElementVNode("div", null, [
|
|
4346
|
+
createElementVNode("i", {
|
|
4347
|
+
class: normalizeClass([
|
|
4348
|
+
"fa-2x",
|
|
4349
|
+
props.icon
|
|
4350
|
+
])
|
|
4351
|
+
}, null, 2)
|
|
4352
|
+
]),
|
|
4353
|
+
createElementVNode("div", null, toDisplayString(props.name), 1)
|
|
4354
|
+
], 10, _hoisted_5)
|
|
4355
|
+
]),
|
|
4356
|
+
_: 2
|
|
4357
|
+
}, 1032, [
|
|
4358
|
+
"id"
|
|
4359
|
+
]);
|
|
4360
|
+
}), 128))
|
|
4361
|
+
])
|
|
4362
|
+
])
|
|
4363
|
+
]);
|
|
4364
|
+
}
|
|
4365
|
+
var AIdentityProviderPicker = /* @__PURE__ */ _export_sfc(_sfc_main, [
|
|
4366
|
+
[
|
|
4367
|
+
"render",
|
|
4368
|
+
_sfc_render
|
|
4369
|
+
],
|
|
4370
|
+
[
|
|
4371
|
+
"__scopeId",
|
|
4372
|
+
"data-v-0df1e731"
|
|
4373
|
+
]
|
|
4374
|
+
]);
|
|
4375
|
+
|
|
4190
4376
|
const AIdentityProviderOAuth2ClientFields = defineComponent({
|
|
4191
4377
|
props: {
|
|
4192
4378
|
entity: {
|
|
@@ -4467,10 +4653,10 @@ const AIdentityProviderOAuth2Form = defineComponent({
|
|
|
4467
4653
|
type: String
|
|
4468
4654
|
}
|
|
4469
4655
|
},
|
|
4470
|
-
emits:
|
|
4656
|
+
emits: defineResourceVEmitOptions(),
|
|
4471
4657
|
setup (props, ctx) {
|
|
4472
4658
|
const apiClient = injectHTTPClient();
|
|
4473
|
-
const manager =
|
|
4659
|
+
const manager = createResourceManager({
|
|
4474
4660
|
type: `${DomainType.IDENTITY_PROVIDER}`,
|
|
4475
4661
|
setup: ctx,
|
|
4476
4662
|
props
|
|
@@ -4724,17 +4910,16 @@ const AIdentityProviderForm = defineComponent({
|
|
|
4724
4910
|
set();
|
|
4725
4911
|
onChange(updatedAt, ()=>set());
|
|
4726
4912
|
const renderPicker = ()=>h(AIdentityProviderPicker, {
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
preset.value = value.preset;
|
|
4735
|
-
} else {
|
|
4736
|
-
preset.value = null;
|
|
4913
|
+
protocol: protocol.value,
|
|
4914
|
+
preset: preset.value,
|
|
4915
|
+
onPick (type, value) {
|
|
4916
|
+
if (type === 'preset') {
|
|
4917
|
+
preset.value = value;
|
|
4918
|
+
protocol.value = `${getIdentityProviderProtocolForPreset(value)}`;
|
|
4919
|
+
return;
|
|
4737
4920
|
}
|
|
4921
|
+
protocol.value = value;
|
|
4922
|
+
preset.value = null;
|
|
4738
4923
|
}
|
|
4739
4924
|
});
|
|
4740
4925
|
const render = (node)=>{
|
|
@@ -4806,11 +4991,11 @@ const AIdentityProviderForm = defineComponent({
|
|
|
4806
4991
|
});
|
|
4807
4992
|
|
|
4808
4993
|
const AIdentityProviders = defineComponent({
|
|
4809
|
-
props:
|
|
4994
|
+
props: defineResourceCollectionVProps(),
|
|
4810
4995
|
slots: Object,
|
|
4811
|
-
emits:
|
|
4996
|
+
emits: defineResourceCollectionVEmitOptions(),
|
|
4812
4997
|
setup (props, ctx) {
|
|
4813
|
-
const { render } =
|
|
4998
|
+
const { render } = createResourceCollectionManager({
|
|
4814
4999
|
type: `${DomainType.IDENTITY_PROVIDER}`,
|
|
4815
5000
|
props,
|
|
4816
5001
|
setup: ctx
|
|
@@ -4878,7 +5063,7 @@ const AIdentityProviderRoleAssignment = defineComponent({
|
|
|
4878
5063
|
required: true
|
|
4879
5064
|
}
|
|
4880
5065
|
},
|
|
4881
|
-
emits:
|
|
5066
|
+
emits: defineResourceVEmitOptions(),
|
|
4882
5067
|
async setup (props, setup) {
|
|
4883
5068
|
const display = ref(false);
|
|
4884
5069
|
const toggleDisplay = ()=>{
|
|
@@ -4906,7 +5091,7 @@ const AIdentityProviderRoleAssignment = defineComponent({
|
|
|
4906
5091
|
key: TranslatorTranslationDefaultKey.VALUE_IS_REGEX
|
|
4907
5092
|
}
|
|
4908
5093
|
]);
|
|
4909
|
-
const manager =
|
|
5094
|
+
const manager = createResourceManager({
|
|
4910
5095
|
type: `${DomainType.IDENTITY_PROVIDER_ROLE_MAPPING}`,
|
|
4911
5096
|
setup,
|
|
4912
5097
|
socket: {
|
|
@@ -5087,7 +5272,7 @@ const ARoleForm = defineComponent({
|
|
|
5087
5272
|
default: undefined
|
|
5088
5273
|
}
|
|
5089
5274
|
},
|
|
5090
|
-
emits:
|
|
5275
|
+
emits: defineResourceVEmitOptions(),
|
|
5091
5276
|
setup (props, ctx) {
|
|
5092
5277
|
const busy = ref(false);
|
|
5093
5278
|
const form = reactive({
|
|
@@ -5112,9 +5297,9 @@ const ARoleForm = defineComponent({
|
|
|
5112
5297
|
},
|
|
5113
5298
|
realm_id: {}
|
|
5114
5299
|
}, form);
|
|
5115
|
-
const store =
|
|
5300
|
+
const store = injectStore();
|
|
5116
5301
|
const storeRefs = storeToRefs(store);
|
|
5117
|
-
const manager =
|
|
5302
|
+
const manager = createResourceManager({
|
|
5118
5303
|
type: `${DomainType.ROLE}`,
|
|
5119
5304
|
setup: ctx,
|
|
5120
5305
|
props
|
|
@@ -5218,11 +5403,11 @@ const ARoleForm = defineComponent({
|
|
|
5218
5403
|
});
|
|
5219
5404
|
|
|
5220
5405
|
const ARoles = defineComponent({
|
|
5221
|
-
props:
|
|
5406
|
+
props: defineResourceCollectionVProps(),
|
|
5222
5407
|
slots: Object,
|
|
5223
|
-
emits:
|
|
5408
|
+
emits: defineResourceCollectionVEmitOptions(),
|
|
5224
5409
|
setup (props, ctx) {
|
|
5225
|
-
const { render } =
|
|
5410
|
+
const { render } = createResourceCollectionManager({
|
|
5226
5411
|
type: `${DomainType.ROLE}`,
|
|
5227
5412
|
props,
|
|
5228
5413
|
setup: ctx
|
|
@@ -5247,11 +5432,11 @@ const ARoles = defineComponent({
|
|
|
5247
5432
|
});
|
|
5248
5433
|
|
|
5249
5434
|
const ARole = defineComponent({
|
|
5250
|
-
props:
|
|
5251
|
-
emits:
|
|
5435
|
+
props: defineResourceVProps(),
|
|
5436
|
+
emits: defineResourceVEmitOptions(),
|
|
5252
5437
|
slots: Object,
|
|
5253
5438
|
async setup (props, setup) {
|
|
5254
|
-
const manager =
|
|
5439
|
+
const manager = createResourceManager({
|
|
5255
5440
|
type: `${DomainType.ROLE}`,
|
|
5256
5441
|
props,
|
|
5257
5442
|
setup
|
|
@@ -5287,11 +5472,11 @@ const AIdentityProviderRoleAssignments = defineComponent({
|
|
|
5287
5472
|
});
|
|
5288
5473
|
|
|
5289
5474
|
const APermission = defineComponent({
|
|
5290
|
-
props:
|
|
5291
|
-
emits:
|
|
5475
|
+
props: defineResourceVProps(),
|
|
5476
|
+
emits: defineResourceVEmitOptions(),
|
|
5292
5477
|
slots: Object,
|
|
5293
5478
|
async setup (props, setup) {
|
|
5294
|
-
const manager =
|
|
5479
|
+
const manager = createResourceManager({
|
|
5295
5480
|
type: `${DomainType.PERMISSION}`,
|
|
5296
5481
|
setup,
|
|
5297
5482
|
props
|
|
@@ -5343,7 +5528,7 @@ const APermissionForm = defineComponent({
|
|
|
5343
5528
|
type: Object
|
|
5344
5529
|
}
|
|
5345
5530
|
},
|
|
5346
|
-
emits:
|
|
5531
|
+
emits: defineResourceVEmitOptions(),
|
|
5347
5532
|
setup (props, ctx) {
|
|
5348
5533
|
const busy = ref(false);
|
|
5349
5534
|
const form = reactive({
|
|
@@ -5368,9 +5553,9 @@ const APermissionForm = defineComponent({
|
|
|
5368
5553
|
},
|
|
5369
5554
|
realm_id: {}
|
|
5370
5555
|
}, form);
|
|
5371
|
-
const store =
|
|
5556
|
+
const store = injectStore();
|
|
5372
5557
|
const storeRefs = storeToRefs(store);
|
|
5373
|
-
const manager =
|
|
5558
|
+
const manager = createResourceManager({
|
|
5374
5559
|
type: `${DomainType.PERMISSION}`,
|
|
5375
5560
|
setup: ctx,
|
|
5376
5561
|
props
|
|
@@ -5477,11 +5662,11 @@ const APermissionForm = defineComponent({
|
|
|
5477
5662
|
});
|
|
5478
5663
|
|
|
5479
5664
|
const APermissions = defineComponent({
|
|
5480
|
-
props:
|
|
5665
|
+
props: defineResourceCollectionVProps(),
|
|
5481
5666
|
slots: Object,
|
|
5482
|
-
emits:
|
|
5667
|
+
emits: defineResourceCollectionVEmitOptions(),
|
|
5483
5668
|
setup (props, setup) {
|
|
5484
|
-
const { render } =
|
|
5669
|
+
const { render } = createResourceCollectionManager({
|
|
5485
5670
|
type: `${DomainType.PERMISSION}`,
|
|
5486
5671
|
props,
|
|
5487
5672
|
setup
|
|
@@ -5510,9 +5695,9 @@ const ARobotPermissionAssignment = defineComponent({
|
|
|
5510
5695
|
robotId: String,
|
|
5511
5696
|
permissionId: String
|
|
5512
5697
|
},
|
|
5513
|
-
emits:
|
|
5698
|
+
emits: defineResourceVEmitOptions(),
|
|
5514
5699
|
async setup (props, setup) {
|
|
5515
|
-
const manager =
|
|
5700
|
+
const manager = createResourceManager({
|
|
5516
5701
|
type: `${DomainType.ROBOT_PERMISSION}`,
|
|
5517
5702
|
setup,
|
|
5518
5703
|
socket: {
|
|
@@ -5542,11 +5727,11 @@ const ARobotPermissionAssignment = defineComponent({
|
|
|
5542
5727
|
});
|
|
5543
5728
|
|
|
5544
5729
|
const ARobot = defineComponent({
|
|
5545
|
-
props:
|
|
5546
|
-
emits:
|
|
5730
|
+
props: defineResourceVProps(),
|
|
5731
|
+
emits: defineResourceVEmitOptions(),
|
|
5547
5732
|
slots: Object,
|
|
5548
5733
|
async setup (props, setup) {
|
|
5549
|
-
const manager =
|
|
5734
|
+
const manager = createResourceManager({
|
|
5550
5735
|
type: `${DomainType.ROBOT}`,
|
|
5551
5736
|
props,
|
|
5552
5737
|
setup
|
|
@@ -5575,7 +5760,7 @@ const ARobotForm = defineComponent({
|
|
|
5575
5760
|
default: undefined
|
|
5576
5761
|
}
|
|
5577
5762
|
},
|
|
5578
|
-
emits:
|
|
5763
|
+
emits: defineResourceVEmitOptions(),
|
|
5579
5764
|
setup (props, ctx) {
|
|
5580
5765
|
const busy = ref(false);
|
|
5581
5766
|
const form = reactive({
|
|
@@ -5602,7 +5787,7 @@ const ARobotForm = defineComponent({
|
|
|
5602
5787
|
maxLength: maxLength(256)
|
|
5603
5788
|
}
|
|
5604
5789
|
}, form);
|
|
5605
|
-
const manager =
|
|
5790
|
+
const manager = createResourceManager({
|
|
5606
5791
|
type: `${DomainType.ROBOT}`,
|
|
5607
5792
|
setup: ctx,
|
|
5608
5793
|
props
|
|
@@ -5804,11 +5989,11 @@ const ARobotForm = defineComponent({
|
|
|
5804
5989
|
});
|
|
5805
5990
|
|
|
5806
5991
|
const ARobots = defineComponent({
|
|
5807
|
-
props:
|
|
5992
|
+
props: defineResourceCollectionVProps(),
|
|
5808
5993
|
slots: Object,
|
|
5809
|
-
emits:
|
|
5994
|
+
emits: defineResourceCollectionVEmitOptions(),
|
|
5810
5995
|
setup (props, ctx) {
|
|
5811
|
-
const { render } =
|
|
5996
|
+
const { render } = createResourceCollectionManager({
|
|
5812
5997
|
type: `${DomainType.ROBOT}`,
|
|
5813
5998
|
props,
|
|
5814
5999
|
setup: ctx
|
|
@@ -5856,9 +6041,9 @@ const ARolePermissionAssignment = defineComponent({
|
|
|
5856
6041
|
roleId: String,
|
|
5857
6042
|
permissionId: String
|
|
5858
6043
|
},
|
|
5859
|
-
emits:
|
|
6044
|
+
emits: defineResourceVEmitOptions(),
|
|
5860
6045
|
async setup (props, setup) {
|
|
5861
|
-
const manager =
|
|
6046
|
+
const manager = createResourceManager({
|
|
5862
6047
|
type: `${DomainType.ROLE_PERMISSION}`,
|
|
5863
6048
|
setup,
|
|
5864
6049
|
socket: {
|
|
@@ -5930,9 +6115,9 @@ const AUserPermissionAssignment = defineComponent({
|
|
|
5930
6115
|
userId: String,
|
|
5931
6116
|
permissionId: String
|
|
5932
6117
|
},
|
|
5933
|
-
emits:
|
|
6118
|
+
emits: defineResourceVEmitOptions(),
|
|
5934
6119
|
async setup (props, setup) {
|
|
5935
|
-
const manager =
|
|
6120
|
+
const manager = createResourceManager({
|
|
5936
6121
|
type: `${DomainType.USER_PERMISSION}`,
|
|
5937
6122
|
setup,
|
|
5938
6123
|
socket: {
|
|
@@ -5981,11 +6166,11 @@ const AUserPermissionAssignments = defineComponent({
|
|
|
5981
6166
|
});
|
|
5982
6167
|
|
|
5983
6168
|
const AUser = defineComponent({
|
|
5984
|
-
props:
|
|
5985
|
-
emits:
|
|
6169
|
+
props: defineResourceVProps(),
|
|
6170
|
+
emits: defineResourceVEmitOptions(),
|
|
5986
6171
|
slots: Object,
|
|
5987
6172
|
async setup (props, setup) {
|
|
5988
|
-
const manager =
|
|
6173
|
+
const manager = createResourceManager({
|
|
5989
6174
|
type: `${DomainType.USER}`,
|
|
5990
6175
|
props,
|
|
5991
6176
|
setup
|
|
@@ -6014,7 +6199,7 @@ const AUserForm = defineComponent({
|
|
|
6014
6199
|
default: true
|
|
6015
6200
|
}
|
|
6016
6201
|
},
|
|
6017
|
-
emits:
|
|
6202
|
+
emits: defineResourceVEmitOptions(),
|
|
6018
6203
|
async setup (props, ctx) {
|
|
6019
6204
|
const busy = ref(false);
|
|
6020
6205
|
const form = reactive({
|
|
@@ -6046,7 +6231,7 @@ const AUserForm = defineComponent({
|
|
|
6046
6231
|
required
|
|
6047
6232
|
}
|
|
6048
6233
|
}, form);
|
|
6049
|
-
const manager =
|
|
6234
|
+
const manager = createResourceManager({
|
|
6050
6235
|
type: `${DomainType.USER}`,
|
|
6051
6236
|
setup: ctx,
|
|
6052
6237
|
props
|
|
@@ -6258,11 +6443,11 @@ const AUserForm = defineComponent({
|
|
|
6258
6443
|
});
|
|
6259
6444
|
|
|
6260
6445
|
const AUsers = defineComponent({
|
|
6261
|
-
props:
|
|
6446
|
+
props: defineResourceCollectionVProps(),
|
|
6262
6447
|
slots: Object,
|
|
6263
|
-
emits:
|
|
6448
|
+
emits: defineResourceCollectionVEmitOptions(),
|
|
6264
6449
|
setup (props, ctx) {
|
|
6265
|
-
const { render } =
|
|
6450
|
+
const { render } = createResourceCollectionManager({
|
|
6266
6451
|
type: `${DomainType.USER}`,
|
|
6267
6452
|
props,
|
|
6268
6453
|
setup: ctx
|
|
@@ -6443,9 +6628,9 @@ const ARobotRoleAssignment = defineComponent({
|
|
|
6443
6628
|
roleId: String,
|
|
6444
6629
|
robotId: String
|
|
6445
6630
|
},
|
|
6446
|
-
emits:
|
|
6631
|
+
emits: defineResourceVEmitOptions(),
|
|
6447
6632
|
async setup (props, setup) {
|
|
6448
|
-
const manager =
|
|
6633
|
+
const manager = createResourceManager({
|
|
6449
6634
|
type: `${DomainType.ROBOT_ROLE}`,
|
|
6450
6635
|
setup,
|
|
6451
6636
|
socket: {
|
|
@@ -6510,9 +6695,9 @@ const AUserRoleAssignment = defineComponent({
|
|
|
6510
6695
|
roleId: String,
|
|
6511
6696
|
userId: String
|
|
6512
6697
|
},
|
|
6513
|
-
emits:
|
|
6698
|
+
emits: defineResourceVEmitOptions(),
|
|
6514
6699
|
async setup (props, setup) {
|
|
6515
|
-
const manager =
|
|
6700
|
+
const manager = createResourceManager({
|
|
6516
6701
|
type: `${DomainType.USER_ROLE}`,
|
|
6517
6702
|
setup,
|
|
6518
6703
|
socket: {
|
|
@@ -7114,5 +7299,5 @@ var index = {
|
|
|
7114
7299
|
install
|
|
7115
7300
|
};
|
|
7116
7301
|
|
|
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,
|
|
7302
|
+
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, HTTPClientSymbol, LanguageSwitcherDropdown, ResourceRecordError, STORE_ID, SocketClientSymbol, StoreDispatcherEventName, TranslatorTranslationClientKey, TranslatorTranslationDefaultKey, TranslatorTranslationGroup, TranslatorTranslationVuecsKey, VuelidateCustomRule, VuelidateCustomRuleKey, buildFormSubmitWithTranslations, buildListCreatedHandler, buildListDeletedHandler, buildListUpdatedHandler, buildResourceVSlotProps, createFormSubmitTranslations, createPermissionCheckerReactiveFn, createResourceCollectionManager, createResourceManager, createStore, createStoreDispatcher, index as default, defineResourceCollectionVEmitOptions, defineResourceCollectionVProps, defineResourceVEmitOptions, defineResourceVProps, extendObjectProperties, extractVuelidateResultsFromChild, getVuelidateSeverity, hasHTTPClient, hasNormalizedSlot, hasStoreFactory, initFormAttributesFromSource, inject$1 as inject, injectHTTPClient, injectSocketManager, injectStore, injectStoreDispatcher, injectStoreFactory, injectTranslatorLocale, install, installHTTPClient, installSocketManager, installStore, installTranslator, isQuerySortedDescByDate, isSocketManagerUsable, mergeListOptions, normalizeSlot, onChange, provide, provideHTTPClient, provideSocketManager, provideStoreDispatcher, provideStoreFactory, renderEntityAssignAction, storeToRefs, useIsEditing, usePermissionCheck, useRealmResourceWritableCheck, useTranslation, useTranslationsForBaseValidation, useTranslationsForGroup, useTranslationsForNestedValidation, useUpdatedAt, wrapFnWithBusyState };
|
|
7118
7303
|
//# sourceMappingURL=index.mjs.map
|