@nestjs-cls/transactional-adapter-mongoose 1.2.1 → 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.
@@ -0,0 +1,2 @@
1
+ export * from './lib/transactional-adapter-mongoose.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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-mongoose"), exports);
17
+ __exportStar(require("./lib/transactional-adapter-mongoose.js"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -20,3 +20,4 @@ class TransactionalAdapterMongoose {
20
20
  }
21
21
  }
22
22
  exports.TransactionalAdapterMongoose = TransactionalAdapterMongoose;
23
+ //# sourceMappingURL=transactional-adapter-mongoose.js.map
@@ -0,0 +1,2 @@
1
+ export * from './lib/transactional-adapter-mongoose.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,19 @@
1
+ export class TransactionalAdapterMongoose {
2
+ constructor(options) {
3
+ this.supportsTransactionProxy = false;
4
+ this.connectionToken = options.mongooseConnectionToken;
5
+ this.defaultTxOptions = options.defaultTxOptions;
6
+ }
7
+ optionsFactory(connection) {
8
+ return {
9
+ wrapWithTransaction: async (options, fn, setTx) => {
10
+ return connection.transaction((session) => {
11
+ setTx(session);
12
+ return fn();
13
+ }, options);
14
+ },
15
+ getFallbackInstance: () => null,
16
+ };
17
+ }
18
+ }
19
+ //# sourceMappingURL=transactional-adapter-mongoose.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-mongoose",
3
- "version": "1.2.1",
3
+ "version": "2.0.0",
4
4
  "description": "A mongoose adapter for @nestjs-cls/transactional",
5
5
  "author": "papooch",
6
6
  "license": "MIT",
7
7
  "engines": {
8
- "node": ">=18"
8
+ "node": ">=22"
9
9
  },
10
10
  "publishConfig": {
11
11
  "access": "public"
@@ -31,41 +31,53 @@
31
31
  "aop",
32
32
  "mongoose"
33
33
  ],
34
- "main": "dist/src/index.js",
35
- "types": "dist/src/index.d.ts",
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/src/**/!(*.spec).d.ts",
38
- "dist/src/**/!(*.spec).js"
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
- "prebuild": "rimraf dist",
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": "^3.3.0",
61
+ "@nestjs-cls/transactional": "^4.0.0",
50
62
  "mongoose": ">= 8",
51
- "nestjs-cls": "^6.3.0"
63
+ "nestjs-cls": "^7.0.0"
52
64
  },
53
65
  "devDependencies": {
54
- "@nestjs/cli": "^12.0.0",
55
- "@nestjs/common": "^12.0.0",
56
- "@nestjs/core": "^12.0.0",
57
- "@nestjs/testing": "^12.0.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.19.7",
60
- "jest": "^30.2.0",
71
+ "@types/node": "^22.20.4",
72
+ "jest": "~30.4.2",
61
73
  "mongodb-memory-server": "^11.2.0",
62
- "mongoose": "^9.1.4",
74
+ "mongoose": "^9.10.1",
63
75
  "reflect-metadata": "^0.2.2",
64
- "rimraf": "^6.1.2",
76
+ "rimraf": "^6.1.3",
65
77
  "rxjs": "^7.8.2",
66
- "sqlite3": "^5.1.7",
67
- "ts-jest": "^29.4.6",
68
- "ts-loader": "^9.5.4",
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"
@@ -1,2 +0,0 @@
1
- export * from './lib/transactional-adapter-mongoose';
2
- //# sourceMappingURL=index.d.ts.map