@nestjs-cls/transactional-adapter-mongodb 1.2.0 → 2.0.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/dist/cjs/index.d.ts +2 -0
- package/dist/{src → cjs}/index.js +2 -1
- package/dist/{src → cjs}/lib/transactional-adapter-mongodb.js +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/lib/transactional-adapter-mongodb.js +20 -0
- package/dist/esm/package.json +1 -0
- package/package.json +34 -22
- package/dist/src/index.d.ts +0 -2
- /package/dist/{src → cjs}/lib/transactional-adapter-mongodb.d.ts +0 -0
|
@@ -14,4 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./lib/transactional-adapter-mongodb"), exports);
|
|
17
|
+
__exportStar(require("./lib/transactional-adapter-mongodb.js"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export class TransactionalAdapterMongoDB {
|
|
2
|
+
constructor(options) {
|
|
3
|
+
/** cannot proxy an `undefined` value */
|
|
4
|
+
this.supportsTransactionProxy = false;
|
|
5
|
+
this.connectionToken = options.mongoClientToken;
|
|
6
|
+
this.defaultTxOptions = options.defaultTxOptions;
|
|
7
|
+
}
|
|
8
|
+
optionsFactory(mongoClient) {
|
|
9
|
+
return {
|
|
10
|
+
wrapWithTransaction: async (options, fn, setTx) => {
|
|
11
|
+
return mongoClient.withSession(options.sessionOptions ?? {}, async (session) => session.withTransaction(() => {
|
|
12
|
+
setTx(session);
|
|
13
|
+
return fn();
|
|
14
|
+
}, options));
|
|
15
|
+
},
|
|
16
|
+
getFallbackInstance: () => undefined,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=transactional-adapter-mongodb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs-cls/transactional-adapter-mongodb",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "A mongodb adapter for @nestjs-cls/transactional",
|
|
5
5
|
"author": "papooch",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"engines": {
|
|
8
|
-
"node": ">=
|
|
8
|
+
"node": ">=22"
|
|
9
9
|
},
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
@@ -31,41 +31,53 @@
|
|
|
31
31
|
"aop",
|
|
32
32
|
"mongodb"
|
|
33
33
|
],
|
|
34
|
-
"main": "dist/
|
|
35
|
-
"
|
|
34
|
+
"main": "dist/cjs/index.js",
|
|
35
|
+
"module": "dist/esm/index.js",
|
|
36
|
+
"types": "dist/cjs/index.d.ts",
|
|
37
|
+
"exports": {
|
|
38
|
+
".": {
|
|
39
|
+
"types": "./dist/cjs/index.d.ts",
|
|
40
|
+
"import": "./dist/esm/index.js",
|
|
41
|
+
"require": "./dist/cjs/index.js"
|
|
42
|
+
},
|
|
43
|
+
"./package.json": "./package.json"
|
|
44
|
+
},
|
|
36
45
|
"files": [
|
|
37
|
-
"dist/
|
|
38
|
-
"dist/
|
|
46
|
+
"dist/cjs/**/*.js",
|
|
47
|
+
"dist/cjs/**/*.d.ts",
|
|
48
|
+
"dist/esm/**/*.js",
|
|
49
|
+
"dist/esm/package.json"
|
|
39
50
|
],
|
|
40
51
|
"scripts": {
|
|
41
52
|
"prepack": "cp ../../../LICENSE ./LICENSE",
|
|
42
|
-
"
|
|
43
|
-
"build": "tsc -p tsconfig.build.json",
|
|
53
|
+
"build": "rimraf dist && tsc -p tsconfig.build.json",
|
|
54
|
+
"build:esm": "tsc -p tsconfig.build.esm.json && echo '{\"type\":\"module\"}' > dist/esm/package.json",
|
|
55
|
+
"build:release": "yarn build && yarn build:esm",
|
|
44
56
|
"test": "NODE_OPTIONS=\"${NODE_OPTIONS:-} --experimental-vm-modules\" jest",
|
|
45
57
|
"test:watch": "NODE_OPTIONS=\"${NODE_OPTIONS:-} --experimental-vm-modules\" jest --watch",
|
|
46
58
|
"test:cov": "NODE_OPTIONS=\"${NODE_OPTIONS:-} --experimental-vm-modules\" jest --coverage"
|
|
47
59
|
},
|
|
48
60
|
"peerDependencies": {
|
|
49
|
-
"@nestjs-cls/transactional": "^
|
|
61
|
+
"@nestjs-cls/transactional": "^4.0.0",
|
|
50
62
|
"mongodb": ">= 6",
|
|
51
|
-
"nestjs-cls": "^
|
|
63
|
+
"nestjs-cls": "^7.0.0"
|
|
52
64
|
},
|
|
53
65
|
"devDependencies": {
|
|
54
|
-
"@nestjs/cli": "^12.0.
|
|
55
|
-
"@nestjs/common": "^12.0.
|
|
56
|
-
"@nestjs/core": "^12.0.
|
|
57
|
-
"@nestjs/testing": "^12.0.
|
|
66
|
+
"@nestjs/cli": "^12.0.3",
|
|
67
|
+
"@nestjs/common": "^12.0.3",
|
|
68
|
+
"@nestjs/core": "^12.0.3",
|
|
69
|
+
"@nestjs/testing": "^12.0.3",
|
|
58
70
|
"@types/jest": "^30.0.0",
|
|
59
|
-
"@types/node": "^22.
|
|
60
|
-
"jest": "
|
|
61
|
-
"mongodb": "^7.
|
|
62
|
-
"mongodb-memory-server": "^11.0
|
|
71
|
+
"@types/node": "^22.20.4",
|
|
72
|
+
"jest": "~30.4.2",
|
|
73
|
+
"mongodb": "^7.6.0",
|
|
74
|
+
"mongodb-memory-server": "^11.2.0",
|
|
63
75
|
"reflect-metadata": "^0.2.2",
|
|
64
|
-
"rimraf": "^6.1.
|
|
76
|
+
"rimraf": "^6.1.3",
|
|
65
77
|
"rxjs": "^7.8.2",
|
|
66
|
-
"sqlite3": "^
|
|
67
|
-
"ts-jest": "^29.4.
|
|
68
|
-
"ts-loader": "^9.
|
|
78
|
+
"sqlite3": "^6.0.1",
|
|
79
|
+
"ts-jest": "^29.4.12",
|
|
80
|
+
"ts-loader": "^9.6.2",
|
|
69
81
|
"ts-node": "^10.9.2",
|
|
70
82
|
"tsconfig-paths": "^4.2.0",
|
|
71
83
|
"typescript": "5.9.3"
|
package/dist/src/index.d.ts
DELETED
|
File without changes
|