@nathapp/nestjs-notify-prisma 1.0.0 → 1.1.1
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/README.md +9 -3
- package/package.json +6 -6
- package/AGENTS.md +0 -56
- package/CLAUDE.md +0 -54
- package/GEMINI.md +0 -54
- package/codex.md +0 -54
package/README.md
CHANGED
|
@@ -37,13 +37,18 @@ depends on it.
|
|
|
37
37
|
|
|
38
38
|
```ts
|
|
39
39
|
import { Module } from '@nestjs/common';
|
|
40
|
-
import {
|
|
40
|
+
import { PrismaPg } from '@prisma/adapter-pg'; // MySQL: PrismaMariaDb from '@prisma/adapter-mariadb' (host/port/user/password/database, no connectionString)
|
|
41
|
+
import { PrismaClient } from './generated/prisma/client'; // your generator `output`
|
|
41
42
|
import { PrismaModule } from '@nathapp/nestjs-prisma';
|
|
42
43
|
import { NotifyPrismaModule } from '@nathapp/nestjs-notify-prisma';
|
|
43
44
|
|
|
44
45
|
@Module({
|
|
45
46
|
imports: [
|
|
46
|
-
PrismaModule.forRoot({
|
|
47
|
+
PrismaModule.forRoot({
|
|
48
|
+
client: PrismaClient,
|
|
49
|
+
clientOptions: { adapter: new PrismaPg({ connectionString: process.env.DATABASE_URL! }) },
|
|
50
|
+
transaction: true,
|
|
51
|
+
}),
|
|
47
52
|
NotifyPrismaModule.register(),
|
|
48
53
|
],
|
|
49
54
|
})
|
|
@@ -91,7 +96,8 @@ which is exported from this package if you need to name the type.
|
|
|
91
96
|
|
|
92
97
|
## Transactions
|
|
93
98
|
|
|
94
|
-
Multi-write flows need `PrismaModule.forRoot({ client: PrismaClient, transaction: true })
|
|
99
|
+
Multi-write flows need `PrismaModule.forRoot({ client: PrismaClient, transaction: true })`
|
|
100
|
+
with `PrismaClient` imported from your generated client (Prisma 7 `prisma-client` generator).
|
|
95
101
|
Every repository resolves its client per operation from the `TRANSACTION_MANAGER`
|
|
96
102
|
token, and the two `PrismaModule` registration paths fail differently when
|
|
97
103
|
`transaction` is omitted:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nathapp/nestjs-notify-prisma",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Prisma adapter for @nathapp/nestjs-notify",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "rimraf dist && tsc -p tsconfig.json",
|
|
@@ -24,18 +24,18 @@
|
|
|
24
24
|
"lib": "lib"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@nathapp/nestjs-notify": "1.
|
|
28
|
-
"@nathapp/nestjs-data": "^3.3.0 || ^4.0.
|
|
27
|
+
"@nathapp/nestjs-notify": "1.1.0",
|
|
28
|
+
"@nathapp/nestjs-data": "^3.3.0 || ^4.0.3"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@nathapp/nestjs-prisma": "^4.0
|
|
31
|
+
"@nathapp/nestjs-prisma": "^4.1.0",
|
|
32
32
|
"eslint": "^8.57.0",
|
|
33
33
|
"typescript": "^5"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@nestjs/common": "^11.0.0 || ^12.1.0",
|
|
37
37
|
"@nestjs/core": "^11.0.0 || ^12.1.0",
|
|
38
|
-
"@nathapp/nestjs-prisma": "^
|
|
39
|
-
"@prisma/client": "^
|
|
38
|
+
"@nathapp/nestjs-prisma": "^4.1.0",
|
|
39
|
+
"@prisma/client": "^7.0.0"
|
|
40
40
|
}
|
|
41
41
|
}
|
package/AGENTS.md
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# Agent Instructions
|
|
2
|
-
|
|
3
|
-
This file is auto-generated from `.nax/context.md`.
|
|
4
|
-
DO NOT EDIT MANUALLY — run `nax generate` to regenerate.
|
|
5
|
-
|
|
6
|
-
These instructions apply to all AI coding agents in this project.
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## Project Metadata
|
|
11
|
-
|
|
12
|
-
> Auto-injected by `nax generate`
|
|
13
|
-
|
|
14
|
-
**Project:** `@nathapp/nestjs-notify-prisma`
|
|
15
|
-
|
|
16
|
-
**Language:** TypeScript
|
|
17
|
-
|
|
18
|
-
**Key dependencies:** @nathapp/nestjs-prisma, typescript
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
# CLAUDE.md — @nathapp/nestjs-notify-prisma
|
|
22
|
-
|
|
23
|
-
Prisma adapter for `@nathapp/nestjs-notify`. Implements all repository interfaces using `@prisma/client`.
|
|
24
|
-
|
|
25
|
-
## Status: ✅ Complete
|
|
26
|
-
|
|
27
|
-
## What Is Implemented
|
|
28
|
-
|
|
29
|
-
3 repository classes: `PrismaTemplateRepository`, `PrismaPreferenceRepository`, `PrismaDeliveryLogRepository` — each extending `AbstractPrismaRepository` from `@nathapp/nestjs-data` and implementing its corresponding interface from `@nathapp/nestjs-notify`.
|
|
30
|
-
|
|
31
|
-
`NotifyPrismaModule` registers all three repositories with their DI tokens.
|
|
32
|
-
|
|
33
|
-
## Module Wiring (ADR-004)
|
|
34
|
-
|
|
35
|
-
`NotifyPrismaModule.register()` takes **no arguments**. The consumer is responsible for providing:
|
|
36
|
-
|
|
37
|
-
```typescript
|
|
38
|
-
PrismaModule.forRoot({ transaction: true })
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
This supplies `PRISMA_CLIENT` (via `@nathapp/nestjs-prisma`) and `TRANSACTION_MANAGER` (via `@nathapp/nestjs-data`) to all repositories. `NotifyPrismaModule` does **not** re-declare `PRISMA_CLIENT` — it is inherited from the consumer's `PrismaModule`.
|
|
42
|
-
|
|
43
|
-
## Repository Pattern
|
|
44
|
-
|
|
45
|
-
All three repos extend `AbstractPrismaRepository<Domain, any, string>`:
|
|
46
|
-
|
|
47
|
-
- `AbstractPrismaRepository` provides `create`, `findById`, `update`, `delete` via the tx-aware `this.model` delegate
|
|
48
|
-
- Each repo implements domain-specific finders (`findByRecipient`, `findByUserAndChannel`, `findTemplate`, etc.)
|
|
49
|
-
- Tenant scoping is done **explicitly in custom finders** — `findById`/`update`/`delete` are unscoped at the repo level; the template tenant-guard lives in `DefaultTemplateService`
|
|
50
|
-
|
|
51
|
-
## Dependencies
|
|
52
|
-
|
|
53
|
-
- `@nathapp/nestjs-notify` (workspace)
|
|
54
|
-
- `@nathapp/nestjs-data` (workspace) — `AbstractPrismaRepository`, `TRANSACTION_MANAGER`
|
|
55
|
-
- `@nathapp/nestjs-prisma` ^3.0.0 (peer) — `PrismaModule`, `PRISMA_CLIENT`
|
|
56
|
-
- `@prisma/client` ^6.0.0 (peer)
|
package/CLAUDE.md
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
# Project Context
|
|
2
|
-
|
|
3
|
-
This file is auto-generated from `.nax/context.md`.
|
|
4
|
-
DO NOT EDIT MANUALLY — run `nax generate` to regenerate.
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Project Metadata
|
|
9
|
-
|
|
10
|
-
> Auto-injected by `nax generate`
|
|
11
|
-
|
|
12
|
-
**Project:** `@nathapp/nestjs-notify-prisma`
|
|
13
|
-
|
|
14
|
-
**Language:** TypeScript
|
|
15
|
-
|
|
16
|
-
**Key dependencies:** @nathapp/nestjs-prisma, typescript
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
# CLAUDE.md — @nathapp/nestjs-notify-prisma
|
|
20
|
-
|
|
21
|
-
Prisma adapter for `@nathapp/nestjs-notify`. Implements all repository interfaces using `@prisma/client`.
|
|
22
|
-
|
|
23
|
-
## Status: ✅ Complete
|
|
24
|
-
|
|
25
|
-
## What Is Implemented
|
|
26
|
-
|
|
27
|
-
3 repository classes: `PrismaTemplateRepository`, `PrismaPreferenceRepository`, `PrismaDeliveryLogRepository` — each extending `AbstractPrismaRepository` from `@nathapp/nestjs-data` and implementing its corresponding interface from `@nathapp/nestjs-notify`.
|
|
28
|
-
|
|
29
|
-
`NotifyPrismaModule` registers all three repositories with their DI tokens.
|
|
30
|
-
|
|
31
|
-
## Module Wiring (ADR-004)
|
|
32
|
-
|
|
33
|
-
`NotifyPrismaModule.register()` takes **no arguments**. The consumer is responsible for providing:
|
|
34
|
-
|
|
35
|
-
```typescript
|
|
36
|
-
PrismaModule.forRoot({ transaction: true })
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
This supplies `PRISMA_CLIENT` (via `@nathapp/nestjs-prisma`) and `TRANSACTION_MANAGER` (via `@nathapp/nestjs-data`) to all repositories. `NotifyPrismaModule` does **not** re-declare `PRISMA_CLIENT` — it is inherited from the consumer's `PrismaModule`.
|
|
40
|
-
|
|
41
|
-
## Repository Pattern
|
|
42
|
-
|
|
43
|
-
All three repos extend `AbstractPrismaRepository<Domain, any, string>`:
|
|
44
|
-
|
|
45
|
-
- `AbstractPrismaRepository` provides `create`, `findById`, `update`, `delete` via the tx-aware `this.model` delegate
|
|
46
|
-
- Each repo implements domain-specific finders (`findByRecipient`, `findByUserAndChannel`, `findTemplate`, etc.)
|
|
47
|
-
- Tenant scoping is done **explicitly in custom finders** — `findById`/`update`/`delete` are unscoped at the repo level; the template tenant-guard lives in `DefaultTemplateService`
|
|
48
|
-
|
|
49
|
-
## Dependencies
|
|
50
|
-
|
|
51
|
-
- `@nathapp/nestjs-notify` (workspace)
|
|
52
|
-
- `@nathapp/nestjs-data` (workspace) — `AbstractPrismaRepository`, `TRANSACTION_MANAGER`
|
|
53
|
-
- `@nathapp/nestjs-prisma` ^3.0.0 (peer) — `PrismaModule`, `PRISMA_CLIENT`
|
|
54
|
-
- `@prisma/client` ^6.0.0 (peer)
|
package/GEMINI.md
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
# Gemini CLI Context
|
|
2
|
-
|
|
3
|
-
This file is auto-generated from `.nax/context.md`.
|
|
4
|
-
DO NOT EDIT MANUALLY — run `nax generate` to regenerate.
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Project Metadata
|
|
9
|
-
|
|
10
|
-
> Auto-injected by `nax generate`
|
|
11
|
-
|
|
12
|
-
**Project:** `@nathapp/nestjs-notify-prisma`
|
|
13
|
-
|
|
14
|
-
**Language:** TypeScript
|
|
15
|
-
|
|
16
|
-
**Key dependencies:** @nathapp/nestjs-prisma, typescript
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
# CLAUDE.md — @nathapp/nestjs-notify-prisma
|
|
20
|
-
|
|
21
|
-
Prisma adapter for `@nathapp/nestjs-notify`. Implements all repository interfaces using `@prisma/client`.
|
|
22
|
-
|
|
23
|
-
## Status: ✅ Complete
|
|
24
|
-
|
|
25
|
-
## What Is Implemented
|
|
26
|
-
|
|
27
|
-
3 repository classes: `PrismaTemplateRepository`, `PrismaPreferenceRepository`, `PrismaDeliveryLogRepository` — each extending `AbstractPrismaRepository` from `@nathapp/nestjs-data` and implementing its corresponding interface from `@nathapp/nestjs-notify`.
|
|
28
|
-
|
|
29
|
-
`NotifyPrismaModule` registers all three repositories with their DI tokens.
|
|
30
|
-
|
|
31
|
-
## Module Wiring (ADR-004)
|
|
32
|
-
|
|
33
|
-
`NotifyPrismaModule.register()` takes **no arguments**. The consumer is responsible for providing:
|
|
34
|
-
|
|
35
|
-
```typescript
|
|
36
|
-
PrismaModule.forRoot({ transaction: true })
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
This supplies `PRISMA_CLIENT` (via `@nathapp/nestjs-prisma`) and `TRANSACTION_MANAGER` (via `@nathapp/nestjs-data`) to all repositories. `NotifyPrismaModule` does **not** re-declare `PRISMA_CLIENT` — it is inherited from the consumer's `PrismaModule`.
|
|
40
|
-
|
|
41
|
-
## Repository Pattern
|
|
42
|
-
|
|
43
|
-
All three repos extend `AbstractPrismaRepository<Domain, any, string>`:
|
|
44
|
-
|
|
45
|
-
- `AbstractPrismaRepository` provides `create`, `findById`, `update`, `delete` via the tx-aware `this.model` delegate
|
|
46
|
-
- Each repo implements domain-specific finders (`findByRecipient`, `findByUserAndChannel`, `findTemplate`, etc.)
|
|
47
|
-
- Tenant scoping is done **explicitly in custom finders** — `findById`/`update`/`delete` are unscoped at the repo level; the template tenant-guard lives in `DefaultTemplateService`
|
|
48
|
-
|
|
49
|
-
## Dependencies
|
|
50
|
-
|
|
51
|
-
- `@nathapp/nestjs-notify` (workspace)
|
|
52
|
-
- `@nathapp/nestjs-data` (workspace) — `AbstractPrismaRepository`, `TRANSACTION_MANAGER`
|
|
53
|
-
- `@nathapp/nestjs-prisma` ^3.0.0 (peer) — `PrismaModule`, `PRISMA_CLIENT`
|
|
54
|
-
- `@prisma/client` ^6.0.0 (peer)
|
package/codex.md
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
# Codex Instructions
|
|
2
|
-
|
|
3
|
-
This file is auto-generated from `.nax/context.md`.
|
|
4
|
-
DO NOT EDIT MANUALLY — run `nax generate` to regenerate.
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Project Metadata
|
|
9
|
-
|
|
10
|
-
> Auto-injected by `nax generate`
|
|
11
|
-
|
|
12
|
-
**Project:** `@nathapp/nestjs-notify-prisma`
|
|
13
|
-
|
|
14
|
-
**Language:** TypeScript
|
|
15
|
-
|
|
16
|
-
**Key dependencies:** @nathapp/nestjs-prisma, typescript
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
# CLAUDE.md — @nathapp/nestjs-notify-prisma
|
|
20
|
-
|
|
21
|
-
Prisma adapter for `@nathapp/nestjs-notify`. Implements all repository interfaces using `@prisma/client`.
|
|
22
|
-
|
|
23
|
-
## Status: ✅ Complete
|
|
24
|
-
|
|
25
|
-
## What Is Implemented
|
|
26
|
-
|
|
27
|
-
3 repository classes: `PrismaTemplateRepository`, `PrismaPreferenceRepository`, `PrismaDeliveryLogRepository` — each extending `AbstractPrismaRepository` from `@nathapp/nestjs-data` and implementing its corresponding interface from `@nathapp/nestjs-notify`.
|
|
28
|
-
|
|
29
|
-
`NotifyPrismaModule` registers all three repositories with their DI tokens.
|
|
30
|
-
|
|
31
|
-
## Module Wiring (ADR-004)
|
|
32
|
-
|
|
33
|
-
`NotifyPrismaModule.register()` takes **no arguments**. The consumer is responsible for providing:
|
|
34
|
-
|
|
35
|
-
```typescript
|
|
36
|
-
PrismaModule.forRoot({ transaction: true })
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
This supplies `PRISMA_CLIENT` (via `@nathapp/nestjs-prisma`) and `TRANSACTION_MANAGER` (via `@nathapp/nestjs-data`) to all repositories. `NotifyPrismaModule` does **not** re-declare `PRISMA_CLIENT` — it is inherited from the consumer's `PrismaModule`.
|
|
40
|
-
|
|
41
|
-
## Repository Pattern
|
|
42
|
-
|
|
43
|
-
All three repos extend `AbstractPrismaRepository<Domain, any, string>`:
|
|
44
|
-
|
|
45
|
-
- `AbstractPrismaRepository` provides `create`, `findById`, `update`, `delete` via the tx-aware `this.model` delegate
|
|
46
|
-
- Each repo implements domain-specific finders (`findByRecipient`, `findByUserAndChannel`, `findTemplate`, etc.)
|
|
47
|
-
- Tenant scoping is done **explicitly in custom finders** — `findById`/`update`/`delete` are unscoped at the repo level; the template tenant-guard lives in `DefaultTemplateService`
|
|
48
|
-
|
|
49
|
-
## Dependencies
|
|
50
|
-
|
|
51
|
-
- `@nathapp/nestjs-notify` (workspace)
|
|
52
|
-
- `@nathapp/nestjs-data` (workspace) — `AbstractPrismaRepository`, `TRANSACTION_MANAGER`
|
|
53
|
-
- `@nathapp/nestjs-prisma` ^3.0.0 (peer) — `PrismaModule`, `PRISMA_CLIENT`
|
|
54
|
-
- `@prisma/client` ^6.0.0 (peer)
|