uql-orm 0.9.4 → 0.10.1
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 +43 -0
- package/README.md +63 -683
- package/dist/browser/http/http.d.ts +16 -1
- package/dist/browser/http/http.d.ts.map +1 -1
- package/dist/browser/http/http.js +31 -6
- package/dist/browser/http/http.js.map +1 -1
- package/dist/browser/querier/httpQuerier.d.ts +24 -6
- package/dist/browser/querier/httpQuerier.d.ts.map +1 -1
- package/dist/browser/querier/httpQuerier.js +42 -27
- package/dist/browser/querier/httpQuerier.js.map +1 -1
- package/dist/browser/querier/index.d.ts +0 -1
- package/dist/browser/querier/index.d.ts.map +1 -1
- package/dist/browser/querier/index.js +0 -1
- package/dist/browser/querier/index.js.map +1 -1
- package/dist/browser/type/clientQuerier.d.ts +5 -1
- package/dist/browser/type/clientQuerier.d.ts.map +1 -1
- package/dist/browser/type/request.d.ts +9 -10
- package/dist/browser/type/request.d.ts.map +1 -1
- package/dist/browser/uql-browser.min.js +2 -5649
- package/dist/browser/uql-browser.min.js.map +17 -1
- package/dist/dialect/abstractSqlDialect.js.map +1 -1
- package/dist/express/index.d.ts +0 -1
- package/dist/express/index.d.ts.map +1 -1
- package/dist/express/index.js +0 -1
- package/dist/express/index.js.map +1 -1
- package/dist/express/querierMiddleware.d.ts +8 -22
- package/dist/express/querierMiddleware.d.ts.map +1 -1
- package/dist/express/querierMiddleware.js +26 -129
- package/dist/express/querierMiddleware.js.map +1 -1
- package/dist/http/contract.d.ts +99 -0
- package/dist/http/contract.d.ts.map +1 -0
- package/dist/http/contract.js +72 -0
- package/dist/http/contract.js.map +1 -0
- package/dist/http/fetchHandler.d.ts +14 -0
- package/dist/http/fetchHandler.d.ts.map +1 -0
- package/dist/http/fetchHandler.js +63 -0
- package/dist/http/fetchHandler.js.map +1 -0
- package/dist/http/handler.d.ts +77 -0
- package/dist/http/handler.d.ts.map +1 -0
- package/dist/http/handler.js +172 -0
- package/dist/http/handler.js.map +1 -0
- package/dist/http/index.d.ts +5 -0
- package/dist/http/index.d.ts.map +1 -0
- package/dist/http/index.js +5 -0
- package/dist/http/index.js.map +1 -0
- package/dist/http/query.d.ts +12 -0
- package/dist/http/query.d.ts.map +1 -0
- package/dist/http/query.js +49 -0
- package/dist/http/query.js.map +1 -0
- package/dist/mongo/mongoDialect.js.map +1 -1
- package/dist/nestjs/index.d.ts +2 -0
- package/dist/nestjs/index.d.ts.map +1 -0
- package/dist/nestjs/index.js +2 -0
- package/dist/nestjs/index.js.map +1 -0
- package/dist/nestjs/uqlModule.d.ts +29 -0
- package/dist/nestjs/uqlModule.d.ts.map +1 -0
- package/dist/nestjs/uqlModule.js +42 -0
- package/dist/nestjs/uqlModule.js.map +1 -0
- package/dist/schema/schemaASTBuilder.d.ts.map +1 -1
- package/dist/schema/schemaASTBuilder.js.map +1 -1
- package/dist/type/querierPool.d.ts +3 -3
- package/dist/type/querierPool.d.ts.map +1 -1
- package/dist/util/dialect.util.js +2 -2
- package/dist/util/dialect.util.js.map +1 -1
- package/package.json +16 -9
- package/dist/browser/cc-BVTDOeZ_.js +0 -566
- package/dist/browser/cc-BVTDOeZ_.js.map +0 -1
- package/dist/browser/mongoSchemaGenerator-BT2_u1wI.js +0 -735
- package/dist/browser/mongoSchemaGenerator-BT2_u1wI.js.map +0 -1
- package/dist/browser/querier/querier.util.d.ts +0 -3
- package/dist/browser/querier/querier.util.d.ts.map +0 -1
- package/dist/browser/querier/querier.util.js +0 -17
- package/dist/browser/querier/querier.util.js.map +0 -1
- package/dist/express/query.util.d.ts +0 -7
- package/dist/express/query.util.d.ts.map +0 -1
- package/dist/express/query.util.js +0 -27
- package/dist/express/query.util.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,49 @@ All notable changes to this project will be documented in this file. Please add
|
|
|
4
4
|
|
|
5
5
|
date format is [yyyy-mm-dd]
|
|
6
6
|
|
|
7
|
+
## [0.10.1] - 2026-07-03
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
- **`UqlModule` ends the pool on application shutdown** (`onApplicationShutdown`), so Nest testing modules and SIGTERM-driven shutdowns release database connections; call `app.enableShutdownHooks()` to wire signals.
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
- **`uql-orm@0.10.0` on npm shipped only the browser bundle** (5 files; `dist/index.js` missing, so every server-side import failed). The package build shared the repo root's `tsBuildInfoFile` (introduced 2026-06-29 in an unrelated config cleanup): after `clean` wiped `dist`, `tsc -b` trusted the stale build info and emitted nothing, and the release published the partial `dist`. The build info is now package-local and the errant root-level one has been removed entirely, restoring the isolation each package had before that cleanup. `prepack` no longer checks two hardcoded files (which would have missed this exact failure — neither covered `uql-orm/migrate`); it now verifies every path declared in `main`, `types`, `bin`, and `exports` exists in `dist` before packing, derived straight from `package.json` so the check can't go stale as exports are added. Use 0.10.1 instead of 0.10.0.
|
|
16
|
+
|
|
17
|
+
## [0.10.0] - 2026-07-02
|
|
18
|
+
|
|
19
|
+
### Breaking Changes
|
|
20
|
+
|
|
21
|
+
- **HTTP transport redesigned around a framework-agnostic core (`uql-orm/http`)**: the wire contract (routes, envelopes, query serialization) is defined once and shared by the server adapters and the browser client; `uql-orm/express` is now a thin adapter over it.
|
|
22
|
+
- **Hooks**: `pre`/`preSave`/`preFilter` receive a single `HookContext` (`{ meta, op, method, query, body, context }`) instead of `(req, meta)`, may be `async`, and abort by throwing (a numeric `status` on the error becomes the HTTP status). Migration is mechanical: `req.query` becomes `ctx.query`, `req.body` becomes `ctx.body`.
|
|
23
|
+
- **Error responses** are now `{ error: { message, code } }` (was `{ error: string }`).
|
|
24
|
+
- **`HttpQuerier.saveOne`** issues `PUT /<entity>` (server-side upsert) instead of client-side POST/PATCH branching.
|
|
25
|
+
- **Removed**: `buildQuerierRouter`, express `parseQuery` (use `parseQueryParams` from `uql-orm/http`), the `express.Request.query` type augmentation, and the browser re-exports of `stringifyQuery` and the envelope types (import them from `uql-orm/http`).
|
|
26
|
+
- **`uql-orm/browser` no longer loads `reflect-metadata`**: import it (or `uql-orm`) directly if you relied on that side effect.
|
|
27
|
+
|
|
28
|
+
### Features
|
|
29
|
+
|
|
30
|
+
- **`uql-orm/http`**: `createFetchHandler` mounts natively on Hono, Next.js route handlers, Bun.serve, Deno.serve, Cloudflare Workers, and SvelteKit; `createRequestHandler` bridges any other framework.
|
|
31
|
+
- **Extended wire protocol**: new routes for `insertMany`, `saveOne` (upsert), `saveMany`, and bulk `updateMany`, with matching `HttpQuerier` methods.
|
|
32
|
+
- **`uql-orm/nestjs`**: `UqlModule.forRoot({ pool })` registers the pool with Nest DI and as UQL's default pool.
|
|
33
|
+
- **HTTP QUERY method (RFC 10008)**: reads can send the JSON query in the request body, avoiding URL-length limits; the client opts in via `new HttpQuerier('/api', { readMethod: 'QUERY' })`.
|
|
34
|
+
- **Better client ergonomics**: per-call and per-instance `headers`, `AbortSignal` support, and non-2xx responses throw `RequestError` carrying the HTTP `status`.
|
|
35
|
+
- **`post` hook**: shape the success envelope before it is sent (strip secrets, derive presentation fields).
|
|
36
|
+
|
|
37
|
+
### Bug Fixes
|
|
38
|
+
|
|
39
|
+
- **The published browser bundle was broken** (it contained test helpers instead of the client); it is now a 4 KB bundle with no `reflect-metadata`.
|
|
40
|
+
- **The express middleware falls through** (`next()`) on unknown routes, so it composes with custom routes on the same prefix.
|
|
41
|
+
- Hooks can now enforce `softDelete`; malformed JSON returns `400` instead of `500`; `HEAD` is served as `GET`; query strings are percent-encoded; `GET /<entity>/:id` merges an array `$where` via `$and` instead of overwriting it.
|
|
42
|
+
|
|
43
|
+
## [0.9.5] - 2026-07-02
|
|
44
|
+
|
|
45
|
+
### Documentation
|
|
46
|
+
|
|
47
|
+
- **README**: Slimmed from 336 to 127 lines as a marketing quick-reference. Added "Why UQL" section, dark mode logo, value proposition, and a minimal 4-line query example aligned to the querier API. Completed the database support list, updated benchmark claims to July 2026, and cleaned up writing style. Updated and simplified entry example of the ORM.
|
|
48
|
+
- **Contributing**: Added `CONTRIBUTING.md` and `CODE_OF_CONDUCT.md`.
|
|
49
|
+
|
|
7
50
|
## [0.9.4] - 2026-06-29
|
|
8
51
|
|
|
9
52
|
### Bug Fixes
|