monsqlize 3.1.14 → 3.3.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,14 +1,20 @@
1
1
  # CHANGELOG
2
2
 
3
- > Summary index — the v3.1.0 stable release details are in [changelogs/v3.1.0.md](./changelogs/v3.1.0.md); the earlier RC note remains an unpublished rehearsal archive.
4
- > **Last updated**: 2026-07-15
3
+ > Summary index — the newest versioned release details are in [changelogs/v3.3.0.md](./changelogs/v3.3.0.md); the earlier RC note remains an unpublished rehearsal archive.
4
+ > **Last updated**: 2026-08-11
5
5
 
6
6
  ---
7
7
 
8
+ ## Unreleased
9
+
10
+ No changes are currently recorded after v3.3.0.
11
+
8
12
  ## Version Overview
9
13
 
10
14
  | Version | Date | Summary | Details |
11
15
  |---------|------|---------|---------|
16
+ | [v3.3.0](./changelogs/v3.3.0.md) | 2026-08-11 | Minor: static Model schema type inference, schema-dsl 3.0.4, and silent-by-default Pool logging | [View](./changelogs/v3.3.0.md) |
17
+ | [v3.2.0](./changelogs/v3.2.0.md) | 2026-08-07 | Minor: Vector Search APIs, relation-safe Model deletion, and relation projection improvements | [View](./changelogs/v3.2.0.md) |
12
18
  | [v3.1.0](./changelogs/v3.1.0.md) | 2026-07-15 | Minor: schema-dsl v3 GA consumption, canonical validation errors, and normalized full-document persistence | [View](./changelogs/v3.1.0.md) |
13
19
  | [v3.0.0](./changelogs/v3.0.0.md) | 2026-07-14 | Major: two-instance preview/apply/restore data tasks, write-path policy, runtime-scoped schema DSL, stricter OCC/sync/query contracts, and release recovery controls | [View](./changelogs/v3.0.0.md) |
14
20
  | [v2.0.7](./changelogs/v2.0.7.md) | Unpublished | Withdrawn patch candidate; never published and superseded by v3.0.0 | [Archive](./changelogs/v2.0.7.md) |
package/README.md CHANGED
@@ -14,7 +14,7 @@ Upgrade and security: [Migration Guide](./MIGRATION.md) · [Private Vulnerabilit
14
14
 
15
15
  The npm `latest` dist-tag and GitHub Pages are the stable channel; `main` may contain the next release. Pages deployment accepts only a versioned Git tag whose package version is already present on npm, so unpublished APIs are not promoted as stable documentation.
16
16
 
17
- This source tree contains the stable `3.1.0` release candidate, pinned to verified registry `schema-dsl@3.0.0`. The v3 package remains subject to the full release gate before its immutable tag and npm publication.
17
+ This development source is pinned to verified registry `schema-dsl@3.0.4`. The v3 package remains subject to the full release gate before an immutable tag and npm publication.
18
18
 
19
19
  ```bash
20
20
  npm install monsqlize
@@ -234,6 +234,30 @@ const user = await User.insertOne({
234
234
  });
235
235
  ```
236
236
 
237
+ ### TypeScript Schema Inference
238
+
239
+ For a static object-literal schema, `defineModel()` carries the schema-derived document type from definition through registration to runtime access. Registration remains explicit, so it does not change the process-wide Model registry behavior.
240
+
241
+ ```ts
242
+ import { defineModel, Model } from 'monsqlize';
243
+
244
+ const User = defineModel('users', {
245
+ schema: {
246
+ email: 'email!',
247
+ age: 'number?'
248
+ }
249
+ });
250
+
251
+ Model.define(User);
252
+
253
+ const users = msq.model(User);
254
+ const user = await users.findOne({ email: 'ada@example.com' });
255
+ // user?.email: string
256
+ // user?.age: number | undefined
257
+ ```
258
+
259
+ Call `Model.define(User)` before `model(User)`, `use(...).model(User)`, or `pool(...).model(User)`. Callback-based or dynamically composed schemas continue to use the existing explicit generic API, such as `msq.model<UserDocument>('users')`; managed fields added by timestamps, soft delete, versioning, relations, or virtuals are not synthesized into this schema-derived type.
260
+
237
261
  When a service needs runtime-local custom types, messages, locale, or an already-owned schema-dsl runtime, configure `schemaDsl` on the MonSQLize instance:
238
262
 
239
263
  ```js
@@ -0,0 +1,24 @@
1
+ # monSQLize v3.2.0
2
+
3
+ > Release date: 2026-08-07
4
+
5
+ ## Highlights
6
+
7
+ - Added first-class Vector Search entrypoints for Collections and Models.
8
+ - Added relation-aware Model deletion guards and completed relation projection behavior.
9
+
10
+ ## Added
11
+
12
+ - Added `Collection.vectorSearch()` and `Model.vectorSearch()` with ANN/ENN option validation, score envelopes, and Model soft-delete visibility expressed inside `$vectorSearch.filter`.
13
+ - Added Model relation-usage reporting plus explicit restrict-style `deleteOneWithRelations()` and `forceDeleteWithRelations()` methods.
14
+
15
+ ## Changed
16
+
17
+ - `populate()` now supports local ID arrays, relation-level default inclusion selection, server-side relation projections, and cleanup of internal join keys after nested population.
18
+ - Added stable `INVALID_VECTOR_SEARCH`, `INVALID_RELATION_SELECT`, `RELATION_IN_USE`, and `RELATION_USAGE_UNAVAILABLE` error codes.
19
+ - Updated production dependency overrides to resolve audited `fast-uri` and `brace-expansion` versions.
20
+
21
+ ## Compatibility boundaries
22
+
23
+ - This is a backward-compatible minor release. Existing `expr` APIs remain unchanged.
24
+ - Vector Search requires a MongoDB-compatible deployment with a pre-created Vector Search index. The API validates its local contract; deployment/index execution remains an operator-managed prerequisite.
@@ -0,0 +1,29 @@
1
+ # monSQLize v3.3.0
2
+
3
+ > Release date: 2026-08-11
4
+
5
+ ## Highlights
6
+
7
+ - Added schema-derived TypeScript document inference for static Model definitions.
8
+ - Made Pool logging silent by default while preserving explicit logger delivery.
9
+
10
+ ## Added
11
+
12
+ - Added `defineModel()` and `ModelDescriptor` so object-literal `schema` definitions carry their inferred document type through `Model.define()`, `model()`, `scopedModel()`, `use().model()`, and `pool().model()`.
13
+ - Added CJS, ESM, public-type, compatibility, pack-consumer, and registry-consumer verification for the descriptor API.
14
+
15
+ ## Changed
16
+
17
+ - Updated the exact production dependency from `schema-dsl@3.0.0` to `schema-dsl@3.0.4`.
18
+ - Extended current-version validation so README and bilingual dependency-governance documents must match the exact `schema-dsl` version in `package.json`.
19
+
20
+ ## Fixed
21
+
22
+ - Forwarded the configured `ConnectionPoolManager` logger to `PoolSelector`, `HealthChecker`, and `PoolStatsManager`.
23
+ - Removed implicit `console` fallback logging from Pool helpers when no logger is configured.
24
+
25
+ ## Compatibility boundaries
26
+
27
+ - This is a backward-compatible minor release. Existing string-based Model registration/access, manual TypeScript generics, Pool APIs, and explicit process-wide Model registry lifecycle remain unchanged.
28
+ - `defineModel()` creates a static descriptor; it does not register the Model. Call `Model.define(descriptor)` before binding it through a runtime accessor.
29
+ - Callback or dynamically composed schemas continue to use explicit document generics. Schema-derived types do not synthesize timestamp, soft-delete, version, relation, or virtual fields.
@@ -31,7 +31,7 @@ var import_node_url = require("node:url");
31
31
  // package.json
32
32
  var package_default = {
33
33
  name: "monsqlize",
34
- version: "3.1.14",
34
+ version: "3.3.0",
35
35
  description: "TypeScript production data runtime layer for MongoDB today, with cache, transactions, pools, models, sync, and observability",
36
36
  type: "commonjs",
37
37
  main: "./dist/cjs/index.cjs",
@@ -52,6 +52,8 @@ var package_default = {
52
52
  "./package.json": "./package.json"
53
53
  },
54
54
  files: [
55
+ "changelogs/v3.3.0.md",
56
+ "changelogs/v3.2.0.md",
55
57
  "changelogs/v3.1.14.md",
56
58
  "changelogs/v3.1.13.md",
57
59
  "changelogs/v3.1.12.md",
@@ -190,8 +192,17 @@ var package_default = {
190
192
  "cache-hub": "2.2.4",
191
193
  ioredis: "5.11.1",
192
194
  mongodb: "6.21.0",
193
- "schema-dsl": "3.0.0",
195
+ "schema-dsl": "3.0.4",
194
196
  ssh2: "1.17.0"
197
+ },
198
+ overrides: {
199
+ "fast-uri": "3.1.5",
200
+ "minimatch@3.1.5": {
201
+ "brace-expansion": "1.1.18"
202
+ },
203
+ "minimatch@10.2.5": {
204
+ "brace-expansion": "5.0.9"
205
+ }
195
206
  }
196
207
  };
197
208