@jskit-ai/crud-core 0.1.45 → 0.1.47
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/package.descriptor.mjs +2 -2
- package/package.json +7 -7
- package/src/server/crudModuleConfig.js +14 -13
package/package.descriptor.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default Object.freeze({
|
|
2
2
|
packageVersion: 1,
|
|
3
3
|
packageId: "@jskit-ai/crud-core",
|
|
4
|
-
version: "0.1.
|
|
4
|
+
version: "0.1.47",
|
|
5
5
|
kind: "runtime",
|
|
6
6
|
description: "Shared CRUD helpers used by CRUD modules.",
|
|
7
7
|
dependsOn: [
|
|
@@ -26,7 +26,7 @@ export default Object.freeze({
|
|
|
26
26
|
mutations: {
|
|
27
27
|
dependencies: {
|
|
28
28
|
runtime: {
|
|
29
|
-
"@jskit-ai/crud-core": "0.1.
|
|
29
|
+
"@jskit-ai/crud-core": "0.1.47"
|
|
30
30
|
},
|
|
31
31
|
dev: {}
|
|
32
32
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jskit-ai/crud-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.47",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "node --test"
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@tanstack/vue-query": "^5.90.5",
|
|
29
|
-
"@jskit-ai/database-runtime": "0.1.
|
|
30
|
-
"@jskit-ai/kernel": "0.1.
|
|
31
|
-
"@jskit-ai/realtime": "0.1.
|
|
32
|
-
"@jskit-ai/shell-web": "0.1.
|
|
33
|
-
"@jskit-ai/users-core": "0.1.
|
|
34
|
-
"@jskit-ai/users-web": "0.1.
|
|
29
|
+
"@jskit-ai/database-runtime": "0.1.39",
|
|
30
|
+
"@jskit-ai/kernel": "0.1.39",
|
|
31
|
+
"@jskit-ai/realtime": "0.1.38",
|
|
32
|
+
"@jskit-ai/shell-web": "0.1.38",
|
|
33
|
+
"@jskit-ai/users-core": "0.1.49",
|
|
34
|
+
"@jskit-ai/users-web": "0.1.54",
|
|
35
35
|
"typebox": "^1.0.81"
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -5,18 +5,18 @@ import {
|
|
|
5
5
|
requireCrudNamespace
|
|
6
6
|
} from "../shared/crudNamespaceSupport.js";
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
} from "@jskit-ai/
|
|
8
|
+
resolveScopedApiBasePath
|
|
9
|
+
} from "@jskit-ai/kernel/shared/surface";
|
|
10
10
|
import {
|
|
11
|
-
|
|
11
|
+
ROUTE_VISIBILITY_TOKENS,
|
|
12
12
|
checkRouteVisibility,
|
|
13
|
-
|
|
14
|
-
} from "@jskit-ai/
|
|
13
|
+
isWorkspaceRouteVisibility
|
|
14
|
+
} from "@jskit-ai/kernel/shared/support/visibility";
|
|
15
15
|
|
|
16
16
|
const DEFAULT_OWNERSHIP_FILTER = "workspace";
|
|
17
17
|
const CRUD_REQUESTED_OWNERSHIP_FILTER_AUTO = "auto";
|
|
18
18
|
const CRUD_REQUESTED_OWNERSHIP_FILTER_SET = new Set([
|
|
19
|
-
...
|
|
19
|
+
...ROUTE_VISIBILITY_TOKENS,
|
|
20
20
|
CRUD_REQUESTED_OWNERSHIP_FILTER_AUTO
|
|
21
21
|
]);
|
|
22
22
|
const CRUD_MODULE_ID = "crud";
|
|
@@ -76,9 +76,10 @@ function normalizeCrudRelativePath(relativePath = "", { context = "resolveCrudSu
|
|
|
76
76
|
|
|
77
77
|
function resolveCrudApiBasePath({ namespace = "", surfaceRequiresWorkspace = false } = {}) {
|
|
78
78
|
const relativePath = resolveCrudRelativePath(namespace);
|
|
79
|
-
return
|
|
80
|
-
|
|
81
|
-
relativePath
|
|
79
|
+
return resolveScopedApiBasePath({
|
|
80
|
+
routeBase: surfaceRequiresWorkspace === true ? "/w/:workspaceSlug" : "/",
|
|
81
|
+
relativePath,
|
|
82
|
+
strictParams: false
|
|
82
83
|
});
|
|
83
84
|
}
|
|
84
85
|
|
|
@@ -125,7 +126,7 @@ function resolveCrudConfig(source = {}) {
|
|
|
125
126
|
return Object.freeze({
|
|
126
127
|
namespace,
|
|
127
128
|
ownershipFilter,
|
|
128
|
-
workspaceScoped:
|
|
129
|
+
workspaceScoped: isWorkspaceRouteVisibility(ownershipFilter),
|
|
129
130
|
namespacePath: resolveCrudNamespacePath(namespace),
|
|
130
131
|
relativePath: resolveCrudRelativePath(namespace),
|
|
131
132
|
apiBasePath: resolveCrudApiBasePath({ namespace }),
|
|
@@ -204,7 +205,7 @@ function resolveCrudSurfacePolicy(
|
|
|
204
205
|
context: `${context} ownershipFilter`
|
|
205
206
|
});
|
|
206
207
|
|
|
207
|
-
if (
|
|
208
|
+
if (isWorkspaceRouteVisibility(ownershipFilter) && surfaceDefinition.requiresWorkspace !== true) {
|
|
208
209
|
throw new Error(
|
|
209
210
|
`${context} ownershipFilter "${ownershipFilter}" requires a workspace-enabled surface.`
|
|
210
211
|
);
|
|
@@ -218,7 +219,7 @@ function resolveCrudSurfacePolicy(
|
|
|
218
219
|
surfaceId,
|
|
219
220
|
ownershipFilter,
|
|
220
221
|
requestedOwnershipFilter,
|
|
221
|
-
workspaceScoped:
|
|
222
|
+
workspaceScoped: isWorkspaceRouteVisibility(ownershipFilter),
|
|
222
223
|
relativePath,
|
|
223
224
|
surfaceDefinition
|
|
224
225
|
});
|
|
@@ -284,7 +285,7 @@ export {
|
|
|
284
285
|
normalizeCrudNamespace,
|
|
285
286
|
normalizeCrudOwnershipFilter,
|
|
286
287
|
normalizeCrudRequestedOwnershipFilter,
|
|
287
|
-
|
|
288
|
+
isWorkspaceRouteVisibility,
|
|
288
289
|
requireCrudNamespace,
|
|
289
290
|
resolveCrudNamespacePath,
|
|
290
291
|
resolveCrudRelativePath,
|