nuxt-backend 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (555) hide show
  1. package/README.md +8 -1
  2. package/dist/chunks/catalog.mjs +1 -1
  3. package/dist/chunks/doctor.mjs +102 -8
  4. package/dist/chunks/email-previews.mjs +1 -1
  5. package/dist/chunks/health.mjs +2 -2
  6. package/dist/chunks/index.mjs +3 -3
  7. package/dist/chunks/install.mjs +4 -4
  8. package/dist/chunks/run.mjs +1 -1
  9. package/dist/chunks/server.mjs +6 -6
  10. package/dist/cli.mjs +285 -140
  11. package/dist/convex/catalog.d.ts +8 -0
  12. package/dist/convex/catalog.d.ts.map +1 -1
  13. package/dist/convex/catalog.js +16 -0
  14. package/dist/convex/catalog.js.map +1 -1
  15. package/dist/convex/components/backend/_generated/component.d.ts +21 -1
  16. package/dist/convex/components/backend/_generated/component.d.ts.map +1 -1
  17. package/dist/convex/components/backend/billing.d.ts +7 -0
  18. package/dist/convex/components/backend/billing.d.ts.map +1 -1
  19. package/dist/convex/components/backend/billing.js +20 -5
  20. package/dist/convex/components/backend/billing.js.map +1 -1
  21. package/dist/convex/components/backend/jobs.d.ts +69 -1
  22. package/dist/convex/components/backend/jobs.d.ts.map +1 -1
  23. package/dist/convex/components/backend/jobs.js +103 -5
  24. package/dist/convex/components/backend/jobs.js.map +1 -1
  25. package/dist/convex/components/backend/schema.d.ts +46 -18
  26. package/dist/convex/components/backend/schema.d.ts.map +1 -1
  27. package/dist/convex/components/backend/schema.js +11 -0
  28. package/dist/convex/components/backend/schema.js.map +1 -1
  29. package/dist/convex/components/backend/subscriptions.d.ts +3 -3
  30. package/dist/convex/delivery.d.ts +17 -0
  31. package/dist/convex/delivery.d.ts.map +1 -1
  32. package/dist/convex/delivery.js +26 -1
  33. package/dist/convex/delivery.js.map +1 -1
  34. package/dist/convex/emails/renewal-reminder.d.ts.map +1 -1
  35. package/dist/convex/emails/renewal-reminder.js +17 -1
  36. package/dist/convex/emails/renewal-reminder.js.map +1 -1
  37. package/dist/convex/errors.d.ts +7 -5
  38. package/dist/convex/errors.d.ts.map +1 -1
  39. package/dist/convex/errors.js +24 -9
  40. package/dist/convex/errors.js.map +1 -1
  41. package/dist/convex/events.d.ts +10 -0
  42. package/dist/convex/events.d.ts.map +1 -1
  43. package/dist/convex/events.js +7 -0
  44. package/dist/convex/events.js.map +1 -1
  45. package/dist/convex/integrations/ai/images.d.ts.map +1 -1
  46. package/dist/convex/integrations/ai/images.js +20 -7
  47. package/dist/convex/integrations/ai/images.js.map +1 -1
  48. package/dist/convex/integrations/ai/job-errors.d.ts +32 -4
  49. package/dist/convex/integrations/ai/job-errors.d.ts.map +1 -1
  50. package/dist/convex/integrations/ai/job-errors.js +55 -8
  51. package/dist/convex/integrations/ai/job-errors.js.map +1 -1
  52. package/dist/convex/integrations/ai/jobs.d.ts +128 -7
  53. package/dist/convex/integrations/ai/jobs.d.ts.map +1 -1
  54. package/dist/convex/integrations/ai/jobs.js +395 -63
  55. package/dist/convex/integrations/ai/jobs.js.map +1 -1
  56. package/dist/convex/integrations/ai/models.d.ts +1 -1
  57. package/dist/convex/integrations/ai/models.d.ts.map +1 -1
  58. package/dist/convex/integrations/ai/moderation.d.ts +9 -3
  59. package/dist/convex/integrations/ai/moderation.d.ts.map +1 -1
  60. package/dist/convex/integrations/ai/moderation.js +4 -2
  61. package/dist/convex/integrations/ai/moderation.js.map +1 -1
  62. package/dist/convex/integrations/ai.d.ts +2 -2
  63. package/dist/convex/integrations/ai.d.ts.map +1 -1
  64. package/dist/convex/integrations/ai.js +1 -1
  65. package/dist/convex/integrations/ai.js.map +1 -1
  66. package/dist/convex/integrations/billing/context.d.ts.map +1 -1
  67. package/dist/convex/integrations/billing/context.js +5 -2
  68. package/dist/convex/integrations/billing/context.js.map +1 -1
  69. package/dist/convex/integrations/billing/credits.d.ts +1 -0
  70. package/dist/convex/integrations/billing/credits.d.ts.map +1 -1
  71. package/dist/convex/integrations/billing/credits.js +4 -1
  72. package/dist/convex/integrations/billing/credits.js.map +1 -1
  73. package/dist/convex/integrations/billing/features.d.ts.map +1 -1
  74. package/dist/convex/integrations/billing/gifts.d.ts.map +1 -1
  75. package/dist/convex/integrations/billing/history.d.ts.map +1 -1
  76. package/dist/convex/integrations/billing/passes.d.ts +2 -2
  77. package/dist/convex/integrations/billing/passes.d.ts.map +1 -1
  78. package/dist/convex/integrations/billing/passes.js +3 -11
  79. package/dist/convex/integrations/billing/passes.js.map +1 -1
  80. package/dist/convex/integrations/billing/provider-failure.d.ts +17 -0
  81. package/dist/convex/integrations/billing/provider-failure.d.ts.map +1 -0
  82. package/dist/convex/integrations/billing/provider-failure.js +52 -0
  83. package/dist/convex/integrations/billing/provider-failure.js.map +1 -0
  84. package/dist/convex/integrations/billing/quotas.d.ts.map +1 -1
  85. package/dist/convex/integrations/billing/subscriptions.d.ts.map +1 -1
  86. package/dist/convex/integrations/billing/types/setup.d.ts +1 -0
  87. package/dist/convex/integrations/billing/types/setup.d.ts.map +1 -1
  88. package/dist/convex/integrations/billing/types/surface.d.ts +9 -1
  89. package/dist/convex/integrations/billing/types/surface.d.ts.map +1 -1
  90. package/dist/convex/integrations/email-sync.d.ts +24 -2
  91. package/dist/convex/integrations/email-sync.d.ts.map +1 -1
  92. package/dist/convex/integrations/email-sync.js +54 -23
  93. package/dist/convex/integrations/email-sync.js.map +1 -1
  94. package/dist/convex/integrations/inbound.d.ts +16 -7
  95. package/dist/convex/integrations/inbound.d.ts.map +1 -1
  96. package/dist/convex/integrations/inbound.js +21 -10
  97. package/dist/convex/integrations/inbound.js.map +1 -1
  98. package/dist/convex/integrations/launch.d.ts +17 -1
  99. package/dist/convex/integrations/launch.d.ts.map +1 -1
  100. package/dist/convex/integrations/launch.js +32 -3
  101. package/dist/convex/integrations/launch.js.map +1 -1
  102. package/dist/convex/integrations/referrals.d.ts +20 -0
  103. package/dist/convex/integrations/referrals.d.ts.map +1 -1
  104. package/dist/convex/integrations/referrals.js +14 -9
  105. package/dist/convex/integrations/referrals.js.map +1 -1
  106. package/dist/convex/integrations/storage.d.ts +67 -0
  107. package/dist/convex/integrations/storage.d.ts.map +1 -1
  108. package/dist/convex/integrations/storage.js +42 -1
  109. package/dist/convex/integrations/storage.js.map +1 -1
  110. package/dist/convex/label-groups/admin.d.ts +3 -0
  111. package/dist/convex/label-groups/admin.d.ts.map +1 -1
  112. package/dist/convex/label-groups/admin.js +3 -0
  113. package/dist/convex/label-groups/admin.js.map +1 -1
  114. package/dist/convex/label-groups/audit.d.ts +1 -0
  115. package/dist/convex/label-groups/audit.d.ts.map +1 -1
  116. package/dist/convex/label-groups/audit.js +1 -0
  117. package/dist/convex/label-groups/audit.js.map +1 -1
  118. package/dist/convex/label-groups/auth.d.ts +7 -0
  119. package/dist/convex/label-groups/auth.d.ts.map +1 -1
  120. package/dist/convex/label-groups/auth.js +7 -0
  121. package/dist/convex/label-groups/auth.js.map +1 -1
  122. package/dist/convex/label-groups/errors.d.ts +9 -0
  123. package/dist/convex/label-groups/errors.d.ts.map +1 -1
  124. package/dist/convex/label-groups/errors.js +12 -0
  125. package/dist/convex/label-groups/errors.js.map +1 -1
  126. package/dist/convex/label-groups/gift.d.ts +24 -0
  127. package/dist/convex/label-groups/gift.d.ts.map +1 -1
  128. package/dist/convex/label-groups/gift.js +27 -0
  129. package/dist/convex/label-groups/gift.js.map +1 -1
  130. package/dist/convex/label-groups/legal.d.ts +1 -1
  131. package/dist/convex/label-groups/pricing.d.ts +15 -0
  132. package/dist/convex/label-groups/pricing.d.ts.map +1 -1
  133. package/dist/convex/label-groups/pricing.js +20 -0
  134. package/dist/convex/label-groups/pricing.js.map +1 -1
  135. package/dist/convex/label-groups/referral.d.ts +4 -0
  136. package/dist/convex/label-groups/referral.d.ts.map +1 -1
  137. package/dist/convex/label-groups/referral.js +4 -0
  138. package/dist/convex/label-groups/referral.js.map +1 -1
  139. package/dist/convex/label-groups/settings.d.ts +34 -0
  140. package/dist/convex/label-groups/settings.d.ts.map +1 -1
  141. package/dist/convex/label-groups/settings.js +39 -0
  142. package/dist/convex/label-groups/settings.js.map +1 -1
  143. package/dist/convex/label-groups/waitlist.d.ts +5 -0
  144. package/dist/convex/label-groups/waitlist.d.ts.map +1 -1
  145. package/dist/convex/label-groups/waitlist.js +7 -2
  146. package/dist/convex/label-groups/waitlist.js.map +1 -1
  147. package/dist/convex/labels.d.ts +103 -1
  148. package/dist/convex/labels.d.ts.map +1 -1
  149. package/dist/convex/legal.d.ts +18 -1
  150. package/dist/convex/legal.d.ts.map +1 -1
  151. package/dist/convex/legal.js +17 -2
  152. package/dist/convex/legal.js.map +1 -1
  153. package/dist/convex/log.js +8 -0
  154. package/dist/convex/log.js.map +1 -1
  155. package/dist/convex/money.d.ts +10 -0
  156. package/dist/convex/money.d.ts.map +1 -0
  157. package/dist/convex/money.js +37 -0
  158. package/dist/convex/money.js.map +1 -0
  159. package/dist/convex/report-rules.d.ts +6 -0
  160. package/dist/convex/report-rules.d.ts.map +1 -1
  161. package/dist/convex/report-rules.js +15 -0
  162. package/dist/convex/report-rules.js.map +1 -1
  163. package/dist/convex/test-billing.d.ts +83 -0
  164. package/dist/convex/test-billing.d.ts.map +1 -0
  165. package/dist/convex/test-billing.js +131 -0
  166. package/dist/convex/test-billing.js.map +1 -0
  167. package/dist/convex/test-models.d.ts +14 -2
  168. package/dist/convex/test-models.d.ts.map +1 -1
  169. package/dist/convex/test-models.js +61 -4
  170. package/dist/convex/test-models.js.map +1 -1
  171. package/dist/devtools-client/index.html +1 -1
  172. package/dist/eslint.d.mts +2 -1
  173. package/dist/eslint.mjs +2 -1
  174. package/dist/module.d.ts +45 -2
  175. package/dist/module.js +2 -2
  176. package/dist/module.json +1 -1
  177. package/dist/runtime/chunk-recovery.d.ts +13 -0
  178. package/dist/runtime/chunk-recovery.js +1 -0
  179. package/dist/runtime/locales/de.json +113 -7
  180. package/dist/runtime/locales/en.json +114 -8
  181. package/dist/runtime/locales/es.json +113 -7
  182. package/dist/runtime/locales/fr.json +113 -7
  183. package/dist/runtime/locales/ru.json +113 -7
  184. package/dist/runtime/server/chunk-recovery.d.ts +49 -0
  185. package/dist/runtime/server/chunk-recovery.js +44 -0
  186. package/dist/runtime/server/csp.d.ts +7 -2
  187. package/dist/runtime/server/csp.js +2 -2
  188. package/dist/runtime/server/photo-decoder-csp.d.ts +17 -0
  189. package/dist/runtime/server/photo-decoder-csp.js +9 -0
  190. package/dist/runtime/vue/components/account/AccountDeletion.css +1 -1
  191. package/dist/runtime/vue/components/account/ActivationChecklist.css +1 -1
  192. package/dist/runtime/vue/components/account/ConsentPrompt.css +1 -1
  193. package/dist/runtime/vue/components/account/EmailUnsubscribe.css +1 -1
  194. package/dist/runtime/vue/components/account/HowDidYouHear.css +1 -1
  195. package/dist/runtime/vue/components/account/KeepAccount.css +1 -1
  196. package/dist/runtime/vue/components/account/OnboardingFlow.css +1 -1
  197. package/dist/runtime/vue/components/account/ProfileIdentity.css +1 -1
  198. package/dist/runtime/vue/components/account/ProfilePreferencesSection.css +1 -1
  199. package/dist/runtime/vue/components/account/ProfileSettings.css +1 -1
  200. package/dist/runtime/vue/components/account/SecurityAlerts.css +1 -1
  201. package/dist/runtime/vue/components/account/SecurityPasskeys.css +1 -1
  202. package/dist/runtime/vue/components/account/SecuritySessions.css +1 -1
  203. package/dist/runtime/vue/components/account/SecuritySettings.css +1 -1
  204. package/dist/runtime/vue/components/admin/AdminAccess.css +1 -1
  205. package/dist/runtime/vue/components/admin/AdminAnnouncements.css +1 -1
  206. package/dist/runtime/vue/components/admin/AdminBilling.css +1 -1
  207. package/dist/runtime/vue/components/admin/AdminChart.css +1 -1
  208. package/dist/runtime/vue/components/admin/AdminConsole.css +1 -1
  209. package/dist/runtime/vue/components/admin/AdminExperiments.css +1 -1
  210. package/dist/runtime/vue/components/admin/AdminFlags.css +1 -1
  211. package/dist/runtime/vue/components/admin/AdminQueue.css +1 -1
  212. package/dist/runtime/vue/components/admin/AdminQueueJob.vue +5 -2
  213. package/dist/runtime/vue/components/admin/AdminReferrals.css +1 -1
  214. package/dist/runtime/vue/components/admin/AdminReports.css +1 -1
  215. package/dist/runtime/vue/components/admin/AdminRevenue.css +1 -1
  216. package/dist/runtime/vue/components/admin/AdminUsers.d.vue.ts +3 -0
  217. package/dist/runtime/vue/components/admin/AdminUsers.vue.d.ts +3 -0
  218. package/dist/runtime/vue/components/admin/AdminWorkspaces.d.vue.ts +3 -0
  219. package/dist/runtime/vue/components/admin/AdminWorkspaces.vue.d.ts +3 -0
  220. package/dist/runtime/vue/components/admin/admin-access-tab.js +2 -1
  221. package/dist/runtime/vue/components/admin/admin-revenue-tab.js +4 -1
  222. package/dist/runtime/vue/components/admin/admin.css +1 -1
  223. package/dist/runtime/vue/components/auth/AuthForm.css +1 -1
  224. package/dist/runtime/vue/components/auth/AuthForm.d.vue.ts +7 -0
  225. package/dist/runtime/vue/components/auth/AuthForm.vue +1 -2
  226. package/dist/runtime/vue/components/auth/AuthForm.vue.d.ts +7 -0
  227. package/dist/runtime/vue/components/auth/AuthFormChoose.css +1 -1
  228. package/dist/runtime/vue/components/auth/AuthFormHeader.css +1 -1
  229. package/dist/runtime/vue/components/auth/AuthFormPasskeyOffer.css +1 -1
  230. package/dist/runtime/vue/components/auth/InviteRedeem.css +1 -1
  231. package/dist/runtime/vue/components/auth/InviteRedeem.vue +95 -8
  232. package/dist/runtime/vue/components/auth/ReauthenticateCode.css +1 -1
  233. package/dist/runtime/vue/components/auth/ReauthenticateDialog.css +1 -1
  234. package/dist/runtime/vue/components/auth/ReauthenticatePasskey.css +1 -1
  235. package/dist/runtime/vue/components/auth/WaitlistForm.css +1 -1
  236. package/dist/runtime/vue/components/auth/WaitlistForm.d.vue.ts +5 -0
  237. package/dist/runtime/vue/components/auth/WaitlistForm.vue +3 -5
  238. package/dist/runtime/vue/components/auth/WaitlistForm.vue.d.ts +5 -0
  239. package/dist/runtime/vue/components/auth/WaitlistPlace.css +1 -1
  240. package/dist/runtime/vue/components/auth/WaitlistShare.css +1 -1
  241. package/dist/runtime/vue/components/auth/WaitlistShare.vue +1 -7
  242. package/dist/runtime/vue/components/auth/WaitlistStatus.css +1 -1
  243. package/dist/runtime/vue/components/auth/WaitlistStatus.vue +120 -23
  244. package/dist/runtime/vue/components/auth/auth-form.d.ts +1 -1
  245. package/dist/runtime/vue/components/auth/waitlist-form.js +1 -1
  246. package/dist/runtime/vue/components/billing/BillingHistory.css +1 -1
  247. package/dist/runtime/vue/components/billing/BillingHistoryOrder.css +1 -1
  248. package/dist/runtime/vue/components/billing/CancelConfirmGroup.vue +2 -7
  249. package/dist/runtime/vue/components/billing/CancelFlow.css +1 -1
  250. package/dist/runtime/vue/components/billing/GiftForm.css +1 -0
  251. package/dist/runtime/vue/components/billing/GiftForm.d.vue.ts +105 -0
  252. package/dist/runtime/vue/components/billing/GiftForm.vue +228 -0
  253. package/dist/runtime/vue/components/billing/GiftForm.vue.d.ts +105 -0
  254. package/dist/runtime/vue/components/billing/GiftList.css +1 -1
  255. package/dist/runtime/vue/components/billing/GiftList.d.vue.ts +87 -2
  256. package/dist/runtime/vue/components/billing/GiftList.vue +7 -4
  257. package/dist/runtime/vue/components/billing/GiftList.vue.d.ts +87 -2
  258. package/dist/runtime/vue/components/billing/GiftReceived.vue +11 -3
  259. package/dist/runtime/vue/components/billing/PlanChangeConfirmGroup.d.vue.ts +7 -0
  260. package/dist/runtime/vue/components/billing/PlanChangeConfirmGroup.vue +50 -0
  261. package/dist/runtime/vue/components/billing/PlanChangeConfirmGroup.vue.d.ts +7 -0
  262. package/dist/runtime/vue/components/billing/PricingChangeConfirm.d.vue.ts +4 -0
  263. package/dist/runtime/vue/components/billing/PricingChangeConfirm.vue +17 -0
  264. package/dist/runtime/vue/components/billing/PricingChangeConfirm.vue.d.ts +4 -0
  265. package/dist/runtime/vue/components/billing/PricingPackCard.css +1 -1
  266. package/dist/runtime/vue/components/billing/PricingPlanCard.css +1 -1
  267. package/dist/runtime/vue/components/billing/PricingPlanCard.vue +15 -0
  268. package/dist/runtime/vue/components/billing/PricingTable.css +1 -1
  269. package/dist/runtime/vue/components/billing/PricingTable.d.vue.ts +24 -2
  270. package/dist/runtime/vue/components/billing/PricingTable.vue +84 -17
  271. package/dist/runtime/vue/components/billing/PricingTable.vue.d.ts +24 -2
  272. package/dist/runtime/vue/components/billing/ReferralCard.css +1 -1
  273. package/dist/runtime/vue/components/billing/ReferralCard.d.vue.ts +4 -0
  274. package/dist/runtime/vue/components/billing/ReferralCard.vue.d.ts +4 -0
  275. package/dist/runtime/vue/components/billing/ReferralLanding.css +1 -1
  276. package/dist/runtime/vue/components/billing/ReferralLanding.vue +44 -2
  277. package/dist/runtime/vue/components/billing/UpgradePrompt.css +1 -1
  278. package/dist/runtime/vue/components/billing/UsageHistory.css +1 -1
  279. package/dist/runtime/vue/components/billing/WithdrawalButton.css +1 -1
  280. package/dist/runtime/vue/components/billing/cancel-flow.js +2 -1
  281. package/dist/runtime/vue/components/billing/pricing-table.d.ts +10 -0
  282. package/dist/runtime/vue/components/billing/withdrawal-button.d.ts +3 -2
  283. package/dist/runtime/vue/components/billing/withdrawal-button.js +13 -33
  284. package/dist/runtime/vue/components/shared.css +1 -1
  285. package/dist/runtime/vue/components/shell/AccessDenied.css +1 -1
  286. package/dist/runtime/vue/components/shell/AiLabel.css +1 -1
  287. package/dist/runtime/vue/components/shell/AppShell.css +1 -1
  288. package/dist/runtime/vue/components/shell/ConfirmDialog.css +1 -1
  289. package/dist/runtime/vue/components/shell/ConnectionStatus.css +1 -1
  290. package/dist/runtime/vue/components/shell/ContactForm.css +1 -1
  291. package/dist/runtime/vue/components/shell/Gate.css +1 -1
  292. package/dist/runtime/vue/components/shell/LegalDocument.css +1 -1
  293. package/dist/runtime/vue/components/shell/NoticeAnnouncement.css +1 -1
  294. package/dist/runtime/vue/components/shell/NoticeDeletion.css +1 -1
  295. package/dist/runtime/vue/components/shell/NoticeGift.css +1 -1
  296. package/dist/runtime/vue/components/shell/NoticeImpersonation.css +1 -1
  297. package/dist/runtime/vue/components/shell/NoticeLowCredits.css +1 -1
  298. package/dist/runtime/vue/components/shell/NoticeMaintenance.css +1 -1
  299. package/dist/runtime/vue/components/shell/NoticePastDue.css +1 -1
  300. package/dist/runtime/vue/components/shell/NotificationInbox.css +1 -1
  301. package/dist/runtime/vue/components/shell/ReportAppeal.vue +16 -13
  302. package/dist/runtime/vue/components/shell/ReportNotice.css +1 -1
  303. package/dist/runtime/vue/components/shell/UploadField.css +1 -1
  304. package/dist/runtime/vue/components/shell/WorkspaceSwitcher.css +1 -1
  305. package/dist/runtime/vue/components/shell/report-form.js +1 -44
  306. package/dist/runtime/vue/components/tokens.css +1 -1
  307. package/dist/runtime/vue/components/workspaces/AuditLog.css +1 -1
  308. package/dist/runtime/vue/components/workspaces/AuditLog.d.vue.ts +1 -0
  309. package/dist/runtime/vue/components/workspaces/AuditLog.vue.d.ts +1 -0
  310. package/dist/runtime/vue/components/workspaces/WorkspaceBilling.css +1 -1
  311. package/dist/runtime/vue/components/workspaces/WorkspaceBilling.vue +29 -50
  312. package/dist/runtime/vue/components/workspaces/WorkspaceBillingPause.d.vue.ts +3 -0
  313. package/dist/runtime/vue/components/workspaces/WorkspaceBillingPause.vue +69 -0
  314. package/dist/runtime/vue/components/workspaces/WorkspaceBillingPause.vue.d.ts +3 -0
  315. package/dist/runtime/vue/components/workspaces/WorkspaceBillingSwitch.d.vue.ts +3 -0
  316. package/dist/runtime/vue/components/workspaces/WorkspaceBillingSwitch.vue +54 -0
  317. package/dist/runtime/vue/components/workspaces/WorkspaceBillingSwitch.vue.d.ts +3 -0
  318. package/dist/runtime/vue/components/workspaces/WorkspaceCredits.css +1 -1
  319. package/dist/runtime/vue/components/workspaces/WorkspaceList.css +1 -1
  320. package/dist/runtime/vue/components/workspaces/WorkspaceSettings.d.vue.ts +38 -0
  321. package/dist/runtime/vue/components/workspaces/WorkspaceSettings.vue +32 -1
  322. package/dist/runtime/vue/components/workspaces/WorkspaceSettings.vue.d.ts +38 -0
  323. package/dist/runtime/vue/components/workspaces/workspace-billing.d.ts +39 -2
  324. package/dist/runtime/vue/components/workspaces/workspace-billing.js +94 -2
  325. package/dist/runtime/vue/components/workspaces/workspace-settings.d.ts +4 -0
  326. package/dist/runtime/vue/composables/billing-format.d.ts +9 -4
  327. package/dist/runtime/vue/composables/billing-format.js +17 -9
  328. package/dist/runtime/vue/composables/billing-provider.js +3 -2
  329. package/dist/runtime/vue/composables/prepare-photo.d.ts +75 -0
  330. package/dist/runtime/vue/composables/prepare-photo.js +223 -0
  331. package/dist/runtime/vue/composables/use-access.d.ts +23 -2
  332. package/dist/runtime/vue/composables/use-access.js +22 -3
  333. package/dist/runtime/vue/composables/use-billing.d.ts +76 -5
  334. package/dist/runtime/vue/composables/use-billing.js +48 -0
  335. package/dist/runtime/vue/composables/use-gift-form.d.ts +123 -0
  336. package/dist/runtime/vue/composables/use-gift-form.js +169 -0
  337. package/dist/runtime/vue/composables/use-gift-list.d.ts +44 -4
  338. package/dist/runtime/vue/composables/use-gift-list.js +11 -5
  339. package/dist/runtime/vue/composables/use-install-prompt.d.ts +71 -0
  340. package/dist/runtime/vue/composables/use-install-prompt.js +53 -0
  341. package/dist/runtime/vue/composables/use-labels.js +17 -23
  342. package/dist/runtime/vue/composables/use-login-flow.d.ts +9 -0
  343. package/dist/runtime/vue/composables/use-login-flow.js +7 -0
  344. package/dist/runtime/vue/composables/use-orders.d.ts +1 -1
  345. package/dist/runtime/vue/composables/use-pricing.d.ts +54 -5
  346. package/dist/runtime/vue/composables/use-pricing.js +37 -10
  347. package/dist/runtime/vue/composables/use-push-subscription.js +1 -7
  348. package/dist/runtime/vue/composables/use-referral-invite.d.ts +17 -2
  349. package/dist/runtime/vue/composables/use-referral-invite.js +10 -1
  350. package/dist/runtime/vue/composables/use-referrals.js +2 -1
  351. package/dist/runtime/vue/composables/use-report-appeal.d.ts +86 -0
  352. package/dist/runtime/vue/composables/use-report-appeal.js +61 -0
  353. package/dist/runtime/vue/composables/use-return-path.d.ts +5 -4
  354. package/dist/runtime/vue/composables/use-return-path.js +16 -2
  355. package/dist/runtime/vue/composables/use-waitlist.d.ts +13 -1
  356. package/dist/runtime/vue/composables/use-waitlist.js +15 -4
  357. package/dist/runtime/vue/composables/use-withdrawal.d.ts +63 -0
  358. package/dist/runtime/vue/composables/use-withdrawal.js +38 -0
  359. package/dist/runtime/vue/middleware/page-access.js +2 -2
  360. package/dist/runtime/vue/pages/gifts.vue +2 -0
  361. package/dist/runtime/vue/pages/login.vue +5 -7
  362. package/dist/runtime/vue/pages/report.vue +2 -3
  363. package/dist/runtime/vue/parts.d.ts +5 -0
  364. package/dist/runtime/vue/plugins/chunk-recovery.client.d.ts +10 -0
  365. package/dist/runtime/vue/plugins/chunk-recovery.client.js +10 -0
  366. package/dist/runtime/vue/plugins/install-banner.client.d.ts +7 -0
  367. package/dist/runtime/vue/plugins/install-banner.client.js +5 -0
  368. package/dist/runtime/vue/plugins/install-prompt.client.d.ts +7 -0
  369. package/dist/runtime/vue/plugins/install-prompt.client.js +6 -0
  370. package/dist/runtime/vue/plugins/session-ended.js +2 -3
  371. package/dist/runtime/vue/utils/active-locale.js +8 -0
  372. package/dist/runtime/vue/utils/confirm-group.d.ts +18 -0
  373. package/dist/runtime/vue/utils/confirm-group.js +17 -0
  374. package/dist/runtime/vue/utils/display-mode.d.ts +8 -0
  375. package/dist/runtime/vue/utils/display-mode.js +11 -0
  376. package/dist/runtime/vue/utils/heic-absent.d.ts +2 -0
  377. package/dist/runtime/vue/utils/heic-absent.js +3 -0
  378. package/dist/runtime/vue/utils/intl.d.ts +12 -4
  379. package/dist/runtime/vue/utils/intl.js +13 -2
  380. package/dist/runtime/vue/utils/kept-invite.js +6 -29
  381. package/dist/runtime/vue/utils/page-origin.d.ts +15 -0
  382. package/dist/runtime/vue/utils/page-origin.js +8 -0
  383. package/dist/runtime/vue/utils/page-rules.d.ts +9 -0
  384. package/dist/runtime/vue/utils/page-rules.js +3 -0
  385. package/dist/runtime/vue/utils/plan-change-confirm.d.ts +76 -0
  386. package/dist/runtime/vue/utils/plan-change-confirm.js +39 -0
  387. package/dist/runtime/vue/utils/pricing-bindings.d.ts +7 -1
  388. package/dist/runtime/vue/utils/pricing-bindings.js +21 -0
  389. package/dist/runtime/vue/utils/pricing-seo.js +4 -2
  390. package/dist/runtime/vue/utils/tab-keep.d.ts +17 -0
  391. package/dist/runtime/vue/utils/tab-keep.js +46 -0
  392. package/dist/shared/{nuxt-backend.Bq_mhlky.mjs → nuxt-backend.9IVxzzft.mjs} +55 -10
  393. package/dist/shared/{nuxt-backend.DmZI-QSO.mjs → nuxt-backend.BCjeoX0x.mjs} +2 -26
  394. package/dist/shared/{nuxt-backend.D9qXcOOI.mjs → nuxt-backend.Baxb382E.mjs} +1 -1
  395. package/dist/shared/{nuxt-backend.Lk2MQI2u.mjs → nuxt-backend.BjQoqNIu.mjs} +26 -2
  396. package/dist/shared/{nuxt-backend.G4JryO1q.mjs → nuxt-backend.CbR37s_c.mjs} +255 -49
  397. package/package.json +6 -1
  398. package/skills/nuxt-backend/references/api.md +26 -10
  399. package/skills/nuxt-backend/references/renames.json +104 -0
  400. package/skills/nuxt-backend/references/surface.json +30 -2
  401. package/skills/nuxt-backend-ai/references/api.md +2 -1
  402. package/skills/nuxt-backend-auth/references/api.md +1 -1
  403. package/skills/nuxt-backend-billing/references/api.md +2 -0
  404. package/skills/nuxt-backend-data/references/api.md +4 -1
  405. package/skills/nuxt-backend-email/SKILL.md +5 -2
  406. package/skills/nuxt-backend-email/references/api.md +1 -0
  407. package/skills/nuxt-backend-growth/references/api.md +4 -0
  408. package/skills/nuxt-backend-ship/SKILL.md +1 -1
  409. package/skills/nuxt-backend-ship/references/api.md +9 -5
  410. package/skills/nuxt-backend-ui/SKILL.md +10 -5
  411. package/skills/nuxt-backend-upgrade/SKILL.md +4 -3
  412. package/skills/nuxt-backend-upgrade/references/upgrade.md +43 -0
  413. package/src/convex/catalog.ts +17 -0
  414. package/src/convex/components/backend/_generated/component.ts +30 -2
  415. package/src/convex/components/backend/billing.ts +19 -5
  416. package/src/convex/components/backend/jobs.ts +102 -5
  417. package/src/convex/components/backend/schema.ts +11 -0
  418. package/src/convex/delivery.ts +26 -1
  419. package/src/convex/emails/renewal-reminder.ts +19 -1
  420. package/src/convex/errors.ts +23 -9
  421. package/src/convex/events.ts +7 -0
  422. package/src/convex/integrations/ai/images.ts +22 -8
  423. package/src/convex/integrations/ai/job-errors.ts +64 -9
  424. package/src/convex/integrations/ai/jobs.ts +509 -64
  425. package/src/convex/integrations/ai/models.ts +1 -1
  426. package/src/convex/integrations/ai/moderation.ts +10 -5
  427. package/src/convex/integrations/ai.ts +6 -1
  428. package/src/convex/integrations/billing/context.ts +6 -3
  429. package/src/convex/integrations/billing/credits.ts +4 -1
  430. package/src/convex/integrations/billing/passes.ts +3 -11
  431. package/src/convex/integrations/billing/provider-failure.ts +56 -0
  432. package/src/convex/integrations/billing/types/setup.ts +1 -1
  433. package/src/convex/integrations/billing/types/surface.ts +9 -2
  434. package/src/convex/integrations/email-sync.ts +74 -26
  435. package/src/convex/integrations/inbound.ts +32 -16
  436. package/src/convex/integrations/launch.ts +52 -5
  437. package/src/convex/integrations/referrals.ts +25 -7
  438. package/src/convex/integrations/storage.ts +107 -1
  439. package/src/convex/label-groups/admin.ts +3 -0
  440. package/src/convex/label-groups/audit.ts +1 -0
  441. package/src/convex/label-groups/auth.ts +7 -0
  442. package/src/convex/label-groups/errors.ts +12 -0
  443. package/src/convex/label-groups/gift.ts +27 -0
  444. package/src/convex/label-groups/pricing.ts +20 -0
  445. package/src/convex/label-groups/referral.ts +4 -0
  446. package/src/convex/label-groups/settings.ts +39 -0
  447. package/src/convex/label-groups/waitlist.ts +7 -2
  448. package/src/convex/legal.ts +23 -2
  449. package/src/convex/log.ts +8 -0
  450. package/src/convex/money.ts +40 -0
  451. package/src/convex/report-rules.ts +16 -0
  452. package/src/convex/test-billing.ts +189 -0
  453. package/src/convex/test-models.ts +59 -4
  454. package/src/convex/test.ts +95 -8
  455. package/src/runtime/vue/components/account/AccountDeletion.css +1 -1
  456. package/src/runtime/vue/components/account/ActivationChecklist.css +5 -3
  457. package/src/runtime/vue/components/account/ConsentPrompt.css +7 -5
  458. package/src/runtime/vue/components/account/EmailUnsubscribe.css +8 -4
  459. package/src/runtime/vue/components/account/HowDidYouHear.css +9 -5
  460. package/src/runtime/vue/components/account/KeepAccount.css +4 -2
  461. package/src/runtime/vue/components/account/OnboardingFlow.css +6 -4
  462. package/src/runtime/vue/components/account/ProfileIdentity.css +1 -1
  463. package/src/runtime/vue/components/account/ProfilePreferencesSection.css +4 -2
  464. package/src/runtime/vue/components/account/ProfileSettings.css +4 -2
  465. package/src/runtime/vue/components/account/SecurityAlerts.css +1 -1
  466. package/src/runtime/vue/components/account/SecurityPasskeys.css +3 -3
  467. package/src/runtime/vue/components/account/SecuritySessions.css +1 -1
  468. package/src/runtime/vue/components/account/SecuritySettings.css +1 -1
  469. package/src/runtime/vue/components/admin/AdminAccess.css +1 -1
  470. package/src/runtime/vue/components/admin/AdminAnnouncements.css +2 -2
  471. package/src/runtime/vue/components/admin/AdminBilling.css +1 -1
  472. package/src/runtime/vue/components/admin/AdminChart.css +1 -1
  473. package/src/runtime/vue/components/admin/AdminConsole.css +1 -0
  474. package/src/runtime/vue/components/admin/AdminExperiments.css +1 -1
  475. package/src/runtime/vue/components/admin/AdminFlags.css +2 -2
  476. package/src/runtime/vue/components/admin/AdminQueue.css +5 -3
  477. package/src/runtime/vue/components/admin/AdminQueueJob.vue +6 -2
  478. package/src/runtime/vue/components/admin/AdminReferrals.css +4 -2
  479. package/src/runtime/vue/components/admin/AdminReports.css +1 -1
  480. package/src/runtime/vue/components/admin/AdminRevenue.css +1 -1
  481. package/src/runtime/vue/components/admin/admin.css +3 -3
  482. package/src/runtime/vue/components/auth/AuthForm.css +7 -4
  483. package/src/runtime/vue/components/auth/AuthForm.vue +1 -2
  484. package/src/runtime/vue/components/auth/AuthFormChoose.css +2 -1
  485. package/src/runtime/vue/components/auth/AuthFormHeader.css +1 -1
  486. package/src/runtime/vue/components/auth/AuthFormPasskeyOffer.css +1 -1
  487. package/src/runtime/vue/components/auth/InviteRedeem.css +56 -2
  488. package/src/runtime/vue/components/auth/InviteRedeem.vue +110 -9
  489. package/src/runtime/vue/components/auth/ReauthenticateCode.css +1 -1
  490. package/src/runtime/vue/components/auth/ReauthenticateDialog.css +6 -3
  491. package/src/runtime/vue/components/auth/ReauthenticatePasskey.css +1 -1
  492. package/src/runtime/vue/components/auth/WaitlistForm.css +4 -2
  493. package/src/runtime/vue/components/auth/WaitlistForm.vue +5 -6
  494. package/src/runtime/vue/components/auth/WaitlistPlace.css +4 -2
  495. package/src/runtime/vue/components/auth/WaitlistShare.css +6 -4
  496. package/src/runtime/vue/components/auth/WaitlistShare.vue +2 -8
  497. package/src/runtime/vue/components/auth/WaitlistStatus.css +27 -1
  498. package/src/runtime/vue/components/auth/WaitlistStatus.vue +153 -31
  499. package/src/runtime/vue/components/billing/BillingHistory.css +2 -2
  500. package/src/runtime/vue/components/billing/BillingHistoryOrder.css +1 -1
  501. package/src/runtime/vue/components/billing/CancelConfirmGroup.vue +2 -8
  502. package/src/runtime/vue/components/billing/CancelFlow.css +6 -4
  503. package/src/runtime/vue/components/billing/GiftForm.css +89 -0
  504. package/src/runtime/vue/components/billing/GiftForm.vue +251 -0
  505. package/src/runtime/vue/components/billing/GiftList.css +5 -3
  506. package/src/runtime/vue/components/billing/GiftList.vue +21 -9
  507. package/src/runtime/vue/components/billing/GiftReceived.vue +11 -3
  508. package/src/runtime/vue/components/billing/PlanChangeConfirmGroup.vue +59 -0
  509. package/src/runtime/vue/components/billing/PricingChangeConfirm.vue +22 -0
  510. package/src/runtime/vue/components/billing/PricingPackCard.css +1 -1
  511. package/src/runtime/vue/components/billing/PricingPlanCard.css +31 -4
  512. package/src/runtime/vue/components/billing/PricingPlanCard.vue +17 -2
  513. package/src/runtime/vue/components/billing/PricingTable.css +2 -2
  514. package/src/runtime/vue/components/billing/PricingTable.vue +141 -28
  515. package/src/runtime/vue/components/billing/ReferralCard.css +6 -4
  516. package/src/runtime/vue/components/billing/ReferralLanding.css +14 -3
  517. package/src/runtime/vue/components/billing/ReferralLanding.vue +54 -3
  518. package/src/runtime/vue/components/billing/UpgradePrompt.css +6 -4
  519. package/src/runtime/vue/components/billing/UsageHistory.css +2 -2
  520. package/src/runtime/vue/components/billing/WithdrawalButton.css +5 -3
  521. package/src/runtime/vue/components/shared.css +62 -9
  522. package/src/runtime/vue/components/shell/AccessDenied.css +5 -3
  523. package/src/runtime/vue/components/shell/AiLabel.css +2 -2
  524. package/src/runtime/vue/components/shell/AppShell.css +5 -3
  525. package/src/runtime/vue/components/shell/ConfirmDialog.css +5 -3
  526. package/src/runtime/vue/components/shell/ConnectionStatus.css +1 -1
  527. package/src/runtime/vue/components/shell/ContactForm.css +4 -2
  528. package/src/runtime/vue/components/shell/Gate.css +5 -3
  529. package/src/runtime/vue/components/shell/LegalDocument.css +1 -1
  530. package/src/runtime/vue/components/shell/NoticeAnnouncement.css +1 -1
  531. package/src/runtime/vue/components/shell/NoticeDeletion.css +5 -3
  532. package/src/runtime/vue/components/shell/NoticeGift.css +1 -1
  533. package/src/runtime/vue/components/shell/NoticeImpersonation.css +1 -1
  534. package/src/runtime/vue/components/shell/NoticeLowCredits.css +6 -3
  535. package/src/runtime/vue/components/shell/NoticeMaintenance.css +1 -1
  536. package/src/runtime/vue/components/shell/NoticePastDue.css +5 -3
  537. package/src/runtime/vue/components/shell/NotificationInbox.css +6 -4
  538. package/src/runtime/vue/components/shell/ReportAppeal.vue +17 -14
  539. package/src/runtime/vue/components/shell/ReportNotice.css +1 -1
  540. package/src/runtime/vue/components/shell/UploadField.css +5 -3
  541. package/src/runtime/vue/components/shell/WorkspaceSwitcher.css +5 -3
  542. package/src/runtime/vue/components/tokens.css +30 -0
  543. package/src/runtime/vue/components/workspaces/AuditLog.css +2 -2
  544. package/src/runtime/vue/components/workspaces/WorkspaceBilling.css +75 -2
  545. package/src/runtime/vue/components/workspaces/WorkspaceBilling.vue +45 -53
  546. package/src/runtime/vue/components/workspaces/WorkspaceBillingPause.vue +79 -0
  547. package/src/runtime/vue/components/workspaces/WorkspaceBillingSwitch.vue +63 -0
  548. package/src/runtime/vue/components/workspaces/WorkspaceCredits.css +1 -0
  549. package/src/runtime/vue/components/workspaces/WorkspaceList.css +2 -2
  550. package/src/runtime/vue/components/workspaces/WorkspaceSettings.vue +47 -4
  551. package/src/runtime/vue/pages/gifts.vue +12 -7
  552. package/src/runtime/vue/pages/invite.vue +4 -2
  553. package/src/runtime/vue/pages/login.vue +8 -8
  554. package/src/runtime/vue/pages/report.vue +2 -3
  555. package/src/runtime/vue/pages/waitlist.vue +8 -5
package/dist/cli.mjs CHANGED
@@ -2,12 +2,12 @@
2
2
  import { defineCommand, parseArgs, runMain } from 'citty';
3
3
  import { mkdtempSync, writeFileSync, rmSync, existsSync, readFileSync, readdirSync, mkdirSync, cpSync, symlinkSync } from 'node:fs';
4
4
  import { join, resolve, dirname, posix, relative, isAbsolute, sep } from 'node:path';
5
- import { C as CAPABILITY_STATES, d as deploymentFunctionSpec, a as deploymentEnvNames, i as isHttpUrl, b as deploymentBackendEnvironment, c as billingEnvironment, s as siteFromCloudUrl, e as deployKeyType, r as readEnvFiles, f as runConvex, R as RESYNC_ENTITLEMENTS_FUNCTION, g as deploymentFlags, h as ConvexCliError, n as nonProductionDeployKey, j as resolveFunctionsDir, k as readTextIfPresent, l as executeEnvPush, m as generateAuthSecret, o as setDeploymentEnv, p as isLoopbackUrl, q as spawnConvex, B as BACKEND_ENV_NAMES, D as DERIVED_DEPLOYMENT_ENV, t as scaffoldBackendFiles, u as pathsSourceOf, v as syncPathsFile, w as backendPathsOf, x as pathsFileLocation, y as appBrandOf, z as syncBrandFile, A as brandFileLocation, E as appLabelsOf, F as syncLabelsFile, G as labelsFileLocation, H as configuredDeployment, I as isDevDeploymentId, M as MCP_SDK, J as computeDeployment, K as appMonitoringDsn, L as monitoringSdkInstalled, N as detectCapabilities, O as DEPLOYMENT_KIND_LABEL, P as CAPABILITY_NAMES, Q as REGISTERED_UI, S as uiPath, T as BACKEND_PAGE_DEFS, U as installedVersion, V as packageDir, W as uiEntry, X as agentsMdVersion, Y as packageVersion, Z as doctorReport, _ as formatPreflightSummary, $ as runEnvPush, a0 as devPushRefusal } from './shared/nuxt-backend.Bq_mhlky.mjs';
6
- import { s as setUpProject, n as nextCommands$1, f as formatNextSteps, a as setUpAgentFiles } from './shared/nuxt-backend.DmZI-QSO.mjs';
7
- import { P as PROVIDER_COMPONENT, l as loadCatalog, f as freePlanOf, M as MANAGED_BY, i as isManaged, r as refuseUnpricedPlans, a as refuseInvalidPrices, b as refuseOnceCredits, c as refuseInvalidGifts, d as refuseInvalidQuotas, e as refuseInvalidDiscounts, g as listAllPages, h as refuseMissingDefaultCurrency, j as refuseMissingOrganizationCurrency, k as refuseUnpricedDiscounts, m as ensurePlanQuotas, n as retirePlan, p as pricedIntervals, o as attachRetiredPlanQuotas, q as recordQuotaKeys, s as packPricesByCurrency, t as syncPassProducts, u as syncDiscounts, v as planQuotasKeys, w as derivedPassKeys, x as droppedQuotasKeys, y as unpricedPlanProducts, z as providerClientOptions, A as planQuotasKey, B as planPricesByCurrency, C as findPlanProduct, D as isUntaggedPlanProduct, E as planCreditUnits, F as planQuotasBenefits, G as isFreePlan, H as zeroPrices, I as providerTrialOf, J as pushPlanTrial, K as attachPlanQuotas, L as BILLING_WEBHOOK_PROVISION_EVENTS, N as planProductKey, O as recordPlanProduct, Q as loadGenerated, R as renderGenerated, S as probeWebhookRoute, T as runEmailSync, U as planSettingChanges, V as planEndpointChanges, W as applyProviderChanges, X as billingProviderTarget, Y as providerClient, Z as readProviderOrganization, _ as readProviderEndpoint, $ as emailSyncRefusal, a0 as ADMISSION_DAYS, a1 as CLI_ADMISSION_LABEL, a2 as admitInputRefusal, a3 as admitRefused, a4 as admitCleaned, a5 as runDoctorChecks, a6 as readProductionPosture, a7 as email, a8 as runEnvDefaults, a9 as bootstrapAdmin, aa as runEmailSyncCommand, ab as ENV_DEFAULT_TYPES } from './chunks/doctor.mjs';
5
+ import { C as CAPABILITY_STATES, d as deploymentFunctionSpec, a as deploymentEnvNames, i as isHttpUrl, b as deploymentBackendEnvironment, c as billingEnvironment, s as siteFromCloudUrl, e as deployKeyType, r as readEnvFiles, f as runConvex, R as RESYNC_ENTITLEMENTS_FUNCTION, g as deploymentFlags, h as ConvexCliError, n as nonProductionDeployKey, j as resolveFunctionsDir, k as readTextIfPresent, l as executeEnvPush, m as generateAuthSecret, o as setDeploymentEnv, p as isLoopbackUrl, q as configuredDeployment, t as spawnConvex, B as BACKEND_ENV_NAMES, D as DERIVED_DEPLOYMENT_ENV, u as scaffoldBackendFiles, v as pathsSourceOf, w as syncPathsFile, x as backendPathsOf, y as pathsFileLocation, z as appBrandOf, A as syncBrandFile, E as brandFileLocation, F as appLabelsOf, G as syncLabelsFile, H as labelsFileLocation, I as isDevDeploymentId, M as MCP_SDK, J as computeDeployment, K as appMonitoringDsn, L as monitoringSdkInstalled, N as detectCapabilities, O as DEPLOYMENT_KIND_LABEL, P as CAPABILITY_NAMES, Q as REGISTERED_UI, S as uiPath, T as BACKEND_PAGE_DEFS, U as installedVersion, V as packageDir, W as uiEntry, X as agentsMdVersion, Y as packageVersion, Z as doctorReport, _ as formatPreflightSummary, $ as runEnvPush, a0 as devPushRefusal } from './shared/nuxt-backend.9IVxzzft.mjs';
6
+ import { s as setUpProject, n as nextCommands$1, f as formatNextSteps, a as setUpAgentFiles } from './shared/nuxt-backend.BCjeoX0x.mjs';
7
+ import { P as PROVIDER_COMPONENT, l as loadCatalog, f as freePlanOf, M as MANAGED_BY, i as isManaged, r as refuseUnpricedPlans, a as refuseInvalidPrices, b as refuseOnceCredits, c as refuseInvalidGifts, d as refuseInvalidQuotas, e as refuseInvalidDiscounts, g as listAllPages, h as refuseMissingDefaultCurrency, j as refuseMissingOrganizationCurrency, k as refuseUnpricedDiscounts, m as ensurePlanQuotas, n as retirePlan, p as pricedIntervals, o as attachRetiredPlanQuotas, q as recordQuotaKeys, s as packPricesByCurrency, t as syncPassProducts, u as syncDiscounts, v as planQuotasKeys, w as derivedPassKeys, x as droppedQuotasKeys, y as unpricedPlanProducts, z as providerClientOptions, A as planQuotasKey, B as planPricesByCurrency, C as findPlanProduct, D as isUntaggedPlanProduct, E as planCreditUnits, F as planQuotasBenefits, G as isFreePlan, H as zeroPrices, I as providerTrialOf, J as pushPlanTrial, K as attachPlanQuotas, L as BILLING_WEBHOOK_PROVISION_EVENTS, N as planProductKey, O as recordPlanProduct, Q as loadGenerated, R as renderGenerated, S as runEmailSync, T as runInboundSync, U as emailSyncLines, V as runEmailSyncCommand, W as probeWebhookRoute, X as emailSyncRefusal, Y as inboundSyncLines, Z as planSettingChanges, _ as planEndpointChanges, $ as applyProviderChanges, a0 as billingProviderTarget, a1 as providerClient, a2 as readProviderOrganization, a3 as readProviderEndpoint, a4 as ADMISSION_DAYS, a5 as CLI_ADMISSION_LABEL, a6 as admitInputRefusal, a7 as admitRefused, a8 as admitCleaned, a9 as runDoctorChecks, aa as readProductionPosture, ab as email, ac as runEnvDefaults, ad as firstAdministratorOnFix, ae as ENV_DEFAULT_TYPES } from './chunks/doctor.mjs';
8
8
  import { createInterface } from 'node:readline';
9
9
  import { webhooksResetWebhookEndpointSecret } from '@polar-sh/sdk/funcs/webhooksResetWebhookEndpointSecret.js';
10
- import { w as withContract, p as progress, f as finish, a as adoptBackendDevScript, d as dev } from './shared/nuxt-backend.Lk2MQI2u.mjs';
10
+ import { w as withContract, p as progress, f as finish, a as adoptBackendDevScript, d as dev } from './shared/nuxt-backend.BjQoqNIu.mjs';
11
11
  import { runAnalyze, halvesOf } from './chunks/run.mjs';
12
12
  import { f as formatReport, b as budgetFailures, a as formatSize, p as parseSize, B as BUDGET_FLAGS } from './chunks/report.mjs';
13
13
  import { tmpdir } from 'node:os';
@@ -28,12 +28,12 @@ import { organizationsListOrganizations } from '@polar-sh/sdk/funcs/organization
28
28
  import { randomBytes } from 'node:crypto';
29
29
  import { spawn } from 'node:child_process';
30
30
  import { Resend } from 'resend';
31
- import { f as fixConvexConfig } from './shared/nuxt-backend.D9qXcOOI.mjs';
31
+ import { setTimeout } from 'node:timers/promises';
32
+ import { f as fixConvexConfig } from './shared/nuxt-backend.Baxb382E.mjs';
32
33
  import { isSandboxAddress, findCode } from '../dist/runtime/vue/utils/sandbox-code.js';
33
34
  import { styleText } from 'node:util';
34
35
  import { v } from 'convex/values';
35
36
  import { D as DARK_SCHEME_QUERY, t as textDirection } from './shared/nuxt-backend.C62dpRH3.mjs';
36
- import { setTimeout } from 'node:timers/promises';
37
37
  import 'node:url';
38
38
  import 'node:module';
39
39
  import 'dedent';
@@ -1262,14 +1262,15 @@ async function fixBilling(rootDir, { prod, confirm, print, report, probe }) {
1262
1262
  }
1263
1263
  }
1264
1264
  async function fixEmail(rootDir, { prod, confirm, print, report, probe, emailSync }) {
1265
- const read = await emailSync(rootDir, { prod, dryRun: true }).catch(() => null);
1265
+ const read = await emailSync(rootDir, { prod, dryRun: true, enableWebhook: true }).catch(() => null);
1266
1266
  const url = read?.webhook.url;
1267
1267
  if (!read || !url || read.webhook.enabled !== false) return;
1268
1268
  if ((await probe(url)).state !== "mounted") {
1269
1269
  print("[nuxt-backend] doctor --fix: the email webhook stays off: its route does not answer the probe yet. Fix the route (doctor's email-webhook-route), then run doctor --fix again.");
1270
1270
  return;
1271
1271
  }
1272
- const change = { description: `Turn the email webhook ${url} back on: its route answers the probe now.` };
1272
+ const alongside = read.log.length > 0 ? emailSyncPlans(read) : [];
1273
+ const change = { description: `Turn the email webhook ${url} back on: its route answers the probe now.${alongside.length > 0 ? ` The deployment runs an older backend, whose sync makes the rest with it: ${alongside.join(", ")}.` : ""}` };
1273
1274
  if (!await confirm(change)) {
1274
1275
  report.skipped.push("email-webhook-enabled");
1275
1276
  return;
@@ -1298,6 +1299,70 @@ async function fixProviderSettings(rootDir, { prod, confirm, print, billing = tr
1298
1299
  if (report.skipped.length > 0) print(`[nuxt-backend] doctor --fix: left as they are (not confirmed): ${report.skipped.join(", ")}.`);
1299
1300
  return report;
1300
1301
  }
1302
+ function emailSyncPlans(report) {
1303
+ const entries = report.log.filter((entry) => entry.action === "would-create" || entry.action === "would-update").map((entry) => `${entry.action === "would-create" ? "create" : "update"} the ${entry.kind} ${entry.key}`);
1304
+ const ids = (report.ids ?? []).map((id) => `store the provider's id for the ${id.kind} ${id.key} on the deployment`);
1305
+ const webhook = report.webhook.action === "would-create" ? [`create the webhook ${report.webhook.url} and store its signing secret on the deployment as EMAIL_WEBHOOK_SECRET`] : report.webhook.action === "would-update" ? [`give the webhook ${report.webhook.missingEvents.join(", ")}`] : [];
1306
+ const flows = (report.flows?.unsynced ?? []).map((flow) => `configure the flow ${flow}`);
1307
+ const retired = (report.flows?.retired ?? []).map((flow) => `stop the flow ${flow}, which backend/email.ts no longer declares`);
1308
+ return [...entries, ...ids, ...webhook, ...flows, ...retired];
1309
+ }
1310
+ function inboundSyncPlans(inbound, email) {
1311
+ const inbox = inbound.inbox === "would-create" ? [`create the support inbox ${inbound.support}`] : [];
1312
+ if (inbound.webhook.state === "would-update") return [...inbox, `give the webhook ${inbound.webhook.added.join(", ")}`];
1313
+ const madeFirst = inbound.support !== null && inbound.webhook.state === "missing" && email.webhook.action === "would-create";
1314
+ return [...inbox, ...madeFirst ? ["give the new webhook the support inbox's events"] : []];
1315
+ }
1316
+ async function planInboundSync(rootDir, prod, email, plan) {
1317
+ let inbound;
1318
+ try {
1319
+ inbound = await plan(rootDir, { prod, dryRun: true });
1320
+ } catch (error) {
1321
+ return { plans: [`sync the support inbox, which the deployment could not plan (${error instanceof Error ? error.message : String(error)})`], lines: [] };
1322
+ }
1323
+ if (!inbound) return { plans: [], lines: [] };
1324
+ return { plans: inboundSyncPlans(inbound, email), lines: inboundSyncLines(inbound) };
1325
+ }
1326
+ async function syncEmailOnFix(rootDir, { prod, confirm, print }, deps = {}) {
1327
+ const planned = await planEmailSync(rootDir, prod, print, deps.plan ?? runEmailSync);
1328
+ if (typeof planned === "string") return planned;
1329
+ const inbound = await planInboundSync(rootDir, prod, planned.report, deps.planInbound ?? runInboundSync);
1330
+ const plans = [...planned.plans, ...inbound.plans];
1331
+ if (plans.length === 0) {
1332
+ print("[nuxt-backend] doctor --fix: email sync: the email provider has what backend/email.ts declares.");
1333
+ return "unchanged";
1334
+ }
1335
+ for (const line of [...emailSyncLines(planned.report), ...inbound.lines]) print(line);
1336
+ const account = prod ? "production's email provider account" : "the dev email provider account";
1337
+ if (!await confirm({ description: `Sync ${account}: ${plans.join(", ")}.` })) return "declined";
1338
+ const { exitCode } = await (deps.apply ?? runEmailSyncCommand)(rootDir, { prod }, print);
1339
+ if (exitCode === 0) return "applied";
1340
+ print(`[nuxt-backend] doctor --fix: email sync failed: run \`npx nuxt-backend email sync${prod ? " --prod" : ""}\` for its full output.`);
1341
+ return "failed";
1342
+ }
1343
+ async function planEmailSync(rootDir, prod, print, plan) {
1344
+ const refusal = emailSyncRefusal(rootDir, prod);
1345
+ if (refusal) {
1346
+ print(`[nuxt-backend] doctor --fix: email sync refused: ${refusal}`);
1347
+ return "failed";
1348
+ }
1349
+ let report;
1350
+ try {
1351
+ report = await plan(rootDir, { prod, dryRun: true });
1352
+ } catch (error) {
1353
+ print(`[nuxt-backend] doctor --fix: email sync failed: ${error instanceof Error ? error.message : String(error)}`);
1354
+ return "failed";
1355
+ }
1356
+ if (!report) {
1357
+ print("[nuxt-backend] doctor --fix: email sync skipped: the deployment has no email:syncEmail.");
1358
+ return "skipped";
1359
+ }
1360
+ if (report.key !== "full") {
1361
+ for (const line of emailSyncLines(report)) print(line);
1362
+ return "skipped";
1363
+ }
1364
+ return { report, plans: emailSyncPlans(report) };
1365
+ }
1301
1366
  function changeConfirmation({ yes, interactive, ask, print }) {
1302
1367
  return async ({ description }) => {
1303
1368
  if (yes) return true;
@@ -1954,6 +2019,56 @@ async function catalogIdsStep(state, generated) {
1954
2019
  const code = await state.deps.backend.push();
1955
2020
  record(state, code === 0 ? { ...base, outcome: "done", detail: `billing sync wrote new ids: pushed the backend again, so production reads them. ${commit}` } : { ...base, outcome: "failed", detail: `billing sync wrote new ids, and npx convex deploy exited with code ${code}: run deploy again. ${commit}` });
1956
2021
  }
2022
+ const MIGRATE_BY_HAND = "npx nuxt-backend upgrade --prod --yes";
2023
+ function migrationsOutcome({ data, pools }, dryRun) {
2024
+ if (dryRun) return { outcome: "planned", detail: `${plannedMigrations(data)}, then start the workpool backfill on every pool` };
2025
+ const failed = failedMigrations(data);
2026
+ if (failed) return { outcome: "failed", detail: `${failed}: fix it, then run ${MIGRATE_BY_HAND}` };
2027
+ const unfinished = unfinishedMigrations({ data, pools });
2028
+ if (unfinished) return migrationsUnanswered(unfinished);
2029
+ return { outcome: "done", detail: `${migratedDetail(data)}; ${backfillDetail(pools)}` };
2030
+ }
2031
+ function migrationsUnanswered(reason) {
2032
+ return { outcome: "skipped", detail: `${reason}: the deploy goes on; run ${MIGRATE_BY_HAND} to finish them` };
2033
+ }
2034
+ const waiting = (data) => data.migrations.filter((migration) => migration.state !== "done").map((migration) => migration.name).join(", ");
2035
+ function plannedMigrations(data) {
2036
+ if (data.state === "done" || data.state === "none") return "no data migration left";
2037
+ if (data.state === "pending" || data.state === "running") return `would run ${waiting(data)}`;
2038
+ return "would run the package's data migrations once the backend is pushed";
2039
+ }
2040
+ function failedMigrations(data) {
2041
+ const failed = data.migrations.filter((migration) => migration.state === "failed");
2042
+ if (failed.length === 0) return void 0;
2043
+ return failed.map((migration) => `${migration.name} failed${migration.error ? ` (${migration.error})` : ""}`).join(", ");
2044
+ }
2045
+ function unfinishedMigrations({ data, pools }) {
2046
+ if (data.state === "failed" || data.state === "needs-push" || data.state === "skipped") return data.reason ?? "production did not answer the data migrations";
2047
+ if (pools.state === "failed") return `the workpool backfill was refused by ${pools.failed.map((pool) => `${pool.component} (${pool.reason})`).join(", ")}`;
2048
+ return void 0;
2049
+ }
2050
+ function migratedDetail(data) {
2051
+ if (data.state === "none") return "no data migration in this version";
2052
+ if (data.state === "running") return `${waiting(data)} still running on production's scheduler (${MIGRATE_BY_HAND} shows them finish)`;
2053
+ return "every data migration done";
2054
+ }
2055
+ function backfillDetail(pools) {
2056
+ if (pools.state === "started") return `the workpool backfill started on ${pools.pools.join(", ")}`;
2057
+ if (pools.state === "skipped") return `the workpool backfill not asked: ${pools.reason ?? "production did not list its components"}`;
2058
+ return "no pool needs the workpool backfill";
2059
+ }
2060
+ async function migrationsStep(state) {
2061
+ if (!state.deps.migrate) return;
2062
+ const base = { id: "data-migrations", capability: "data", title: "The data migrations" };
2063
+ if (!state.options.dryRun && !state.steps.some((step) => step.id === "backend" && step.outcome === "done")) {
2064
+ return record(state, { ...base, outcome: "skipped", detail: `they run on the backend this version pushes, which did not go up: run deploy again, or ${MIGRATE_BY_HAND} after the push` });
2065
+ }
2066
+ try {
2067
+ record(state, { ...base, ...migrationsOutcome(await state.deps.migrate({ dryRun: state.options.dryRun }), state.options.dryRun) });
2068
+ } catch (error) {
2069
+ record(state, { ...base, ...migrationsUnanswered(error instanceof Error ? error.message : String(error)) });
2070
+ }
2071
+ }
1957
2072
  async function emailEndpoint(state) {
1958
2073
  const url = state.url ?? (state.options.dryRun ? await state.deps.backend.url() : null);
1959
2074
  const site = state.deps.env.NUXT_PUBLIC_CONVEX_SITE_URL || (url ? siteFromCloudUrl(url) : null);
@@ -2064,6 +2179,7 @@ async function runDeploy(options, deps) {
2064
2179
  for (const step of ENV_STEPS) await step(state);
2065
2180
  await backendStep(state);
2066
2181
  await catalogIdsStep(state, await billingStep(state));
2182
+ await migrationsStep(state);
2067
2183
  await emailWebhookStep(state);
2068
2184
  await emailSyncStep(state);
2069
2185
  await appEnvStep(state);
@@ -2118,7 +2234,19 @@ async function runBuild(deps) {
2118
2234
  return 1;
2119
2235
  }
2120
2236
  }
2121
- return deps.convexDeploy(["deploy", "--cmd", buildCmd(preview, deps.env, deps.packageManager), "--cmd-url-env-var-name", "NUXT_PUBLIC_BACKEND_URL", ...preview ? previewRun(deps.env, deps.print) : []]);
2237
+ const code = await deps.convexDeploy(["deploy", "--cmd", buildCmd(preview, deps.env, deps.packageManager), "--cmd-url-env-var-name", "NUXT_PUBLIC_BACKEND_URL", ...preview ? previewRun(deps.env, deps.print) : []]);
2238
+ if (code !== 0 || preview || !deps.migrate) return code;
2239
+ return migrateProduction(deps.migrate, deps.print);
2240
+ }
2241
+ async function migrateProduction(migrate, print) {
2242
+ let outcome;
2243
+ try {
2244
+ outcome = migrationsOutcome(await migrate(), false);
2245
+ } catch (error) {
2246
+ outcome = migrationsUnanswered(error instanceof Error ? error.message : String(error));
2247
+ }
2248
+ print(`[nuxt-backend] deploy --build: the data migrations${outcome.outcome === "skipped" ? " (warning)" : ""}: ${outcome.detail}`);
2249
+ return outcome.outcome === "failed" ? 1 : 0;
2122
2250
  }
2123
2251
 
2124
2252
  const EMAIL_WEBHOOK_EVENTS = [
@@ -2167,6 +2295,127 @@ async function ensureEmailWebhook(apiKey, url, { dryRun = false, client } = {})
2167
2295
  return { action: "created", secret: created.data.signing_secret };
2168
2296
  }
2169
2297
 
2298
+ const PACKAGE_MIGRATIONS = [
2299
+ {
2300
+ name: "personalWorkspaces",
2301
+ table: "user",
2302
+ since: "0.2.0",
2303
+ does: "gives each signed-in user without a workspace the personal one their sign-in would have made"
2304
+ },
2305
+ {
2306
+ name: "activeWorkspaces",
2307
+ table: "session",
2308
+ since: "0.2.0",
2309
+ does: "activates a workspace on each live session that has none, so a signed-in user need not sign in again"
2310
+ }
2311
+ ];
2312
+
2313
+ const POOL_BACKFILL = "migrations:backfillPendingStartIds";
2314
+ const PROBE = "__nuxt_backend_component_listing__";
2315
+ const BATCH_WORKER = "batchWorker";
2316
+ const CONCURRENCY = 4;
2317
+ async function listComponents(rootDir, prod, run) {
2318
+ try {
2319
+ await run(rootDir, ["run", ...deploymentFlags({ prod }), "--component", PROBE, "--inline-query", "return null"], { timeout: 6e4 });
2320
+ } catch (error) {
2321
+ if (error instanceof ConvexCliError && error.components) return error.components;
2322
+ return { reason: `the deployment did not list its components: ${error instanceof Error ? error.message : String(error)}` };
2323
+ }
2324
+ return { reason: "the deployment did not list its components" };
2325
+ }
2326
+ async function backfill(rootDir, component, prod, run) {
2327
+ try {
2328
+ await run(rootDir, ["run", ...deploymentFlags({ prod }), "--component", component, POOL_BACKFILL, "{}"], { timeout: 6e4 });
2329
+ return "started";
2330
+ } catch (error) {
2331
+ if (error instanceof ConvexCliError && error.missingFunction) return "absent";
2332
+ return { reason: error instanceof Error ? error.message : String(error) };
2333
+ }
2334
+ }
2335
+ async function inBatches(items, limit, task) {
2336
+ const results = [];
2337
+ for (let start = 0; start < items.length; start += limit) {
2338
+ results.push(...await Promise.all(items.slice(start, start + limit).map(task)));
2339
+ }
2340
+ return results;
2341
+ }
2342
+ async function backfillPools(rootDir, { prod, dryRun }, run = runConvex) {
2343
+ if (dryRun) return { state: "pending", pools: [], failed: [], reason: `a dry run starts nothing: upgrade runs ${POOL_BACKFILL} on every workpool the deployment mounts` };
2344
+ const components = await listComponents(rootDir, prod, run);
2345
+ if (!Array.isArray(components)) return { state: "skipped", pools: [], failed: [], reason: components.reason };
2346
+ const candidates = components.filter((path) => path.split("/").at(-1) !== BATCH_WORKER);
2347
+ const answers = await inBatches(candidates, CONCURRENCY, (component) => backfill(rootDir, component, prod, run));
2348
+ const pools = candidates.filter((_, index) => answers[index] === "started");
2349
+ const failed = candidates.flatMap((component, index) => {
2350
+ const answer = answers[index];
2351
+ return typeof answer === "object" ? [{ component, reason: answer.reason }] : [];
2352
+ });
2353
+ return { state: failed.length > 0 ? "failed" : pools.length > 0 ? "started" : "none", pools, failed };
2354
+ }
2355
+
2356
+ const COMPONENT = "backend";
2357
+ function missingFunction(error) {
2358
+ const text = error instanceof ConvexCliError ? error.stderrTail : String(error);
2359
+ return /could not find function|•\s*[\w/.-]+:\w+/i.test(text);
2360
+ }
2361
+ async function call(rootDir, fn, prod) {
2362
+ const { stdout } = await runConvex(rootDir, ["run", "--component", COMPONENT, ...deploymentFlags({ prod }), `migrations:${fn}`, "{}"], { timeout: 6e4 });
2363
+ return JSON.parse(stdout);
2364
+ }
2365
+ function overall(migrations) {
2366
+ if (migrations.length === 0) return "none";
2367
+ if (migrations.some((migration) => migration.state === "failed")) return "failed";
2368
+ if (migrations.every((migration) => migration.state === "done")) return "done";
2369
+ return migrations.some((migration) => migration.state === "running") ? "running" : "pending";
2370
+ }
2371
+ function unread() {
2372
+ return PACKAGE_MIGRATIONS.map(({ name, since, does }) => ({ name, since, does, state: "pending", processed: 0 }));
2373
+ }
2374
+ const settled = (state) => state === "done" || state === "none" || state === "failed";
2375
+ async function readStatus(rootDir, options) {
2376
+ const deployment = options.prod ? "production" : "dev";
2377
+ if (!options.prod && !configuredDeployment(rootDir) && deployKeyType({ ...readEnvFiles(rootDir), ...process.env }) === null) {
2378
+ return { deployment, state: "skipped", reason: "no dev deployment is configured: `npx nuxt-backend dev` sets one up", migrations: unread() };
2379
+ }
2380
+ try {
2381
+ return await call(rootDir, "status", options.prod);
2382
+ } catch (error) {
2383
+ if (missingFunction(error)) return { deployment, state: "needs-push", reason: `the ${deployment} deployment runs a backend older than this version: push it first`, migrations: unread() };
2384
+ return { deployment, state: options.prod ? "failed" : "skipped", reason: `the ${deployment} deployment did not answer: ${error instanceof Error ? error.message : String(error)}`, migrations: unread() };
2385
+ }
2386
+ }
2387
+ async function follow(rootDir, started, options) {
2388
+ let migrations = started;
2389
+ const deadline = Date.now() + (options.wait ?? 12e4);
2390
+ while (!settled(overall(migrations)) && Date.now() < deadline) {
2391
+ options.print?.(`[nuxt-backend] ${options.command ?? "upgrade"}: ${migrations.filter((migration) => migration.state === "done").length} of ${migrations.length} package migrations done\u2026`);
2392
+ await setTimeout(options.interval ?? 1500);
2393
+ migrations = await call(rootDir, "status", options.prod).catch(() => migrations);
2394
+ }
2395
+ return migrations;
2396
+ }
2397
+ async function migrateData(rootDir, options) {
2398
+ const deployment = options.prod ? "production" : "dev";
2399
+ const status = await readStatus(rootDir, options);
2400
+ if (!Array.isArray(status)) return status;
2401
+ const before = overall(status);
2402
+ if (options.dryRun || before === "done" || before === "none") return { deployment, state: before, migrations: status };
2403
+ let started;
2404
+ try {
2405
+ started = await call(rootDir, "run", options.prod);
2406
+ } catch (error) {
2407
+ return { deployment, state: "failed", reason: `starting the migrations failed: ${error instanceof Error ? error.message : String(error)}`, migrations: status };
2408
+ }
2409
+ const migrations = await follow(rootDir, started, options);
2410
+ const state = overall(migrations);
2411
+ return { deployment, state: state === "pending" ? "running" : state, migrations };
2412
+ }
2413
+ async function migrateDeployment(rootDir, options) {
2414
+ const data = await migrateData(rootDir, options);
2415
+ const pools = data.state === "skipped" ? { state: "skipped", pools: [], failed: [], ...data.reason ? { reason: data.reason } : {} } : await backfillPools(rootDir, { prod: options.prod, dryRun: options.dryRun });
2416
+ return { data, pools };
2417
+ }
2418
+
2170
2419
  const HOST_KEY_NAME = "nuxt-backend-host";
2171
2420
  function deployKeyOf(output) {
2172
2421
  const key = output.split("\n").map((line) => line.trim()).reverse().find((line) => /^[\w-]+:[\w:-]+\|\S+$/.test(line));
@@ -2203,7 +2452,7 @@ const deploy = withContract("deploy", {
2203
2452
  1: "refused, a step failed, or `doctor --prod` fails"
2204
2453
  }
2205
2454
  }, defineCommand({
2206
- meta: { name: "deploy", description: "Take production from nothing to a passing doctor --prod: link or create the production deployment, push its env, push the backend, sync the billing catalog, register both webhooks, write the app's env into the Vercel project, then run doctor --prod. Safe to run again" },
2455
+ meta: { name: "deploy", description: "Take production from nothing to a passing doctor --prod: link or create the production deployment, push its env, push the backend, sync the billing catalog, run the package's data migrations, register both webhooks, write the app's env into the Vercel project, then run doctor --prod. Safe to run again" },
2207
2456
  args: {
2208
2457
  "cwd": { type: "string", description: "Project directory", default: "." },
2209
2458
  "dry-run": { type: "boolean", description: "Print every step it would take, and change nothing", default: false },
@@ -2220,7 +2469,8 @@ const deploy = withContract("deploy", {
2220
2469
  process.exitCode = 1;
2221
2470
  return;
2222
2471
  }
2223
- process.exitCode = await runBuild({ backend: convexBackend(rootDir, { json: false }), convexDeploy: (deployArgs) => spawnConvex(rootDir, deployArgs), env: process.env, packageManager: packageManagerOf(rootDir), print: (line) => console.error(line) });
2472
+ const print2 = (line) => console.error(line);
2473
+ process.exitCode = await runBuild({ backend: convexBackend(rootDir, { json: false }), convexDeploy: (deployArgs) => spawnConvex(rootDir, deployArgs), env: process.env, packageManager: packageManagerOf(rootDir), migrate: () => migrateDeployment(rootDir, { prod: true, dryRun: false, print: print2, command: "deploy --build" }), print: print2 });
2224
2474
  return;
2225
2475
  }
2226
2476
  const key = nonProductionDeployKey({ ...readEnvFiles(rootDir), ...process.env });
@@ -2239,6 +2489,7 @@ const deploy = withContract("deploy", {
2239
2489
  billingSync: (options) => runBillingSync(rootDir, options, { print }),
2240
2490
  emailWebhook: (apiKey, url, options) => ensureEmailWebhook(apiKey, url, options),
2241
2491
  emailSync: ({ dryRun }) => runEmailSync(rootDir, { prod: true, dryRun }),
2492
+ migrate: ({ dryRun }) => migrateDeployment(rootDir, { prod: true, dryRun, print, command: "deploy" }),
2242
2493
  doctor: () => runDoctorChecks(rootDir, { prod: true }),
2243
2494
  buildAdvice: host.kind === "vercel" ? buildCommandAdvice(rootDir) : null,
2244
2495
  print
@@ -2276,11 +2527,11 @@ function parseEnvPushArgs(rawArgs, args) {
2276
2527
  }
2277
2528
 
2278
2529
  async function repairProjectFiles(rootDir, print = () => {
2279
- }) {
2530
+ }, { configRoot = rootDir } = {}) {
2280
2531
  const written = scaffoldBackendFiles(rootDir, { log: print });
2281
2532
  const changes = await fixConvexConfig(rootDir);
2282
2533
  for (const change of changes) print(`[nuxt-backend] doctor --fix: ${change}`);
2283
- const config = await loadConfig(rootDir);
2534
+ const config = await loadConfig(configRoot);
2284
2535
  const source = config ? pathsSourceOf(config) : null;
2285
2536
  if (source && syncPathsFile(rootDir, backendPathsOf(source)) === "written") {
2286
2537
  const line = `${pathsFileLocation(rootDir).name} \u2192 the paths nuxt.config declares`;
@@ -2803,10 +3054,18 @@ ${note}`,
2803
3054
  };
2804
3055
  }
2805
3056
 
3057
+ const WHOLE_UNITS = "BIF CLP DJF GNF JPY KMF KRW MGA PYG RWF VND VUV XAF XOF XPF".split(" ");
3058
+ const THOUSANDTHS = "BHD JOD KWD OMR TND".split(" ");
3059
+ function minorUnitDigits(code) {
3060
+ return WHOLE_UNITS.includes(code) ? 0 : THOUSANDTHS.includes(code) ? 3 : 2;
3061
+ }
2806
3062
  function renewalReminder({ email, plan, amount, currency, interval, intervalCount, renewsAt, manageUrl }, context) {
2807
3063
  const { t } = context;
2808
3064
  const date = new Intl.DateTimeFormat(context.locale, { dateStyle: "long", timeZone: "UTC" }).format(renewsAt);
2809
- const price = new Intl.NumberFormat(context.locale, { style: "currency", currency: currency.toUpperCase() || "USD" }).format(amount / 100);
3065
+ const code = currency.toUpperCase() || "USD";
3066
+ const digits = minorUnitDigits(code);
3067
+ const shown = amount % 10 ** digits === 0 ? 0 : digits;
3068
+ const price = new Intl.NumberFormat(context.locale, { style: "currency", currency: code, minimumFractionDigits: shown, maximumFractionDigits: shown }).format(amount / 10 ** digits);
2810
3069
  const every = t(`email.renewalReminder.every.${interval === "day" || interval === "week" ? interval : "month"}`, { count: intervalCount });
2811
3070
  const intro = t("email.renewalReminder.intro", { plan, price, every, date });
2812
3071
  const cancel = t("email.renewalReminder.cancel");
@@ -3291,79 +3550,6 @@ const ejectCommand = withContract("eject", {
3291
3550
  }
3292
3551
  }));
3293
3552
 
3294
- const PACKAGE_MIGRATIONS = [
3295
- {
3296
- name: "personalWorkspaces",
3297
- table: "user",
3298
- since: "0.2.0",
3299
- does: "gives each signed-in user without a workspace the personal one their sign-in would have made"
3300
- },
3301
- {
3302
- name: "activeWorkspaces",
3303
- table: "session",
3304
- since: "0.2.0",
3305
- does: "activates a workspace on each live session that has none, so a signed-in user need not sign in again"
3306
- }
3307
- ];
3308
-
3309
- const COMPONENT = "backend";
3310
- function missingFunction(error) {
3311
- const text = error instanceof ConvexCliError ? error.stderrTail : String(error);
3312
- return /could not find function|•\s*[\w/.-]+:\w+/i.test(text);
3313
- }
3314
- async function call(rootDir, fn, prod) {
3315
- const { stdout } = await runConvex(rootDir, ["run", "--component", COMPONENT, ...deploymentFlags({ prod }), `migrations:${fn}`, "{}"], { timeout: 6e4 });
3316
- return JSON.parse(stdout);
3317
- }
3318
- function overall(migrations) {
3319
- if (migrations.length === 0) return "none";
3320
- if (migrations.some((migration) => migration.state === "failed")) return "failed";
3321
- if (migrations.every((migration) => migration.state === "done")) return "done";
3322
- return migrations.some((migration) => migration.state === "running") ? "running" : "pending";
3323
- }
3324
- function unread() {
3325
- return PACKAGE_MIGRATIONS.map(({ name, since, does }) => ({ name, since, does, state: "pending", processed: 0 }));
3326
- }
3327
- const settled = (state) => state === "done" || state === "none" || state === "failed";
3328
- async function readStatus(rootDir, options) {
3329
- const deployment = options.prod ? "production" : "dev";
3330
- if (!options.prod && !configuredDeployment(rootDir) && deployKeyType({ ...readEnvFiles(rootDir), ...process.env }) === null) {
3331
- return { deployment, state: "skipped", reason: "no dev deployment is configured: `npx nuxt-backend dev` sets one up", migrations: unread() };
3332
- }
3333
- try {
3334
- return await call(rootDir, "status", options.prod);
3335
- } catch (error) {
3336
- if (missingFunction(error)) return { deployment, state: "needs-push", reason: `the ${deployment} deployment runs a backend older than this version: push it first`, migrations: unread() };
3337
- return { deployment, state: options.prod ? "failed" : "skipped", reason: `the ${deployment} deployment did not answer: ${error instanceof Error ? error.message : String(error)}`, migrations: unread() };
3338
- }
3339
- }
3340
- async function follow(rootDir, started, options) {
3341
- let migrations = started;
3342
- const deadline = Date.now() + (options.wait ?? 12e4);
3343
- while (!settled(overall(migrations)) && Date.now() < deadline) {
3344
- options.print?.(`[nuxt-backend] upgrade: ${migrations.filter((migration) => migration.state === "done").length} of ${migrations.length} package migrations done\u2026`);
3345
- await setTimeout(options.interval ?? 1500);
3346
- migrations = await call(rootDir, "status", options.prod).catch(() => migrations);
3347
- }
3348
- return migrations;
3349
- }
3350
- async function migrateData(rootDir, options) {
3351
- const deployment = options.prod ? "production" : "dev";
3352
- const status = await readStatus(rootDir, options);
3353
- if (!Array.isArray(status)) return status;
3354
- const before = overall(status);
3355
- if (options.dryRun || before === "done" || before === "none") return { deployment, state: before, migrations: status };
3356
- let started;
3357
- try {
3358
- started = await call(rootDir, "run", options.prod);
3359
- } catch (error) {
3360
- return { deployment, state: "failed", reason: `starting the migrations failed: ${error instanceof Error ? error.message : String(error)}`, migrations: status };
3361
- }
3362
- const migrations = await follow(rootDir, started, options);
3363
- const state = overall(migrations);
3364
- return { deployment, state: state === "pending" ? "running" : state, migrations };
3365
- }
3366
-
3367
3553
  const MAX_CELLS = 4e6;
3368
3554
  function subsequences(left, right) {
3369
3555
  const width = right.length + 1;
@@ -3509,49 +3695,6 @@ function formatUpgrade(report) {
3509
3695
  ];
3510
3696
  }
3511
3697
 
3512
- const POOL_BACKFILL = "migrations:backfillPendingStartIds";
3513
- const PROBE = "__nuxt_backend_component_listing__";
3514
- const BATCH_WORKER = "batchWorker";
3515
- const CONCURRENCY = 4;
3516
- async function listComponents(rootDir, prod, run) {
3517
- try {
3518
- await run(rootDir, ["run", ...deploymentFlags({ prod }), "--component", PROBE, "--inline-query", "return null"], { timeout: 6e4 });
3519
- } catch (error) {
3520
- if (error instanceof ConvexCliError && error.components) return error.components;
3521
- return { reason: `the deployment did not list its components: ${error instanceof Error ? error.message : String(error)}` };
3522
- }
3523
- return { reason: "the deployment did not list its components" };
3524
- }
3525
- async function backfill(rootDir, component, prod, run) {
3526
- try {
3527
- await run(rootDir, ["run", ...deploymentFlags({ prod }), "--component", component, POOL_BACKFILL, "{}"], { timeout: 6e4 });
3528
- return "started";
3529
- } catch (error) {
3530
- if (error instanceof ConvexCliError && error.missingFunction) return "absent";
3531
- return { reason: error instanceof Error ? error.message : String(error) };
3532
- }
3533
- }
3534
- async function inBatches(items, limit, task) {
3535
- const results = [];
3536
- for (let start = 0; start < items.length; start += limit) {
3537
- results.push(...await Promise.all(items.slice(start, start + limit).map(task)));
3538
- }
3539
- return results;
3540
- }
3541
- async function backfillPools(rootDir, { prod, dryRun }, run = runConvex) {
3542
- if (dryRun) return { state: "pending", pools: [], failed: [], reason: `a dry run starts nothing: upgrade runs ${POOL_BACKFILL} on every workpool the deployment mounts` };
3543
- const components = await listComponents(rootDir, prod, run);
3544
- if (!Array.isArray(components)) return { state: "skipped", pools: [], failed: [], reason: components.reason };
3545
- const candidates = components.filter((path) => path.split("/").at(-1) !== BATCH_WORKER);
3546
- const answers = await inBatches(candidates, CONCURRENCY, (component) => backfill(rootDir, component, prod, run));
3547
- const pools = candidates.filter((_, index) => answers[index] === "started");
3548
- const failed = candidates.flatMap((component, index) => {
3549
- const answer = answers[index];
3550
- return typeof answer === "object" ? [{ component, reason: answer.reason }] : [];
3551
- });
3552
- return { state: failed.length > 0 ? "failed" : pools.length > 0 ? "started" : "none", pools, failed };
3553
- }
3554
-
3555
3698
  function filesUnder(dir, prefix = "") {
3556
3699
  if (!existsSync(dir)) return [];
3557
3700
  return readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {
@@ -3582,7 +3725,7 @@ async function planRepairs(rootDir) {
3582
3725
  const scratch = projectCopy(scratchDir, rootDir, functionsDir);
3583
3726
  if (!scratch) return { written: [], changes: [`${functionsDir}: on another drive, which the dry run cannot copy; \`npx nuxt-backend doctor\` names what the repairs would change`], files: [] };
3584
3727
  copyProject(rootDir, scratch, functionsDir);
3585
- const { written, changes } = await repairProjectFiles(scratch);
3728
+ const { written, changes } = await repairProjectFiles(scratch, void 0, { configRoot: rootDir });
3586
3729
  const files = [...filesUnder(join(scratch, functionsDir), `${functionsDir}/`), "convex.json", "package.json"].flatMap((path) => {
3587
3730
  if (!existsSync(join(scratch, path))) return [];
3588
3731
  const after = readFileSync(join(scratch, path), "utf-8");
@@ -3616,8 +3759,7 @@ async function runUpgrade(rootDir, options) {
3616
3759
  }
3617
3760
  const ejected = await ejectedChanges(rootDir);
3618
3761
  options.print(`[nuxt-backend] upgrade: the package's data migrations, ${options.prod ? "production" : "dev"} deployment\u2026`);
3619
- const data = await migrateData(rootDir, { prod: options.prod, dryRun: options.dryRun, print: options.print });
3620
- const pools = data.state === "skipped" ? { state: "skipped", pools: [], failed: [], ...data.reason ? { reason: data.reason } : {} } : await backfillPools(rootDir, { prod: options.prod, dryRun: options.dryRun });
3762
+ const { data, pools } = await migrateDeployment(rootDir, { prod: options.prod, dryRun: options.dryRun, print: options.print });
3621
3763
  const report = { to, dryRun: options.dryRun, scaffold, ejected, data, pools };
3622
3764
  return { ...report, next: nextCommands(rootDir, report, options.prod) };
3623
3765
  }
@@ -3766,13 +3908,16 @@ async function repairProject(rootDir, prod, print, { interactive, yes, only }) {
3766
3908
  }
3767
3909
  print(`[nuxt-backend] doctor --fix: env push \u2192 ${run.deployment ?? "deployment"}`);
3768
3910
  reportEnvPush(run, { json: false, dryRun: false, print });
3769
- if (interactive) await bootstrapAdmin(rootDir, { prod, ask: askOnTerminal, print });
3770
- print("[nuxt-backend] doctor --fix: email sync");
3771
- await runEmailSyncCommand(rootDir, { prod }, print);
3911
+ await firstAdministratorOnFix(rootDir, { prod, interactive, ask: askOnTerminal, print });
3912
+ const confirm = changeConfirmation({ yes, interactive, ask: askOnTerminal, print });
3772
3913
  const wanted = (capability) => !only || only.length === 0 || only.includes(capability);
3914
+ if (wanted("email")) {
3915
+ print("[nuxt-backend] doctor --fix: email sync");
3916
+ if (await syncEmailOnFix(rootDir, { prod, confirm, print }) === "failed") process.exitCode = 1;
3917
+ }
3773
3918
  if (wanted("billing") || wanted("email")) {
3774
3919
  print("[nuxt-backend] doctor --fix: provider settings");
3775
- await fixProviderSettings(rootDir, { prod, confirm: changeConfirmation({ yes, interactive, ask: askOnTerminal, print }), print, billing: wanted("billing"), email: wanted("email") });
3920
+ await fixProviderSettings(rootDir, { prod, confirm, print, billing: wanted("billing"), email: wanted("email") });
3776
3921
  }
3777
3922
  const set = run.results.filter((result) => result.outcome === "set").map((result) => result.action.name);
3778
3923
  return [.../* @__PURE__ */ new Set([...run.deployedNames, ...set])];
@@ -3930,15 +4075,15 @@ const doctor = withContract("doctor", {
3930
4075
  json: "`{ $schema, findings, summary }`, described by https://nuxt-backend.dev/schemas/doctor.json; with `--fix`, the repair's progress goes to stderr",
3931
4076
  exitCodes: {
3932
4077
  0: "no finding failed (warnings allowed)",
3933
- 1: "a finding failed, or the flags were refused"
4078
+ 1: "a finding failed, the flags were refused, or with `--fix`, `email sync` was refused or failed"
3934
4079
  }
3935
4080
  }, defineCommand({
3936
4081
  meta: { name: "doctor", description: "Check the project + deployment configuration" },
3937
4082
  args: {
3938
4083
  ...cwdArg,
3939
4084
  json: { type: "boolean", description: "Machine-readable output", default: false },
3940
- fix: { type: "boolean", description: "Repair what doctor can: restore missing scaffold files, add missing mounts and routes, push env (`env push`), at a terminal make the first administrator, and apply the provider settings the billing findings recommend and turn a webhook endpoint back on, each after you confirm it", default: false },
3941
- yes: { type: "boolean", description: "With --fix: apply the provider changes without asking (for a script or CI)", default: false },
4085
+ fix: { type: "boolean", description: "Repair what doctor can: restore missing scaffold files, add missing mounts and routes, push env (`env push`), at a terminal make the first administrator, then, each after you confirm it, run `email sync`, apply the provider settings the billing findings recommend and turn a webhook endpoint back on", default: false },
4086
+ yes: { type: "boolean", description: "With --fix: run `email sync` and apply the provider changes without asking (for a script or CI; without it and without a terminal, they are listed and skipped)", default: false },
3942
4087
  prod: { type: "boolean", description: "Check the production deployment: missing email/billing config becomes a failure, its switches and email are read, and its live site is probed", default: false },
3943
4088
  only: { type: "string", description: `Check only these capabilities, comma-separated: ${CAPABILITY_NAMES.join(", ")}` }
3944
4089
  },
@@ -142,6 +142,14 @@ export interface CatalogCustomField {
142
142
  export type CatalogInterval = 'month' | 'year';
143
143
  /** The intervals a plan may be priced at, in the order pricing lists them. */
144
144
  export declare const CATALOG_INTERVALS: readonly ["month", "year"];
145
+ /**
146
+ * The date `months` calendar months after `from` (epoch ms), in UTC, the
147
+ * way the provider adds a monthly period: the same day of the month, or
148
+ * the month's last day when it has fewer (Jan 31 + 1 month is Feb 28,
149
+ * not Mar 3). The server's plan passes and the plan section's pause
150
+ * both count months by it.
151
+ */
152
+ export declare function addMonths(from: number, months: number): number;
145
153
  /**
146
154
  * A plan's prices in cents, one per billing interval it is sold at. Each
147
155
  * becomes a product of its own at the provider, tagged with the plan's key
@@ -1 +1 @@
1
- {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/convex/catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,+EAA+E;AAC/E,MAAM,WAAW,kBAAkB;IACjC,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAA;IACb,2DAA2D;IAC3D,KAAK,EAAE,MAAM,CAAA;IACb;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,qFAAqF;AACrF,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,WAAW,CAAC,EAAE,KAAK,GAAG,OAAO,CAAA;IAC7B,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,SAAS,CAAA;CACjB;AAED;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,WAAW,GAAG,UAAU,CAAA;AAEvE;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAClB;IACF,QAAQ,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