@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.cjs
CHANGED
|
@@ -94,6 +94,91 @@ class PolicyEngine extends kit.PolicyEngine {
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
/*
|
|
98
|
+
* Copyright (c) 2024.
|
|
99
|
+
* Author Peter Placzek (tada5hi)
|
|
100
|
+
* For the full copyright and license information,
|
|
101
|
+
* view the LICENSE file that was distributed with this source code.
|
|
102
|
+
*/ var StoreDispatcherEventName = /*#__PURE__*/ function(StoreDispatcherEventName) {
|
|
103
|
+
StoreDispatcherEventName["LOGGING_IN"] = "loggingIn";
|
|
104
|
+
StoreDispatcherEventName["LOGGED_IN"] = "loggedIn";
|
|
105
|
+
StoreDispatcherEventName["LOGGING_OUT"] = "loggingOut";
|
|
106
|
+
StoreDispatcherEventName["LOGGED_OUT"] = "loggedOut";
|
|
107
|
+
StoreDispatcherEventName["RESOLVING"] = "resolving";
|
|
108
|
+
StoreDispatcherEventName["RESOLVED"] = "resolved";
|
|
109
|
+
StoreDispatcherEventName["ACCESS_TOKEN_UPDATED"] = "accessTokenUpdated";
|
|
110
|
+
StoreDispatcherEventName["ACCESS_TOKEN_EXPIRE_DATE_UPDATED"] = "accessTokenExpireDateUpdated";
|
|
111
|
+
StoreDispatcherEventName["REFRESH_TOKEN_UPDATED"] = "refreshTokenUpdated";
|
|
112
|
+
StoreDispatcherEventName["USER_UPDATED"] = "userUpdated";
|
|
113
|
+
StoreDispatcherEventName["REALM_UPDATED"] = "realmUpdated";
|
|
114
|
+
StoreDispatcherEventName["REALM_MANAGEMENT_UPDATED"] = "realmManagementUpdated";
|
|
115
|
+
return StoreDispatcherEventName;
|
|
116
|
+
}({});
|
|
117
|
+
|
|
118
|
+
// src/event-emitter.ts
|
|
119
|
+
var EventEmitter = class {
|
|
120
|
+
on(type, handler) {
|
|
121
|
+
if (!this.all.has(type)) {
|
|
122
|
+
this.all.set(type, []);
|
|
123
|
+
}
|
|
124
|
+
const handlers = this.all.get(type);
|
|
125
|
+
handlers.push(handler);
|
|
126
|
+
return ()=>handlers.splice(handlers.indexOf(handler) >>> 0, 1);
|
|
127
|
+
}
|
|
128
|
+
off(type, handler) {
|
|
129
|
+
if (!type) {
|
|
130
|
+
return this.all.clear();
|
|
131
|
+
}
|
|
132
|
+
const handlers = this.all.get(type);
|
|
133
|
+
if (handlers) {
|
|
134
|
+
if (handler) {
|
|
135
|
+
handlers.splice(handlers.indexOf(handler) >>> 0, 1);
|
|
136
|
+
} else {
|
|
137
|
+
this.all.delete(type);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Invoke all handlers for the given type.
|
|
143
|
+
* If present, `'*'` handlers are invoked after type-matched handlers.
|
|
144
|
+
*
|
|
145
|
+
* Note: Manually firing `'*'` handlers is not supported.
|
|
146
|
+
*
|
|
147
|
+
* @param type The event type to invoke
|
|
148
|
+
* @param payload Any value to each handler
|
|
149
|
+
*/ emit(type, ...payload) {
|
|
150
|
+
let handlers = this.all.get(type);
|
|
151
|
+
handlers?.slice().map((handler)=>{
|
|
152
|
+
handler(...payload);
|
|
153
|
+
});
|
|
154
|
+
handlers = this.all.get("*");
|
|
155
|
+
if (handlers) {
|
|
156
|
+
handlers.slice().map((handler)=>{
|
|
157
|
+
handler(type, payload);
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
constructor(all){
|
|
162
|
+
this.all = all || /* @__PURE__ */ new Map();
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
function createStoreDispatcher() {
|
|
167
|
+
return new EventEmitter();
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const sym$1 = Symbol.for('AuthupStoreEventBus');
|
|
171
|
+
function injectStoreDispatcher(app) {
|
|
172
|
+
const instance = inject$1(sym$1, app);
|
|
173
|
+
if (!instance) {
|
|
174
|
+
throw new Error('The store dispatcher has not been injected in the app context.');
|
|
175
|
+
}
|
|
176
|
+
return instance;
|
|
177
|
+
}
|
|
178
|
+
function provideStoreDispatcher(eventBus, app) {
|
|
179
|
+
provide(sym$1, eventBus, app);
|
|
180
|
+
}
|
|
181
|
+
|
|
97
182
|
function createPromiseShareWrapperFn(fn) {
|
|
98
183
|
let promise;
|
|
99
184
|
return (...args)=>{
|
|
@@ -111,41 +196,45 @@ function createPromiseShareWrapperFn(fn) {
|
|
|
111
196
|
return promise;
|
|
112
197
|
};
|
|
113
198
|
}
|
|
114
|
-
function createStore(context
|
|
199
|
+
function createStore(context) {
|
|
115
200
|
const client = new coreHttpKit.Client({
|
|
116
201
|
baseURL: context.baseURL
|
|
117
202
|
});
|
|
118
|
-
const
|
|
119
|
-
const
|
|
120
|
-
|
|
203
|
+
const cookiesRead = vue.ref(false);
|
|
204
|
+
const setCookiesRead = (value)=>{
|
|
205
|
+
cookiesRead.value = value;
|
|
121
206
|
};
|
|
122
207
|
// --------------------------------------------------------------------
|
|
123
|
-
const accessToken = vue.ref(
|
|
208
|
+
const accessToken = vue.ref(null);
|
|
124
209
|
const setAccessToken = (input)=>{
|
|
125
210
|
accessToken.value = input;
|
|
211
|
+
context.dispatcher.emit(StoreDispatcherEventName.ACCESS_TOKEN_UPDATED, input);
|
|
126
212
|
};
|
|
127
213
|
// --------------------------------------------------------------------
|
|
128
|
-
const accessTokenExpireDate = vue.ref(
|
|
214
|
+
const accessTokenExpireDate = vue.ref(null);
|
|
129
215
|
const setAccessTokenExpireDate = (input)=>{
|
|
130
216
|
if (typeof input === 'number' || typeof input === 'string') {
|
|
131
217
|
accessTokenExpireDate.value = new Date(input); // verify microseconds or seconds
|
|
132
|
-
|
|
218
|
+
} else {
|
|
219
|
+
accessTokenExpireDate.value = input;
|
|
133
220
|
}
|
|
134
|
-
accessTokenExpireDate.value
|
|
221
|
+
context.dispatcher.emit(StoreDispatcherEventName.ACCESS_TOKEN_EXPIRE_DATE_UPDATED, accessTokenExpireDate.value);
|
|
135
222
|
};
|
|
136
223
|
// --------------------------------------------------------------------
|
|
137
|
-
const refreshToken = vue.ref(
|
|
224
|
+
const refreshToken = vue.ref(null);
|
|
138
225
|
const setRefreshToken = (input)=>{
|
|
139
226
|
refreshToken.value = input;
|
|
227
|
+
context.dispatcher.emit(StoreDispatcherEventName.REFRESH_TOKEN_UPDATED, input);
|
|
140
228
|
};
|
|
141
229
|
// --------------------------------------------------------------------
|
|
142
|
-
const user = vue.ref(
|
|
143
|
-
const userId = vue.computed(()=>user.value ? user.value.id :
|
|
144
|
-
const setUser = (
|
|
145
|
-
user.value =
|
|
230
|
+
const user = vue.ref(null);
|
|
231
|
+
const userId = vue.computed(()=>user.value ? user.value.id : null);
|
|
232
|
+
const setUser = (input)=>{
|
|
233
|
+
user.value = input;
|
|
234
|
+
context.dispatcher.emit(StoreDispatcherEventName.USER_UPDATED, input);
|
|
146
235
|
};
|
|
147
236
|
// --------------------------------------------------------------------
|
|
148
|
-
const realm = vue.ref(
|
|
237
|
+
const realm = vue.ref(null);
|
|
149
238
|
const realmId = vue.computed(()=>realm.value ? realm.value.id : undefined);
|
|
150
239
|
const realmName = vue.computed(()=>realm.value ? realm.value.name : undefined);
|
|
151
240
|
const realmIsRoot = vue.computed(()=>{
|
|
@@ -154,14 +243,16 @@ function createStore(context = {}) {
|
|
|
154
243
|
}
|
|
155
244
|
return false;
|
|
156
245
|
});
|
|
157
|
-
const setRealm = (
|
|
158
|
-
realm.value =
|
|
246
|
+
const setRealm = (input)=>{
|
|
247
|
+
realm.value = input;
|
|
248
|
+
context.dispatcher.emit(StoreDispatcherEventName.REALM_UPDATED, input);
|
|
159
249
|
};
|
|
160
|
-
const realmManagement = vue.ref(
|
|
250
|
+
const realmManagement = vue.ref(null);
|
|
161
251
|
const realmManagementId = vue.computed(()=>realmManagement.value ? realmManagement.value.id : realmId.value);
|
|
162
252
|
const realmManagementName = vue.computed(()=>realmManagement.value ? realmManagement.value.name : realmName.value);
|
|
163
|
-
const setRealmManagement = (
|
|
164
|
-
realmManagement.value =
|
|
253
|
+
const setRealmManagement = (input)=>{
|
|
254
|
+
realmManagement.value = input;
|
|
255
|
+
context.dispatcher.emit(StoreDispatcherEventName.REALM_MANAGEMENT_UPDATED, input);
|
|
165
256
|
};
|
|
166
257
|
// --------------------------------------------------------------------
|
|
167
258
|
const permissionRepository = new kit.PermissionMemoryProvider();
|
|
@@ -170,6 +261,38 @@ function createStore(context = {}) {
|
|
|
170
261
|
policyEngine: new PolicyEngine()
|
|
171
262
|
});
|
|
172
263
|
// --------------------------------------------------------------------
|
|
264
|
+
const cleanup = async ()=>{
|
|
265
|
+
const tempAccessToken = accessToken.value;
|
|
266
|
+
const tempRefreshToken = refreshToken.value;
|
|
267
|
+
setAccessToken(null);
|
|
268
|
+
setAccessTokenExpireDate(null);
|
|
269
|
+
setRefreshToken(null);
|
|
270
|
+
setUser(null);
|
|
271
|
+
setRealm(null);
|
|
272
|
+
setRealmManagement(null);
|
|
273
|
+
permissionRepository.setMany([]);
|
|
274
|
+
tokenResolved.value = false;
|
|
275
|
+
userResolved.value = false;
|
|
276
|
+
try {
|
|
277
|
+
if (tempAccessToken) {
|
|
278
|
+
await client.token.revoke({
|
|
279
|
+
token: tempAccessToken
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
} catch (e) {
|
|
283
|
+
// ...
|
|
284
|
+
}
|
|
285
|
+
try {
|
|
286
|
+
if (tempRefreshToken) {
|
|
287
|
+
await client.token.revoke({
|
|
288
|
+
token: tempRefreshToken
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
} catch (e) {
|
|
292
|
+
// ...
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
// --------------------------------------------------------------------
|
|
173
296
|
const userResolved = vue.ref(false);
|
|
174
297
|
const resolveUser = async ()=>{
|
|
175
298
|
if (!accessToken.value || userResolved.value) {
|
|
@@ -214,29 +337,38 @@ function createStore(context = {}) {
|
|
|
214
337
|
});
|
|
215
338
|
};
|
|
216
339
|
// --------------------------------------------------------------------
|
|
217
|
-
const
|
|
340
|
+
const applyTokenGrantResponse = (response)=>{
|
|
218
341
|
const expireDate = new Date(Date.now() + response.expires_in * 1000);
|
|
219
342
|
setAccessTokenExpireDate(expireDate);
|
|
220
343
|
setAccessToken(response.access_token);
|
|
221
|
-
|
|
344
|
+
if (response.refresh_token) {
|
|
345
|
+
setRefreshToken(response.refresh_token);
|
|
346
|
+
} else {
|
|
347
|
+
setRefreshToken(null);
|
|
348
|
+
}
|
|
222
349
|
};
|
|
223
350
|
// --------------------------------------------------------------------
|
|
224
351
|
const refreshSession = createPromiseShareWrapperFn(async ()=>{
|
|
225
352
|
if (!refreshToken.value) {
|
|
226
353
|
throw new kit.TokenError('The access token can not be renewed.');
|
|
227
354
|
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
}
|
|
355
|
+
try {
|
|
356
|
+
const response = await client.token.createWithRefreshToken({
|
|
357
|
+
refresh_token: refreshToken.value
|
|
358
|
+
});
|
|
359
|
+
applyTokenGrantResponse(response);
|
|
360
|
+
} catch (e) {
|
|
361
|
+
await cleanup();
|
|
362
|
+
throw e;
|
|
363
|
+
} finally{
|
|
234
364
|
tokenResolved.value = false;
|
|
235
365
|
userResolved.value = false;
|
|
236
|
-
}
|
|
366
|
+
}
|
|
237
367
|
});
|
|
238
368
|
// --------------------------------------------------------------------
|
|
369
|
+
// todo: rename to reload() ?
|
|
239
370
|
const resolveInternal = async ()=>{
|
|
371
|
+
context.dispatcher.emit(StoreDispatcherEventName.RESOLVING);
|
|
240
372
|
try {
|
|
241
373
|
if (!accessToken.value && refreshToken.value) {
|
|
242
374
|
await refreshSession();
|
|
@@ -250,49 +382,44 @@ function createStore(context = {}) {
|
|
|
250
382
|
} catch (e) {
|
|
251
383
|
if (coreHttpKit.isClientTokenExpiredError(e) && refreshToken.value) {
|
|
252
384
|
await refreshSession();
|
|
253
|
-
|
|
385
|
+
await resolveToken();
|
|
386
|
+
await resolveUser();
|
|
387
|
+
} else {
|
|
388
|
+
throw e;
|
|
254
389
|
}
|
|
255
|
-
throw e;
|
|
256
390
|
}
|
|
257
|
-
|
|
391
|
+
context.dispatcher.emit(StoreDispatcherEventName.RESOLVED);
|
|
258
392
|
};
|
|
259
393
|
const resolve = createPromiseShareWrapperFn(resolveInternal);
|
|
260
394
|
const loggedIn = vue.computed(()=>!!accessToken.value);
|
|
261
395
|
const login = async (ctx)=>{
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
throw e;
|
|
275
|
-
}
|
|
396
|
+
context.dispatcher.emit(StoreDispatcherEventName.LOGGING_IN);
|
|
397
|
+
const response = await client.token.createWithPasswordGrant({
|
|
398
|
+
username: ctx.name,
|
|
399
|
+
password: ctx.password,
|
|
400
|
+
...realmId.value ? {
|
|
401
|
+
realm_id: ctx.realmId
|
|
402
|
+
} : {}
|
|
403
|
+
});
|
|
404
|
+
applyTokenGrantResponse(response);
|
|
405
|
+
await resolveToken();
|
|
406
|
+
await resolveUser();
|
|
407
|
+
context.dispatcher.emit(StoreDispatcherEventName.LOGGED_IN);
|
|
276
408
|
};
|
|
277
|
-
const logout = ()=>{
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
setUser(undefined);
|
|
282
|
-
setRealm(undefined);
|
|
283
|
-
setRealmManagement(undefined);
|
|
284
|
-
tokenResolved.value = false;
|
|
285
|
-
userResolved.value = false;
|
|
409
|
+
const logout = async ()=>{
|
|
410
|
+
context.dispatcher.emit(StoreDispatcherEventName.LOGGING_OUT);
|
|
411
|
+
await cleanup();
|
|
412
|
+
context.dispatcher.emit(StoreDispatcherEventName.LOGGED_OUT);
|
|
286
413
|
};
|
|
287
414
|
return {
|
|
288
|
-
|
|
289
|
-
|
|
415
|
+
cookiesRead,
|
|
416
|
+
setCookiesRead,
|
|
290
417
|
permissionChecker,
|
|
291
418
|
login,
|
|
292
419
|
logout,
|
|
293
420
|
loggedIn,
|
|
294
421
|
resolve,
|
|
295
|
-
|
|
422
|
+
applyTokenGrantResponse,
|
|
296
423
|
accessToken,
|
|
297
424
|
setAccessToken,
|
|
298
425
|
accessTokenExpireDate,
|
|
@@ -379,8 +506,8 @@ function shouldUpdate(dependencies, newCookies, oldCookies) {
|
|
|
379
506
|
return false;
|
|
380
507
|
}
|
|
381
508
|
|
|
382
|
-
const
|
|
383
|
-
function
|
|
509
|
+
const sym = Symbol.for('AuthupStore');
|
|
510
|
+
function injectStore(pinia, app) {
|
|
384
511
|
const instance = injectStoreFactory(app);
|
|
385
512
|
if (!instance) {
|
|
386
513
|
throw new Error('The store has not been injected in the app context.');
|
|
@@ -388,25 +515,28 @@ function useStore(pinia, app) {
|
|
|
388
515
|
return instance(pinia);
|
|
389
516
|
}
|
|
390
517
|
function injectStoreFactory(app) {
|
|
391
|
-
const instance = inject$1(
|
|
518
|
+
const instance = inject$1(sym, app);
|
|
392
519
|
if (!instance) {
|
|
393
520
|
throw new Error('The store factory has not been injected in the app context.');
|
|
394
521
|
}
|
|
395
522
|
return instance;
|
|
396
523
|
}
|
|
397
524
|
function hasStoreFactory(app) {
|
|
398
|
-
return !!inject$1(
|
|
525
|
+
return !!inject$1(sym, app);
|
|
399
526
|
}
|
|
400
527
|
function provideStoreFactory(store, app) {
|
|
401
|
-
provide(
|
|
528
|
+
provide(sym, store, app);
|
|
402
529
|
}
|
|
403
530
|
|
|
404
531
|
function installStore(app, options = {}) {
|
|
405
532
|
if (hasStoreFactory(app)) {
|
|
406
533
|
return;
|
|
407
534
|
}
|
|
535
|
+
const storeDispatcher = createStoreDispatcher();
|
|
536
|
+
provideStoreDispatcher(storeDispatcher, app);
|
|
408
537
|
const storeFactory = pinia.defineStore(STORE_ID, ()=>createStore({
|
|
409
|
-
baseURL: options.baseURL
|
|
538
|
+
baseURL: options.baseURL,
|
|
539
|
+
dispatcher: storeDispatcher
|
|
410
540
|
}));
|
|
411
541
|
const store = storeFactory(options.pinia);
|
|
412
542
|
let cookieGet;
|
|
@@ -434,11 +564,11 @@ function installStore(app, options = {}) {
|
|
|
434
564
|
const cookies = useCookies();
|
|
435
565
|
cookieUnset = cookies.remove;
|
|
436
566
|
}
|
|
437
|
-
const
|
|
438
|
-
if (store.
|
|
567
|
+
const readCookies = ()=>{
|
|
568
|
+
if (store.cookiesRead) {
|
|
439
569
|
return;
|
|
440
570
|
}
|
|
441
|
-
store.
|
|
571
|
+
store.setCookiesRead(true);
|
|
442
572
|
const keys = Object.values(coreHttpKit.CookieName);
|
|
443
573
|
let value;
|
|
444
574
|
for(let i = 0; i < keys.length; i++){
|
|
@@ -480,51 +610,60 @@ function installStore(app, options = {}) {
|
|
|
480
610
|
}
|
|
481
611
|
}
|
|
482
612
|
};
|
|
483
|
-
|
|
484
|
-
if (
|
|
485
|
-
return;
|
|
613
|
+
const maxAgeFn = ()=>{
|
|
614
|
+
if (!store.accessTokenExpireDate) {
|
|
615
|
+
return undefined;
|
|
486
616
|
}
|
|
487
|
-
|
|
488
|
-
|
|
617
|
+
return Math.floor(Math.max(1000, new Date(`${store.accessTokenExpireDate}`).getTime() - Date.now()) / 1000);
|
|
618
|
+
};
|
|
619
|
+
storeDispatcher.on(StoreDispatcherEventName.ACCESS_TOKEN_EXPIRE_DATE_UPDATED, (input)=>{
|
|
620
|
+
if (input) {
|
|
621
|
+
cookieSet(coreHttpKit.CookieName.ACCESS_TOKEN_EXPIRE_DATE, input, {
|
|
622
|
+
maxAge: maxAgeFn()
|
|
623
|
+
});
|
|
624
|
+
} else {
|
|
489
625
|
cookieUnset(coreHttpKit.CookieName.ACCESS_TOKEN_EXPIRE_DATE, {});
|
|
490
|
-
cookieUnset(coreHttpKit.CookieName.REFRESH_TOKEN, {});
|
|
491
|
-
cookieUnset(coreHttpKit.CookieName.USER, {});
|
|
492
|
-
cookieUnset(coreHttpKit.CookieName.REALM, {});
|
|
493
|
-
cookieUnset(coreHttpKit.CookieName.REALM_MANAGEMENT, {});
|
|
494
626
|
}
|
|
495
627
|
});
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
}
|
|
501
|
-
let maxAge;
|
|
502
|
-
if (state.accessTokenExpireDate) {
|
|
503
|
-
maxAge = Math.floor(Math.max(1000, new Date(`${state.accessTokenExpireDate}`).getTime() - Date.now()) / 1000);
|
|
504
|
-
}
|
|
505
|
-
if (state.accessToken) {
|
|
506
|
-
cookieSet(coreHttpKit.CookieName.ACCESS_TOKEN, state.accessToken, {
|
|
507
|
-
maxAge
|
|
508
|
-
});
|
|
509
|
-
}
|
|
510
|
-
if (state.accessTokenExpireDate) {
|
|
511
|
-
cookieSet(coreHttpKit.CookieName.ACCESS_TOKEN_EXPIRE_DATE, state.accessTokenExpireDate, {
|
|
628
|
+
storeDispatcher.on(StoreDispatcherEventName.ACCESS_TOKEN_UPDATED, (input)=>{
|
|
629
|
+
if (input) {
|
|
630
|
+
const maxAge = maxAgeFn();
|
|
631
|
+
cookieSet(coreHttpKit.CookieName.ACCESS_TOKEN, input, {
|
|
512
632
|
maxAge
|
|
513
633
|
});
|
|
634
|
+
} else {
|
|
635
|
+
cookieUnset(coreHttpKit.CookieName.ACCESS_TOKEN, {});
|
|
514
636
|
}
|
|
515
|
-
|
|
516
|
-
|
|
637
|
+
});
|
|
638
|
+
storeDispatcher.on(StoreDispatcherEventName.REFRESH_TOKEN_UPDATED, (input)=>{
|
|
639
|
+
if (input) {
|
|
640
|
+
cookieSet(coreHttpKit.CookieName.REFRESH_TOKEN, input, {});
|
|
641
|
+
} else {
|
|
642
|
+
cookieUnset(coreHttpKit.CookieName.REFRESH_TOKEN, {});
|
|
517
643
|
}
|
|
518
|
-
|
|
519
|
-
|
|
644
|
+
});
|
|
645
|
+
storeDispatcher.on(StoreDispatcherEventName.USER_UPDATED, (input)=>{
|
|
646
|
+
if (input) {
|
|
647
|
+
cookieSet(coreHttpKit.CookieName.USER, input, {});
|
|
648
|
+
} else {
|
|
649
|
+
cookieUnset(coreHttpKit.CookieName.USER, {});
|
|
520
650
|
}
|
|
521
|
-
|
|
522
|
-
|
|
651
|
+
});
|
|
652
|
+
storeDispatcher.on(StoreDispatcherEventName.REALM_UPDATED, (input)=>{
|
|
653
|
+
if (input) {
|
|
654
|
+
cookieSet(coreHttpKit.CookieName.REALM, input, {});
|
|
655
|
+
} else {
|
|
656
|
+
cookieUnset(coreHttpKit.CookieName.REALM, {});
|
|
523
657
|
}
|
|
524
|
-
|
|
525
|
-
|
|
658
|
+
});
|
|
659
|
+
storeDispatcher.on(StoreDispatcherEventName.REALM_MANAGEMENT_UPDATED, (input)=>{
|
|
660
|
+
if (input) {
|
|
661
|
+
cookieSet(coreHttpKit.CookieName.REALM_MANAGEMENT, input, {});
|
|
662
|
+
} else {
|
|
663
|
+
cookieUnset(coreHttpKit.CookieName.REALM_MANAGEMENT, {});
|
|
526
664
|
}
|
|
527
665
|
});
|
|
666
|
+
readCookies();
|
|
528
667
|
provideStoreFactory(storeFactory, app);
|
|
529
668
|
}
|
|
530
669
|
|
|
@@ -562,30 +701,36 @@ function installHTTPClient(app, options = {}) {
|
|
|
562
701
|
});
|
|
563
702
|
},
|
|
564
703
|
tokenCreated: (response)=>{
|
|
565
|
-
store.
|
|
704
|
+
store.applyTokenGrantResponse(response);
|
|
566
705
|
},
|
|
567
706
|
tokenFailed: ()=>{
|
|
568
|
-
store.logout();
|
|
707
|
+
Promise.resolve().then(()=>store.logout());
|
|
569
708
|
},
|
|
570
709
|
timer: !options.isServer
|
|
571
710
|
});
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
if (
|
|
711
|
+
const storeDispatcher = injectStoreDispatcher(app);
|
|
712
|
+
const handleAccessTokenEvent = ()=>{
|
|
713
|
+
if (store.accessToken) {
|
|
575
714
|
client.setAuthorizationHeader({
|
|
576
715
|
type: 'Bearer',
|
|
577
|
-
token:
|
|
716
|
+
token: store.accessToken
|
|
578
717
|
});
|
|
579
718
|
tokenHook.mount();
|
|
580
719
|
} else {
|
|
581
720
|
client.unsetAuthorizationHeader();
|
|
582
721
|
tokenHook.unmount();
|
|
583
722
|
}
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
723
|
+
};
|
|
724
|
+
const handleAccessTokenExpireDateEvent = ()=>{
|
|
725
|
+
if (store.accessTokenExpireDate) {
|
|
726
|
+
const expiresIn = Math.floor((store.accessTokenExpireDate.getTime() - Date.now()) / 1000);
|
|
727
|
+
tokenHook.setTimer(expiresIn, ()=>refreshToken.value || undefined);
|
|
587
728
|
}
|
|
588
|
-
}
|
|
729
|
+
};
|
|
730
|
+
storeDispatcher.on(StoreDispatcherEventName.ACCESS_TOKEN_UPDATED, ()=>handleAccessTokenEvent());
|
|
731
|
+
storeDispatcher.on(StoreDispatcherEventName.ACCESS_TOKEN_EXPIRE_DATE_UPDATED, ()=>handleAccessTokenExpireDateEvent());
|
|
732
|
+
handleAccessTokenEvent();
|
|
733
|
+
handleAccessTokenExpireDateEvent();
|
|
589
734
|
provideHTTPClient(client, app);
|
|
590
735
|
}
|
|
591
736
|
|
|
@@ -633,7 +778,7 @@ function renderEntityAssignAction(ctx) {
|
|
|
633
778
|
* Author Peter Placzek (tada5hi)
|
|
634
779
|
* For the full copyright and license information,
|
|
635
780
|
* view the LICENSE file that was distributed with this source code.
|
|
636
|
-
*/ function
|
|
781
|
+
*/ function defineResourceCollectionVEmitOptions() {
|
|
637
782
|
return {
|
|
638
783
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
639
784
|
created: (_item)=>true,
|
|
@@ -643,7 +788,7 @@ function renderEntityAssignAction(ctx) {
|
|
|
643
788
|
updated: (_item)=>true
|
|
644
789
|
};
|
|
645
790
|
}
|
|
646
|
-
function
|
|
791
|
+
function defineResourceCollectionVProps() {
|
|
647
792
|
return {
|
|
648
793
|
query: {
|
|
649
794
|
type: Object,
|
|
@@ -818,7 +963,7 @@ function installSocketManager(app, options) {
|
|
|
818
963
|
provideSocketManager(manager, app);
|
|
819
964
|
}
|
|
820
965
|
|
|
821
|
-
function
|
|
966
|
+
function create$2(ctx) {
|
|
822
967
|
if (!isSocketManagerUsable()) {
|
|
823
968
|
return {
|
|
824
969
|
mount () {},
|
|
@@ -826,7 +971,7 @@ function createEntitySocket(ctx) {
|
|
|
826
971
|
};
|
|
827
972
|
}
|
|
828
973
|
const socketManager = injectSocketManager();
|
|
829
|
-
const store =
|
|
974
|
+
const store = injectStore();
|
|
830
975
|
const storeRefs = storeToRefs(store);
|
|
831
976
|
const realmId = vue.computed(()=>{
|
|
832
977
|
if (storeRefs.realmName.value === coreKit.REALM_MASTER_NAME) {
|
|
@@ -930,8 +1075,7 @@ function createEntitySocket(ctx) {
|
|
|
930
1075
|
vue.onUnmounted(()=>unmount());
|
|
931
1076
|
vue.watch(targetId, (val, oldValue)=>{
|
|
932
1077
|
if (val !== oldValue) {
|
|
933
|
-
unmount();
|
|
934
|
-
mount();
|
|
1078
|
+
Promise.resolve().then(()=>unmount()).then(()=>mount());
|
|
935
1079
|
}
|
|
936
1080
|
});
|
|
937
1081
|
return {
|
|
@@ -939,6 +1083,9 @@ function createEntitySocket(ctx) {
|
|
|
939
1083
|
unmount
|
|
940
1084
|
};
|
|
941
1085
|
}
|
|
1086
|
+
function createResourceSocketManager(ctx) {
|
|
1087
|
+
return create$2(ctx);
|
|
1088
|
+
}
|
|
942
1089
|
|
|
943
1090
|
function isQuerySortedDescByDate(input) {
|
|
944
1091
|
if (Array.isArray(input)) {
|
|
@@ -955,7 +1102,7 @@ const merger = smob.createMerger({
|
|
|
955
1102
|
inPlace: false,
|
|
956
1103
|
priority: 'left'
|
|
957
1104
|
});
|
|
958
|
-
function
|
|
1105
|
+
function create$1(context) {
|
|
959
1106
|
const data = vue.ref([]);
|
|
960
1107
|
const busy = vue.ref(false);
|
|
961
1108
|
const total = vue.ref(0);
|
|
@@ -1040,7 +1187,7 @@ function createList(context) {
|
|
|
1040
1187
|
}
|
|
1041
1188
|
}
|
|
1042
1189
|
const handleCreated = buildListCreatedHandler(data, (cbEntity)=>{
|
|
1043
|
-
total.value
|
|
1190
|
+
total.value++;
|
|
1044
1191
|
if (context.onCreated) {
|
|
1045
1192
|
context.onCreated(cbEntity, meta.value);
|
|
1046
1193
|
}
|
|
@@ -1073,7 +1220,7 @@ function createList(context) {
|
|
|
1073
1220
|
noMore: renderOptions.noMore,
|
|
1074
1221
|
body: renderOptions.body,
|
|
1075
1222
|
loading: renderOptions.loading,
|
|
1076
|
-
total,
|
|
1223
|
+
total: total.value,
|
|
1077
1224
|
load,
|
|
1078
1225
|
busy: busy.value,
|
|
1079
1226
|
data: data.value,
|
|
@@ -1082,16 +1229,19 @@ function createList(context) {
|
|
|
1082
1229
|
if (context.setup.emit) {
|
|
1083
1230
|
context.setup.emit('created', value);
|
|
1084
1231
|
}
|
|
1232
|
+
handleCreated(value);
|
|
1085
1233
|
},
|
|
1086
1234
|
onDeleted: (value)=>{
|
|
1087
1235
|
if (context.setup.emit) {
|
|
1088
1236
|
context.setup.emit('deleted', value);
|
|
1089
1237
|
}
|
|
1238
|
+
handleDeleted(value);
|
|
1090
1239
|
},
|
|
1091
1240
|
onUpdated: (value)=>{
|
|
1092
1241
|
if (context.setup.emit) {
|
|
1093
1242
|
context.setup.emit('updated', value);
|
|
1094
1243
|
}
|
|
1244
|
+
handleUpdated(value);
|
|
1095
1245
|
},
|
|
1096
1246
|
slotItems: context.setup.slots || {}
|
|
1097
1247
|
});
|
|
@@ -1129,7 +1279,7 @@ function createList(context) {
|
|
|
1129
1279
|
handleDeleted(entity);
|
|
1130
1280
|
};
|
|
1131
1281
|
socketContext.realmId = realmId;
|
|
1132
|
-
|
|
1282
|
+
createResourceSocketManager(socketContext);
|
|
1133
1283
|
}
|
|
1134
1284
|
return {
|
|
1135
1285
|
data,
|
|
@@ -1143,13 +1293,16 @@ function createList(context) {
|
|
|
1143
1293
|
load
|
|
1144
1294
|
};
|
|
1145
1295
|
}
|
|
1296
|
+
function createResourceCollectionManager(context) {
|
|
1297
|
+
return create$1(context);
|
|
1298
|
+
}
|
|
1146
1299
|
|
|
1147
1300
|
/*
|
|
1148
1301
|
* Copyright (c) 2023.
|
|
1149
1302
|
* Author Peter Placzek (tada5hi)
|
|
1150
1303
|
* For the full copyright and license information,
|
|
1151
1304
|
* view the LICENSE file that was distributed with this source code.
|
|
1152
|
-
*/ class
|
|
1305
|
+
*/ class ResourceRecordError extends Error {
|
|
1153
1306
|
static unresolvable() {
|
|
1154
1307
|
return new this('Entity could not be resolved.');
|
|
1155
1308
|
}
|
|
@@ -1196,7 +1349,7 @@ function createList(context) {
|
|
|
1196
1349
|
return [];
|
|
1197
1350
|
}
|
|
1198
1351
|
|
|
1199
|
-
function
|
|
1352
|
+
function buildResourceVSlotProps(input) {
|
|
1200
1353
|
return {
|
|
1201
1354
|
...input,
|
|
1202
1355
|
error: vue.unref(input.error),
|
|
@@ -1205,7 +1358,7 @@ function buildEntityManagerSlotProps(input) {
|
|
|
1205
1358
|
lockId: vue.unref(input.lockId)
|
|
1206
1359
|
};
|
|
1207
1360
|
}
|
|
1208
|
-
function
|
|
1361
|
+
function defineResourceVEmitOptions() {
|
|
1209
1362
|
return {
|
|
1210
1363
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1211
1364
|
failed: (_item)=>true,
|
|
@@ -1219,7 +1372,7 @@ function defineEntityManagerEvents() {
|
|
|
1219
1372
|
resolved: (_item)=>true
|
|
1220
1373
|
};
|
|
1221
1374
|
}
|
|
1222
|
-
function
|
|
1375
|
+
function defineResourceVProps() {
|
|
1223
1376
|
return {
|
|
1224
1377
|
entity: {
|
|
1225
1378
|
type: Object
|
|
@@ -1239,7 +1392,7 @@ function defineEntityManagerProps() {
|
|
|
1239
1392
|
};
|
|
1240
1393
|
}
|
|
1241
1394
|
|
|
1242
|
-
function
|
|
1395
|
+
function create(ctx) {
|
|
1243
1396
|
const client = injectHTTPClient();
|
|
1244
1397
|
let domainAPI;
|
|
1245
1398
|
if (kit.hasOwnProperty(client, ctx.type)) {
|
|
@@ -1391,7 +1544,7 @@ function createEntityManager(ctx) {
|
|
|
1391
1544
|
socketContext.realmId = realmId;
|
|
1392
1545
|
socketContext.target = true;
|
|
1393
1546
|
socketContext.targetId = entityId;
|
|
1394
|
-
socket =
|
|
1547
|
+
socket = createResourceSocketManager(socketContext);
|
|
1395
1548
|
}
|
|
1396
1549
|
const error = vue.ref(undefined);
|
|
1397
1550
|
const resolveByProps = ()=>{
|
|
@@ -1500,7 +1653,7 @@ function createEntityManager(ctx) {
|
|
|
1500
1653
|
await resolve(resolveContext);
|
|
1501
1654
|
if (typeof entity.value === 'undefined') {
|
|
1502
1655
|
if (!error.value) {
|
|
1503
|
-
throw
|
|
1656
|
+
throw ResourceRecordError.unresolvable();
|
|
1504
1657
|
}
|
|
1505
1658
|
// eslint-disable-next-line no-throw-literal
|
|
1506
1659
|
throw error.value;
|
|
@@ -1529,7 +1682,7 @@ function createEntityManager(ctx) {
|
|
|
1529
1682
|
return typeof content === 'function' ? content() : content;
|
|
1530
1683
|
}
|
|
1531
1684
|
if (hasNormalizedSlot('default', ctx.setup.slots)) {
|
|
1532
|
-
return normalizeSlot('default',
|
|
1685
|
+
return normalizeSlot('default', buildResourceVSlotProps(manager), ctx.setup.slots);
|
|
1533
1686
|
}
|
|
1534
1687
|
return typeof content === 'function' ? content() : content;
|
|
1535
1688
|
};
|
|
@@ -1544,6 +1697,9 @@ function createEntityManager(ctx) {
|
|
|
1544
1697
|
};
|
|
1545
1698
|
return manager;
|
|
1546
1699
|
}
|
|
1700
|
+
function createResourceManager(ctx) {
|
|
1701
|
+
return create(ctx);
|
|
1702
|
+
}
|
|
1547
1703
|
|
|
1548
1704
|
/*
|
|
1549
1705
|
* Copyright (c) 2022.
|
|
@@ -2092,7 +2248,7 @@ function createPermissionCheckerReactiveFn(ctx = {}) {
|
|
|
2092
2248
|
if (ctx.store) {
|
|
2093
2249
|
store = ctx.store;
|
|
2094
2250
|
} else {
|
|
2095
|
-
store =
|
|
2251
|
+
store = injectStore(ctx.pinia, ctx.app);
|
|
2096
2252
|
}
|
|
2097
2253
|
const storeRefs = storeToRefs(store);
|
|
2098
2254
|
return (ctx)=>{
|
|
@@ -2147,11 +2303,11 @@ function createPermissionCheckerReactiveFn(ctx = {}) {
|
|
|
2147
2303
|
}
|
|
2148
2304
|
|
|
2149
2305
|
const AClient = vue.defineComponent({
|
|
2150
|
-
props:
|
|
2151
|
-
emits:
|
|
2306
|
+
props: defineResourceVProps(),
|
|
2307
|
+
emits: defineResourceVEmitOptions(),
|
|
2152
2308
|
slots: Object,
|
|
2153
2309
|
async setup (props, setup) {
|
|
2154
|
-
const manager =
|
|
2310
|
+
const manager = createResourceManager({
|
|
2155
2311
|
type: `${coreKit.DomainType.CLIENT}`,
|
|
2156
2312
|
setup,
|
|
2157
2313
|
props
|
|
@@ -2199,7 +2355,7 @@ function usePermissionCheck(ctx) {
|
|
|
2199
2355
|
}
|
|
2200
2356
|
|
|
2201
2357
|
function useRealmResourceWritableCheck(realmId) {
|
|
2202
|
-
const store =
|
|
2358
|
+
const store = injectStore();
|
|
2203
2359
|
const { realm } = pinia.storeToRefs(store);
|
|
2204
2360
|
return vue.computed(()=>{
|
|
2205
2361
|
const realmIdRaw = vue.unref(realmId);
|
|
@@ -2208,11 +2364,11 @@ function useRealmResourceWritableCheck(realmId) {
|
|
|
2208
2364
|
}
|
|
2209
2365
|
|
|
2210
2366
|
const ARealm = vue.defineComponent({
|
|
2211
|
-
props:
|
|
2212
|
-
emits:
|
|
2367
|
+
props: defineResourceVProps(),
|
|
2368
|
+
emits: defineResourceVEmitOptions(),
|
|
2213
2369
|
slots: Object,
|
|
2214
2370
|
async setup (props, setup) {
|
|
2215
|
-
const manager =
|
|
2371
|
+
const manager = createResourceManager({
|
|
2216
2372
|
type: `${coreKit.DomainType.REALM}`,
|
|
2217
2373
|
props,
|
|
2218
2374
|
setup
|
|
@@ -2234,7 +2390,7 @@ const ARealmForm = vue.defineComponent({
|
|
|
2234
2390
|
default: undefined
|
|
2235
2391
|
}
|
|
2236
2392
|
},
|
|
2237
|
-
emits:
|
|
2393
|
+
emits: defineResourceVEmitOptions(),
|
|
2238
2394
|
setup (props, ctx) {
|
|
2239
2395
|
const busy = vue.ref(false);
|
|
2240
2396
|
const form = vue.reactive({
|
|
@@ -2257,7 +2413,7 @@ const ARealmForm = vue.defineComponent({
|
|
|
2257
2413
|
maxLength: validators.maxLength(4096)
|
|
2258
2414
|
}
|
|
2259
2415
|
}, form);
|
|
2260
|
-
const manager =
|
|
2416
|
+
const manager = createResourceManager({
|
|
2261
2417
|
type: `${coreKit.DomainType.REALM}`,
|
|
2262
2418
|
setup: ctx,
|
|
2263
2419
|
props
|
|
@@ -2392,11 +2548,11 @@ const ARealmForm = vue.defineComponent({
|
|
|
2392
2548
|
});
|
|
2393
2549
|
|
|
2394
2550
|
const ARealms = vue.defineComponent({
|
|
2395
|
-
props:
|
|
2551
|
+
props: defineResourceCollectionVProps(),
|
|
2396
2552
|
slots: Object,
|
|
2397
|
-
emits:
|
|
2553
|
+
emits: defineResourceCollectionVEmitOptions(),
|
|
2398
2554
|
setup (props, ctx) {
|
|
2399
|
-
const { render } =
|
|
2555
|
+
const { render } = createResourceCollectionManager({
|
|
2400
2556
|
type: `${coreKit.DomainType.REALM}`,
|
|
2401
2557
|
props,
|
|
2402
2558
|
setup: ctx
|
|
@@ -2561,7 +2717,7 @@ const AClientForm = vue.defineComponent({
|
|
|
2561
2717
|
default: undefined
|
|
2562
2718
|
}
|
|
2563
2719
|
},
|
|
2564
|
-
emits:
|
|
2720
|
+
emits: defineResourceVEmitOptions(),
|
|
2565
2721
|
setup (props, ctx) {
|
|
2566
2722
|
const busy = vue.ref(false);
|
|
2567
2723
|
const form = vue.reactive({
|
|
@@ -2603,7 +2759,7 @@ const AClientForm = vue.defineComponent({
|
|
|
2603
2759
|
maxLength: validators.maxLength(256)
|
|
2604
2760
|
}
|
|
2605
2761
|
}, form);
|
|
2606
|
-
const manager =
|
|
2762
|
+
const manager = createResourceManager({
|
|
2607
2763
|
type: `${coreKit.DomainType.CLIENT}`,
|
|
2608
2764
|
setup: ctx,
|
|
2609
2765
|
props
|
|
@@ -2876,11 +3032,11 @@ const AClientForm = vue.defineComponent({
|
|
|
2876
3032
|
});
|
|
2877
3033
|
|
|
2878
3034
|
const AClients = vue.defineComponent({
|
|
2879
|
-
props:
|
|
3035
|
+
props: defineResourceCollectionVProps(),
|
|
2880
3036
|
slots: Object,
|
|
2881
|
-
emits:
|
|
3037
|
+
emits: defineResourceCollectionVEmitOptions(),
|
|
2882
3038
|
setup (props, ctx) {
|
|
2883
|
-
const { render } =
|
|
3039
|
+
const { render } = createResourceCollectionManager({
|
|
2884
3040
|
type: `${coreKit.DomainType.CLIENT}`,
|
|
2885
3041
|
props,
|
|
2886
3042
|
setup: ctx
|
|
@@ -2905,11 +3061,11 @@ const AClients = vue.defineComponent({
|
|
|
2905
3061
|
});
|
|
2906
3062
|
|
|
2907
3063
|
const AClientScope = vue.defineComponent({
|
|
2908
|
-
props:
|
|
2909
|
-
emits:
|
|
3064
|
+
props: defineResourceVProps(),
|
|
3065
|
+
emits: defineResourceVEmitOptions(),
|
|
2910
3066
|
slots: Object,
|
|
2911
3067
|
async setup (props, setup) {
|
|
2912
|
-
const manager =
|
|
3068
|
+
const manager = createResourceManager({
|
|
2913
3069
|
type: `${coreKit.DomainType.CLIENT_SCOPE}`,
|
|
2914
3070
|
props,
|
|
2915
3071
|
setup
|
|
@@ -2924,11 +3080,11 @@ const AClientScope = vue.defineComponent({
|
|
|
2924
3080
|
});
|
|
2925
3081
|
|
|
2926
3082
|
const AClientScopes = vue.defineComponent({
|
|
2927
|
-
props:
|
|
3083
|
+
props: defineResourceCollectionVProps(),
|
|
2928
3084
|
slots: Object,
|
|
2929
|
-
emits:
|
|
3085
|
+
emits: defineResourceCollectionVEmitOptions(),
|
|
2930
3086
|
setup (props, ctx) {
|
|
2931
|
-
const { render } =
|
|
3087
|
+
const { render } = createResourceCollectionManager({
|
|
2932
3088
|
type: `${coreKit.DomainType.CLIENT_SCOPE}`,
|
|
2933
3089
|
props,
|
|
2934
3090
|
setup: ctx
|
|
@@ -2981,7 +3137,7 @@ const AScopeForm = vue.defineComponent({
|
|
|
2981
3137
|
type: Object
|
|
2982
3138
|
}
|
|
2983
3139
|
},
|
|
2984
|
-
emits:
|
|
3140
|
+
emits: defineResourceVEmitOptions(),
|
|
2985
3141
|
setup (props, ctx) {
|
|
2986
3142
|
const busy = vue.ref(false);
|
|
2987
3143
|
const form = vue.reactive({
|
|
@@ -3007,9 +3163,9 @@ const AScopeForm = vue.defineComponent({
|
|
|
3007
3163
|
},
|
|
3008
3164
|
realm_id: {}
|
|
3009
3165
|
}, form);
|
|
3010
|
-
const store =
|
|
3166
|
+
const store = injectStore();
|
|
3011
3167
|
const storeRefs = storeToRefs(store);
|
|
3012
|
-
const manager =
|
|
3168
|
+
const manager = createResourceManager({
|
|
3013
3169
|
type: `${coreKit.DomainType.SCOPE}`,
|
|
3014
3170
|
setup: ctx,
|
|
3015
3171
|
props
|
|
@@ -3128,11 +3284,11 @@ const AScopeForm = vue.defineComponent({
|
|
|
3128
3284
|
});
|
|
3129
3285
|
|
|
3130
3286
|
const AScopes = vue.defineComponent({
|
|
3131
|
-
props:
|
|
3287
|
+
props: defineResourceCollectionVProps(),
|
|
3132
3288
|
slots: Object,
|
|
3133
|
-
emits:
|
|
3289
|
+
emits: defineResourceCollectionVEmitOptions(),
|
|
3134
3290
|
setup (props, ctx) {
|
|
3135
|
-
const { render } =
|
|
3291
|
+
const { render } = createResourceCollectionManager({
|
|
3136
3292
|
type: coreKit.DomainType.SCOPE,
|
|
3137
3293
|
props,
|
|
3138
3294
|
setup: ctx
|
|
@@ -3157,11 +3313,11 @@ const AScopes = vue.defineComponent({
|
|
|
3157
3313
|
});
|
|
3158
3314
|
|
|
3159
3315
|
const AScope = vue.defineComponent({
|
|
3160
|
-
props:
|
|
3161
|
-
emits:
|
|
3316
|
+
props: defineResourceVProps(),
|
|
3317
|
+
emits: defineResourceVEmitOptions(),
|
|
3162
3318
|
slots: Object,
|
|
3163
3319
|
async setup (props, setup) {
|
|
3164
|
-
const manager =
|
|
3320
|
+
const manager = createResourceManager({
|
|
3165
3321
|
type: `${coreKit.DomainType.SCOPE}`,
|
|
3166
3322
|
props,
|
|
3167
3323
|
setup
|
|
@@ -3180,9 +3336,9 @@ const AClientScopeAssignment = vue.defineComponent({
|
|
|
3180
3336
|
clientId: String,
|
|
3181
3337
|
scopeId: String
|
|
3182
3338
|
},
|
|
3183
|
-
emits:
|
|
3339
|
+
emits: defineResourceVEmitOptions(),
|
|
3184
3340
|
async setup (props, setup) {
|
|
3185
|
-
const manager =
|
|
3341
|
+
const manager = createResourceManager({
|
|
3186
3342
|
type: `${coreKit.DomainType.CLIENT_SCOPE}`,
|
|
3187
3343
|
setup,
|
|
3188
3344
|
socket: {
|
|
@@ -3231,11 +3387,11 @@ const AClientScopeAssignments = vue.defineComponent({
|
|
|
3231
3387
|
});
|
|
3232
3388
|
|
|
3233
3389
|
const AIdentityProvider = vue.defineComponent({
|
|
3234
|
-
props:
|
|
3235
|
-
emits:
|
|
3390
|
+
props: defineResourceVProps(),
|
|
3391
|
+
emits: defineResourceVEmitOptions(),
|
|
3236
3392
|
slots: Object,
|
|
3237
3393
|
async setup (props, setup) {
|
|
3238
|
-
const manager =
|
|
3394
|
+
const manager = createResourceManager({
|
|
3239
3395
|
type: `${coreKit.DomainType.IDENTITY_PROVIDER}`,
|
|
3240
3396
|
props,
|
|
3241
3397
|
setup
|
|
@@ -3854,9 +4010,9 @@ const AIdentityProviderLdapForm = vue.defineComponent({
|
|
|
3854
4010
|
default: undefined
|
|
3855
4011
|
}
|
|
3856
4012
|
},
|
|
3857
|
-
emits:
|
|
4013
|
+
emits: defineResourceVEmitOptions(),
|
|
3858
4014
|
setup (props, ctx) {
|
|
3859
|
-
const manager =
|
|
4015
|
+
const manager = createResourceManager({
|
|
3860
4016
|
type: `${coreKit.DomainType.IDENTITY_PROVIDER}`,
|
|
3861
4017
|
setup: ctx,
|
|
3862
4018
|
props
|
|
@@ -4071,7 +4227,11 @@ const AIdentityProviderPreset = vue.defineComponent({
|
|
|
4071
4227
|
}
|
|
4072
4228
|
});
|
|
4073
4229
|
|
|
4074
|
-
|
|
4230
|
+
var _sfc_main = vue.defineComponent({
|
|
4231
|
+
components: {
|
|
4232
|
+
AIdentityProviderPreset,
|
|
4233
|
+
AIdentityProviderProtocol
|
|
4234
|
+
},
|
|
4075
4235
|
props: {
|
|
4076
4236
|
protocol: {
|
|
4077
4237
|
type: String
|
|
@@ -4084,113 +4244,139 @@ const AIdentityProviderPicker = vue.defineComponent({
|
|
|
4084
4244
|
'pick'
|
|
4085
4245
|
],
|
|
4086
4246
|
setup (props, setup) {
|
|
4087
|
-
const protocols =
|
|
4088
|
-
const presets =
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
id
|
|
4092
|
-
});
|
|
4093
|
-
return id;
|
|
4094
|
-
});
|
|
4095
|
-
Object.values(coreKit.IdentityProviderPreset).map((id)=>{
|
|
4096
|
-
presets.push({
|
|
4097
|
-
id
|
|
4098
|
-
});
|
|
4099
|
-
return id;
|
|
4100
|
-
});
|
|
4101
|
-
const pick = (ctx)=>{
|
|
4102
|
-
setup.emit('pick', ctx);
|
|
4247
|
+
const protocols = Object.values(coreKit.IdentityProviderProtocol);
|
|
4248
|
+
const presets = Object.values(coreKit.IdentityProviderPreset);
|
|
4249
|
+
const pickProtocol = (protocol)=>{
|
|
4250
|
+
setup.emit('pick', 'protocol', protocol);
|
|
4103
4251
|
};
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
item: {
|
|
4113
|
-
class: [
|
|
4114
|
-
'me-1 list-item'
|
|
4115
|
-
],
|
|
4116
|
-
icon: false,
|
|
4117
|
-
content: (item)=>vue.h(AIdentityProviderProtocol, {
|
|
4118
|
-
id: item.id
|
|
4119
|
-
}, {
|
|
4120
|
-
default: (element)=>[
|
|
4121
|
-
vue.h('i', {
|
|
4122
|
-
class: [
|
|
4123
|
-
element.icon,
|
|
4124
|
-
'pe-1'
|
|
4125
|
-
]
|
|
4126
|
-
}),
|
|
4127
|
-
element.name,
|
|
4128
|
-
vue.h('button', {
|
|
4129
|
-
class: 'btn btn-xs btn-dark ms-1',
|
|
4130
|
-
onClick ($event) {
|
|
4131
|
-
$event.preventDefault();
|
|
4132
|
-
pick({
|
|
4133
|
-
protocol: item.id
|
|
4134
|
-
});
|
|
4135
|
-
}
|
|
4136
|
-
}, [
|
|
4137
|
-
vue.h('i', {
|
|
4138
|
-
class: 'fa fa-plus'
|
|
4139
|
-
})
|
|
4140
|
-
])
|
|
4141
|
-
]
|
|
4142
|
-
})
|
|
4143
|
-
}
|
|
4144
|
-
}
|
|
4145
|
-
});
|
|
4146
|
-
const protocolNodeConfigurationNode = listControls.buildList({
|
|
4147
|
-
data: presets,
|
|
4148
|
-
header: {
|
|
4149
|
-
content: vue.h('h6', 'Presets')
|
|
4150
|
-
},
|
|
4151
|
-
body: {
|
|
4152
|
-
class: 'd-flex flex-row',
|
|
4153
|
-
item: {
|
|
4154
|
-
class: 'me-1 list-item',
|
|
4155
|
-
icon: false,
|
|
4156
|
-
content: (preset)=>vue.h(AIdentityProviderPreset, {
|
|
4157
|
-
id: preset.id
|
|
4158
|
-
}, {
|
|
4159
|
-
default: (item)=>vue.h('div', [
|
|
4160
|
-
vue.h('i', {
|
|
4161
|
-
class: [
|
|
4162
|
-
item.icon,
|
|
4163
|
-
'pe-1'
|
|
4164
|
-
]
|
|
4165
|
-
}),
|
|
4166
|
-
item.name,
|
|
4167
|
-
vue.h('button', {
|
|
4168
|
-
class: 'btn btn-xs btn-dark ms-1',
|
|
4169
|
-
onClick ($event) {
|
|
4170
|
-
$event.preventDefault();
|
|
4171
|
-
pick({
|
|
4172
|
-
preset: preset.id,
|
|
4173
|
-
protocol: coreKit.getIdentityProviderProtocolForPreset(preset.id)
|
|
4174
|
-
});
|
|
4175
|
-
}
|
|
4176
|
-
}, [
|
|
4177
|
-
vue.h('i', {
|
|
4178
|
-
class: 'fa fa-plus'
|
|
4179
|
-
})
|
|
4180
|
-
])
|
|
4181
|
-
])
|
|
4182
|
-
})
|
|
4183
|
-
}
|
|
4184
|
-
}
|
|
4185
|
-
});
|
|
4186
|
-
return [
|
|
4187
|
-
protocolNode,
|
|
4188
|
-
protocolNodeConfigurationNode
|
|
4189
|
-
];
|
|
4252
|
+
const pickPreset = (preset)=>{
|
|
4253
|
+
setup.emit('pick', 'preset', preset);
|
|
4254
|
+
};
|
|
4255
|
+
return {
|
|
4256
|
+
protocols,
|
|
4257
|
+
presets,
|
|
4258
|
+
pickProtocol,
|
|
4259
|
+
pickPreset
|
|
4190
4260
|
};
|
|
4191
4261
|
}
|
|
4192
4262
|
});
|
|
4193
4263
|
|
|
4264
|
+
var _export_sfc = (sfc, props) => {
|
|
4265
|
+
const target = sfc.__vccOpts || sfc;
|
|
4266
|
+
for (const [key, val] of props) {
|
|
4267
|
+
target[key] = val;
|
|
4268
|
+
}
|
|
4269
|
+
return target;
|
|
4270
|
+
};
|
|
4271
|
+
|
|
4272
|
+
const _hoisted_1 = {
|
|
4273
|
+
class: "d-flex flex-column gap-2"
|
|
4274
|
+
};
|
|
4275
|
+
const _hoisted_2 = {
|
|
4276
|
+
class: "d-flex flex-row gap-2 flex-wrap"
|
|
4277
|
+
};
|
|
4278
|
+
const _hoisted_3 = [
|
|
4279
|
+
"onClick"
|
|
4280
|
+
];
|
|
4281
|
+
const _hoisted_4 = {
|
|
4282
|
+
class: "d-flex flex-row gap-2 flex-wrap"
|
|
4283
|
+
};
|
|
4284
|
+
const _hoisted_5 = [
|
|
4285
|
+
"onClick"
|
|
4286
|
+
];
|
|
4287
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
4288
|
+
const _component_AIdentityProviderProtocol = vue.resolveComponent("AIdentityProviderProtocol");
|
|
4289
|
+
const _component_AIdentityProviderPreset = vue.resolveComponent("AIdentityProviderPreset");
|
|
4290
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
4291
|
+
vue.createElementVNode("div", null, [
|
|
4292
|
+
_cache[0] || (_cache[0] = vue.createElementVNode("h6", null, "Protocols", -1)),
|
|
4293
|
+
vue.createElementVNode("div", _hoisted_2, [
|
|
4294
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.protocols, (item, key)=>{
|
|
4295
|
+
return vue.openBlock(), vue.createBlock(_component_AIdentityProviderProtocol, {
|
|
4296
|
+
key,
|
|
4297
|
+
id: item
|
|
4298
|
+
}, {
|
|
4299
|
+
default: vue.withCtx((props)=>[
|
|
4300
|
+
vue.createElementVNode("div", {
|
|
4301
|
+
class: vue.normalizeClass([
|
|
4302
|
+
{
|
|
4303
|
+
"active": item === _ctx.protocol && !_ctx.preset
|
|
4304
|
+
},
|
|
4305
|
+
"d-flex flex-column gap-1 text-center identity-provider-picker-item"
|
|
4306
|
+
]),
|
|
4307
|
+
onClick: vue.withModifiers(($event)=>_ctx.pickProtocol(item), [
|
|
4308
|
+
"prevent"
|
|
4309
|
+
])
|
|
4310
|
+
}, [
|
|
4311
|
+
vue.createElementVNode("div", null, [
|
|
4312
|
+
vue.createElementVNode("i", {
|
|
4313
|
+
class: vue.normalizeClass([
|
|
4314
|
+
"fa-2x",
|
|
4315
|
+
props.icon
|
|
4316
|
+
])
|
|
4317
|
+
}, null, 2)
|
|
4318
|
+
]),
|
|
4319
|
+
vue.createElementVNode("div", null, vue.toDisplayString(props.name), 1)
|
|
4320
|
+
], 10, _hoisted_3)
|
|
4321
|
+
]),
|
|
4322
|
+
_: 2
|
|
4323
|
+
}, 1032, [
|
|
4324
|
+
"id"
|
|
4325
|
+
]);
|
|
4326
|
+
}), 128))
|
|
4327
|
+
])
|
|
4328
|
+
]),
|
|
4329
|
+
vue.createElementVNode("div", null, [
|
|
4330
|
+
_cache[1] || (_cache[1] = vue.createElementVNode("h6", null, "Presets", -1)),
|
|
4331
|
+
vue.createElementVNode("div", _hoisted_4, [
|
|
4332
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.presets, (item, key)=>{
|
|
4333
|
+
return vue.openBlock(), vue.createBlock(_component_AIdentityProviderPreset, {
|
|
4334
|
+
key,
|
|
4335
|
+
id: item
|
|
4336
|
+
}, {
|
|
4337
|
+
default: vue.withCtx((props)=>[
|
|
4338
|
+
vue.createElementVNode("div", {
|
|
4339
|
+
class: vue.normalizeClass([
|
|
4340
|
+
{
|
|
4341
|
+
"active": item === _ctx.preset
|
|
4342
|
+
},
|
|
4343
|
+
"d-flex flex-column gap-1 text-center identity-provider-picker-item"
|
|
4344
|
+
]),
|
|
4345
|
+
onClick: vue.withModifiers(($event)=>_ctx.pickPreset(item), [
|
|
4346
|
+
"prevent"
|
|
4347
|
+
])
|
|
4348
|
+
}, [
|
|
4349
|
+
vue.createElementVNode("div", null, [
|
|
4350
|
+
vue.createElementVNode("i", {
|
|
4351
|
+
class: vue.normalizeClass([
|
|
4352
|
+
"fa-2x",
|
|
4353
|
+
props.icon
|
|
4354
|
+
])
|
|
4355
|
+
}, null, 2)
|
|
4356
|
+
]),
|
|
4357
|
+
vue.createElementVNode("div", null, vue.toDisplayString(props.name), 1)
|
|
4358
|
+
], 10, _hoisted_5)
|
|
4359
|
+
]),
|
|
4360
|
+
_: 2
|
|
4361
|
+
}, 1032, [
|
|
4362
|
+
"id"
|
|
4363
|
+
]);
|
|
4364
|
+
}), 128))
|
|
4365
|
+
])
|
|
4366
|
+
])
|
|
4367
|
+
]);
|
|
4368
|
+
}
|
|
4369
|
+
var AIdentityProviderPicker = /* @__PURE__ */ _export_sfc(_sfc_main, [
|
|
4370
|
+
[
|
|
4371
|
+
"render",
|
|
4372
|
+
_sfc_render
|
|
4373
|
+
],
|
|
4374
|
+
[
|
|
4375
|
+
"__scopeId",
|
|
4376
|
+
"data-v-0df1e731"
|
|
4377
|
+
]
|
|
4378
|
+
]);
|
|
4379
|
+
|
|
4194
4380
|
const AIdentityProviderOAuth2ClientFields = vue.defineComponent({
|
|
4195
4381
|
props: {
|
|
4196
4382
|
entity: {
|
|
@@ -4471,10 +4657,10 @@ const AIdentityProviderOAuth2Form = vue.defineComponent({
|
|
|
4471
4657
|
type: String
|
|
4472
4658
|
}
|
|
4473
4659
|
},
|
|
4474
|
-
emits:
|
|
4660
|
+
emits: defineResourceVEmitOptions(),
|
|
4475
4661
|
setup (props, ctx) {
|
|
4476
4662
|
const apiClient = injectHTTPClient();
|
|
4477
|
-
const manager =
|
|
4663
|
+
const manager = createResourceManager({
|
|
4478
4664
|
type: `${coreKit.DomainType.IDENTITY_PROVIDER}`,
|
|
4479
4665
|
setup: ctx,
|
|
4480
4666
|
props
|
|
@@ -4728,17 +4914,16 @@ const AIdentityProviderForm = vue.defineComponent({
|
|
|
4728
4914
|
set();
|
|
4729
4915
|
onChange(updatedAt, ()=>set());
|
|
4730
4916
|
const renderPicker = ()=>vue.h(AIdentityProviderPicker, {
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
preset.value = value.preset;
|
|
4739
|
-
} else {
|
|
4740
|
-
preset.value = null;
|
|
4917
|
+
protocol: protocol.value,
|
|
4918
|
+
preset: preset.value,
|
|
4919
|
+
onPick (type, value) {
|
|
4920
|
+
if (type === 'preset') {
|
|
4921
|
+
preset.value = value;
|
|
4922
|
+
protocol.value = `${coreKit.getIdentityProviderProtocolForPreset(value)}`;
|
|
4923
|
+
return;
|
|
4741
4924
|
}
|
|
4925
|
+
protocol.value = value;
|
|
4926
|
+
preset.value = null;
|
|
4742
4927
|
}
|
|
4743
4928
|
});
|
|
4744
4929
|
const render = (node)=>{
|
|
@@ -4810,11 +4995,11 @@ const AIdentityProviderForm = vue.defineComponent({
|
|
|
4810
4995
|
});
|
|
4811
4996
|
|
|
4812
4997
|
const AIdentityProviders = vue.defineComponent({
|
|
4813
|
-
props:
|
|
4998
|
+
props: defineResourceCollectionVProps(),
|
|
4814
4999
|
slots: Object,
|
|
4815
|
-
emits:
|
|
5000
|
+
emits: defineResourceCollectionVEmitOptions(),
|
|
4816
5001
|
setup (props, ctx) {
|
|
4817
|
-
const { render } =
|
|
5002
|
+
const { render } = createResourceCollectionManager({
|
|
4818
5003
|
type: `${coreKit.DomainType.IDENTITY_PROVIDER}`,
|
|
4819
5004
|
props,
|
|
4820
5005
|
setup: ctx
|
|
@@ -4882,7 +5067,7 @@ const AIdentityProviderRoleAssignment = vue.defineComponent({
|
|
|
4882
5067
|
required: true
|
|
4883
5068
|
}
|
|
4884
5069
|
},
|
|
4885
|
-
emits:
|
|
5070
|
+
emits: defineResourceVEmitOptions(),
|
|
4886
5071
|
async setup (props, setup) {
|
|
4887
5072
|
const display = vue.ref(false);
|
|
4888
5073
|
const toggleDisplay = ()=>{
|
|
@@ -4910,7 +5095,7 @@ const AIdentityProviderRoleAssignment = vue.defineComponent({
|
|
|
4910
5095
|
key: TranslatorTranslationDefaultKey.VALUE_IS_REGEX
|
|
4911
5096
|
}
|
|
4912
5097
|
]);
|
|
4913
|
-
const manager =
|
|
5098
|
+
const manager = createResourceManager({
|
|
4914
5099
|
type: `${coreKit.DomainType.IDENTITY_PROVIDER_ROLE_MAPPING}`,
|
|
4915
5100
|
setup,
|
|
4916
5101
|
socket: {
|
|
@@ -5091,7 +5276,7 @@ const ARoleForm = vue.defineComponent({
|
|
|
5091
5276
|
default: undefined
|
|
5092
5277
|
}
|
|
5093
5278
|
},
|
|
5094
|
-
emits:
|
|
5279
|
+
emits: defineResourceVEmitOptions(),
|
|
5095
5280
|
setup (props, ctx) {
|
|
5096
5281
|
const busy = vue.ref(false);
|
|
5097
5282
|
const form = vue.reactive({
|
|
@@ -5116,9 +5301,9 @@ const ARoleForm = vue.defineComponent({
|
|
|
5116
5301
|
},
|
|
5117
5302
|
realm_id: {}
|
|
5118
5303
|
}, form);
|
|
5119
|
-
const store =
|
|
5304
|
+
const store = injectStore();
|
|
5120
5305
|
const storeRefs = storeToRefs(store);
|
|
5121
|
-
const manager =
|
|
5306
|
+
const manager = createResourceManager({
|
|
5122
5307
|
type: `${coreKit.DomainType.ROLE}`,
|
|
5123
5308
|
setup: ctx,
|
|
5124
5309
|
props
|
|
@@ -5222,11 +5407,11 @@ const ARoleForm = vue.defineComponent({
|
|
|
5222
5407
|
});
|
|
5223
5408
|
|
|
5224
5409
|
const ARoles = vue.defineComponent({
|
|
5225
|
-
props:
|
|
5410
|
+
props: defineResourceCollectionVProps(),
|
|
5226
5411
|
slots: Object,
|
|
5227
|
-
emits:
|
|
5412
|
+
emits: defineResourceCollectionVEmitOptions(),
|
|
5228
5413
|
setup (props, ctx) {
|
|
5229
|
-
const { render } =
|
|
5414
|
+
const { render } = createResourceCollectionManager({
|
|
5230
5415
|
type: `${coreKit.DomainType.ROLE}`,
|
|
5231
5416
|
props,
|
|
5232
5417
|
setup: ctx
|
|
@@ -5251,11 +5436,11 @@ const ARoles = vue.defineComponent({
|
|
|
5251
5436
|
});
|
|
5252
5437
|
|
|
5253
5438
|
const ARole = vue.defineComponent({
|
|
5254
|
-
props:
|
|
5255
|
-
emits:
|
|
5439
|
+
props: defineResourceVProps(),
|
|
5440
|
+
emits: defineResourceVEmitOptions(),
|
|
5256
5441
|
slots: Object,
|
|
5257
5442
|
async setup (props, setup) {
|
|
5258
|
-
const manager =
|
|
5443
|
+
const manager = createResourceManager({
|
|
5259
5444
|
type: `${coreKit.DomainType.ROLE}`,
|
|
5260
5445
|
props,
|
|
5261
5446
|
setup
|
|
@@ -5291,11 +5476,11 @@ const AIdentityProviderRoleAssignments = vue.defineComponent({
|
|
|
5291
5476
|
});
|
|
5292
5477
|
|
|
5293
5478
|
const APermission = vue.defineComponent({
|
|
5294
|
-
props:
|
|
5295
|
-
emits:
|
|
5479
|
+
props: defineResourceVProps(),
|
|
5480
|
+
emits: defineResourceVEmitOptions(),
|
|
5296
5481
|
slots: Object,
|
|
5297
5482
|
async setup (props, setup) {
|
|
5298
|
-
const manager =
|
|
5483
|
+
const manager = createResourceManager({
|
|
5299
5484
|
type: `${coreKit.DomainType.PERMISSION}`,
|
|
5300
5485
|
setup,
|
|
5301
5486
|
props
|
|
@@ -5347,7 +5532,7 @@ const APermissionForm = vue.defineComponent({
|
|
|
5347
5532
|
type: Object
|
|
5348
5533
|
}
|
|
5349
5534
|
},
|
|
5350
|
-
emits:
|
|
5535
|
+
emits: defineResourceVEmitOptions(),
|
|
5351
5536
|
setup (props, ctx) {
|
|
5352
5537
|
const busy = vue.ref(false);
|
|
5353
5538
|
const form = vue.reactive({
|
|
@@ -5372,9 +5557,9 @@ const APermissionForm = vue.defineComponent({
|
|
|
5372
5557
|
},
|
|
5373
5558
|
realm_id: {}
|
|
5374
5559
|
}, form);
|
|
5375
|
-
const store =
|
|
5560
|
+
const store = injectStore();
|
|
5376
5561
|
const storeRefs = storeToRefs(store);
|
|
5377
|
-
const manager =
|
|
5562
|
+
const manager = createResourceManager({
|
|
5378
5563
|
type: `${coreKit.DomainType.PERMISSION}`,
|
|
5379
5564
|
setup: ctx,
|
|
5380
5565
|
props
|
|
@@ -5481,11 +5666,11 @@ const APermissionForm = vue.defineComponent({
|
|
|
5481
5666
|
});
|
|
5482
5667
|
|
|
5483
5668
|
const APermissions = vue.defineComponent({
|
|
5484
|
-
props:
|
|
5669
|
+
props: defineResourceCollectionVProps(),
|
|
5485
5670
|
slots: Object,
|
|
5486
|
-
emits:
|
|
5671
|
+
emits: defineResourceCollectionVEmitOptions(),
|
|
5487
5672
|
setup (props, setup) {
|
|
5488
|
-
const { render } =
|
|
5673
|
+
const { render } = createResourceCollectionManager({
|
|
5489
5674
|
type: `${coreKit.DomainType.PERMISSION}`,
|
|
5490
5675
|
props,
|
|
5491
5676
|
setup
|
|
@@ -5514,9 +5699,9 @@ const ARobotPermissionAssignment = vue.defineComponent({
|
|
|
5514
5699
|
robotId: String,
|
|
5515
5700
|
permissionId: String
|
|
5516
5701
|
},
|
|
5517
|
-
emits:
|
|
5702
|
+
emits: defineResourceVEmitOptions(),
|
|
5518
5703
|
async setup (props, setup) {
|
|
5519
|
-
const manager =
|
|
5704
|
+
const manager = createResourceManager({
|
|
5520
5705
|
type: `${coreKit.DomainType.ROBOT_PERMISSION}`,
|
|
5521
5706
|
setup,
|
|
5522
5707
|
socket: {
|
|
@@ -5546,11 +5731,11 @@ const ARobotPermissionAssignment = vue.defineComponent({
|
|
|
5546
5731
|
});
|
|
5547
5732
|
|
|
5548
5733
|
const ARobot = vue.defineComponent({
|
|
5549
|
-
props:
|
|
5550
|
-
emits:
|
|
5734
|
+
props: defineResourceVProps(),
|
|
5735
|
+
emits: defineResourceVEmitOptions(),
|
|
5551
5736
|
slots: Object,
|
|
5552
5737
|
async setup (props, setup) {
|
|
5553
|
-
const manager =
|
|
5738
|
+
const manager = createResourceManager({
|
|
5554
5739
|
type: `${coreKit.DomainType.ROBOT}`,
|
|
5555
5740
|
props,
|
|
5556
5741
|
setup
|
|
@@ -5579,7 +5764,7 @@ const ARobotForm = vue.defineComponent({
|
|
|
5579
5764
|
default: undefined
|
|
5580
5765
|
}
|
|
5581
5766
|
},
|
|
5582
|
-
emits:
|
|
5767
|
+
emits: defineResourceVEmitOptions(),
|
|
5583
5768
|
setup (props, ctx) {
|
|
5584
5769
|
const busy = vue.ref(false);
|
|
5585
5770
|
const form = vue.reactive({
|
|
@@ -5606,7 +5791,7 @@ const ARobotForm = vue.defineComponent({
|
|
|
5606
5791
|
maxLength: validators.maxLength(256)
|
|
5607
5792
|
}
|
|
5608
5793
|
}, form);
|
|
5609
|
-
const manager =
|
|
5794
|
+
const manager = createResourceManager({
|
|
5610
5795
|
type: `${coreKit.DomainType.ROBOT}`,
|
|
5611
5796
|
setup: ctx,
|
|
5612
5797
|
props
|
|
@@ -5808,11 +5993,11 @@ const ARobotForm = vue.defineComponent({
|
|
|
5808
5993
|
});
|
|
5809
5994
|
|
|
5810
5995
|
const ARobots = vue.defineComponent({
|
|
5811
|
-
props:
|
|
5996
|
+
props: defineResourceCollectionVProps(),
|
|
5812
5997
|
slots: Object,
|
|
5813
|
-
emits:
|
|
5998
|
+
emits: defineResourceCollectionVEmitOptions(),
|
|
5814
5999
|
setup (props, ctx) {
|
|
5815
|
-
const { render } =
|
|
6000
|
+
const { render } = createResourceCollectionManager({
|
|
5816
6001
|
type: `${coreKit.DomainType.ROBOT}`,
|
|
5817
6002
|
props,
|
|
5818
6003
|
setup: ctx
|
|
@@ -5860,9 +6045,9 @@ const ARolePermissionAssignment = vue.defineComponent({
|
|
|
5860
6045
|
roleId: String,
|
|
5861
6046
|
permissionId: String
|
|
5862
6047
|
},
|
|
5863
|
-
emits:
|
|
6048
|
+
emits: defineResourceVEmitOptions(),
|
|
5864
6049
|
async setup (props, setup) {
|
|
5865
|
-
const manager =
|
|
6050
|
+
const manager = createResourceManager({
|
|
5866
6051
|
type: `${coreKit.DomainType.ROLE_PERMISSION}`,
|
|
5867
6052
|
setup,
|
|
5868
6053
|
socket: {
|
|
@@ -5934,9 +6119,9 @@ const AUserPermissionAssignment = vue.defineComponent({
|
|
|
5934
6119
|
userId: String,
|
|
5935
6120
|
permissionId: String
|
|
5936
6121
|
},
|
|
5937
|
-
emits:
|
|
6122
|
+
emits: defineResourceVEmitOptions(),
|
|
5938
6123
|
async setup (props, setup) {
|
|
5939
|
-
const manager =
|
|
6124
|
+
const manager = createResourceManager({
|
|
5940
6125
|
type: `${coreKit.DomainType.USER_PERMISSION}`,
|
|
5941
6126
|
setup,
|
|
5942
6127
|
socket: {
|
|
@@ -5985,11 +6170,11 @@ const AUserPermissionAssignments = vue.defineComponent({
|
|
|
5985
6170
|
});
|
|
5986
6171
|
|
|
5987
6172
|
const AUser = vue.defineComponent({
|
|
5988
|
-
props:
|
|
5989
|
-
emits:
|
|
6173
|
+
props: defineResourceVProps(),
|
|
6174
|
+
emits: defineResourceVEmitOptions(),
|
|
5990
6175
|
slots: Object,
|
|
5991
6176
|
async setup (props, setup) {
|
|
5992
|
-
const manager =
|
|
6177
|
+
const manager = createResourceManager({
|
|
5993
6178
|
type: `${coreKit.DomainType.USER}`,
|
|
5994
6179
|
props,
|
|
5995
6180
|
setup
|
|
@@ -6018,7 +6203,7 @@ const AUserForm = vue.defineComponent({
|
|
|
6018
6203
|
default: true
|
|
6019
6204
|
}
|
|
6020
6205
|
},
|
|
6021
|
-
emits:
|
|
6206
|
+
emits: defineResourceVEmitOptions(),
|
|
6022
6207
|
async setup (props, ctx) {
|
|
6023
6208
|
const busy = vue.ref(false);
|
|
6024
6209
|
const form = vue.reactive({
|
|
@@ -6050,7 +6235,7 @@ const AUserForm = vue.defineComponent({
|
|
|
6050
6235
|
required: validators.required
|
|
6051
6236
|
}
|
|
6052
6237
|
}, form);
|
|
6053
|
-
const manager =
|
|
6238
|
+
const manager = createResourceManager({
|
|
6054
6239
|
type: `${coreKit.DomainType.USER}`,
|
|
6055
6240
|
setup: ctx,
|
|
6056
6241
|
props
|
|
@@ -6262,11 +6447,11 @@ const AUserForm = vue.defineComponent({
|
|
|
6262
6447
|
});
|
|
6263
6448
|
|
|
6264
6449
|
const AUsers = vue.defineComponent({
|
|
6265
|
-
props:
|
|
6450
|
+
props: defineResourceCollectionVProps(),
|
|
6266
6451
|
slots: Object,
|
|
6267
|
-
emits:
|
|
6452
|
+
emits: defineResourceCollectionVEmitOptions(),
|
|
6268
6453
|
setup (props, ctx) {
|
|
6269
|
-
const { render } =
|
|
6454
|
+
const { render } = createResourceCollectionManager({
|
|
6270
6455
|
type: `${coreKit.DomainType.USER}`,
|
|
6271
6456
|
props,
|
|
6272
6457
|
setup: ctx
|
|
@@ -6447,9 +6632,9 @@ const ARobotRoleAssignment = vue.defineComponent({
|
|
|
6447
6632
|
roleId: String,
|
|
6448
6633
|
robotId: String
|
|
6449
6634
|
},
|
|
6450
|
-
emits:
|
|
6635
|
+
emits: defineResourceVEmitOptions(),
|
|
6451
6636
|
async setup (props, setup) {
|
|
6452
|
-
const manager =
|
|
6637
|
+
const manager = createResourceManager({
|
|
6453
6638
|
type: `${coreKit.DomainType.ROBOT_ROLE}`,
|
|
6454
6639
|
setup,
|
|
6455
6640
|
socket: {
|
|
@@ -6514,9 +6699,9 @@ const AUserRoleAssignment = vue.defineComponent({
|
|
|
6514
6699
|
roleId: String,
|
|
6515
6700
|
userId: String
|
|
6516
6701
|
},
|
|
6517
|
-
emits:
|
|
6702
|
+
emits: defineResourceVEmitOptions(),
|
|
6518
6703
|
async setup (props, setup) {
|
|
6519
|
-
const manager =
|
|
6704
|
+
const manager = createResourceManager({
|
|
6520
6705
|
type: `${coreKit.DomainType.USER_ROLE}`,
|
|
6521
6706
|
setup,
|
|
6522
6707
|
socket: {
|
|
@@ -7177,33 +7362,34 @@ exports.AUserPermissionAssignments = AUserPermissionAssignments;
|
|
|
7177
7362
|
exports.AUserRoleAssignment = AUserRoleAssignment;
|
|
7178
7363
|
exports.AUserRoleAssignments = AUserRoleAssignments;
|
|
7179
7364
|
exports.AUsers = AUsers;
|
|
7180
|
-
exports.EntityManagerError = EntityManagerError;
|
|
7181
7365
|
exports.HTTPClientSymbol = HTTPClientSymbol;
|
|
7182
7366
|
exports.LanguageSwitcherDropdown = LanguageSwitcherDropdown;
|
|
7367
|
+
exports.ResourceRecordError = ResourceRecordError;
|
|
7183
7368
|
exports.STORE_ID = STORE_ID;
|
|
7184
7369
|
exports.SocketClientSymbol = SocketClientSymbol;
|
|
7185
|
-
exports.
|
|
7370
|
+
exports.StoreDispatcherEventName = StoreDispatcherEventName;
|
|
7186
7371
|
exports.TranslatorTranslationClientKey = TranslatorTranslationClientKey;
|
|
7187
7372
|
exports.TranslatorTranslationDefaultKey = TranslatorTranslationDefaultKey;
|
|
7188
7373
|
exports.TranslatorTranslationGroup = TranslatorTranslationGroup;
|
|
7189
7374
|
exports.TranslatorTranslationVuecsKey = TranslatorTranslationVuecsKey;
|
|
7190
7375
|
exports.VuelidateCustomRule = VuelidateCustomRule;
|
|
7191
7376
|
exports.VuelidateCustomRuleKey = VuelidateCustomRuleKey;
|
|
7192
|
-
exports.buildEntityManagerSlotProps = buildEntityManagerSlotProps;
|
|
7193
7377
|
exports.buildFormSubmitWithTranslations = buildFormSubmitWithTranslations;
|
|
7194
7378
|
exports.buildListCreatedHandler = buildListCreatedHandler;
|
|
7195
7379
|
exports.buildListDeletedHandler = buildListDeletedHandler;
|
|
7196
7380
|
exports.buildListUpdatedHandler = buildListUpdatedHandler;
|
|
7197
|
-
exports.
|
|
7381
|
+
exports.buildResourceVSlotProps = buildResourceVSlotProps;
|
|
7198
7382
|
exports.createFormSubmitTranslations = createFormSubmitTranslations;
|
|
7199
|
-
exports.createList = createList;
|
|
7200
7383
|
exports.createPermissionCheckerReactiveFn = createPermissionCheckerReactiveFn;
|
|
7384
|
+
exports.createResourceCollectionManager = createResourceCollectionManager;
|
|
7385
|
+
exports.createResourceManager = createResourceManager;
|
|
7201
7386
|
exports.createStore = createStore;
|
|
7387
|
+
exports.createStoreDispatcher = createStoreDispatcher;
|
|
7202
7388
|
exports.default = index;
|
|
7203
|
-
exports.
|
|
7204
|
-
exports.
|
|
7205
|
-
exports.
|
|
7206
|
-
exports.
|
|
7389
|
+
exports.defineResourceCollectionVEmitOptions = defineResourceCollectionVEmitOptions;
|
|
7390
|
+
exports.defineResourceCollectionVProps = defineResourceCollectionVProps;
|
|
7391
|
+
exports.defineResourceVEmitOptions = defineResourceVEmitOptions;
|
|
7392
|
+
exports.defineResourceVProps = defineResourceVProps;
|
|
7207
7393
|
exports.extendObjectProperties = extendObjectProperties;
|
|
7208
7394
|
exports.extractVuelidateResultsFromChild = extractVuelidateResultsFromChild;
|
|
7209
7395
|
exports.getVuelidateSeverity = getVuelidateSeverity;
|
|
@@ -7214,6 +7400,8 @@ exports.initFormAttributesFromSource = initFormAttributesFromSource;
|
|
|
7214
7400
|
exports.inject = inject$1;
|
|
7215
7401
|
exports.injectHTTPClient = injectHTTPClient;
|
|
7216
7402
|
exports.injectSocketManager = injectSocketManager;
|
|
7403
|
+
exports.injectStore = injectStore;
|
|
7404
|
+
exports.injectStoreDispatcher = injectStoreDispatcher;
|
|
7217
7405
|
exports.injectStoreFactory = injectStoreFactory;
|
|
7218
7406
|
exports.injectTranslatorLocale = injectTranslatorLocale;
|
|
7219
7407
|
exports.install = install;
|
|
@@ -7229,13 +7417,13 @@ exports.onChange = onChange;
|
|
|
7229
7417
|
exports.provide = provide;
|
|
7230
7418
|
exports.provideHTTPClient = provideHTTPClient;
|
|
7231
7419
|
exports.provideSocketManager = provideSocketManager;
|
|
7420
|
+
exports.provideStoreDispatcher = provideStoreDispatcher;
|
|
7232
7421
|
exports.provideStoreFactory = provideStoreFactory;
|
|
7233
7422
|
exports.renderEntityAssignAction = renderEntityAssignAction;
|
|
7234
7423
|
exports.storeToRefs = storeToRefs;
|
|
7235
7424
|
exports.useIsEditing = useIsEditing;
|
|
7236
7425
|
exports.usePermissionCheck = usePermissionCheck;
|
|
7237
7426
|
exports.useRealmResourceWritableCheck = useRealmResourceWritableCheck;
|
|
7238
|
-
exports.useStore = useStore;
|
|
7239
7427
|
exports.useTranslation = useTranslation;
|
|
7240
7428
|
exports.useTranslationsForBaseValidation = useTranslationsForBaseValidation;
|
|
7241
7429
|
exports.useTranslationsForGroup = useTranslationsForGroup;
|