@protobase/server 0.55.5 → 0.55.7
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/package.js +1 -1
- package/dist/parent-reads.js +6 -3
- package/dist/view-access.js +1 -0
- package/package.json +4 -4
package/dist/package.js
CHANGED
package/dist/parent-reads.js
CHANGED
|
@@ -4,11 +4,14 @@
|
|
|
4
4
|
* scope on the parent's resource: tenant, read row filter, soft delete and its own parents. A caller who cannot read the
|
|
5
5
|
* parent resource, or whose read rule there needs the record, which no query can express, reads no parent. `chain` holds
|
|
6
6
|
* the resources whose parents led here: one already on it is not followed further, so a resource that is its own parent,
|
|
7
|
-
* such as a tree, is checked one level up.
|
|
7
|
+
* such as a tree, is checked one level up. Reached as its own parent, the last on `chain`, it still follows its other
|
|
8
|
+
* parents, so a reply read through its thread keeps to the thread's channel too.
|
|
8
9
|
*/
|
|
9
10
|
const parentReads = async (entry, session, chain, accessOf, find) => {
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
const ownParent = chain.at(-1) === entry.name;
|
|
12
|
+
if (!ownParent && chain.includes(entry.name)) return [];
|
|
13
|
+
const isSelf = (field) => entry.model.fields[field].relation.resource === entry.name;
|
|
14
|
+
const reads = (entry.model.parents ?? []).filter((parent) => parent.access === "read" && !(ownParent && isSelf(parent.field)));
|
|
12
15
|
return Promise.all(reads.map(async ({ field }) => {
|
|
13
16
|
const relation = entry.model.fields[field];
|
|
14
17
|
const parentEntry = find(relation.relation.resource);
|
package/dist/view-access.js
CHANGED
|
@@ -346,6 +346,7 @@ const viewShape = (resource, model, models, prompted, createPages, writeOnly) =>
|
|
|
346
346
|
import: shapes.data,
|
|
347
347
|
export: shapes.data,
|
|
348
348
|
create: shapes.data,
|
|
349
|
+
record: shapes.data,
|
|
349
350
|
forms: shapes.map(() => void 0),
|
|
350
351
|
lists: shapes.list(shapes.object({
|
|
351
352
|
name: shapes.data,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/server",
|
|
3
|
-
"version": "0.55.
|
|
3
|
+
"version": "0.55.7",
|
|
4
4
|
"description": "The Protobase REST API as a Hono app, with Better Auth sign-in.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"@better-auth/passkey": "^1.7.12",
|
|
41
41
|
"@better-auth/sso": "^1.7.12",
|
|
42
42
|
"@modelcontextprotocol/server": "^2.3.1",
|
|
43
|
-
"@protobase/layout": "0.55.
|
|
44
|
-
"@protobase/query": "0.55.
|
|
45
|
-
"@protobase/schema": "0.55.
|
|
43
|
+
"@protobase/layout": "0.55.7",
|
|
44
|
+
"@protobase/query": "0.55.7",
|
|
45
|
+
"@protobase/schema": "0.55.7",
|
|
46
46
|
"@react-email/render": "^2.1.0",
|
|
47
47
|
"@scalar/hono-api-reference": "^0.12.10",
|
|
48
48
|
"@sentry/core": "^11.7.0",
|