@jskit-ai/resource-runtime 0.2.19 → 0.2.20
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 +1 -0
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
- Depends on json-rest-api 3.1.3 exactly (from 3.1.2), from the registry with its published integrity: a write checks each linked target type with one read of the targets' ids (their minimal records only for a target resource with a `checkPermissions` hook), which also takes the shared lock on the belongs-to and polymorphic targets it stores, before `beforeSchemaValidate` rather than after the `beforeDataCall` hooks; in a system context a belongs-to its declared foreign key protects is left to that key, so a missing target there fails with the database's foreign key error instead of `not_found`. json-rest-api now asks for json-rest-schema ^1.0.20.
|
|
5
6
|
- Depends on json-rest-api 3.1.2 exactly (from 3.1.1), from the registry with its published integrity: json-rest-api bounds a blob field itself too (`maxBytes` required, a blob answered only where `fields` names it, at most 16 MiB of named blobs per read, none in an include, `queryAll` or HTTP response, many-row write statements chunked by blob bytes, and the MySQL/MariaDB column type chosen by `maxBytes`), its `contains`, `startsWith` and `endsWith` filters match `%`, `_` and `\` literally on every database, a relationship write checks and locks each related type's targets in one query, and an AnyAPI many-to-many read costs its own link rows instead of growing with the square of them.
|
|
6
7
|
- A search filter of an `owns` entry may read other owners' tables through their join sources: `joinSources: { alias: ({ requires, owned }) => owner }` names, by alias, the owner answering each (an owner API the feature requires, or one of its own handles), and its `applyFilter(query, value, { column, joinSource })` gets `joinSource(alias)`, that owner's `{ query, column }` for the caller's scope (its ownership, its row policy, never a hidden column), for a `whereExists` or `whereNotExists` tied to the row with `whereColumn`. A handle builds the join sources a read's filters use before the read, in the call's own context and transaction, so a handle's `query`, `queryAll`, `queryPages`, `aggregate` and `joinSource` take such a filter in one statement, on SQLite, PostgreSQL and MariaDB. A search for the rows that have, or lack, a related owner's rows no longer resolves that owner's ids first or keeps a raw-SQL exception. `own()` refuses at startup a `joinSources` that is not a record of functions under valid aliases, and such a filter with `oneOf` or without `applyFilter`; a read throws naming the filter when its picker answers no owner with `joinSource`. On MySQL and MariaDB `patchWhere`, `deleteWhere`, `lockWhere` and `claim` refuse such a filter as json-rest-api refuses a filter on another table's field (`RestApiValidationError`, rule `selection_cross_table`, the cause of a write's `RestApiWriteError`), since those databases read another table from the transaction's snapshot without locking it, as json-rest-api refuses a filter on another table's field; PostgreSQL and SQLite take it. The data-access guide's Layer 5 shows the filter and how an app switches a report or a pre-resolved id list to it.
|
|
7
8
|
- `lock`, `lockMany`, `lockWhere` and `claim` take `include` again, for belongs-to relationships: after the lock's own rows, the records they name are locked through each related table's own handle (its scope, its row policy, its hidden fields), in id order, with the call's lock mode, each included table once however many rows name it, and nested as a read's include nests them, `include: "batch.yard"` locking the yards after the batches. On MySQL and MariaDB the links are read with a locking read of the rows the lock holds, so a record committed after the transaction's first plain read is found and locked, which a plain read after the lock misses (`lockedReads.mysql.test.js`). A link to a record the caller may not see reads as in a read: its belongs-to field null, the relationship undefined. A collection, or a name that is no belongs-to relationship, is still a TypeError before any statement, now saying to lock a collection's rows with that table's own `lockWhere()`; `claim` refuses `include` named both in its params and its options. Upgrading: none; a read after the lock that only fetched the locked rows' parents may become the lock's `include`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jskit-ai/resource-runtime",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.20",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=24.0.0"
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"./locales/en.json": "./locales/en.json"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@jskit-ai/resource-core": "0.1.
|
|
19
|
-
"@jskit-ai/resource-crud-core": "0.1.
|
|
20
|
-
"json-rest-api": "3.1.
|
|
18
|
+
"@jskit-ai/resource-core": "0.1.209",
|
|
19
|
+
"@jskit-ai/resource-crud-core": "0.1.209",
|
|
20
|
+
"json-rest-api": "3.1.3"
|
|
21
21
|
},
|
|
22
22
|
"description": "The resource runtime: features own their tables through it and read and write them with scoped handles on json-rest-api.",
|
|
23
23
|
"jskit": {
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
|
-
"@jskit-ai/database-runtime": "0.1.
|
|
68
|
-
"@jskit-ai/kernel": "0.2.
|
|
67
|
+
"@jskit-ai/database-runtime": "0.1.267",
|
|
68
|
+
"@jskit-ai/kernel": "0.2.18"
|
|
69
69
|
}
|
|
70
70
|
}
|