You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/workflows/publish.yml
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -76,7 +76,7 @@ jobs:
76
76
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
77
77
run: |
78
78
if [ -z "${NODE_AUTH_TOKEN:-}" ]; then
79
-
echo "::error::NPM_TOKEN is not configured or is not available to this repository. Grant the same npm publish secret used by schema-dsl to vextjs/monSQLize, or configure npm trusted publishing and adjust this workflow."
79
+
echo "::error::NPM_TOKEN is not configured or is not available to devcodex-labs/monSQLize. Grant this repository an npm publish secret, or configure npm trusted publishing and adjust this workflow."
Copy file name to clipboardExpand all lines: CHANGELOG.md
+7-2Lines changed: 7 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,19 @@
1
1
# CHANGELOG
2
2
3
-
> Summary index — the latest stable release details are in [changelogs/v3.2.0.md](./changelogs/v3.2.0.md); the earlier RC note remains an unpublished rehearsal archive.
4
-
> **Last updated**: 2026-08-07
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)|
12
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)|
13
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)|
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 =awaitusers.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:
- Fixed Pool logger propagation so PoolSelector and HealthChecker use the manager logger; omitted loggers are now silent instead of writing to `console`.
- 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.
Copy file name to clipboardExpand all lines: docs/en/file-dependency-governance.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,11 +5,11 @@ The current root package adopts the **precise version dependency strategy**:
5
5
| Dependencies | Strategy | Reasons |
6
6
|------|------|------|
7
7
|`cache-hub`| Exact version `2.2.4`| The root direct dependency and schema-dsl integration share the verified cache runtime baseline |
8
-
|`schema-dsl`| Exact stable version `3.0.0`| Node 18-compatible v3 runtime with a side-effect-free root entry and the isolated `schema-dsl/runtime` entry |
8
+
|`schema-dsl`| Exact stable version `3.0.4`| Node 18-compatible v3 runtime with a side-effect-free root entry and the isolated `schema-dsl/runtime` entry |
9
9
|`ioredis`| Exact version `5.11.1`| Runtime Redis dependency; enabled only when Redis-backed features are configured |
10
10
|`mongodb-memory-server`| Dev exact version `10.4.3`| Test tooling remains compatible with Node `>=16.20.1`, preserving the package's Node 18 CI contract |
11
11
12
-
> monSQLize `3.1.0` is pinned to verified registry `schema-dsl@3.0.0`. Local `file:` or workspace resolutions are prohibited from the release lockfile. Historical npm `schema-dsl@2.3.x` artifacts are not accepted as substitutes.
12
+
> The current monSQLize line is pinned to verified registry `schema-dsl@3.0.4`. Local `file:` or workspace resolutions are prohibited from the release lockfile. Historical npm `schema-dsl@2.3.x` artifacts are not accepted as substitutes.
13
13
14
14
## Current Risk
15
15
@@ -23,7 +23,7 @@ The current root package adopts the **precise version dependency strategy**:
23
23
## Development status
24
24
25
25
- The root direct `cache-hub` dependency is fixed to `2.2.4`; no workspace override is required.
26
-
-`schema-dsl` is fixed to registry `3.0.0`, `ioredis` to `5.11.1`, and test tooling `mongodb-memory-server` to `10.4.3`.
26
+
-`schema-dsl` is fixed to registry `3.0.4`, `ioredis` to `5.11.1`, and test tooling `mongodb-memory-server` to `10.4.3`.
27
27
- Local sibling `../schema-dsl` is only used for debugging the upstream library itself and is no longer a prerequisite for monSQLize root package installation.
28
28
29
29
@@ -44,7 +44,7 @@ The v3 consumer migration used an identity-bound local tarball for rehearsal and
44
44
2. Install the exact GA and run `npm run type-check`, Model unit/integration tests, root String prototype probes, examples, and packed-consumer verification.
45
45
3. All model-related unit tests/integration tests passed (covered with `npm run test:unit` and `npm run test:integration`).
46
46
4.`npm run test:examples` all passed.
47
-
5.`npm run release:preflight` remains the final gate; it must reject local `file:` resolution and require registry `schema-dsl@3.0.0` for GA.
47
+
5.`npm run release:preflight` remains the final gate; it must reject local `file:` resolution and require registry `schema-dsl@3.0.4` for GA.
48
48
6. This file, Profile, CHANGELOG, package manifest, and lockfile must share the same candidate or GA identity.
Copy file name to clipboardExpand all lines: docs/en/model.md
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -637,6 +637,32 @@ When validation succeeds, those six write paths continue with schema-dsl's norma
637
637
638
638
Patch-style writes such as `updateOne()`, `updateMany()`, `findOneAndUpdate()`, `upsertOne()`, `incrementOne()`, and `updateBatch()` receive MongoDB update operators or aggregation pipelines rather than the final document. monSQLize does not run full-document schema validation for those patch writes; use hooks, `Model.validate()`, or application-side validation when a patch must be checked against a complete domain object.
639
639
640
+
## TypeScript static schema inference
641
+
642
+
Available since monSQLize 3.3.0.
643
+
644
+
For a static object-literal schema, `defineModel()` carries the schema-derived document type through registration to `model()`, `scopedModel()`, `use().model()`, and `pool().model()`. The descriptor does not register itself, so the existing process-wide registry lifecycle stays explicit.
645
+
646
+
```typescript
647
+
import { defineModel, Model } from'monsqlize';
648
+
649
+
const User =defineModel('users', {
650
+
schema: {
651
+
email: 'email!',
652
+
age: 'number?',
653
+
},
654
+
});
655
+
656
+
Model.define(User);
657
+
658
+
const users =msq.model(User);
659
+
const user =awaitusers.findOne({ email: 'ada@example.com' });
660
+
// user?.email: string
661
+
// user?.age: number | undefined
662
+
```
663
+
664
+
Call `Model.define(User)` before binding the descriptor through a runtime accessor. Callback-based or dynamically composed schemas continue to use the existing explicit generic form, such as `msq.model<UserDocument>('users')`. The inferred type contains schema fields only; timestamp, soft-delete, version, relation, and virtual fields remain application-defined types.
0 commit comments