@dismissible/nestjs-postgres-storage 0.0.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 +309 -0
- package/bin/dismissible-prisma.js +57 -0
- package/package.json +67 -0
- package/prisma/generated/prisma/client.d.ts +26 -0
- package/prisma/generated/prisma/client.js +34 -0
- package/prisma/generated/prisma/client.js.map +1 -0
- package/prisma/generated/prisma/commonInputTypes.d.ts +177 -0
- package/prisma/generated/prisma/commonInputTypes.js +12 -0
- package/prisma/generated/prisma/commonInputTypes.js.map +1 -0
- package/prisma/generated/prisma/enums.d.ts +1 -0
- package/prisma/generated/prisma/enums.js +12 -0
- package/prisma/generated/prisma/enums.js.map +1 -0
- package/prisma/generated/prisma/internal/class.d.ts +126 -0
- package/prisma/generated/prisma/internal/class.js +45 -0
- package/prisma/generated/prisma/internal/class.js.map +1 -0
- package/prisma/generated/prisma/internal/prismaNamespace.d.ts +528 -0
- package/prisma/generated/prisma/internal/prismaNamespace.js +104 -0
- package/prisma/generated/prisma/internal/prismaNamespace.js.map +1 -0
- package/prisma/generated/prisma/models/DismissibleItem.d.ts +979 -0
- package/prisma/generated/prisma/models/DismissibleItem.js +3 -0
- package/prisma/generated/prisma/models/DismissibleItem.js.map +1 -0
- package/prisma/generated/prisma/models.d.ts +2 -0
- package/prisma/generated/prisma/models.js +3 -0
- package/prisma/generated/prisma/models.js.map +1 -0
- package/prisma/migrations/20251219094936_init/migration.sql +12 -0
- package/prisma/migrations/migration_lock.toml +3 -0
- package/prisma/schema.prisma +23 -0
- package/prisma.config.mjs +33 -0
- package/src/index.d.ts +6 -0
- package/src/index.js +10 -0
- package/src/index.js.map +1 -0
- package/src/postgres-storage.adapter.d.ts +21 -0
- package/src/postgres-storage.adapter.js +81 -0
- package/src/postgres-storage.adapter.js.map +1 -0
- package/src/postgres-storage.config.d.ts +7 -0
- package/src/postgres-storage.config.js +17 -0
- package/src/postgres-storage.config.js.map +1 -0
- package/src/postgres-storage.module.d.ts +12 -0
- package/src/postgres-storage.module.js +72 -0
- package/src/postgres-storage.module.js.map +1 -0
- package/src/prisma-config.d.ts +61 -0
- package/src/prisma-config.js +65 -0
- package/src/prisma-config.js.map +1 -0
- package/src/prisma.service.d.ts +15 -0
- package/src/prisma.service.js +48 -0
- package/src/prisma.service.js.map +1 -0
- package/src/schema-path.d.ts +13 -0
- package/src/schema-path.js +20 -0
- package/src/schema-path.js.map +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
# @dismissible/nestjs-postgres-storage
|
|
2
|
+
|
|
3
|
+
PostgreSQL storage adapter for the Dismissible system using Prisma.
|
|
4
|
+
|
|
5
|
+
> **Part of the Dismissible API** - This library is part of the [Dismissible API](https://dismissible.io) ecosystem. Visit [dismissible.io](https://dismissible.io) for more information and documentation.
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
This library provides a production-ready PostgreSQL storage adapter for the Dismissible system. It uses Prisma for database access and includes:
|
|
10
|
+
|
|
11
|
+
- Persistent storage of dismissible items
|
|
12
|
+
- Automatic database migrations via Prisma
|
|
13
|
+
- Connection pooling and lifecycle management
|
|
14
|
+
- Full TypeScript support
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install @dismissible/nestjs-postgres-storage
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
You'll also need to install the peer dependencies:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install @dismissible/nestjs-storage @dismissible/nestjs-dismissible-item @dismissible/nestjs-logger prisma
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Prerequisites
|
|
29
|
+
|
|
30
|
+
- PostgreSQL database (version 12 or higher)
|
|
31
|
+
- Node.js 18 or higher
|
|
32
|
+
|
|
33
|
+
## Getting Started
|
|
34
|
+
|
|
35
|
+
### 1. Database Setup
|
|
36
|
+
|
|
37
|
+
First, set up your PostgreSQL database connection string:
|
|
38
|
+
|
|
39
|
+
```env
|
|
40
|
+
DISMISSIBLE_POSTGRES_STORAGE_CONNECTION_STRING=postgresql://user:password@localhost:5432/dismissible
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### 2. Initialize Database Schema
|
|
44
|
+
|
|
45
|
+
**CRITICAL**: You must initialize the database schema before using the storage module. The API will fail to start if the database tables don't exist.
|
|
46
|
+
|
|
47
|
+
#### Option A: Using the CLI Tool (Recommended)
|
|
48
|
+
|
|
49
|
+
The package includes a CLI helper that automatically uses the correct schema path:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# Step 1: Generate Prisma Client (required before migrations)
|
|
53
|
+
npx dismissible-prisma generate
|
|
54
|
+
|
|
55
|
+
# Step 2: Initialize the database schema
|
|
56
|
+
# For development (creates migration files):
|
|
57
|
+
npx dismissible-prisma migrate dev --name init
|
|
58
|
+
|
|
59
|
+
# For production (applies existing migrations):
|
|
60
|
+
npx dismissible-prisma migrate deploy
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
#### Option B: Using Prisma Directly
|
|
64
|
+
|
|
65
|
+
If you prefer using Prisma directly, specify the schema path:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# Generate Prisma client
|
|
69
|
+
npx prisma generate --schema=node_modules/@dismissible/nestjs-postgres-storage/prisma/schema.prisma
|
|
70
|
+
|
|
71
|
+
# For development: Create and apply migrations
|
|
72
|
+
npx prisma migrate dev --schema=node_modules/@dismissible/nestjs-postgres-storage/prisma/schema.prisma --name init
|
|
73
|
+
|
|
74
|
+
# For production: Apply existing migrations
|
|
75
|
+
npx prisma migrate deploy --schema=node_modules/@dismissible/nestjs-postgres-storage/prisma/schema.prisma
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
#### Quick Development Setup (Not for Production)
|
|
79
|
+
|
|
80
|
+
For rapid development, you can use `db push` (development only, may cause data loss):
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# Generate client
|
|
84
|
+
npx dismissible-prisma generate
|
|
85
|
+
|
|
86
|
+
# Push schema without migrations
|
|
87
|
+
npx dismissible-prisma db push
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
> **Migration Commands Explained**:
|
|
91
|
+
>
|
|
92
|
+
> - `migrate dev` - Creates migration files and applies them (use when schema changes)
|
|
93
|
+
> - `migrate deploy` - Applies existing migrations (use in production, CI/CD, or fresh database setup)
|
|
94
|
+
> - `db push` - Syncs schema without migrations (development only, not version-controlled)
|
|
95
|
+
> - `generate` - Generates Prisma Client (required before using the storage module)
|
|
96
|
+
|
|
97
|
+
### 3. Module Configuration
|
|
98
|
+
|
|
99
|
+
Import and configure the module in your NestJS application:
|
|
100
|
+
|
|
101
|
+
```typescript
|
|
102
|
+
import { Module } from '@nestjs/common';
|
|
103
|
+
import { DismissibleModule } from '@dismissible/nestjs-dismissible';
|
|
104
|
+
import { PostgresStorageModule } from '@dismissible/nestjs-postgres-storage';
|
|
105
|
+
import { LoggerModule } from '@dismissible/nestjs-logger';
|
|
106
|
+
|
|
107
|
+
@Module({
|
|
108
|
+
imports: [
|
|
109
|
+
LoggerModule.forRoot({}),
|
|
110
|
+
PostgresStorageModule.forRoot({
|
|
111
|
+
connectionString: process.env.DISMISSIBLE_POSTGRES_STORAGE_CONNECTION_STRING!,
|
|
112
|
+
}),
|
|
113
|
+
DismissibleModule.forRoot({
|
|
114
|
+
storage: PostgresStorageModule,
|
|
115
|
+
}),
|
|
116
|
+
],
|
|
117
|
+
})
|
|
118
|
+
export class AppModule {}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### 4. Async Configuration
|
|
122
|
+
|
|
123
|
+
You can also configure the module asynchronously:
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
import { Module } from '@nestjs/common';
|
|
127
|
+
import { ConfigModule, ConfigService } from '@nestjs/config';
|
|
128
|
+
import { PostgresStorageModule } from '@dismissible/nestjs-postgres-storage';
|
|
129
|
+
|
|
130
|
+
@Module({
|
|
131
|
+
imports: [
|
|
132
|
+
ConfigModule.forRoot(),
|
|
133
|
+
PostgresStorageModule.forRootAsync({
|
|
134
|
+
imports: [ConfigModule],
|
|
135
|
+
useFactory: (config: ConfigService) => ({
|
|
136
|
+
connectionString: config.get<string>('DISMISSIBLE_POSTGRES_STORAGE_CONNECTION_STRING')!,
|
|
137
|
+
}),
|
|
138
|
+
inject: [ConfigService],
|
|
139
|
+
}),
|
|
140
|
+
],
|
|
141
|
+
})
|
|
142
|
+
export class AppModule {}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Database Schema
|
|
146
|
+
|
|
147
|
+
The library uses Prisma to manage the database schema. The schema includes:
|
|
148
|
+
|
|
149
|
+
- `DismissibleItem` table with fields:
|
|
150
|
+
- `id` (String, primary key)
|
|
151
|
+
- `userId` (String, indexed)
|
|
152
|
+
- `createdAt` (DateTime)
|
|
153
|
+
- `dismissedAt` (DateTime, nullable)
|
|
154
|
+
- `metadata` (Json, nullable)
|
|
155
|
+
|
|
156
|
+
## API Reference
|
|
157
|
+
|
|
158
|
+
### PostgresStorageModule
|
|
159
|
+
|
|
160
|
+
#### `PostgresStorageModule.forRoot(options)`
|
|
161
|
+
|
|
162
|
+
Configures the PostgreSQL storage module synchronously.
|
|
163
|
+
|
|
164
|
+
**Options:**
|
|
165
|
+
|
|
166
|
+
- `connectionString: string` - PostgreSQL connection string
|
|
167
|
+
|
|
168
|
+
**Returns:** `DynamicModule`
|
|
169
|
+
|
|
170
|
+
#### `PostgresStorageModule.forRootAsync(options)`
|
|
171
|
+
|
|
172
|
+
Configures the PostgreSQL storage module asynchronously.
|
|
173
|
+
|
|
174
|
+
**Options:**
|
|
175
|
+
|
|
176
|
+
- `imports?: any[]` - Modules to import
|
|
177
|
+
- `useFactory: (deps) => PostgresStorageModuleOptions` - Factory function
|
|
178
|
+
- `inject?: any[]` - Dependencies to inject into the factory
|
|
179
|
+
|
|
180
|
+
**Returns:** `DynamicModule`
|
|
181
|
+
|
|
182
|
+
### PostgresStorageAdapter
|
|
183
|
+
|
|
184
|
+
The adapter implements `IDismissibleStorage` and provides:
|
|
185
|
+
|
|
186
|
+
- `get(userId, itemId)` - Retrieve an item
|
|
187
|
+
- `create(item)` - Create a new item
|
|
188
|
+
- `update(item)` - Update an existing item
|
|
189
|
+
|
|
190
|
+
### PrismaService
|
|
191
|
+
|
|
192
|
+
The service manages the Prisma client lifecycle:
|
|
193
|
+
|
|
194
|
+
- Automatically connects on module initialization
|
|
195
|
+
- Automatically disconnects on module destruction
|
|
196
|
+
- Uses connection pooling via `pg` adapter
|
|
197
|
+
|
|
198
|
+
## CLI Tool
|
|
199
|
+
|
|
200
|
+
The package includes a CLI tool for Prisma operations:
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
# Generate Prisma client
|
|
204
|
+
npx dismissible-prisma generate
|
|
205
|
+
|
|
206
|
+
# Run migrations
|
|
207
|
+
npx dismissible-prisma migrate dev
|
|
208
|
+
|
|
209
|
+
# Push schema (development)
|
|
210
|
+
npx dismissible-prisma db push
|
|
211
|
+
|
|
212
|
+
# View database
|
|
213
|
+
npx dismissible-prisma studio
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
The CLI automatically uses the bundled Prisma configuration, so you don't need to create your own `prisma.config.mjs` file.
|
|
217
|
+
|
|
218
|
+
## Prisma v7 Configuration
|
|
219
|
+
|
|
220
|
+
This package is compatible with Prisma v7+ which uses a configuration file (`prisma.config.ts` or `prisma.config.mjs`) for datasource configuration.
|
|
221
|
+
|
|
222
|
+
### Zero-Config Approach (Recommended)
|
|
223
|
+
|
|
224
|
+
Simply use the CLI tool - it handles all configuration automatically:
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
npx dismissible-prisma migrate dev
|
|
228
|
+
npx dismissible-prisma generate
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### Custom Configuration
|
|
232
|
+
|
|
233
|
+
If you need to customize the Prisma configuration (e.g., add seeding), create your own `prisma.config.mjs` and import from this package:
|
|
234
|
+
|
|
235
|
+
```javascript
|
|
236
|
+
// prisma.config.mjs
|
|
237
|
+
import { defineConfig } from 'prisma/config';
|
|
238
|
+
import { basePrismaConfig } from '@dismissible/nestjs-postgres-storage';
|
|
239
|
+
|
|
240
|
+
export default defineConfig(basePrismaConfig);
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
### Extending the Configuration
|
|
244
|
+
|
|
245
|
+
You can extend the base configuration with additional options:
|
|
246
|
+
|
|
247
|
+
```javascript
|
|
248
|
+
// prisma.config.mjs
|
|
249
|
+
import { defineConfig } from 'prisma/config';
|
|
250
|
+
import { basePrismaConfig } from '@dismissible/nestjs-postgres-storage';
|
|
251
|
+
|
|
252
|
+
export default defineConfig({
|
|
253
|
+
...basePrismaConfig,
|
|
254
|
+
migrations: {
|
|
255
|
+
...basePrismaConfig.migrations,
|
|
256
|
+
seed: 'tsx prisma/seed.ts',
|
|
257
|
+
},
|
|
258
|
+
});
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Programmatic Access
|
|
262
|
+
|
|
263
|
+
For advanced use cases, you can also use the config factory:
|
|
264
|
+
|
|
265
|
+
```typescript
|
|
266
|
+
import { createPrismaConfig, basePrismaConfig } from '@dismissible/nestjs-postgres-storage';
|
|
267
|
+
|
|
268
|
+
// Get the base config object
|
|
269
|
+
console.log(basePrismaConfig.schema);
|
|
270
|
+
|
|
271
|
+
// Or create a fresh config
|
|
272
|
+
const config = createPrismaConfig();
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
## Environment Variables
|
|
276
|
+
|
|
277
|
+
- `DATABASE_URL` - PostgreSQL connection string (standard Prisma convention)
|
|
278
|
+
- `DISMISSIBLE_POSTGRES_STORAGE_CONNECTION_STRING` - Alternative PostgreSQL connection string (fallback if `DATABASE_URL` is not set)
|
|
279
|
+
|
|
280
|
+
## Production Considerations
|
|
281
|
+
|
|
282
|
+
1. **Connection Pooling**: The adapter uses `pg` connection pooling. Configure your pool size based on your application's needs.
|
|
283
|
+
|
|
284
|
+
2. **Migrations**: Always use Prisma migrations in production. Run migrations before starting your application:
|
|
285
|
+
|
|
286
|
+
```bash
|
|
287
|
+
# Using the CLI helper (recommended)
|
|
288
|
+
npx dismissible-prisma migrate deploy
|
|
289
|
+
|
|
290
|
+
# Or using Prisma directly
|
|
291
|
+
npx prisma migrate deploy --schema=node_modules/@dismissible/nestjs-postgres-storage/prisma/schema.prisma
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
> **Critical**: The database schema must be initialized before your application starts. The storage adapter will fail if tables don't exist.
|
|
295
|
+
|
|
296
|
+
3. **Monitoring**: Monitor database connections and query performance.
|
|
297
|
+
|
|
298
|
+
4. **Backups**: Ensure regular database backups are in place.
|
|
299
|
+
|
|
300
|
+
## Related Packages
|
|
301
|
+
|
|
302
|
+
- `@dismissible/nestjs-dismissible` - Main dismissible service
|
|
303
|
+
- `@dismissible/nestjs-storage` - Storage interface
|
|
304
|
+
- `@dismissible/nestjs-dismissible-item` - Data models
|
|
305
|
+
- `@dismissible/nestjs-logger` - Logging
|
|
306
|
+
|
|
307
|
+
## License
|
|
308
|
+
|
|
309
|
+
MIT
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* CLI helper for @dismissible/nestjs-postgres-storage
|
|
5
|
+
* Runs Prisma commands with the correct schema and config paths.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* npx dismissible-prisma generate
|
|
9
|
+
* npx dismissible-prisma migrate dev
|
|
10
|
+
* npx dismissible-prisma migrate deploy
|
|
11
|
+
* npx dismissible-prisma db push
|
|
12
|
+
* npx dismissible-prisma studio
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
const { execSync } = require('child_process');
|
|
16
|
+
const path = require('path');
|
|
17
|
+
|
|
18
|
+
const configPath = path.join(__dirname, '..', 'prisma.config.mjs');
|
|
19
|
+
const schemaPath = path.join(__dirname, '..', 'prisma', 'schema.prisma');
|
|
20
|
+
const args = process.argv.slice(2);
|
|
21
|
+
|
|
22
|
+
if (args.length === 0) {
|
|
23
|
+
console.log(`
|
|
24
|
+
@dismissible/nestjs-postgres-storage - Prisma CLI Helper
|
|
25
|
+
|
|
26
|
+
Usage:
|
|
27
|
+
npx dismissible-prisma <command> [options]
|
|
28
|
+
|
|
29
|
+
Commands:
|
|
30
|
+
generate Generate Prisma Client
|
|
31
|
+
migrate dev Create and apply migrations (development)
|
|
32
|
+
migrate deploy Apply pending migrations (production)
|
|
33
|
+
migrate reset Reset database and apply all migrations
|
|
34
|
+
db push Push schema to database without migrations
|
|
35
|
+
db pull Pull schema from database
|
|
36
|
+
studio Open Prisma Studio
|
|
37
|
+
|
|
38
|
+
Examples:
|
|
39
|
+
npx dismissible-prisma generate
|
|
40
|
+
npx dismissible-prisma migrate dev --name init
|
|
41
|
+
npx dismissible-prisma db push
|
|
42
|
+
|
|
43
|
+
Config location: ${configPath}
|
|
44
|
+
Schema location: ${schemaPath}
|
|
45
|
+
`);
|
|
46
|
+
process.exit(0);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const command = `npx prisma ${args.join(' ')} --config="${configPath}"`;
|
|
50
|
+
|
|
51
|
+
console.log(`Running: ${command}\n`);
|
|
52
|
+
|
|
53
|
+
try {
|
|
54
|
+
execSync(command, { stdio: 'inherit' });
|
|
55
|
+
} catch (error) {
|
|
56
|
+
process.exit(error.status || 1);
|
|
57
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dismissible/nestjs-postgres-storage",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "PostgreSQL storage adapter for Dismissible using Prisma",
|
|
5
|
+
"main": "./src/index.js",
|
|
6
|
+
"types": "./src/index.d.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"dismissible-prisma": "./bin/dismissible-prisma.js"
|
|
9
|
+
},
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": "./src/index.mjs",
|
|
13
|
+
"require": "./src/index.js",
|
|
14
|
+
"types": "./src/index.d.ts"
|
|
15
|
+
},
|
|
16
|
+
"./prisma/schema.prisma": "./prisma/schema.prisma",
|
|
17
|
+
"./prisma.config": "./prisma.config.mjs"
|
|
18
|
+
},
|
|
19
|
+
"prisma": {
|
|
20
|
+
"schema": "prisma/schema.prisma"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"src",
|
|
24
|
+
"bin",
|
|
25
|
+
"prisma",
|
|
26
|
+
"prisma.config.mjs",
|
|
27
|
+
"README.md"
|
|
28
|
+
],
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"@nestjs/common": "^11.0.0"
|
|
31
|
+
},
|
|
32
|
+
"peerDependenciesMeta": {
|
|
33
|
+
"@nestjs/common": {
|
|
34
|
+
"optional": false
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@dismissible/nestjs-storage": "^0.0.1",
|
|
39
|
+
"@dismissible/nestjs-dismissible-item": "^0.0.1",
|
|
40
|
+
"@dismissible/nestjs-logger": "^0.0.1",
|
|
41
|
+
"prisma": "^7.2.0",
|
|
42
|
+
"@prisma/client": "^7.2.0",
|
|
43
|
+
"@prisma/adapter-pg": "^7.2.0",
|
|
44
|
+
"pg": "^8.16.3"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@types/pg": "^8.16.0"
|
|
48
|
+
},
|
|
49
|
+
"keywords": [
|
|
50
|
+
"nestjs",
|
|
51
|
+
"dismissible",
|
|
52
|
+
"storage",
|
|
53
|
+
"postgres",
|
|
54
|
+
"prisma",
|
|
55
|
+
"adapter"
|
|
56
|
+
],
|
|
57
|
+
"author": "",
|
|
58
|
+
"license": "MIT",
|
|
59
|
+
"repository": {
|
|
60
|
+
"type": "git",
|
|
61
|
+
"url": "https://github.com/DismissibleIo/dismissible-api"
|
|
62
|
+
},
|
|
63
|
+
"publishConfig": {
|
|
64
|
+
"access": "public"
|
|
65
|
+
},
|
|
66
|
+
"type": "commonjs"
|
|
67
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as runtime from "@prisma/client/runtime/client";
|
|
2
|
+
import * as $Class from "./internal/class";
|
|
3
|
+
import * as Prisma from "./internal/prismaNamespace";
|
|
4
|
+
export * as $Enums from './enums';
|
|
5
|
+
export * from "./enums";
|
|
6
|
+
/**
|
|
7
|
+
* ## Prisma Client
|
|
8
|
+
*
|
|
9
|
+
* Type-safe database client for TypeScript
|
|
10
|
+
* @example
|
|
11
|
+
* ```
|
|
12
|
+
* const prisma = new PrismaClient()
|
|
13
|
+
* // Fetch zero or more DismissibleItems
|
|
14
|
+
* const dismissibleItems = await prisma.dismissibleItem.findMany()
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* Read more in our [docs](https://pris.ly/d/client).
|
|
18
|
+
*/
|
|
19
|
+
export declare const PrismaClient: $Class.PrismaClientConstructor;
|
|
20
|
+
export type PrismaClient<LogOpts extends Prisma.LogLevel = never, OmitOpts extends Prisma.PrismaClientOptions["omit"] = Prisma.PrismaClientOptions["omit"], ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = $Class.PrismaClient<LogOpts, OmitOpts, ExtArgs>;
|
|
21
|
+
export { Prisma };
|
|
22
|
+
/**
|
|
23
|
+
* Model DismissibleItem
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
export type DismissibleItem = Prisma.DismissibleItemModel;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
// biome-ignore-all lint: generated file
|
|
5
|
+
// @ts-nocheck
|
|
6
|
+
/*
|
|
7
|
+
* This file should be your main import to use Prisma. Through it you get access to all the models, enums, and input types.
|
|
8
|
+
* If you're looking for something you can import in the client-side of your application, please refer to the `browser.ts` file instead.
|
|
9
|
+
*
|
|
10
|
+
* 🟢 You can import this file directly.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.Prisma = exports.PrismaClient = exports.$Enums = void 0;
|
|
14
|
+
const tslib_1 = require("tslib");
|
|
15
|
+
const $Class = tslib_1.__importStar(require("./internal/class"));
|
|
16
|
+
const Prisma = tslib_1.__importStar(require("./internal/prismaNamespace"));
|
|
17
|
+
exports.Prisma = Prisma;
|
|
18
|
+
exports.$Enums = tslib_1.__importStar(require("./enums"));
|
|
19
|
+
tslib_1.__exportStar(require("./enums"), exports);
|
|
20
|
+
/**
|
|
21
|
+
* ## Prisma Client
|
|
22
|
+
*
|
|
23
|
+
* Type-safe database client for TypeScript
|
|
24
|
+
* @example
|
|
25
|
+
* ```
|
|
26
|
+
* const prisma = new PrismaClient()
|
|
27
|
+
* // Fetch zero or more DismissibleItems
|
|
28
|
+
* const dismissibleItems = await prisma.dismissibleItem.findMany()
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* Read more in our [docs](https://pris.ly/d/client).
|
|
32
|
+
*/
|
|
33
|
+
exports.PrismaClient = $Class.getPrismaClientClass();
|
|
34
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../../libs/postgres-storage/prisma/generated/prisma/client.ts"],"names":[],"mappings":";AACA,qEAAqE;AACrE,oBAAoB;AACpB,wCAAwC;AACxC,eAAe;AACf;;;;;GAKG;;;;AAOH,iEAA0C;AAC1C,2EAAoD;AAmB3C,wBAAM;AAjBf,0DAAiC;AACjC,kDAAuB;AACvB;;;;;;;;;;;;GAYG;AACU,QAAA,YAAY,GAAG,MAAM,CAAC,oBAAoB,EAAE,CAAA"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import type * as Prisma from "./internal/prismaNamespace";
|
|
2
|
+
export type StringFilter<$PrismaModel = never> = {
|
|
3
|
+
equals?: string | Prisma.StringFieldRefInput<$PrismaModel>;
|
|
4
|
+
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>;
|
|
5
|
+
notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>;
|
|
6
|
+
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>;
|
|
7
|
+
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>;
|
|
8
|
+
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>;
|
|
9
|
+
gte?: string | Prisma.StringFieldRefInput<$PrismaModel>;
|
|
10
|
+
contains?: string | Prisma.StringFieldRefInput<$PrismaModel>;
|
|
11
|
+
startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>;
|
|
12
|
+
endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>;
|
|
13
|
+
mode?: Prisma.QueryMode;
|
|
14
|
+
not?: Prisma.NestedStringFilter<$PrismaModel> | string;
|
|
15
|
+
};
|
|
16
|
+
export type DateTimeFilter<$PrismaModel = never> = {
|
|
17
|
+
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
18
|
+
in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel>;
|
|
19
|
+
notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel>;
|
|
20
|
+
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
21
|
+
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
22
|
+
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
23
|
+
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
24
|
+
not?: Prisma.NestedDateTimeFilter<$PrismaModel> | Date | string;
|
|
25
|
+
};
|
|
26
|
+
export type DateTimeNullableFilter<$PrismaModel = never> = {
|
|
27
|
+
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null;
|
|
28
|
+
in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null;
|
|
29
|
+
notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null;
|
|
30
|
+
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
31
|
+
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
32
|
+
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
33
|
+
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
34
|
+
not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null;
|
|
35
|
+
};
|
|
36
|
+
export type SortOrderInput = {
|
|
37
|
+
sort: Prisma.SortOrder;
|
|
38
|
+
nulls?: Prisma.NullsOrder;
|
|
39
|
+
};
|
|
40
|
+
export type StringWithAggregatesFilter<$PrismaModel = never> = {
|
|
41
|
+
equals?: string | Prisma.StringFieldRefInput<$PrismaModel>;
|
|
42
|
+
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>;
|
|
43
|
+
notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>;
|
|
44
|
+
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>;
|
|
45
|
+
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>;
|
|
46
|
+
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>;
|
|
47
|
+
gte?: string | Prisma.StringFieldRefInput<$PrismaModel>;
|
|
48
|
+
contains?: string | Prisma.StringFieldRefInput<$PrismaModel>;
|
|
49
|
+
startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>;
|
|
50
|
+
endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>;
|
|
51
|
+
mode?: Prisma.QueryMode;
|
|
52
|
+
not?: Prisma.NestedStringWithAggregatesFilter<$PrismaModel> | string;
|
|
53
|
+
_count?: Prisma.NestedIntFilter<$PrismaModel>;
|
|
54
|
+
_min?: Prisma.NestedStringFilter<$PrismaModel>;
|
|
55
|
+
_max?: Prisma.NestedStringFilter<$PrismaModel>;
|
|
56
|
+
};
|
|
57
|
+
export type DateTimeWithAggregatesFilter<$PrismaModel = never> = {
|
|
58
|
+
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
59
|
+
in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel>;
|
|
60
|
+
notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel>;
|
|
61
|
+
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
62
|
+
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
63
|
+
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
64
|
+
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
65
|
+
not?: Prisma.NestedDateTimeWithAggregatesFilter<$PrismaModel> | Date | string;
|
|
66
|
+
_count?: Prisma.NestedIntFilter<$PrismaModel>;
|
|
67
|
+
_min?: Prisma.NestedDateTimeFilter<$PrismaModel>;
|
|
68
|
+
_max?: Prisma.NestedDateTimeFilter<$PrismaModel>;
|
|
69
|
+
};
|
|
70
|
+
export type DateTimeNullableWithAggregatesFilter<$PrismaModel = never> = {
|
|
71
|
+
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null;
|
|
72
|
+
in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null;
|
|
73
|
+
notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null;
|
|
74
|
+
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
75
|
+
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
76
|
+
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
77
|
+
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
78
|
+
not?: Prisma.NestedDateTimeNullableWithAggregatesFilter<$PrismaModel> | Date | string | null;
|
|
79
|
+
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>;
|
|
80
|
+
_min?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>;
|
|
81
|
+
_max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>;
|
|
82
|
+
};
|
|
83
|
+
export type NestedStringFilter<$PrismaModel = never> = {
|
|
84
|
+
equals?: string | Prisma.StringFieldRefInput<$PrismaModel>;
|
|
85
|
+
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>;
|
|
86
|
+
notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>;
|
|
87
|
+
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>;
|
|
88
|
+
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>;
|
|
89
|
+
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>;
|
|
90
|
+
gte?: string | Prisma.StringFieldRefInput<$PrismaModel>;
|
|
91
|
+
contains?: string | Prisma.StringFieldRefInput<$PrismaModel>;
|
|
92
|
+
startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>;
|
|
93
|
+
endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>;
|
|
94
|
+
not?: Prisma.NestedStringFilter<$PrismaModel> | string;
|
|
95
|
+
};
|
|
96
|
+
export type NestedDateTimeFilter<$PrismaModel = never> = {
|
|
97
|
+
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
98
|
+
in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel>;
|
|
99
|
+
notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel>;
|
|
100
|
+
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
101
|
+
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
102
|
+
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
103
|
+
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
104
|
+
not?: Prisma.NestedDateTimeFilter<$PrismaModel> | Date | string;
|
|
105
|
+
};
|
|
106
|
+
export type NestedDateTimeNullableFilter<$PrismaModel = never> = {
|
|
107
|
+
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null;
|
|
108
|
+
in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null;
|
|
109
|
+
notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null;
|
|
110
|
+
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
111
|
+
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
112
|
+
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
113
|
+
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
114
|
+
not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null;
|
|
115
|
+
};
|
|
116
|
+
export type NestedStringWithAggregatesFilter<$PrismaModel = never> = {
|
|
117
|
+
equals?: string | Prisma.StringFieldRefInput<$PrismaModel>;
|
|
118
|
+
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>;
|
|
119
|
+
notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>;
|
|
120
|
+
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>;
|
|
121
|
+
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>;
|
|
122
|
+
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>;
|
|
123
|
+
gte?: string | Prisma.StringFieldRefInput<$PrismaModel>;
|
|
124
|
+
contains?: string | Prisma.StringFieldRefInput<$PrismaModel>;
|
|
125
|
+
startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>;
|
|
126
|
+
endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>;
|
|
127
|
+
not?: Prisma.NestedStringWithAggregatesFilter<$PrismaModel> | string;
|
|
128
|
+
_count?: Prisma.NestedIntFilter<$PrismaModel>;
|
|
129
|
+
_min?: Prisma.NestedStringFilter<$PrismaModel>;
|
|
130
|
+
_max?: Prisma.NestedStringFilter<$PrismaModel>;
|
|
131
|
+
};
|
|
132
|
+
export type NestedIntFilter<$PrismaModel = never> = {
|
|
133
|
+
equals?: number | Prisma.IntFieldRefInput<$PrismaModel>;
|
|
134
|
+
in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel>;
|
|
135
|
+
notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel>;
|
|
136
|
+
lt?: number | Prisma.IntFieldRefInput<$PrismaModel>;
|
|
137
|
+
lte?: number | Prisma.IntFieldRefInput<$PrismaModel>;
|
|
138
|
+
gt?: number | Prisma.IntFieldRefInput<$PrismaModel>;
|
|
139
|
+
gte?: number | Prisma.IntFieldRefInput<$PrismaModel>;
|
|
140
|
+
not?: Prisma.NestedIntFilter<$PrismaModel> | number;
|
|
141
|
+
};
|
|
142
|
+
export type NestedDateTimeWithAggregatesFilter<$PrismaModel = never> = {
|
|
143
|
+
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
144
|
+
in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel>;
|
|
145
|
+
notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel>;
|
|
146
|
+
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
147
|
+
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
148
|
+
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
149
|
+
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
150
|
+
not?: Prisma.NestedDateTimeWithAggregatesFilter<$PrismaModel> | Date | string;
|
|
151
|
+
_count?: Prisma.NestedIntFilter<$PrismaModel>;
|
|
152
|
+
_min?: Prisma.NestedDateTimeFilter<$PrismaModel>;
|
|
153
|
+
_max?: Prisma.NestedDateTimeFilter<$PrismaModel>;
|
|
154
|
+
};
|
|
155
|
+
export type NestedDateTimeNullableWithAggregatesFilter<$PrismaModel = never> = {
|
|
156
|
+
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null;
|
|
157
|
+
in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null;
|
|
158
|
+
notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null;
|
|
159
|
+
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
160
|
+
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
161
|
+
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
162
|
+
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>;
|
|
163
|
+
not?: Prisma.NestedDateTimeNullableWithAggregatesFilter<$PrismaModel> | Date | string | null;
|
|
164
|
+
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>;
|
|
165
|
+
_min?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>;
|
|
166
|
+
_max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>;
|
|
167
|
+
};
|
|
168
|
+
export type NestedIntNullableFilter<$PrismaModel = never> = {
|
|
169
|
+
equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null;
|
|
170
|
+
in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null;
|
|
171
|
+
notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null;
|
|
172
|
+
lt?: number | Prisma.IntFieldRefInput<$PrismaModel>;
|
|
173
|
+
lte?: number | Prisma.IntFieldRefInput<$PrismaModel>;
|
|
174
|
+
gt?: number | Prisma.IntFieldRefInput<$PrismaModel>;
|
|
175
|
+
gte?: number | Prisma.IntFieldRefInput<$PrismaModel>;
|
|
176
|
+
not?: Prisma.NestedIntNullableFilter<$PrismaModel> | number | null;
|
|
177
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
// biome-ignore-all lint: generated file
|
|
5
|
+
// @ts-nocheck
|
|
6
|
+
/*
|
|
7
|
+
* This file exports various common sort, input & filter types that are not directly linked to a particular model.
|
|
8
|
+
*
|
|
9
|
+
* 🟢 You can import this file directly.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
//# sourceMappingURL=commonInputTypes.js.map
|