monsqlize 3.3.0 → 3.3.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 +4 -3
- package/README.md +31 -5
- package/changelogs/v3.3.1.md +28 -0
- package/dist/cjs/cli/data-task.cjs +3 -2
- package/dist/cjs/index.cjs +1010 -610
- package/dist/cjs/transaction/Transaction.cjs +33 -5
- package/dist/cjs/transaction/TransactionManager.cjs +38 -16
- package/dist/esm/index.mjs +1014 -614
- package/dist/types/collection.d.mts +6 -6
- package/dist/types/collection.d.ts +6 -6
- package/dist/types/data-tasks.d.mts +1 -0
- package/dist/types/data-tasks.d.ts +1 -0
- package/dist/types/model.d.mts +3 -0
- package/dist/types/model.d.ts +3 -0
- package/dist/types/monsqlize.d.mts +4 -0
- package/dist/types/monsqlize.d.ts +4 -0
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
-
> Summary index — the newest versioned release details are in [changelogs/v3.3.
|
|
4
|
-
> **Last updated**: 2026-
|
|
3
|
+
> Summary index — the newest versioned release details are in [changelogs/v3.3.1.md](./changelogs/v3.3.1.md); the earlier RC note remains an unpublished rehearsal archive.
|
|
4
|
+
> **Last updated**: 2026-09-23
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
## Unreleased
|
|
9
9
|
|
|
10
|
-
No changes are currently recorded after v3.3.
|
|
10
|
+
No changes are currently recorded after v3.3.1.
|
|
11
11
|
|
|
12
12
|
## Version Overview
|
|
13
13
|
|
|
14
14
|
| Version | Date | Summary | Details |
|
|
15
15
|
|---------|------|---------|---------|
|
|
16
|
+
| [v3.3.1](./changelogs/v3.3.1.md) | 2026-09-23 | Patch: audited Model, count, transaction, cache, sync, pool, Data Task and SSH corrections | [View](./changelogs/v3.3.1.md) |
|
|
16
17
|
| [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
18
|
| [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) |
|
|
18
19
|
| [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) |
|
package/README.md
CHANGED
|
@@ -332,6 +332,14 @@ Relative model paths are resolved from `process.cwd()`. In production services,
|
|
|
332
332
|
Model-declared indexes are still created automatically by default for backward compatibility. Production services can turn off automatic indexing and run an explicit preflight before creating missing indexes:
|
|
333
333
|
|
|
334
334
|
```js
|
|
335
|
+
const MonSQLize = require('monsqlize');
|
|
336
|
+
|
|
337
|
+
async function main() {
|
|
338
|
+
MonSQLize.Model.define('users', {
|
|
339
|
+
schema: { email: 'email!' },
|
|
340
|
+
indexes: [{ key: { email: 1 }, unique: true }]
|
|
341
|
+
});
|
|
342
|
+
|
|
335
343
|
const msq = new MonSQLize({
|
|
336
344
|
type: 'mongodb',
|
|
337
345
|
databaseName: 'mydb',
|
|
@@ -339,11 +347,18 @@ const msq = new MonSQLize({
|
|
|
339
347
|
autoIndex: false
|
|
340
348
|
});
|
|
341
349
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
350
|
+
try {
|
|
351
|
+
await msq.connect();
|
|
352
|
+
const plan = await msq.ensureModelIndexes({ models: ['users'], dryRun: true });
|
|
353
|
+
if (plan.totals.conflicts === 0) {
|
|
354
|
+
await msq.ensureModelIndexes({ models: ['users'], throwOnError: true });
|
|
355
|
+
}
|
|
356
|
+
} finally {
|
|
357
|
+
await msq.close();
|
|
346
358
|
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
main().catch((error) => { console.error(error); process.exitCode = 1; });
|
|
347
362
|
```
|
|
348
363
|
|
|
349
364
|
`ensureModelIndexes()` creates only missing indexes. It does not drop, rename, or rebuild conflicting indexes.
|
|
@@ -449,6 +464,8 @@ Transaction cache invalidations are recorded during the transaction and flushed
|
|
|
449
464
|
### Connection Pools
|
|
450
465
|
|
|
451
466
|
```js
|
|
467
|
+
const MonSQLize = require('monsqlize');
|
|
468
|
+
async function main() {
|
|
452
469
|
const msq = new MonSQLize({
|
|
453
470
|
type: 'mongodb',
|
|
454
471
|
databaseName: 'main',
|
|
@@ -458,7 +475,16 @@ const msq = new MonSQLize({
|
|
|
458
475
|
]
|
|
459
476
|
});
|
|
460
477
|
|
|
461
|
-
|
|
478
|
+
try {
|
|
479
|
+
await msq.connect();
|
|
480
|
+
const reports = msq.pool('analytics').collection('reports');
|
|
481
|
+
console.log(await reports.countDocuments({}));
|
|
482
|
+
} finally {
|
|
483
|
+
await msq.close();
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
main().catch((error) => { console.error(error); process.exitCode = 1; });
|
|
462
488
|
```
|
|
463
489
|
|
|
464
490
|
### Change Streams
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# monSQLize v3.3.1
|
|
2
|
+
|
|
3
|
+
> Release date: 2026-09-23
|
|
4
|
+
|
|
5
|
+
## Highlights
|
|
6
|
+
|
|
7
|
+
This backward-compatible patch closes the post-3.3.0 runtime audit findings. It corrects Model validation, soft-delete, relation and strict-version behavior; count cancellation; transaction, cache, pool and sync lifecycle edges; and backup/restore data fidelity.
|
|
8
|
+
|
|
9
|
+
## Fixed
|
|
10
|
+
|
|
11
|
+
- Model writes now surface a schema factory error only when full-document validation is required. Disabling validation or using `skipValidation` no longer blocks unrelated writes and management methods.
|
|
12
|
+
- Boolean soft delete consistently treats only `true` as deleted across reads, batch deletion and relation-usage checks. Hydrated `remove()` follows Model hooks and soft-delete rules.
|
|
13
|
+
- Strict `updateMany` and `updateBatch` preserve the original business filter during each atomic write. A candidate that no longer matches that filter is reported as skipped; a still-matching candidate with a changed version is a conflict. Candidate enumeration is no longer limited by the public find default.
|
|
14
|
+
- Populate pagination applies `skip` and `limit` per parent. Model batch writes, query cache keys, expression evaluation and write-path checks retain their original filters and BSON semantics.
|
|
15
|
+
- Public count operations forward the caller's abort signal to CountQueue, including queued and running work. Running slots remain occupied until the underlying operation settles.
|
|
16
|
+
- Managed transaction aborts reject later wrapped writes. Redis invalidation does not rebroadcast received events, pool close/capacity races are handled, and Change Stream sync preserves resume tokens and failure barriers.
|
|
17
|
+
- Data Task backup/restore preserves canonical BSON values. Optional SSH host verification and local failure cleanup are available without changing the default connection path.
|
|
18
|
+
|
|
19
|
+
## Compatibility and verification
|
|
20
|
+
|
|
21
|
+
- No breaking public method signature, package entry point, runtime Node requirement or direct production dependency change. MongoDB remains the only complete adapter; Node.js `>=18` remains the runtime contract.
|
|
22
|
+
- The transitive `fast-uri` override now permits patched v3 releases and resolves to 3.1.8; the development-only `js-yaml` lockfile entry is refreshed to 4.3.2. Both clear high-severity advisories found during release review without changing the supported major versions.
|
|
23
|
+
- Release automation uses npm trusted publishing through GitHub Actions OIDC. The pre-tag check verifies runner readiness; npm verifies the configured publisher during the actual publish.
|
|
24
|
+
- Validation-disabled writes and strict batch-result classification may behave differently from the faulty post-3.3.0 main branch; applications relying on the documented contracts receive the corrected behavior.
|
|
25
|
+
- The root CJS/ESM byte budget moves from 720,000 to 740,000 to cover the audited runtime fixes while retaining a tight size guard. The CLI budget remains 50,000 bytes.
|
|
26
|
+
- The release gate covers full tests and coverage, Node 18/20/22 CI, Node 20/22 × MongoDB Driver 6/7 × MongoDB Server 7.0.37/8.0.26, package installation, and bilingual website verification.
|
|
27
|
+
|
|
28
|
+
Private SSH and Atlas deployments remain operator-managed integration checks; local and public CI coverage does not claim to replace them.
|
|
@@ -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.3.
|
|
34
|
+
version: "3.3.1",
|
|
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,7 @@ var package_default = {
|
|
|
52
52
|
"./package.json": "./package.json"
|
|
53
53
|
},
|
|
54
54
|
files: [
|
|
55
|
+
"changelogs/v3.3.1.md",
|
|
55
56
|
"changelogs/v3.3.0.md",
|
|
56
57
|
"changelogs/v3.2.0.md",
|
|
57
58
|
"changelogs/v3.1.14.md",
|
|
@@ -196,7 +197,7 @@ var package_default = {
|
|
|
196
197
|
ssh2: "1.17.0"
|
|
197
198
|
},
|
|
198
199
|
overrides: {
|
|
199
|
-
"fast-uri": "3.1.
|
|
200
|
+
"fast-uri": "^3.1.8",
|
|
200
201
|
"minimatch@3.1.5": {
|
|
201
202
|
"brace-expansion": "1.1.18"
|
|
202
203
|
},
|