@diagramers/cli 1.1.12 → 1.1.13
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 +180 -0
- package/package.json +1 -1
package/README.md
CHANGED
@@ -231,6 +231,113 @@ diagramers extend --list
|
|
231
231
|
diagramers extend --feature <feature-name>
|
232
232
|
```
|
233
233
|
|
234
|
+
### Email System Management
|
235
|
+
|
236
|
+
#### Generate Email Module
|
237
|
+
```bash
|
238
|
+
diagramers extend --module email --crud
|
239
|
+
```
|
240
|
+
|
241
|
+
#### Add Email Configuration Table
|
242
|
+
```bash
|
243
|
+
diagramers extend --table email:configs --fields provider,code,credentials,fromName,fromEmail,default
|
244
|
+
```
|
245
|
+
|
246
|
+
#### Add Email Templates Table
|
247
|
+
```bash
|
248
|
+
diagramers extend --table email:templates --fields name,subject,body,isActive,createdAt
|
249
|
+
```
|
250
|
+
|
251
|
+
#### Add Email Logs Table
|
252
|
+
```bash
|
253
|
+
diagramers extend --table email:logs --fields to,subject,status,provider,error,createdAt
|
254
|
+
```
|
255
|
+
|
256
|
+
#### Create Email Relations
|
257
|
+
```bash
|
258
|
+
# One-to-many: User to Email Configs
|
259
|
+
diagramers extend --relation email:user-config:one-to-many
|
260
|
+
|
261
|
+
# One-to-many: Email Config to Email Logs
|
262
|
+
diagramers extend --relation email:config-log:one-to-many
|
263
|
+
```
|
264
|
+
|
265
|
+
#### Add Email Endpoints
|
266
|
+
```bash
|
267
|
+
# Send email endpoint
|
268
|
+
diagramers extend --endpoint email:send --method POST --description "Send email using configured provider"
|
269
|
+
|
270
|
+
# Test email endpoint
|
271
|
+
diagramers extend --endpoint email:test --method POST --description "Test email configuration"
|
272
|
+
|
273
|
+
# Get email statistics
|
274
|
+
diagramers extend --endpoint email:stats --method GET --description "Get email sending statistics"
|
275
|
+
```
|
276
|
+
|
277
|
+
#### Email Provider Setup Commands
|
278
|
+
```bash
|
279
|
+
# Add Gmail SMTP configuration
|
280
|
+
diagramers extend --endpoint email:setup-gmail --method POST --description "Setup Gmail SMTP configuration"
|
281
|
+
|
282
|
+
# Add SendGrid configuration
|
283
|
+
diagramers extend --endpoint email:setup-sendgrid --method POST --description "Setup SendGrid configuration"
|
284
|
+
|
285
|
+
# Add AWS SES configuration
|
286
|
+
diagramers extend --endpoint email:setup-ses --method POST --description "Setup AWS SES configuration"
|
287
|
+
```
|
288
|
+
|
289
|
+
### User Management System
|
290
|
+
|
291
|
+
#### Generate User Module
|
292
|
+
```bash
|
293
|
+
diagramers extend --module users --crud
|
294
|
+
```
|
295
|
+
|
296
|
+
#### Add User Profile Table
|
297
|
+
```bash
|
298
|
+
diagramers extend --table users:profiles --fields bio,avatar,socialLinks,location,website,birthDate,preferences
|
299
|
+
```
|
300
|
+
|
301
|
+
#### Add User Sessions Table
|
302
|
+
```bash
|
303
|
+
diagramers extend --table users:sessions --fields userId,deviceInfo,ipAddress,userAgent,isActive,lastActivity
|
304
|
+
```
|
305
|
+
|
306
|
+
#### Add User Activity Table
|
307
|
+
```bash
|
308
|
+
diagramers extend --table users:activities --fields userId,action,details,ipAddress,userAgent,timestamp
|
309
|
+
```
|
310
|
+
|
311
|
+
#### Create User Relations
|
312
|
+
```bash
|
313
|
+
# One-to-one: User to Profile
|
314
|
+
diagramers extend --relation users:user-profile:one-to-one
|
315
|
+
|
316
|
+
# One-to-many: User to Sessions
|
317
|
+
diagramers extend --relation users:user-session:one-to-many
|
318
|
+
|
319
|
+
# One-to-many: User to Activities
|
320
|
+
diagramers extend --relation users:user-activity:one-to-many
|
321
|
+
```
|
322
|
+
|
323
|
+
#### Add User Endpoints
|
324
|
+
```bash
|
325
|
+
# User profile management
|
326
|
+
diagramers extend --endpoint users:profile --method GET --description "Get user profile"
|
327
|
+
diagramers extend --endpoint users:update-profile --method PUT --description "Update user profile"
|
328
|
+
diagramers extend --endpoint users:upload-avatar --method POST --description "Upload user avatar"
|
329
|
+
|
330
|
+
# User administration
|
331
|
+
diagramers extend --endpoint users:list --method GET --description "List all users (admin)"
|
332
|
+
diagramers extend --endpoint users:create --method POST --description "Create user (admin)"
|
333
|
+
diagramers extend --endpoint users:update --method PUT --description "Update user (admin)"
|
334
|
+
diagramers extend --endpoint users:delete --method DELETE --description "Delete user (admin)"
|
335
|
+
|
336
|
+
# User statistics
|
337
|
+
diagramers extend --endpoint users:stats --method GET --description "Get user statistics"
|
338
|
+
diagramers extend --endpoint users:activity --method GET --description "Get user activity"
|
339
|
+
```
|
340
|
+
|
234
341
|
## 🔧 Workflow Examples
|
235
342
|
|
236
343
|
### Complete Product Management System
|
@@ -277,6 +384,79 @@ diagramers extend --endpoint users:update-profile --method PUT
|
|
277
384
|
diagramers extend --endpoint users:get-profile --method GET
|
278
385
|
```
|
279
386
|
|
387
|
+
### Complete Email System Setup
|
388
|
+
|
389
|
+
```bash
|
390
|
+
# 1. Generate email module with CRUD operations
|
391
|
+
diagramers extend --module email --crud
|
392
|
+
|
393
|
+
# 2. Add email configurations table
|
394
|
+
diagramers extend --table email:configs --fields provider,code,credentials,fromName,fromEmail,default
|
395
|
+
|
396
|
+
# 3. Add email templates table
|
397
|
+
diagramers extend --table email:templates --fields name,subject,body,isActive,createdAt
|
398
|
+
|
399
|
+
# 4. Add email logs table for tracking
|
400
|
+
diagramers extend --table email:logs --fields to,subject,status,provider,error,createdAt
|
401
|
+
|
402
|
+
# 5. Create relationships
|
403
|
+
diagramers extend --relation email:user-config:one-to-many
|
404
|
+
diagramers extend --relation email:config-log:one-to-many
|
405
|
+
|
406
|
+
# 6. Add email-specific endpoints
|
407
|
+
diagramers extend --endpoint email:send --method POST --description "Send email using configured provider"
|
408
|
+
diagramers extend --endpoint email:test --method POST --description "Test email configuration"
|
409
|
+
diagramers extend --endpoint email:stats --method GET --description "Get email sending statistics"
|
410
|
+
|
411
|
+
# 7. Add provider setup endpoints
|
412
|
+
diagramers extend --endpoint email:setup-gmail --method POST --description "Setup Gmail SMTP configuration"
|
413
|
+
diagramers extend --endpoint email:setup-sendgrid --method POST --description "Setup SendGrid configuration"
|
414
|
+
|
415
|
+
# 8. Install dependencies and start
|
416
|
+
npm install
|
417
|
+
npm start
|
418
|
+
```
|
419
|
+
|
420
|
+
### Complete User Management System Setup
|
421
|
+
|
422
|
+
```bash
|
423
|
+
# 1. Generate users module with CRUD operations
|
424
|
+
diagramers extend --module users --crud
|
425
|
+
|
426
|
+
# 2. Add user profiles table
|
427
|
+
diagramers extend --table users:profiles --fields bio,avatar,socialLinks,location,website,birthDate,preferences
|
428
|
+
|
429
|
+
# 3. Add user sessions table for tracking
|
430
|
+
diagramers extend --table users:sessions --fields userId,deviceInfo,ipAddress,userAgent,isActive,lastActivity
|
431
|
+
|
432
|
+
# 4. Add user activity table for audit
|
433
|
+
diagramers extend --table users:activities --fields userId,action,details,ipAddress,userAgent,timestamp
|
434
|
+
|
435
|
+
# 5. Create user relationships
|
436
|
+
diagramers extend --relation users:user-profile:one-to-one
|
437
|
+
diagramers extend --relation users:user-session:one-to-many
|
438
|
+
diagramers extend --relation users:user-activity:one-to-many
|
439
|
+
|
440
|
+
# 6. Add user profile endpoints
|
441
|
+
diagramers extend --endpoint users:profile --method GET --description "Get user profile"
|
442
|
+
diagramers extend --endpoint users:update-profile --method PUT --description "Update user profile"
|
443
|
+
diagramers extend --endpoint users:upload-avatar --method POST --description "Upload user avatar"
|
444
|
+
|
445
|
+
# 7. Add user administration endpoints
|
446
|
+
diagramers extend --endpoint users:list --method GET --description "List all users (admin)"
|
447
|
+
diagramers extend --endpoint users:create --method POST --description "Create user (admin)"
|
448
|
+
diagramers extend --endpoint users:update --method PUT --description "Update user (admin)"
|
449
|
+
diagramers extend --endpoint users:delete --method DELETE --description "Delete user (admin)"
|
450
|
+
|
451
|
+
# 8. Add user analytics endpoints
|
452
|
+
diagramers extend --endpoint users:stats --method GET --description "Get user statistics"
|
453
|
+
diagramers extend --endpoint users:activity --method GET --description "Get user activity"
|
454
|
+
|
455
|
+
# 9. Install dependencies and start
|
456
|
+
npm install
|
457
|
+
npm start
|
458
|
+
```
|
459
|
+
|
280
460
|
## 🛠️ Advanced Usage
|
281
461
|
|
282
462
|
### Database Seeding
|