@jskit-ai/resource-runtime 0.2.27 → 0.2.28
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 +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
- Depends on json-rest-api 3.1.7 exactly (from 3.1.6): a handle's `aggregate` reads only the rows it groups. When its filters and row policy join no other table, json-rest-api groups the filtered query as it reads, so the database reads the rows the filters select through their index, however many other rows the table holds; it no longer groups the table's rows whose ids the filtered query selects (`where id in (select id … where <filters>)`), a read MySQL and MariaDB could make over the whole table, and PostgreSQL too on a partitioned table. A filter or row policy that joins another table keeps the id selection, so no row counts twice. Results are unchanged.
|
|
5
6
|
- Depends on json-rest-api 3.1.6 exactly (from 3.1.5): within one transaction (a handle's `withTransaction`, or a write's own), json-rest-api answers a check of a row a write links to, or of a to-one link a response shows, from the transaction's own earlier check of that row in the same scope (the same ownership, row policy and filter values) under a lock at least as strong, until the transaction sends a statement that could change the answer: an insert or update of a table the check reads, an update of a column a remembered check names (such as `workspace_id`), a delete, a savepoint's rollback, or any other statement. A check that found no row is never remembered, and nothing carries from one transaction to the next. Installing one module (a form and a module, each published from a draft version, every row naming its author and publisher) in one transaction sent 55 statements and now sends 30; 32 modules in one transaction sent 1,698 and now send 836: its checks went from 1,024 to 162, the two users every row names checked twice instead of 480 times, and each module's own new rows 5 times instead of 17 (again only after a write to their table), on MariaDB 11.4 and PostgreSQL alike. `transactionChecks.test.js` (SQLite, and PostgreSQL in CI) and `transactionChecks.mysql.test.js` compare 1 and 32 modules, and show a transaction refusing a row it removed, moved out of the caller's scope or hid, another workspace's or user's row in the same transaction, a row an earlier transaction checked, and every link refused before.
|
|
6
7
|
- Depends on json-rest-api 3.1.5 exactly (from 3.1.4), from the registry with its published integrity: a read-only builder (a `scopedQuery()`, a join source, a row policy's `ownTable()`) that json-rest-api's own query compiles as a subquery keeps its joins, where 3.1.4 dropped them and the subquery matched more rows than it should (a row policy or filter narrowing with `whereExists` over a joined subquery widened), and `lockByIds`/`lockWhere` take `lockMode: 'share'`.
|
|
7
8
|
- **Security.** A row policy's calls that are not where calls (`join`, `leftJoin`, `select` and the rest) now throw a TypeError naming the feature, the policy and the table, as the policy makes them. Its calls replay inside one `where` group, where Knex compiles predicates only and dropped a join without a word, so a policy that narrowed through a join narrowed nothing and its readers saw rows it meant to hide. A policy narrows through another table with `whereExists` over `ownTable(name)` (which may join the owner's tables) or over another owner's `joinSource({ alias }, options)`. Upgrading: a policy that called `join` now fails every read of its table; rewrite it as a `whereExists`.
|
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.28",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=24.0.0"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@jskit-ai/resource-core": "0.1.212",
|
|
19
19
|
"@jskit-ai/resource-crud-core": "0.1.214",
|
|
20
|
-
"json-rest-api": "3.1.
|
|
20
|
+
"json-rest-api": "3.1.7"
|
|
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": {
|