@authup/client-web-kit 1.0.0-beta.10 → 1.0.0-beta.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/dist/components/AEntityDelete.d.ts +7 -7
  2. package/dist/components/client/AClient.d.ts +2 -2
  3. package/dist/components/client/AClientForm.d.ts +3 -3
  4. package/dist/components/client/AClientRedirectUrisItem.d.ts +2 -2
  5. package/dist/components/client/AClients.d.ts +6 -6
  6. package/dist/components/client-scope/AClientScope.d.ts +2 -2
  7. package/dist/components/client-scope/AClientScopeAssignment.d.ts +2 -2
  8. package/dist/components/client-scope/AClientScopes.d.ts +6 -6
  9. package/dist/components/identity-provider/AIdentityProvider.d.ts +2 -2
  10. package/dist/components/identity-provider/AIdentityProviderBasicFields.d.ts +3 -1
  11. package/dist/components/identity-provider/AIdentityProviderBasicFields.d.ts.map +1 -1
  12. package/dist/components/identity-provider/AIdentityProviderForm.d.ts +3 -3
  13. package/dist/components/identity-provider/AIdentityProviderLdapForm.d.ts +3 -3
  14. package/dist/components/identity-provider/AIdentityProviderOAuth2Discovery.d.ts +3 -2
  15. package/dist/components/identity-provider/AIdentityProviderOAuth2Discovery.d.ts.map +1 -1
  16. package/dist/components/identity-provider/AIdentityProviderOAuth2Form.d.ts +3 -3
  17. package/dist/components/identity-provider/AIdentityProviders.d.ts +6 -6
  18. package/dist/components/identity-provider-role/AIdentityProviderRoleAssignment.d.ts +2 -2
  19. package/dist/components/permission/APermission.d.ts +2 -2
  20. package/dist/components/permission/APermissionForm.d.ts +4 -8
  21. package/dist/components/permission/APermissionForm.d.ts.map +1 -1
  22. package/dist/components/permission/APermissions.d.ts +6 -6
  23. package/dist/components/realm/ARealm.d.ts +2 -2
  24. package/dist/components/realm/ARealmForm.d.ts +2 -2
  25. package/dist/components/realm/ARealms.d.ts +6 -6
  26. package/dist/components/realm/helpers/form-picker.d.ts +7 -0
  27. package/dist/components/realm/helpers/form-picker.d.ts.map +1 -0
  28. package/dist/components/realm/helpers/index.d.ts +2 -0
  29. package/dist/components/realm/helpers/index.d.ts.map +1 -0
  30. package/dist/components/robot/ARobot.d.ts +2 -2
  31. package/dist/components/robot/ARobotForm.d.ts +3 -3
  32. package/dist/components/robot/ARobots.d.ts +6 -6
  33. package/dist/components/robot-permission/ARobotPermissionAssignment.d.ts +2 -2
  34. package/dist/components/robot-role/ARobotRoleAssignment.d.ts +2 -2
  35. package/dist/components/role/ARole.d.ts +2 -2
  36. package/dist/components/role/ARoleForm.d.ts +2 -2
  37. package/dist/components/role/ARoleForm.d.ts.map +1 -1
  38. package/dist/components/role/ARoles.d.ts +6 -6
  39. package/dist/components/role-permission/ARolePermissionAssignment.d.ts +2 -2
  40. package/dist/components/scope/AScope.d.ts +2 -2
  41. package/dist/components/scope/AScopeForm.d.ts +2 -14
  42. package/dist/components/scope/AScopeForm.d.ts.map +1 -1
  43. package/dist/components/scope/AScopes.d.ts +6 -6
  44. package/dist/components/user/AUser.d.ts +2 -2
  45. package/dist/components/user/AUserForm.d.ts +3 -3
  46. package/dist/components/user/AUserPasswordForm.d.ts +3 -3
  47. package/dist/components/user/AUsers.d.ts +6 -6
  48. package/dist/components/user-permission/AUserPermissionAssignment.d.ts +2 -2
  49. package/dist/components/user-role/AUserRoleAssignment.d.ts +2 -2
  50. package/dist/components/utility/search/ASearch.d.ts +3 -1
  51. package/dist/components/utility/search/ASearch.d.ts.map +1 -1
  52. package/dist/components/utility/search/module.d.ts +3 -2
  53. package/dist/components/utility/search/module.d.ts.map +1 -1
  54. package/dist/composables/index.d.ts +2 -0
  55. package/dist/composables/index.d.ts.map +1 -1
  56. package/dist/composables/use-ability-check.d.ts +3 -0
  57. package/dist/composables/use-ability-check.d.ts.map +1 -0
  58. package/dist/composables/use-realm-resource-writable-check.d.ts +3 -0
  59. package/dist/composables/use-realm-resource-writable-check.d.ts.map +1 -0
  60. package/dist/core/http-client/index.d.ts +4 -0
  61. package/dist/core/http-client/index.d.ts.map +1 -0
  62. package/dist/core/http-client/install.d.ts +4 -0
  63. package/dist/core/http-client/install.d.ts.map +1 -0
  64. package/dist/core/http-client/singleton.d.ts +7 -0
  65. package/dist/core/http-client/singleton.d.ts.map +1 -0
  66. package/dist/core/http-client/types.d.ts +4 -0
  67. package/dist/core/http-client/types.d.ts.map +1 -0
  68. package/dist/core/index.d.ts +1 -1
  69. package/dist/core/index.d.ts.map +1 -1
  70. package/dist/core/socket-client-manager/index.d.ts +1 -0
  71. package/dist/core/socket-client-manager/index.d.ts.map +1 -1
  72. package/dist/core/socket-client-manager/install.d.ts +6 -0
  73. package/dist/core/socket-client-manager/install.d.ts.map +1 -0
  74. package/dist/core/store/constants.d.ts +2 -0
  75. package/dist/core/store/constants.d.ts.map +1 -0
  76. package/dist/core/store/{module.d.ts → create.d.ts} +12 -7
  77. package/dist/core/store/create.d.ts.map +1 -0
  78. package/dist/core/store/index.d.ts +4 -2
  79. package/dist/core/store/index.d.ts.map +1 -1
  80. package/dist/core/store/install.d.ts +4 -0
  81. package/dist/core/store/install.d.ts.map +1 -0
  82. package/dist/core/store/singleton.d.ts +6 -7
  83. package/dist/core/store/singleton.d.ts.map +1 -1
  84. package/dist/core/store/types.d.ts +26 -0
  85. package/dist/core/store/types.d.ts.map +1 -0
  86. package/dist/index.cjs +1351 -493
  87. package/dist/index.cjs.map +1 -1
  88. package/dist/index.d.ts +6 -5
  89. package/dist/index.d.ts.map +1 -1
  90. package/dist/index.mjs +1347 -501
  91. package/dist/index.mjs.map +1 -1
  92. package/dist/module.d.ts +5 -0
  93. package/dist/module.d.ts.map +1 -0
  94. package/dist/types.d.ts +9 -8
  95. package/dist/types.d.ts.map +1 -1
  96. package/package.json +16 -13
  97. package/dist/core/api-client.d.ts +0 -6
  98. package/dist/core/api-client.d.ts.map +0 -1
  99. package/dist/core/store/module.d.ts.map +0 -1
  100. package/dist/core/store/type.d.ts +0 -13
  101. package/dist/core/store/type.d.ts.map +0 -1
package/dist/index.mjs CHANGED
@@ -1,149 +1,1164 @@
1
- import { hasOwnProperty, merge, isObject, createMerger } from 'smob';
2
- import { hasInjectionContext, inject as inject$2, provide as provide$1, unref, h, ref, computed, toRaw, isRef, isReactive, toRef, onMounted, onUnmounted, watch, shallowRef, watchEffect, defineComponent, reactive, nextTick, getCurrentInstance, resolveDynamicComponent, mergeProps } from 'vue';
3
- import { REALM_MASTER_NAME, DomainEventName, buildDomainChannelName, DomainType, IdentityProviderProtocol, IdentityProviderPreset, getIdentityProviderProtocolForPreset } from '@authup/core-kit';
4
- import { AbilityManager, buildEventFullName, EventNameSuffix, hasOwnProperty as hasOwnProperty$1, createNanoID, isOAuth2OpenIDProviderMetadata, isObject as isObject$1 } from '@authup/kit';
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, toRaw, isRef, isReactive, toRef, getCurrentInstance, ref, watch, reactive, markRaw, effectScope, nextTick, computed, getCurrentScope, onScopeDispose, toRefs, unref, h, onMounted, onUnmounted, shallowRef, watchEffect, defineComponent, resolveDynamicComponent, mergeProps } from 'vue';
3
+ import { Client, isClientTokenExpiredError, CookieName, ClientResponseErrorTokenHook } from '@authup/core-http-kit';
4
+ import { Abilities, buildEventFullName, EventNameSuffix, hasOwnProperty, createNanoID, isOAuth2OpenIDProviderMetadata, isObject as isObject$1 } from '@authup/kit';
5
+ import { merge, isObject, createMerger } from 'smob';
5
6
  import { buildList, SlotName } from '@vuecs/list-controls';
6
- import { Client, isClientTokenExpiredError } from '@authup/core-http-kit';
7
+ import { ClientManager } from '@authup/core-realtime-kit';
7
8
  import { SortDirection } from 'rapiq';
8
9
  import { buildFormSubmit, buildFormGroup, buildFormInput, buildFormTextarea, buildFormInputCheckbox, buildFormInputText } from '@vuecs/form-controls';
9
10
  import { useTranslationsForBaseValidation as useTranslationsForBaseValidation$1, useTranslationsForNestedValidations, getSeverity, install as install$1 } from '@ilingo/vuelidate';
10
11
  import { helpers, required, minLength, maxLength, url, numeric, email, sameAs } from '@vuelidate/validators';
11
12
  import useVuelidate from '@vuelidate/core';
12
13
  import { buildPagination as buildPagination$1 } from '@vuecs/pagination';
14
+ import Cookie from 'universal-cookie';
13
15
 
14
- var StoreName;
15
- (function(StoreName) {
16
- StoreName["DEFAULT"] = "default";
17
- })(StoreName || (StoreName = {}));
18
- class Store {
16
+ function inject$1(key, instance) {
17
+ if (instance && instance._context && instance._context.provides && instance._context.provides[key]) {
18
+ return instance._context.provides[key];
19
+ }
20
+ if (hasInjectionContext()) {
21
+ return inject$2(key, undefined);
22
+ }
23
+ return undefined;
24
+ }
25
+
26
+ function provide(key, value, app) {
27
+ if (typeof app === 'undefined') {
28
+ const val = inject$1(key);
29
+ if (typeof val !== 'undefined') {
30
+ return;
31
+ }
32
+ provide$1(key, value);
33
+ return;
34
+ }
35
+ if (app && app._context && app._context.provides && app._context.provides[key]) {
36
+ return;
37
+ }
38
+ app.provide(key, value);
39
+ }
40
+
41
+ const HTTPClientSymbol = Symbol.for('AuthupHTTPClient');
42
+ function provideHTTPClient(client, app) {
43
+ provide(HTTPClientSymbol, client, app);
44
+ }
45
+ function hasHTTPClient(app) {
46
+ return !!inject$1(HTTPClientSymbol, app);
47
+ }
48
+ function injectHTTPClient(app) {
49
+ const instance = inject$1(HTTPClientSymbol, app);
50
+ if (!instance) {
51
+ throw new Error('The api client has not been injected.');
52
+ }
53
+ return instance;
54
+ }
55
+
56
+ var isVue2 = false;
57
+ function set(target, key, val) {
58
+ if (Array.isArray(target)) {
59
+ target.length = Math.max(target.length, key);
60
+ target.splice(key, 1, val);
61
+ return val;
62
+ }
63
+ target[key] = val;
64
+ return val;
65
+ }
66
+ function del(target, key) {
67
+ if (Array.isArray(target)) {
68
+ target.splice(key, 1);
69
+ return;
70
+ }
71
+ delete target[key];
72
+ }
73
+
74
+ /**
75
+ * setActivePinia must be called to handle SSR at the top of functions like
76
+ * `fetch`, `setup`, `serverPrefetch` and others
77
+ */ let activePinia;
78
+ /**
79
+ * Sets or unsets the active pinia. Used in SSR and internally when calling
80
+ * actions and getters
81
+ *
82
+ * @param pinia - Pinia instance
83
+ */ // @ts-expect-error: cannot constrain the type of the return
84
+ const setActivePinia = (pinia)=>activePinia = pinia;
85
+ const piniaSymbol = process.env.NODE_ENV !== 'production' ? Symbol('pinia') : /* istanbul ignore next */ Symbol();
86
+ function isPlainObject(// eslint-disable-next-line @typescript-eslint/no-explicit-any
87
+ o) {
88
+ return o && typeof o === 'object' && Object.prototype.toString.call(o) === '[object Object]' && typeof o.toJSON !== 'function';
89
+ }
90
+ // type DeepReadonly<T> = { readonly [P in keyof T]: DeepReadonly<T[P]> }
91
+ // TODO: can we change these to numbers?
92
+ /**
93
+ * Possible types for SubscriptionCallback
94
+ */ var MutationType;
95
+ (function(MutationType) {
96
+ /**
97
+ * Direct mutation of the state:
98
+ *
99
+ * - `store.name = 'new name'`
100
+ * - `store.$state.name = 'new name'`
101
+ * - `store.list.push('new item')`
102
+ */ MutationType["direct"] = "direct";
103
+ /**
104
+ * Mutated the state with `$patch` and an object
105
+ *
106
+ * - `store.$patch({ name: 'newName' })`
107
+ */ MutationType["patchObject"] = "patch object";
19
108
  /**
20
- * Set options for all groups.
109
+ * Mutated the state with `$patch` and a function
21
110
  *
22
- * @param items
23
- */ setAll(items) {
24
- const keys = Object.keys(items);
111
+ * - `store.$patch(state => state.name = 'newName')`
112
+ */ MutationType["patchFunction"] = "patch function";
113
+ // maybe reset? for $state = {} and $reset
114
+ })(MutationType || (MutationType = {}));
115
+ const IS_CLIENT = typeof window !== 'undefined';
116
+ /**
117
+ * Should we add the devtools plugins.
118
+ * - only if dev mode or forced through the prod devtools flag
119
+ * - not in test
120
+ * - only if window exists (could change in the future)
121
+ */ const USE_DEVTOOLS = (process.env.NODE_ENV !== 'production' || typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__) && !(process.env.NODE_ENV === 'test') && IS_CLIENT;
122
+ /**
123
+ * Mutates in place `newState` with `oldState` to _hot update_ it. It will
124
+ * remove any key not existing in `newState` and recursively merge plain
125
+ * objects.
126
+ *
127
+ * @param newState - new state object to be patched
128
+ * @param oldState - old state that should be used to patch newState
129
+ * @returns - newState
130
+ */ function patchObject(newState, oldState) {
131
+ // no need to go through symbols because they cannot be serialized anyway
132
+ for(const key in oldState){
133
+ const subPatch = oldState[key];
134
+ // skip the whole sub tree
135
+ if (!(key in newState)) {
136
+ continue;
137
+ }
138
+ const targetValue = newState[key];
139
+ if (isPlainObject(targetValue) && isPlainObject(subPatch) && !isRef(subPatch) && !isReactive(subPatch)) {
140
+ newState[key] = patchObject(targetValue, subPatch);
141
+ } else {
142
+ // objects are either a bit more complex (e.g. refs) or primitives, so we
143
+ // just set the whole thing
144
+ {
145
+ newState[key] = subPatch;
146
+ }
147
+ }
148
+ }
149
+ return newState;
150
+ }
151
+ const noop$1 = ()=>{};
152
+ function addSubscription(subscriptions, callback, detached, onCleanup = noop$1) {
153
+ subscriptions.push(callback);
154
+ const removeSubscription = ()=>{
155
+ const idx = subscriptions.indexOf(callback);
156
+ if (idx > -1) {
157
+ subscriptions.splice(idx, 1);
158
+ onCleanup();
159
+ }
160
+ };
161
+ if (!detached && getCurrentScope()) {
162
+ onScopeDispose(removeSubscription);
163
+ }
164
+ return removeSubscription;
165
+ }
166
+ function triggerSubscriptions(subscriptions, ...args) {
167
+ subscriptions.slice().forEach((callback)=>{
168
+ callback(...args);
169
+ });
170
+ }
171
+ const fallbackRunWithContext = (fn)=>fn();
172
+ function mergeReactiveObjects(target, patchToApply) {
173
+ // Handle Map instances
174
+ if (target instanceof Map && patchToApply instanceof Map) {
175
+ patchToApply.forEach((value, key)=>target.set(key, value));
176
+ }
177
+ // Handle Set instances
178
+ if (target instanceof Set && patchToApply instanceof Set) {
179
+ patchToApply.forEach(target.add, target);
180
+ }
181
+ // no need to go through symbols because they cannot be serialized anyway
182
+ for(const key in patchToApply){
183
+ if (!patchToApply.hasOwnProperty(key)) continue;
184
+ const subPatch = patchToApply[key];
185
+ const targetValue = target[key];
186
+ if (isPlainObject(targetValue) && isPlainObject(subPatch) && target.hasOwnProperty(key) && !isRef(subPatch) && !isReactive(subPatch)) {
187
+ // NOTE: here I wanted to warn about inconsistent types but it's not possible because in setup stores one might
188
+ // start the value of a property as a certain type e.g. a Map, and then for some reason, during SSR, change that
189
+ // to `undefined`. When trying to hydrate, we want to override the Map with `undefined`.
190
+ target[key] = mergeReactiveObjects(targetValue, subPatch);
191
+ } else {
192
+ // @ts-expect-error: subPatch is a valid value
193
+ target[key] = subPatch;
194
+ }
195
+ }
196
+ return target;
197
+ }
198
+ const skipHydrateSymbol = process.env.NODE_ENV !== 'production' ? Symbol('pinia:skipHydration') : /* istanbul ignore next */ Symbol();
199
+ /**
200
+ * Returns whether a value should be hydrated
201
+ *
202
+ * @param obj - target variable
203
+ * @returns true if `obj` should be hydrated
204
+ */ function shouldHydrate(obj) {
205
+ return !isPlainObject(obj) || !obj.hasOwnProperty(skipHydrateSymbol);
206
+ }
207
+ const { assign } = Object;
208
+ function isComputed(o) {
209
+ return !!(isRef(o) && o.effect);
210
+ }
211
+ function createOptionsStore(id, options, pinia, hot) {
212
+ const { state, actions, getters } = options;
213
+ const initialState = pinia.state.value[id];
214
+ let store;
215
+ function setup() {
216
+ if (!initialState && (!(process.env.NODE_ENV !== 'production') || !hot)) {
217
+ /* istanbul ignore if */ {
218
+ pinia.state.value[id] = state ? state() : {};
219
+ }
220
+ }
221
+ // avoid creating a state in pinia.state.value
222
+ const localState = process.env.NODE_ENV !== 'production' && hot ? toRefs(ref(state ? state() : {}).value) : toRefs(pinia.state.value[id]);
223
+ return assign(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name)=>{
224
+ if (process.env.NODE_ENV !== 'production' && name in localState) {
225
+ console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${name}" in store "${id}".`);
226
+ }
227
+ computedGetters[name] = markRaw(computed(()=>{
228
+ setActivePinia(pinia);
229
+ // it was created just before
230
+ const store = pinia._s.get(id);
231
+ // @ts-expect-error
232
+ // return getters![name].call(context, context)
233
+ // TODO: avoid reading the getter while assigning with a global variable
234
+ return getters[name].call(store, store);
235
+ }));
236
+ return computedGetters;
237
+ }, {}));
238
+ }
239
+ store = createSetupStore(id, setup, options, pinia, hot, true);
240
+ return store;
241
+ }
242
+ function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore) {
243
+ let scope;
244
+ const optionsForPlugin = assign({
245
+ actions: {}
246
+ }, options);
247
+ /* istanbul ignore if */ if (process.env.NODE_ENV !== 'production' && !pinia._e.active) {
248
+ throw new Error('Pinia destroyed');
249
+ }
250
+ // watcher options for $subscribe
251
+ const $subscribeOptions = {
252
+ deep: true
253
+ };
254
+ /* istanbul ignore else */ if (process.env.NODE_ENV !== 'production' && !isVue2) {
255
+ $subscribeOptions.onTrigger = (event)=>{
256
+ /* istanbul ignore else */ if (isListening) {
257
+ debuggerEvents = event;
258
+ // avoid triggering this while the store is being built and the state is being set in pinia
259
+ } else if (isListening == false && !store._hotUpdating) {
260
+ // let patch send all the events together later
261
+ /* istanbul ignore else */ if (Array.isArray(debuggerEvents)) {
262
+ debuggerEvents.push(event);
263
+ } else {
264
+ console.error('🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug.');
265
+ }
266
+ }
267
+ };
268
+ }
269
+ // internal state
270
+ let isListening; // set to true at the end
271
+ let isSyncListening; // set to true at the end
272
+ let subscriptions = [];
273
+ let actionSubscriptions = [];
274
+ let debuggerEvents;
275
+ const initialState = pinia.state.value[$id];
276
+ // avoid setting the state for option stores if it is set
277
+ // by the setup
278
+ if (!isOptionsStore && !initialState && (!(process.env.NODE_ENV !== 'production') || !hot)) {
279
+ /* istanbul ignore if */ {
280
+ pinia.state.value[$id] = {};
281
+ }
282
+ }
283
+ const hotState = ref({});
284
+ // avoid triggering too many listeners
285
+ // https://github.com/vuejs/pinia/issues/1129
286
+ let activeListener;
287
+ function $patch(partialStateOrMutator) {
288
+ let subscriptionMutation;
289
+ isListening = isSyncListening = false;
290
+ // reset the debugger events since patches are sync
291
+ /* istanbul ignore else */ if (process.env.NODE_ENV !== 'production') {
292
+ debuggerEvents = [];
293
+ }
294
+ if (typeof partialStateOrMutator === 'function') {
295
+ partialStateOrMutator(pinia.state.value[$id]);
296
+ subscriptionMutation = {
297
+ type: MutationType.patchFunction,
298
+ storeId: $id,
299
+ events: debuggerEvents
300
+ };
301
+ } else {
302
+ mergeReactiveObjects(pinia.state.value[$id], partialStateOrMutator);
303
+ subscriptionMutation = {
304
+ type: MutationType.patchObject,
305
+ payload: partialStateOrMutator,
306
+ storeId: $id,
307
+ events: debuggerEvents
308
+ };
309
+ }
310
+ const myListenerId = activeListener = Symbol();
311
+ nextTick().then(()=>{
312
+ if (activeListener === myListenerId) {
313
+ isListening = true;
314
+ }
315
+ });
316
+ isSyncListening = true;
317
+ // because we paused the watcher, we need to manually call the subscriptions
318
+ triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]);
319
+ }
320
+ const $reset = isOptionsStore ? function $reset() {
321
+ const { state } = options;
322
+ const newState = state ? state() : {};
323
+ // we use a patch to group all changes into one single subscription
324
+ this.$patch(($state)=>{
325
+ assign($state, newState);
326
+ });
327
+ } : /* istanbul ignore next */ process.env.NODE_ENV !== 'production' ? ()=>{
328
+ throw new Error(`🍍: Store "${$id}" is built using the setup syntax and does not implement $reset().`);
329
+ } : noop$1;
330
+ function $dispose() {
331
+ scope.stop();
332
+ subscriptions = [];
333
+ actionSubscriptions = [];
334
+ pinia._s.delete($id);
335
+ }
336
+ /**
337
+ * Wraps an action to handle subscriptions.
338
+ *
339
+ * @param name - name of the action
340
+ * @param action - action to wrap
341
+ * @returns a wrapped action to handle subscriptions
342
+ */ function wrapAction(name, action) {
343
+ return function() {
344
+ setActivePinia(pinia);
345
+ const args = Array.from(arguments);
346
+ const afterCallbackList = [];
347
+ const onErrorCallbackList = [];
348
+ function after(callback) {
349
+ afterCallbackList.push(callback);
350
+ }
351
+ function onError(callback) {
352
+ onErrorCallbackList.push(callback);
353
+ }
354
+ // @ts-expect-error
355
+ triggerSubscriptions(actionSubscriptions, {
356
+ args,
357
+ name,
358
+ store,
359
+ after,
360
+ onError
361
+ });
362
+ let ret;
363
+ try {
364
+ ret = action.apply(this && this.$id === $id ? this : store, args);
365
+ // handle sync errors
366
+ } catch (error) {
367
+ triggerSubscriptions(onErrorCallbackList, error);
368
+ throw error;
369
+ }
370
+ if (ret instanceof Promise) {
371
+ return ret.then((value)=>{
372
+ triggerSubscriptions(afterCallbackList, value);
373
+ return value;
374
+ }).catch((error)=>{
375
+ triggerSubscriptions(onErrorCallbackList, error);
376
+ return Promise.reject(error);
377
+ });
378
+ }
379
+ // trigger after callbacks
380
+ triggerSubscriptions(afterCallbackList, ret);
381
+ return ret;
382
+ };
383
+ }
384
+ const _hmrPayload = /*#__PURE__*/ markRaw({
385
+ actions: {},
386
+ getters: {},
387
+ state: [],
388
+ hotState
389
+ });
390
+ const partialStore = {
391
+ _p: pinia,
392
+ // _s: scope,
393
+ $id,
394
+ $onAction: addSubscription.bind(null, actionSubscriptions),
395
+ $patch,
396
+ $reset,
397
+ $subscribe (callback, options = {}) {
398
+ const removeSubscription = addSubscription(subscriptions, callback, options.detached, ()=>stopWatcher());
399
+ const stopWatcher = scope.run(()=>watch(()=>pinia.state.value[$id], (state)=>{
400
+ if (options.flush === 'sync' ? isSyncListening : isListening) {
401
+ callback({
402
+ storeId: $id,
403
+ type: MutationType.direct,
404
+ events: debuggerEvents
405
+ }, state);
406
+ }
407
+ }, assign({}, $subscribeOptions, options)));
408
+ return removeSubscription;
409
+ },
410
+ $dispose
411
+ };
412
+ const store = reactive(process.env.NODE_ENV !== 'production' || USE_DEVTOOLS ? assign({
413
+ _hmrPayload,
414
+ _customProperties: markRaw(new Set())
415
+ }, partialStore) : partialStore);
416
+ // store the partial store now so the setup of stores can instantiate each other before they are finished without
417
+ // creating infinite loops.
418
+ pinia._s.set($id, store);
419
+ const runWithContext = pinia._a && pinia._a.runWithContext || fallbackRunWithContext;
420
+ // TODO: idea create skipSerialize that marks properties as non serializable and they are skipped
421
+ const setupStore = runWithContext(()=>pinia._e.run(()=>(scope = effectScope()).run(setup)));
422
+ // overwrite existing actions to support $onAction
423
+ for(const key in setupStore){
424
+ const prop = setupStore[key];
425
+ if (isRef(prop) && !isComputed(prop) || isReactive(prop)) {
426
+ // mark it as a piece of state to be serialized
427
+ if (process.env.NODE_ENV !== 'production' && hot) {
428
+ set(hotState.value, key, toRef(setupStore, key));
429
+ // createOptionStore directly sets the state in pinia.state.value so we
430
+ // can just skip that
431
+ } else if (!isOptionsStore) {
432
+ // in setup stores we must hydrate the state and sync pinia state tree with the refs the user just created
433
+ if (initialState && shouldHydrate(prop)) {
434
+ if (isRef(prop)) {
435
+ prop.value = initialState[key];
436
+ } else {
437
+ // probably a reactive object, lets recursively assign
438
+ // @ts-expect-error: prop is unknown
439
+ mergeReactiveObjects(prop, initialState[key]);
440
+ }
441
+ }
442
+ // transfer the ref to the pinia state to keep everything in sync
443
+ /* istanbul ignore if */ {
444
+ pinia.state.value[$id][key] = prop;
445
+ }
446
+ }
447
+ /* istanbul ignore else */ if (process.env.NODE_ENV !== 'production') {
448
+ _hmrPayload.state.push(key);
449
+ }
450
+ // action
451
+ } else if (typeof prop === 'function') {
452
+ // @ts-expect-error: we are overriding the function we avoid wrapping if
453
+ const actionValue = process.env.NODE_ENV !== 'production' && hot ? prop : wrapAction(key, prop);
454
+ // this a hot module replacement store because the hotUpdate method needs
455
+ // to do it with the right context
456
+ /* istanbul ignore if */ {
457
+ // @ts-expect-error
458
+ setupStore[key] = actionValue;
459
+ }
460
+ /* istanbul ignore else */ if (process.env.NODE_ENV !== 'production') {
461
+ _hmrPayload.actions[key] = prop;
462
+ }
463
+ // list actions so they can be used in plugins
464
+ // @ts-expect-error
465
+ optionsForPlugin.actions[key] = prop;
466
+ } else if (process.env.NODE_ENV !== 'production') {
467
+ // add getters for devtools
468
+ if (isComputed(prop)) {
469
+ _hmrPayload.getters[key] = isOptionsStore ? options.getters[key] : prop;
470
+ if (IS_CLIENT) {
471
+ const getters = setupStore._getters || // @ts-expect-error: same
472
+ (setupStore._getters = markRaw([]));
473
+ getters.push(key);
474
+ }
475
+ }
476
+ }
477
+ }
478
+ // add the state, getters, and action properties
479
+ /* istanbul ignore if */ {
480
+ assign(store, setupStore);
481
+ // allows retrieving reactive objects with `storeToRefs()`. Must be called after assigning to the reactive object.
482
+ // Make `storeToRefs()` work with `reactive()` #799
483
+ assign(toRaw(store), setupStore);
484
+ }
485
+ // use this instead of a computed with setter to be able to create it anywhere
486
+ // without linking the computed lifespan to wherever the store is first
487
+ // created.
488
+ Object.defineProperty(store, '$state', {
489
+ get: ()=>process.env.NODE_ENV !== 'production' && hot ? hotState.value : pinia.state.value[$id],
490
+ set: (state)=>{
491
+ /* istanbul ignore if */ if (process.env.NODE_ENV !== 'production' && hot) {
492
+ throw new Error('cannot set hotState');
493
+ }
494
+ $patch(($state)=>{
495
+ assign($state, state);
496
+ });
497
+ }
498
+ });
499
+ // add the hotUpdate before plugins to allow them to override it
500
+ /* istanbul ignore else */ if (process.env.NODE_ENV !== 'production') {
501
+ store._hotUpdate = markRaw((newStore)=>{
502
+ store._hotUpdating = true;
503
+ newStore._hmrPayload.state.forEach((stateKey)=>{
504
+ if (stateKey in store.$state) {
505
+ const newStateTarget = newStore.$state[stateKey];
506
+ const oldStateSource = store.$state[stateKey];
507
+ if (typeof newStateTarget === 'object' && isPlainObject(newStateTarget) && isPlainObject(oldStateSource)) {
508
+ patchObject(newStateTarget, oldStateSource);
509
+ } else {
510
+ // transfer the ref
511
+ newStore.$state[stateKey] = oldStateSource;
512
+ }
513
+ }
514
+ // patch direct access properties to allow store.stateProperty to work as
515
+ // store.$state.stateProperty
516
+ set(store, stateKey, toRef(newStore.$state, stateKey));
517
+ });
518
+ // remove deleted state properties
519
+ Object.keys(store.$state).forEach((stateKey)=>{
520
+ if (!(stateKey in newStore.$state)) {
521
+ del(store, stateKey);
522
+ }
523
+ });
524
+ // avoid devtools logging this as a mutation
525
+ isListening = false;
526
+ isSyncListening = false;
527
+ pinia.state.value[$id] = toRef(newStore._hmrPayload, 'hotState');
528
+ isSyncListening = true;
529
+ nextTick().then(()=>{
530
+ isListening = true;
531
+ });
532
+ for(const actionName in newStore._hmrPayload.actions){
533
+ const action = newStore[actionName];
534
+ set(store, actionName, wrapAction(actionName, action));
535
+ }
536
+ // TODO: does this work in both setup and option store?
537
+ for(const getterName in newStore._hmrPayload.getters){
538
+ const getter = newStore._hmrPayload.getters[getterName];
539
+ const getterValue = isOptionsStore ? computed(()=>{
540
+ setActivePinia(pinia);
541
+ return getter.call(store, store);
542
+ }) : getter;
543
+ set(store, getterName, getterValue);
544
+ }
545
+ // remove deleted getters
546
+ Object.keys(store._hmrPayload.getters).forEach((key)=>{
547
+ if (!(key in newStore._hmrPayload.getters)) {
548
+ del(store, key);
549
+ }
550
+ });
551
+ // remove old actions
552
+ Object.keys(store._hmrPayload.actions).forEach((key)=>{
553
+ if (!(key in newStore._hmrPayload.actions)) {
554
+ del(store, key);
555
+ }
556
+ });
557
+ // update the values used in devtools and to allow deleting new properties later on
558
+ store._hmrPayload = newStore._hmrPayload;
559
+ store._getters = newStore._getters;
560
+ store._hotUpdating = false;
561
+ });
562
+ }
563
+ if (USE_DEVTOOLS) {
564
+ const nonEnumerable = {
565
+ writable: true,
566
+ configurable: true,
567
+ // avoid warning on devtools trying to display this property
568
+ enumerable: false
569
+ };
570
+ [
571
+ '_p',
572
+ '_hmrPayload',
573
+ '_getters',
574
+ '_customProperties'
575
+ ].forEach((p)=>{
576
+ Object.defineProperty(store, p, assign({
577
+ value: store[p]
578
+ }, nonEnumerable));
579
+ });
580
+ }
581
+ // apply all plugins
582
+ pinia._p.forEach((extender)=>{
583
+ /* istanbul ignore else */ if (USE_DEVTOOLS) {
584
+ const extensions = scope.run(()=>extender({
585
+ store,
586
+ app: pinia._a,
587
+ pinia,
588
+ options: optionsForPlugin
589
+ }));
590
+ Object.keys(extensions || {}).forEach((key)=>store._customProperties.add(key));
591
+ assign(store, extensions);
592
+ } else {
593
+ assign(store, scope.run(()=>extender({
594
+ store,
595
+ app: pinia._a,
596
+ pinia,
597
+ options: optionsForPlugin
598
+ })));
599
+ }
600
+ });
601
+ if (process.env.NODE_ENV !== 'production' && store.$state && typeof store.$state === 'object' && typeof store.$state.constructor === 'function' && !store.$state.constructor.toString().includes('[native code]')) {
602
+ console.warn(`[🍍]: The "state" must be a plain object. It cannot be\n` + `\tstate: () => new MyClass()\n` + `Found in store "${store.$id}".`);
603
+ }
604
+ // only apply hydrate to option stores with an initial state in pinia
605
+ if (initialState && isOptionsStore && options.hydrate) {
606
+ options.hydrate(store.$state, initialState);
607
+ }
608
+ isListening = true;
609
+ isSyncListening = true;
610
+ return store;
611
+ }
612
+ function defineStore(// TODO: add proper types from above
613
+ idOrOptions, setup, setupOptions) {
614
+ let id;
615
+ let options;
616
+ const isSetupStore = typeof setup === 'function';
617
+ {
618
+ id = idOrOptions;
619
+ // the option store setup will contain the actual options in this case
620
+ options = isSetupStore ? setupOptions : setup;
621
+ }
622
+ function useStore(pinia, hot) {
623
+ const hasContext = hasInjectionContext();
624
+ pinia = // in test mode, ignore the argument provided as we can always retrieve a
625
+ // pinia instance with getActivePinia()
626
+ (process.env.NODE_ENV === 'test' && activePinia && activePinia._testing ? null : pinia) || (hasContext ? inject$2(piniaSymbol, null) : null);
627
+ if (pinia) setActivePinia(pinia);
628
+ if (process.env.NODE_ENV !== 'production' && !activePinia) {
629
+ throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?\n` + `See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.\n` + `This will fail in production.`);
630
+ }
631
+ pinia = activePinia;
632
+ if (!pinia._s.has(id)) {
633
+ // creating the store registers it in `pinia._s`
634
+ if (isSetupStore) {
635
+ createSetupStore(id, setup, options, pinia);
636
+ } else {
637
+ createOptionsStore(id, options, pinia);
638
+ }
639
+ /* istanbul ignore else */ if (process.env.NODE_ENV !== 'production') {
640
+ // @ts-expect-error: not the right inferred type
641
+ useStore._pinia = pinia;
642
+ }
643
+ }
644
+ const store = pinia._s.get(id);
645
+ if (process.env.NODE_ENV !== 'production' && hot) {
646
+ const hotId = '__hot:' + id;
647
+ const newStore = isSetupStore ? createSetupStore(hotId, setup, options, pinia, true) : createOptionsStore(hotId, assign({}, options), pinia, true);
648
+ hot._hotUpdate(newStore);
649
+ // cleanup the state properties and the store from the cache
650
+ delete pinia.state.value[hotId];
651
+ pinia._s.delete(hotId);
652
+ }
653
+ if (process.env.NODE_ENV !== 'production' && IS_CLIENT) {
654
+ const currentInstance = getCurrentInstance();
655
+ // save stores in instances to access them devtools
656
+ if (currentInstance && currentInstance.proxy && // avoid adding stores that are just built for hot module replacement
657
+ !hot) {
658
+ const vm = currentInstance.proxy;
659
+ const cache = '_pStores' in vm ? vm._pStores : vm._pStores = {};
660
+ cache[id] = store;
661
+ }
662
+ }
663
+ // StoreGeneric cannot be casted towards Store
664
+ return store;
665
+ }
666
+ useStore.$id = id;
667
+ return useStore;
668
+ }
669
+ /**
670
+ * Creates an object of references with all the state, getters, and plugin-added
671
+ * state properties of the store. Similar to `toRefs()` but specifically
672
+ * designed for Pinia stores so methods and non reactive properties are
673
+ * completely ignored.
674
+ *
675
+ * @param store - store to extract the refs from
676
+ */ function storeToRefs$1(store) {
677
+ // See https://github.com/vuejs/pinia/issues/852
678
+ // It's easier to just use toRefs() even if it includes more stuff
679
+ {
680
+ store = toRaw(store);
681
+ const refs = {};
682
+ for(const key in store){
683
+ const value = store[key];
684
+ if (isRef(value) || isReactive(value)) {
685
+ // @ts-expect-error: the key is state or getter
686
+ refs[key] = // ---
687
+ toRef(store, key);
688
+ }
689
+ }
690
+ return refs;
691
+ }
692
+ }
693
+
694
+ /*
695
+ * Copyright (c) 2024.
696
+ * Author Peter Placzek (tada5hi)
697
+ * For the full copyright and license information,
698
+ * view the LICENSE file that was distributed with this source code.
699
+ */ const STORE_ID = 'authup';
700
+
701
+ function createStore(context = {}) {
702
+ const client = new Client({
703
+ baseURL: context.baseURL
704
+ });
705
+ const initialized = ref(false);
706
+ const setInitialized = (value)=>{
707
+ initialized.value = value;
708
+ };
709
+ // --------------------------------------------------------------------
710
+ const accessToken = ref(undefined);
711
+ const setAccessToken = (input)=>{
712
+ accessToken.value = input;
713
+ };
714
+ // --------------------------------------------------------------------
715
+ const accessTokenExpireDate = ref(undefined);
716
+ const setAccessTokenExpireDate = (input)=>{
717
+ if (typeof input === 'number' || typeof input === 'string') {
718
+ accessTokenExpireDate.value = new Date(input); // verify microseconds or seconds
719
+ return;
720
+ }
721
+ accessTokenExpireDate.value = input;
722
+ };
723
+ // --------------------------------------------------------------------
724
+ const refreshToken = ref(undefined);
725
+ const setRefreshToken = (input)=>{
726
+ refreshToken.value = input;
727
+ };
728
+ // --------------------------------------------------------------------
729
+ const handleTokenGrantResponse = (response)=>{
730
+ const expireDate = new Date(Date.now() + response.expires_in * 1000);
731
+ setAccessTokenExpireDate(expireDate);
732
+ setAccessToken(response.access_token);
733
+ setRefreshToken(response.refresh_token);
734
+ };
735
+ // --------------------------------------------------------------------
736
+ let refreshTokenPromise;
737
+ const attemptRefreshToken = ()=>{
738
+ if (!refreshToken.value) {
739
+ return Promise.reject(new Error('No refresh token is present.'));
740
+ }
741
+ if (refreshTokenPromise) {
742
+ return refreshTokenPromise;
743
+ }
744
+ refreshTokenPromise = client.token.createWithRefreshToken({
745
+ refresh_token: refreshToken.value
746
+ }).then((r)=>{
747
+ handleTokenGrantResponse(r);
748
+ return r;
749
+ }).finally(()=>{
750
+ refreshTokenPromise = undefined;
751
+ });
752
+ return refreshTokenPromise;
753
+ };
754
+ // --------------------------------------------------------------------
755
+ const user = ref(undefined);
756
+ const userId = computed(()=>user.value ? user.value.id : undefined);
757
+ const userResolved = ref(false);
758
+ const setUser = (entity)=>{
759
+ user.value = entity;
760
+ userResolved.value = !!entity;
761
+ };
762
+ // --------------------------------------------------------------------
763
+ const realm = ref(undefined);
764
+ const realmId = computed(()=>realm.value ? realm.value.id : undefined);
765
+ const realmName = computed(()=>realm.value ? realm.value.name : undefined);
766
+ const realmIsRoot = computed(()=>{
767
+ if (realm.value) {
768
+ return realm.value.name === REALM_MASTER_NAME;
769
+ }
770
+ return false;
771
+ });
772
+ const setRealm = (entity)=>{
773
+ realm.value = entity;
774
+ };
775
+ const realmManagement = ref(undefined);
776
+ const realmManagementId = computed(()=>realmManagement.value ? realmManagement.value.id : realmId.value);
777
+ const realmManagementName = computed(()=>realmManagement.value ? realmManagement.value.name : realmName.value);
778
+ const setRealmManagement = (entity)=>{
779
+ realmManagement.value = entity;
780
+ };
781
+ const abilities = new Abilities();
782
+ const tokenInfo = ref(undefined);
783
+ const tokenResolved = ref(false);
784
+ const setTokenInfo = (entity)=>{
785
+ tokenResolved.value = !!entity;
786
+ tokenInfo.value = entity;
787
+ if (!entity) {
788
+ setRealm(undefined);
789
+ setRealmManagement(undefined);
790
+ abilities.set([]);
791
+ return;
792
+ }
793
+ if (entity.exp) {
794
+ const expireDate = new Date(entity.exp * 1000);
795
+ setAccessTokenExpireDate(expireDate);
796
+ }
797
+ if (entity.realm_id && entity.realm_name) {
798
+ realm.value = {
799
+ id: entity.realm_id,
800
+ name: entity.realm_name
801
+ };
802
+ if (typeof realmManagement.value === 'undefined') {
803
+ setRealmManagement(realm.value);
804
+ }
805
+ }
806
+ if (entity.permissions) {
807
+ abilities.set(entity.permissions);
808
+ }
809
+ };
810
+ // --------------------------------------------------------------------
811
+ const resolve = async (ctx = {})=>{
812
+ if (!accessToken.value || ctx.attempts && ctx.attempts > 3) return;
813
+ try {
814
+ if (!tokenResolved.value || ctx.refresh) {
815
+ const token = await client.token.introspect({
816
+ token: accessToken.value
817
+ }, {
818
+ authorizationHeader: {
819
+ type: 'Bearer',
820
+ token: accessToken.value
821
+ }
822
+ });
823
+ setTokenInfo(token);
824
+ tokenResolved.value = true;
825
+ }
826
+ if (!userResolved.value || ctx.refresh) {
827
+ const entity = await client.userInfo.get(`Bearer ${accessToken.value}`);
828
+ setUser(entity);
829
+ userResolved.value = true;
830
+ }
831
+ } catch (e) {
832
+ if (isClientTokenExpiredError(e)) {
833
+ await attemptRefreshToken();
834
+ await resolve({
835
+ refresh: true,
836
+ attempts: ctx.attempts ? ctx.attempts++ : 1
837
+ });
838
+ return;
839
+ }
840
+ throw e;
841
+ }
842
+ };
843
+ const loggedIn = computed(()=>!!accessToken.value);
844
+ const login = async (ctx)=>{
845
+ try {
846
+ const response = await client.token.createWithPasswordGrant({
847
+ username: ctx.name,
848
+ password: ctx.password,
849
+ ...realmId.value ? {
850
+ realm_id: ctx.realmId
851
+ } : {}
852
+ });
853
+ handleTokenGrantResponse(response);
854
+ await resolve();
855
+ } catch (e) {
856
+ setUser(undefined);
857
+ throw e;
858
+ }
859
+ };
860
+ const logout = ()=>{
861
+ setAccessToken(undefined);
862
+ setAccessTokenExpireDate(undefined);
863
+ setRefreshToken(undefined);
864
+ setUser(undefined);
865
+ setTokenInfo(undefined);
866
+ };
867
+ return {
868
+ initialized,
869
+ setInitialized,
870
+ abilities,
871
+ login,
872
+ logout,
873
+ loggedIn,
874
+ resolve,
875
+ handleTokenGrantResponse,
876
+ accessToken,
877
+ setAccessToken,
878
+ accessTokenExpireDate,
879
+ setAccessTokenExpireDate,
880
+ refreshToken,
881
+ setRefreshToken,
882
+ tokenInfo,
883
+ setTokenInfo,
884
+ realm,
885
+ realmId,
886
+ realmIsRoot,
887
+ realmName,
888
+ setRealm,
889
+ realmManagement,
890
+ realmManagementId,
891
+ realmManagementName,
892
+ setRealmManagement,
893
+ user,
894
+ userId,
895
+ setUser
896
+ };
897
+ }
898
+
899
+ function tryOnScopeDispose(fn) {
900
+ if (getCurrentScope()) {
901
+ onScopeDispose(fn);
902
+ return true;
903
+ }
904
+ return false;
905
+ }
906
+ typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
907
+ const noop = ()=>{};
908
+
909
+ function useCookies(dependencies, { doNotParse = false, autoUpdateDependencies = false } = {}, cookies = new Cookie()) {
910
+ const watchingDependencies = autoUpdateDependencies ? [
911
+ ...[]
912
+ ] : dependencies;
913
+ let previousCookies = cookies.getAll({
914
+ doNotParse: true
915
+ });
916
+ const touches = ref(0);
917
+ const onChange = ()=>{
918
+ const newCookies = cookies.getAll({
919
+ doNotParse: true
920
+ });
921
+ if (shouldUpdate(watchingDependencies || null, newCookies, previousCookies)) touches.value++;
922
+ previousCookies = newCookies;
923
+ };
924
+ cookies.addChangeListener(onChange);
925
+ tryOnScopeDispose(()=>{
926
+ cookies.removeChangeListener(onChange);
927
+ });
928
+ return {
929
+ /**
930
+ * Reactive get cookie by name. If **autoUpdateDependencies = true** then it will update watching dependencies
931
+ */ get: (...args)=>{
932
+ if (autoUpdateDependencies && watchingDependencies && !watchingDependencies.includes(args[0])) watchingDependencies.push(args[0]);
933
+ touches.value;
934
+ return cookies.get(args[0], {
935
+ doNotParse,
936
+ ...args[1]
937
+ });
938
+ },
939
+ /**
940
+ * Reactive get all cookies
941
+ */ getAll: (...args)=>{
942
+ touches.value;
943
+ return cookies.getAll({
944
+ doNotParse,
945
+ ...args[0]
946
+ });
947
+ },
948
+ set: (...args)=>cookies.set(...args),
949
+ remove: (...args)=>cookies.remove(...args),
950
+ addChangeListener: (...args)=>cookies.addChangeListener(...args),
951
+ removeChangeListener: (...args)=>cookies.removeChangeListener(...args)
952
+ };
953
+ }
954
+ function shouldUpdate(dependencies, newCookies, oldCookies) {
955
+ if (!dependencies) return true;
956
+ for (const dependency of dependencies){
957
+ if (newCookies[dependency] !== oldCookies[dependency]) return true;
958
+ }
959
+ return false;
960
+ }
961
+
962
+ const StoreSymbol = Symbol.for('AuthupStore');
963
+ function useStore(pinia, app) {
964
+ const instance = injectStore(app);
965
+ if (!instance) {
966
+ throw new Error('The store has not been injected in the app context.');
967
+ }
968
+ return instance(pinia);
969
+ }
970
+ function injectStore(app) {
971
+ const instance = inject$1(StoreSymbol, app);
972
+ if (!instance) {
973
+ throw new Error('The store has not been injected in the app context.');
974
+ }
975
+ return instance;
976
+ }
977
+ function hasStore(app) {
978
+ return !!inject$1(StoreSymbol, app);
979
+ }
980
+ function provideStore(store, app) {
981
+ provide(StoreSymbol, store, app);
982
+ }
983
+
984
+ function installStore(app, options = {}) {
985
+ if (hasStore(app)) {
986
+ return;
987
+ }
988
+ const storeCreator = defineStore(STORE_ID, ()=>createStore({
989
+ baseURL: options.baseURL
990
+ }));
991
+ const store = storeCreator();
992
+ const cookies = useCookies();
993
+ let cookieGet;
994
+ if (options.cookieGet) {
995
+ cookieGet = options.cookieGet;
996
+ } else {
997
+ cookieGet = cookies.get;
998
+ }
999
+ let cookieSet;
1000
+ if (options.cookieSet) {
1001
+ cookieSet = options.cookieSet;
1002
+ } else {
1003
+ cookieSet = cookies.set;
1004
+ }
1005
+ let cookieUnset;
1006
+ if (options.cookieUnset) {
1007
+ cookieUnset = options.cookieUnset;
1008
+ } else if (options.cookieSet) {
1009
+ cookieUnset = (key)=>{
1010
+ options.cookieSet(key, null);
1011
+ };
1012
+ } else {
1013
+ cookieUnset = cookies.remove;
1014
+ }
1015
+ const initStore = ()=>{
1016
+ if (store.initialized) {
1017
+ return;
1018
+ }
1019
+ store.setInitialized(true);
1020
+ const keys = Object.values(CookieName);
1021
+ let value;
25
1022
  for(let i = 0; i < keys.length; i++){
26
- this.setOptions(keys[i], items[keys[i]]);
1023
+ value = cookieGet(keys[i]);
1024
+ if (!value) {
1025
+ continue;
1026
+ }
1027
+ switch(keys[i]){
1028
+ case CookieName.ACCESS_TOKEN:
1029
+ if (!store.accessToken) {
1030
+ store.setAccessToken(value);
1031
+ }
1032
+ break;
1033
+ case CookieName.ACCESS_TOKEN_EXPIRE_DATE:
1034
+ if (!store.accessTokenExpireDate) {
1035
+ store.setAccessTokenExpireDate(value);
1036
+ }
1037
+ break;
1038
+ case CookieName.REFRESH_TOKEN:
1039
+ if (!store.refreshToken) {
1040
+ store.setRefreshToken(value);
1041
+ }
1042
+ break;
1043
+ case CookieName.USER:
1044
+ if (!store.user) {
1045
+ store.setUser(value);
1046
+ }
1047
+ break;
1048
+ case CookieName.REALM:
1049
+ if (!store.realm) {
1050
+ store.setRealm(value);
1051
+ }
1052
+ break;
1053
+ case CookieName.REALM_MANAGEMENT:
1054
+ if (!store.realmManagement) {
1055
+ store.setRealmManagement(value);
1056
+ }
1057
+ break;
1058
+ }
27
1059
  }
28
- }
29
- /**
30
- * Set options for a specific group.
31
- *
32
- * @param group
33
- * @param options
34
- */ setOptions(group, options) {
35
- if (typeof this.data[group] === 'undefined') {
36
- this.data[group] = {};
1060
+ };
1061
+ store.$onAction((action)=>{
1062
+ if (action.store.$id !== STORE_ID) {
1063
+ return;
37
1064
  }
38
- this.data[group] = options;
39
- }
40
- hasOptions(group) {
41
- return hasOwnProperty(this.data, group);
42
- }
43
- getOptions(group) {
44
- if (typeof this.data[group] !== 'undefined') {
45
- return this.data[group];
1065
+ if (action.name === 'logout') {
1066
+ cookieUnset(CookieName.ACCESS_TOKEN);
1067
+ cookieUnset(CookieName.ACCESS_TOKEN_EXPIRE_DATE);
1068
+ cookieUnset(CookieName.REFRESH_TOKEN);
1069
+ cookieUnset(CookieName.USER);
1070
+ cookieUnset(CookieName.REALM);
1071
+ cookieUnset(CookieName.REALM_MANAGEMENT);
46
1072
  }
47
- return {};
48
- }
49
- hasOption(group, option) {
50
- return typeof this.data[group] !== 'undefined' && hasOwnProperty(this.data[group], option);
51
- }
52
- getOption(group, option) {
53
- if (typeof this.data[group] === 'undefined') {
54
- return undefined;
1073
+ });
1074
+ initStore();
1075
+ store.$subscribe((mutation, state)=>{
1076
+ if (mutation.storeId !== STORE_ID) {
1077
+ return;
55
1078
  }
56
- return this.data[group][option];
57
- }
58
- constructor(){
59
- this.data = {};
60
- }
61
- }
62
- class StoreManager {
63
- keys() {
64
- return Object.keys(this.instances);
65
- }
66
- use(key) {
67
- if (typeof this.instances[key] !== 'undefined') {
68
- return this.instances[key];
1079
+ if (state.accessToken) {
1080
+ cookieSet(CookieName.ACCESS_TOKEN, state.accessToken);
69
1081
  }
70
- this.instances[key] = new Store();
71
- return this.instances[key];
72
- }
73
- constructor(){
74
- this.instances = {};
75
- }
76
- }
77
- function applyStoreManagerOptions(manager, options) {
78
- if (options.presets) {
79
- const presetKeys = Object.keys(options.presets);
80
- for(let i = 0; i < presetKeys.length; i++){
81
- const store = manager.use(presetKeys[i]);
82
- store.setAll(options.presets[presetKeys[i]]);
1082
+ if (state.accessTokenExpireDate) {
1083
+ cookieSet(CookieName.ACCESS_TOKEN_EXPIRE_DATE, state.accessTokenExpireDate);
83
1084
  }
84
- }
85
- if (options.defaults) {
86
- const store = manager.use(StoreName.DEFAULT);
87
- store.setAll(options.defaults);
88
- }
89
- }
90
- function getSymbol(key) {
91
- {
92
- return Symbol.for(`VCStoreManager#${key}`);
93
- }
94
- }
95
- function installStoreManager(instance, key) {
96
- let manager;
97
- const symbol = getSymbol(key);
98
- if (instance._context && instance._context.provides && instance._context.provides[symbol]) {
99
- return instance._context.provides[symbol];
100
- }
101
- if (hasInjectionContext()) {
102
- manager = inject$2(symbol, undefined);
103
- if (manager) {
104
- return manager;
1085
+ if (state.refreshToken) {
1086
+ cookieSet(CookieName.REFRESH_TOKEN, state.refreshToken);
105
1087
  }
106
- }
107
- manager = new StoreManager();
108
- instance.provide(symbol, manager);
109
- return manager;
110
- }
111
-
112
- function inject$1(key, instance) {
113
- if (instance && instance._context && instance._context.provides && instance._context.provides[key]) {
114
- return instance._context.provides[key];
115
- }
116
- if (hasInjectionContext()) {
117
- return inject$2(key, undefined);
118
- }
119
- return undefined;
1088
+ if (state.user) {
1089
+ cookieSet(CookieName.USER, state.user);
1090
+ }
1091
+ if (state.realm) {
1092
+ cookieSet(CookieName.REALM, state.realm);
1093
+ }
1094
+ if (state.realmManagement) {
1095
+ cookieSet(CookieName.REALM_MANAGEMENT, state.realmManagement);
1096
+ }
1097
+ });
1098
+ provideStore(storeCreator, app);
120
1099
  }
121
1100
 
122
- function provide(key, value, app) {
123
- if (typeof app === 'undefined') {
124
- const val = inject$1(key);
125
- if (typeof val !== 'undefined') {
126
- return;
1101
+ function storeToRefs(store) {
1102
+ store = toRaw(store);
1103
+ const refs = {};
1104
+ const keys = Object.keys(store);
1105
+ for(let i = 0; i < keys.length; i++){
1106
+ const value = store[keys[i]];
1107
+ if (isRef(value) || isReactive(value)) {
1108
+ refs[keys[i]] = toRef(store, keys[i]);
127
1109
  }
128
- provide$1(key, value);
129
- return;
130
- }
131
- if (app && app._context && app._context.provides && app._context.provides[key]) {
132
- return;
133
1110
  }
134
- app.provide(key, value);
1111
+ return refs;
135
1112
  }
136
1113
 
137
- const APIClientSymbol = Symbol.for('AuthupAPIClient');
138
- function provideAPIClient(client, app) {
139
- provide(APIClientSymbol, client, app);
140
- }
141
- function injectAPIClient() {
142
- const instance = inject$1(APIClientSymbol);
143
- if (!instance) {
144
- throw new Error('The api client has not been injected.');
1114
+ function installHTTPClient(app, options = {}) {
1115
+ if (hasHTTPClient(app)) {
1116
+ return;
145
1117
  }
146
- return instance;
1118
+ const client = new Client({
1119
+ baseURL: options.baseURL
1120
+ });
1121
+ const storeCreator = injectStore(app);
1122
+ const store = storeCreator();
1123
+ const { refreshToken } = storeToRefs$1(store);
1124
+ const tokenHook = new ClientResponseErrorTokenHook(client, {
1125
+ baseURL: options.baseURL,
1126
+ tokenCreator: ()=>{
1127
+ if (!refreshToken.value) {
1128
+ throw new Error('No refresh token available.');
1129
+ }
1130
+ return client.token.createWithRefreshToken({
1131
+ refresh_token: refreshToken.value
1132
+ });
1133
+ },
1134
+ tokenCreated: (response)=>{
1135
+ store.handleTokenGrantResponse(response);
1136
+ },
1137
+ tokenFailed: ()=>{
1138
+ store.logout();
1139
+ }
1140
+ });
1141
+ store.$subscribe((mutation, state)=>{
1142
+ if (mutation.storeId !== STORE_ID) return;
1143
+ if (state.accessToken) {
1144
+ client.setAuthorizationHeader({
1145
+ type: 'Bearer',
1146
+ token: state.accessToken
1147
+ });
1148
+ tokenHook.mount();
1149
+ } else {
1150
+ client.unsetAuthorizationHeader();
1151
+ tokenHook.unmount();
1152
+ }
1153
+ if (state.refreshToken && state.accessTokenExpireDate) {
1154
+ const expiresIn = Math.floor((state.accessTokenExpireDate.getTime() - Date.now()) / 1000);
1155
+ tokenHook.setTimer({
1156
+ refresh_token: ()=>refreshToken.value,
1157
+ expires_in: expiresIn
1158
+ });
1159
+ }
1160
+ });
1161
+ provideHTTPClient(client, app);
147
1162
  }
148
1163
 
149
1164
  function renderEntityAssignAction(ctx) {
@@ -285,271 +1300,61 @@ function buildListCreatedHandler(items, cb) {
285
1300
  } else {
286
1301
  index = -1;
287
1302
  }
288
- if (index === -1) {
289
- if (options.unshift) {
290
- items.value.unshift(item);
291
- } else {
292
- items.value.push(item);
293
- }
294
- if (cb) {
295
- cb(item);
296
- }
297
- }
298
- };
299
- }
300
- function buildListUpdatedHandler(items, cb) {
301
- return (item)=>{
302
- if (!isObject(item)) {
303
- return;
304
- }
305
- const index = items.value.findIndex((el)=>el.id === item.id);
306
- if (index !== -1) {
307
- const keys = Object.keys(item);
308
- for(let i = 0; i < keys.length; i++){
309
- items.value[index][keys[i]] = item[keys[i]];
310
- }
311
- if (cb) {
312
- cb(item);
313
- }
314
- }
315
- };
316
- }
317
- function buildListDeletedHandler(items, cb) {
318
- return (item)=>{
319
- if (!isObject(item)) {
320
- return undefined;
321
- }
322
- const index = items.value.findIndex((el)=>el.id === item.id);
323
- if (index !== -1) {
324
- if (cb) {
325
- cb(items.value[index]);
326
- }
327
- return items.value.splice(index, 1).pop();
328
- }
329
- return undefined;
330
- };
331
- }
332
-
333
- /*
334
- * Copyright (c) 2023.
335
- * Author Peter Placzek (tada5hi)
336
- * For the full copyright and license information,
337
- * view the LICENSE file that was distributed with this source code.
338
- */ function boolableToObject(input) {
339
- if (typeof input === 'boolean') {
340
- return {};
341
- }
342
- return input;
343
- }
344
-
345
- const createStore = (context)=>{
346
- const client = new Client({
347
- baseURL: context.baseURL
348
- });
349
- // --------------------------------------------------------------------
350
- const accessToken = ref(undefined);
351
- const setAccessToken = (input)=>{
352
- accessToken.value = input;
353
- };
354
- // --------------------------------------------------------------------
355
- const accessTokenExpireDate = ref(undefined);
356
- const setAccessTokenExpireDate = (input)=>{
357
- if (typeof input === 'number' || typeof input === 'string') {
358
- accessTokenExpireDate.value = new Date(input); // verify microseconds or seconds
359
- return;
360
- }
361
- accessTokenExpireDate.value = input;
362
- };
363
- // --------------------------------------------------------------------
364
- const refreshToken = ref(undefined);
365
- const setRefreshToken = (input)=>{
366
- refreshToken.value = input;
367
- };
368
- const handleTokenGrantResponse = (response)=>{
369
- const expireDate = new Date(Date.now() + response.expires_in * 1000);
370
- setAccessTokenExpireDate(expireDate);
371
- setAccessToken(response.access_token);
372
- setRefreshToken(response.refresh_token);
373
- };
374
- let refreshTokenPromise;
375
- const attemptRefreshToken = ()=>{
376
- if (!refreshToken.value) {
377
- return Promise.reject(new Error('No refresh token is present.'));
378
- }
379
- if (refreshTokenPromise) {
380
- return refreshTokenPromise;
381
- }
382
- refreshTokenPromise = client.token.createWithRefreshToken({
383
- refresh_token: refreshToken.value
384
- }).then((r)=>{
385
- handleTokenGrantResponse(r);
386
- refreshTokenPromise = undefined;
387
- return r;
388
- }).catch((e)=>{
389
- refreshTokenPromise = undefined;
390
- throw e;
391
- });
392
- return refreshTokenPromise;
393
- };
394
- // --------------------------------------------------------------------
395
- const user = ref(undefined);
396
- const userId = computed(()=>user.value ? user.value.id : undefined);
397
- const userResolved = ref(false);
398
- const setUser = (entity)=>{
399
- user.value = entity;
400
- userResolved.value = !!entity;
401
- };
402
- // --------------------------------------------------------------------
403
- const abilityManager = new AbilityManager();
404
- const tokenInfo = ref(undefined);
405
- const tokenResolved = ref(false);
406
- const has = (name)=>abilityManager.has(name);
407
- const realm = ref(undefined);
408
- const realmId = computed(()=>realm.value ? realm.value.id : undefined);
409
- const realmName = computed(()=>realm.value ? realm.value.name : undefined);
410
- const setRealm = (entity)=>{
411
- realm.value = entity;
412
- };
413
- const realmManagement = ref(undefined);
414
- const realmManagementId = computed(()=>realmManagement.value ? realmManagement.value.id : realmId.value);
415
- const realmManagementName = computed(()=>realmManagement.value ? realmManagement.value.name : realmName.value);
416
- const setRealmManagement = (entity)=>{
417
- realmManagement.value = entity;
418
- };
419
- const setTokenInfo = (entity)=>{
420
- tokenResolved.value = !!entity;
421
- tokenInfo.value = entity;
422
- if (!entity) {
423
- setRealm(undefined);
424
- setRealmManagement(undefined);
425
- abilityManager.set([]);
426
- return;
427
- }
428
- if (entity.exp) {
429
- const expireDate = new Date(entity.exp * 1000);
430
- setAccessTokenExpireDate(expireDate);
431
- }
432
- if (entity.realm_id && entity.realm_name) {
433
- realm.value = {
434
- id: entity.realm_id,
435
- name: entity.realm_name
436
- };
437
- if (typeof realmManagement.value === 'undefined') {
438
- setRealmManagement(realm.value);
439
- }
440
- }
441
- if (entity.permissions) {
442
- abilityManager.set(entity.permissions);
443
- }
444
- };
445
- // --------------------------------------------------------------------
446
- const resolve = async (ctx = {})=>{
447
- if (!accessToken.value || ctx.attempts && ctx.attempts > 3) return;
448
- try {
449
- if (!tokenResolved.value || ctx.refresh) {
450
- const token = await client.token.introspect({
451
- token: accessToken.value
452
- }, {
453
- authorizationHeader: {
454
- type: 'Bearer',
455
- token: accessToken.value
456
- }
457
- });
458
- setTokenInfo(token);
459
- tokenResolved.value = true;
460
- }
461
- if (!userResolved.value || ctx.refresh) {
462
- const entity = await client.userInfo.get(`Bearer ${accessToken.value}`);
463
- setUser(entity);
464
- userResolved.value = true;
1303
+ if (index === -1) {
1304
+ if (options.unshift) {
1305
+ items.value.unshift(item);
1306
+ } else {
1307
+ items.value.push(item);
465
1308
  }
466
- } catch (e) {
467
- if (isClientTokenExpiredError(e)) {
468
- await attemptRefreshToken();
469
- await resolve({
470
- refresh: true,
471
- attempts: ctx.attempts ? ctx.attempts++ : 1
472
- });
473
- return;
1309
+ if (cb) {
1310
+ cb(item);
474
1311
  }
475
- throw e;
476
1312
  }
477
1313
  };
478
- const loggedIn = computed(()=>!!accessToken.value);
479
- const login = async (ctx)=>{
480
- try {
481
- const response = await client.token.createWithPasswordGrant({
482
- username: ctx.name,
483
- password: ctx.password,
484
- ...realmId.value ? {
485
- realm_id: ctx.realmId
486
- } : {}
487
- });
488
- handleTokenGrantResponse(response);
489
- await resolve();
490
- } catch (e) {
491
- setUser(undefined);
492
- throw e;
1314
+ }
1315
+ function buildListUpdatedHandler(items, cb) {
1316
+ return (item)=>{
1317
+ if (!isObject(item)) {
1318
+ return;
1319
+ }
1320
+ const index = items.value.findIndex((el)=>el.id === item.id);
1321
+ if (index !== -1) {
1322
+ const keys = Object.keys(item);
1323
+ for(let i = 0; i < keys.length; i++){
1324
+ items.value[index][keys[i]] = item[keys[i]];
1325
+ }
1326
+ if (cb) {
1327
+ cb(item);
1328
+ }
493
1329
  }
494
1330
  };
495
- const logout = ()=>{
496
- setAccessToken(undefined);
497
- setRefreshToken(undefined);
498
- setUser(undefined);
499
- setTokenInfo(undefined);
500
- };
501
- return {
502
- login,
503
- logout,
504
- loggedIn,
505
- resolve,
506
- handleTokenGrantResponse,
507
- accessToken,
508
- setAccessToken,
509
- accessTokenExpireDate,
510
- setAccessTokenExpireDate,
511
- refreshToken,
512
- setRefreshToken,
513
- tokenInfo,
514
- setTokenInfo,
515
- realm,
516
- realmId,
517
- realmName,
518
- setRealm,
519
- realmManagement,
520
- realmManagementId,
521
- realmManagementName,
522
- setRealmManagement,
523
- user,
524
- userId,
525
- setUser,
526
- has
527
- };
528
- };
529
-
530
- const StoreSymbol = Symbol.for('AuthupStore');
531
- function injectStore() {
532
- const instance = inject$1(StoreSymbol);
533
- if (!instance) {
534
- throw new Error('The store has not been injected in the app context.');
535
- }
536
- return instance;
537
1331
  }
538
- function provideStore(store, app) {
539
- provide(StoreSymbol, store, app);
1332
+ function buildListDeletedHandler(items, cb) {
1333
+ return (item)=>{
1334
+ if (!isObject(item)) {
1335
+ return undefined;
1336
+ }
1337
+ const index = items.value.findIndex((el)=>el.id === item.id);
1338
+ if (index !== -1) {
1339
+ if (cb) {
1340
+ cb(items.value[index]);
1341
+ }
1342
+ return items.value.splice(index, 1).pop();
1343
+ }
1344
+ return undefined;
1345
+ };
540
1346
  }
541
1347
 
542
- function storeToRefs(store) {
543
- store = toRaw(store);
544
- const refs = {};
545
- const keys = Object.keys(store);
546
- for(let i = 0; i < keys.length; i++){
547
- const value = store[keys[i]];
548
- if (isRef(value) || isReactive(value)) {
549
- refs[keys[i]] = toRef(store, keys[i]);
550
- }
1348
+ /*
1349
+ * Copyright (c) 2023.
1350
+ * Author Peter Placzek (tada5hi)
1351
+ * For the full copyright and license information,
1352
+ * view the LICENSE file that was distributed with this source code.
1353
+ */ function boolableToObject(input) {
1354
+ if (typeof input === 'boolean') {
1355
+ return {};
551
1356
  }
552
- return refs;
1357
+ return input;
553
1358
  }
554
1359
 
555
1360
  const SocketClientSymbol = Symbol.for('AuthupSocketClientManager');
@@ -571,6 +1376,13 @@ function injectSocketClientManager() {
571
1376
  return manager;
572
1377
  }
573
1378
 
1379
+ function installSocketClientManager(app, options) {
1380
+ const socketClientManager = new ClientManager({
1381
+ url: options.baseURL
1382
+ });
1383
+ provideSocketClientManager(socketClientManager, app);
1384
+ }
1385
+
574
1386
  function createEntitySocket(ctx) {
575
1387
  if (!isSocketClientManagerInjected()) {
576
1388
  return {
@@ -578,7 +1390,7 @@ function createEntitySocket(ctx) {
578
1390
  unmount () {}
579
1391
  };
580
1392
  }
581
- const store = injectStore();
1393
+ const store = useStore();
582
1394
  const storeRefs = storeToRefs(store);
583
1395
  const realmId = computed(()=>{
584
1396
  if (storeRefs.realmName.value === REALM_MASTER_NAME) {
@@ -727,9 +1539,9 @@ function createList(context) {
727
1539
  }
728
1540
  return undefined;
729
1541
  });
730
- const client = injectAPIClient();
1542
+ const client = injectHTTPClient();
731
1543
  let domainAPI;
732
- if (hasOwnProperty$1(client, context.type)) {
1544
+ if (hasOwnProperty(client, context.type)) {
733
1545
  domainAPI = client[context.type];
734
1546
  }
735
1547
  let query;
@@ -739,7 +1551,7 @@ function createList(context) {
739
1551
  meta.value.busy = true;
740
1552
  try {
741
1553
  let filters;
742
- if (context.queryFilters && input.filters && hasOwnProperty$1(input.filters, 'name') && typeof input.filters.name === 'string') {
1554
+ if (context.queryFilters && input.filters && hasOwnProperty(input.filters, 'name') && typeof input.filters.name === 'string') {
743
1555
  // todo: queryFilters should customize full filters object!
744
1556
  filters = context.queryFilters(input.filters.name);
745
1557
  }
@@ -933,7 +1745,7 @@ function createList(context) {
933
1745
  * @param name
934
1746
  * @param $slots
935
1747
  */ function hasNormalizedSlot(name, $slots = {}) {
936
- return hasOwnProperty$1($slots, name);
1748
+ return hasOwnProperty($slots, name);
937
1749
  }
938
1750
  /**
939
1751
  * Returns VNodes for named slot either scoped or unscoped
@@ -944,7 +1756,7 @@ function createList(context) {
944
1756
  *
945
1757
  * @returns {Array} VNodes
946
1758
  */ function normalizeSlot(name, scope = {}, $slots = {}) {
947
- if (hasOwnProperty$1($slots, name)) {
1759
+ if (hasOwnProperty($slots, name)) {
948
1760
  return $slots[name](scope);
949
1761
  }
950
1762
  return [];
@@ -994,9 +1806,9 @@ function defineEntityManagerProps() {
994
1806
  }
995
1807
 
996
1808
  function createEntityManager(ctx) {
997
- const client = injectAPIClient();
1809
+ const client = injectHTTPClient();
998
1810
  let domainAPI;
999
- if (hasOwnProperty$1(client, ctx.type)) {
1811
+ if (hasOwnProperty(client, ctx.type)) {
1000
1812
  domainAPI = client[ctx.type];
1001
1813
  }
1002
1814
  const entity = ref(undefined);
@@ -1010,7 +1822,7 @@ function createEntityManager(ctx) {
1010
1822
  realmId = isRef(ctx.realmId) ? ctx.realmId.value : ctx.realmId;
1011
1823
  }
1012
1824
  if (!realmId && entity.value) {
1013
- if (hasOwnProperty$1(entity.value, 'realm_id') && typeof entity.value.realm_id === 'string') {
1825
+ if (hasOwnProperty(entity.value, 'realm_id') && typeof entity.value.realm_id === 'string') {
1014
1826
  return entity.value.realm_id;
1015
1827
  }
1016
1828
  }
@@ -1429,9 +2241,6 @@ class MemoryStore {
1429
2241
  }
1430
2242
  }
1431
2243
 
1432
- typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
1433
- const noop = ()=>{};
1434
-
1435
2244
  function computedAsync(evaluationCallback, initialState, optionsOrRef) {
1436
2245
  let options;
1437
2246
  if (isRef(optionsOrRef)) {
@@ -1641,7 +2450,7 @@ function extractVuelidateResultsFromChild(vuelidate, child, keys) {
1641
2450
  const childKeys = keys ?? Object.keys(childResults).filter((key)=>!key.startsWith('$'));
1642
2451
  const result = {};
1643
2452
  for(let i = 0; i < childKeys.length; i++){
1644
- if (hasOwnProperty$1(childResults, childKeys[i])) {
2453
+ if (hasOwnProperty(childResults, childKeys[i])) {
1645
2454
  result[childKeys[i]] = childResults[childKeys[i]].$model;
1646
2455
  }
1647
2456
  }
@@ -1811,6 +2620,33 @@ function useUpdatedAt(input) {
1811
2620
  });
1812
2621
  }
1813
2622
 
2623
+ function useAbilityCheck(name) {
2624
+ const { abilities } = useStore();
2625
+ const data = ref(false);
2626
+ data.value = abilities.has(name);
2627
+ let removeListener;
2628
+ onMounted(()=>{
2629
+ removeListener = abilities.on('updated', ()=>{
2630
+ data.value = abilities.has(name);
2631
+ });
2632
+ });
2633
+ onUnmounted(()=>{
2634
+ if (typeof removeListener !== 'undefined') {
2635
+ removeListener();
2636
+ }
2637
+ });
2638
+ return data;
2639
+ }
2640
+
2641
+ function useRealmResourceWritableCheck(realmId) {
2642
+ const store = useStore();
2643
+ const { realm } = storeToRefs$1(store);
2644
+ return computed(()=>{
2645
+ const realmIdRaw = unref(realmId);
2646
+ return isRealmResourceWritable(realm.value, realmIdRaw);
2647
+ });
2648
+ }
2649
+
1814
2650
  const ARealm = defineComponent({
1815
2651
  props: defineEntityManagerProps(),
1816
2652
  emits: defineEntityManagerEvents(),
@@ -2517,6 +3353,25 @@ const AClientScopes = defineComponent({
2517
3353
  }
2518
3354
  });
2519
3355
 
3356
+ function createRealmFormPicker(form) {
3357
+ return buildFormGroup({
3358
+ label: true,
3359
+ labelContent: 'Realm',
3360
+ content: h(ARealms, {}, {
3361
+ [SlotName.ITEM_ACTIONS]: (props)=>renderEntityAssignAction({
3362
+ item: form.realm_id === props.data.id,
3363
+ busy: props.busy,
3364
+ add () {
3365
+ form.realm_id = props.data.id;
3366
+ },
3367
+ drop () {
3368
+ form.realm_id = '';
3369
+ }
3370
+ })
3371
+ })
3372
+ });
3373
+ }
3374
+
2520
3375
  const AScopeForm = defineComponent({
2521
3376
  props: {
2522
3377
  name: {
@@ -2524,12 +3379,7 @@ const AScopeForm = defineComponent({
2524
3379
  default: undefined
2525
3380
  },
2526
3381
  entity: {
2527
- type: Object,
2528
- default: undefined
2529
- },
2530
- realmId: {
2531
- type: String,
2532
- default: undefined
3382
+ type: Object
2533
3383
  }
2534
3384
  },
2535
3385
  emits: defineEntityManagerEvents(),
@@ -2553,11 +3403,19 @@ const AScopeForm = defineComponent({
2553
3403
  },
2554
3404
  realm_id: {}
2555
3405
  }, form);
3406
+ const store = useStore();
3407
+ const storeRefs = storeToRefs(store);
2556
3408
  const manager = createEntityManager({
2557
3409
  type: `${DomainType.SCOPE}`,
2558
3410
  setup: ctx,
2559
3411
  props
2560
3412
  });
3413
+ const realmId = computed(()=>{
3414
+ if (!storeRefs.realmIsRoot) {
3415
+ return storeRefs.realmId.value;
3416
+ }
3417
+ return manager.data.value ? manager.data.value.realm_id : null;
3418
+ });
2561
3419
  const isEditing = useIsEditing(manager.data);
2562
3420
  const updatedAt = useUpdatedAt(props.entity);
2563
3421
  const isNameFixed = computed(()=>{
@@ -2566,14 +3424,10 @@ const AScopeForm = defineComponent({
2566
3424
  }
2567
3425
  return !!(manager.data.value && manager.data.value.built_in);
2568
3426
  });
2569
- const isRealmLocked = computed(()=>!!props.realmId);
2570
3427
  function initForm() {
2571
3428
  if (props.name) {
2572
3429
  form.name = props.name;
2573
3430
  }
2574
- if (props.realmId) {
2575
- form.realm_id = props.realmId;
2576
- }
2577
3431
  initFormAttributesFromSource(form, manager.data.value);
2578
3432
  }
2579
3433
  watch(updatedAt, (val, oldVal)=>{
@@ -2602,8 +3456,8 @@ const AScopeForm = defineComponent({
2602
3456
  key: TranslatorTranslationDefaultKey.REALM
2603
3457
  }
2604
3458
  ]);
2605
- const render = ()=>{
2606
- const name = [
3459
+ return ()=>{
3460
+ const children = [
2607
3461
  buildFormGroup({
2608
3462
  validationMessages: translationsValidation.name.value,
2609
3463
  validationSeverity: getVuelidateSeverity($v.value.name),
@@ -2618,9 +3472,7 @@ const AScopeForm = defineComponent({
2618
3472
  disabled: isNameFixed.value
2619
3473
  }
2620
3474
  })
2621
- })
2622
- ];
2623
- const description = [
3475
+ }),
2624
3476
  buildFormGroup({
2625
3477
  validationMessages: translationsValidation.description.value,
2626
3478
  validationSeverity: getVuelidateSeverity($v.value.description),
@@ -2637,52 +3489,22 @@ const AScopeForm = defineComponent({
2637
3489
  })
2638
3490
  })
2639
3491
  ];
2640
- const submitForm = buildFormSubmitWithTranslations({
2641
- busy,
3492
+ if (!realmId.value && !isNameFixed.value && !isEditing.value) {
3493
+ children.push(createRealmFormPicker(form));
3494
+ }
3495
+ children.push(buildFormSubmitWithTranslations({
2642
3496
  submit,
3497
+ busy,
2643
3498
  isEditing: isEditing.value,
2644
3499
  invalid: $v.value.$invalid
2645
- }, translationsSubmit);
2646
- let realm = [];
2647
- if (!isRealmLocked.value && !isNameFixed.value) {
2648
- realm = [
2649
- h('hr'),
2650
- h('label', {
2651
- class: 'form-label'
2652
- }, translationsDefault[TranslatorTranslationDefaultKey.REALM].value),
2653
- h(ARealms, {
2654
- headerTitle: false
2655
- }, {
2656
- [SlotName.ITEM_ACTIONS]: (props)=>renderEntityAssignAction({
2657
- item: form.realm_id === props.data.id,
2658
- busy: props.busy,
2659
- add () {
2660
- form.realm_id = props.data.id;
2661
- },
2662
- drop () {
2663
- form.realm_id = '';
2664
- }
2665
- })
2666
- })
2667
- ];
2668
- }
3500
+ }, translationsSubmit));
2669
3501
  return h('form', {
2670
3502
  onSubmit ($event) {
2671
3503
  $event.preventDefault();
2672
3504
  return submit.apply(null);
2673
3505
  }
2674
- }, [
2675
- h('div', [
2676
- name,
2677
- h('hr'),
2678
- description,
2679
- realm,
2680
- h('hr'),
2681
- submitForm
2682
- ])
2683
- ]);
3506
+ }, children);
2684
3507
  };
2685
- return ()=>render();
2686
3508
  }
2687
3509
  });
2688
3510
 
@@ -4002,7 +4824,7 @@ const AIdentityProviderOAuth2Form = defineComponent({
4002
4824
  },
4003
4825
  emits: defineEntityManagerEvents(),
4004
4826
  setup (props, ctx) {
4005
- const apiClient = injectAPIClient();
4827
+ const apiClient = injectHTTPClient();
4006
4828
  const manager = createEntityManager({
4007
4829
  type: `${DomainType.IDENTITY_PROVIDER}`,
4008
4830
  setup: ctx,
@@ -4594,7 +5416,8 @@ const ARoleForm = defineComponent({
4594
5416
  const busy = ref(false);
4595
5417
  const form = reactive({
4596
5418
  name: '',
4597
- description: ''
5419
+ description: '',
5420
+ realm_id: ''
4598
5421
  });
4599
5422
  const $v = useVuelidate({
4600
5423
  name: {
@@ -4605,13 +5428,22 @@ const ARoleForm = defineComponent({
4605
5428
  description: {
4606
5429
  minLength: minLength(5),
4607
5430
  maxLength: maxLength(4096)
4608
- }
5431
+ },
5432
+ realm_id: {}
4609
5433
  }, form);
5434
+ const store = useStore();
5435
+ const storeRefs = storeToRefs(store);
4610
5436
  const manager = createEntityManager({
4611
5437
  type: `${DomainType.ROLE}`,
4612
5438
  setup: ctx,
4613
5439
  props
4614
5440
  });
5441
+ const realmId = computed(()=>{
5442
+ if (!storeRefs.realmIsRoot) {
5443
+ return storeRefs.realmId.value;
5444
+ }
5445
+ return manager.data.value ? manager.data.value.realm_id : null;
5446
+ });
4615
5447
  const isEditing = useIsEditing(manager.data);
4616
5448
  const updatedAt = useUpdatedAt(props.entity);
4617
5449
  function initForm() {
@@ -4641,7 +5473,8 @@ const ARoleForm = defineComponent({
4641
5473
  }
4642
5474
  ]);
4643
5475
  const render = ()=>{
4644
- const name = buildFormGroup({
5476
+ const children = [];
5477
+ children.push(buildFormGroup({
4645
5478
  validationMessages: translationsValidation.name.value,
4646
5479
  validationSeverity: getVuelidateSeverity($v.value.name),
4647
5480
  label: true,
@@ -4652,8 +5485,8 @@ const ARoleForm = defineComponent({
4652
5485
  $v.value.name.$model = input;
4653
5486
  }
4654
5487
  })
4655
- });
4656
- const description = buildFormGroup({
5488
+ }));
5489
+ children.push(buildFormGroup({
4657
5490
  validationMessages: translationsValidation.description.value,
4658
5491
  validationSeverity: getVuelidateSeverity($v.value.description),
4659
5492
  label: true,
@@ -4667,23 +5500,22 @@ const ARoleForm = defineComponent({
4667
5500
  rows: 6
4668
5501
  }
4669
5502
  })
4670
- });
4671
- const submitForm = buildFormSubmitWithTranslations({
5503
+ }));
5504
+ if (!realmId.value && !isEditing.value) {
5505
+ children.push(createRealmFormPicker(form));
5506
+ }
5507
+ children.push(buildFormSubmitWithTranslations({
4672
5508
  submit,
4673
- busy: busy.value,
5509
+ busy,
4674
5510
  isEditing: isEditing.value,
4675
5511
  invalid: $v.value.$invalid
4676
- }, translationsSubmit);
5512
+ }, translationsSubmit));
4677
5513
  return h('form', {
4678
5514
  onSubmit ($event) {
4679
5515
  $event.preventDefault();
4680
5516
  return submit.apply(null);
4681
5517
  }
4682
- }, [
4683
- name,
4684
- description,
4685
- submitForm
4686
- ]);
5518
+ }, children);
4687
5519
  };
4688
5520
  return ()=>render();
4689
5521
  }
@@ -4780,8 +5612,7 @@ const APermission = defineComponent({
4780
5612
  const APermissionForm = defineComponent({
4781
5613
  props: {
4782
5614
  entity: {
4783
- type: Object,
4784
- default: undefined
5615
+ type: Object
4785
5616
  }
4786
5617
  },
4787
5618
  emits: defineEntityManagerEvents(),
@@ -4789,7 +5620,8 @@ const APermissionForm = defineComponent({
4789
5620
  const busy = ref(false);
4790
5621
  const form = reactive({
4791
5622
  name: '',
4792
- description: ''
5623
+ description: '',
5624
+ realm_id: ''
4793
5625
  });
4794
5626
  const $v = useVuelidate({
4795
5627
  name: {
@@ -4800,13 +5632,22 @@ const APermissionForm = defineComponent({
4800
5632
  description: {
4801
5633
  minLength: minLength(5),
4802
5634
  maxLength: maxLength(4096)
4803
- }
5635
+ },
5636
+ realm_id: {}
4804
5637
  }, form);
5638
+ const store = useStore();
5639
+ const storeRefs = storeToRefs(store);
4805
5640
  const manager = createEntityManager({
4806
5641
  type: `${DomainType.PERMISSION}`,
4807
5642
  setup: ctx,
4808
5643
  props
4809
5644
  });
5645
+ const realmId = computed(()=>{
5646
+ if (!storeRefs.realmIsRoot) {
5647
+ return storeRefs.realmId.value;
5648
+ }
5649
+ return manager.data.value ? manager.data.value.realm_id : null;
5650
+ });
4810
5651
  const isEditing = useIsEditing(manager.data);
4811
5652
  const updatedAt = useUpdatedAt(props.entity);
4812
5653
  function initForm() {
@@ -4836,7 +5677,8 @@ const APermissionForm = defineComponent({
4836
5677
  }
4837
5678
  ]);
4838
5679
  const render = ()=>{
4839
- const name = buildFormGroup({
5680
+ const children = [];
5681
+ children.push(buildFormGroup({
4840
5682
  validationMessages: translationsValidation.name.value,
4841
5683
  validationSeverity: getVuelidateSeverity($v.value.name),
4842
5684
  label: true,
@@ -4850,8 +5692,8 @@ const APermissionForm = defineComponent({
4850
5692
  disabled: manager.data.value && manager.data.value.built_in
4851
5693
  }
4852
5694
  })
4853
- });
4854
- const description = buildFormGroup({
5695
+ }));
5696
+ children.push(buildFormGroup({
4855
5697
  validationMessages: translationsValidation.description.value,
4856
5698
  validationSeverity: getVuelidateSeverity($v.value.description),
4857
5699
  label: true,
@@ -4865,23 +5707,22 @@ const APermissionForm = defineComponent({
4865
5707
  rows: 4
4866
5708
  }
4867
5709
  })
4868
- });
4869
- const submitButton = buildFormSubmitWithTranslations({
5710
+ }));
5711
+ if (!realmId.value && !isEditing.value) {
5712
+ children.push(createRealmFormPicker(form));
5713
+ }
5714
+ children.push(buildFormSubmitWithTranslations({
4870
5715
  submit,
4871
5716
  busy,
4872
5717
  isEditing: isEditing.value,
4873
5718
  invalid: $v.value.$invalid
4874
- }, translationsSubmit);
5719
+ }, translationsSubmit));
4875
5720
  return h('form', {
4876
5721
  onSubmit ($event) {
4877
5722
  $event.preventDefault();
4878
5723
  return submit.apply(null);
4879
5724
  }
4880
- }, [
4881
- name,
4882
- description,
4883
- submitButton
4884
- ]);
5725
+ }, children);
4885
5726
  };
4886
5727
  return ()=>render();
4887
5728
  }
@@ -5698,7 +6539,7 @@ const AUserPasswordForm = defineComponent({
5698
6539
  'failed'
5699
6540
  ],
5700
6541
  setup (props, ctx) {
5701
- const apiClient = injectAPIClient();
6542
+ const apiClient = injectHTTPClient();
5702
6543
  const busy = ref(false);
5703
6544
  const form = reactive({
5704
6545
  password: '',
@@ -6332,12 +7173,12 @@ const AEntityDelete = defineComponent({
6332
7173
  'failed'
6333
7174
  ],
6334
7175
  setup (props, ctx) {
6335
- const apiClient = injectAPIClient();
7176
+ const apiClient = injectHTTPClient();
6336
7177
  const instance = getCurrentInstance();
6337
7178
  const busy = ref(false);
6338
7179
  const submit = wrapFnWithBusyState(busy, async ()=>{
6339
7180
  let domainAPI;
6340
- if (hasOwnProperty$1(apiClient, props.entityType) && isObject$1(apiClient[props.entityType]) && hasOwnProperty$1(apiClient[props.entityType], 'delete')) {
7181
+ if (hasOwnProperty(apiClient, props.entityType) && isObject$1(apiClient[props.entityType]) && hasOwnProperty(apiClient[props.entityType], 'delete')) {
6341
7182
  domainAPI = apiClient[props.entityType];
6342
7183
  }
6343
7184
  if (!domainAPI) {
@@ -6465,41 +7306,46 @@ var components = /*#__PURE__*/Object.freeze({
6465
7306
  LanguageSwitcherDropdown: LanguageSwitcherDropdown
6466
7307
  });
6467
7308
 
6468
- function install(app, options) {
6469
- options = options || {};
6470
- if (options.apiClient) {
6471
- provideAPIClient(options.apiClient, app);
6472
- }
6473
- if (options.socketClientManager) {
6474
- provideSocketClientManager(options.socketClientManager, app);
6475
- }
6476
- if (options.store) {
6477
- provideStore(options.store, app);
7309
+ function installComponents(input) {
7310
+ if (!input) {
7311
+ return;
6478
7312
  }
6479
- installTranslator(app, {
6480
- locale: options.translatorLocale
6481
- });
6482
- const storeManager = installStoreManager(app, 'authup');
6483
- if (options.storeManager) {
6484
- applyStoreManagerOptions(storeManager, options.storeManager);
7313
+ let componentsSelected;
7314
+ if (typeof input !== 'boolean') {
7315
+ componentsSelected = input;
6485
7316
  }
6486
- if (options.components) {
6487
- let componentsSelected;
6488
- if (typeof options.components !== 'boolean') {
6489
- componentsSelected = options.components;
7317
+ Object.entries(components).forEach(([componentName, component])=>{
7318
+ if (!Array.isArray(componentsSelected) || componentsSelected.indexOf(componentName) !== -1) {
7319
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
7320
+ // @ts-ignore
7321
+ app.component(componentName, component);
6490
7322
  }
6491
- Object.entries(components).forEach(([componentName, component])=>{
6492
- if (!Array.isArray(componentsSelected) || componentsSelected.indexOf(componentName) !== -1) {
6493
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
6494
- // @ts-ignore
6495
- app.component(componentName, component);
6496
- }
7323
+ });
7324
+ }
7325
+ function install(app1, options) {
7326
+ if (options.realtime) {
7327
+ installSocketClientManager(app1, {
7328
+ baseURL: options.realtimeURL || options.baseURL
6497
7329
  });
6498
7330
  }
7331
+ installStore(app1, {
7332
+ baseURL: options.baseURL,
7333
+ cookieSet: options.cookieSet,
7334
+ cookieGet: options.cookieGet,
7335
+ cookieUnset: options.cookieUnset
7336
+ });
7337
+ installHTTPClient(app1, {
7338
+ baseURL: options.baseURL
7339
+ });
7340
+ installTranslator(app1, {
7341
+ locale: options.translatorLocale
7342
+ });
7343
+ installComponents(options.components);
6499
7344
  }
7345
+
6500
7346
  var index = {
6501
7347
  install
6502
7348
  };
6503
7349
 
6504
- export { AClient, AClientForm, AClientRedirectUris, AClientRedirectUrisItem, AClientScope, AClientScopeAssignment, AClientScopeAssignments, AClientScopes, AClients, AEntityDelete, AIdentityProvider, AIdentityProviderForm, AIdentityProviderIcon, AIdentityProviderLdapForm, AIdentityProviderOAuth2Form, AIdentityProviderPreset, AIdentityProviderProtocol, AIdentityProviderRoleAssignment, AIdentityProviderRoleAssignments, AIdentityProviders, APIClientSymbol, APagination, APermission, APermissionForm, APermissionRobotAssignments, APermissionRoleAssignments, APermissionUserAssignments, APermissions, ARealm, ARealmForm, ARealms, ARobot, ARobotForm, ARobotPermissionAssignment, ARobotPermissionAssignments, ARobotRoleAssignment, ARobotRoleAssignments, ARobots, ARole, ARoleForm, ARolePermissionAssignment, ARolePermissionAssignments, ARoleRobotAssignments, ARoleUserAssignments, ARoles, AScope, AScopeClientAssignments, AScopeForm, AScopes, ASearch, ATitle, AUser, AUserForm, AUserPasswordForm, AUserPermissionAssignment, AUserPermissionAssignments, AUserRoleAssignment, AUserRoleAssignments, AUsers, EntityManagerError, LanguageSwitcherDropdown, SocketClientSymbol, StoreSymbol, TranslatorTranslationClientKey, TranslatorTranslationDefaultKey, TranslatorTranslationGroup, TranslatorTranslationVuecsKey, VuelidateCustomRule, VuelidateCustomRuleKey, buildEntityManagerSlotProps, buildFormSubmitWithTranslations, buildListCreatedHandler, buildListDeletedHandler, buildListUpdatedHandler, createEntityManager, createFormSubmitTranslations, createList, createStore, index as default, defineEntityManagerEvents, defineEntityManagerProps, defineListEvents, defineListProps, extendObjectProperties, extractVuelidateResultsFromChild, getVuelidateSeverity, hasNormalizedSlot, initFormAttributesFromSource, inject$1 as inject, injectAPIClient, injectSocketClientManager, injectStore, injectTranslatorLocale, install, installTranslator, isQuerySortedDescByDate, isSocketClientManagerInjected, mergeListOptions, normalizeSlot, provide, provideAPIClient, provideSocketClientManager, provideStore, renderEntityAssignAction, storeToRefs, useTranslation, useTranslationsForBaseValidation, useTranslationsForGroup, useTranslationsForNestedValidation, wrapFnWithBusyState };
7350
+ export { AClient, AClientForm, AClientRedirectUris, AClientRedirectUrisItem, AClientScope, AClientScopeAssignment, AClientScopeAssignments, AClientScopes, AClients, AEntityDelete, AIdentityProvider, AIdentityProviderForm, AIdentityProviderIcon, AIdentityProviderLdapForm, AIdentityProviderOAuth2Form, AIdentityProviderPreset, AIdentityProviderProtocol, AIdentityProviderRoleAssignment, AIdentityProviderRoleAssignments, AIdentityProviders, APagination, APermission, APermissionForm, APermissionRobotAssignments, APermissionRoleAssignments, APermissionUserAssignments, APermissions, ARealm, ARealmForm, ARealms, ARobot, ARobotForm, ARobotPermissionAssignment, ARobotPermissionAssignments, ARobotRoleAssignment, ARobotRoleAssignments, ARobots, ARole, ARoleForm, ARolePermissionAssignment, ARolePermissionAssignments, ARoleRobotAssignments, ARoleUserAssignments, ARoles, AScope, AScopeClientAssignments, AScopeForm, AScopes, ASearch, ATitle, AUser, AUserForm, AUserPasswordForm, AUserPermissionAssignment, AUserPermissionAssignments, AUserRoleAssignment, AUserRoleAssignments, AUsers, EntityManagerError, HTTPClientSymbol, LanguageSwitcherDropdown, STORE_ID, SocketClientSymbol, StoreSymbol, TranslatorTranslationClientKey, TranslatorTranslationDefaultKey, TranslatorTranslationGroup, TranslatorTranslationVuecsKey, VuelidateCustomRule, VuelidateCustomRuleKey, buildEntityManagerSlotProps, buildFormSubmitWithTranslations, buildListCreatedHandler, buildListDeletedHandler, buildListUpdatedHandler, createEntityManager, createFormSubmitTranslations, createList, createStore, index as default, defineEntityManagerEvents, defineEntityManagerProps, defineListEvents, defineListProps, extendObjectProperties, extractVuelidateResultsFromChild, getVuelidateSeverity, hasHTTPClient, hasNormalizedSlot, hasStore, initFormAttributesFromSource, inject$1 as inject, injectHTTPClient, injectSocketClientManager, injectStore, injectTranslatorLocale, install, installHTTPClient, installSocketClientManager, installStore, installTranslator, isQuerySortedDescByDate, isSocketClientManagerInjected, mergeListOptions, normalizeSlot, onChange, provide, provideHTTPClient, provideSocketClientManager, provideStore, renderEntityAssignAction, storeToRefs, useAbilityCheck, useIsEditing, useRealmResourceWritableCheck, useStore, useTranslation, useTranslationsForBaseValidation, useTranslationsForGroup, useTranslationsForNestedValidation, useUpdatedAt, wrapFnWithBusyState };
6505
7351
  //# sourceMappingURL=index.mjs.map