monsqlize 2.0.5 → 2.0.6

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,7 +1,7 @@
1
1
  # CHANGELOG
2
2
 
3
- > Summary index — current release details are packaged in [changelogs/v2.0.5.md](./changelogs/v2.0.5.md); historical details live in the repository changelog archive.
4
- > **Last updated**: 2026-06-13
3
+ > Summary index — current release details are packaged in [changelogs/v2.0.6.md](./changelogs/v2.0.6.md); historical details live in the repository changelog archive.
4
+ > **Last updated**: 2026-06-15
5
5
 
6
6
  ---
7
7
 
@@ -9,6 +9,7 @@
9
9
 
10
10
  | Version | Date | Summary | Details |
11
11
  |---------|------|---------|---------|
12
+ | [v2.0.6](./changelogs/v2.0.6.md) | 2026-06-15 | Patch: dependency alignment to `schema-dsl@2.0.11` so downstream frameworks inherit the ESM/CJS shared custom type registry fix | [View](./changelogs/v2.0.6.md) |
12
13
  | [v2.0.5](./changelogs/v2.0.5.md) | 2026-06-13 | Patch: Model schema adapter delegates DSL type authority to `schema-dsl@2.0.10`, removing the duplicated monSQLize allowlist while preserving legacy aliases and business literals | [View](./changelogs/v2.0.5.md) |
13
14
  | [v2.0.4](./changelogs/v2.0.4.md) | 2026-06-12 | Patch: production-safe Model index rollout controls, `schema-dsl@2.0.9`, capability-index wording cleanup, and documentation home refinements | [View](./changelogs/v2.0.4.md) |
14
15
  | [v2.0.3](./changelogs/v2.0.3.md) | 2026-06-11 | Patch: v1 compatibility fixes, public stats APIs, standalone docs-site link safety, bilingual docs consistency, and release preflight alignment | [View](./changelogs/v2.0.3.md) |
@@ -448,7 +449,8 @@ const result = await msq.collection('orders').insertOne(dataFromMongoose);
448
449
  changelogs/
449
450
  ├── README.md # 变更文档说明
450
451
  ├── TEMPLATE.md # 变更文档模板
451
- ├── v2.0.5.md # 当前发布详细变更
452
+ ├── v2.0.6.md # 当前发布详细变更
453
+ ├── v2.0.5.md # v2.0.5 详细变更
452
454
  ├── v2.0.4.md # v2.0.4 详细变更
453
455
  ├── v2.0.3.md # v2.0.3 详细变更
454
456
  ├── v2.0.2.md # v2.0.2 详细变更
@@ -504,7 +506,8 @@ changelogs/
504
506
 
505
507
  ## 相关文档
506
508
 
507
- - [changelogs/v2.0.5.md](./changelogs/v2.0.5.md) - 当前发布详细变更文档
509
+ - [changelogs/v2.0.6.md](./changelogs/v2.0.6.md) - 当前发布详细变更文档
510
+ - [changelogs/v2.0.5.md](./changelogs/v2.0.5.md) - v2.0.5 详细变更文档
508
511
  - [changelogs/v2.0.4.md](./changelogs/v2.0.4.md) - v2.0.4 详细变更文档
509
512
  - [changelogs/v2.0.3.md](./changelogs/v2.0.3.md) - v2.0.3 详细变更文档
510
513
  - [changelogs/v2.0.2.md](./changelogs/v2.0.2.md) - v2.0.2 详细变更文档
@@ -514,5 +517,5 @@ changelogs/
514
517
 
515
518
  ---
516
519
 
517
- **最后更新**: 2026-06-13
520
+ **最后更新**: 2026-06-15
518
521
 
package/README.md CHANGED
@@ -518,7 +518,7 @@ npm run test:real-env:private
518
518
 
519
519
  ## Release Status
520
520
 
521
- The current published release is `v2.0.4`.
521
+ The current release train targets `v2.0.6`.
522
522
 
523
523
  Key release-readiness points:
524
524
 
@@ -526,11 +526,17 @@ Key release-readiness points:
526
526
  - Package exports are consolidated under `dist/cjs`, `dist/esm`, and `dist/types`.
527
527
  - npm packages include the runtime bundles and declaration files only; source maps are disabled by default and can be generated locally with `MONSQLIZE_BUILD_SOURCEMAPS=1 npm run build`.
528
528
  - v1 smooth-upgrade compatibility has been validated against the target workspace consumers.
529
- - `schema-dsl` follows the npm `latest` TypeScript line `schema-dsl@2.0.9`; deprecated `2.3.x` mistake releases are intentionally excluded.
529
+ - `schema-dsl` follows the npm `latest` TypeScript line `schema-dsl@2.0.11`; deprecated `2.3.x` mistake releases are intentionally excluded.
530
530
  - GitHub Actions publishes to npm from `v*` tags after running `npm run release:preflight`; the publish step skips duplicate lifecycle scripts because the gate already ran in the same job.
531
531
 
532
532
  ## Roadmap
533
533
 
534
+ ### v2.0.6
535
+
536
+ - Dependency alignment to `schema-dsl@2.0.11`, carrying the shared ESM/CJS custom type registry fix to downstream vext applications.
537
+ - NodeNext declaration compatibility for ESM consumers through generated `*.d.mts` mirrors and import-side `types` conditions.
538
+ - Restored v1-compatible root option type exports.
539
+
534
540
  ### v2.0.4
535
541
 
536
542
  - Production-safe Model index rollout controls with `autoIndex`, dry-run preflight, conflict reporting, and explicit `ensureIndexes()` / `ensureModelIndexes()` APIs.
@@ -0,0 +1,16 @@
1
+ # monSQLize v2.0.6
2
+
3
+ Released: 2026-06-15
4
+
5
+ ## Changes
6
+
7
+ - Upgrade runtime dependency `schema-dsl` from `2.0.10` to `2.0.11`.
8
+ - This keeps monSQLize aligned with the schema-dsl ESM/CJS shared custom type registry fix used by downstream vext applications.
9
+ - Restore v1-compatible root type exports: `FindOptions`, `CountOptions`, `AggregateOptions`, and `DistinctOptions`.
10
+ - Add NodeNext-safe type-only import attributes for ESM `cache-hub` declarations consumed from monSQLize's CommonJS package boundary.
11
+ - Generate ESM declaration mirrors (`*.d.mts`) and point the import-side package `types` condition at `dist/types/index.d.mts`, preserving default import constructability for NodeNext ESM consumers.
12
+
13
+ ## Validation
14
+
15
+ - Dependency-only release; full release preflight should run after `schema-dsl@2.0.11` is available from npm.
16
+ - `npm run type-check`
@@ -0,0 +1,81 @@
1
+ export type DbType = 'mongodb';
2
+
3
+ export interface ExpressionObject {
4
+ __expr__: string;
5
+ __compiled__: boolean;
6
+ }
7
+
8
+ export type ExpressionFunction = (expression: string) => ExpressionObject;
9
+
10
+ /** Context in which an expression is evaluated. @since v1.0.0 */
11
+ export type ExpressionContext = '$match' | '$project' | '$group' | 'unknown';
12
+
13
+ export interface LoggerLike {
14
+ debug?: (...args: unknown[]) => void;
15
+ info?: (...args: unknown[]) => void;
16
+ warn?: (...args: unknown[]) => void;
17
+ error?: (...args: unknown[]) => void;
18
+ /** Wrap a function execution with a trace ID. @since v1.3.0 */
19
+ withTraceId?: (fn: Function, traceId?: string) => any;
20
+ /** Retrieve the current trace ID. @since v1.3.0 */
21
+ getTraceId?: () => string | null;
22
+ }
23
+
24
+ /** Logger configuration options. @since v1.3.0 */
25
+ export interface LoggerOptions {
26
+ /** Enable structured (JSON) log output. */
27
+ structured?: boolean;
28
+ /** Enable automatic trace ID injection into log entries. */
29
+ enableTraceId?: boolean;
30
+ }
31
+
32
+ export declare const enum ErrorCodes {
33
+ INVALID_ARGUMENT = 'INVALID_ARGUMENT',
34
+ INVALID_COLLECTION_NAME = 'INVALID_COLLECTION_NAME',
35
+ INVALID_DATABASE_NAME = 'INVALID_DATABASE_NAME',
36
+ INVALID_EXPRESSION = 'INVALID_EXPRESSION',
37
+ INVALID_PAGINATION = 'INVALID_PAGINATION',
38
+ INVALID_OPERATION = 'INVALID_OPERATION',
39
+ INVALID_CURSOR = 'INVALID_CURSOR',
40
+ INVALID_CONFIG = 'INVALID_CONFIG',
41
+ INVALID_MODEL_DEFINITION = 'INVALID_MODEL_DEFINITION',
42
+ INVALID_SCHEMA_TYPE = 'INVALID_SCHEMA_TYPE',
43
+ NOT_CONNECTED = 'NOT_CONNECTED',
44
+ NO_POOL_MANAGER = 'NO_POOL_MANAGER',
45
+ POOL_NOT_FOUND = 'POOL_NOT_FOUND',
46
+ MODEL_NOT_DEFINED = 'MODEL_NOT_DEFINED',
47
+ MODEL_ALREADY_EXISTS = 'MODEL_ALREADY_EXISTS',
48
+ MISSING_SCHEMA = 'MISSING_SCHEMA',
49
+ UNSUPPORTED_DATABASE = 'UNSUPPORTED_DATABASE',
50
+ CONNECTION_FAILED = 'CONNECTION_FAILED',
51
+ CONNECTION_CLOSED = 'CONNECTION_CLOSED',
52
+ CONNECTION_TIMEOUT = 'CONNECTION_TIMEOUT',
53
+ OPERATION_TIMEOUT = 'OPERATION_TIMEOUT',
54
+ QUERY_TIMEOUT = 'QUERY_TIMEOUT',
55
+ DATABASE_ERROR = 'DATABASE_ERROR',
56
+ CACHE_UNAVAILABLE = 'CACHE_UNAVAILABLE',
57
+ CACHE_ERROR = 'CACHE_ERROR',
58
+ CACHE_TIMEOUT = 'CACHE_TIMEOUT',
59
+ MANAGEMENT_OPERATION_FAILED = 'MANAGEMENT_OPERATION_FAILED',
60
+ VALIDATION_ERROR = 'VALIDATION_ERROR',
61
+ DOCUMENT_REQUIRED = 'DOCUMENT_REQUIRED',
62
+ DOCUMENTS_REQUIRED = 'DOCUMENTS_REQUIRED',
63
+ DUPLICATE_KEY = 'DUPLICATE_KEY',
64
+ WRITE_ERROR = 'WRITE_ERROR',
65
+ WRITE_CONFLICT = 'WRITE_CONFLICT',
66
+ CURSOR_SORT_MISMATCH = 'CURSOR_SORT_MISMATCH',
67
+ JUMP_TOO_FAR = 'JUMP_TOO_FAR',
68
+ STREAM_NO_JUMP = 'STREAM_NO_JUMP',
69
+ STREAM_NO_TOTALS = 'STREAM_NO_TOTALS',
70
+ STREAM_NO_EXPLAIN = 'STREAM_NO_EXPLAIN',
71
+ MONGODB_ERROR = 'MONGODB_ERROR',
72
+ LOCK_ACQUIRE_FAILED = 'LOCK_ACQUIRE_FAILED',
73
+ LOCK_TIMEOUT = 'LOCK_TIMEOUT',
74
+ }
75
+
76
+ export interface MonSQLizeError extends Error {
77
+ code: string;
78
+ details?: unknown[];
79
+ cause?: Error;
80
+ }
81
+