@everystack/server 0.4.40 → 0.4.42
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 +12 -0
- package/package.json +4 -4
- package/src/destroy.ts +4 -2
- package/src/plugin.ts +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,18 @@ All notable changes to `@everystack/server` are documented here.
|
|
|
4
4
|
|
|
5
5
|
Format based on [Keep a Changelog](https://keepachangelog.com/).
|
|
6
6
|
|
|
7
|
+
## [0.4.42] - 2026-10-31
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- a granted definer role is not a request role in the lifecycle check
|
|
12
|
+
|
|
13
|
+
## [0.4.41] - 2026-10-31
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- destroyExpired links a module's raw models itself
|
|
18
|
+
|
|
7
19
|
## [0.4.40] - 2026-10-30
|
|
8
20
|
|
|
9
21
|
### BREAKING CHANGES
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everystack/server",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.42",
|
|
4
4
|
"description": "Server runtime primitives for Lambda — event adapters, routing, SSR, image processing",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"author": "Scalable Technology, Inc. <licensing@scalable.technology>",
|
|
@@ -207,11 +207,11 @@
|
|
|
207
207
|
"sst": "4.13.1",
|
|
208
208
|
"ts-jest": "29.4.9",
|
|
209
209
|
"typescript": "5.9.3",
|
|
210
|
-
"@everystack/
|
|
211
|
-
"@everystack/
|
|
210
|
+
"@everystack/cli": "0.4.106",
|
|
211
|
+
"@everystack/auth": "0.4.10"
|
|
212
212
|
},
|
|
213
213
|
"dependencies": {
|
|
214
|
-
"@everystack/model": "0.4.
|
|
214
|
+
"@everystack/model": "0.4.26"
|
|
215
215
|
},
|
|
216
216
|
"scripts": {
|
|
217
217
|
"test": "jest",
|
package/src/destroy.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Generated SQL owns removal; this module brackets it with root hooks. */
|
|
2
2
|
import { sql, type SQL } from 'drizzle-orm';
|
|
3
|
-
import { isVeto, lifecycleDestroyOrder, pgType, type DestroyContext, type ModelDescriptor } from '@everystack/model';
|
|
3
|
+
import { isVeto, lifecycleDestroyOrder, linkModels, pgType, type DestroyContext, type ModelDescriptor } from '@everystack/model';
|
|
4
4
|
import type { SessionCapableDb, SessionTx } from './db-session';
|
|
5
5
|
|
|
6
6
|
type Row = Record<string, unknown>;
|
|
@@ -127,6 +127,7 @@ const context = (row: Row): DestroyContext => Object.freeze({
|
|
|
127
127
|
* commit fails. afterDestroy runs after commit, best-effort: a crash can lose it.
|
|
128
128
|
* `role`: every transaction opens with SET LOCAL ROLE, so a least-privilege login (NOINHERIT,
|
|
129
129
|
* granted the app roles) runs it as a role that manages the tables. Never everystack_lifecycle.
|
|
130
|
+
* `models` may be a module's raw array: it is linked here (linkModels) before the destroy order is read.
|
|
130
131
|
*/
|
|
131
132
|
export async function destroyExpired(
|
|
132
133
|
db: SessionCapableDb,
|
|
@@ -149,7 +150,8 @@ export async function destroyExpired(
|
|
|
149
150
|
for (const [name, value] of [['batch', batch], ['statementTimeoutMs', timeout]] as const) {
|
|
150
151
|
if (!Number.isInteger(value) || value <= 0 || value > 2147483647) throw new Error(`${name} must be a positive PostgreSQL integer`);
|
|
151
152
|
}
|
|
152
|
-
|
|
153
|
+
// A module's raw models still hold name references; linking an already linked set is a no-op.
|
|
154
|
+
const order = lifecycleDestroyOrder(linkModels(models));
|
|
153
155
|
const byName = new Map(models.map(m => [m.schema === 'public' ? m.table : label(m), m]));
|
|
154
156
|
const result: DestroyResult = { perTable: {}, order };
|
|
155
157
|
const report = async (fault: DestroyFault): Promise<void> => {
|
package/src/plugin.ts
CHANGED
|
@@ -1482,6 +1482,9 @@ export function dbPlugin(options: DbPluginOptions): Plugin {
|
|
|
1482
1482
|
// The lifecycle catalog check's roles, as sent. executeReconcile refuses lifecycle-owned
|
|
1483
1483
|
// objects when they are absent or malformed (an older CLI): fail closed, never skipped.
|
|
1484
1484
|
applicationRoles: p.applicationRoles,
|
|
1485
|
+
// The role declaration, optional: absent (an older CLI), the check runs as before.
|
|
1486
|
+
requestRoles: p.requestRoles,
|
|
1487
|
+
declaredOwners: p.declaredOwners,
|
|
1485
1488
|
actor: p.actor ?? null,
|
|
1486
1489
|
gitRef: p.gitRef ?? null,
|
|
1487
1490
|
});
|