create-fullstack-scaffold 0.4.2 → 0.4.4

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.
Files changed (156) hide show
  1. package/dist/cli/index.js +513 -122
  2. package/dist/cli/index.js.map +1 -1
  3. package/package.json +1 -1
  4. package/template/dist/cli/index.js +237 -94
  5. package/template/dist/cli/index.js.map +1 -1
  6. package/template/dist/client/admin.html +15 -10
  7. package/template/dist/client/assets/App-BpFUIC-5.js +114 -0
  8. package/template/dist/client/assets/{CartPage-DESSHkaG.js → CartPage-DgDZP-R5.js} +2 -2
  9. package/template/dist/client/assets/{CategoriesPage-DqLZ_Mom.js → CategoriesPage-fuYNiSmE.js} +2 -2
  10. package/template/dist/client/assets/ContentDetailPage-BvvFU1Mr.js +1 -0
  11. package/template/dist/client/assets/ContentListPage-ShPxo6WG.js +1 -0
  12. package/template/dist/client/assets/DashboardPage-C1rZzZo4.js +11 -0
  13. package/template/dist/client/assets/{DeveloperDashboardPage-Cum7zFwO.js → DeveloperDashboardPage-_WtmbVoA.js} +2 -2
  14. package/template/dist/client/assets/{EmptyState-BK7ttK8D.js → EmptyState-DEyOQjbY.js} +1 -1
  15. package/template/dist/client/assets/LoadingSpinner-BcHjaM1m.js +6 -0
  16. package/template/dist/client/assets/LoginPage-CjeQqDdO.js +1 -0
  17. package/template/dist/client/assets/LogoutOutlined-ColFAHdd.js +1 -0
  18. package/template/dist/client/assets/NotificationPage-DRkEv02s.js +1 -0
  19. package/template/dist/client/assets/OrdersPage-7I3vPWLP.js +11 -0
  20. package/template/dist/client/assets/{PluginDetailPage-Br24YS4P.js → PluginDetailPage-CWyxdVCg.js} +3 -13
  21. package/template/dist/client/assets/PluginsPage-DRgWLeJT.js +6 -0
  22. package/template/dist/client/assets/ProfilePage-2FFkaii8.js +16 -0
  23. package/template/dist/client/assets/PublishPage-DW7yvROx.js +1 -0
  24. package/template/dist/client/assets/{RegisterPage-rPFG4Sry.js → RegisterPage-Dvaf9b0e.js} +2 -2
  25. package/template/dist/client/assets/SaveOutlined-CLQ2tsSY.js +2 -0
  26. package/template/dist/client/assets/{SearchPage-DQl1U5Uy.js → SearchPage-DvnEyswS.js} +2 -2
  27. package/template/dist/client/assets/{SettingsPage-DaYE80wj.js → SettingsPage-IrU-L9Zr.js} +2 -2
  28. package/template/dist/client/assets/{StatusBadge-BJ3W2Zc7.js → StatusBadge-CG7wVqpu.js} +1 -1
  29. package/template/dist/client/assets/{TodoPage-zC5wWNBa.js → TodoPage-B7D-bl65.js} +3 -3
  30. package/template/dist/client/assets/TopicsPage-CYCNr-mn.js +6 -0
  31. package/template/dist/client/assets/{WebSocketPage-B4NLdz1w.js → WebSocketPage-CGEg6QJE.js} +2 -2
  32. package/template/dist/client/assets/{activity-B94BUAsD.js → activity-CgTz9Mrd.js} +1 -1
  33. package/template/dist/client/assets/admin-D2iHWNOg.js +1 -0
  34. package/template/dist/client/assets/api-request-DIJocPxr.js +356 -0
  35. package/template/dist/client/assets/{arrow-left-H5JH0iU1.js → arrow-left-DtLQ3tTk.js} +1 -1
  36. package/template/dist/client/assets/{chevron-down-DwRh_wjD.js → chevron-down-CpIAV_yr.js} +1 -1
  37. package/template/dist/client/assets/{chevron-right-CpIWaqAL.js → chevron-right-CnU7oPQs.js} +1 -1
  38. package/template/dist/client/assets/{circle-check-big-CSElLscG.js → circle-check-big-CrZdwS75.js} +1 -1
  39. package/template/dist/client/assets/{circle-x-CYxr4RAw.js → circle-x-CvN9r3fW.js} +1 -1
  40. package/template/dist/client/assets/{clock-BseUJ7ex.js → clock-CTeSZBiH.js} +1 -1
  41. package/template/dist/client/assets/{download-BsGC_Xhq.js → download-OSVfVuNV.js} +1 -1
  42. package/template/dist/client/assets/{external-link-UTDzdjq8.js → external-link-fBsuHMby.js} +1 -1
  43. package/template/dist/client/assets/{eye-nR10ui7i.js → eye-CwlZZEsj.js} +1 -1
  44. package/template/dist/client/assets/index-09IqiOaE.css +1 -0
  45. package/template/dist/client/assets/index-B3CRby6r.js +51 -0
  46. package/template/dist/client/assets/index-CC_zy73y.js +17 -0
  47. package/template/dist/client/assets/main-Cn4IDo2I.js +92 -0
  48. package/template/dist/client/assets/merchant-DDDN9bMu.js +40 -0
  49. package/template/dist/client/assets/{message-square-CwWGL-Bh.js → message-square-BRaZfgbJ.js} +1 -1
  50. package/template/dist/client/assets/pluginStore-DDsWJPe6.js +1 -0
  51. package/template/dist/client/assets/{plus-pZld_nUL.js → plus-DDZfPiDJ.js} +1 -1
  52. package/template/dist/client/assets/sse-client-DGQ072hl.js +64 -0
  53. package/template/dist/client/assets/star-C7tO6w4H.js +11 -0
  54. package/template/dist/client/assets/{tag-DsiUPF90.js → tag-DBfpQDuJ.js} +1 -1
  55. package/template/dist/client/assets/tenant-CizbLaLJ.js +1 -0
  56. package/template/dist/client/assets/{trash-2-DRblNbnA.js → trash-2-BP7fkd5b.js} +1 -1
  57. package/template/dist/client/assets/{triangle-alert-D1CLh-Vd.js → triangle-alert-CrOQEdJ2.js} +1 -1
  58. package/template/dist/client/assets/{wifi-BwXjnCqI.js → wifi-CwYSE0J4.js} +1 -1
  59. package/template/dist/client/assets/{x-BH2rJdFq.js → x-t615pnNR.js} +1 -1
  60. package/template/dist/client/content/index.html +5 -4
  61. package/template/dist/client/index.html +4 -3
  62. package/template/dist/client/merchant.html +18 -0
  63. package/template/dist/client/notifications/index.html +6 -5
  64. package/template/dist/client/tenant.html +18 -0
  65. package/template/dist/client/todos/index.html +6 -5
  66. package/template/dist/client/websocket/index.html +6 -5
  67. package/template/dist/cloudflare/chunk-HX7DVRDX.js +1 -0
  68. package/template/dist/cloudflare/{chunk-QBHAPWIA.js → chunk-IXJL2LE4.js} +1 -1
  69. package/template/dist/cloudflare/chunk-Q34AN3RF.js +14 -0
  70. package/template/dist/cloudflare/{chunk-BHPTQ4K2.js → chunk-ZAMVL4EG.js} +2 -2
  71. package/template/dist/cloudflare/cloudflare.js +35 -29
  72. package/template/dist/cloudflare/db-4AQOSFAX.js +1 -0
  73. package/template/dist/cloudflare/{migrator-2ZYYKNI5.js → migrator-TEPBVUFO.js} +1 -1
  74. package/template/dist/cloudflare/permission-service-impl-RE7NPW3Q.js +1 -0
  75. package/template/dist/cloudflare/schema-DVEMT3X2.js +1 -0
  76. package/template/dist/cloudflare/test-setup-Z2RYE5B4.js +265 -0
  77. package/template/dist/server/chunk-27SIJSPF.js +1 -0
  78. package/template/dist/server/chunk-37QNGBQU.js +1 -0
  79. package/template/dist/server/chunk-FIY4CGJJ.js +1 -0
  80. package/template/dist/server/chunk-HZUDBIT4.js +1 -0
  81. package/template/dist/server/chunk-I6OBDFDU.js +1 -0
  82. package/template/dist/server/chunk-JHNYLNG7.js +1 -0
  83. package/template/dist/server/chunk-MDOVVKKD.js +1 -0
  84. package/template/dist/server/chunk-NSOCT7E5.js +1 -0
  85. package/template/dist/server/chunk-OU5IGVVO.js +1 -0
  86. package/template/dist/server/chunk-OYCBNRMK.js +1 -0
  87. package/template/dist/server/chunk-P2RJNNGD.js +1 -0
  88. package/template/dist/server/chunk-UMAQLNPE.js +1 -0
  89. package/template/dist/server/chunk-XZZTSRSN.js +1 -0
  90. package/template/dist/server/content-service-5QVHDR5X.js +1 -0
  91. package/template/dist/server/db-FLI5L5DD.js +1 -0
  92. package/template/dist/server/dispute-service-E2FCYUEM.js +1 -0
  93. package/template/dist/server/init-72JXJV3I.js +46 -0
  94. package/template/dist/server/init-FWYXSKPX.js +46 -0
  95. package/template/dist/server/node.js +34 -28
  96. package/template/dist/server/order-service-TKGG5S5K.js +1 -0
  97. package/template/dist/server/permission-service-impl-M3AKEYNY.js +1 -0
  98. package/template/dist/server/schema-V4UG7HMU.js +1 -0
  99. package/template/dist/server/tenant-service-JG6UUWXQ.js +1 -0
  100. package/template/dist/server/tenant-service-XJWZSEDX.js +1 -0
  101. package/template/dist/{cloudflare/test-setup-NMZJZLRV.js → server/test-setup-VFOPBGYM.js} +83 -2
  102. package/template/dist/server/ticket-service-3RSW7V2Z.js +1 -0
  103. package/template/dist/server/todo-service-S6BGIO7D.js +1 -0
  104. package/template/package.json +1 -1
  105. package/template/src/client/App.tsx +3 -1
  106. package/template/src/client/pages/ContentListPage.tsx +36 -4
  107. package/template/src/client/pages/PluginsPage.tsx +112 -20
  108. package/template/src/client/pages/TodoPage.tsx +9 -1
  109. package/template/src/client/preset-ui-config.ts +79 -2
  110. package/template/src/merchant/pages/DisputesPage.tsx +11 -11
  111. package/template/src/merchant/pages/OrdersPage.tsx +4 -3
  112. package/template/src/merchant/pages/ProductsPage.tsx +2 -2
  113. package/template/src/merchant/stores/merchantStore.ts +11 -6
  114. package/template/src/server/db/init.ts +5 -253
  115. package/template/src/server/module-content/routes/topics-routes.ts +250 -0
  116. package/template/src/server/module-content/services/content-service.ts +1 -1
  117. package/template/src/server/module-plugin/services/plugin-seed-service.ts +623 -0
  118. package/template/src/server/module-tenant/routes/tenant-routes.ts +2 -2
  119. package/template/src/server/module-tenant/services/tenant-service.ts +63 -17
  120. package/template/src/server/module-todos/services/todo-service.ts +1 -1
  121. package/template/src/shared/modules/merchant/index.ts +9 -0
  122. package/template/src/shared/modules/merchant/schemas.ts +37 -0
  123. package/template/src/shared/modules/tenant/index.ts +2 -0
  124. package/template/src/shared/schemas/index.ts +27 -0
  125. package/template/src/tenant/layouts/Header.tsx +1 -1
  126. package/template/src/tenant/layouts/Sidebar.tsx +1 -1
  127. package/template/src/tenant/pages/SettingsPage.tsx +4 -8
  128. package/template/src/tenant/stores/tenantStore.ts +41 -302
  129. package/template/tsconfig.json +1 -0
  130. package/template/tsup.config.ts +11 -3
  131. package/template/dist/client/assets/ContentDetailPage-DdltMANL.js +0 -1
  132. package/template/dist/client/assets/ContentListPage-B63sUB6N.js +0 -1
  133. package/template/dist/client/assets/DashboardPage-tUMilc7Z.js +0 -11
  134. package/template/dist/client/assets/LoadingSpinner-DVYOLSRM.js +0 -6
  135. package/template/dist/client/assets/LoginPage-g9mSLIMC.js +0 -6
  136. package/template/dist/client/assets/NotificationPage-COTzp-HD.js +0 -1
  137. package/template/dist/client/assets/OrdersPage-BsPh4oEI.js +0 -11
  138. package/template/dist/client/assets/PluginsPage-BNtAe_yo.js +0 -6
  139. package/template/dist/client/assets/ProfilePage-dL_iSuZN.js +0 -16
  140. package/template/dist/client/assets/PublishPage-D96FnbLA.js +0 -1
  141. package/template/dist/client/assets/TopicsPage-DyLjZa4D.js +0 -6
  142. package/template/dist/client/assets/admin-Bh1vfz_L.js +0 -486
  143. package/template/dist/client/assets/index-1bA-ixFv.js +0 -114
  144. package/template/dist/client/assets/index-CWh3vXC_.css +0 -1
  145. package/template/dist/client/assets/main-DHnArIp_.js +0 -82
  146. package/template/dist/client/assets/pluginStore-XQfsm3iR.js +0 -1
  147. package/template/dist/client/content/content-1/index.html +0 -18
  148. package/template/dist/client/content/content-13/index.html +0 -18
  149. package/template/dist/client/content/content-14/index.html +0 -18
  150. package/template/dist/client/content/content-15/index.html +0 -18
  151. package/template/dist/client/content/content-19/index.html +0 -18
  152. package/template/dist/client/content/content-2/index.html +0 -18
  153. package/template/dist/client/content/content-20/index.html +0 -18
  154. package/template/dist/cloudflare/chunk-YY6FRMAQ.js +0 -14
  155. package/template/dist/cloudflare/db-7J42RQ3T.js +0 -1
  156. package/template/dist/cloudflare/permission-service-impl-TGXVSSSA.js +0 -1
@@ -0,0 +1,623 @@
1
+ import {
2
+ plugins,
3
+ pluginVersions,
4
+ pluginCategories,
5
+ pluginCategoryMappings,
6
+ } from '@server/db/schema'
7
+ import { generateUUID } from '@server/utils/uuid'
8
+ import { getDb } from '@server/db'
9
+
10
+ export async function seedPluginsIfEmpty() {
11
+ const db = await getDb()
12
+
13
+ const existing = await db.select().from(plugins)
14
+ if (existing.length > 0) return
15
+
16
+ const sampleCategories = [
17
+ {
18
+ id: generateUUID(),
19
+ name: 'UI & Design',
20
+ slug: 'ui-design',
21
+ description: 'Visual customization and theming',
22
+ icon: 'palette',
23
+ sortOrder: 1,
24
+ },
25
+ {
26
+ id: generateUUID(),
27
+ name: 'Analytics',
28
+ slug: 'analytics',
29
+ description: 'Data tracking and reporting',
30
+ icon: 'chart',
31
+ sortOrder: 2,
32
+ },
33
+ {
34
+ id: generateUUID(),
35
+ name: 'SEO & Marketing',
36
+ slug: 'seo-marketing',
37
+ description: 'Search optimization and growth tools',
38
+ icon: 'trending-up',
39
+ sortOrder: 3,
40
+ },
41
+ {
42
+ id: generateUUID(),
43
+ name: 'Developer Tools',
44
+ slug: 'developer-tools',
45
+ description: 'Utilities for developers',
46
+ icon: 'code',
47
+ sortOrder: 4,
48
+ },
49
+ {
50
+ id: generateUUID(),
51
+ name: 'Integration',
52
+ slug: 'integration',
53
+ description: 'Third-party service integrations',
54
+ icon: 'plug',
55
+ sortOrder: 5,
56
+ },
57
+ ]
58
+
59
+ await db.insert(pluginCategories).values(sampleCategories)
60
+
61
+ const samplePlugins = [
62
+ {
63
+ id: generateUUID(),
64
+ name: 'Theme Engine',
65
+ slug: 'theme-engine',
66
+ description:
67
+ 'Advanced theming system with dark mode, custom color palettes, and responsive layout controls.',
68
+ readme:
69
+ '# Theme Engine\n\nA powerful theming plugin for customizing the look and feel of your application.',
70
+ authorId: '1',
71
+ authorName: 'superadmin',
72
+ repositoryUrl: 'https://github.com/example/theme-engine',
73
+ homepageUrl: 'https://theme-engine.example.com',
74
+ license: 'MIT',
75
+ version: '2.1.0',
76
+ status: 'approved' as const,
77
+ downloadCount: 1520,
78
+ viewCount: 4320,
79
+ featured: true,
80
+ screenshotUrl: 'https://picsum.photos/seed/theme/800/400',
81
+ tags: '["theme","dark-mode","customization"]',
82
+ },
83
+ {
84
+ id: generateUUID(),
85
+ slug: 'analytics-dashboard',
86
+ name: 'Analytics Dashboard',
87
+ description:
88
+ 'Real-time analytics dashboard with charts, heatmaps, and user behavior tracking.',
89
+ readme: '# Analytics Dashboard\n\nTrack user engagement and visualize data in real time.',
90
+ authorId: '1',
91
+ authorName: 'superadmin',
92
+ repositoryUrl: 'https://github.com/example/analytics-dashboard',
93
+ homepageUrl: 'https://analytics.example.com',
94
+ license: 'Apache-2.0',
95
+ version: '1.5.3',
96
+ status: 'approved' as const,
97
+ downloadCount: 980,
98
+ viewCount: 2100,
99
+ featured: true,
100
+ screenshotUrl: 'https://picsum.photos/seed/analytics/800/400',
101
+ tags: '["analytics","dashboard","charts"]',
102
+ },
103
+ {
104
+ id: generateUUID(),
105
+ slug: 'seo-optimizer',
106
+ name: 'SEO Optimizer',
107
+ description:
108
+ 'Automated SEO optimization with meta tags, sitemap generation, and structured data support.',
109
+ authorId: '2',
110
+ authorName: 'customerservice',
111
+ repositoryUrl: 'https://github.com/example/seo-optimizer',
112
+ license: 'MIT',
113
+ version: '1.2.0',
114
+ status: 'approved' as const,
115
+ downloadCount: 740,
116
+ viewCount: 1800,
117
+ featured: false,
118
+ screenshotUrl: 'https://picsum.photos/seed/seo/800/400',
119
+ tags: '["seo","meta","sitemap"]',
120
+ },
121
+ {
122
+ id: generateUUID(),
123
+ slug: 'api-toolkit',
124
+ name: 'API Toolkit',
125
+ description:
126
+ 'Developer toolkit for building and testing REST APIs with auto-documentation and mock servers.',
127
+ authorId: '2',
128
+ authorName: 'customerservice',
129
+ repositoryUrl: 'https://github.com/example/api-toolkit',
130
+ homepageUrl: 'https://api-toolkit.example.com',
131
+ license: 'MIT',
132
+ version: '3.0.1',
133
+ status: 'approved' as const,
134
+ downloadCount: 2100,
135
+ viewCount: 5600,
136
+ featured: true,
137
+ screenshotUrl: 'https://picsum.photos/seed/apitoolkit/800/400',
138
+ tags: '["api","developer","testing","documentation"]',
139
+ },
140
+ {
141
+ id: generateUUID(),
142
+ slug: 'notification-hub',
143
+ name: 'Notification Hub',
144
+ description:
145
+ 'Unified notification management supporting email, SMS, push, and in-app notifications.',
146
+ authorId: '3',
147
+ authorName: 'user1',
148
+ repositoryUrl: 'https://github.com/example/notification-hub',
149
+ license: 'ISC',
150
+ version: '1.0.0',
151
+ status: 'pending' as const,
152
+ downloadCount: 0,
153
+ viewCount: 50,
154
+ featured: false,
155
+ screenshotUrl: 'https://picsum.photos/seed/notify/800/400',
156
+ tags: '["notification","email","push"]',
157
+ },
158
+ {
159
+ id: generateUUID(),
160
+ slug: 'form-builder',
161
+ name: 'Form Builder',
162
+ description:
163
+ 'Drag-and-drop form creation with validation rules, conditional logic, and file uploads.',
164
+ readme:
165
+ '# Form Builder\n\nCreate complex forms with ease using our visual drag-and-drop builder.',
166
+ authorId: '1',
167
+ authorName: 'superadmin',
168
+ repositoryUrl: 'https://github.com/example/form-builder',
169
+ homepageUrl: 'https://form-builder.example.com',
170
+ license: 'MIT',
171
+ version: '3.2.1',
172
+ status: 'approved' as const,
173
+ downloadCount: 3420,
174
+ viewCount: 8900,
175
+ featured: true,
176
+ screenshotUrl: 'https://picsum.photos/seed/formbuilder/800/400',
177
+ tags: '["forms","validation","drag-drop"]',
178
+ },
179
+ {
180
+ id: generateUUID(),
181
+ slug: 'image-optimizer',
182
+ name: 'Image Optimizer',
183
+ description:
184
+ 'Automatic image compression and format conversion with lazy loading and responsive srcset support.',
185
+ readme: '# Image Optimizer\n\nOptimize images automatically for faster page loads.',
186
+ authorId: '2',
187
+ authorName: 'customerservice',
188
+ repositoryUrl: 'https://github.com/example/image-optimizer',
189
+ license: 'MIT',
190
+ version: '2.0.0',
191
+ status: 'approved' as const,
192
+ downloadCount: 2890,
193
+ viewCount: 6500,
194
+ featured: false,
195
+ screenshotUrl: 'https://picsum.photos/seed/imgopt/800/400',
196
+ tags: '["image","optimization","performance"]',
197
+ },
198
+ {
199
+ id: generateUUID(),
200
+ slug: 'cache-manager',
201
+ name: 'Cache Manager',
202
+ description:
203
+ 'Redis-powered caching layer with TTL management, cache invalidation, and tag-based purging.',
204
+ readme: '# Cache Manager\n\nSmart caching for high-performance applications.',
205
+ authorId: '1',
206
+ authorName: 'superadmin',
207
+ repositoryUrl: 'https://github.com/example/cache-manager',
208
+ homepageUrl: 'https://cache-manager.example.com',
209
+ license: 'Apache-2.0',
210
+ version: '1.8.0',
211
+ status: 'approved' as const,
212
+ downloadCount: 1560,
213
+ viewCount: 4200,
214
+ featured: true,
215
+ screenshotUrl: 'https://picsum.photos/seed/cache/800/400',
216
+ tags: '["cache","redis","performance"]',
217
+ },
218
+ {
219
+ id: generateUUID(),
220
+ slug: 'auth-guard',
221
+ name: 'Auth Guard',
222
+ description:
223
+ 'Advanced authentication flows with OAuth2, SAML, and biometric support including session management.',
224
+ readme: '# Auth Guard\n\nEnterprise-grade authentication for modern apps.',
225
+ authorId: '1',
226
+ authorName: 'superadmin',
227
+ repositoryUrl: 'https://github.com/example/auth-guard',
228
+ homepageUrl: 'https://auth-guard.example.com',
229
+ license: 'MIT',
230
+ version: '4.1.0',
231
+ status: 'approved' as const,
232
+ downloadCount: 4210,
233
+ viewCount: 9800,
234
+ featured: true,
235
+ screenshotUrl: 'https://picsum.photos/seed/authguard/800/400',
236
+ tags: '["auth","oauth","security"]',
237
+ },
238
+ {
239
+ id: generateUUID(),
240
+ slug: 'payment-gateway',
241
+ name: 'Payment Gateway',
242
+ description:
243
+ 'Stripe and PayPal integration with subscription management, invoicing, and refund handling.',
244
+ readme: '# Payment Gateway\n\nAccept payments globally with multiple providers.',
245
+ authorId: '2',
246
+ authorName: 'customerservice',
247
+ repositoryUrl: 'https://github.com/example/payment-gateway',
248
+ homepageUrl: 'https://payment-gateway.example.com',
249
+ license: 'MIT',
250
+ version: '2.3.0',
251
+ status: 'approved' as const,
252
+ downloadCount: 3100,
253
+ viewCount: 7800,
254
+ featured: true,
255
+ screenshotUrl: 'https://picsum.photos/seed/payment/800/400',
256
+ tags: '["payment","stripe","subscription"]',
257
+ },
258
+ {
259
+ id: generateUUID(),
260
+ slug: 'chat-widget',
261
+ name: 'Chat Widget',
262
+ description:
263
+ 'Real-time customer support chat with AI-powered auto-replies and conversation routing.',
264
+ readme: '# Chat Widget\n\nLive chat support for your customers.',
265
+ authorId: '3',
266
+ authorName: 'user1',
267
+ repositoryUrl: 'https://github.com/example/chat-widget',
268
+ license: 'ISC',
269
+ version: '1.4.2',
270
+ status: 'approved' as const,
271
+ downloadCount: 1870,
272
+ viewCount: 5200,
273
+ featured: false,
274
+ screenshotUrl: 'https://picsum.photos/seed/chatwidget/800/400',
275
+ tags: '["chat","support","real-time"]',
276
+ },
277
+ {
278
+ id: generateUUID(),
279
+ slug: 'backup-manager',
280
+ name: 'Backup Manager',
281
+ description:
282
+ 'Automated database backups with scheduling, encryption, and cloud storage integration.',
283
+ readme: '# Backup Manager\n\nNever lose data with automated backups.',
284
+ authorId: '1',
285
+ authorName: 'superadmin',
286
+ repositoryUrl: 'https://github.com/example/backup-manager',
287
+ license: 'MIT',
288
+ version: '1.1.0',
289
+ status: 'approved' as const,
290
+ downloadCount: 980,
291
+ viewCount: 2900,
292
+ featured: false,
293
+ screenshotUrl: 'https://picsum.photos/seed/backup/800/400',
294
+ tags: '["backup","database","scheduling"]',
295
+ },
296
+ {
297
+ id: generateUUID(),
298
+ slug: 'rate-limiter',
299
+ name: 'Rate Limiter',
300
+ description:
301
+ 'API rate limiting middleware with sliding window, token bucket, and fixed window algorithms.',
302
+ readme: '# Rate Limiter\n\nProtect your APIs from abuse.',
303
+ authorId: '2',
304
+ authorName: 'customerservice',
305
+ repositoryUrl: 'https://github.com/example/rate-limiter',
306
+ homepageUrl: 'https://rate-limiter.example.com',
307
+ license: 'MIT',
308
+ version: '2.0.0',
309
+ status: 'approved' as const,
310
+ downloadCount: 1340,
311
+ viewCount: 3800,
312
+ featured: false,
313
+ screenshotUrl: 'https://picsum.photos/seed/ratelimit/800/400',
314
+ tags: '["rate-limit","api","middleware"]',
315
+ },
316
+ {
317
+ id: generateUUID(),
318
+ slug: 'email-templates',
319
+ name: 'Email Templates',
320
+ description:
321
+ 'Responsive email builder with template variables, preview mode, and SMTP integration.',
322
+ readme: '# Email Templates\n\nBeautiful emails that work everywhere.',
323
+ authorId: '3',
324
+ authorName: 'user1',
325
+ repositoryUrl: 'https://github.com/example/email-templates',
326
+ license: 'Apache-2.0',
327
+ version: '1.6.0',
328
+ status: 'approved' as const,
329
+ downloadCount: 2100,
330
+ viewCount: 5600,
331
+ featured: false,
332
+ screenshotUrl: 'https://picsum.photos/seed/emailtpl/800/400',
333
+ tags: '["email","templates","smtp"]',
334
+ },
335
+ {
336
+ id: generateUUID(),
337
+ slug: 'search-engine',
338
+ name: 'Search Engine',
339
+ description:
340
+ 'Elasticsearch integration with faceted search, autocomplete, and relevance tuning.',
341
+ readme: '# Search Engine\n\nPowerful full-text search for your application.',
342
+ authorId: '1',
343
+ authorName: 'superadmin',
344
+ repositoryUrl: 'https://github.com/example/search-engine',
345
+ homepageUrl: 'https://search-engine.example.com',
346
+ license: 'MIT',
347
+ version: '3.0.0',
348
+ status: 'approved' as const,
349
+ downloadCount: 2560,
350
+ viewCount: 7100,
351
+ featured: true,
352
+ screenshotUrl: 'https://picsum.photos/seed/searcheng/800/400',
353
+ tags: '["search","elasticsearch","full-text"]',
354
+ },
355
+ {
356
+ id: generateUUID(),
357
+ slug: 'cdn-manager',
358
+ name: 'CDN Manager',
359
+ description:
360
+ 'Content delivery network controls with cache purging, URL signing, and geo-routing.',
361
+ readme: '# CDN Manager\n\nDeliver content faster globally.',
362
+ authorId: '2',
363
+ authorName: 'customerservice',
364
+ repositoryUrl: 'https://github.com/example/cdn-manager',
365
+ license: 'MIT',
366
+ version: '1.3.0',
367
+ status: 'approved' as const,
368
+ downloadCount: 870,
369
+ viewCount: 2400,
370
+ featured: false,
371
+ screenshotUrl: 'https://picsum.photos/seed/cdn/800/400',
372
+ tags: '["cdn","caching","delivery"]',
373
+ },
374
+ {
375
+ id: generateUUID(),
376
+ slug: 'logger-pro',
377
+ name: 'Logger Pro',
378
+ description:
379
+ 'Structured logging with severity levels, log rotation, and remote aggregation support.',
380
+ readme: '# Logger Pro\n\nEnterprise logging made simple.',
381
+ authorId: '1',
382
+ authorName: 'superadmin',
383
+ repositoryUrl: 'https://github.com/example/logger-pro',
384
+ license: 'BSD-3-Clause',
385
+ version: '2.1.0',
386
+ status: 'approved' as const,
387
+ downloadCount: 1190,
388
+ viewCount: 3300,
389
+ featured: false,
390
+ screenshotUrl: 'https://picsum.photos/seed/logger/800/400',
391
+ tags: '["logging","monitoring","structured"]',
392
+ },
393
+ {
394
+ id: generateUUID(),
395
+ slug: 'task-scheduler',
396
+ name: 'Task Scheduler',
397
+ description:
398
+ 'Cron job management with retry policies, concurrency controls, and execution history.',
399
+ readme: '# Task Scheduler\n\nAutomate recurring tasks with confidence.',
400
+ authorId: '3',
401
+ authorName: 'user1',
402
+ repositoryUrl: 'https://github.com/example/task-scheduler',
403
+ homepageUrl: 'https://task-scheduler.example.com',
404
+ license: 'MIT',
405
+ version: '1.5.0',
406
+ status: 'approved' as const,
407
+ downloadCount: 1780,
408
+ viewCount: 4900,
409
+ featured: false,
410
+ screenshotUrl: 'https://picsum.photos/seed/tasksched/800/400',
411
+ tags: '["scheduler","cron","automation"]',
412
+ },
413
+ {
414
+ id: generateUUID(),
415
+ slug: 'ab-testing',
416
+ name: 'A/B Testing',
417
+ description:
418
+ 'Experiment framework with statistical significance calculation and variant allocation.',
419
+ readme: '# A/B Testing\n\nData-driven decisions through controlled experiments.',
420
+ authorId: '1',
421
+ authorName: 'superadmin',
422
+ repositoryUrl: 'https://github.com/example/ab-testing',
423
+ license: 'Apache-2.0',
424
+ version: '1.0.0',
425
+ status: 'approved' as const,
426
+ downloadCount: 640,
427
+ viewCount: 2100,
428
+ featured: false,
429
+ screenshotUrl: 'https://picsum.photos/seed/abtest/800/400',
430
+ tags: '["testing","experiment","analytics"]',
431
+ },
432
+ {
433
+ id: generateUUID(),
434
+ slug: 'markdown-editor',
435
+ name: 'Markdown Editor',
436
+ description:
437
+ 'Rich text editing with Markdown support, syntax highlighting, and live preview.',
438
+ readme: '# Markdown Editor\n\nWrite beautifully with Markdown.',
439
+ authorId: '2',
440
+ authorName: 'customerservice',
441
+ repositoryUrl: 'https://github.com/example/markdown-editor',
442
+ homepageUrl: 'https://md-editor.example.com',
443
+ license: 'MIT',
444
+ version: '2.4.0',
445
+ status: 'approved' as const,
446
+ downloadCount: 2950,
447
+ viewCount: 7400,
448
+ featured: true,
449
+ screenshotUrl: 'https://picsum.photos/seed/mdeditor/800/400',
450
+ tags: '["markdown","editor","rich-text"]',
451
+ },
452
+ {
453
+ id: generateUUID(),
454
+ slug: 'webhook-manager',
455
+ name: 'Webhook Manager',
456
+ description:
457
+ 'Outgoing webhook automation with retry logic, payload templating, and delivery tracking.',
458
+ readme: '# Webhook Manager\n\nReliable webhook delivery for your integrations.',
459
+ authorId: '3',
460
+ authorName: 'user1',
461
+ repositoryUrl: 'https://github.com/example/webhook-manager',
462
+ license: 'MIT',
463
+ version: '1.2.0',
464
+ status: 'pending' as const,
465
+ downloadCount: 520,
466
+ viewCount: 1800,
467
+ featured: false,
468
+ screenshotUrl: 'https://picsum.photos/seed/webhook/800/400',
469
+ tags: '["webhook","automation","integration"]',
470
+ },
471
+ {
472
+ id: generateUUID(),
473
+ slug: 'two-factor-auth',
474
+ name: 'Two-Factor Auth',
475
+ description: '2FA/MFA support with TOTP, SMS OTP, and hardware key authentication methods.',
476
+ readme: '# Two-Factor Auth\n\nAdd an extra layer of security.',
477
+ authorId: '1',
478
+ authorName: 'superadmin',
479
+ repositoryUrl: 'https://github.com/example/two-factor-auth',
480
+ license: 'MIT',
481
+ version: '1.7.0',
482
+ status: 'approved' as const,
483
+ downloadCount: 2340,
484
+ viewCount: 6100,
485
+ featured: false,
486
+ screenshotUrl: 'https://picsum.photos/seed/2fa/800/400',
487
+ tags: '["2fa","security","authentication"]',
488
+ },
489
+ {
490
+ id: generateUUID(),
491
+ slug: 'database-browser',
492
+ name: 'Database Browser',
493
+ description:
494
+ 'GUI interface for browsing tables, running queries, and visualizing schema relationships.',
495
+ readme: '# Database Browser\n\nExplore your data visually.',
496
+ authorId: '2',
497
+ authorName: 'customerservice',
498
+ repositoryUrl: 'https://github.com/example/database-browser',
499
+ license: 'GPL-3.0',
500
+ version: '1.0.0',
501
+ status: 'pending' as const,
502
+ downloadCount: 340,
503
+ viewCount: 1200,
504
+ featured: false,
505
+ screenshotUrl: 'https://picsum.photos/seed/dbbrowser/800/400',
506
+ tags: '["database","gui","query"]',
507
+ },
508
+ {
509
+ id: generateUUID(),
510
+ slug: 'performance-monitor',
511
+ name: 'Performance Monitor',
512
+ description:
513
+ 'Core Web Vitals tracking with real user monitoring, alerts, and performance budgets.',
514
+ readme: '# Performance Monitor\n\nKeep your app fast and responsive.',
515
+ authorId: '1',
516
+ authorName: 'superadmin',
517
+ repositoryUrl: 'https://github.com/example/performance-monitor',
518
+ homepageUrl: 'https://perf-monitor.example.com',
519
+ license: 'MIT',
520
+ version: '2.0.0',
521
+ status: 'approved' as const,
522
+ downloadCount: 1890,
523
+ viewCount: 5300,
524
+ featured: true,
525
+ screenshotUrl: 'https://picsum.photos/seed/perfmon/800/400',
526
+ tags: '["performance","monitoring","web-vitals"]',
527
+ },
528
+ {
529
+ id: generateUUID(),
530
+ slug: 'i18n-manager',
531
+ name: 'i18n Manager',
532
+ description:
533
+ 'Internationalization toolkit with translation memory, pluralization, and RTL support.',
534
+ readme: '# i18n Manager\n\nGo global with multilingual support.',
535
+ authorId: '3',
536
+ authorName: 'user1',
537
+ repositoryUrl: 'https://github.com/example/i18n-manager',
538
+ license: 'MIT',
539
+ version: '1.3.0',
540
+ status: 'approved' as const,
541
+ downloadCount: 1450,
542
+ viewCount: 4100,
543
+ featured: false,
544
+ screenshotUrl: 'https://picsum.photos/seed/i18n/800/400',
545
+ tags: '["i18n","translation","localization"]',
546
+ },
547
+ ]
548
+
549
+ await db.insert(plugins).values(samplePlugins)
550
+
551
+ const sampleVersions = [
552
+ {
553
+ id: generateUUID(),
554
+ pluginId: samplePlugins[0].id,
555
+ version: '2.1.0',
556
+ changelog: 'Added responsive layout controls',
557
+ status: 'approved' as const,
558
+ },
559
+ {
560
+ id: generateUUID(),
561
+ pluginId: samplePlugins[0].id,
562
+ version: '2.0.0',
563
+ changelog: 'Major rewrite with dark mode support',
564
+ status: 'approved' as const,
565
+ },
566
+ {
567
+ id: generateUUID(),
568
+ pluginId: samplePlugins[1].id,
569
+ version: '1.5.3',
570
+ changelog: 'Fixed heatmap rendering',
571
+ status: 'approved' as const,
572
+ },
573
+ {
574
+ id: generateUUID(),
575
+ pluginId: samplePlugins[1].id,
576
+ version: '1.5.0',
577
+ changelog: 'Added real-time tracking',
578
+ status: 'approved' as const,
579
+ },
580
+ {
581
+ id: generateUUID(),
582
+ pluginId: samplePlugins[2].id,
583
+ version: '1.2.0',
584
+ changelog: 'Structured data support',
585
+ status: 'approved' as const,
586
+ },
587
+ {
588
+ id: generateUUID(),
589
+ pluginId: samplePlugins[3].id,
590
+ version: '3.0.1',
591
+ changelog: 'Auto-documentation improvements',
592
+ status: 'approved' as const,
593
+ },
594
+ {
595
+ id: generateUUID(),
596
+ pluginId: samplePlugins[3].id,
597
+ version: '3.0.0',
598
+ changelog: 'Major version with mock server',
599
+ status: 'approved' as const,
600
+ },
601
+ {
602
+ id: generateUUID(),
603
+ pluginId: samplePlugins[4].id,
604
+ version: '1.0.0',
605
+ changelog: 'Initial release',
606
+ status: 'pending' as const,
607
+ },
608
+ ]
609
+
610
+ await db.insert(pluginVersions).values(sampleVersions)
611
+
612
+ const sampleMappings = [
613
+ { pluginId: samplePlugins[0].id, categoryId: sampleCategories[0].id },
614
+ { pluginId: samplePlugins[1].id, categoryId: sampleCategories[1].id },
615
+ { pluginId: samplePlugins[2].id, categoryId: sampleCategories[2].id },
616
+ { pluginId: samplePlugins[3].id, categoryId: sampleCategories[3].id },
617
+ { pluginId: samplePlugins[4].id, categoryId: sampleCategories[4].id },
618
+ ]
619
+
620
+ await db.insert(pluginCategoryMappings).values(sampleMappings)
621
+
622
+ // Plugin seeding complete
623
+ }
@@ -124,8 +124,8 @@ export const apiRoutes = new OpenAPIHono()
124
124
  const query = c.req.valid('query')
125
125
 
126
126
  const result = await tenantService.listTenants(query.page, query.pageSize, {
127
- status: query.status,
128
- plan: query.plan,
127
+ status: query.status ?? undefined,
128
+ plan: query.plan ?? undefined,
129
129
  })
130
130
 
131
131
  return c.json(success(result), 200)