@veloxts/orm 0.8.2 → 0.9.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/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # @veloxts/orm
2
2
 
3
+ ## 0.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - feat(router): add raw() response primitive for redirects, cookies, custom headers and .check() post-middleware authorization primitive
8
+
9
+ ### Patch Changes
10
+
11
+ - ca6ede3: Plugin contract fixes — eliminates three workaround `addHook` blocks freehand projects need to write today.
12
+ - **`@veloxts/orm`**: `ctx.db` is now writable so middleware (e.g. transactional handlers) can swap in a tx client via `Object.assign(ctx, { db: tx })` without redefining the property.
13
+ - **`@veloxts/core`**: registers an empty-JSON-body fallback parser at app construction. POSTs with `Content-Type: application/json` and empty body now reach handlers as `input = {}` instead of being rejected with 400 by Fastify's default parser.
14
+ - **`@veloxts/events`, `@veloxts/cache`, `@veloxts/mail`, `@veloxts/queue`, `@veloxts/storage`**: each plugin now mirrors its `request.<name>` decoration onto the procedure context (`request.context.<name>`), matching the existing auth-plugin pattern. `ctx.events`, `ctx.cache`, `ctx.mail`, `ctx.queue`, `ctx.storage` are now populated automatically — no manual bridging hook required.
15
+
16
+ **Behavior changes to be aware of on upgrade:**
17
+ - `@veloxts/core` now registers an `application/json` content-type parser by default. If you previously called `app.server.addContentTypeParser('application/json', ...)` in user code, you will now hit `FST_ERR_CTP_ALREADY_PRESENT`. Call `app.server.removeContentTypeParser('application/json')` first, then register your own parser.
18
+ - `ctx.db` was previously frozen via `Object.defineProperty({ writable: false })`. Library authors who relied on the strict-mode TypeError on reassignment should switch to defensive copying (`{ ...ctx }`) instead. End-user procedures and middleware are unaffected.
19
+
20
+ - Updated dependencies
21
+ - Updated dependencies [ca6ede3]
22
+ - @veloxts/core@0.9.0
23
+
24
+ ## 0.8.3
25
+
26
+ ### Patch Changes
27
+
28
+ - bump dependencies across packages (April 2026)
29
+ - Updated dependencies
30
+ - @veloxts/core@0.8.3
31
+
3
32
  ## 0.8.2
4
33
 
5
34
  ### Patch Changes
package/dist/plugin.js CHANGED
@@ -143,13 +143,13 @@ export function databasePlugin(config) {
143
143
  // The context should be created by @veloxts/core's onRequest hook
144
144
  // which runs before this hook (due to plugin registration order)
145
145
  if (request.context) {
146
- // Extend the context with the database client using Object.defineProperty
147
- // for proper property definition without type assertion side effects
146
+ // Writable so middleware (e.g. transactional handlers) and tests
147
+ // can swap in a tx client via Object.assign on ctx.
148
148
  Object.defineProperty(request.context, 'db', {
149
149
  value: config.client,
150
- writable: false,
150
+ writable: true,
151
151
  enumerable: true,
152
- configurable: true, // Allow redefinition for testing
152
+ configurable: true,
153
153
  });
154
154
  }
155
155
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veloxts/orm",
3
- "version": "0.8.2",
3
+ "version": "0.9.0",
4
4
  "description": "Prisma wrapper with enhanced DX for VeloxTS framework",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -16,17 +16,17 @@
16
16
  }
17
17
  },
18
18
  "dependencies": {
19
- "fastify": "5.8.2",
19
+ "fastify": "5.8.5",
20
20
  "pg": "8.20.0",
21
21
  "pg-format": "1.0.4",
22
- "@veloxts/core": "0.8.2"
22
+ "@veloxts/core": "0.9.0"
23
23
  },
24
24
  "devDependencies": {
25
- "@types/pg": "8.18.0",
25
+ "@types/pg": "8.20.0",
26
26
  "@types/pg-format": "1.0.5",
27
- "@vitest/coverage-v8": "4.1.0",
27
+ "@vitest/coverage-v8": "4.1.5",
28
28
  "typescript": "5.9.3",
29
- "vitest": "4.1.0"
29
+ "vitest": "4.1.5"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "@prisma/client": ">=7.0.0"