monsqlize 3.3.0 → 3.3.2
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 +5 -3
- package/MIGRATION.md +66 -5
- package/README.md +37 -9
- package/changelogs/v3.3.1.md +28 -0
- package/changelogs/v3.3.2.md +37 -0
- package/dist/cjs/cli/data-task.cjs +7 -5
- package/dist/cjs/index.cjs +5032 -3325
- package/dist/cjs/transaction/Transaction.cjs +140 -14
- package/dist/cjs/transaction/TransactionManager.cjs +145 -25
- package/dist/esm/index.mjs +4836 -3130
- package/dist/types/base.d.mts +1 -1
- package/dist/types/base.d.ts +1 -1
- package/dist/types/collection.d.mts +10 -10
- package/dist/types/collection.d.ts +10 -10
- package/dist/types/data-tasks.d.mts +1 -0
- package/dist/types/data-tasks.d.ts +1 -0
- package/dist/types/index.d.mts +3 -1
- package/dist/types/index.d.ts +3 -1
- package/dist/types/model.d.mts +16 -12
- package/dist/types/model.d.ts +16 -12
- package/dist/types/monsqlize.d.mts +8 -2
- package/dist/types/monsqlize.d.ts +8 -2
- package/dist/types/pool.d.mts +3 -0
- package/dist/types/pool.d.ts +3 -0
- package/dist/types/runtime.d.mts +11 -23
- package/dist/types/runtime.d.ts +11 -23
- package/dist/types/slow-query-log.d.mts +9 -1
- package/dist/types/slow-query-log.d.ts +9 -1
- package/dist/types/sync.d.mts +4 -2
- package/dist/types/sync.d.ts +4 -2
- package/dist/types/transaction.d.mts +6 -4
- package/dist/types/transaction.d.ts +6 -4
- package/package.json +7 -5
|
@@ -24,9 +24,9 @@ export interface TransactionOptions {
|
|
|
24
24
|
};
|
|
25
25
|
readPreference?: 'primary' | 'primaryPreferred' | 'secondary' | 'secondaryPreferred' | 'nearest';
|
|
26
26
|
causalConsistency?: boolean;
|
|
27
|
-
/** Maximum transaction duration in milliseconds before
|
|
27
|
+
/** Maximum transaction work duration in milliseconds before commit begins. */
|
|
28
28
|
maxDuration?: number;
|
|
29
|
-
/**
|
|
29
|
+
/** Deadline for transaction work before commit begins. Alias: `maxDuration`. */
|
|
30
30
|
timeout?: number;
|
|
31
31
|
enableRetry?: boolean;
|
|
32
32
|
maxRetries?: number;
|
|
@@ -90,16 +90,18 @@ export declare class Transaction {
|
|
|
90
90
|
cache?: CacheLike | null;
|
|
91
91
|
logger?: LoggerLike | null;
|
|
92
92
|
lockManager?: CacheLockManager | null;
|
|
93
|
+
/** Work deadline in milliseconds; the timer stops before commit is dispatched. */
|
|
93
94
|
timeout?: number;
|
|
95
|
+
/** MongoDB transaction options, including driver commit limits such as `maxCommitTimeMS`. */
|
|
94
96
|
transactionOptions?: Record<string, unknown>;
|
|
95
97
|
});
|
|
96
98
|
/** Begin the transaction (starts the MongoDB session transaction). */
|
|
97
99
|
start(): Promise<void>;
|
|
98
|
-
/** Commit the transaction;
|
|
100
|
+
/** Commit the transaction; flushes cache invalidations on success or an unknown commit result. */
|
|
99
101
|
commit(): Promise<void>;
|
|
100
102
|
/** Abort the transaction and discard pending cache invalidations. */
|
|
101
103
|
abort(): Promise<void>;
|
|
102
|
-
/**
|
|
104
|
+
/** End the session after pending lifecycle work; aborts an active transaction with a known outcome. */
|
|
103
105
|
end(): Promise<void>;
|
|
104
106
|
/** Record a cache-invalidation pattern to be replayed on commit. */
|
|
105
107
|
recordInvalidation(pattern: string): Promise<void>;
|
|
@@ -24,9 +24,9 @@ export interface TransactionOptions {
|
|
|
24
24
|
};
|
|
25
25
|
readPreference?: 'primary' | 'primaryPreferred' | 'secondary' | 'secondaryPreferred' | 'nearest';
|
|
26
26
|
causalConsistency?: boolean;
|
|
27
|
-
/** Maximum transaction duration in milliseconds before
|
|
27
|
+
/** Maximum transaction work duration in milliseconds before commit begins. */
|
|
28
28
|
maxDuration?: number;
|
|
29
|
-
/**
|
|
29
|
+
/** Deadline for transaction work before commit begins. Alias: `maxDuration`. */
|
|
30
30
|
timeout?: number;
|
|
31
31
|
enableRetry?: boolean;
|
|
32
32
|
maxRetries?: number;
|
|
@@ -90,16 +90,18 @@ export declare class Transaction {
|
|
|
90
90
|
cache?: CacheLike | null;
|
|
91
91
|
logger?: LoggerLike | null;
|
|
92
92
|
lockManager?: CacheLockManager | null;
|
|
93
|
+
/** Work deadline in milliseconds; the timer stops before commit is dispatched. */
|
|
93
94
|
timeout?: number;
|
|
95
|
+
/** MongoDB transaction options, including driver commit limits such as `maxCommitTimeMS`. */
|
|
94
96
|
transactionOptions?: Record<string, unknown>;
|
|
95
97
|
});
|
|
96
98
|
/** Begin the transaction (starts the MongoDB session transaction). */
|
|
97
99
|
start(): Promise<void>;
|
|
98
|
-
/** Commit the transaction;
|
|
100
|
+
/** Commit the transaction; flushes cache invalidations on success or an unknown commit result. */
|
|
99
101
|
commit(): Promise<void>;
|
|
100
102
|
/** Abort the transaction and discard pending cache invalidations. */
|
|
101
103
|
abort(): Promise<void>;
|
|
102
|
-
/**
|
|
104
|
+
/** End the session after pending lifecycle work; aborts an active transaction with a known outcome. */
|
|
103
105
|
end(): Promise<void>;
|
|
104
106
|
/** Record a cache-invalidation pattern to be replayed on commit. */
|
|
105
107
|
recordInvalidation(pattern: string): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "monsqlize",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.2",
|
|
4
4
|
"description": "TypeScript production data runtime layer for MongoDB today, with cache, transactions, pools, models, sync, and observability",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./dist/cjs/index.cjs",
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
"./package.json": "./package.json"
|
|
22
22
|
},
|
|
23
23
|
"files": [
|
|
24
|
+
"changelogs/v3.3.2.md",
|
|
25
|
+
"changelogs/v3.3.1.md",
|
|
24
26
|
"changelogs/v3.3.0.md",
|
|
25
27
|
"changelogs/v3.2.0.md",
|
|
26
28
|
"changelogs/v3.1.14.md",
|
|
@@ -111,8 +113,8 @@
|
|
|
111
113
|
"check:sizes:strict": "node scripts/check-file-sizes.cjs --strict",
|
|
112
114
|
"build": "node scripts/build-p1.cjs",
|
|
113
115
|
"build:tests": "node scripts/compile-tests.cjs",
|
|
114
|
-
"lint": "eslint .
|
|
115
|
-
"lint:fix": "eslint . --fix
|
|
116
|
+
"lint": "eslint .",
|
|
117
|
+
"lint:fix": "eslint . --fix",
|
|
116
118
|
"test:runtime": "npm run build && npm run build:tests && node --test .generated/test-dist/test/smoke/root-cjs.test.js .generated/test-dist/test/smoke/root-esm.test.js .generated/test-dist/test/smoke/pack-artifacts.test.js",
|
|
117
119
|
"test:compatibility": "npm run build && npm run build:tests && node --test .generated/test-dist/test/compatibility/exports/exports.test.js .generated/test-dist/test/compatibility/matrix.test.js",
|
|
118
120
|
"probe:server-matrix": "node scripts/validation/probe-memory-server-matrix.cjs",
|
|
@@ -121,7 +123,7 @@
|
|
|
121
123
|
"test:examples": "npm run build && tsc -p tsconfig.examples.json && node scripts/run-examples.cjs",
|
|
122
124
|
"test:performance": "npm run build && npm run build:tests && node .generated/test-dist/test/performance/baselines/function-cache.benchmark.js",
|
|
123
125
|
"test:unit": "npm run build && npm run build:tests && node test/run-tests.cjs unit",
|
|
124
|
-
"test:integration": "npm run build && npm run build:tests && node --test --test-concurrency=1 .generated/test-dist/test/integration/cache/cache.test.js .generated/test-dist/test/integration/cache/cache-behavior.test.js .generated/test-dist/test/integration/mongodb/connect.test.js .generated/test-dist/test/integration/mongodb/queries.test.js .generated/test-dist/test/integration/mongodb/management.test.js .generated/test-dist/test/integration/mongodb/writes-batch.test.js .generated/test-dist/test/integration/mongodb/find.test.js .generated/test-dist/test/integration/mongodb/find-one.test.js .generated/test-dist/test/integration/mongodb/find-page.test.js .generated/test-dist/test/integration/mongodb/aggregate.test.js .generated/test-dist/test/integration/mongodb/chaining.test.js .generated/test-dist/test/integration/mongodb/insert.test.js .generated/test-dist/test/integration/mongodb/update.test.js .generated/test-dist/test/integration/mongodb/delete.test.js .generated/test-dist/test/integration/mongodb/update-pipeline.test.js .generated/test-dist/test/integration/model/model-features.test.js .generated/test-dist/test/integration/transaction/transaction.test.js .generated/test-dist/test/integration/pool/pool.test.js .generated/test-dist/test/integration/pool/pool-behavior.test.js .generated/test-dist/test/integration/watch/watch-native.test.js .generated/test-dist/test/integration/runtime/runtime-core-regression.test.js .generated/test-dist/test/integration/sync/sync.test.js .generated/test-dist/test/integration/slow-query-log/slow-query-log.test.js .generated/test-dist/test/integration/model/model-crud-extended.test.js .generated/test-dist/test/integration/mongodb/management-complete.test.js .generated/test-dist/test/integration/runtime/runtime-methods-extended.test.js .generated/test-dist/test/integration/mongodb/find-page-advanced.test.js",
|
|
126
|
+
"test:integration": "npm run build && npm run build:tests && node --test --test-concurrency=1 .generated/test-dist/test/integration/cache/cache.test.js .generated/test-dist/test/integration/cache/cache-behavior.test.js .generated/test-dist/test/integration/mongodb/connect.test.js .generated/test-dist/test/integration/mongodb/queries.test.js .generated/test-dist/test/integration/mongodb/management.test.js .generated/test-dist/test/integration/mongodb/writes-batch.test.js .generated/test-dist/test/integration/mongodb/find.test.js .generated/test-dist/test/integration/mongodb/find-one.test.js .generated/test-dist/test/integration/mongodb/find-page.test.js .generated/test-dist/test/integration/mongodb/aggregate.test.js .generated/test-dist/test/integration/mongodb/chaining.test.js .generated/test-dist/test/integration/mongodb/insert.test.js .generated/test-dist/test/integration/mongodb/update.test.js .generated/test-dist/test/integration/mongodb/delete.test.js .generated/test-dist/test/integration/mongodb/update-pipeline.test.js .generated/test-dist/test/integration/model/model-features.test.js .generated/test-dist/test/integration/transaction/transaction.test.js .generated/test-dist/test/integration/pool/pool.test.js .generated/test-dist/test/integration/pool/pool-behavior.test.js .generated/test-dist/test/integration/watch/watch-native.test.js .generated/test-dist/test/integration/runtime/runtime-core-regression.test.js .generated/test-dist/test/integration/runtime/review-regressions.test.js .generated/test-dist/test/integration/sync/sync.test.js .generated/test-dist/test/integration/slow-query-log/slow-query-log.test.js .generated/test-dist/test/integration/model/model-crud-extended.test.js .generated/test-dist/test/integration/mongodb/management-complete.test.js .generated/test-dist/test/integration/runtime/runtime-methods-extended.test.js .generated/test-dist/test/integration/mongodb/find-page-advanced.test.js .generated/test-dist/test/integration/mongodb/review-repair-regressions.test.js .generated/test-dist/test/integration/model/review-model-regressions.test.js .generated/test-dist/test/integration/slow-query-log/review-storage-regressions.test.js",
|
|
125
127
|
"test:data-tasks:integration": "npm run build && npm run build:tests && node test/run-tests.cjs data-tasks-integration",
|
|
126
128
|
"test:data-task-cli": "npm run build && npm run build:tests && node test/run-tests.cjs data-task-cli",
|
|
127
129
|
"test:pack-install": "npm run build && node scripts/pack-install-smoke.cjs",
|
|
@@ -165,7 +167,7 @@
|
|
|
165
167
|
"ssh2": "1.17.0"
|
|
166
168
|
},
|
|
167
169
|
"overrides": {
|
|
168
|
-
"fast-uri": "3.1.
|
|
170
|
+
"fast-uri": "^3.1.8",
|
|
169
171
|
"minimatch@3.1.5": {
|
|
170
172
|
"brace-expansion": "1.1.18"
|
|
171
173
|
},
|