@svadmin/surface 0.10.0 → 0.11.1
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/compatibility.json +1 -1
- package/dist/openui.js +17 -1
- package/package.json +3 -3
package/compatibility.json
CHANGED
package/dist/openui.js
CHANGED
|
@@ -43,6 +43,21 @@ function element(value) {
|
|
|
43
43
|
&& typeof value.typeName === 'string'
|
|
44
44
|
&& !!value.props && typeof value.props === 'object';
|
|
45
45
|
}
|
|
46
|
+
function surfaceDataSource(value) {
|
|
47
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
48
|
+
return false;
|
|
49
|
+
const source = value;
|
|
50
|
+
if (typeof source['id'] !== 'string' || typeof source['resource'] !== 'string')
|
|
51
|
+
return false;
|
|
52
|
+
if (source['type'] === 'resource-one') {
|
|
53
|
+
return typeof source['recordId'] === 'string' || typeof source['recordId'] === 'number';
|
|
54
|
+
}
|
|
55
|
+
if (source['type'] !== 'resource-list')
|
|
56
|
+
return false;
|
|
57
|
+
if (source['pageSize'] !== undefined && typeof source['pageSize'] !== 'number')
|
|
58
|
+
return false;
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
46
61
|
export function createSurfaceOpenUIStream(options) {
|
|
47
62
|
const { catalog, policy } = options;
|
|
48
63
|
const schema = createSurfaceOpenUISchema(catalog);
|
|
@@ -77,7 +92,8 @@ export function createSurfaceOpenUIStream(options) {
|
|
|
77
92
|
for (const source of sources) {
|
|
78
93
|
if (source === null && !final)
|
|
79
94
|
continue;
|
|
80
|
-
if (!element(source) || source.typeName !== 'Source' || source.partial
|
|
95
|
+
if (!element(source) || source.typeName !== 'Source' || source.partial
|
|
96
|
+
|| !isJsonValue(source.props['value']) || !surfaceDataSource(source.props['value'])) {
|
|
81
97
|
throw new SurfaceOpenUIError('syntax', 'Invalid Source node');
|
|
82
98
|
}
|
|
83
99
|
dataSources.push(source.props['value']);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@svadmin/surface",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"description": "Validated declarative surfaces for svadmin dashboards",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
}
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
|
-
"@svadmin/core": ">=0.53.0 <0.
|
|
78
|
-
"@svadmin/ui": ">=0.73.0 <0.
|
|
77
|
+
"@svadmin/core": ">=0.53.0 <0.57.0",
|
|
78
|
+
"@svadmin/ui": ">=0.73.0 <0.77.0",
|
|
79
79
|
"svelte": "^5.56.10"
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|