@authup/client-web-kit 1.0.0-beta.28 → 1.0.0-beta.30
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/entities/client-role/AClientRoleAssignments.d.ts +2 -0
- package/dist/components/entities/client-role/AClientRoleAssignments.d.ts.map +1 -1
- package/dist/components/entities/permission/APermissionCheck.d.ts +3 -3
- package/dist/components/entities/permission/APermissionCheck.d.ts.map +1 -1
- package/dist/components/utility/entity/record/module.d.ts.map +1 -1
- package/dist/core/permission-check/module.d.ts.map +1 -1
- package/dist/index.mjs +180 -180
- package/dist/index.mjs.map +1 -1
- package/package.json +30 -30
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export declare const AClientRoleAssignments: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
2
|
entityId: StringConstructor;
|
|
3
|
+
realmId: StringConstructor;
|
|
3
4
|
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
4
5
|
[key: string]: any;
|
|
5
6
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
6
7
|
entityId: StringConstructor;
|
|
8
|
+
realmId: StringConstructor;
|
|
7
9
|
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
8
10
|
export default AClientRoleAssignments;
|
|
9
11
|
//# sourceMappingURL=AClientRoleAssignments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AClientRoleAssignments.d.ts","sourceRoot":"","sources":["../../../../src/components/entities/client-role/AClientRoleAssignments.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,sBAAsB
|
|
1
|
+
{"version":3,"file":"AClientRoleAssignments.d.ts","sourceRoot":"","sources":["../../../../src/components/entities/client-role/AClientRoleAssignments.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,sBAAsB;;;;;;;;iGAwBjC,CAAC;AAEH,eAAe,sBAAsB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PermissionCheckerCheckOptions
|
|
1
|
+
import type { PermissionCheckerCheckOptions } from '@authup/access';
|
|
2
2
|
import type { PropType } from 'vue';
|
|
3
3
|
export declare const APermissionCheck: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
4
|
name: {
|
|
@@ -6,7 +6,7 @@ export declare const APermissionCheck: import("vue").DefineComponent<import("vue
|
|
|
6
6
|
required: true;
|
|
7
7
|
};
|
|
8
8
|
input: {
|
|
9
|
-
type: PropType<
|
|
9
|
+
type: PropType<Record<string, any>>;
|
|
10
10
|
};
|
|
11
11
|
options: {
|
|
12
12
|
type: PropType<PermissionCheckerCheckOptions>;
|
|
@@ -21,7 +21,7 @@ export declare const APermissionCheck: import("vue").DefineComponent<import("vue
|
|
|
21
21
|
required: true;
|
|
22
22
|
};
|
|
23
23
|
input: {
|
|
24
|
-
type: PropType<
|
|
24
|
+
type: PropType<Record<string, any>>;
|
|
25
25
|
};
|
|
26
26
|
options: {
|
|
27
27
|
type: PropType<PermissionCheckerCheckOptions>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"APermissionCheck.d.ts","sourceRoot":"","sources":["../../../../src/components/entities/permission/APermissionCheck.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,6BAA6B,EAAE,
|
|
1
|
+
{"version":3,"file":"APermissionCheck.d.ts","sourceRoot":"","sources":["../../../../src/components/entities/permission/APermissionCheck.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAGpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAIpC,eAAO,MAAM,gBAAgB;;cAGQ,QAAQ,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC;;;;cAIpC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;;;cAG7B,QAAQ,CAAC,6BAA6B,CAAC;;;;;;;;cAP9B,QAAQ,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC;;;;cAIpC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;;;cAG7B,QAAQ,CAAC,6BAA6B,CAAC;;iGAuBjE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/components/utility/entity/record/module.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/components/utility/entity/record/module.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAatD,OAAO,KAAK,EAER,aAAa,EACb,0BAA0B,EAG7B,MAAM,SAAS,CAAC;AAgbjB,wBAAgB,mBAAmB,CAC/B,IAAI,SAAS,MAAM,aAAa,EAEhC,GAAG,EAAE,0BAA0B,CAAC,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC,GAC1D,aAAa,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAErC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/core/permission-check/module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/core/permission-check/module.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,2BAA2B,EAAE,wCAAwC,EAAE,MAAM,SAAS,CAAC;AAErG,wBAAgB,iCAAiC,CAC7C,GAAG,GAAE,wCAA6C,GAClD,2BAA2B,CAoF9B"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,127 +1,31 @@
|
|
|
1
1
|
import installFormControl, { VCFormGroup, VCFormInput, buildFormSubmit, buildFormInputText, buildFormGroup, buildFormInput, buildFormTextarea, buildFormInputCheckbox, VCFormInputCheckbox } from '@vuecs/form-controls';
|
|
2
2
|
import { hasOwnProperty, isObject as isObject$1, merge, createMerger } from 'smob';
|
|
3
|
-
import { hasInjectionContext, inject as inject$3, provide as provide$2, defineComponent, reactive, resolveComponent,
|
|
3
|
+
import { hasInjectionContext, inject as inject$3, provide as provide$2, defineComponent, reactive, resolveComponent, openBlock, createBlock, withCtx, createVNode, createElementVNode, withModifiers, ref, computed, getCurrentScope, onScopeDispose, shallowRef, toRaw, isRef, isReactive, toRef, watchEffect, unref, onMounted, watch, onUnmounted, h, createElementBlock, renderSlot, createTextVNode, createCommentVNode, Fragment, renderList, mergeProps, getCurrentInstance, resolveDynamicComponent, toDisplayString, nextTick, normalizeClass, Suspense } from 'vue';
|
|
4
4
|
import installPagination, { buildPagination as buildPagination$1 } from '@vuecs/pagination';
|
|
5
5
|
import { REALM_MASTER_NAME, EntityDefaultEventName, buildEntityChannelName, EntityType, IdentityProviderProtocol, IdentityProviderPreset, getIdentityProviderProtocolForPreset, isUserFakeEmail, buildUserFakeEmail } from '@authup/core-kit';
|
|
6
6
|
import { IVuelidate, useTranslationsForNestedValidations, useTranslationsForBaseValidation as useTranslationsForBaseValidation$1, getSeverity, install as install$1 } from '@ilingo/vuelidate';
|
|
7
7
|
import useVuelidate from '@vuelidate/core';
|
|
8
|
-
import { maxLength, minLength,
|
|
8
|
+
import { required, maxLength, minLength, helpers, numeric, url, maxValue, minValue, email, sameAs } from '@vuelidate/validators';
|
|
9
9
|
import { SlotName, buildList } from '@vuecs/list-controls';
|
|
10
10
|
import { Client, CookieName, ClientAuthenticationHook, ClientAuthenticationHookEventName } from '@authup/core-http-kit';
|
|
11
11
|
import { defineStore, storeToRefs as storeToRefs$1 } from 'pinia';
|
|
12
|
-
import {
|
|
12
|
+
import { PermissionMemoryRepository, PermissionChecker, PolicyEngine, PolicyData, BuiltInPolicyType, TimePolicyInterval, isIntervalForDayOfWeek, isIntervalForDayOfMonth, isIntervalForDayOfYear } from '@authup/access';
|
|
13
13
|
import { OAuth2Error, isOpenIDProviderMetadata, deserializeOAuth2Scope } from '@authup/specs';
|
|
14
14
|
import { hasOwnProperty as hasOwnProperty$1, extendObject, isObject as isObject$2, createNanoID, isBCryptHash, base64URLEncode } from '@authup/kit';
|
|
15
15
|
import { SortDirection } from 'rapiq';
|
|
16
16
|
import { ClientManager, buildEventFullName, EventNameSuffix } from '@authup/core-realtime-kit';
|
|
17
17
|
import Cookie from 'universal-cookie';
|
|
18
18
|
|
|
19
|
-
/*
|
|
20
|
-
* Copyright (c) 2024-2024.
|
|
21
|
-
* Author Peter Placzek (tada5hi)
|
|
22
|
-
* For the full copyright and license information,
|
|
23
|
-
* view the LICENSE file that was distributed with this source code.
|
|
24
|
-
*/ const BRACKET_NUMBER_REGEX = RegExp("(?<!\\\\)\\[(\\d+)]$");
|
|
25
|
-
/**
|
|
26
|
-
* Convert string to property path array.
|
|
27
|
-
*
|
|
28
|
-
* @see https://github.com/lodash/lodash/blob/main/src/.internal/stringToPath.ts
|
|
29
|
-
* @see https://github.com/chaijs/pathval
|
|
30
|
-
*
|
|
31
|
-
* @param segment
|
|
32
|
-
*/ function pathToArray(segment) {
|
|
33
|
-
const str = segment.replace(/([^\\])\[/g, '$1.[');
|
|
34
|
-
const parts = str.match(/(\\\.|[^.]+?)+/g);
|
|
35
|
-
if (!parts) {
|
|
36
|
-
return [];
|
|
37
|
-
}
|
|
38
|
-
const result = [];
|
|
39
|
-
for(let i = 0; i < parts.length; i++){
|
|
40
|
-
if (parts[i] === 'constructor' || parts[i] === '__proto__' || parts[i] === 'prototype') {
|
|
41
|
-
continue;
|
|
42
|
-
}
|
|
43
|
-
const regex = BRACKET_NUMBER_REGEX.exec(parts[i]);
|
|
44
|
-
if (regex) {
|
|
45
|
-
result.push(regex[1]);
|
|
46
|
-
} else {
|
|
47
|
-
result.push(parts[i].replace(/\\([.[\]])/g, '$1'));
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return result;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
19
|
/*
|
|
54
20
|
* Copyright (c) 2024.
|
|
55
21
|
* Author Peter Placzek (tada5hi)
|
|
56
22
|
* For the full copyright and license information,
|
|
57
23
|
* view the LICENSE file that was distributed with this source code.
|
|
58
|
-
*/ var Character;
|
|
24
|
+
*/ var Character$1;
|
|
59
25
|
(function(Character) {
|
|
60
26
|
Character["WILDCARD"] = "*";
|
|
61
27
|
Character["GLOBSTAR"] = "**";
|
|
62
|
-
})(Character || (Character = {}));
|
|
63
|
-
|
|
64
|
-
/*
|
|
65
|
-
* Copyright (c) 2024.
|
|
66
|
-
* Author Peter Placzek (tada5hi)
|
|
67
|
-
* For the full copyright and license information,
|
|
68
|
-
* view the LICENSE file that was distributed with this source code.
|
|
69
|
-
*/ function isObject(input) {
|
|
70
|
-
return !!input && typeof input === 'object' && !Array.isArray(input);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function getPathValue(data, path) {
|
|
74
|
-
const parts = Array.isArray(path) ? path : pathToArray(path);
|
|
75
|
-
let res;
|
|
76
|
-
let temp = data;
|
|
77
|
-
let index = 0;
|
|
78
|
-
while(index < parts.length){
|
|
79
|
-
if (temp === null || typeof temp === 'undefined') {
|
|
80
|
-
break;
|
|
81
|
-
}
|
|
82
|
-
if (parts[index] in Object(temp)) {
|
|
83
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
84
|
-
// @ts-expect-error
|
|
85
|
-
temp = temp[parts[index]];
|
|
86
|
-
} else {
|
|
87
|
-
break;
|
|
88
|
-
}
|
|
89
|
-
if (index === parts.length - 1) {
|
|
90
|
-
res = temp;
|
|
91
|
-
}
|
|
92
|
-
index++;
|
|
93
|
-
}
|
|
94
|
-
return res;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const NUMBER_REGEX = /^\d+$/;
|
|
98
|
-
function setPathValue(data, path, value) {
|
|
99
|
-
const parts = Array.isArray(path) ? path : pathToArray(path);
|
|
100
|
-
let temp = data;
|
|
101
|
-
let index = 0;
|
|
102
|
-
while(index < parts.length){
|
|
103
|
-
/* istanbul ignore next */ if (!Array.isArray(temp) && !isObject(temp)) {
|
|
104
|
-
break;
|
|
105
|
-
}
|
|
106
|
-
const key = parts[index];
|
|
107
|
-
// [foo, '0']
|
|
108
|
-
if (typeof temp[key] === 'undefined') {
|
|
109
|
-
const match = NUMBER_REGEX.test(key);
|
|
110
|
-
if (match) {
|
|
111
|
-
temp[key] = [];
|
|
112
|
-
} else {
|
|
113
|
-
temp[key] = {};
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
if (index === parts.length - 1) {
|
|
117
|
-
temp[key] = value;
|
|
118
|
-
break;
|
|
119
|
-
}
|
|
120
|
-
index++;
|
|
121
|
-
temp = temp[key];
|
|
122
|
-
}
|
|
123
|
-
return data;
|
|
124
|
-
}
|
|
28
|
+
})(Character$1 || (Character$1 = {}));
|
|
125
29
|
|
|
126
30
|
class Store {
|
|
127
31
|
/**
|
|
@@ -533,9 +437,9 @@ function createStore(context) {
|
|
|
533
437
|
context.dispatcher.emit(StoreDispatcherEventName.REALM_MANAGEMENT_UPDATED, input);
|
|
534
438
|
};
|
|
535
439
|
// --------------------------------------------------------------------
|
|
536
|
-
const permissionRepository = new
|
|
440
|
+
const permissionRepository = new PermissionMemoryRepository();
|
|
537
441
|
const permissionChecker = new PermissionChecker({
|
|
538
|
-
|
|
442
|
+
repository: permissionRepository,
|
|
539
443
|
policyEngine: new PolicyEngine()
|
|
540
444
|
});
|
|
541
445
|
// --------------------------------------------------------------------
|
|
@@ -738,6 +642,7 @@ function tryOnScopeDispose(fn, failSilently) {
|
|
|
738
642
|
return false;
|
|
739
643
|
}
|
|
740
644
|
typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
|
|
645
|
+
const noop = () => {};
|
|
741
646
|
|
|
742
647
|
/**
|
|
743
648
|
* Reactive methods to work with cookies (use {@link createCookies} method instead if you are using SSR)
|
|
@@ -1145,7 +1050,118 @@ var TranslatorTranslationDefaultKey = /*#__PURE__*/ function(TranslatorTranslati
|
|
|
1145
1050
|
return TranslatorTranslationDefaultKey;
|
|
1146
1051
|
}({});
|
|
1147
1052
|
|
|
1053
|
+
/*
|
|
1054
|
+
* Copyright (c) 2024-2024.
|
|
1055
|
+
* Author Peter Placzek (tada5hi)
|
|
1056
|
+
* For the full copyright and license information,
|
|
1057
|
+
* view the LICENSE file that was distributed with this source code.
|
|
1058
|
+
*/ const BRACKET_NUMBER_REGEX = RegExp("(?<!\\\\)\\[(\\d+)]$");
|
|
1059
|
+
/**
|
|
1060
|
+
* Convert string to property path array.
|
|
1061
|
+
*
|
|
1062
|
+
* @see https://github.com/lodash/lodash/blob/main/src/.internal/stringToPath.ts
|
|
1063
|
+
* @see https://github.com/chaijs/pathval
|
|
1064
|
+
*
|
|
1065
|
+
* @param segment
|
|
1066
|
+
*/ function pathToArray(segment) {
|
|
1067
|
+
const str = segment.replace(/([^\\])\[/g, '$1.[');
|
|
1068
|
+
const parts = str.match(/(\\\.|[^.]+?)+/g);
|
|
1069
|
+
if (!parts) {
|
|
1070
|
+
return [];
|
|
1071
|
+
}
|
|
1072
|
+
const result = [];
|
|
1073
|
+
for(let i = 0; i < parts.length; i++){
|
|
1074
|
+
if (parts[i] === 'constructor' || parts[i] === '__proto__' || parts[i] === 'prototype') {
|
|
1075
|
+
continue;
|
|
1076
|
+
}
|
|
1077
|
+
const regex = BRACKET_NUMBER_REGEX.exec(parts[i]);
|
|
1078
|
+
if (regex) {
|
|
1079
|
+
result.push(regex[1]);
|
|
1080
|
+
} else {
|
|
1081
|
+
result.push(parts[i].replace(/\\([.[\]])/g, '$1'));
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
return result;
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
/*
|
|
1088
|
+
* Copyright (c) 2024.
|
|
1089
|
+
* Author Peter Placzek (tada5hi)
|
|
1090
|
+
* For the full copyright and license information,
|
|
1091
|
+
* view the LICENSE file that was distributed with this source code.
|
|
1092
|
+
*/ var Character;
|
|
1093
|
+
(function(Character) {
|
|
1094
|
+
Character["WILDCARD"] = "*";
|
|
1095
|
+
Character["GLOBSTAR"] = "**";
|
|
1096
|
+
})(Character || (Character = {}));
|
|
1097
|
+
|
|
1098
|
+
/*
|
|
1099
|
+
* Copyright (c) 2024.
|
|
1100
|
+
* Author Peter Placzek (tada5hi)
|
|
1101
|
+
* For the full copyright and license information,
|
|
1102
|
+
* view the LICENSE file that was distributed with this source code.
|
|
1103
|
+
*/ function isObject(input) {
|
|
1104
|
+
return !!input && typeof input === 'object' && !Array.isArray(input);
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
function getPathValue(data, path) {
|
|
1108
|
+
const parts = Array.isArray(path) ? path : pathToArray(path);
|
|
1109
|
+
let res;
|
|
1110
|
+
let temp = data;
|
|
1111
|
+
let index = 0;
|
|
1112
|
+
while(index < parts.length){
|
|
1113
|
+
if (temp === null || typeof temp === 'undefined') {
|
|
1114
|
+
break;
|
|
1115
|
+
}
|
|
1116
|
+
if (parts[index] in Object(temp)) {
|
|
1117
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
1118
|
+
// @ts-expect-error
|
|
1119
|
+
temp = temp[parts[index]];
|
|
1120
|
+
} else {
|
|
1121
|
+
break;
|
|
1122
|
+
}
|
|
1123
|
+
if (index === parts.length - 1) {
|
|
1124
|
+
res = temp;
|
|
1125
|
+
}
|
|
1126
|
+
index++;
|
|
1127
|
+
}
|
|
1128
|
+
return res;
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
const NUMBER_REGEX = /^\d+$/;
|
|
1132
|
+
function setPathValue(data, path, value) {
|
|
1133
|
+
const parts = Array.isArray(path) ? path : pathToArray(path);
|
|
1134
|
+
let temp = data;
|
|
1135
|
+
let index = 0;
|
|
1136
|
+
while(index < parts.length){
|
|
1137
|
+
/* istanbul ignore next */ if (!Array.isArray(temp) && !isObject(temp)) {
|
|
1138
|
+
break;
|
|
1139
|
+
}
|
|
1140
|
+
const key = parts[index];
|
|
1141
|
+
// [foo, '0']
|
|
1142
|
+
if (typeof temp[key] === 'undefined') {
|
|
1143
|
+
const match = NUMBER_REGEX.test(key);
|
|
1144
|
+
if (match) {
|
|
1145
|
+
temp[key] = [];
|
|
1146
|
+
} else {
|
|
1147
|
+
temp[key] = {};
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
if (index === parts.length - 1) {
|
|
1151
|
+
temp[key] = value;
|
|
1152
|
+
break;
|
|
1153
|
+
}
|
|
1154
|
+
index++;
|
|
1155
|
+
temp = temp[key];
|
|
1156
|
+
}
|
|
1157
|
+
return data;
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1148
1160
|
class MemoryStore {
|
|
1161
|
+
data;
|
|
1162
|
+
constructor(options){
|
|
1163
|
+
this.data = options.data;
|
|
1164
|
+
}
|
|
1149
1165
|
async get(context) {
|
|
1150
1166
|
if (!this.data[context.locale] || !this.data[context.locale][context.group]) {
|
|
1151
1167
|
return undefined;
|
|
@@ -1171,73 +1187,46 @@ class MemoryStore {
|
|
|
1171
1187
|
async getLocales() {
|
|
1172
1188
|
return Object.keys(this.data);
|
|
1173
1189
|
}
|
|
1174
|
-
constructor(options){
|
|
1175
|
-
this.data = options.data;
|
|
1176
|
-
}
|
|
1177
1190
|
}
|
|
1178
1191
|
|
|
1179
|
-
|
|
1180
|
-
const noop = () => {
|
|
1181
|
-
};
|
|
1182
|
-
|
|
1192
|
+
//#region computedAsync/index.ts
|
|
1183
1193
|
function computedAsync(evaluationCallback, initialState, optionsOrRef) {
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
cancelCallback();
|
|
1221
|
-
});
|
|
1222
|
-
});
|
|
1223
|
-
if (counterAtBeginning === counter)
|
|
1224
|
-
current.value = result;
|
|
1225
|
-
} catch (e) {
|
|
1226
|
-
onError(e);
|
|
1227
|
-
} finally {
|
|
1228
|
-
if (evaluating && counterAtBeginning === counter)
|
|
1229
|
-
evaluating.value = false;
|
|
1230
|
-
hasFinished = true;
|
|
1231
|
-
}
|
|
1232
|
-
}, { flush });
|
|
1233
|
-
if (lazy) {
|
|
1234
|
-
return computed(() => {
|
|
1235
|
-
started.value = true;
|
|
1236
|
-
return current.value;
|
|
1237
|
-
});
|
|
1238
|
-
} else {
|
|
1239
|
-
return current;
|
|
1240
|
-
}
|
|
1194
|
+
var _globalThis$reportErr;
|
|
1195
|
+
let options;
|
|
1196
|
+
if (isRef(optionsOrRef)) options = { evaluating: optionsOrRef };
|
|
1197
|
+
else options = optionsOrRef || {};
|
|
1198
|
+
const { lazy = false, flush = "sync", evaluating = void 0, shallow = true, onError = (_globalThis$reportErr = globalThis.reportError) !== null && _globalThis$reportErr !== void 0 ? _globalThis$reportErr : noop } = options;
|
|
1199
|
+
const started = shallowRef(!lazy);
|
|
1200
|
+
const current = shallow ? shallowRef(initialState) : ref(initialState);
|
|
1201
|
+
let counter = 0;
|
|
1202
|
+
watchEffect(async (onInvalidate) => {
|
|
1203
|
+
if (!started.value) return;
|
|
1204
|
+
counter++;
|
|
1205
|
+
const counterAtBeginning = counter;
|
|
1206
|
+
let hasFinished = false;
|
|
1207
|
+
if (evaluating) Promise.resolve().then(() => {
|
|
1208
|
+
evaluating.value = true;
|
|
1209
|
+
});
|
|
1210
|
+
try {
|
|
1211
|
+
const result = await evaluationCallback((cancelCallback) => {
|
|
1212
|
+
onInvalidate(() => {
|
|
1213
|
+
if (evaluating) evaluating.value = false;
|
|
1214
|
+
if (!hasFinished) cancelCallback();
|
|
1215
|
+
});
|
|
1216
|
+
});
|
|
1217
|
+
if (counterAtBeginning === counter) current.value = result;
|
|
1218
|
+
} catch (e) {
|
|
1219
|
+
onError(e);
|
|
1220
|
+
} finally {
|
|
1221
|
+
if (evaluating && counterAtBeginning === counter) evaluating.value = false;
|
|
1222
|
+
hasFinished = true;
|
|
1223
|
+
}
|
|
1224
|
+
}, { flush });
|
|
1225
|
+
if (lazy) return computed(() => {
|
|
1226
|
+
started.value = true;
|
|
1227
|
+
return current.value;
|
|
1228
|
+
});
|
|
1229
|
+
else return current;
|
|
1241
1230
|
}
|
|
1242
1231
|
|
|
1243
1232
|
function inject(key, instance) {
|
|
@@ -1578,13 +1567,12 @@ function createPermissionCheckerReactiveFn(ctx = {}) {
|
|
|
1578
1567
|
}
|
|
1579
1568
|
}
|
|
1580
1569
|
let outcome;
|
|
1570
|
+
const input = ctx.input || new PolicyData();
|
|
1571
|
+
input.set(BuiltInPolicyType.IDENTITY, identity);
|
|
1581
1572
|
try {
|
|
1582
1573
|
computePromise = store.permissionChecker.preCheckOneOf({
|
|
1583
1574
|
...ctx,
|
|
1584
|
-
input
|
|
1585
|
-
...ctx.input || {},
|
|
1586
|
-
identity
|
|
1587
|
-
}
|
|
1575
|
+
input
|
|
1588
1576
|
}).then(()=>true).catch(()=>false);
|
|
1589
1577
|
outcome = await computePromise;
|
|
1590
1578
|
} catch (e) {
|
|
@@ -2636,12 +2624,12 @@ function create(ctx) {
|
|
|
2636
2624
|
return;
|
|
2637
2625
|
}
|
|
2638
2626
|
if (ctx.props.queryFilters) {
|
|
2639
|
-
query = {
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2627
|
+
query = query || {};
|
|
2628
|
+
query.filters = ctx.props.queryFilters;
|
|
2629
|
+
}
|
|
2630
|
+
if (ctx.props.queryFields) {
|
|
2631
|
+
query = query || {};
|
|
2632
|
+
query.fields = ctx.props.queryFields;
|
|
2645
2633
|
}
|
|
2646
2634
|
if (ctx.props.entityId) {
|
|
2647
2635
|
id = ctx.props.entityId;
|
|
@@ -4155,7 +4143,7 @@ const APermissionCheck = defineComponent({
|
|
|
4155
4143
|
const fn = createPermissionCheckerReactiveFn();
|
|
4156
4144
|
const isPermitted = computed(()=>fn({
|
|
4157
4145
|
name: props.name,
|
|
4158
|
-
input: props.input,
|
|
4146
|
+
input: new PolicyData(props.input),
|
|
4159
4147
|
options: props.options
|
|
4160
4148
|
}));
|
|
4161
4149
|
return ()=>{
|
|
@@ -4765,10 +4753,22 @@ const AClientRoleAssignment = defineComponent({
|
|
|
4765
4753
|
|
|
4766
4754
|
const AClientRoleAssignments = defineComponent({
|
|
4767
4755
|
props: {
|
|
4768
|
-
entityId: String
|
|
4756
|
+
entityId: String,
|
|
4757
|
+
realmId: String
|
|
4769
4758
|
},
|
|
4770
4759
|
setup (props, { slots }) {
|
|
4771
|
-
return ()=>h(ARoles, {
|
|
4760
|
+
return ()=>h(ARoles, {
|
|
4761
|
+
query: {
|
|
4762
|
+
filters: {
|
|
4763
|
+
realm_id: [
|
|
4764
|
+
...props.realmId ? [
|
|
4765
|
+
props.realmId
|
|
4766
|
+
] : [],
|
|
4767
|
+
null
|
|
4768
|
+
]
|
|
4769
|
+
}
|
|
4770
|
+
}
|
|
4771
|
+
}, {
|
|
4772
4772
|
[SlotName.ITEM_ACTIONS]: (slotProps)=>h(AClientRoleAssignment, {
|
|
4773
4773
|
clientId: props.entityId,
|
|
4774
4774
|
roleId: slotProps.data.id,
|