ramdb2-core 2.0.0-alpha.2 → 2.0.0-alpha.4
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/CHANGELOG.md +10 -0
- package/package.json +2 -2
- package/src/DbObject.js +13 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# ramdb2-core
|
|
2
2
|
|
|
3
|
+
## 2.0.0-alpha.4
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 919e6ae: Permissions by field (D58): `@restricted` in the schema, `permissions.<Type>.fields` in ramdb2-server. A refused field gives `null`; a query on a restricted field only covers the objects whose field the user may read.
|
|
8
|
+
|
|
9
|
+
## 2.0.0-alpha.3
|
|
10
|
+
|
|
11
|
+
No changes in this release.
|
|
12
|
+
|
|
3
13
|
## 2.0.0-alpha.2
|
|
4
14
|
|
|
5
15
|
No changes in this release.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ramdb2-core",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.4",
|
|
4
4
|
"description": "In-memory database working directly on hydrated objects, persisted in SQLite",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./src/index.js",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
],
|
|
19
19
|
"scripts": {
|
|
20
20
|
"test": "node --test \"test/**/*.test.js\"",
|
|
21
|
-
"bench": "node bench/commit.bench.js && node bench/index.bench.js && node bench/integrity.bench.js && node bench/computed.bench.js && node bench/query.bench.js && node bench/logs.bench.js",
|
|
21
|
+
"bench": "node bench/commit.bench.js && node bench/index.bench.js && node bench/integrity.bench.js && node bench/computed.bench.js && node bench/query.bench.js && node bench/logs.bench.js && node bench/see.bench.js",
|
|
22
22
|
"bench:filter-libs": "node bench/filter-libs.bench.js"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
package/src/DbObject.js
CHANGED
|
@@ -58,6 +58,19 @@ export default class DbObject {
|
|
|
58
58
|
*/
|
|
59
59
|
static privateFields = []
|
|
60
60
|
|
|
61
|
+
/**
|
|
62
|
+
* Fields read through the GraphQL API only when the permission of the server allows it, for each object
|
|
63
|
+
* (@restricted, D58): stored fields, relations with their foreign key, computed and @transient fields.
|
|
64
|
+
* @type {string[]}
|
|
65
|
+
*/
|
|
66
|
+
static restrictedFields = []
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The list relations: the table of their objects and the foreign key that points to this object.
|
|
70
|
+
* @type {Record<string, {table: string, key: string}>}
|
|
71
|
+
*/
|
|
72
|
+
static listRelations = {}
|
|
73
|
+
|
|
61
74
|
constructor() {
|
|
62
75
|
/** @type {{id: number} & Record<string, any>} persistent values, set by the generated constructor */
|
|
63
76
|
this._f = undefined
|