@kubun/db-adapter 0.11.0 → 0.12.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/lib/postgres.js +2 -0
- package/lib/sqlite.js +2 -0
- package/package.json +9 -9
package/lib/postgres.js
CHANGED
|
@@ -72,6 +72,7 @@ export class AbstractPostgresAdapter {
|
|
|
72
72
|
OR ((data -> 'accessPermissions' -> 'read' ->> 'level') IS NULL AND EXISTS (
|
|
73
73
|
SELECT 1 FROM kubun_graph_user_model_access_defaults AS _mad
|
|
74
74
|
WHERE _mad.owner_did = owner AND _mad.model_id = ${modelID} AND _mad.permission_type = 'read'
|
|
75
|
+
AND (_mad.removed IS NULL OR _mad.removed = 0)
|
|
75
76
|
AND (
|
|
76
77
|
_mad.access_level = 'anyone'
|
|
77
78
|
OR (_mad.access_level = 'only_owner' AND owner = ${viewerDID})
|
|
@@ -81,6 +82,7 @@ export class AbstractPostgresAdapter {
|
|
|
81
82
|
OR ((data -> 'accessPermissions' -> 'read' ->> 'level') IS NULL AND NOT EXISTS (
|
|
82
83
|
SELECT 1 FROM kubun_graph_user_model_access_defaults AS _mad2
|
|
83
84
|
WHERE _mad2.owner_did = owner AND _mad2.model_id = ${modelID} AND _mad2.permission_type = 'read'
|
|
85
|
+
AND (_mad2.removed IS NULL OR _mad2.removed = 0)
|
|
84
86
|
) AND (${serverDefaultCond}))
|
|
85
87
|
)`;
|
|
86
88
|
}
|
package/lib/sqlite.js
CHANGED
|
@@ -76,6 +76,7 @@ export class AbstractSQLiteAdapter {
|
|
|
76
76
|
OR (json_extract(data, '$.accessPermissions.read.level') IS NULL AND EXISTS (
|
|
77
77
|
SELECT 1 FROM kubun_graph_user_model_access_defaults AS _mad
|
|
78
78
|
WHERE _mad.owner_did = owner AND _mad.model_id = ${modelID} AND _mad.permission_type = 'read'
|
|
79
|
+
AND (_mad.removed IS NULL OR _mad.removed = 0)
|
|
79
80
|
AND (
|
|
80
81
|
_mad.access_level = 'anyone'
|
|
81
82
|
OR (_mad.access_level = 'only_owner' AND owner = ${viewerDID})
|
|
@@ -85,6 +86,7 @@ export class AbstractSQLiteAdapter {
|
|
|
85
86
|
OR (json_extract(data, '$.accessPermissions.read.level') IS NULL AND NOT EXISTS (
|
|
86
87
|
SELECT 1 FROM kubun_graph_user_model_access_defaults AS _mad2
|
|
87
88
|
WHERE _mad2.owner_did = owner AND _mad2.model_id = ${modelID} AND _mad2.permission_type = 'read'
|
|
89
|
+
AND (_mad2.removed IS NULL OR _mad2.removed = 0)
|
|
88
90
|
) AND (${serverDefaultCond}))
|
|
89
91
|
)`;
|
|
90
92
|
}
|
package/package.json
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubun/db-adapter",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"license": "see LICENSE.md",
|
|
3
|
+
"version": "0.12.0",
|
|
5
4
|
"keywords": [],
|
|
5
|
+
"license": "see LICENSE.md",
|
|
6
|
+
"sideEffects": false,
|
|
6
7
|
"type": "module",
|
|
7
|
-
"main": "lib/index.js",
|
|
8
|
-
"types": "lib/index.d.ts",
|
|
9
8
|
"exports": {
|
|
10
9
|
".": "./lib/index.js"
|
|
11
10
|
},
|
|
11
|
+
"main": "lib/index.js",
|
|
12
|
+
"types": "lib/index.d.ts",
|
|
12
13
|
"files": [
|
|
13
14
|
"lib/*",
|
|
14
15
|
"LICENSE.md"
|
|
15
16
|
],
|
|
16
|
-
"sideEffects": false,
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"kysely": "^0.29.
|
|
18
|
+
"kysely": "^0.29.4"
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
|
+
"build": "pnpm run build:clean && pnpm run build:js && pnpm run build:types",
|
|
21
22
|
"build:clean": "del lib",
|
|
22
23
|
"build:js": "swc src -d ./lib --config-file ../../node_modules/@kigu/dev/swc.json --strip-leading-paths",
|
|
23
24
|
"build:types": "tsc --emitDeclarationOnly --skipLibCheck",
|
|
24
25
|
"build:types:ci": "tsc --emitDeclarationOnly --declarationMap false",
|
|
25
|
-
"
|
|
26
|
+
"test": "pnpm run test:types && pnpm run test:unit",
|
|
26
27
|
"test:types": "tsc --noEmit",
|
|
27
|
-
"test:unit": "vitest run"
|
|
28
|
-
"test": "pnpm run test:types && pnpm run test:unit"
|
|
28
|
+
"test:unit": "vitest run"
|
|
29
29
|
}
|
|
30
30
|
}
|