@rapidd/build 2.0.3 → 2.1.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/README.md +26 -165
- package/dist/bin/cli.js +0 -2
- package/dist/bin/cli.js.map +1 -1
- package/dist/index.d.ts +2 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -12
- package/dist/index.js.map +1 -1
- package/dist/src/commands/build.d.ts +1 -3
- package/dist/src/commands/build.d.ts.map +1 -1
- package/dist/src/commands/build.js +1 -106
- package/dist/src/commands/build.js.map +1 -1
- package/dist/src/generators/aclGenerator.d.ts +2 -2
- package/dist/src/generators/aclGenerator.d.ts.map +1 -1
- package/dist/src/generators/aclGenerator.js +11 -304
- package/dist/src/generators/aclGenerator.js.map +1 -1
- package/dist/src/generators/modelGenerator.d.ts +1 -1
- package/dist/src/generators/modelGenerator.d.ts.map +1 -1
- package/dist/src/generators/modelGenerator.js +46 -16
- package/dist/src/generators/modelGenerator.js.map +1 -1
- package/dist/src/generators/routeGenerator.d.ts +1 -1
- package/dist/src/generators/routeGenerator.d.ts.map +1 -1
- package/dist/src/generators/routeGenerator.js +6 -2
- package/dist/src/generators/routeGenerator.js.map +1 -1
- package/dist/src/parsers/index.d.ts +1 -10
- package/dist/src/parsers/index.d.ts.map +1 -1
- package/dist/src/parsers/index.js +1 -14
- package/dist/src/parsers/index.js.map +1 -1
- package/dist/src/parsers/prismaParser.d.ts +1 -1
- package/dist/src/parsers/prismaParser.d.ts.map +1 -1
- package/dist/src/parsers/prismaParser.js +7 -7
- package/dist/src/parsers/prismaParser.js.map +1 -1
- package/dist/src/parsers/types.d.ts +33 -0
- package/dist/src/parsers/types.d.ts.map +1 -0
- package/dist/src/parsers/types.js +3 -0
- package/dist/src/parsers/types.js.map +1 -0
- package/package.json +14 -19
- package/dist/src/parsers/datasourceParser.d.ts +0 -11
- package/dist/src/parsers/datasourceParser.d.ts.map +0 -1
- package/dist/src/parsers/datasourceParser.js +0 -131
- package/dist/src/parsers/datasourceParser.js.map +0 -1
- package/dist/src/parsers/deepSQLAnalyzer.d.ts +0 -85
- package/dist/src/parsers/deepSQLAnalyzer.d.ts.map +0 -1
- package/dist/src/parsers/deepSQLAnalyzer.js +0 -482
- package/dist/src/parsers/deepSQLAnalyzer.js.map +0 -1
- package/dist/src/parsers/enhancedRLSConverter.d.ts +0 -14
- package/dist/src/parsers/enhancedRLSConverter.d.ts.map +0 -1
- package/dist/src/parsers/enhancedRLSConverter.js +0 -168
- package/dist/src/parsers/enhancedRLSConverter.js.map +0 -1
- package/dist/src/parsers/functionAnalyzer.d.ts +0 -55
- package/dist/src/parsers/functionAnalyzer.d.ts.map +0 -1
- package/dist/src/parsers/functionAnalyzer.js +0 -274
- package/dist/src/parsers/functionAnalyzer.js.map +0 -1
- package/dist/src/parsers/prismaFilterBuilder.d.ts +0 -79
- package/dist/src/parsers/prismaFilterBuilder.d.ts.map +0 -1
- package/dist/src/parsers/prismaFilterBuilder.js +0 -322
- package/dist/src/parsers/prismaFilterBuilder.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
# @rapidd/build
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Code generator that transforms Prisma schemas into Fastify CRUD APIs with TypeScript.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
7
|
- **Automatic CRUD API Generation** - Creates Fastify routes from Prisma models (TypeScript)
|
|
8
|
-
- **
|
|
9
|
-
- **
|
|
10
|
-
- **Relationship Handling** - Supports 1:1, 1:n, n:m including junction tables
|
|
11
|
-
- **Role-Based Access Control** - Properly handles role checks in filters
|
|
12
|
-
- **Model Generation** - Creates TypeScript CRUD model classes with capitalized filenames
|
|
8
|
+
- **Model Generation** - Creates TypeScript CRUD model classes
|
|
9
|
+
- **ACL Generation** - Generates default Access Control Layer config
|
|
13
10
|
- **Selective Generation** - Update only specific models or components
|
|
14
11
|
|
|
15
12
|
## Requirements
|
|
16
13
|
|
|
17
|
-
- **Prisma 7+**
|
|
14
|
+
- **Prisma 7+**
|
|
18
15
|
- Node.js 18.0.0 or higher
|
|
19
16
|
- TypeScript 5.0+
|
|
20
17
|
|
|
@@ -27,7 +24,7 @@ npm install @rapidd/build
|
|
|
27
24
|
## Quick Start
|
|
28
25
|
|
|
29
26
|
```bash
|
|
30
|
-
# Generate everything in current directory
|
|
27
|
+
# Generate everything in current directory
|
|
31
28
|
npx rapidd build
|
|
32
29
|
|
|
33
30
|
# Generate in specific directory
|
|
@@ -43,12 +40,6 @@ npx rapidd build --only acl
|
|
|
43
40
|
|
|
44
41
|
# Combine model and component filters
|
|
45
42
|
npx rapidd build --model account --only route
|
|
46
|
-
|
|
47
|
-
# Specify custom user table
|
|
48
|
-
npx rapidd build --user-table accounts
|
|
49
|
-
|
|
50
|
-
# Enable debug mode (generates acl-mappings.json)
|
|
51
|
-
npx rapidd build --debug
|
|
52
43
|
```
|
|
53
44
|
|
|
54
45
|
## CLI Options
|
|
@@ -59,8 +50,6 @@ npx rapidd build --debug
|
|
|
59
50
|
| `-s, --schema <path>` | Prisma schema file | `./prisma/schema.prisma` |
|
|
60
51
|
| `-m, --model <name>` | Generate/update only specific model | All models |
|
|
61
52
|
| `--only <component>` | Generate only: `model`, `route`, or `acl` | All components |
|
|
62
|
-
| `--user-table <name>` | User table name for ACL | Auto-detected |
|
|
63
|
-
| `--debug` | Enable debug mode | `false` |
|
|
64
53
|
|
|
65
54
|
## Generated Structure
|
|
66
55
|
|
|
@@ -70,7 +59,6 @@ npx rapidd build --debug
|
|
|
70
59
|
│ ├── models/
|
|
71
60
|
│ │ ├── User.ts
|
|
72
61
|
│ │ ├── Post.ts
|
|
73
|
-
│ │ ├── index.ts
|
|
74
62
|
│ │ └── ...
|
|
75
63
|
│ └── config/
|
|
76
64
|
│ └── acl.ts
|
|
@@ -79,13 +67,12 @@ npx rapidd build --debug
|
|
|
79
67
|
└── v1/
|
|
80
68
|
├── users.ts
|
|
81
69
|
├── posts.ts
|
|
82
|
-
├── index.ts
|
|
83
70
|
└── ...
|
|
84
71
|
```
|
|
85
72
|
|
|
86
73
|
## Generated Code Examples
|
|
87
74
|
|
|
88
|
-
### Model
|
|
75
|
+
### Model
|
|
89
76
|
|
|
90
77
|
```typescript
|
|
91
78
|
// src/models/Users.ts
|
|
@@ -98,42 +85,17 @@ export class Users extends Model {
|
|
|
98
85
|
super('users', options);
|
|
99
86
|
}
|
|
100
87
|
|
|
101
|
-
async getMany(
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
sortBy: string = 'id',
|
|
107
|
-
sortOrder: 'asc' | 'desc' = 'asc'
|
|
108
|
-
): Promise<GetManyResult> {
|
|
109
|
-
return await this._getMany(q, include, Number(limit), Number(offset), sortBy, sortOrder);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
async get(id: string | number, include?: string | Record<string, unknown>): Promise<Record<string, unknown>> {
|
|
113
|
-
return await this._get(id, include);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
async create(data: Record<string, unknown>): Promise<Record<string, unknown>> {
|
|
117
|
-
return await this._create(data);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
async update(id: string | number, data: Record<string, unknown>): Promise<Record<string, unknown>> {
|
|
121
|
-
return await this._update(id, data);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
async delete(id: string | number): Promise<Record<string, unknown>> {
|
|
125
|
-
return await this._delete(id);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
filter(include: string | Record<string, unknown>): Record<string, unknown> {
|
|
129
|
-
return { ...this._filter(include), ...this.getAccessFilter() };
|
|
130
|
-
}
|
|
88
|
+
async getMany(...) { ... }
|
|
89
|
+
async get(id, include?) { ... }
|
|
90
|
+
async create(data) { ... }
|
|
91
|
+
async update(id, data) { ... }
|
|
92
|
+
async delete(id) { ... }
|
|
131
93
|
|
|
132
94
|
static override QueryBuilder = new QueryBuilder('users');
|
|
133
95
|
}
|
|
134
96
|
```
|
|
135
97
|
|
|
136
|
-
### Route (Fastify
|
|
98
|
+
### Route (Fastify)
|
|
137
99
|
|
|
138
100
|
```typescript
|
|
139
101
|
// routes/api/v1/users.ts
|
|
@@ -148,20 +110,17 @@ const usersRoutes: FastifyPluginAsync = async (fastify) => {
|
|
|
148
110
|
(request as any).Users = new Users({ user: request.user });
|
|
149
111
|
});
|
|
150
112
|
|
|
151
|
-
fastify.get('/', async (request
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
// ... POST, PATCH, DELETE handlers
|
|
113
|
+
fastify.get('/', async (request, reply) => { ... });
|
|
114
|
+
fastify.get('/:id', async (request, reply) => { ... });
|
|
115
|
+
fastify.post('/', async (request, reply) => { ... });
|
|
116
|
+
fastify.patch('/:id', async (request, reply) => { ... });
|
|
117
|
+
fastify.delete('/:id', async (request, reply) => { ... });
|
|
159
118
|
};
|
|
160
119
|
|
|
161
120
|
export default usersRoutes;
|
|
162
121
|
```
|
|
163
122
|
|
|
164
|
-
### ACL
|
|
123
|
+
### ACL
|
|
165
124
|
|
|
166
125
|
```typescript
|
|
167
126
|
// src/config/acl.ts
|
|
@@ -170,22 +129,19 @@ import type { AclConfig, RapiddUser } from '../types';
|
|
|
170
129
|
const acl: AclConfig = {
|
|
171
130
|
model: {
|
|
172
131
|
users: {
|
|
173
|
-
canCreate(): boolean {
|
|
132
|
+
canCreate(_user: RapiddUser): boolean {
|
|
174
133
|
return true;
|
|
175
134
|
},
|
|
176
|
-
getAccessFilter(
|
|
177
|
-
|
|
178
|
-
return { id: user.id };
|
|
135
|
+
getAccessFilter(_user: RapiddUser): Record<string, unknown> | boolean {
|
|
136
|
+
return {};
|
|
179
137
|
},
|
|
180
|
-
getUpdateFilter(
|
|
181
|
-
|
|
182
|
-
return { id: user.id };
|
|
138
|
+
getUpdateFilter(_user: RapiddUser): Record<string, unknown> | boolean | false {
|
|
139
|
+
return {};
|
|
183
140
|
},
|
|
184
|
-
getDeleteFilter(
|
|
185
|
-
|
|
186
|
-
return false;
|
|
141
|
+
getDeleteFilter(_user: RapiddUser): Record<string, unknown> | boolean | false {
|
|
142
|
+
return {};
|
|
187
143
|
},
|
|
188
|
-
getOmitFields(): string[] {
|
|
144
|
+
getOmitFields(_user: RapiddUser): string[] {
|
|
189
145
|
return [];
|
|
190
146
|
},
|
|
191
147
|
},
|
|
@@ -196,126 +152,31 @@ const acl: AclConfig = {
|
|
|
196
152
|
export default acl;
|
|
197
153
|
```
|
|
198
154
|
|
|
199
|
-
## ACL Translation Example
|
|
200
|
-
|
|
201
|
-
**PostgreSQL Policy:**
|
|
202
|
-
```sql
|
|
203
|
-
CREATE POLICY user_policy ON posts
|
|
204
|
-
FOR SELECT
|
|
205
|
-
USING (author_id = current_user_id() OR current_user_role() IN ('admin', 'moderator'));
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
**Generated TypeScript:**
|
|
209
|
-
```typescript
|
|
210
|
-
getAccessFilter(user: RapiddUser) {
|
|
211
|
-
if (['admin', 'moderator'].includes(user?.role)) return {};
|
|
212
|
-
return { author_id: user?.id };
|
|
213
|
-
}
|
|
214
|
-
```
|
|
215
|
-
|
|
216
155
|
## Selective Generation
|
|
217
156
|
|
|
218
157
|
### Update Single Model
|
|
219
158
|
|
|
220
159
|
```bash
|
|
221
|
-
# Update only the account model across all components
|
|
222
160
|
npx rapidd build --model account
|
|
223
161
|
```
|
|
224
162
|
|
|
225
|
-
This will:
|
|
226
|
-
- Generate/update `src/models/Account.ts`
|
|
227
|
-
- Generate/update `routes/api/v1/account.ts`
|
|
228
|
-
- Update the `account` entry in `src/config/acl.ts`
|
|
229
|
-
|
|
230
163
|
### Update Single Component
|
|
231
164
|
|
|
232
165
|
```bash
|
|
233
|
-
# Regenerate all routes
|
|
234
166
|
npx rapidd build --only route
|
|
235
|
-
|
|
236
|
-
# Regenerate all ACL configs
|
|
237
167
|
npx rapidd build --only acl
|
|
238
|
-
|
|
239
|
-
# Regenerate all models
|
|
240
168
|
npx rapidd build --only model
|
|
241
169
|
```
|
|
242
170
|
|
|
243
171
|
### Combine Filters
|
|
244
172
|
|
|
245
173
|
```bash
|
|
246
|
-
# Update only the route for a specific model
|
|
247
174
|
npx rapidd build --model user --only route
|
|
248
|
-
|
|
249
|
-
# Update ACL for account model
|
|
250
175
|
npx rapidd build --model account --only acl
|
|
251
176
|
```
|
|
252
177
|
|
|
253
|
-
## Use Cases
|
|
254
|
-
|
|
255
|
-
### During Development
|
|
256
|
-
```bash
|
|
257
|
-
# After adding a new model to schema
|
|
258
|
-
npx rapidd build --model newModel
|
|
259
|
-
|
|
260
|
-
# After updating RLS policies
|
|
261
|
-
npx rapidd build --only acl
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
### Continuous Integration
|
|
265
|
-
```bash
|
|
266
|
-
# Full rebuild for CI/CD
|
|
267
|
-
npx rapidd build --output ./generated
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
### Incremental Updates
|
|
271
|
-
```bash
|
|
272
|
-
# Update specific model after schema changes
|
|
273
|
-
npx rapidd build --model user --only model
|
|
274
|
-
npx rapidd build --model user --only acl
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
## Migration from v1 (JavaScript/Express) to v2 (TypeScript/Fastify)
|
|
278
|
-
|
|
279
|
-
Version 2.0 brings major changes:
|
|
280
|
-
|
|
281
|
-
1. **TypeScript Output** - All generated files are now TypeScript (`.ts`)
|
|
282
|
-
2. **Fastify Framework** - Routes now use Fastify instead of Express
|
|
283
|
-
3. **New Directory Structure**:
|
|
284
|
-
- Models: `src/models/` (was `src/Model/`)
|
|
285
|
-
- ACL: `src/config/acl.ts` (was `rapidd/acl.js`)
|
|
286
|
-
- Routes: `routes/api/v1/*.ts` (now TypeScript)
|
|
287
|
-
4. **Removed**: `rapidd/` folder and `relationships.json` are no longer generated
|
|
288
|
-
|
|
289
|
-
### Upgrade Steps
|
|
290
|
-
|
|
291
|
-
```bash
|
|
292
|
-
# 1. Update dependencies
|
|
293
|
-
npm install @rapidd/build@latest
|
|
294
|
-
npm install prisma@^7.0.0 @prisma/client@^7.0.0
|
|
295
|
-
|
|
296
|
-
# 2. Full rebuild
|
|
297
|
-
npx rapidd build
|
|
298
|
-
|
|
299
|
-
# 3. Update your imports in existing code
|
|
300
|
-
# Old: const { User } = require('./src/Model/User');
|
|
301
|
-
# New: import { User } from './src/models/User';
|
|
302
|
-
```
|
|
303
|
-
|
|
304
|
-
## Migration from Prisma 6 to 7
|
|
305
|
-
|
|
306
|
-
If you're upgrading from Prisma 6, this package now automatically:
|
|
307
|
-
|
|
308
|
-
1. **Uses `@prisma/internals`** for DMMF access (no longer relies on generated client)
|
|
309
|
-
2. **Reads database URL** from multiple sources in order:
|
|
310
|
-
- `prisma.config.ts` (Prisma 7 default)
|
|
311
|
-
- Schema file `datasource.url` (Prisma 5/6 style)
|
|
312
|
-
- `DATABASE_URL` environment variable
|
|
313
|
-
3. **Maintains full compatibility** - no changes needed to your workflow
|
|
314
|
-
|
|
315
178
|
## API Usage
|
|
316
179
|
|
|
317
|
-
You can also use the package programmatically:
|
|
318
|
-
|
|
319
180
|
```typescript
|
|
320
181
|
import { buildModels, parsePrismaSchema, generateAllModels } from '@rapidd/build';
|
|
321
182
|
|
package/dist/bin/cli.js
CHANGED
|
@@ -15,8 +15,6 @@ program
|
|
|
15
15
|
.option('-o, --output <path>', 'Output base directory', './')
|
|
16
16
|
.option('-m, --model <name>', 'Generate/update only specific model (e.g., "account", "user")')
|
|
17
17
|
.option('--only <component>', 'Generate only specific component: "model", "route", or "acl"')
|
|
18
|
-
.option('--user-table <name>', 'Name of the user table for ACL (default: auto-detect from user/users)')
|
|
19
|
-
.option('--debug', 'Enable debug mode (generates acl-mappings.json)')
|
|
20
18
|
.action(async (options) => {
|
|
21
19
|
try {
|
|
22
20
|
await (0, build_1.buildModels)(options);
|
package/dist/bin/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../bin/cli.ts"],"names":[],"mappings":";;;AAEA,yCAAoC;AACpC,iDAAkE;AAElE,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,QAAQ,CAAC;KACd,WAAW,CAAC,4EAA4E,CAAC;KACzF,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO;KACJ,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,kEAAkE,CAAC;KAC/E,MAAM,CAAC,qBAAqB,EAAE,4BAA4B,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,wBAAwB,CAAC;KACvH,MAAM,CAAC,qBAAqB,EAAE,uBAAuB,EAAE,IAAI,CAAC;KAC5D,MAAM,CAAC,oBAAoB,EAAE,+DAA+D,CAAC;KAC7F,MAAM,CAAC,oBAAoB,EAAE,8DAA8D,CAAC;KAC5F,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../bin/cli.ts"],"names":[],"mappings":";;;AAEA,yCAAoC;AACpC,iDAAkE;AAElE,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,QAAQ,CAAC;KACd,WAAW,CAAC,4EAA4E,CAAC;KACzF,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO;KACJ,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,kEAAkE,CAAC;KAC/E,MAAM,CAAC,qBAAqB,EAAE,4BAA4B,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,wBAAwB,CAAC;KACvH,MAAM,CAAC,qBAAqB,EAAE,uBAAuB,EAAE,IAAI,CAAC;KAC5D,MAAM,CAAC,oBAAoB,EAAE,+DAA+D,CAAC;KAC7F,MAAM,CAAC,oBAAoB,EAAE,8DAA8D,CAAC;KAC5F,MAAM,CAAC,KAAK,EAAE,OAAqB,EAAE,EAAE;IACtC,IAAI,CAAC;QACH,MAAM,IAAA,mBAAW,EAAC,OAAO,CAAC,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;IAClD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAG,KAAe,CAAC,OAAO,CAAC,CAAC;QAClE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,9 @@
|
|
|
1
1
|
export { buildModels } from './src/commands/build';
|
|
2
2
|
export type { BuildOptions } from './src/commands/build';
|
|
3
3
|
export { parsePrismaSchema, parsePrismaDMMF } from './src/parsers/prismaParser';
|
|
4
|
-
export {
|
|
5
|
-
export { DeepSQLAnalyzer } from './src/parsers/deepSQLAnalyzer';
|
|
6
|
-
export { PrismaFilterBuilder } from './src/parsers/prismaFilterBuilder';
|
|
7
|
-
export { createEnhancedConverter } from './src/parsers/enhancedRLSConverter';
|
|
8
|
-
export { analyzeFunctions, generateMappingConfig } from './src/parsers/functionAnalyzer';
|
|
4
|
+
export type { ParsedSchema } from './src/parsers/prismaParser';
|
|
9
5
|
export { generateModelFile, generateAllModels } from './src/generators/modelGenerator';
|
|
10
6
|
export { generateRouteFile, generateAllRoutes } from './src/generators/routeGenerator';
|
|
11
7
|
export { generateACL } from './src/generators/aclGenerator';
|
|
12
|
-
export type { ModelInfo, ModelField, ModelRelation
|
|
13
|
-
export type { SQLFilter, SQLCondition, SQLAnalysis } from './src/parsers/deepSQLAnalyzer';
|
|
14
|
-
export type { DatasourceConfig } from './src/parsers/datasourceParser';
|
|
15
|
-
export type { ParsedSchema } from './src/parsers/prismaParser';
|
|
16
|
-
export type { EnhancedConverter } from './src/parsers/enhancedRLSConverter';
|
|
17
|
-
export type { FunctionMapping, FunctionAnalysisResult, MappingConfig } from './src/parsers/functionAnalyzer';
|
|
8
|
+
export type { ModelInfo, ModelField, ModelRelation } from './src/parsers/types';
|
|
18
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGzD,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAChF,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGzD,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAChF,YAAY,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAG/D,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAG5D,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Main exports for @rapidd/build
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.generateACL = exports.generateAllRoutes = exports.generateRouteFile = exports.generateAllModels = exports.generateModelFile = exports.
|
|
4
|
+
exports.generateACL = exports.generateAllRoutes = exports.generateRouteFile = exports.generateAllModels = exports.generateModelFile = exports.parsePrismaDMMF = exports.parsePrismaSchema = exports.buildModels = void 0;
|
|
5
5
|
// Commands
|
|
6
6
|
var build_1 = require("./src/commands/build");
|
|
7
7
|
Object.defineProperty(exports, "buildModels", { enumerable: true, get: function () { return build_1.buildModels; } });
|
|
@@ -9,17 +9,6 @@ Object.defineProperty(exports, "buildModels", { enumerable: true, get: function
|
|
|
9
9
|
var prismaParser_1 = require("./src/parsers/prismaParser");
|
|
10
10
|
Object.defineProperty(exports, "parsePrismaSchema", { enumerable: true, get: function () { return prismaParser_1.parsePrismaSchema; } });
|
|
11
11
|
Object.defineProperty(exports, "parsePrismaDMMF", { enumerable: true, get: function () { return prismaParser_1.parsePrismaDMMF; } });
|
|
12
|
-
var datasourceParser_1 = require("./src/parsers/datasourceParser");
|
|
13
|
-
Object.defineProperty(exports, "parseDatasource", { enumerable: true, get: function () { return datasourceParser_1.parseDatasource; } });
|
|
14
|
-
var deepSQLAnalyzer_1 = require("./src/parsers/deepSQLAnalyzer");
|
|
15
|
-
Object.defineProperty(exports, "DeepSQLAnalyzer", { enumerable: true, get: function () { return deepSQLAnalyzer_1.DeepSQLAnalyzer; } });
|
|
16
|
-
var prismaFilterBuilder_1 = require("./src/parsers/prismaFilterBuilder");
|
|
17
|
-
Object.defineProperty(exports, "PrismaFilterBuilder", { enumerable: true, get: function () { return prismaFilterBuilder_1.PrismaFilterBuilder; } });
|
|
18
|
-
var enhancedRLSConverter_1 = require("./src/parsers/enhancedRLSConverter");
|
|
19
|
-
Object.defineProperty(exports, "createEnhancedConverter", { enumerable: true, get: function () { return enhancedRLSConverter_1.createEnhancedConverter; } });
|
|
20
|
-
var functionAnalyzer_1 = require("./src/parsers/functionAnalyzer");
|
|
21
|
-
Object.defineProperty(exports, "analyzeFunctions", { enumerable: true, get: function () { return functionAnalyzer_1.analyzeFunctions; } });
|
|
22
|
-
Object.defineProperty(exports, "generateMappingConfig", { enumerable: true, get: function () { return functionAnalyzer_1.generateMappingConfig; } });
|
|
23
12
|
// Generators
|
|
24
13
|
var modelGenerator_1 = require("./src/generators/modelGenerator");
|
|
25
14
|
Object.defineProperty(exports, "generateModelFile", { enumerable: true, get: function () { return modelGenerator_1.generateModelFile; } });
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";AAAA,iCAAiC;;;AAEjC,WAAW;AACX,8CAAmD;AAA1C,oGAAA,WAAW,OAAA;AAGpB,UAAU;AACV,2DAAgF;AAAvE,iHAAA,iBAAiB,OAAA;AAAE,+GAAA,eAAe,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";AAAA,iCAAiC;;;AAEjC,WAAW;AACX,8CAAmD;AAA1C,oGAAA,WAAW,OAAA;AAGpB,UAAU;AACV,2DAAgF;AAAvE,iHAAA,iBAAiB,OAAA;AAAE,+GAAA,eAAe,OAAA;AAG3C,aAAa;AACb,kEAAuF;AAA9E,mHAAA,iBAAiB,OAAA;AAAE,mHAAA,iBAAiB,OAAA;AAC7C,kEAAuF;AAA9E,mHAAA,iBAAiB,OAAA;AAAE,mHAAA,iBAAiB,OAAA;AAC7C,8DAA4D;AAAnD,2GAAA,WAAW,OAAA"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import type { ModelInfo } from '../parsers/
|
|
1
|
+
import type { ModelInfo } from '../parsers/types';
|
|
2
2
|
export interface BuildOptions {
|
|
3
3
|
schema: string;
|
|
4
4
|
output: string;
|
|
5
5
|
model?: string;
|
|
6
6
|
only?: 'model' | 'route' | 'acl';
|
|
7
|
-
userTable?: string;
|
|
8
|
-
debug?: boolean;
|
|
9
7
|
}
|
|
10
8
|
/**
|
|
11
9
|
* Build models from Prisma schema
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/commands/build.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/commands/build.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,KAAK,CAAC;CAClC;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAAC,KAAK,EAAE,GAAG,CAAA;CAAE,CAAC,CAoGnH"}
|
|
@@ -38,82 +38,9 @@ const fs = __importStar(require("fs"));
|
|
|
38
38
|
const path = __importStar(require("path"));
|
|
39
39
|
const child_process_1 = require("child_process");
|
|
40
40
|
const prismaParser_1 = require("../parsers/prismaParser");
|
|
41
|
-
const datasourceParser_1 = require("../parsers/datasourceParser");
|
|
42
41
|
const modelGenerator_1 = require("../generators/modelGenerator");
|
|
43
42
|
const routeGenerator_1 = require("../generators/routeGenerator");
|
|
44
43
|
const aclGenerator_1 = require("../generators/aclGenerator");
|
|
45
|
-
/**
|
|
46
|
-
* Update acl.ts for a specific model
|
|
47
|
-
*/
|
|
48
|
-
async function updateACLForModel(filteredModels, allModels, aclPath, datasource, userTable, debug = false) {
|
|
49
|
-
// Generate ACL for the filtered model (but pass all models for user table detection)
|
|
50
|
-
const tempPath = aclPath + '.tmp';
|
|
51
|
-
await (0, aclGenerator_1.generateACL)(filteredModels, tempPath, datasource.url, datasource.isPostgreSQL, userTable, {}, debug, allModels);
|
|
52
|
-
// Read the generated ACL for the specific model
|
|
53
|
-
const tempContent = fs.readFileSync(tempPath, 'utf8');
|
|
54
|
-
fs.unlinkSync(tempPath);
|
|
55
|
-
// Extract the model's ACL configuration
|
|
56
|
-
const modelName = Object.keys(filteredModels)[0];
|
|
57
|
-
// Find the start of the model definition
|
|
58
|
-
const modelStart = tempContent.indexOf(`${modelName}:`);
|
|
59
|
-
if (modelStart === -1) {
|
|
60
|
-
throw new Error(`Could not find model ${modelName} in generated RLS`);
|
|
61
|
-
}
|
|
62
|
-
// Find the matching closing brace by counting braces
|
|
63
|
-
let braceCount = 0;
|
|
64
|
-
let inString = false;
|
|
65
|
-
let stringChar = null;
|
|
66
|
-
let i = tempContent.indexOf('{', modelStart);
|
|
67
|
-
for (; i < tempContent.length; i++) {
|
|
68
|
-
const char = tempContent[i];
|
|
69
|
-
const prevChar = i > 0 ? tempContent[i - 1] : '';
|
|
70
|
-
// Handle string literals
|
|
71
|
-
if ((char === '"' || char === "'" || char === '`') && prevChar !== '\\') {
|
|
72
|
-
if (!inString) {
|
|
73
|
-
inString = true;
|
|
74
|
-
stringChar = char;
|
|
75
|
-
}
|
|
76
|
-
else if (char === stringChar) {
|
|
77
|
-
inString = false;
|
|
78
|
-
stringChar = null;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
if (!inString) {
|
|
82
|
-
if (char === '{')
|
|
83
|
-
braceCount++;
|
|
84
|
-
if (char === '}')
|
|
85
|
-
braceCount--;
|
|
86
|
-
if (braceCount === 0) {
|
|
87
|
-
// Found the closing brace
|
|
88
|
-
break;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
if (braceCount !== 0) {
|
|
93
|
-
throw new Error(`Could not extract ACL for model ${modelName} - unmatched braces`);
|
|
94
|
-
}
|
|
95
|
-
const modelAcl = tempContent.substring(modelStart, i + 1);
|
|
96
|
-
// Read existing acl.ts
|
|
97
|
-
if (fs.existsSync(aclPath)) {
|
|
98
|
-
let existingContent = fs.readFileSync(aclPath, 'utf8');
|
|
99
|
-
// Check if model already exists in ACL
|
|
100
|
-
const existingModelPattern = new RegExp(`${modelName}:\\s*\\{[\\s\\S]*?\\n \\}(?=,|\\n)`);
|
|
101
|
-
if (existingModelPattern.test(existingContent)) {
|
|
102
|
-
// Replace existing model ACL
|
|
103
|
-
existingContent = existingContent.replace(existingModelPattern, modelAcl);
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
// Add new model ACL before the closing of acl.model
|
|
107
|
-
existingContent = existingContent.replace(/(\n \})\n(\s*\},)/, `$1,\n ${modelAcl}\n$2`);
|
|
108
|
-
}
|
|
109
|
-
fs.writeFileSync(aclPath, existingContent);
|
|
110
|
-
console.log(`Updated ACL for model: ${modelName}`);
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
// If acl.ts doesn't exist, create it with just this model
|
|
114
|
-
await (0, aclGenerator_1.generateACL)(filteredModels, aclPath, datasource.url, datasource.isPostgreSQL, userTable, {}, debug, allModels);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
44
|
/**
|
|
118
45
|
* Build models from Prisma schema
|
|
119
46
|
*/
|
|
@@ -191,41 +118,9 @@ async function buildModels(options) {
|
|
|
191
118
|
if (shouldGenerate.model) {
|
|
192
119
|
(0, modelGenerator_1.generateAllModels)(filteredModels, modelDir);
|
|
193
120
|
}
|
|
194
|
-
// Parse datasource to determine database type
|
|
195
|
-
let datasource = { isPostgreSQL: true, url: null, provider: null, isMySQL: false };
|
|
196
|
-
try {
|
|
197
|
-
datasource = (0, datasourceParser_1.parseDatasource)(schemaPath);
|
|
198
|
-
}
|
|
199
|
-
catch (error) {
|
|
200
|
-
// Only warn if it's not the expected "No url found" error in Prisma 7
|
|
201
|
-
if (!error.message.includes('No url found')) {
|
|
202
|
-
console.warn('Could not parse datasource, assuming PostgreSQL:', error.message);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
121
|
// Generate ACL configuration
|
|
206
122
|
if (shouldGenerate.acl) {
|
|
207
|
-
|
|
208
|
-
try {
|
|
209
|
-
// For non-PostgreSQL databases (MySQL, SQLite, etc.), generate permissive ACL
|
|
210
|
-
if (!datasource.isPostgreSQL) {
|
|
211
|
-
console.log(`${datasource.provider || 'Non-PostgreSQL'} database detected - generating permissive ACL...`);
|
|
212
|
-
await (0, aclGenerator_1.generateACL)(models, aclPath, null, false, options.userTable, {}, options.debug);
|
|
213
|
-
}
|
|
214
|
-
else if (options.model) {
|
|
215
|
-
// Update only specific model in acl.ts
|
|
216
|
-
await updateACLForModel(filteredModels, models, aclPath, datasource, options.userTable, options.debug);
|
|
217
|
-
}
|
|
218
|
-
else {
|
|
219
|
-
// Generate ACL for all models
|
|
220
|
-
await (0, aclGenerator_1.generateACL)(models, aclPath, datasource.url, datasource.isPostgreSQL, options.userTable, {}, options.debug);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
catch (error) {
|
|
224
|
-
console.error('Failed to generate ACL:', error.message);
|
|
225
|
-
console.log('Generating permissive ACL fallback...');
|
|
226
|
-
// Pass null for URL and false for isPostgreSQL to skip database connection
|
|
227
|
-
await (0, aclGenerator_1.generateACL)(models, aclPath, null, false, options.userTable, {}, options.debug);
|
|
228
|
-
}
|
|
123
|
+
(0, aclGenerator_1.generateACL)(filteredModels, aclPath);
|
|
229
124
|
}
|
|
230
125
|
// Generate routes
|
|
231
126
|
if (shouldGenerate.route) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../../src/commands/build.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../../src/commands/build.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,kCAoGC;AAvHD,uCAAyB;AACzB,2CAA6B;AAC7B,iDAAyC;AACzC,0DAA6E;AAC7E,iEAAiE;AACjE,iEAAiE;AACjE,6DAAyD;AAUzD;;GAEG;AACI,KAAK,UAAU,WAAW,CAA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QACvB,IAAA,0BAAW,EAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC;IAED,kBAAkB;IAClB,IAAI,cAAc,CAAC,KAAK,EAAE,CAAC;QACzB,IAAA,kCAAiB,EAAC,cAAc,EAAE,SAAS,CAAC,CAAC;IAC/C,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AAC3B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ModelInfo
|
|
1
|
+
import type { ModelInfo } from '../parsers/types';
|
|
2
2
|
/**
|
|
3
3
|
* Generate complete acl.ts file (TypeScript)
|
|
4
4
|
*/
|
|
5
|
-
export declare function generateACL(models: Record<string, ModelInfo>, outputPath: string
|
|
5
|
+
export declare function generateACL(models: Record<string, ModelInfo>, outputPath: string): void;
|
|
6
6
|
//# sourceMappingURL=aclGenerator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aclGenerator.d.ts","sourceRoot":"","sources":["../../../src/generators/aclGenerator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"aclGenerator.d.ts","sourceRoot":"","sources":["../../../src/generators/aclGenerator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAyBlD;;GAEG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EACjC,UAAU,EAAE,MAAM,GACjB,IAAI,CAgCN"}
|