@nathapp/nestjs-data 3.0.3 → 3.2.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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +74 -0
- package/dist/constant/tokens.js +1 -1
- package/dist/constant/tokens.js.map +1 -1
- package/lib/constant/tokens.ts +33 -1
- package/package.json +5 -5
package/.turbo/turbo-build.log
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,79 @@
|
|
|
1
1
|
# @nathapp/nestjs-data
|
|
2
2
|
|
|
3
|
+
## 3.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 1876b9a: ### nestjs-auth
|
|
8
|
+
|
|
9
|
+
- Add JWKS support via `JwksJwtStrategyProvider` and `createJwksStrategyProvider` factory — enables remote key resolution through `jwks-rsa` (optional peer dep)
|
|
10
|
+
- Add `validateJwksOptions` security guard and `JwksOptions` interface
|
|
11
|
+
- Export `JwksJwtStrategyProvider` and `JwksOptions` from the public API
|
|
12
|
+
- Fix permission guard and JWT module immutability issues from code review
|
|
13
|
+
|
|
14
|
+
### nestjs-typeorm
|
|
15
|
+
|
|
16
|
+
- Add `AbstractTypeOrmRepository<TDomain, TEntity, TId>` — portable `IRepository` implementation decoupled from TypeORM internals
|
|
17
|
+
- Add `TYPEORM_TRANSACTION_ALS` DI token and publish it from `forRoot`/`forRootAsync`
|
|
18
|
+
- `forCustomRepository` now instantiates `AbstractTypeOrmRepository` subclasses with the correct per-DataSource tx manager token
|
|
19
|
+
- Add `getTypeOrmTransactionManagerToken(name?)` helper for multi-DataSource wiring
|
|
20
|
+
- Named DataSource tx tokens no longer collide; default DataSource still aliases the global `TRANSACTION_MANAGER` symbol
|
|
21
|
+
|
|
22
|
+
### nestjs-prisma
|
|
23
|
+
|
|
24
|
+
- Add `getPrismaTransactionManagerToken(name?)` helper for multi-DataSource wiring
|
|
25
|
+
- `forRoot` / `forRootAsync` register named tx manager token + default-only guard to prevent collision
|
|
26
|
+
|
|
27
|
+
### nestjs-data
|
|
28
|
+
|
|
29
|
+
- Add `IRepository<TDomain, TId>` portable repository contract
|
|
30
|
+
- Fix missing `@nathapp/nestjs-common` peer dep for turborepo build resolution
|
|
31
|
+
|
|
32
|
+
### nestjs-common
|
|
33
|
+
|
|
34
|
+
- Add `request-ip` utility for extracting client IP across Express and Fastify adapters
|
|
35
|
+
|
|
36
|
+
### nestjs-cache
|
|
37
|
+
|
|
38
|
+
- Fix cache interceptor, cache manager, and cache tag registry immutability and type issues
|
|
39
|
+
|
|
40
|
+
### nestjs-app
|
|
41
|
+
|
|
42
|
+
- Fix `nathapp.ts` and `app-factory.ts` code review findings (immutability, error handling)
|
|
43
|
+
|
|
44
|
+
### nestjs-queue
|
|
45
|
+
|
|
46
|
+
- Upgrade `uuid` dependency from `^9.0.0` to `^11.1.1` (security)
|
|
47
|
+
- Fix BullMQ health check to use `IRedisClient.info()` (aligned with BullMQ interface)
|
|
48
|
+
|
|
49
|
+
### nestjs-notification
|
|
50
|
+
|
|
51
|
+
- Upgrade `nodemailer` dev dep from `^7` to `^8` — resolves SMTP command injection CVEs (GHSA-c7w3-x93f-qmm8, GHSA-vvjj-xcjg-gr5g)
|
|
52
|
+
|
|
53
|
+
### nestjs-storage
|
|
54
|
+
|
|
55
|
+
- Fix code review findings (immutability, validation)
|
|
56
|
+
|
|
57
|
+
### nestjs-throttler
|
|
58
|
+
|
|
59
|
+
- Fix code review findings
|
|
60
|
+
|
|
61
|
+
### All packages
|
|
62
|
+
|
|
63
|
+
- Upgrade AJV to v8 (removes root override that broke `@fastify/ajv-compiler`)
|
|
64
|
+
- Align all package versions to 3.1.3 as baseline for this minor release
|
|
65
|
+
|
|
66
|
+
### Patch Changes
|
|
67
|
+
|
|
68
|
+
- Updated dependencies [1876b9a]
|
|
69
|
+
- @nathapp/nestjs-common@3.2.0
|
|
70
|
+
|
|
71
|
+
## 3.0.4
|
|
72
|
+
|
|
73
|
+
### Patch Changes
|
|
74
|
+
|
|
75
|
+
- a48beb2: transaction manager symbol bug fix
|
|
76
|
+
|
|
3
77
|
## 3.0.3
|
|
4
78
|
|
|
5
79
|
### Patch Changes
|
package/dist/constant/tokens.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TRANSACTION_MANAGER = void 0;
|
|
4
|
-
exports.TRANSACTION_MANAGER = Symbol('TRANSACTION_MANAGER');
|
|
4
|
+
exports.TRANSACTION_MANAGER = Symbol.for('TRANSACTION_MANAGER');
|
|
5
5
|
//# sourceMappingURL=tokens.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../lib/constant/tokens.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../lib/constant/tokens.ts"],"names":[],"mappings":";;;AAgCa,QAAA,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC"}
|
package/lib/constant/tokens.ts
CHANGED
|
@@ -1 +1,33 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Global DI token for ITransactionManager.
|
|
3
|
+
*
|
|
4
|
+
* Uses Symbol.for (not Symbol) so the token is identical across all
|
|
5
|
+
* JavaScript realms, bundles, and duplicate package installations.
|
|
6
|
+
* This prevents UnknownDependenciesException when the consuming app
|
|
7
|
+
* and @nathapp/nestjs-prisma / @nathapp/nestjs-typeorm resolve
|
|
8
|
+
* @nathapp/nestjs-data from different node_modules paths or bundles.
|
|
9
|
+
*
|
|
10
|
+
* --------------------------------------------------------------------------
|
|
11
|
+
* IMPORTANT — Single-DB vs Multi-DB usage
|
|
12
|
+
* --------------------------------------------------------------------------
|
|
13
|
+
*
|
|
14
|
+
* **Single-DB apps (recommended):**
|
|
15
|
+
* @Inject(TRANSACTION_MANAGER) private readonly tx: ITransactionManager
|
|
16
|
+
*
|
|
17
|
+
* This works because the default connection registers TRANSACTION_MANAGER
|
|
18
|
+
* as an alias to the default transaction manager automatically.
|
|
19
|
+
*
|
|
20
|
+
* **Multi-DB apps (MUST use named tokens):**
|
|
21
|
+
* // CORRECT — explicit per-connection token
|
|
22
|
+
* @Inject(getPrismaTransactionManagerToken('dbA')) private readonly txA: ITransactionManager
|
|
23
|
+
* @Inject(getTypeOrmTransactionManagerToken('analytics')) private readonly txAnalytics: ITransactionManager
|
|
24
|
+
*
|
|
25
|
+
* // WRONG — TRANSACTION_MANAGER is only an alias for the DEFAULT connection.
|
|
26
|
+
* // Named connections do NOT register this global token.
|
|
27
|
+
* @Inject(TRANSACTION_MANAGER) private readonly tx: ITransactionManager // ❌ only resolves default!
|
|
28
|
+
*
|
|
29
|
+
* If you inject TRANSACTION_MANAGER in a multi-DB app, you silently get the
|
|
30
|
+
* default connection's tx manager. Writes to other databases will NOT be
|
|
31
|
+
* covered by the transaction. Use named tokens for every non-default connection.
|
|
32
|
+
*/
|
|
33
|
+
export const TRANSACTION_MANAGER = Symbol.for('TRANSACTION_MANAGER');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nathapp/nestjs-data",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "ORM-agnostic data access abstractions for NestJS",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"clean": "rimraf dist/ .turbo/",
|
|
@@ -13,17 +13,17 @@
|
|
|
13
13
|
"types": "dist/index.d.ts",
|
|
14
14
|
"main": "dist/index.js",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@nathapp/nestjs-common": "^3.
|
|
16
|
+
"@nathapp/nestjs-common": "^3.2.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
+
"@golevelup/ts-jest": "^0.6.1",
|
|
19
20
|
"@nathapp/eslint-config": "1.0.1",
|
|
20
21
|
"@nathapp/typescript-config": "1.0.1",
|
|
21
|
-
"@golevelup/ts-jest": "^0.6.1",
|
|
22
22
|
"eslint": "^8.57.0",
|
|
23
23
|
"typescript": "^5"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@nestjs
|
|
27
|
-
"@
|
|
26
|
+
"@nathapp/nestjs-common": "^3.0.0",
|
|
27
|
+
"@nestjs/common": "^10.0.0 || ^11.0.0"
|
|
28
28
|
}
|
|
29
29
|
}
|