@platform-mesh/portal-ui-lib 0.72.1 → 0.74.0
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/assets/platform-mesh-portal-ui-wc.js +787 -776
- package/fesm2022/platform-mesh-portal-ui-lib-models.mjs +8 -14
- package/fesm2022/platform-mesh-portal-ui-lib-models.mjs.map +1 -1
- package/fesm2022/platform-mesh-portal-ui-lib-portal-options.mjs +1945 -1444
- package/fesm2022/platform-mesh-portal-ui-lib-portal-options.mjs.map +1 -1
- package/fesm2022/platform-mesh-portal-ui-lib-services.mjs +986 -960
- package/fesm2022/platform-mesh-portal-ui-lib-services.mjs.map +1 -1
- package/fesm2022/platform-mesh-portal-ui-lib-utils.mjs +180 -264
- package/fesm2022/platform-mesh-portal-ui-lib-utils.mjs.map +1 -1
- package/fesm2022/platform-mesh-portal-ui-lib.mjs +2 -9
- package/fesm2022/platform-mesh-portal-ui-lib.mjs.map +1 -1
- package/package.json +6 -5
- package/types/platform-mesh-portal-ui-lib-models.d.ts +177 -187
- package/types/platform-mesh-portal-ui-lib-portal-options.d.ts +117 -128
- package/types/platform-mesh-portal-ui-lib-services.d.ts +239 -253
- package/types/platform-mesh-portal-ui-lib-utils.d.ts +38 -51
- package/types/platform-mesh-portal-ui-lib.d.ts +1 -3
|
@@ -1,299 +1,215 @@
|
|
|
1
|
-
import { JSONPath } from
|
|
2
|
-
import { ResourceOperationTypeMap } from
|
|
3
|
-
|
|
4
|
-
const QUERY_SUFFIX = 'Query';
|
|
5
|
-
/**
|
|
6
|
-
* Builds the input type name of a mutation from the `__typename` of the query
|
|
7
|
-
* type that holds the resource (e.g. `NetworkAPIFooBarV1alpha1Query`). The
|
|
8
|
-
* gateway names the input type `<prefix><Kind>_Input` with the same prefix,
|
|
9
|
-
* so the UI does not need its own copy of the gateway's naming rule.
|
|
10
|
-
*/
|
|
1
|
+
import { JSONPath } from "jsonpath-plus";
|
|
2
|
+
import { ResourceOperationTypeMap } from "@platform-mesh/portal-ui-lib/models";
|
|
3
|
+
const QUERY_SUFFIX = "Query";
|
|
11
4
|
function buildGraphQLInputTypeName(queryTypeName, entity) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
const prefix = queryTypeName.slice(0, -QUERY_SUFFIX.length);
|
|
16
|
-
return `${prefix}${entity}_Input`;
|
|
5
|
+
if (!queryTypeName?.endsWith(QUERY_SUFFIX)) throw new Error(`Unexpected GraphQL query type name: ${queryTypeName}`);
|
|
6
|
+
return `${queryTypeName.slice(0, -5)}${entity}_Input`;
|
|
17
7
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
8
|
+
function buildResourcePath(input, separator = "_") {
|
|
9
|
+
return [
|
|
10
|
+
input.apiGroup,
|
|
11
|
+
input.version,
|
|
12
|
+
input.entity
|
|
13
|
+
].filter((p) => !!p).join(separator);
|
|
23
14
|
}
|
|
24
|
-
|
|
25
|
-
/** Flattens nested `propertyCollection` trees into a list of leaf field definitions. */
|
|
26
15
|
function flattenFieldTree(fields) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
16
|
+
const result = [];
|
|
17
|
+
for (const field of fields ?? []) {
|
|
18
|
+
if (field.propertyCollection?.length) {
|
|
19
|
+
result.push(...flattenFieldTree(field.propertyCollection));
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
result.push(field);
|
|
23
|
+
}
|
|
24
|
+
return result;
|
|
36
25
|
}
|
|
37
|
-
|
|
38
|
-
/** Builds GraphQL field selections for reads, omitting write-only secrets. */
|
|
39
26
|
const generateGraphQLReadFields = (uiFields) => generateGraphQLFields(uiFields, { forRead: true });
|
|
40
27
|
const generateGraphQLFields = (uiFields, options = {}) => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
field.property.map((property) => generate(property, graphQLFields));
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
generate(field.property, graphQLFields);
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
return graphQLFields;
|
|
28
|
+
const graphQLFields = [];
|
|
29
|
+
const flattened = flattenFieldTree(uiFields);
|
|
30
|
+
(options.forRead ? flattened.filter((field) => !field.writeOnly) : flattened).map((field) => {
|
|
31
|
+
if (field.property instanceof Array) field.property.map((property) => generate(property, graphQLFields));
|
|
32
|
+
else generate(field.property, graphQLFields);
|
|
33
|
+
});
|
|
34
|
+
return graphQLFields;
|
|
55
35
|
};
|
|
56
36
|
const generate = (root, fields = []) => {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
[part]: [...generate(paths.splice(1).join('.'))],
|
|
68
|
-
});
|
|
69
|
-
return fields;
|
|
70
|
-
}
|
|
37
|
+
if (!root) return [];
|
|
38
|
+
const paths = root.split(".");
|
|
39
|
+
for (const part of paths) {
|
|
40
|
+
if (paths.length === 1) {
|
|
41
|
+
fields.push(part);
|
|
42
|
+
return fields;
|
|
43
|
+
}
|
|
44
|
+
fields.push({ [part]: [...generate(paths.splice(1).join("."))] });
|
|
45
|
+
return fields;
|
|
46
|
+
}
|
|
71
47
|
};
|
|
72
|
-
|
|
73
48
|
const getResourceValueByJsonPath = (resource, field) => {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
if (value && field.propertyField) {
|
|
89
|
-
return executeTransform(value[field.propertyField.key], field.propertyField.transform);
|
|
90
|
-
}
|
|
91
|
-
return value;
|
|
49
|
+
const property = field.jsonPathExpression || field.property;
|
|
50
|
+
if (!property) return;
|
|
51
|
+
if (property instanceof Array) {
|
|
52
|
+
console.error(`Property defined as an array: ${JSON.stringify(property)}, provide "jsonPathExpression" field to properly ready resource value`);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const prefix = property.startsWith("$.") ? "" : "$.";
|
|
56
|
+
const queryResult = JSONPath({
|
|
57
|
+
path: `${prefix}${property}`,
|
|
58
|
+
json: resource
|
|
59
|
+
});
|
|
60
|
+
const value = queryResult.length ? queryResult[0] : void 0;
|
|
61
|
+
if (value && field.propertyField) return executeTransform(value[field.propertyField.key], field.propertyField.transform);
|
|
62
|
+
return value;
|
|
92
63
|
};
|
|
93
64
|
const executeTransform = (value, transform) => {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
try {
|
|
118
|
-
return encodeBase64(acc);
|
|
119
|
-
}
|
|
120
|
-
catch {
|
|
121
|
-
return acc;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
default:
|
|
125
|
-
return acc;
|
|
126
|
-
}
|
|
127
|
-
}, value);
|
|
65
|
+
if (value == null || transform == null || !transform.length) return value;
|
|
66
|
+
return transform.reduce((acc, t) => {
|
|
67
|
+
if (acc == null) return acc;
|
|
68
|
+
switch (t) {
|
|
69
|
+
case "uppercase": return acc.toUpperCase();
|
|
70
|
+
case "lowercase": return acc.toLowerCase();
|
|
71
|
+
case "capitalize": {
|
|
72
|
+
const str = String(acc);
|
|
73
|
+
return str.length ? str.charAt(0).toUpperCase() + str.slice(1) : str;
|
|
74
|
+
}
|
|
75
|
+
case "decode": try {
|
|
76
|
+
return decodeBase64(acc);
|
|
77
|
+
} catch {
|
|
78
|
+
return acc;
|
|
79
|
+
}
|
|
80
|
+
case "encode": try {
|
|
81
|
+
return encodeBase64(acc);
|
|
82
|
+
} catch {
|
|
83
|
+
return acc;
|
|
84
|
+
}
|
|
85
|
+
default: return acc;
|
|
86
|
+
}
|
|
87
|
+
}, value);
|
|
128
88
|
};
|
|
129
89
|
const encodeBase64 = (str) => {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
90
|
+
try {
|
|
91
|
+
const utf8Bytes = new TextEncoder().encode(str);
|
|
92
|
+
const binaryString = Array.from(utf8Bytes, (byte) => String.fromCharCode(byte)).join("");
|
|
93
|
+
return btoa(binaryString);
|
|
94
|
+
} catch (error) {
|
|
95
|
+
console.error("Base64 encoding failed:", error);
|
|
96
|
+
throw new Error("Failed to encode string to Base64");
|
|
97
|
+
}
|
|
139
98
|
};
|
|
140
99
|
const decodeBase64 = (base64) => {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
100
|
+
try {
|
|
101
|
+
const binaryString = atob(base64);
|
|
102
|
+
const bytes = Uint8Array.from(binaryString, (char) => char.charCodeAt(0));
|
|
103
|
+
return new TextDecoder().decode(bytes);
|
|
104
|
+
} catch (error) {
|
|
105
|
+
console.error("Base64 decoding failed:", error);
|
|
106
|
+
throw new Error("Failed to decode Base64 string");
|
|
107
|
+
}
|
|
150
108
|
};
|
|
151
|
-
|
|
152
109
|
const getValueByPath = (obj, path) => {
|
|
153
|
-
|
|
154
|
-
jsonPathExpression: path,
|
|
155
|
-
});
|
|
110
|
+
return getResourceValueByJsonPath(obj, { jsonPathExpression: path });
|
|
156
111
|
};
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
112
|
+
const permissionKey = (instance) => [
|
|
113
|
+
instance.resource,
|
|
114
|
+
instance.namespace,
|
|
115
|
+
instance.name
|
|
116
|
+
].filter(Boolean).join("/");
|
|
162
117
|
const isLocalSetup = () => {
|
|
163
|
-
|
|
164
|
-
window.location.hostname.includes('portal.dev.local'));
|
|
118
|
+
return window.location.hostname.includes("localhost") || window.location.hostname.includes("portal.dev.local");
|
|
165
119
|
};
|
|
166
|
-
|
|
167
120
|
function isNamespacedResource(nodeContext) {
|
|
168
|
-
|
|
121
|
+
return nodeContext?.resourceDefinition?.scope === "Namespaced";
|
|
169
122
|
}
|
|
170
|
-
|
|
171
123
|
function mergeListWithSubscriptionResult(items, subscriptionResult, options) {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
}
|
|
190
|
-
if (type === ResourceOperationTypeMap.ADDED) {
|
|
191
|
-
result.set(objectKey, mappedObject);
|
|
192
|
-
}
|
|
193
|
-
else if (type === ResourceOperationTypeMap.MODIFIED) {
|
|
194
|
-
if (result.has(objectKey)) {
|
|
195
|
-
result.set(objectKey, mappedObject);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
else if (type === ResourceOperationTypeMap.DELETED) {
|
|
199
|
-
result.delete(objectKey);
|
|
200
|
-
}
|
|
201
|
-
return [...result.values()];
|
|
124
|
+
if (!subscriptionResult) return items;
|
|
125
|
+
const { getItemKey, mapSubscriptionObjectToItem } = options;
|
|
126
|
+
const result = /* @__PURE__ */ new Map();
|
|
127
|
+
items.forEach((item) => {
|
|
128
|
+
const key = getItemKey(item);
|
|
129
|
+
if (!key) return;
|
|
130
|
+
result.set(key, item);
|
|
131
|
+
});
|
|
132
|
+
const { type, object } = subscriptionResult;
|
|
133
|
+
const mappedObject = mapSubscriptionObjectToItem(object);
|
|
134
|
+
const objectKey = getItemKey(mappedObject);
|
|
135
|
+
if (!objectKey) return items;
|
|
136
|
+
if (type === ResourceOperationTypeMap.ADDED) result.set(objectKey, mappedObject);
|
|
137
|
+
else if (type === ResourceOperationTypeMap.MODIFIED) {
|
|
138
|
+
if (result.has(objectKey)) result.set(objectKey, mappedObject);
|
|
139
|
+
} else if (type === ResourceOperationTypeMap.DELETED) result.delete(objectKey);
|
|
140
|
+
return [...result.values()];
|
|
202
141
|
}
|
|
203
|
-
|
|
204
142
|
const parseRawGqlQueryToFields = (s) => {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
stack.at(-1)?.push(v);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
return root;
|
|
143
|
+
const tokens = s.replace(/[{}]/g, " $& ").trim().split(/\s+/);
|
|
144
|
+
const root = [];
|
|
145
|
+
const stack = [root];
|
|
146
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
147
|
+
const v = tokens[i];
|
|
148
|
+
if (v === "{") continue;
|
|
149
|
+
if (v === "}") {
|
|
150
|
+
stack.pop();
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
if (tokens[i + 1] === "{") {
|
|
154
|
+
const node = { [v]: [] };
|
|
155
|
+
stack.at(-1)?.push(node);
|
|
156
|
+
stack.push(node[v]);
|
|
157
|
+
} else stack.at(-1)?.push(v);
|
|
158
|
+
}
|
|
159
|
+
return root;
|
|
226
160
|
};
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
* Tier-1 resource-level permission check (fail-open).
|
|
230
|
-
*
|
|
231
|
-
* Returns true when the verb is granted for the resource, OR when no
|
|
232
|
-
* permissions were fetched for the resource at all (no entry in
|
|
233
|
-
* portalPermissions → we don't gate). Returns false ONLY when permissions
|
|
234
|
-
* WERE fetched for the resource and the verb is absent.
|
|
235
|
-
*/
|
|
236
|
-
const resourceActionAllowed = (portalPermissions, resource, verb) => portalPermissions?.[resource ?? '']?.includes(verb) ?? true;
|
|
237
|
-
|
|
161
|
+
const resourceActionAllowed = (portalPermissions, resource, verb) => portalPermissions?.[resource ?? ""]?.includes(verb) ?? true;
|
|
238
162
|
function stripTypename(value) {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
rest[k] = stripTypename(rest[k]);
|
|
247
|
-
}
|
|
248
|
-
return rest;
|
|
249
|
-
}
|
|
250
|
-
return value;
|
|
163
|
+
if (Array.isArray(value)) return value.map((v) => stripTypename(v));
|
|
164
|
+
if (value && typeof value === "object") {
|
|
165
|
+
const { __typename, ...rest } = value;
|
|
166
|
+
for (const k of Object.keys(rest)) rest[k] = stripTypename(rest[k]);
|
|
167
|
+
return rest;
|
|
168
|
+
}
|
|
169
|
+
return value;
|
|
251
170
|
}
|
|
252
|
-
|
|
171
|
+
const viewUrlPlaceholderPattern = /\{(context|nodeParams)\.([^{}]+)\}/g;
|
|
172
|
+
const resolveViewUrlPlaceholders = (viewUrl, sources) => {
|
|
173
|
+
let unresolved = false;
|
|
174
|
+
const resolved = viewUrl.replace(viewUrlPlaceholderPattern, (placeholder, source, path) => {
|
|
175
|
+
const key = path.trim();
|
|
176
|
+
const values = sources[source];
|
|
177
|
+
const value = values && Object.hasOwn(values, key) ? values[key] : key.split(".").reduce((current, segment) => typeof current === "object" && current !== null && Object.hasOwn(current, segment) ? current[segment] : void 0, values);
|
|
178
|
+
if (typeof value === "string" && value.trim() !== "" || typeof value === "number" || typeof value === "boolean") return String(value);
|
|
179
|
+
unresolved = true;
|
|
180
|
+
return placeholder;
|
|
181
|
+
});
|
|
182
|
+
return unresolved ? void 0 : resolved;
|
|
183
|
+
};
|
|
253
184
|
function deletePropertyByPath(object, path) {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
current = next;
|
|
266
|
-
}
|
|
267
|
-
delete current[segments[segments.length - 1]];
|
|
268
|
-
return object;
|
|
185
|
+
const segments = path.split(".").filter(Boolean);
|
|
186
|
+
if (segments.length === 0) return object;
|
|
187
|
+
let current = object;
|
|
188
|
+
for (let i = 0; i < segments.length - 1; i += 1) {
|
|
189
|
+
const key = segments[i];
|
|
190
|
+
const next = current[key];
|
|
191
|
+
if (next == null || typeof next !== "object") return object;
|
|
192
|
+
current = next;
|
|
193
|
+
}
|
|
194
|
+
delete current[segments[segments.length - 1]];
|
|
195
|
+
return object;
|
|
269
196
|
}
|
|
270
|
-
|
|
271
197
|
function setPropertyByPath(object, path, value) {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
typeof existing !== 'object') {
|
|
287
|
-
current[key] = {};
|
|
288
|
-
}
|
|
289
|
-
current = current[key];
|
|
290
|
-
}
|
|
291
|
-
return object;
|
|
198
|
+
const segments = path.split(".").filter(Boolean);
|
|
199
|
+
if (segments.length === 0) return object;
|
|
200
|
+
let current = object;
|
|
201
|
+
for (let i = 0; i < segments.length; i += 1) {
|
|
202
|
+
const key = segments[i];
|
|
203
|
+
if (i === segments.length - 1) {
|
|
204
|
+
current[key] = value;
|
|
205
|
+
break;
|
|
206
|
+
}
|
|
207
|
+
const existing = current[key];
|
|
208
|
+
if (existing === void 0 || existing === null || typeof existing !== "object") current[key] = {};
|
|
209
|
+
current = current[key];
|
|
210
|
+
}
|
|
211
|
+
return object;
|
|
292
212
|
}
|
|
213
|
+
export { buildGraphQLInputTypeName, buildResourcePath, decodeBase64, deletePropertyByPath, encodeBase64, flattenFieldTree, generateGraphQLFields, generateGraphQLReadFields, getResourceValueByJsonPath, getValueByPath, isLocalSetup, isNamespacedResource, mergeListWithSubscriptionResult, parseRawGqlQueryToFields, permissionKey, resolveViewUrlPlaceholders, resourceActionAllowed, setPropertyByPath, stripTypename };
|
|
293
214
|
|
|
294
|
-
|
|
295
|
-
* Generated bundle index. Do not edit.
|
|
296
|
-
*/
|
|
297
|
-
|
|
298
|
-
export { buildGraphQLInputTypeName, buildResourcePath, decodeBase64, deletePropertyByPath, encodeBase64, flattenFieldTree, generateGraphQLFields, generateGraphQLReadFields, getResourceValueByJsonPath, getValueByPath, isLocalSetup, isNamespacedResource, mergeListWithSubscriptionResult, parseRawGqlQueryToFields, permissionKey, resourceActionAllowed, setPropertyByPath, stripTypename };
|
|
299
|
-
//# sourceMappingURL=platform-mesh-portal-ui-lib-utils.mjs.map
|
|
215
|
+
//# sourceMappingURL=platform-mesh-portal-ui-lib-utils.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-mesh-portal-ui-lib-utils.mjs","sources":["../../projects/lib/utils/utils/build-graphql-input-type-name.ts","../../projects/lib/utils/utils/build-resource-list-operation.ts","../../projects/lib/utils/utils/flatten-field-tree.ts","../../projects/lib/utils/utils/columns-to-gql-fields.ts","../../projects/lib/utils/utils/resource-field-by-path.ts","../../projects/lib/utils/utils/get-value-by-path.ts","../../projects/lib/utils/utils/instance-permission-key.ts","../../projects/lib/utils/utils/is-local-setup.ts","../../projects/lib/utils/utils/is-namespaced-resource.ts","../../projects/lib/utils/utils/merge-list-with-subscription-result.ts","../../projects/lib/utils/utils/parse-raw-gql-query.ts","../../projects/lib/utils/utils/resource-action-allowed.ts","../../projects/lib/utils/utils/resource-sanitizer.ts","../../projects/lib/utils/utils/delete-property-by-path.ts","../../projects/lib/utils/utils/set-property-by-path.ts","../../projects/lib/utils/platform-mesh-portal-ui-lib-utils.ts"],"sourcesContent":["const QUERY_SUFFIX = 'Query';\n\n/**\n * Builds the input type name of a mutation from the `__typename` of the query\n * type that holds the resource (e.g. `NetworkAPIFooBarV1alpha1Query`). The\n * gateway names the input type `<prefix><Kind>_Input` with the same prefix,\n * so the UI does not need its own copy of the gateway's naming rule.\n */\nexport function buildGraphQLInputTypeName(\n queryTypeName: string | undefined,\n entity: string,\n): string {\n if (!queryTypeName?.endsWith(QUERY_SUFFIX)) {\n throw new Error(`Unexpected GraphQL query type name: ${queryTypeName}`);\n }\n\n const prefix = queryTypeName.slice(0, -QUERY_SUFFIX.length);\n return `${prefix}${entity}_Input`;\n}\n","export function buildResourcePath(\n input: {\n apiGroup?: string | undefined;\n entity: string;\n version?: string | undefined;\n },\n separator: string = '_',\n): string {\n return [input.apiGroup, input.version, input.entity]\n .filter((p): p is string => !!p)\n .join(separator);\n}\n","import { PlatformMeshFieldDefinition } from '@platform-mesh/portal-ui-lib/models';\n\n/** Flattens nested `propertyCollection` trees into a list of leaf field definitions. */\nexport function flattenFieldTree(\n fields: readonly PlatformMeshFieldDefinition[] | undefined,\n): PlatformMeshFieldDefinition[] {\n const result: PlatformMeshFieldDefinition[] = [];\n for (const field of fields ?? []) {\n if (field.propertyCollection?.length) {\n result.push(...flattenFieldTree(field.propertyCollection));\n continue;\n }\n result.push(field);\n }\n return result;\n}\n","import { flattenFieldTree } from './flatten-field-tree';\nimport { PlatformMeshFieldDefinition } from '@platform-mesh/portal-ui-lib/models';\n\nexport type GenerateGraphQLFieldsOptions = {\n /** Omit fields marked writeOnly (for queries/mutation return selections). */\n forRead?: boolean;\n};\n\n/** Builds GraphQL field selections for reads, omitting write-only secrets. */\nexport const generateGraphQLReadFields = (\n uiFields: readonly PlatformMeshFieldDefinition[],\n): any[] => generateGraphQLFields(uiFields, { forRead: true });\n\nexport const generateGraphQLFields = (\n uiFields: readonly PlatformMeshFieldDefinition[],\n options: GenerateGraphQLFieldsOptions = {},\n): any[] => {\n const graphQLFields: any[] = [];\n const flattened = flattenFieldTree(uiFields);\n const fields = options.forRead\n ? flattened.filter((field) => !field.writeOnly)\n : flattened;\n fields.map((field) => {\n if (field.property instanceof Array) {\n field.property.map((property) => generate(property, graphQLFields));\n } else {\n generate(field.property, graphQLFields);\n }\n });\n return graphQLFields;\n};\n\nconst generate = (root: string | undefined, fields: any = []) => {\n if (!root) {\n return [];\n }\n\n const paths = root.split('.');\n\n for (const part of paths) {\n if (paths.length === 1) {\n fields.push(part);\n return fields;\n }\n\n fields.push({\n [part]: [...generate(paths.splice(1).join('.'))],\n });\n\n return fields;\n }\n};\n","import {\n PropertyField,\n TransformType,\n} from '@platform-mesh/portal-ui-lib/models';\nimport { JSONPath } from 'jsonpath-plus';\n\nexport const getResourceValueByJsonPath = <T>(\n resource: T,\n field: {\n jsonPathExpression?: string;\n property?: string | string[];\n propertyField?: PropertyField;\n },\n) => {\n const property = field.jsonPathExpression || field.property;\n if (!property) {\n return undefined;\n }\n\n if (property instanceof Array) {\n console.error(\n `Property defined as an array: ${JSON.stringify(property)}, provide \"jsonPathExpression\" field to properly ready resource value`,\n );\n return undefined;\n }\n\n const prefix = property.startsWith('$.') ? '' : '$.';\n const queryResult = JSONPath({\n path: `${prefix}${property}`,\n json: resource as object,\n });\n const value = queryResult.length ? queryResult[0] : undefined;\n\n if (value && field.propertyField) {\n return executeTransform(\n value[field.propertyField.key],\n field.propertyField.transform,\n );\n }\n\n return value;\n};\n\nconst executeTransform = (\n value: string | undefined,\n transform: TransformType[] | undefined,\n): string | undefined => {\n if (value == null || transform == null || !transform.length) return value;\n\n return transform.reduce((acc, t) => {\n if (acc == null) return acc;\n\n switch (t) {\n case 'uppercase':\n return acc.toUpperCase();\n case 'lowercase':\n return acc.toLowerCase();\n case 'capitalize': {\n const str = String(acc);\n return str.length ? str.charAt(0).toUpperCase() + str.slice(1) : str;\n }\n case 'decode': {\n try {\n return decodeBase64(acc);\n } catch {\n return acc;\n }\n }\n case 'encode': {\n try {\n return encodeBase64(acc);\n } catch {\n return acc;\n }\n }\n default:\n return acc;\n }\n }, value);\n};\n\nexport const encodeBase64 = (str: string): string => {\n try {\n const utf8Bytes = new TextEncoder().encode(str);\n const binaryString = Array.from(utf8Bytes, (byte) =>\n String.fromCharCode(byte),\n ).join('');\n return btoa(binaryString);\n } catch (error) {\n console.error('Base64 encoding failed:', error);\n throw new Error('Failed to encode string to Base64');\n }\n};\n\nexport const decodeBase64 = (base64: string): string => {\n try {\n const binaryString = atob(base64);\n const bytes = Uint8Array.from(binaryString, (char) => char.charCodeAt(0));\n return new TextDecoder().decode(bytes);\n } catch (error) {\n console.error('Base64 decoding failed:', error);\n throw new Error('Failed to decode Base64 string');\n }\n};\n","import { getResourceValueByJsonPath } from './resource-field-by-path';\nimport { Resource } from '@platform-mesh/portal-ui-lib/models';\n\nexport const getValueByPath = <T extends object, R = unknown>(\n obj: T,\n path: string,\n): R | undefined => {\n return getResourceValueByJsonPath(obj as Resource, {\n jsonPathExpression: path,\n });\n};\n","import { InstancePermission } from '@platform-mesh/portal-ui-lib/models';\n\nexport const permissionKey = (\n instance: Partial<Omit<InstancePermission, 'actions'>>,\n): string =>\n [instance.resource, instance.namespace, instance.name]\n .filter(Boolean)\n .join('/');\n","export const isLocalSetup = () => {\n return (\n window.location.hostname.includes('localhost') ||\n window.location.hostname.includes('portal.dev.local')\n );\n};\n","import { NodeContext } from '@openmfp/portal-ui-lib';\n\nexport function isNamespacedResource(nodeContext: Partial<NodeContext>) {\n return nodeContext?.resourceDefinition?.scope === 'Namespaced';\n}\n","import {\n Resource,\n ResourceOperationTypeMap,\n ResourceSubscriptionResult,\n} from '@platform-mesh/portal-ui-lib/models';\n\nexport interface MergeListWithSubscriptionResultOptions<T> {\n getItemKey: (item: T) => string | undefined;\n mapSubscriptionObjectToItem: (object: Resource) => T;\n}\n\nexport function mergeListWithSubscriptionResult<T>(\n items: T[],\n subscriptionResult: ResourceSubscriptionResult | undefined,\n options: MergeListWithSubscriptionResultOptions<T>,\n): T[] {\n if (!subscriptionResult) {\n return items;\n }\n\n const { getItemKey, mapSubscriptionObjectToItem } = options;\n\n const result = new Map<string, T>();\n items.forEach((item) => {\n const key = getItemKey(item);\n if (!key) {\n return;\n }\n result.set(key, item);\n });\n\n const { type, object } = subscriptionResult;\n const mappedObject = mapSubscriptionObjectToItem(object);\n const objectKey = getItemKey(mappedObject);\n if (!objectKey) {\n return items;\n }\n\n if (type === ResourceOperationTypeMap.ADDED) {\n result.set(objectKey, mappedObject);\n } else if (type === ResourceOperationTypeMap.MODIFIED) {\n if (result.has(objectKey)) {\n result.set(objectKey, mappedObject);\n }\n } else if (type === ResourceOperationTypeMap.DELETED) {\n result.delete(objectKey);\n }\n\n return [...result.values()];\n}\n","export const parseRawGqlQueryToFields = (s: string): any[] => {\n const tokens = s.replace(/[{}]/g, ' $& ').trim().split(/\\s+/);\n const root: any[] = [];\n const stack: any[][] = [root];\n\n for (let i = 0; i < tokens.length; i++) {\n const v = tokens[i];\n\n if (v === '{') continue;\n if (v === '}') {\n stack.pop();\n continue;\n }\n\n if (tokens[i + 1] === '{') {\n const node = { [v]: [] };\n stack.at(-1)?.push(node);\n stack.push(node[v]);\n } else {\n stack.at(-1)?.push(v);\n }\n }\n\n return root;\n};\n","/**\n * Tier-1 resource-level permission check (fail-open).\n *\n * Returns true when the verb is granted for the resource, OR when no\n * permissions were fetched for the resource at all (no entry in\n * portalPermissions → we don't gate). Returns false ONLY when permissions\n * WERE fetched for the resource and the verb is absent.\n */\nexport const resourceActionAllowed = (\n portalPermissions: { [key: string]: string[] } | undefined,\n resource: string | undefined,\n verb: string,\n): boolean => portalPermissions?.[resource ?? '']?.includes(verb) ?? true;\n","export function stripTypename<T>(value: T): T {\n if (Array.isArray(value)) {\n return (value as unknown as any[]).map((v) => stripTypename(v)) as T;\n }\n if (value && typeof value === 'object') {\n const { __typename, ...rest } = value as Record<string, unknown> & {\n __typename?: string;\n };\n for (const k of Object.keys(rest)) {\n // @ts-ignore - rest is an indexable object\n rest[k] = stripTypename((rest as any)[k]);\n }\n return rest as T;\n }\n return value;\n}\n","export function deletePropertyByPath<T extends Record<string, unknown>>(\n object: T,\n path: string,\n): T {\n const segments = path.split('.').filter(Boolean);\n if (segments.length === 0) {\n return object;\n }\n\n let current: Record<string, unknown> = object;\n\n for (let i = 0; i < segments.length - 1; i += 1) {\n const key = segments[i];\n const next = current[key];\n if (next == null || typeof next !== 'object') {\n return object;\n }\n current = next as Record<string, unknown>;\n }\n\n delete current[segments[segments.length - 1]];\n return object;\n}\n","export function setPropertyByPath<T extends Record<string, any>>(\n object: T,\n path: string,\n value: unknown,\n): T {\n const segments = path.split('.').filter(Boolean);\n if (segments.length === 0) {\n return object;\n }\n\n let current: Record<string, any> = object;\n\n for (let i = 0; i < segments.length; i += 1) {\n const key = segments[i];\n if (i === segments.length - 1) {\n current[key] = value;\n break;\n }\n\n const existing = current[key];\n\n if (\n existing === undefined ||\n existing === null ||\n typeof existing !== 'object'\n ) {\n current[key] = {};\n }\n\n current = current[key];\n }\n\n return object;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAAA,MAAM,YAAY,GAAG,OAAO;AAE5B;;;;;AAKG;AACG,SAAU,yBAAyB,CACvC,aAAiC,EACjC,MAAc,EAAA;IAEd,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,YAAY,CAAC,EAAE;AAC1C,QAAA,MAAM,IAAI,KAAK,CAAC,uCAAuC,aAAa,CAAA,CAAE,CAAC;IACzE;AAEA,IAAA,MAAM,MAAM,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC;AAC3D,IAAA,OAAO,CAAA,EAAG,MAAM,CA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,GAAG,OAAO,CAAC,GAAG,CAAC;IACxB;AAEA,IAAA,OAAO,MAAM;AACf;;ACjCA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"platform-mesh-portal-ui-lib-utils.mjs","names":[],"sources":["../../projects/lib/utils/utils/build-graphql-input-type-name.ts","../../projects/lib/utils/utils/build-resource-list-operation.ts","../../projects/lib/utils/utils/flatten-field-tree.ts","../../projects/lib/utils/utils/columns-to-gql-fields.ts","../../projects/lib/utils/utils/resource-field-by-path.ts","../../projects/lib/utils/utils/get-value-by-path.ts","../../projects/lib/utils/utils/instance-permission-key.ts","../../projects/lib/utils/utils/is-local-setup.ts","../../projects/lib/utils/utils/is-namespaced-resource.ts","../../projects/lib/utils/utils/merge-list-with-subscription-result.ts","../../projects/lib/utils/utils/parse-raw-gql-query.ts","../../projects/lib/utils/utils/resource-action-allowed.ts","../../projects/lib/utils/utils/resource-sanitizer.ts","../../projects/lib/utils/utils/resolve-view-url-placeholders.ts","../../projects/lib/utils/utils/delete-property-by-path.ts","../../projects/lib/utils/utils/set-property-by-path.ts"],"sourcesContent":["const QUERY_SUFFIX = 'Query';\n\n/**\n * Builds the input type name of a mutation from the `__typename` of the query\n * type that holds the resource (e.g. `NetworkAPIFooBarV1alpha1Query`). The\n * gateway names the input type `<prefix><Kind>_Input` with the same prefix,\n * so the UI does not need its own copy of the gateway's naming rule.\n */\nexport function buildGraphQLInputTypeName(\n queryTypeName: string | undefined,\n entity: string,\n): string {\n if (!queryTypeName?.endsWith(QUERY_SUFFIX)) {\n throw new Error(`Unexpected GraphQL query type name: ${queryTypeName}`);\n }\n\n const prefix = queryTypeName.slice(0, -QUERY_SUFFIX.length);\n return `${prefix}${entity}_Input`;\n}\n","export function buildResourcePath(\n input: {\n apiGroup?: string | undefined;\n entity: string;\n version?: string | undefined;\n },\n separator: string = '_',\n): string {\n return [input.apiGroup, input.version, input.entity]\n .filter((p): p is string => !!p)\n .join(separator);\n}\n","import { PlatformMeshFieldDefinition } from '@platform-mesh/portal-ui-lib/models';\n\n/** Flattens nested `propertyCollection` trees into a list of leaf field definitions. */\nexport function flattenFieldTree(\n fields: readonly PlatformMeshFieldDefinition[] | undefined,\n): PlatformMeshFieldDefinition[] {\n const result: PlatformMeshFieldDefinition[] = [];\n for (const field of fields ?? []) {\n if (field.propertyCollection?.length) {\n result.push(...flattenFieldTree(field.propertyCollection));\n continue;\n }\n result.push(field);\n }\n return result;\n}\n","import { flattenFieldTree } from './flatten-field-tree';\nimport { PlatformMeshFieldDefinition } from '@platform-mesh/portal-ui-lib/models';\n\nexport type GenerateGraphQLFieldsOptions = {\n /** Omit fields marked writeOnly (for queries/mutation return selections). */\n forRead?: boolean;\n};\n\n/** Builds GraphQL field selections for reads, omitting write-only secrets. */\nexport const generateGraphQLReadFields = (\n uiFields: readonly PlatformMeshFieldDefinition[],\n): any[] => generateGraphQLFields(uiFields, { forRead: true });\n\nexport const generateGraphQLFields = (\n uiFields: readonly PlatformMeshFieldDefinition[],\n options: GenerateGraphQLFieldsOptions = {},\n): any[] => {\n const graphQLFields: any[] = [];\n const flattened = flattenFieldTree(uiFields);\n const fields = options.forRead\n ? flattened.filter((field) => !field.writeOnly)\n : flattened;\n fields.map((field) => {\n if (field.property instanceof Array) {\n field.property.map((property) => generate(property, graphQLFields));\n } else {\n generate(field.property, graphQLFields);\n }\n });\n return graphQLFields;\n};\n\nconst generate = (root: string | undefined, fields: any = []) => {\n if (!root) {\n return [];\n }\n\n const paths = root.split('.');\n\n for (const part of paths) {\n if (paths.length === 1) {\n fields.push(part);\n return fields;\n }\n\n fields.push({\n [part]: [...generate(paths.splice(1).join('.'))],\n });\n\n return fields;\n }\n};\n","import {\n PropertyField,\n TransformType,\n} from '@platform-mesh/portal-ui-lib/models';\nimport { JSONPath } from 'jsonpath-plus';\n\nexport const getResourceValueByJsonPath = <T>(\n resource: T,\n field: {\n jsonPathExpression?: string;\n property?: string | string[];\n propertyField?: PropertyField;\n },\n) => {\n const property = field.jsonPathExpression || field.property;\n if (!property) {\n return undefined;\n }\n\n if (property instanceof Array) {\n console.error(\n `Property defined as an array: ${JSON.stringify(property)}, provide \"jsonPathExpression\" field to properly ready resource value`,\n );\n return undefined;\n }\n\n const prefix = property.startsWith('$.') ? '' : '$.';\n const queryResult = JSONPath({\n path: `${prefix}${property}`,\n json: resource as object,\n }) as any[];\n const value = queryResult.length ? queryResult[0] : undefined;\n\n if (value && field.propertyField) {\n return executeTransform(\n value[field.propertyField.key],\n field.propertyField.transform,\n );\n }\n\n return value;\n};\n\nconst executeTransform = (\n value: string | undefined,\n transform: TransformType[] | undefined,\n): string | undefined => {\n if (value == null || transform == null || !transform.length) return value;\n\n return transform.reduce((acc, t) => {\n if (acc == null) return acc;\n\n switch (t) {\n case 'uppercase':\n return acc.toUpperCase();\n case 'lowercase':\n return acc.toLowerCase();\n case 'capitalize': {\n const str = String(acc);\n return str.length ? str.charAt(0).toUpperCase() + str.slice(1) : str;\n }\n case 'decode': {\n try {\n return decodeBase64(acc);\n } catch {\n return acc;\n }\n }\n case 'encode': {\n try {\n return encodeBase64(acc);\n } catch {\n return acc;\n }\n }\n default:\n return acc;\n }\n }, value);\n};\n\nexport const encodeBase64 = (str: string): string => {\n try {\n const utf8Bytes = new TextEncoder().encode(str);\n const binaryString = Array.from(utf8Bytes, (byte) =>\n String.fromCharCode(byte),\n ).join('');\n return btoa(binaryString);\n } catch (error) {\n console.error('Base64 encoding failed:', error);\n throw new Error('Failed to encode string to Base64');\n }\n};\n\nexport const decodeBase64 = (base64: string): string => {\n try {\n const binaryString = atob(base64);\n const bytes = Uint8Array.from(binaryString, (char) => char.charCodeAt(0));\n return new TextDecoder().decode(bytes);\n } catch (error) {\n console.error('Base64 decoding failed:', error);\n throw new Error('Failed to decode Base64 string');\n }\n};\n","import { getResourceValueByJsonPath } from './resource-field-by-path';\nimport { Resource } from '@platform-mesh/portal-ui-lib/models';\n\nexport const getValueByPath = <T extends object, R = unknown>(\n obj: T,\n path: string,\n): R | undefined => {\n return getResourceValueByJsonPath(obj as Resource, {\n jsonPathExpression: path,\n });\n};\n","import { InstancePermission } from '@platform-mesh/portal-ui-lib/models';\n\nexport const permissionKey = (\n instance: Partial<Omit<InstancePermission, 'actions'>>,\n): string =>\n [instance.resource, instance.namespace, instance.name]\n .filter(Boolean)\n .join('/');\n","export const isLocalSetup = () => {\n return (\n window.location.hostname.includes('localhost') ||\n window.location.hostname.includes('portal.dev.local')\n );\n};\n","import { NodeContext } from '@openmfp/portal-ui-lib';\n\nexport function isNamespacedResource(nodeContext: Partial<NodeContext>) {\n return nodeContext?.resourceDefinition?.scope === 'Namespaced';\n}\n","import {\n Resource,\n ResourceOperationTypeMap,\n ResourceSubscriptionResult,\n} from '@platform-mesh/portal-ui-lib/models';\n\nexport interface MergeListWithSubscriptionResultOptions<T> {\n getItemKey: (item: T) => string | undefined;\n mapSubscriptionObjectToItem: (object: Resource) => T;\n}\n\nexport function mergeListWithSubscriptionResult<T>(\n items: T[],\n subscriptionResult: ResourceSubscriptionResult | undefined,\n options: MergeListWithSubscriptionResultOptions<T>,\n): T[] {\n if (!subscriptionResult) {\n return items;\n }\n\n const { getItemKey, mapSubscriptionObjectToItem } = options;\n\n const result = new Map<string, T>();\n items.forEach((item) => {\n const key = getItemKey(item);\n if (!key) {\n return;\n }\n result.set(key, item);\n });\n\n const { type, object } = subscriptionResult;\n const mappedObject = mapSubscriptionObjectToItem(object);\n const objectKey = getItemKey(mappedObject);\n if (!objectKey) {\n return items;\n }\n\n if (type === ResourceOperationTypeMap.ADDED) {\n result.set(objectKey, mappedObject);\n } else if (type === ResourceOperationTypeMap.MODIFIED) {\n if (result.has(objectKey)) {\n result.set(objectKey, mappedObject);\n }\n } else if (type === ResourceOperationTypeMap.DELETED) {\n result.delete(objectKey);\n }\n\n return [...result.values()];\n}\n","export const parseRawGqlQueryToFields = (s: string): any[] => {\n const tokens = s.replace(/[{}]/g, ' $& ').trim().split(/\\s+/);\n const root: any[] = [];\n const stack: any[][] = [root];\n\n for (let i = 0; i < tokens.length; i++) {\n const v = tokens[i];\n\n if (v === '{') continue;\n if (v === '}') {\n stack.pop();\n continue;\n }\n\n if (tokens[i + 1] === '{') {\n const node = { [v]: [] };\n stack.at(-1)?.push(node);\n stack.push(node[v]);\n } else {\n stack.at(-1)?.push(v);\n }\n }\n\n return root;\n};\n","/**\n * Tier-1 resource-level permission check (fail-open).\n *\n * Returns true when the verb is granted for the resource, OR when no\n * permissions were fetched for the resource at all (no entry in\n * portalPermissions → we don't gate). Returns false ONLY when permissions\n * WERE fetched for the resource and the verb is absent.\n */\nexport const resourceActionAllowed = (\n portalPermissions: { [key: string]: string[] } | undefined,\n resource: string | undefined,\n verb: string,\n): boolean => portalPermissions?.[resource ?? '']?.includes(verb) ?? true;\n","export function stripTypename<T>(value: T): T {\n if (Array.isArray(value)) {\n return (value as unknown as any[]).map((v) => stripTypename(v)) as T;\n }\n if (value && typeof value === 'object') {\n const { __typename, ...rest } = value as Record<string, unknown> & {\n __typename?: string;\n };\n for (const k of Object.keys(rest)) {\n // @ts-ignore - rest is an indexable object\n rest[k] = stripTypename((rest as any)[k]);\n }\n return rest as T;\n }\n return value;\n}\n","export interface ViewUrlPlaceholderSources {\n context?: Record<string, unknown>;\n nodeParams?: Record<string, unknown>;\n}\n\nconst viewUrlPlaceholderPattern = /\\{(context|nodeParams)\\.([^{}]+)\\}/g;\n\nexport const resolveViewUrlPlaceholders = (\n viewUrl: string,\n sources: ViewUrlPlaceholderSources,\n): string | undefined => {\n let unresolved = false;\n const resolved = viewUrl.replace(\n viewUrlPlaceholderPattern,\n (placeholder, source: keyof ViewUrlPlaceholderSources, path: string) => {\n const key = path.trim();\n const values = sources[source];\n const value =\n values && Object.hasOwn(values, key)\n ? values[key]\n : key\n .split('.')\n .reduce<unknown>(\n (current, segment) =>\n typeof current === 'object' &&\n current !== null &&\n Object.hasOwn(current, segment)\n ? (current as Record<string, unknown>)[segment]\n : undefined,\n values,\n );\n if (\n (typeof value === 'string' && value.trim() !== '') ||\n typeof value === 'number' ||\n typeof value === 'boolean'\n ) {\n return String(value);\n }\n unresolved = true;\n return placeholder;\n },\n );\n return unresolved ? undefined : resolved;\n};\n","export function deletePropertyByPath<T extends Record<string, unknown>>(\n object: T,\n path: string,\n): T {\n const segments = path.split('.').filter(Boolean);\n if (segments.length === 0) {\n return object;\n }\n\n let current: Record<string, unknown> = object;\n\n for (let i = 0; i < segments.length - 1; i += 1) {\n const key = segments[i];\n const next = current[key];\n if (next == null || typeof next !== 'object') {\n return object;\n }\n current = next as Record<string, unknown>;\n }\n\n delete current[segments[segments.length - 1]];\n return object;\n}\n","export function setPropertyByPath<T extends Record<string, any>>(\n object: T,\n path: string,\n value: unknown,\n): T {\n const segments = path.split('.').filter(Boolean);\n if (segments.length === 0) {\n return object;\n }\n\n let current: Record<string, any> = object;\n\n for (let i = 0; i < segments.length; i += 1) {\n const key = segments[i];\n if (i === segments.length - 1) {\n current[key] = value;\n break;\n }\n\n const existing = current[key];\n\n if (\n existing === undefined ||\n existing === null ||\n typeof existing !== 'object'\n ) {\n current[key] = {};\n }\n\n current = current[key];\n }\n\n return object;\n}\n"],"mappings":";;AAAA,MAAM,eAAe;AAQrB,SAAgB,0BACd,eACA,QAAc;CAEd,IAAI,CAAC,eAAe,SAAS,YAAY,GACvC,MAAM,IAAI,MAAM,uCAAuC,eAAe;CAIxE,OAAO,GADQ,cAAc,MAAM,GAAG,EAC5B,IAAS,OAAM;AAC3B;AClBA,SAAgB,kBACd,OAKA,YAAoB,KAAG;CAEvB,OAAO;EAAC,MAAM;EAAU,MAAM;EAAS,MAAM;CAAM,CAAC,CACjD,QAAQ,MAAmB,CAAC,CAAC,CAAC,CAAC,CAC/B,KAAK,SAAS;AACnB;ACRA,SAAgB,iBACd,QAA0D;CAE1D,MAAM,SAAwC,CAAA;CAC9C,KAAK,MAAM,SAAS,UAAU,CAAA,GAAI;EAChC,IAAI,MAAM,oBAAoB,QAAQ;GACpC,OAAO,KAAK,GAAG,iBAAiB,MAAM,kBA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AAY;AAClC;AC3CA,SAAgB,qBACd,QACA,MAAY;CAEZ,MAAM,WAAW,KAAK,MAAM,GAAG,CAAC,CAAC,OAAO,OAAO;CAC/C,IAAI,SAAS,WAAW,GACtB,OAAO;CAGT,IAAI,UAAmC;CAEvC,KAAK,IAAI,IAAI,GAAG,IAAI,SAAS,SAAS,GAAG,KAAK,GAAG;EAC/C,MAAM,MAAM,SAAS;EACrB,MAAM,OAAO,QAAQ;EACrB,IAAI,QAAQ,QAAQ,OAAO,SAAS,UAClC,OAAO;EAET,UAAU;CACZ;CAEA,OAAO,QAAQ,SAAS,SAAS,SAAS;CAC1C,OAAO;AACT;ACtBA,SAAgB,kBACd,QACA,MACA,OAAc;CAEd,MAAM,WAAW,KAAK,MAAM,GAAG,CAAC,CAAC,OAAO,OAAO;CAC/C,IAAI,SAAS,WAAW,GACtB,OAAO;CAGT,IAAI,UAA+B;CAEnC,KAAK,IAAI,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK,GAAG;EAC3C,MAAM,MAAM,SAAS;EACrB,IAAI,MAAM,SAAS,SAAS,GAAG;GAC7B,QAAQ,OAAO;GACf;EACF;EAEA,MAAM,WAAW,QAAQ;EAEzB,IACE,aAAa,UACb,aAAa,QACb,OAAO,aAAa,UAEpB,QAAQ,OAAO,CAAA;EAGjB,UAAU,QAAQ;CACpB;CAEA,OAAO;AACT"}
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Public API Surface of lib
|
|
3
|
-
*/
|
|
4
1
|
const EMPTY_PACKAGE = true;
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Generated bundle index. Do not edit.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
2
|
export { EMPTY_PACKAGE };
|
|
11
|
-
|
|
3
|
+
|
|
4
|
+
//# sourceMappingURL=platform-mesh-portal-ui-lib.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-mesh-portal-ui-lib.mjs","sources":["../../projects/lib/public-api.ts"
|
|
1
|
+
{"version":3,"file":"platform-mesh-portal-ui-lib.mjs","names":[],"sources":["../../projects/lib/public-api.ts"],"sourcesContent":["/*\n * Public API Surface of lib\n */\nexport const EMPTY_PACKAGE = true;\n"],"mappings":"AAGA,MAAa,gBAAgB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platform-mesh/portal-ui-lib",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.74.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"url": "git+https://github.com/platform-mesh/portal-ui-lib.git"
|
|
6
6
|
},
|
|
@@ -8,12 +8,13 @@
|
|
|
8
8
|
"author": "Platform Mesh",
|
|
9
9
|
"license": "Apache-2.0",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"jsonpath-plus": "
|
|
12
|
-
"tslib": "2.
|
|
11
|
+
"jsonpath-plus": "11.3.0",
|
|
12
|
+
"tslib": "2.9.1"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@
|
|
16
|
-
"@openmfp/
|
|
15
|
+
"@luigi-project/core": "^2.33.0",
|
|
16
|
+
"@openmfp/portal-ui-lib": "^0.199.39",
|
|
17
|
+
"@openmfp/ngx": "^2.3.0"
|
|
17
18
|
},
|
|
18
19
|
"files": [
|
|
19
20
|
"assets/**",
|