@nextsparkjs/core 0.1.0-beta.84 → 0.1.0-beta.85

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 (356) hide show
  1. package/dist/styles/classes.json +1 -1
  2. package/dist/templates/app/(auth)/forgot-password/page.tsx +216 -0
  3. package/dist/templates/app/(auth)/layout.tsx +51 -0
  4. package/dist/templates/app/(auth)/login/page.tsx +21 -0
  5. package/dist/templates/app/(auth)/reset-password/page.tsx +212 -0
  6. package/dist/templates/app/(auth)/signup/page.tsx +21 -0
  7. package/dist/templates/app/(auth)/verify-email/page.tsx +190 -0
  8. package/dist/templates/app/(public)/[...slug]/page.tsx +378 -0
  9. package/dist/templates/app/(public)/docs/[section]/[page]/page.tsx +90 -0
  10. package/dist/templates/app/(public)/docs/layout.tsx +25 -0
  11. package/dist/templates/app/(public)/docs/page.tsx +81 -0
  12. package/dist/templates/app/(public)/layout.tsx +41 -0
  13. package/dist/templates/app/(public)/page.tsx +19 -0
  14. package/dist/templates/app/403/page.tsx +89 -0
  15. package/dist/templates/app/api/auth/[...all]/route.ts +78 -0
  16. package/dist/templates/app/api/cron/billing/lifecycle/route.ts +98 -0
  17. package/dist/templates/app/api/csp-report/route.ts +175 -0
  18. package/dist/templates/app/api/devtools/config/entities/route.ts +108 -0
  19. package/dist/templates/app/api/devtools/config/theme/route.ts +66 -0
  20. package/dist/templates/app/api/devtools/tests/[...path]/route.ts +130 -0
  21. package/dist/templates/app/api/devtools/tests/route.ts +134 -0
  22. package/dist/templates/app/api/health/route.ts +29 -0
  23. package/dist/templates/app/api/internal/user-metadata/route.ts +36 -0
  24. package/dist/templates/app/api/superadmin/subscriptions/route.ts +310 -0
  25. package/dist/templates/app/api/superadmin/teams/[teamId]/route.ts +286 -0
  26. package/dist/templates/app/api/superadmin/teams/route.ts +188 -0
  27. package/dist/templates/app/api/superadmin/users/[userId]/route.ts +540 -0
  28. package/dist/templates/app/api/superadmin/users/route.ts +323 -0
  29. package/dist/templates/app/api/user/delete-account/route.ts +55 -0
  30. package/dist/templates/app/api/user/plan-flags/route.ts +283 -0
  31. package/dist/templates/app/api/user/profile/route.ts +133 -0
  32. package/dist/templates/app/api/v1/[entity]/[id]/child/[childType]/[childId]/route.ts +210 -0
  33. package/dist/templates/app/api/v1/[entity]/[id]/child/[childType]/route.ts +331 -0
  34. package/dist/templates/app/api/v1/[entity]/[id]/route.ts +35 -0
  35. package/dist/templates/app/api/v1/[entity]/docs.md +369 -0
  36. package/dist/templates/app/api/v1/[entity]/presets.ts +194 -0
  37. package/dist/templates/app/api/v1/[entity]/route.ts +31 -0
  38. package/dist/templates/app/api/v1/api-keys/[id]/route.ts +303 -0
  39. package/dist/templates/app/api/v1/api-keys/docs.md +101 -0
  40. package/dist/templates/app/api/v1/api-keys/presets.ts +31 -0
  41. package/dist/templates/app/api/v1/api-keys/route.ts +250 -0
  42. package/dist/templates/app/api/v1/auth/docs.md +184 -0
  43. package/dist/templates/app/api/v1/auth/presets.ts +44 -0
  44. package/dist/templates/app/api/v1/auth/signup-with-invite/route.ts +227 -0
  45. package/dist/templates/app/api/v1/billing/cancel/route.ts +206 -0
  46. package/dist/templates/app/api/v1/billing/change-plan/route.ts +97 -0
  47. package/dist/templates/app/api/v1/billing/check-action/route.ts +81 -0
  48. package/dist/templates/app/api/v1/billing/checkout/route.ts +124 -0
  49. package/dist/templates/app/api/v1/billing/docs.md +209 -0
  50. package/dist/templates/app/api/v1/billing/plans/route.ts +85 -0
  51. package/dist/templates/app/api/v1/billing/portal/route.ts +90 -0
  52. package/dist/templates/app/api/v1/billing/presets.ts +121 -0
  53. package/dist/templates/app/api/v1/billing/webhooks/stripe/route.ts +428 -0
  54. package/dist/templates/app/api/v1/blocks/[slug]/route.ts +29 -0
  55. package/dist/templates/app/api/v1/blocks/docs.md +173 -0
  56. package/dist/templates/app/api/v1/blocks/presets.ts +121 -0
  57. package/dist/templates/app/api/v1/blocks/route.ts +45 -0
  58. package/dist/templates/app/api/v1/blocks/validate/route.ts +45 -0
  59. package/dist/templates/app/api/v1/cron/docs.md +116 -0
  60. package/dist/templates/app/api/v1/cron/presets.ts +26 -0
  61. package/dist/templates/app/api/v1/cron/process/route.ts +108 -0
  62. package/dist/templates/app/api/v1/devtools/blocks/route.ts +82 -0
  63. package/dist/templates/app/api/v1/devtools/docs/route.ts +150 -0
  64. package/dist/templates/app/api/v1/devtools/docs.md +204 -0
  65. package/dist/templates/app/api/v1/devtools/features/route.ts +61 -0
  66. package/dist/templates/app/api/v1/devtools/flows/route.ts +61 -0
  67. package/dist/templates/app/api/v1/devtools/presets.ts +113 -0
  68. package/dist/templates/app/api/v1/devtools/scheduled-actions/route.ts +120 -0
  69. package/dist/templates/app/api/v1/devtools/testing/route.ts +82 -0
  70. package/dist/templates/app/api/v1/media/docs.md +117 -0
  71. package/dist/templates/app/api/v1/media/presets.ts +24 -0
  72. package/dist/templates/app/api/v1/media/upload/route.ts +150 -0
  73. package/dist/templates/app/api/v1/patterns/[id]/usages/route.ts +116 -0
  74. package/dist/templates/app/api/v1/plugin/[...path]/route.ts +373 -0
  75. package/dist/templates/app/api/v1/plugin/docs.md +79 -0
  76. package/dist/templates/app/api/v1/plugin/presets.ts +21 -0
  77. package/dist/templates/app/api/v1/plugin/route.ts +96 -0
  78. package/dist/templates/app/api/v1/post-categories/[id]/route.ts +255 -0
  79. package/dist/templates/app/api/v1/post-categories/docs.md +134 -0
  80. package/dist/templates/app/api/v1/post-categories/presets.ts +78 -0
  81. package/dist/templates/app/api/v1/post-categories/route.ts +119 -0
  82. package/dist/templates/app/api/v1/team-invitations/[token]/accept/route.ts +179 -0
  83. package/dist/templates/app/api/v1/team-invitations/[token]/decline/route.ts +120 -0
  84. package/dist/templates/app/api/v1/team-invitations/[token]/route.ts +89 -0
  85. package/dist/templates/app/api/v1/team-invitations/docs.md +88 -0
  86. package/dist/templates/app/api/v1/team-invitations/presets.ts +43 -0
  87. package/dist/templates/app/api/v1/team-invitations/route.ts +114 -0
  88. package/dist/templates/app/api/v1/teams/[teamId]/invitations/route.ts +171 -0
  89. package/dist/templates/app/api/v1/teams/[teamId]/invoices/[invoiceNumber]/route.ts +105 -0
  90. package/dist/templates/app/api/v1/teams/[teamId]/invoices/route.ts +125 -0
  91. package/dist/templates/app/api/v1/teams/[teamId]/members/[memberId]/route.ts +263 -0
  92. package/dist/templates/app/api/v1/teams/[teamId]/members/route.ts +358 -0
  93. package/dist/templates/app/api/v1/teams/[teamId]/route.ts +322 -0
  94. package/dist/templates/app/api/v1/teams/[teamId]/subscription/route.ts +50 -0
  95. package/dist/templates/app/api/v1/teams/[teamId]/usage/[limitSlug]/route.ts +91 -0
  96. package/dist/templates/app/api/v1/teams/docs.md +320 -0
  97. package/dist/templates/app/api/v1/teams/presets.ts +178 -0
  98. package/dist/templates/app/api/v1/teams/route.ts +293 -0
  99. package/dist/templates/app/api/v1/teams/switch/route.ts +88 -0
  100. package/dist/templates/app/api/v1/theme/[...path]/route.ts +361 -0
  101. package/dist/templates/app/api/v1/theme/docs.md +74 -0
  102. package/dist/templates/app/api/v1/theme/presets.ts +21 -0
  103. package/dist/templates/app/api/v1/theme/route.ts +96 -0
  104. package/dist/templates/app/api/v1/users/[id]/meta/[key]/route.ts +363 -0
  105. package/dist/templates/app/api/v1/users/[id]/route.ts +302 -0
  106. package/dist/templates/app/api/v1/users/docs.md +93 -0
  107. package/dist/templates/app/api/v1/users/presets.ts +59 -0
  108. package/dist/templates/app/api/v1/users/route.ts +197 -0
  109. package/dist/templates/app/dashboard/(main)/[entity]/[id]/edit/page.tsx +117 -0
  110. package/dist/templates/app/dashboard/(main)/[entity]/[id]/page.tsx +103 -0
  111. package/dist/templates/app/dashboard/(main)/[entity]/create/page.tsx +95 -0
  112. package/dist/templates/app/dashboard/(main)/[entity]/error.tsx +51 -0
  113. package/dist/templates/app/dashboard/(main)/[entity]/layout.tsx +113 -0
  114. package/dist/templates/app/dashboard/(main)/[entity]/loading.tsx +61 -0
  115. package/dist/templates/app/dashboard/(main)/[entity]/page.tsx +90 -0
  116. package/dist/templates/app/dashboard/(main)/layout.tsx +98 -0
  117. package/dist/templates/app/dashboard/(main)/loading.tsx +5 -0
  118. package/dist/templates/app/dashboard/(main)/page.tsx +201 -0
  119. package/dist/templates/app/dashboard/(main)/patterns/[id]/edit/page.tsx +114 -0
  120. package/dist/templates/app/dashboard/(main)/patterns/[id]/page.tsx +20 -0
  121. package/dist/templates/app/dashboard/(main)/patterns/[id]/reports/page.tsx +171 -0
  122. package/dist/templates/app/dashboard/(main)/patterns/create/page.tsx +86 -0
  123. package/dist/templates/app/dashboard/(main)/patterns/page.tsx +444 -0
  124. package/dist/templates/app/dashboard/features/analytics/page.tsx +35 -0
  125. package/dist/templates/app/dashboard/features/automation/page.tsx +35 -0
  126. package/dist/templates/app/dashboard/features/layout.tsx +13 -0
  127. package/dist/templates/app/dashboard/features/loading.tsx +5 -0
  128. package/dist/templates/app/dashboard/features/webhooks/page.tsx +35 -0
  129. package/dist/templates/app/dashboard/layout.tsx +86 -0
  130. package/dist/templates/app/dashboard/permission-denied/page.tsx +29 -0
  131. package/dist/templates/app/dashboard/settings/api-keys/loading.tsx +5 -0
  132. package/dist/templates/app/dashboard/settings/api-keys/page.tsx +513 -0
  133. package/dist/templates/app/dashboard/settings/billing/loading.tsx +5 -0
  134. package/dist/templates/app/dashboard/settings/billing/page.tsx +284 -0
  135. package/dist/templates/app/dashboard/settings/invoices/[invoiceNumber]/page.tsx +222 -0
  136. package/dist/templates/app/dashboard/settings/invoices/loading.tsx +5 -0
  137. package/dist/templates/app/dashboard/settings/invoices/page.tsx +82 -0
  138. package/dist/templates/app/dashboard/settings/layout.tsx +151 -0
  139. package/dist/templates/app/dashboard/settings/loading.tsx +5 -0
  140. package/dist/templates/app/dashboard/settings/notifications/loading.tsx +5 -0
  141. package/dist/templates/app/dashboard/settings/notifications/page.tsx +462 -0
  142. package/dist/templates/app/dashboard/settings/page.tsx +92 -0
  143. package/dist/templates/app/dashboard/settings/password/loading.tsx +5 -0
  144. package/dist/templates/app/dashboard/settings/password/page.tsx +306 -0
  145. package/dist/templates/app/dashboard/settings/plans/loading.tsx +5 -0
  146. package/dist/templates/app/dashboard/settings/plans/page.tsx +40 -0
  147. package/dist/templates/app/dashboard/settings/profile/loading.tsx +5 -0
  148. package/dist/templates/app/dashboard/settings/profile/page.tsx +686 -0
  149. package/dist/templates/app/dashboard/settings/security/loading.tsx +5 -0
  150. package/dist/templates/app/dashboard/settings/security/page.tsx +505 -0
  151. package/dist/templates/app/dashboard/settings/teams/loading.tsx +5 -0
  152. package/dist/templates/app/dashboard/settings/teams/page.tsx +272 -0
  153. package/dist/templates/app/dashboard/settings/teams/permissions/page.tsx +92 -0
  154. package/dist/templates/app/devtools/blocks/[slug]/page.tsx +39 -0
  155. package/dist/templates/app/devtools/blocks/page.tsx +31 -0
  156. package/dist/templates/app/devtools/config/page.tsx +31 -0
  157. package/dist/templates/app/devtools/features/page.tsx +31 -0
  158. package/dist/templates/app/devtools/flows/page.tsx +31 -0
  159. package/dist/templates/app/devtools/layout.tsx +58 -0
  160. package/dist/templates/app/devtools/page.tsx +121 -0
  161. package/dist/templates/app/devtools/scheduled-actions/page.tsx +157 -0
  162. package/dist/templates/app/devtools/style/page.tsx +330 -0
  163. package/dist/templates/app/devtools/tags/page.tsx +31 -0
  164. package/dist/templates/app/devtools/tests/[[...path]]/page.tsx +47 -0
  165. package/dist/templates/app/favicon.ico +0 -0
  166. package/dist/templates/app/globals.css +12 -0
  167. package/dist/templates/app/layout.tsx +96 -0
  168. package/dist/templates/app/public/page.tsx +30 -0
  169. package/dist/templates/app/superadmin/docs/[section]/[page]/page.tsx +92 -0
  170. package/dist/templates/app/superadmin/docs/page.tsx +75 -0
  171. package/dist/templates/app/superadmin/layout.tsx +67 -0
  172. package/dist/templates/app/superadmin/page.tsx +149 -0
  173. package/dist/templates/app/superadmin/subscriptions/page.tsx +655 -0
  174. package/dist/templates/app/superadmin/team-roles/page.tsx +493 -0
  175. package/dist/templates/app/superadmin/teams/[teamId]/page.tsx +687 -0
  176. package/dist/templates/app/superadmin/teams/page.tsx +302 -0
  177. package/dist/templates/app/superadmin/users/[userId]/page.tsx +548 -0
  178. package/dist/templates/app/superadmin/users/page.tsx +528 -0
  179. package/package.json +2 -2
  180. package/templates/app/(auth)/forgot-password/page.tsx +216 -0
  181. package/templates/app/(auth)/layout.tsx +51 -0
  182. package/templates/app/(auth)/login/page.tsx +21 -0
  183. package/templates/app/(auth)/reset-password/page.tsx +212 -0
  184. package/templates/app/(auth)/signup/page.tsx +21 -0
  185. package/templates/app/(auth)/verify-email/page.tsx +190 -0
  186. package/templates/app/(public)/[...slug]/page.tsx +378 -0
  187. package/templates/app/(public)/docs/[section]/[page]/page.tsx +90 -0
  188. package/templates/app/(public)/docs/layout.tsx +25 -0
  189. package/templates/app/(public)/docs/page.tsx +81 -0
  190. package/templates/app/(public)/layout.tsx +41 -0
  191. package/templates/app/(public)/page.tsx +19 -0
  192. package/templates/app/403/page.tsx +89 -0
  193. package/templates/app/api/auth/[...all]/route.ts +78 -0
  194. package/templates/app/api/cron/billing/lifecycle/route.ts +98 -0
  195. package/templates/app/api/csp-report/route.ts +175 -0
  196. package/templates/app/api/devtools/config/entities/route.ts +108 -0
  197. package/templates/app/api/devtools/config/theme/route.ts +66 -0
  198. package/templates/app/api/devtools/tests/[...path]/route.ts +130 -0
  199. package/templates/app/api/devtools/tests/route.ts +134 -0
  200. package/templates/app/api/health/route.ts +29 -0
  201. package/templates/app/api/internal/user-metadata/route.ts +36 -0
  202. package/templates/app/api/superadmin/subscriptions/route.ts +310 -0
  203. package/templates/app/api/superadmin/teams/[teamId]/route.ts +286 -0
  204. package/templates/app/api/superadmin/teams/route.ts +188 -0
  205. package/templates/app/api/superadmin/users/[userId]/route.ts +540 -0
  206. package/templates/app/api/superadmin/users/route.ts +323 -0
  207. package/templates/app/api/user/delete-account/route.ts +55 -0
  208. package/templates/app/api/user/plan-flags/route.ts +283 -0
  209. package/templates/app/api/user/profile/route.ts +133 -0
  210. package/templates/app/api/v1/[entity]/[id]/child/[childType]/[childId]/route.ts +210 -0
  211. package/templates/app/api/v1/[entity]/[id]/child/[childType]/route.ts +331 -0
  212. package/templates/app/api/v1/[entity]/[id]/route.ts +35 -0
  213. package/templates/app/api/v1/[entity]/docs.md +369 -0
  214. package/templates/app/api/v1/[entity]/presets.ts +194 -0
  215. package/templates/app/api/v1/[entity]/route.ts +31 -0
  216. package/templates/app/api/v1/api-keys/[id]/route.ts +303 -0
  217. package/templates/app/api/v1/api-keys/docs.md +101 -0
  218. package/templates/app/api/v1/api-keys/presets.ts +31 -0
  219. package/templates/app/api/v1/api-keys/route.ts +250 -0
  220. package/templates/app/api/v1/auth/docs.md +184 -0
  221. package/templates/app/api/v1/auth/presets.ts +44 -0
  222. package/templates/app/api/v1/auth/signup-with-invite/route.ts +227 -0
  223. package/templates/app/api/v1/billing/cancel/route.ts +206 -0
  224. package/templates/app/api/v1/billing/change-plan/route.ts +97 -0
  225. package/templates/app/api/v1/billing/check-action/route.ts +81 -0
  226. package/templates/app/api/v1/billing/checkout/route.ts +124 -0
  227. package/templates/app/api/v1/billing/docs.md +209 -0
  228. package/templates/app/api/v1/billing/plans/route.ts +85 -0
  229. package/templates/app/api/v1/billing/portal/route.ts +90 -0
  230. package/templates/app/api/v1/billing/presets.ts +121 -0
  231. package/templates/app/api/v1/billing/webhooks/stripe/route.ts +428 -0
  232. package/templates/app/api/v1/blocks/[slug]/route.ts +29 -0
  233. package/templates/app/api/v1/blocks/docs.md +173 -0
  234. package/templates/app/api/v1/blocks/presets.ts +121 -0
  235. package/templates/app/api/v1/blocks/route.ts +45 -0
  236. package/templates/app/api/v1/blocks/validate/route.ts +45 -0
  237. package/templates/app/api/v1/cron/docs.md +116 -0
  238. package/templates/app/api/v1/cron/presets.ts +26 -0
  239. package/templates/app/api/v1/cron/process/route.ts +108 -0
  240. package/templates/app/api/v1/devtools/blocks/route.ts +82 -0
  241. package/templates/app/api/v1/devtools/docs/route.ts +150 -0
  242. package/templates/app/api/v1/devtools/docs.md +204 -0
  243. package/templates/app/api/v1/devtools/features/route.ts +61 -0
  244. package/templates/app/api/v1/devtools/flows/route.ts +61 -0
  245. package/templates/app/api/v1/devtools/presets.ts +113 -0
  246. package/templates/app/api/v1/devtools/scheduled-actions/route.ts +120 -0
  247. package/templates/app/api/v1/devtools/testing/route.ts +82 -0
  248. package/templates/app/api/v1/media/docs.md +117 -0
  249. package/templates/app/api/v1/media/presets.ts +24 -0
  250. package/templates/app/api/v1/media/upload/route.ts +150 -0
  251. package/templates/app/api/v1/patterns/[id]/usages/route.ts +116 -0
  252. package/templates/app/api/v1/plugin/[...path]/route.ts +373 -0
  253. package/templates/app/api/v1/plugin/docs.md +79 -0
  254. package/templates/app/api/v1/plugin/presets.ts +21 -0
  255. package/templates/app/api/v1/plugin/route.ts +96 -0
  256. package/templates/app/api/v1/post-categories/[id]/route.ts +255 -0
  257. package/templates/app/api/v1/post-categories/docs.md +134 -0
  258. package/templates/app/api/v1/post-categories/presets.ts +78 -0
  259. package/templates/app/api/v1/post-categories/route.ts +119 -0
  260. package/templates/app/api/v1/team-invitations/[token]/accept/route.ts +179 -0
  261. package/templates/app/api/v1/team-invitations/[token]/decline/route.ts +120 -0
  262. package/templates/app/api/v1/team-invitations/[token]/route.ts +89 -0
  263. package/templates/app/api/v1/team-invitations/docs.md +88 -0
  264. package/templates/app/api/v1/team-invitations/presets.ts +43 -0
  265. package/templates/app/api/v1/team-invitations/route.ts +114 -0
  266. package/templates/app/api/v1/teams/[teamId]/invitations/route.ts +171 -0
  267. package/templates/app/api/v1/teams/[teamId]/invoices/[invoiceNumber]/route.ts +105 -0
  268. package/templates/app/api/v1/teams/[teamId]/invoices/route.ts +125 -0
  269. package/templates/app/api/v1/teams/[teamId]/members/[memberId]/route.ts +263 -0
  270. package/templates/app/api/v1/teams/[teamId]/members/route.ts +358 -0
  271. package/templates/app/api/v1/teams/[teamId]/route.ts +322 -0
  272. package/templates/app/api/v1/teams/[teamId]/subscription/route.ts +50 -0
  273. package/templates/app/api/v1/teams/[teamId]/usage/[limitSlug]/route.ts +91 -0
  274. package/templates/app/api/v1/teams/docs.md +320 -0
  275. package/templates/app/api/v1/teams/presets.ts +178 -0
  276. package/templates/app/api/v1/teams/route.ts +293 -0
  277. package/templates/app/api/v1/teams/switch/route.ts +88 -0
  278. package/templates/app/api/v1/theme/[...path]/route.ts +361 -0
  279. package/templates/app/api/v1/theme/docs.md +74 -0
  280. package/templates/app/api/v1/theme/presets.ts +21 -0
  281. package/templates/app/api/v1/theme/route.ts +96 -0
  282. package/templates/app/api/v1/users/[id]/meta/[key]/route.ts +363 -0
  283. package/templates/app/api/v1/users/[id]/route.ts +302 -0
  284. package/templates/app/api/v1/users/docs.md +93 -0
  285. package/templates/app/api/v1/users/presets.ts +59 -0
  286. package/templates/app/api/v1/users/route.ts +197 -0
  287. package/templates/app/dashboard/(main)/[entity]/[id]/edit/page.tsx +117 -0
  288. package/templates/app/dashboard/(main)/[entity]/[id]/page.tsx +103 -0
  289. package/templates/app/dashboard/(main)/[entity]/create/page.tsx +95 -0
  290. package/templates/app/dashboard/(main)/[entity]/error.tsx +51 -0
  291. package/templates/app/dashboard/(main)/[entity]/layout.tsx +113 -0
  292. package/templates/app/dashboard/(main)/[entity]/loading.tsx +61 -0
  293. package/templates/app/dashboard/(main)/[entity]/page.tsx +90 -0
  294. package/templates/app/dashboard/(main)/layout.tsx +98 -0
  295. package/templates/app/dashboard/(main)/loading.tsx +5 -0
  296. package/templates/app/dashboard/(main)/page.tsx +201 -0
  297. package/templates/app/dashboard/(main)/patterns/[id]/edit/page.tsx +114 -0
  298. package/templates/app/dashboard/(main)/patterns/[id]/page.tsx +20 -0
  299. package/templates/app/dashboard/(main)/patterns/[id]/reports/page.tsx +171 -0
  300. package/templates/app/dashboard/(main)/patterns/create/page.tsx +86 -0
  301. package/templates/app/dashboard/(main)/patterns/page.tsx +444 -0
  302. package/templates/app/dashboard/features/analytics/page.tsx +35 -0
  303. package/templates/app/dashboard/features/automation/page.tsx +35 -0
  304. package/templates/app/dashboard/features/layout.tsx +13 -0
  305. package/templates/app/dashboard/features/loading.tsx +5 -0
  306. package/templates/app/dashboard/features/webhooks/page.tsx +35 -0
  307. package/templates/app/dashboard/layout.tsx +86 -0
  308. package/templates/app/dashboard/permission-denied/page.tsx +29 -0
  309. package/templates/app/dashboard/settings/api-keys/loading.tsx +5 -0
  310. package/templates/app/dashboard/settings/api-keys/page.tsx +513 -0
  311. package/templates/app/dashboard/settings/billing/loading.tsx +5 -0
  312. package/templates/app/dashboard/settings/billing/page.tsx +284 -0
  313. package/templates/app/dashboard/settings/invoices/[invoiceNumber]/page.tsx +222 -0
  314. package/templates/app/dashboard/settings/invoices/loading.tsx +5 -0
  315. package/templates/app/dashboard/settings/invoices/page.tsx +82 -0
  316. package/templates/app/dashboard/settings/layout.tsx +151 -0
  317. package/templates/app/dashboard/settings/loading.tsx +5 -0
  318. package/templates/app/dashboard/settings/notifications/loading.tsx +5 -0
  319. package/templates/app/dashboard/settings/notifications/page.tsx +462 -0
  320. package/templates/app/dashboard/settings/page.tsx +92 -0
  321. package/templates/app/dashboard/settings/password/loading.tsx +5 -0
  322. package/templates/app/dashboard/settings/password/page.tsx +306 -0
  323. package/templates/app/dashboard/settings/plans/loading.tsx +5 -0
  324. package/templates/app/dashboard/settings/plans/page.tsx +40 -0
  325. package/templates/app/dashboard/settings/profile/loading.tsx +5 -0
  326. package/templates/app/dashboard/settings/profile/page.tsx +686 -0
  327. package/templates/app/dashboard/settings/security/loading.tsx +5 -0
  328. package/templates/app/dashboard/settings/security/page.tsx +505 -0
  329. package/templates/app/dashboard/settings/teams/loading.tsx +5 -0
  330. package/templates/app/dashboard/settings/teams/page.tsx +272 -0
  331. package/templates/app/dashboard/settings/teams/permissions/page.tsx +92 -0
  332. package/templates/app/devtools/blocks/[slug]/page.tsx +39 -0
  333. package/templates/app/devtools/blocks/page.tsx +31 -0
  334. package/templates/app/devtools/config/page.tsx +31 -0
  335. package/templates/app/devtools/features/page.tsx +31 -0
  336. package/templates/app/devtools/flows/page.tsx +31 -0
  337. package/templates/app/devtools/layout.tsx +58 -0
  338. package/templates/app/devtools/page.tsx +121 -0
  339. package/templates/app/devtools/scheduled-actions/page.tsx +157 -0
  340. package/templates/app/devtools/style/page.tsx +330 -0
  341. package/templates/app/devtools/tags/page.tsx +31 -0
  342. package/templates/app/devtools/tests/[[...path]]/page.tsx +47 -0
  343. package/templates/app/favicon.ico +0 -0
  344. package/templates/app/globals.css +12 -0
  345. package/templates/app/layout.tsx +96 -0
  346. package/templates/app/public/page.tsx +30 -0
  347. package/templates/app/superadmin/docs/[section]/[page]/page.tsx +92 -0
  348. package/templates/app/superadmin/docs/page.tsx +75 -0
  349. package/templates/app/superadmin/layout.tsx +67 -0
  350. package/templates/app/superadmin/page.tsx +149 -0
  351. package/templates/app/superadmin/subscriptions/page.tsx +655 -0
  352. package/templates/app/superadmin/team-roles/page.tsx +493 -0
  353. package/templates/app/superadmin/teams/[teamId]/page.tsx +687 -0
  354. package/templates/app/superadmin/teams/page.tsx +302 -0
  355. package/templates/app/superadmin/users/[userId]/page.tsx +548 -0
  356. package/templates/app/superadmin/users/page.tsx +528 -0
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Generic Entity Detail Route
3
+ *
4
+ * Catch-all route that handles GET, PATCH, and DELETE requests for any registered entity.
5
+ * Supports dual authentication (API Keys + Sessions).
6
+ *
7
+ * Examples:
8
+ * GET /api/v1/products/123 -> Get product by ID
9
+ * PATCH /api/v1/products/123 -> Update product
10
+ * DELETE /api/v1/products/123 -> Delete product
11
+ * GET /api/v1/orders/456 -> Get order by ID
12
+ * PATCH /api/v1/orders/456 -> Update order
13
+ * DELETE /api/v1/orders/456 -> Delete order
14
+ */
15
+
16
+ // CRITICAL: Initialize entity registry for API routes
17
+ // This import is processed by webpack which resolves the @nextsparkjs alias
18
+ // The setEntityRegistry call happens at module load time
19
+ import { setEntityRegistry, isRegistryInitialized } from '@nextsparkjs/core/lib/entities/queries'
20
+ import { ENTITY_REGISTRY, ENTITY_METADATA } from '@nextsparkjs/registries/entity-registry'
21
+ if (!isRegistryInitialized()) {
22
+ setEntityRegistry(ENTITY_REGISTRY, ENTITY_METADATA)
23
+ }
24
+
25
+ import {
26
+ handleGenericRead,
27
+ handleGenericUpdate,
28
+ handleGenericDelete,
29
+ handleGenericOptions
30
+ } from '@nextsparkjs/core/lib/api/entity/generic-handler'
31
+
32
+ export const GET = handleGenericRead
33
+ export const PATCH = handleGenericUpdate
34
+ export const DELETE = handleGenericDelete
35
+ export const OPTIONS = handleGenericOptions
@@ -0,0 +1,369 @@
1
+ # Dynamic Entity API
2
+
3
+ Generic CRUD endpoints for all registered entities. These routes dynamically handle any entity configured in the system.
4
+
5
+ ## Overview
6
+
7
+ The Dynamic Entity API provides a unified interface for managing all registered entities in the system. Instead of creating separate API routes for each entity type, this single dynamic route handles all CRUD operations based on the entity configuration.
8
+
9
+ When you access `/api/v1/products`, `/api/v1/tasks`, `/api/v1/orders`, etc., you're using this dynamic routing system that reads the entity configuration and handles the request accordingly.
10
+
11
+ ## Authentication
12
+
13
+ All endpoints require authentication via:
14
+ - **Session cookie** (for browser-based requests)
15
+ - **API Key** header (for server-to-server requests)
16
+
17
+ The entity's `access` configuration determines visibility rules (public, shared, etc.).
18
+
19
+ ## Entity Resolution
20
+
21
+ URLs are resolved using the entity's `tableName` (typically plural). For example:
22
+ - `/api/v1/products` → resolves to `product` entity
23
+ - `/api/v1/tasks` → resolves to `task` entity
24
+ - `/api/v1/team-members` → resolves to `teamMember` entity
25
+
26
+ ## Endpoints
27
+
28
+ ### List Entities
29
+ `GET /api/v1/{entity}`
30
+
31
+ Returns a paginated list of entities.
32
+
33
+ **URL Examples:**
34
+ ```
35
+ GET /api/v1/tasks # List tasks
36
+ GET /api/v1/products # List products
37
+ GET /api/v1/orders # List orders
38
+ ```
39
+
40
+ **Query Parameters:**
41
+ - `limit` (number, optional): Maximum records to return. Default: 20
42
+ - `offset` (number, optional): Number of records to skip. Default: 0
43
+ - `search` (string, optional): Search term (searches searchable fields)
44
+ - `sortBy` (string, optional): Field to sort by (must be sortable)
45
+ - `sortOrder` (string, optional): Sort direction - "asc" or "desc"
46
+ - `{fieldName}` (any, optional): Filter by any filterable field
47
+
48
+ **Example Response:**
49
+ ```json
50
+ {
51
+ "success": true,
52
+ "data": [
53
+ {
54
+ "id": "abc123",
55
+ "title": "Example item",
56
+ "status": "active",
57
+ "createdAt": "2024-01-15T10:30:00Z"
58
+ }
59
+ ],
60
+ "pagination": {
61
+ "total": 42,
62
+ "limit": 20,
63
+ "offset": 0
64
+ },
65
+ "info": {
66
+ "timestamp": "2024-01-15T10:30:00Z"
67
+ }
68
+ }
69
+ ```
70
+
71
+ **Filtering Examples:**
72
+ ```
73
+ GET /api/v1/tasks?status=todo
74
+ GET /api/v1/products?category=electronics&inStock=true
75
+ GET /api/v1/orders?search=john&sortBy=createdAt&sortOrder=desc
76
+ ```
77
+
78
+ ### Create Entity
79
+ `POST /api/v1/{entity}`
80
+
81
+ Create a new entity record.
82
+
83
+ **URL Examples:**
84
+ ```
85
+ POST /api/v1/tasks # Create task
86
+ POST /api/v1/products # Create product
87
+ POST /api/v1/orders # Create order
88
+ ```
89
+
90
+ **Request Body:**
91
+ The request body must include all required fields defined in the entity configuration.
92
+
93
+ ```json
94
+ {
95
+ "title": "New item",
96
+ "description": "Item details",
97
+ "status": "draft"
98
+ }
99
+ ```
100
+
101
+ **Response (201 Created):**
102
+ ```json
103
+ {
104
+ "success": true,
105
+ "data": {
106
+ "id": "new123",
107
+ "title": "New item",
108
+ "description": "Item details",
109
+ "status": "draft",
110
+ "createdAt": "2024-01-15T10:30:00Z"
111
+ },
112
+ "info": {
113
+ "timestamp": "2024-01-15T10:30:00Z"
114
+ }
115
+ }
116
+ ```
117
+
118
+ **Validation:**
119
+ - Required fields must be provided
120
+ - Field values are validated against the entity schema
121
+ - Unique constraints are enforced (e.g., slugs)
122
+
123
+ ---
124
+
125
+ ## Single Entity Endpoints
126
+
127
+ ### Get Entity by ID
128
+ `GET /api/v1/{entity}/{id}`
129
+
130
+ Returns a single entity by its ID.
131
+
132
+ **URL Examples:**
133
+ ```
134
+ GET /api/v1/tasks/abc123 # Get task by ID
135
+ GET /api/v1/products/prod456 # Get product by ID
136
+ ```
137
+
138
+ **Path Parameters:**
139
+ - `id` (string, required): Entity ID
140
+
141
+ **Response:**
142
+ ```json
143
+ {
144
+ "success": true,
145
+ "data": {
146
+ "id": "abc123",
147
+ "title": "Example item",
148
+ "description": "Full details",
149
+ "status": "active",
150
+ "createdAt": "2024-01-15T10:30:00Z",
151
+ "updatedAt": "2024-01-16T14:20:00Z"
152
+ },
153
+ "info": {
154
+ "timestamp": "2024-01-16T14:20:00Z"
155
+ }
156
+ }
157
+ ```
158
+
159
+ ### Update Entity
160
+ `PATCH /api/v1/{entity}/{id}`
161
+
162
+ Update an existing entity. Supports partial updates.
163
+
164
+ **URL Examples:**
165
+ ```
166
+ PATCH /api/v1/tasks/abc123 # Update task
167
+ PATCH /api/v1/products/prod456 # Update product
168
+ ```
169
+
170
+ **Path Parameters:**
171
+ - `id` (string, required): Entity ID
172
+
173
+ **Request Body (partial update):**
174
+ ```json
175
+ {
176
+ "status": "completed",
177
+ "notes": "Updated notes"
178
+ }
179
+ ```
180
+
181
+ **Response:**
182
+ ```json
183
+ {
184
+ "success": true,
185
+ "data": {
186
+ "id": "abc123",
187
+ "title": "Example item",
188
+ "status": "completed",
189
+ "notes": "Updated notes",
190
+ "updatedAt": "2024-01-16T14:25:00Z"
191
+ },
192
+ "info": {
193
+ "timestamp": "2024-01-16T14:25:00Z"
194
+ }
195
+ }
196
+ ```
197
+
198
+ ### Delete Entity
199
+ `DELETE /api/v1/{entity}/{id}`
200
+
201
+ Delete an entity record.
202
+
203
+ **URL Examples:**
204
+ ```
205
+ DELETE /api/v1/tasks/abc123 # Delete task
206
+ DELETE /api/v1/products/prod456 # Delete product
207
+ ```
208
+
209
+ **Path Parameters:**
210
+ - `id` (string, required): Entity ID
211
+
212
+ **Response:**
213
+ ```json
214
+ {
215
+ "success": true,
216
+ "data": {
217
+ "deleted": true,
218
+ "id": "abc123"
219
+ },
220
+ "info": {
221
+ "timestamp": "2024-01-16T14:30:00Z"
222
+ }
223
+ }
224
+ ```
225
+
226
+ ---
227
+
228
+ ## Child Entity Endpoints
229
+
230
+ For entities with child relationships (e.g., order items under orders):
231
+
232
+ ### List Child Entities
233
+ `GET /api/v1/{entity}/{id}/child/{childType}`
234
+
235
+ Returns child entities for a parent entity.
236
+
237
+ **URL Examples:**
238
+ ```
239
+ GET /api/v1/orders/ord123/child/order-items # List order items
240
+ GET /api/v1/customers/cust456/child/contacts # List customer contacts
241
+ ```
242
+
243
+ **Path Parameters:**
244
+ - `id` (string, required): Parent entity ID
245
+ - `childType` (string, required): Child entity type name
246
+
247
+ **Response:**
248
+ ```json
249
+ {
250
+ "success": true,
251
+ "data": [
252
+ {
253
+ "id": "item1",
254
+ "parentId": "ord123",
255
+ "productId": "prod456",
256
+ "quantity": 2,
257
+ "price": 29.99
258
+ }
259
+ ],
260
+ "info": {
261
+ "timestamp": "2024-01-16T14:30:00Z"
262
+ }
263
+ }
264
+ ```
265
+
266
+ ### Create Child Entity
267
+ `POST /api/v1/{entity}/{id}/child/{childType}`
268
+
269
+ Create a child entity under a parent.
270
+
271
+ **URL Examples:**
272
+ ```
273
+ POST /api/v1/orders/ord123/child/order-items # Create order item
274
+ POST /api/v1/customers/cust456/child/contacts # Create contact
275
+ ```
276
+
277
+ **Request Body:**
278
+ ```json
279
+ {
280
+ "productId": "prod789",
281
+ "quantity": 3,
282
+ "price": 19.99
283
+ }
284
+ ```
285
+
286
+ **Note:** The `parentId` is automatically set from the URL parameter.
287
+
288
+ ### Single Child Entity Operations
289
+ `GET/PATCH/DELETE /api/v1/{entity}/{id}/child/{childType}/{childId}`
290
+
291
+ Manage individual child entities.
292
+
293
+ **URL Examples:**
294
+ ```
295
+ GET /api/v1/orders/ord123/child/order-items/item1 # Get item
296
+ PATCH /api/v1/orders/ord123/child/order-items/item1 # Update item
297
+ DELETE /api/v1/orders/ord123/child/order-items/item1 # Delete item
298
+ ```
299
+
300
+ ---
301
+
302
+ ## Entity Configuration Properties
303
+
304
+ Each entity's behavior is controlled by its configuration:
305
+
306
+ | Property | Description |
307
+ |----------|-------------|
308
+ | `access.public` | Whether non-authenticated users can read |
309
+ | `access.shared` | Whether all team members can see all records |
310
+ | `access.api` | Whether entity has API endpoints |
311
+ | `access.metadata` | Whether entity supports metadata system |
312
+ | `ui.features.searchable` | Whether search is enabled |
313
+ | `ui.features.sortable` | Whether sorting is enabled |
314
+ | `ui.features.filterable` | Whether filtering is enabled |
315
+
316
+ ## Field Types
317
+
318
+ Entities support various field types:
319
+
320
+ | Type | Description |
321
+ |------|-------------|
322
+ | `text` | Single-line text input |
323
+ | `textarea` | Multi-line text |
324
+ | `richtext` | Rich text editor (HTML) |
325
+ | `number` | Numeric values |
326
+ | `select` | Single selection from options |
327
+ | `multiselect` | Multiple selections |
328
+ | `checkbox` | Boolean toggle |
329
+ | `date` | Date picker |
330
+ | `datetime` | Date and time picker |
331
+ | `image` | Image upload/URL |
332
+ | `relation` | Reference to another entity |
333
+ | `relation-multi` | Multiple references |
334
+ | `json` | JSON data |
335
+ | `tags` | Tag array |
336
+
337
+ ## Row Level Security (RLS)
338
+
339
+ All entity queries respect PostgreSQL Row Level Security:
340
+ - Team-scoped entities filter by the user's active team
341
+ - Shared entities allow read access to all team members
342
+ - Private entities filter by `createdBy` user
343
+ - Superadmin/developer roles can bypass RLS for management
344
+
345
+ ## Error Responses
346
+
347
+ | Status | Description |
348
+ |--------|-------------|
349
+ | 400 | Bad Request - Invalid parameters or validation error |
350
+ | 401 | Unauthorized - Authentication required |
351
+ | 403 | Forbidden - Insufficient permissions or RLS violation |
352
+ | 404 | Not Found - Entity type or record not found |
353
+ | 409 | Conflict - Duplicate key or constraint violation |
354
+ | 422 | Validation Error - Invalid field values |
355
+ | 500 | Server Error - Internal error |
356
+
357
+ ## Related APIs
358
+
359
+ - **[API Keys](/api/v1/api-keys)** - Manage API keys for authentication
360
+ - **[Teams](/api/v1/teams)** - Team management and member access
361
+ - **[Media](/api/v1/media)** - File uploads for entity fields
362
+ - **[Blocks](/api/v1/blocks)** - Page builder blocks for builder-enabled entities
363
+
364
+ ## See Also
365
+
366
+ For entity-specific documentation with field details, see the individual entity docs:
367
+ - Tasks: `/api/v1/tasks` (entity-specific docs)
368
+ - Pages: `/api/v1/pages` (entity-specific docs)
369
+ - Posts: `/api/v1/posts` (entity-specific docs)
@@ -0,0 +1,194 @@
1
+ /**
2
+ * API Presets for Dynamic Entity Routes
3
+ *
4
+ * These presets demonstrate the generic entity API pattern.
5
+ * Replace {entity} with any registered entity (tasks, products, orders, etc.)
6
+ */
7
+
8
+ import { defineApiEndpoint } from '@nextsparkjs/core/types/api-presets'
9
+
10
+ export default defineApiEndpoint({
11
+ endpoint: '/api/v1/{entity}',
12
+ summary: 'Generic CRUD operations for any registered entity',
13
+ presets: [
14
+ // ==================== LIST OPERATIONS ====================
15
+ {
16
+ id: 'list-basic',
17
+ title: 'List Entities (Basic)',
18
+ description: 'Fetch entities with default pagination',
19
+ method: 'GET',
20
+ queryParams: {
21
+ limit: '20',
22
+ offset: '0'
23
+ },
24
+ tags: ['read', 'list']
25
+ },
26
+ {
27
+ id: 'list-with-search',
28
+ title: 'List with Search',
29
+ description: 'Search entities by searchable fields',
30
+ method: 'GET',
31
+ queryParams: {
32
+ search: 'example',
33
+ limit: '20'
34
+ },
35
+ tags: ['read', 'list', 'search']
36
+ },
37
+ {
38
+ id: 'list-with-sort',
39
+ title: 'List with Sorting',
40
+ description: 'Sort entities by a specific field',
41
+ method: 'GET',
42
+ queryParams: {
43
+ sortBy: 'createdAt',
44
+ sortOrder: 'desc',
45
+ limit: '20'
46
+ },
47
+ tags: ['read', 'list', 'sort']
48
+ },
49
+ {
50
+ id: 'list-with-filter',
51
+ title: 'List with Filter',
52
+ description: 'Filter entities by field value (e.g., status)',
53
+ method: 'GET',
54
+ queryParams: {
55
+ status: 'active',
56
+ limit: '20'
57
+ },
58
+ tags: ['read', 'list', 'filter']
59
+ },
60
+ {
61
+ id: 'list-paginated',
62
+ title: 'List with Pagination',
63
+ description: 'Get second page of results',
64
+ method: 'GET',
65
+ queryParams: {
66
+ limit: '10',
67
+ offset: '10'
68
+ },
69
+ tags: ['read', 'list', 'pagination']
70
+ },
71
+
72
+ // ==================== CREATE OPERATIONS ====================
73
+ {
74
+ id: 'create-basic',
75
+ title: 'Create Entity',
76
+ description: 'Create a new entity record',
77
+ method: 'POST',
78
+ payload: {
79
+ title: 'New Item',
80
+ status: 'draft'
81
+ },
82
+ tags: ['write', 'create']
83
+ },
84
+ {
85
+ id: 'create-with-fields',
86
+ title: 'Create with All Fields',
87
+ description: 'Create entity with multiple fields',
88
+ method: 'POST',
89
+ payload: {
90
+ title: 'Complete Item',
91
+ description: 'Full description here',
92
+ status: 'active',
93
+ priority: 'high'
94
+ },
95
+ tags: ['write', 'create']
96
+ },
97
+
98
+ // ==================== READ SINGLE ====================
99
+ {
100
+ id: 'get-by-id',
101
+ title: 'Get Entity by ID',
102
+ description: 'Fetch a single entity by its ID',
103
+ method: 'GET',
104
+ path: '/{id}',
105
+ tags: ['read', 'detail']
106
+ },
107
+
108
+ // ==================== UPDATE OPERATIONS ====================
109
+ {
110
+ id: 'update-status',
111
+ title: 'Update Status',
112
+ description: 'Update entity status field',
113
+ method: 'PATCH',
114
+ path: '/{id}',
115
+ payload: {
116
+ status: 'completed'
117
+ },
118
+ tags: ['write', 'update']
119
+ },
120
+ {
121
+ id: 'update-multiple-fields',
122
+ title: 'Update Multiple Fields',
123
+ description: 'Partial update with multiple fields',
124
+ method: 'PATCH',
125
+ path: '/{id}',
126
+ payload: {
127
+ title: 'Updated Title',
128
+ description: 'Updated description',
129
+ priority: 'low'
130
+ },
131
+ tags: ['write', 'update']
132
+ },
133
+
134
+ // ==================== DELETE OPERATIONS ====================
135
+ {
136
+ id: 'delete-by-id',
137
+ title: 'Delete Entity',
138
+ description: 'Delete an entity by ID',
139
+ method: 'DELETE',
140
+ path: '/{id}',
141
+ tags: ['write', 'delete']
142
+ },
143
+
144
+ // ==================== CHILD ENTITY OPERATIONS ====================
145
+ {
146
+ id: 'list-children',
147
+ title: 'List Child Entities',
148
+ description: 'Get all child entities for a parent',
149
+ method: 'GET',
150
+ path: '/{id}/child/{childType}',
151
+ tags: ['read', 'list', 'children']
152
+ },
153
+ {
154
+ id: 'create-child',
155
+ title: 'Create Child Entity',
156
+ description: 'Add a new child record to parent',
157
+ method: 'POST',
158
+ path: '/{id}/child/{childType}',
159
+ payload: {
160
+ name: 'New Child Item',
161
+ value: 100
162
+ },
163
+ tags: ['write', 'create', 'children']
164
+ },
165
+ {
166
+ id: 'get-child',
167
+ title: 'Get Child Entity',
168
+ description: 'Fetch a specific child entity',
169
+ method: 'GET',
170
+ path: '/{id}/child/{childType}/{childId}',
171
+ tags: ['read', 'detail', 'children']
172
+ },
173
+ {
174
+ id: 'update-child',
175
+ title: 'Update Child Entity',
176
+ description: 'Update a child entity',
177
+ method: 'PATCH',
178
+ path: '/{id}/child/{childType}/{childId}',
179
+ payload: {
180
+ name: 'Updated Child',
181
+ value: 200
182
+ },
183
+ tags: ['write', 'update', 'children']
184
+ },
185
+ {
186
+ id: 'delete-child',
187
+ title: 'Delete Child Entity',
188
+ description: 'Delete a child entity',
189
+ method: 'DELETE',
190
+ path: '/{id}/child/{childType}/{childId}',
191
+ tags: ['write', 'delete', 'children']
192
+ }
193
+ ]
194
+ })
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Generic Entity List Route
3
+ *
4
+ * Catch-all route that handles GET and POST requests for any registered entity.
5
+ * Supports dual authentication (API Keys + Sessions).
6
+ *
7
+ * Examples:
8
+ * GET /api/v1/products -> List products
9
+ * POST /api/v1/products -> Create product
10
+ * GET /api/v1/orders -> List orders
11
+ * POST /api/v1/orders -> Create order
12
+ */
13
+
14
+ // CRITICAL: Initialize entity registry for API routes
15
+ // This import is processed by webpack which resolves the @nextsparkjs alias
16
+ // The setEntityRegistry call happens at module load time
17
+ import { setEntityRegistry, isRegistryInitialized } from '@nextsparkjs/core/lib/entities/queries'
18
+ import { ENTITY_REGISTRY, ENTITY_METADATA } from '@nextsparkjs/registries/entity-registry'
19
+ if (!isRegistryInitialized()) {
20
+ setEntityRegistry(ENTITY_REGISTRY, ENTITY_METADATA)
21
+ }
22
+
23
+ import {
24
+ handleGenericList,
25
+ handleGenericCreate,
26
+ handleGenericOptions
27
+ } from '@nextsparkjs/core/lib/api/entity/generic-handler'
28
+
29
+ export const GET = handleGenericList
30
+ export const POST = handleGenericCreate
31
+ export const OPTIONS = handleGenericOptions