@hed-hog/developer-mode 0.0.194 → 0.0.197

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.
@@ -1 +1 @@
1
- {"version":3,"file":"developermode.controller.d.ts","sourceRoot":"","sources":["../src/developermode.controller.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,qBACa,uBAAuB;IAGtB,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IAFjD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA4C;gBAEtC,oBAAoB,EAAE,oBAAoB;IAIjE,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;IAM3B,eAAe,CACX,IAAI,EAAE,YAAY,EAChB,MAAM,EAAE,MAAM,EACjB,GAAG,EAAE,QAAQ;CAwEvB"}
1
+ {"version":3,"file":"developermode.controller.d.ts","sourceRoot":"","sources":["../src/developermode.controller.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,qBACa,uBAAuB;IAGtB,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IAFjD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA4C;gBAEtC,oBAAoB,EAAE,oBAAoB;IAGjE,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;IAM3B,eAAe,CACX,IAAI,EAAE,YAAY,EAChB,MAAM,EAAE,MAAM,EACjB,GAAG,EAAE,QAAQ;CAwEvB"}
@@ -14,7 +14,6 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
14
14
  var DeveloperModeController_1;
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.DeveloperModeController = void 0;
17
- const api_1 = require("@hed-hog/api");
18
17
  const api_locale_1 = require("@hed-hog/api-locale");
19
18
  const common_1 = require("@nestjs/common");
20
19
  const developermode_service_1 = require("./developermode.service");
@@ -87,7 +86,6 @@ let DeveloperModeController = DeveloperModeController_1 = class DeveloperModeCon
87
86
  };
88
87
  exports.DeveloperModeController = DeveloperModeController;
89
88
  __decorate([
90
- (0, api_1.Public)(),
91
89
  (0, common_1.Get)(),
92
90
  __metadata("design:type", Function),
93
91
  __metadata("design:paramtypes", []),
@@ -1 +1 @@
1
- {"version":3,"file":"developermode.controller.js","sourceRoot":"","sources":["../src/developermode.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sCAAsC;AACtC,oDAA6C;AAC7C,2CAAoF;AAEpF,mEAA+D;AAC/D,yDAAoD;AAG7C,IAAM,uBAAuB,+BAA7B,MAAM,uBAAuB;IAGlC,YAA6B,oBAA0C;QAA1C,yBAAoB,GAApB,oBAAoB,CAAsB;QAFtD,WAAM,GAAG,IAAI,eAAM,CAAC,yBAAuB,CAAC,IAAI,CAAC,CAAC;IAEO,CAAC;IAIrE,AAAN,KAAK,CAAC,OAAO;QACX,OAAO,IAAI,CAAC,oBAAoB,CAAC,oBAAoB,EAAE,CAAC;IAC1D,CAAC;IAIK,AAAN,KAAK,CAAC,eAAe,CACX,IAAkB,EAChB,MAAc,EACjB,GAAa;QAEpB,IAAI,CAAC,MAAM,CAAC,GAAG,CACb,yBAAyB,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,OAAO,IAAI,CAAC,UAAU,EAAE,CACpF,CAAC;QAEF,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,mBAAmB,CAAC,CAAC;QACnD,GAAG,CAAC,SAAS,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;QAC3C,GAAG,CAAC,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC,CA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AE,OAAO,EAAE,EAAE;gBACjB,SAAS,CAAC,KAAK,EAAE;oBACf,OAAO;oBACP,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;iBACpC,CAAC,CAAC;YACL,CAAC,CACF,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,SAAS,CAAC,OAAO,EAAE;gBACjB,OAAO,EACL,KAAK,YAAY,KAAK;oBACpB,CAAC,CAAC,KAAK,CAAC,OAAO;oBACf,CAAC,CAAC,uCAAuC;gBAC7C,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;aACpC,CAAC,CAAC;YACH,SAAS,CAAC,KAAK,EAAE;gBACf,OAAO,EAAE,KAAK;gBACd,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;aACpC,CAAC,CAAC;QACL,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,GAAG,CAAC,GAAG,EAAE,CAAC;YACZ,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAvFY,0DAAuB;AAM5B;IADL,IAAA,YAAG,GAAE;;;;sDAGL;AAIK;IAFL,IAAA,aAAI,EAAC,gBAAgB,CAAC;IACtB,IAAA,iBAAQ,EAAC,GAAG,CAAC;IAEX,WAAA,IAAA,aAAI,GAAE,CAAA;IACN,WAAA,IAAA,mBAAM,GAAE,CAAA;IACR,WAAA,IAAA,YAAG,GAAE,CAAA;;qCAFQ,6BAAY;;8DAyE3B;kCAtFU,uBAAuB;IADnC,IAAA,mBAAU,EAAC,gBAAgB,CAAC;qCAIwB,4CAAoB;GAH5D,uBAAuB,CAuFnC"}
@@ -0,0 +1,557 @@
1
+ import {
2
+ Database,
3
+ FileCode,
4
+ Package,
5
+ Plus,
6
+ RefreshCw,
7
+ Rocket,
8
+ RotateCcw,
9
+ Upload,
10
+ } from 'lucide-react';
11
+ import * as React from 'react';
12
+ import {
13
+ AngularIcon,
14
+ ExpoIcon,
15
+ NestJSIcon,
16
+ NextJSIcon,
17
+ ReactNativeIcon,
18
+ VueIcon,
19
+ } from './icons';
20
+ import {
21
+ AppInfo,
22
+ CommitInfo,
23
+ FrameworkType,
24
+ LibraryInfo,
25
+ QuickAction,
26
+ WizardConfig,
27
+ WizardSelectOption,
28
+ } from './types';
29
+
30
+ export type TranslationFn = (
31
+ key: string,
32
+ values?: Record<string, string | number>
33
+ ) => string;
34
+
35
+ export const frameworkIcons: Record<FrameworkType, React.ReactNode> = {
36
+ nestjs: <NestJSIcon className="h-8 w-8" />,
37
+ nextjs: <NextJSIcon className="h-8 w-8" />,
38
+ angular: <AngularIcon className="h-8 w-8" />,
39
+ vue: <VueIcon className="h-8 w-8" />,
40
+ 'react-native': <ReactNativeIcon className="h-8 w-8" />,
41
+ expo: <ExpoIcon className="h-8 w-8" />,
42
+ };
43
+
44
+ export function getFrameworkLabel(framework: FrameworkType, t: TranslationFn) {
45
+ return t(`framework.${framework}`);
46
+ }
47
+
48
+ export const statusColors: Record<string, string> = {
49
+ running: 'bg-success/20 text-success border-success/30',
50
+ stopped: 'bg-muted text-muted-foreground border-border',
51
+ error: 'bg-destructive/20 text-destructive border-destructive/30',
52
+ };
53
+
54
+ export function getStatusLabel(status: string, t: TranslationFn) {
55
+ return t(`status.${status}`);
56
+ }
57
+
58
+ export function getQuickActions(t: TranslationFn): QuickAction[] {
59
+ return [
60
+ {
61
+ id: 'create-module',
62
+ label: t('quickActions.createModule.label'),
63
+ description: t('quickActions.createModule.description'),
64
+ icon: <Plus className="h-4 w-4" />,
65
+ variant: 'accent',
66
+ },
67
+ {
68
+ id: 'add-module',
69
+ label: t('quickActions.addModule.label'),
70
+ description: t('quickActions.addModule.description'),
71
+ icon: <Package className="h-4 w-4" />,
72
+ variant: 'default',
73
+ },
74
+ {
75
+ id: 'reset-modules',
76
+ label: t('quickActions.resetModules.label'),
77
+ description: t('quickActions.resetModules.description'),
78
+ icon: <RotateCcw className="h-4 w-4" />,
79
+ variant: 'warning',
80
+ },
81
+ {
82
+ id: 'update-types',
83
+ label: t('quickActions.updateTypes.label'),
84
+ description: t('quickActions.updateTypes.description'),
85
+ icon: <Database className="h-4 w-4" />,
86
+ variant: 'info',
87
+ },
88
+ {
89
+ id: 'deploy-migrations',
90
+ label: t('quickActions.deployMigrations.label'),
91
+ description: t('quickActions.deployMigrations.description'),
92
+ icon: <Upload className="h-4 w-4" />,
93
+ variant: 'default',
94
+ },
95
+ {
96
+ id: 'deploy-library',
97
+ label: t('quickActions.deployLibrary.label'),
98
+ description: t('quickActions.deployLibrary.description'),
99
+ icon: <Rocket className="h-4 w-4" />,
100
+ variant: 'default',
101
+ },
102
+ {
103
+ id: 'generate-crud',
104
+ label: t('quickActions.generateCrud.label'),
105
+ description: t('quickActions.generateCrud.description'),
106
+ icon: <FileCode className="h-4 w-4" />,
107
+ variant: 'info',
108
+ },
109
+ {
110
+ id: 'sync-prisma',
111
+ label: t('quickActions.syncPrisma.label'),
112
+ description: t('quickActions.syncPrisma.description'),
113
+ icon: <RefreshCw className="h-4 w-4" />,
114
+ variant: 'default',
115
+ },
116
+ ];
117
+ }
118
+
119
+ export const variantStyles: Record<string, string> = {
120
+ default: 'hover:bg-secondary/80 hover:border-border',
121
+ warning: 'hover:bg-warning/10 hover:border-warning/30 hover:text-warning',
122
+ info: 'hover:bg-info/10 hover:border-info/30 hover:text-info',
123
+ accent: 'hover:bg-accent/10 hover:border-accent/30 hover:text-accent',
124
+ };
125
+
126
+ export const mockStats = {
127
+ nodeVersion: 'v20.11.0',
128
+ diskUsage: '2.4 GB',
129
+ totalApps: 3,
130
+ totalLibraries: 12,
131
+ dbConnections: 5,
132
+ gitBranch: 'main',
133
+ lastCommit: '2h ago',
134
+ uptime: '3d 12h',
135
+ };
136
+
137
+ export function getMockApps(t: TranslationFn): AppInfo[] {
138
+ return [
139
+ {
140
+ name: 'api',
141
+ path: '/apps/api',
142
+ framework: 'nestjs',
143
+ database: 'postgresql',
144
+ description: t('mock.apps.api.description'),
145
+ port: 3001,
146
+ status: 'running',
147
+ scripts: ['dev', 'build', 'test', 'lint'],
148
+ },
149
+ {
150
+ name: 'admin',
151
+ path: '/apps/admin',
152
+ framework: 'nextjs',
153
+ description: t('mock.apps.admin.description'),
154
+ port: 3000,
155
+ status: 'running',
156
+ scripts: ['dev', 'build', 'start', 'lint'],
157
+ },
158
+ {
159
+ name: 'mobile',
160
+ path: '/apps/mobile',
161
+ framework: 'expo',
162
+ description: t('mock.apps.mobile.description'),
163
+ status: 'stopped',
164
+ scripts: ['start', 'android', 'ios', 'web'],
165
+ },
166
+ ];
167
+ }
168
+
169
+ export function getMockLibraries(t: TranslationFn): LibraryInfo[] {
170
+ return [
171
+ {
172
+ name: 'core',
173
+ version: '1.2.3',
174
+ latestVersion: '1.2.3',
175
+ installed: true,
176
+ description: t('mock.libraries.core.description'),
177
+ scripts: [
178
+ { name: 'build', command: 'npm run build' },
179
+ { name: 'test', command: 'npm run test' },
180
+ { name: 'lint', command: 'npm run lint' },
181
+ ],
182
+ },
183
+ {
184
+ name: 'contact',
185
+ version: '1.1.0',
186
+ latestVersion: '1.2.0',
187
+ installed: true,
188
+ description: t('mock.libraries.contact.description'),
189
+ scripts: [
190
+ { name: 'build', command: 'npm run build' },
191
+ { name: 'migrate', command: 'npm run migrate' },
192
+ ],
193
+ },
194
+ {
195
+ name: 'contact-us',
196
+ version: '1.0.5',
197
+ latestVersion: '1.0.5',
198
+ installed: true,
199
+ description: t('mock.libraries.contactUs.description'),
200
+ scripts: [{ name: 'build', command: 'npm run build' }],
201
+ },
202
+ {
203
+ name: 'faq',
204
+ version: '1.0.0',
205
+ latestVersion: '1.1.0',
206
+ installed: true,
207
+ description: t('mock.libraries.faq.description'),
208
+ scripts: [
209
+ { name: 'build', command: 'npm run build' },
210
+ { name: 'seed', command: 'npm run seed' },
211
+ ],
212
+ },
213
+ {
214
+ name: 'tag',
215
+ version: '1.0.2',
216
+ installed: true,
217
+ description: t('mock.libraries.tag.description'),
218
+ scripts: [{ name: 'build', command: 'npm run build' }],
219
+ },
220
+ {
221
+ name: 'content',
222
+ version: '1.3.0',
223
+ installed: false,
224
+ description: t('mock.libraries.content.description'),
225
+ scripts: [],
226
+ },
227
+ {
228
+ name: 'category',
229
+ version: '1.0.0',
230
+ installed: false,
231
+ description: t('mock.libraries.category.description'),
232
+ scripts: [],
233
+ },
234
+ ];
235
+ }
236
+
237
+ export const mockActivityData = [
238
+ { date: 'Mon', commits: 12, builds: 8, deploys: 2 },
239
+ { date: 'Tue', commits: 8, builds: 5, deploys: 1 },
240
+ { date: 'Wed', commits: 15, builds: 10, deploys: 3 },
241
+ { date: 'Thu', commits: 6, builds: 4, deploys: 0 },
242
+ { date: 'Fri', commits: 20, builds: 12, deploys: 4 },
243
+ { date: 'Sat', commits: 3, builds: 2, deploys: 0 },
244
+ { date: 'Sun', commits: 5, builds: 3, deploys: 1 },
245
+ ];
246
+
247
+ export function getMockCommits(t: TranslationFn): CommitInfo[] {
248
+ return [
249
+ {
250
+ hash: 'a1b2c3d4',
251
+ message: t('mock.commits.one.message'),
252
+ author: 'John Doe',
253
+ date: t('mock.commits.one.date'),
254
+ branch: 'main',
255
+ },
256
+ {
257
+ hash: 'e5f6g7h8',
258
+ message: t('mock.commits.two.message'),
259
+ author: 'Jane Smith',
260
+ date: t('mock.commits.two.date'),
261
+ branch: 'main',
262
+ },
263
+ {
264
+ hash: 'i9j0k1l2',
265
+ message: t('mock.commits.three.message'),
266
+ author: 'John Doe',
267
+ date: t('mock.commits.three.date'),
268
+ branch: 'main',
269
+ },
270
+ {
271
+ hash: 'm3n4o5p6',
272
+ message: t('mock.commits.four.message'),
273
+ author: 'Jane Smith',
274
+ date: t('mock.commits.four.date'),
275
+ branch: 'main',
276
+ },
277
+ ];
278
+ }
279
+
280
+ export function getModuleOptions(t: TranslationFn): WizardSelectOption[] {
281
+ return [
282
+ {
283
+ value: 'core',
284
+ label: 'core',
285
+ description: t('moduleOptions.core'),
286
+ },
287
+ {
288
+ value: 'contact',
289
+ label: 'contact',
290
+ description: t('moduleOptions.contact'),
291
+ },
292
+ {
293
+ value: 'contact-us',
294
+ label: 'contact-us',
295
+ description: t('moduleOptions.contactUs'),
296
+ },
297
+ {
298
+ value: 'faq',
299
+ label: 'faq',
300
+ description: t('moduleOptions.faq'),
301
+ },
302
+ {
303
+ value: 'tag',
304
+ label: 'tag',
305
+ description: t('moduleOptions.tag'),
306
+ },
307
+ {
308
+ value: 'content',
309
+ label: 'content',
310
+ description: t('moduleOptions.content'),
311
+ },
312
+ {
313
+ value: 'category',
314
+ label: 'category',
315
+ description: t('moduleOptions.category'),
316
+ },
317
+ ];
318
+ }
319
+
320
+ export function getWizardConfig(
321
+ actionId: string,
322
+ t: TranslationFn
323
+ ): WizardConfig | null {
324
+ const moduleOptions = getModuleOptions(t);
325
+ const mockLibraries = getMockLibraries(t);
326
+
327
+ switch (actionId) {
328
+ case 'create-module':
329
+ return {
330
+ id: 'create-module',
331
+ title: t('wizards.createModule.title'),
332
+ icon: <Plus className="h-5 w-5" />,
333
+ steps: [
334
+ {
335
+ id: 'intro',
336
+ title: t('wizards.createModule.steps.intro.title'),
337
+ description: t('wizards.createModule.steps.intro.description'),
338
+ type: 'info',
339
+ },
340
+ {
341
+ id: 'config',
342
+ title: t('wizards.createModule.steps.config.title'),
343
+ description: t('wizards.createModule.steps.config.description'),
344
+ type: 'form',
345
+ },
346
+ {
347
+ id: 'dependencies',
348
+ title: t('wizards.createModule.steps.dependencies.title'),
349
+ description: t(
350
+ 'wizards.createModule.steps.dependencies.description'
351
+ ),
352
+ type: 'select',
353
+ },
354
+ {
355
+ id: 'progress',
356
+ title: t('wizards.createModule.steps.progress.title'),
357
+ description: t('wizards.createModule.steps.progress.description'),
358
+ type: 'progress',
359
+ },
360
+ ],
361
+ formFields: [
362
+ {
363
+ name: 'moduleName',
364
+ label: t('wizards.createModule.fields.moduleName.label'),
365
+ placeholder: t(
366
+ 'wizards.createModule.fields.moduleName.placeholder'
367
+ ),
368
+ required: true,
369
+ },
370
+ {
371
+ name: 'description',
372
+ label: t('wizards.createModule.fields.description.label'),
373
+ placeholder: t(
374
+ 'wizards.createModule.fields.description.placeholder'
375
+ ),
376
+ },
377
+ ],
378
+ selectOptions: moduleOptions,
379
+ selectMultiple: true,
380
+ };
381
+ case 'add-module':
382
+ return {
383
+ id: 'add-module',
384
+ title: t('wizards.addModule.title'),
385
+ icon: <Package className="h-5 w-5" />,
386
+ steps: [
387
+ {
388
+ id: 'select',
389
+ title: t('wizards.addModule.steps.select.title'),
390
+ description: t('wizards.addModule.steps.select.description'),
391
+ type: 'select',
392
+ },
393
+ {
394
+ id: 'progress',
395
+ title: t('wizards.addModule.steps.progress.title'),
396
+ description: t('wizards.addModule.steps.progress.description'),
397
+ type: 'progress',
398
+ },
399
+ ],
400
+ selectOptions: moduleOptions.filter(
401
+ (moduleOption) =>
402
+ !mockLibraries.find(
403
+ (library) =>
404
+ library.name === moduleOption.value && library.installed
405
+ )
406
+ ),
407
+ selectMultiple: false,
408
+ };
409
+ case 'reset-modules':
410
+ return {
411
+ id: 'reset-modules',
412
+ title: t('wizards.resetModules.title'),
413
+ icon: <RotateCcw className="h-5 w-5" />,
414
+ steps: [
415
+ {
416
+ id: 'warning',
417
+ title: t('wizards.resetModules.steps.warning.title'),
418
+ description: t('wizards.resetModules.steps.warning.description'),
419
+ type: 'info',
420
+ },
421
+ {
422
+ id: 'progress',
423
+ title: t('wizards.resetModules.steps.progress.title'),
424
+ description: t('wizards.resetModules.steps.progress.description'),
425
+ type: 'progress',
426
+ },
427
+ ],
428
+ };
429
+ case 'update-types':
430
+ return {
431
+ id: 'update-types',
432
+ title: t('wizards.updateTypes.title'),
433
+ icon: <Database className="h-5 w-5" />,
434
+ steps: [
435
+ {
436
+ id: 'info',
437
+ title: t('wizards.updateTypes.steps.info.title'),
438
+ description: t('wizards.updateTypes.steps.info.description'),
439
+ type: 'info',
440
+ },
441
+ {
442
+ id: 'progress',
443
+ title: t('wizards.updateTypes.steps.progress.title'),
444
+ description: t('wizards.updateTypes.steps.progress.description'),
445
+ type: 'progress',
446
+ },
447
+ ],
448
+ };
449
+ case 'deploy-migrations':
450
+ return {
451
+ id: 'deploy-migrations',
452
+ title: t('wizards.deployMigrations.title'),
453
+ icon: <Upload className="h-5 w-5" />,
454
+ steps: [
455
+ {
456
+ id: 'info',
457
+ title: t('wizards.deployMigrations.steps.info.title'),
458
+ description: t('wizards.deployMigrations.steps.info.description'),
459
+ type: 'info',
460
+ },
461
+ {
462
+ id: 'progress',
463
+ title: t('wizards.deployMigrations.steps.progress.title'),
464
+ description: t(
465
+ 'wizards.deployMigrations.steps.progress.description'
466
+ ),
467
+ type: 'progress',
468
+ },
469
+ ],
470
+ };
471
+ case 'deploy-library':
472
+ return {
473
+ id: 'deploy-library',
474
+ title: t('wizards.deployLibrary.title'),
475
+ icon: <Rocket className="h-5 w-5" />,
476
+ steps: [
477
+ {
478
+ id: 'select',
479
+ title: t('wizards.deployLibrary.steps.select.title'),
480
+ description: t('wizards.deployLibrary.steps.select.description'),
481
+ type: 'select',
482
+ },
483
+ {
484
+ id: 'progress',
485
+ title: t('wizards.deployLibrary.steps.progress.title'),
486
+ description: t('wizards.deployLibrary.steps.progress.description'),
487
+ type: 'progress',
488
+ },
489
+ ],
490
+ selectOptions: mockLibraries
491
+ .filter((library) => library.installed)
492
+ .map((library) => ({
493
+ value: library.name,
494
+ label: library.name,
495
+ description: library.description,
496
+ })),
497
+ selectMultiple: false,
498
+ };
499
+ case 'generate-crud':
500
+ return {
501
+ id: 'generate-crud',
502
+ title: t('wizards.generateCrud.title'),
503
+ icon: <FileCode className="h-5 w-5" />,
504
+ steps: [
505
+ {
506
+ id: 'config',
507
+ title: t('wizards.generateCrud.steps.config.title'),
508
+ description: t('wizards.generateCrud.steps.config.description'),
509
+ type: 'form',
510
+ },
511
+ {
512
+ id: 'progress',
513
+ title: t('wizards.generateCrud.steps.progress.title'),
514
+ description: t('wizards.generateCrud.steps.progress.description'),
515
+ type: 'progress',
516
+ },
517
+ ],
518
+ formFields: [
519
+ {
520
+ name: 'entityName',
521
+ label: t('wizards.generateCrud.fields.entityName.label'),
522
+ placeholder: t(
523
+ 'wizards.generateCrud.fields.entityName.placeholder'
524
+ ),
525
+ required: true,
526
+ },
527
+ {
528
+ name: 'tableName',
529
+ label: t('wizards.generateCrud.fields.tableName.label'),
530
+ placeholder: t('wizards.generateCrud.fields.tableName.placeholder'),
531
+ },
532
+ ],
533
+ };
534
+ case 'sync-prisma':
535
+ return {
536
+ id: 'sync-prisma',
537
+ title: t('wizards.syncPrisma.title'),
538
+ icon: <RefreshCw className="h-5 w-5" />,
539
+ steps: [
540
+ {
541
+ id: 'info',
542
+ title: t('wizards.syncPrisma.steps.info.title'),
543
+ description: t('wizards.syncPrisma.steps.info.description'),
544
+ type: 'info',
545
+ },
546
+ {
547
+ id: 'progress',
548
+ title: t('wizards.syncPrisma.steps.progress.title'),
549
+ description: t('wizards.syncPrisma.steps.progress.description'),
550
+ type: 'progress',
551
+ },
552
+ ],
553
+ };
554
+ default:
555
+ return null;
556
+ }
557
+ }