nuxt-backend 0.2.1 → 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 (1062) hide show
  1. package/README.md +25 -7
  2. package/dist/capabilities/detect.js +16 -7
  3. package/dist/capabilities/gateway-route.js +24 -0
  4. package/dist/capabilities/registry.js +3 -2
  5. package/dist/capabilities/status.js +3 -1
  6. package/dist/chunks/catalog.mjs +1 -1
  7. package/dist/chunks/doctor.mjs +596 -71
  8. package/dist/chunks/email-previews.mjs +1 -1
  9. package/dist/chunks/health.mjs +2 -2
  10. package/dist/chunks/index.mjs +3 -3
  11. package/dist/chunks/install.mjs +4 -4
  12. package/dist/chunks/run.mjs +1 -1
  13. package/dist/chunks/server.mjs +9 -7
  14. package/dist/cli.mjs +628 -128
  15. package/dist/convex/access-tickets.d.ts +20 -1
  16. package/dist/convex/access-tickets.d.ts.map +1 -1
  17. package/dist/convex/access-tickets.js +28 -0
  18. package/dist/convex/access-tickets.js.map +1 -1
  19. package/dist/convex/account-data.d.ts +25 -3
  20. package/dist/convex/account-data.d.ts.map +1 -1
  21. package/dist/convex/account-data.js +26 -3
  22. package/dist/convex/account-data.js.map +1 -1
  23. package/dist/convex/app.d.ts +15 -2
  24. package/dist/convex/app.d.ts.map +1 -1
  25. package/dist/convex/app.js +16 -2
  26. package/dist/convex/app.js.map +1 -1
  27. package/dist/convex/billing-launch.d.ts +36 -0
  28. package/dist/convex/billing-launch.d.ts.map +1 -0
  29. package/dist/convex/billing-launch.js +18 -0
  30. package/dist/convex/billing-launch.js.map +1 -0
  31. package/dist/convex/catalog.d.ts +24 -2
  32. package/dist/convex/catalog.d.ts.map +1 -1
  33. package/dist/convex/catalog.js +16 -0
  34. package/dist/convex/catalog.js.map +1 -1
  35. package/dist/convex/client/code-binding.js +1 -1
  36. package/dist/convex/client/component.d.ts.map +1 -1
  37. package/dist/convex/client/guards.js +3 -3
  38. package/dist/convex/client/guards.js.map +1 -1
  39. package/dist/convex/client/index.d.ts +94 -40
  40. package/dist/convex/client/index.d.ts.map +1 -1
  41. package/dist/convex/client/index.js +4 -3
  42. package/dist/convex/client/index.js.map +1 -1
  43. package/dist/convex/client/plugins.d.ts +67 -30
  44. package/dist/convex/client/plugins.d.ts.map +1 -1
  45. package/dist/convex/client/plugins.js +43 -19
  46. package/dist/convex/client/plugins.js.map +1 -1
  47. package/dist/convex/components/backend/_generated/api.d.ts +2 -0
  48. package/dist/convex/components/backend/_generated/api.d.ts.map +1 -1
  49. package/dist/convex/components/backend/_generated/api.js.map +1 -1
  50. package/dist/convex/components/backend/_generated/component.d.ts +475 -5
  51. package/dist/convex/components/backend/_generated/component.d.ts.map +1 -1
  52. package/dist/convex/components/backend/access.d.ts +47 -6
  53. package/dist/convex/components/backend/access.d.ts.map +1 -1
  54. package/dist/convex/components/backend/access.js +108 -16
  55. package/dist/convex/components/backend/access.js.map +1 -1
  56. package/dist/convex/components/backend/account.d.ts +6 -0
  57. package/dist/convex/components/backend/account.d.ts.map +1 -1
  58. package/dist/convex/components/backend/account.js +49 -2
  59. package/dist/convex/components/backend/account.js.map +1 -1
  60. package/dist/convex/components/backend/adapter.d.ts +1 -1
  61. package/dist/convex/components/backend/adapter.d.ts.map +1 -1
  62. package/dist/convex/components/backend/adapter.js +1 -1
  63. package/dist/convex/components/backend/adapter.js.map +1 -1
  64. package/dist/convex/components/backend/billing.d.ts +29 -1
  65. package/dist/convex/components/backend/billing.d.ts.map +1 -1
  66. package/dist/convex/components/backend/billing.js +97 -17
  67. package/dist/convex/components/backend/billing.js.map +1 -1
  68. package/dist/convex/components/backend/costs.d.ts +1 -1
  69. package/dist/convex/components/backend/crons.d.ts.map +1 -1
  70. package/dist/convex/components/backend/crons.js +3 -0
  71. package/dist/convex/components/backend/crons.js.map +1 -1
  72. package/dist/convex/components/backend/funnel.d.ts +2 -2
  73. package/dist/convex/components/backend/gifts.d.ts +2 -2
  74. package/dist/convex/components/backend/gifts.js +2 -2
  75. package/dist/convex/components/backend/jobs.d.ts +122 -11
  76. package/dist/convex/components/backend/jobs.d.ts.map +1 -1
  77. package/dist/convex/components/backend/jobs.js +160 -17
  78. package/dist/convex/components/backend/jobs.js.map +1 -1
  79. package/dist/convex/components/backend/maintenance.d.ts +2 -2
  80. package/dist/convex/components/backend/maintenance.d.ts.map +1 -1
  81. package/dist/convex/components/backend/maintenance.js +11 -1
  82. package/dist/convex/components/backend/maintenance.js.map +1 -1
  83. package/dist/convex/components/backend/moderation.d.ts +94 -0
  84. package/dist/convex/components/backend/moderation.d.ts.map +1 -0
  85. package/dist/convex/components/backend/moderation.js +53 -0
  86. package/dist/convex/components/backend/moderation.js.map +1 -0
  87. package/dist/convex/components/backend/schema.d.ts +437 -36
  88. package/dist/convex/components/backend/schema.d.ts.map +1 -1
  89. package/dist/convex/components/backend/schema.js +119 -4
  90. package/dist/convex/components/backend/schema.js.map +1 -1
  91. package/dist/convex/components/backend/storage.d.ts +19 -0
  92. package/dist/convex/components/backend/storage.d.ts.map +1 -1
  93. package/dist/convex/components/backend/storage.js +57 -0
  94. package/dist/convex/components/backend/storage.js.map +1 -1
  95. package/dist/convex/components/backend/subscriptions.d.ts +4 -4
  96. package/dist/convex/components/backend/subscriptions.js +1 -1
  97. package/dist/convex/components/backend/subscriptions.js.map +1 -1
  98. package/dist/convex/constants.d.ts +19 -4
  99. package/dist/convex/constants.d.ts.map +1 -1
  100. package/dist/convex/constants.js +19 -4
  101. package/dist/convex/constants.js.map +1 -1
  102. package/dist/convex/delivery.d.ts +17 -0
  103. package/dist/convex/delivery.d.ts.map +1 -1
  104. package/dist/convex/delivery.js +26 -1
  105. package/dist/convex/delivery.js.map +1 -1
  106. package/dist/convex/email-templates.d.ts +56 -6
  107. package/dist/convex/email-templates.d.ts.map +1 -1
  108. package/dist/convex/email-templates.js +69 -14
  109. package/dist/convex/email-templates.js.map +1 -1
  110. package/dist/convex/emails/notification.d.ts +9 -0
  111. package/dist/convex/emails/notification.d.ts.map +1 -0
  112. package/dist/convex/emails/notification.js +21 -0
  113. package/dist/convex/emails/notification.js.map +1 -0
  114. package/dist/convex/emails/renewal-reminder.d.ts.map +1 -1
  115. package/dist/convex/emails/renewal-reminder.js +17 -1
  116. package/dist/convex/emails/renewal-reminder.js.map +1 -1
  117. package/dist/convex/errors.d.ts +15 -8
  118. package/dist/convex/errors.d.ts.map +1 -1
  119. package/dist/convex/errors.js +78 -15
  120. package/dist/convex/errors.js.map +1 -1
  121. package/dist/convex/events.d.ts +14 -4
  122. package/dist/convex/events.d.ts.map +1 -1
  123. package/dist/convex/events.js +11 -4
  124. package/dist/convex/events.js.map +1 -1
  125. package/dist/convex/files.d.ts +30 -4
  126. package/dist/convex/files.d.ts.map +1 -1
  127. package/dist/convex/files.js +44 -6
  128. package/dist/convex/files.js.map +1 -1
  129. package/dist/convex/integrations/account.d.ts +7 -0
  130. package/dist/convex/integrations/account.d.ts.map +1 -1
  131. package/dist/convex/integrations/account.js +2 -0
  132. package/dist/convex/integrations/account.js.map +1 -1
  133. package/dist/convex/integrations/ai/chat.js +9 -9
  134. package/dist/convex/integrations/ai/chat.js.map +1 -1
  135. package/dist/convex/integrations/ai/config.d.ts +157 -37
  136. package/dist/convex/integrations/ai/config.d.ts.map +1 -1
  137. package/dist/convex/integrations/ai/context.d.ts +3 -0
  138. package/dist/convex/integrations/ai/context.d.ts.map +1 -1
  139. package/dist/convex/integrations/ai/context.js +4 -3
  140. package/dist/convex/integrations/ai/context.js.map +1 -1
  141. package/dist/convex/integrations/ai/costs.d.ts.map +1 -1
  142. package/dist/convex/integrations/ai/costs.js +49 -2
  143. package/dist/convex/integrations/ai/costs.js.map +1 -1
  144. package/dist/convex/integrations/ai/embeddings.d.ts +6 -6
  145. package/dist/convex/integrations/ai/embeddings.d.ts.map +1 -1
  146. package/dist/convex/integrations/ai/embeddings.js +17 -30
  147. package/dist/convex/integrations/ai/embeddings.js.map +1 -1
  148. package/dist/convex/integrations/ai/images.d.ts +25 -0
  149. package/dist/convex/integrations/ai/images.d.ts.map +1 -0
  150. package/dist/convex/integrations/ai/images.js +117 -0
  151. package/dist/convex/integrations/ai/images.js.map +1 -0
  152. package/dist/convex/integrations/ai/job-errors.d.ts +44 -4
  153. package/dist/convex/integrations/ai/job-errors.d.ts.map +1 -1
  154. package/dist/convex/integrations/ai/job-errors.js +72 -9
  155. package/dist/convex/integrations/ai/job-errors.js.map +1 -1
  156. package/dist/convex/integrations/ai/jobs.d.ts +301 -14
  157. package/dist/convex/integrations/ai/jobs.d.ts.map +1 -1
  158. package/dist/convex/integrations/ai/jobs.js +688 -90
  159. package/dist/convex/integrations/ai/jobs.js.map +1 -1
  160. package/dist/convex/integrations/ai/knowledge.d.ts.map +1 -1
  161. package/dist/convex/integrations/ai/knowledge.js +10 -11
  162. package/dist/convex/integrations/ai/knowledge.js.map +1 -1
  163. package/dist/convex/integrations/ai/metering.d.ts +15 -5
  164. package/dist/convex/integrations/ai/metering.d.ts.map +1 -1
  165. package/dist/convex/integrations/ai/metering.js +73 -26
  166. package/dist/convex/integrations/ai/metering.js.map +1 -1
  167. package/dist/convex/integrations/ai/model-id.d.ts +14 -1
  168. package/dist/convex/integrations/ai/model-id.d.ts.map +1 -1
  169. package/dist/convex/integrations/ai/model-id.js +24 -2
  170. package/dist/convex/integrations/ai/model-id.js.map +1 -1
  171. package/dist/convex/integrations/ai/models.d.ts +104 -21
  172. package/dist/convex/integrations/ai/models.d.ts.map +1 -1
  173. package/dist/convex/integrations/ai/models.js +220 -45
  174. package/dist/convex/integrations/ai/models.js.map +1 -1
  175. package/dist/convex/integrations/ai/moderation-providers.d.ts +136 -0
  176. package/dist/convex/integrations/ai/moderation-providers.d.ts.map +1 -0
  177. package/dist/convex/integrations/ai/moderation-providers.js +277 -0
  178. package/dist/convex/integrations/ai/moderation-providers.js.map +1 -0
  179. package/dist/convex/integrations/ai/moderation-taxonomy.d.ts +54 -0
  180. package/dist/convex/integrations/ai/moderation-taxonomy.d.ts.map +1 -0
  181. package/dist/convex/integrations/ai/moderation-taxonomy.js +141 -0
  182. package/dist/convex/integrations/ai/moderation-taxonomy.js.map +1 -0
  183. package/dist/convex/integrations/ai/moderation.d.ts +225 -20
  184. package/dist/convex/integrations/ai/moderation.d.ts.map +1 -1
  185. package/dist/convex/integrations/ai/moderation.js +361 -37
  186. package/dist/convex/integrations/ai/moderation.js.map +1 -1
  187. package/dist/convex/integrations/ai/provenance.d.ts +6 -0
  188. package/dist/convex/integrations/ai/provenance.d.ts.map +1 -1
  189. package/dist/convex/integrations/ai/provenance.js +4 -1
  190. package/dist/convex/integrations/ai/provenance.js.map +1 -1
  191. package/dist/convex/integrations/ai/setup.js +5 -5
  192. package/dist/convex/integrations/ai/setup.js.map +1 -1
  193. package/dist/convex/integrations/ai/stream.d.ts +1 -1
  194. package/dist/convex/integrations/ai/stream.d.ts.map +1 -1
  195. package/dist/convex/integrations/ai/stream.js +4 -2
  196. package/dist/convex/integrations/ai/stream.js.map +1 -1
  197. package/dist/convex/integrations/ai.d.ts +15 -8
  198. package/dist/convex/integrations/ai.d.ts.map +1 -1
  199. package/dist/convex/integrations/ai.js +4 -1
  200. package/dist/convex/integrations/ai.js.map +1 -1
  201. package/dist/convex/integrations/billing/checkout.d.ts +1 -1
  202. package/dist/convex/integrations/billing/checkout.d.ts.map +1 -1
  203. package/dist/convex/integrations/billing/checkout.js +4 -4
  204. package/dist/convex/integrations/billing/checkout.js.map +1 -1
  205. package/dist/convex/integrations/billing/context.d.ts +8 -0
  206. package/dist/convex/integrations/billing/context.d.ts.map +1 -1
  207. package/dist/convex/integrations/billing/context.js +24 -2
  208. package/dist/convex/integrations/billing/context.js.map +1 -1
  209. package/dist/convex/integrations/billing/credits.d.ts +7 -0
  210. package/dist/convex/integrations/billing/credits.d.ts.map +1 -1
  211. package/dist/convex/integrations/billing/credits.js +25 -7
  212. package/dist/convex/integrations/billing/credits.js.map +1 -1
  213. package/dist/convex/integrations/billing/features.d.ts.map +1 -1
  214. package/dist/convex/integrations/billing/free-plan.d.ts +41 -1
  215. package/dist/convex/integrations/billing/free-plan.d.ts.map +1 -1
  216. package/dist/convex/integrations/billing/free-plan.js +92 -29
  217. package/dist/convex/integrations/billing/free-plan.js.map +1 -1
  218. package/dist/convex/integrations/billing/functions.d.ts +7 -3
  219. package/dist/convex/integrations/billing/functions.d.ts.map +1 -1
  220. package/dist/convex/integrations/billing/functions.js +18 -8
  221. package/dist/convex/integrations/billing/functions.js.map +1 -1
  222. package/dist/convex/integrations/billing/gifts.d.ts +4 -0
  223. package/dist/convex/integrations/billing/gifts.d.ts.map +1 -1
  224. package/dist/convex/integrations/billing/gifts.js +37 -6
  225. package/dist/convex/integrations/billing/gifts.js.map +1 -1
  226. package/dist/convex/integrations/billing/history.d.ts.map +1 -1
  227. package/dist/convex/integrations/billing/lifecycle.d.ts +9 -3
  228. package/dist/convex/integrations/billing/lifecycle.d.ts.map +1 -1
  229. package/dist/convex/integrations/billing/lifecycle.js +15 -6
  230. package/dist/convex/integrations/billing/lifecycle.js.map +1 -1
  231. package/dist/convex/integrations/billing/passes.d.ts +2 -2
  232. package/dist/convex/integrations/billing/passes.d.ts.map +1 -1
  233. package/dist/convex/integrations/billing/passes.js +5 -13
  234. package/dist/convex/integrations/billing/passes.js.map +1 -1
  235. package/dist/convex/integrations/billing/pricing.d.ts +9 -2
  236. package/dist/convex/integrations/billing/pricing.d.ts.map +1 -1
  237. package/dist/convex/integrations/billing/pricing.js +38 -4
  238. package/dist/convex/integrations/billing/pricing.js.map +1 -1
  239. package/dist/convex/integrations/billing/provider-failure.d.ts +17 -0
  240. package/dist/convex/integrations/billing/provider-failure.d.ts.map +1 -0
  241. package/dist/convex/integrations/billing/provider-failure.js +52 -0
  242. package/dist/convex/integrations/billing/provider-failure.js.map +1 -0
  243. package/dist/convex/integrations/billing/quotas.d.ts.map +1 -1
  244. package/dist/convex/integrations/billing/rate-limit.d.ts +16 -0
  245. package/dist/convex/integrations/billing/rate-limit.d.ts.map +1 -0
  246. package/dist/convex/integrations/billing/rate-limit.js +45 -0
  247. package/dist/convex/integrations/billing/rate-limit.js.map +1 -0
  248. package/dist/convex/integrations/billing/referral-orders.d.ts +1 -1
  249. package/dist/convex/integrations/billing/referral-orders.js +1 -1
  250. package/dist/convex/integrations/billing/resync.d.ts +28 -0
  251. package/dist/convex/integrations/billing/resync.d.ts.map +1 -0
  252. package/dist/convex/integrations/billing/resync.js +139 -0
  253. package/dist/convex/integrations/billing/resync.js.map +1 -0
  254. package/dist/convex/integrations/billing/subscriptions.d.ts +1 -1
  255. package/dist/convex/integrations/billing/subscriptions.d.ts.map +1 -1
  256. package/dist/convex/integrations/billing/subscriptions.js +6 -2
  257. package/dist/convex/integrations/billing/subscriptions.js.map +1 -1
  258. package/dist/convex/integrations/billing/types/lifecycle.d.ts +1 -1
  259. package/dist/convex/integrations/billing/types/records.d.ts +68 -3
  260. package/dist/convex/integrations/billing/types/records.d.ts.map +1 -1
  261. package/dist/convex/integrations/billing/types/setup.d.ts +10 -4
  262. package/dist/convex/integrations/billing/types/setup.d.ts.map +1 -1
  263. package/dist/convex/integrations/billing/types/surface.d.ts +47 -6
  264. package/dist/convex/integrations/billing/types/surface.d.ts.map +1 -1
  265. package/dist/convex/integrations/billing/webhooks.js +2 -2
  266. package/dist/convex/integrations/billing/welcome.d.ts +16 -0
  267. package/dist/convex/integrations/billing/welcome.d.ts.map +1 -0
  268. package/dist/convex/integrations/billing/welcome.js +93 -0
  269. package/dist/convex/integrations/billing/welcome.js.map +1 -0
  270. package/dist/convex/integrations/billing.d.ts +3 -2
  271. package/dist/convex/integrations/billing.d.ts.map +1 -1
  272. package/dist/convex/integrations/billing.js +17 -5
  273. package/dist/convex/integrations/billing.js.map +1 -1
  274. package/dist/convex/integrations/email-sync.d.ts +24 -2
  275. package/dist/convex/integrations/email-sync.d.ts.map +1 -1
  276. package/dist/convex/integrations/email-sync.js +54 -23
  277. package/dist/convex/integrations/email-sync.js.map +1 -1
  278. package/dist/convex/integrations/email.d.ts +17 -3
  279. package/dist/convex/integrations/email.d.ts.map +1 -1
  280. package/dist/convex/integrations/email.js.map +1 -1
  281. package/dist/convex/integrations/functions.d.ts +2 -2
  282. package/dist/convex/integrations/functions.d.ts.map +1 -1
  283. package/dist/convex/integrations/functions.js +1 -1
  284. package/dist/convex/integrations/functions.js.map +1 -1
  285. package/dist/convex/integrations/inbound.d.ts +16 -7
  286. package/dist/convex/integrations/inbound.d.ts.map +1 -1
  287. package/dist/convex/integrations/inbound.js +21 -10
  288. package/dist/convex/integrations/inbound.js.map +1 -1
  289. package/dist/convex/integrations/launch.d.ts +124 -3
  290. package/dist/convex/integrations/launch.d.ts.map +1 -1
  291. package/dist/convex/integrations/launch.js +172 -22
  292. package/dist/convex/integrations/launch.js.map +1 -1
  293. package/dist/convex/integrations/notifications.d.ts +6 -2
  294. package/dist/convex/integrations/notifications.d.ts.map +1 -1
  295. package/dist/convex/integrations/notifications.js +13 -15
  296. package/dist/convex/integrations/notifications.js.map +1 -1
  297. package/dist/convex/integrations/rate-limit.d.ts +18 -0
  298. package/dist/convex/integrations/rate-limit.d.ts.map +1 -1
  299. package/dist/convex/integrations/rate-limit.js +18 -3
  300. package/dist/convex/integrations/rate-limit.js.map +1 -1
  301. package/dist/convex/integrations/referrals.d.ts +20 -0
  302. package/dist/convex/integrations/referrals.d.ts.map +1 -1
  303. package/dist/convex/integrations/referrals.js +14 -9
  304. package/dist/convex/integrations/referrals.js.map +1 -1
  305. package/dist/convex/integrations/reports.d.ts +4 -1
  306. package/dist/convex/integrations/reports.d.ts.map +1 -1
  307. package/dist/convex/integrations/reports.js +14 -3
  308. package/dist/convex/integrations/reports.js.map +1 -1
  309. package/dist/convex/integrations/retention.d.ts +42 -4
  310. package/dist/convex/integrations/retention.d.ts.map +1 -1
  311. package/dist/convex/integrations/retention.js +62 -4
  312. package/dist/convex/integrations/retention.js.map +1 -1
  313. package/dist/convex/integrations/storage.d.ts +138 -3
  314. package/dist/convex/integrations/storage.d.ts.map +1 -1
  315. package/dist/convex/integrations/storage.js +64 -5
  316. package/dist/convex/integrations/storage.js.map +1 -1
  317. package/dist/convex/label-format.d.ts +2 -2
  318. package/dist/convex/label-format.d.ts.map +1 -1
  319. package/dist/convex/label-format.js +2 -2
  320. package/dist/convex/label-format.js.map +1 -1
  321. package/dist/convex/label-groups/admin.d.ts +30 -0
  322. package/dist/convex/label-groups/admin.d.ts.map +1 -1
  323. package/dist/convex/label-groups/admin.js +31 -0
  324. package/dist/convex/label-groups/admin.js.map +1 -1
  325. package/dist/convex/label-groups/audit.d.ts +1 -0
  326. package/dist/convex/label-groups/audit.d.ts.map +1 -1
  327. package/dist/convex/label-groups/audit.js +1 -0
  328. package/dist/convex/label-groups/audit.js.map +1 -1
  329. package/dist/convex/label-groups/auth.d.ts +7 -0
  330. package/dist/convex/label-groups/auth.d.ts.map +1 -1
  331. package/dist/convex/label-groups/auth.js +7 -0
  332. package/dist/convex/label-groups/auth.js.map +1 -1
  333. package/dist/convex/label-groups/cancelFlow.d.ts +1 -1
  334. package/dist/convex/label-groups/cancelFlow.js +2 -2
  335. package/dist/convex/label-groups/cancelFlow.js.map +1 -1
  336. package/dist/convex/label-groups/email.d.ts.map +1 -1
  337. package/dist/convex/label-groups/email.js +2 -1
  338. package/dist/convex/label-groups/email.js.map +1 -1
  339. package/dist/convex/label-groups/errors.d.ts +13 -0
  340. package/dist/convex/label-groups/errors.d.ts.map +1 -1
  341. package/dist/convex/label-groups/errors.js +18 -1
  342. package/dist/convex/label-groups/errors.js.map +1 -1
  343. package/dist/convex/label-groups/gift.d.ts +26 -0
  344. package/dist/convex/label-groups/gift.d.ts.map +1 -1
  345. package/dist/convex/label-groups/gift.js +32 -2
  346. package/dist/convex/label-groups/gift.js.map +1 -1
  347. package/dist/convex/label-groups/legal.d.ts +28 -2
  348. package/dist/convex/label-groups/legal.d.ts.map +1 -1
  349. package/dist/convex/label-groups/legal.js +31 -0
  350. package/dist/convex/label-groups/legal.js.map +1 -1
  351. package/dist/convex/label-groups/notifications.d.ts +3 -1
  352. package/dist/convex/label-groups/notifications.d.ts.map +1 -1
  353. package/dist/convex/label-groups/notifications.js +5 -3
  354. package/dist/convex/label-groups/notifications.js.map +1 -1
  355. package/dist/convex/label-groups/pastDue.d.ts +1 -1
  356. package/dist/convex/label-groups/pastDue.d.ts.map +1 -1
  357. package/dist/convex/label-groups/pastDue.js +1 -1
  358. package/dist/convex/label-groups/pastDue.js.map +1 -1
  359. package/dist/convex/label-groups/pricing.d.ts +17 -0
  360. package/dist/convex/label-groups/pricing.d.ts.map +1 -1
  361. package/dist/convex/label-groups/pricing.js +24 -0
  362. package/dist/convex/label-groups/pricing.js.map +1 -1
  363. package/dist/convex/label-groups/referral.d.ts +6 -2
  364. package/dist/convex/label-groups/referral.d.ts.map +1 -1
  365. package/dist/convex/label-groups/referral.js +6 -2
  366. package/dist/convex/label-groups/referral.js.map +1 -1
  367. package/dist/convex/label-groups/report.d.ts +8 -1
  368. package/dist/convex/label-groups/report.d.ts.map +1 -1
  369. package/dist/convex/label-groups/report.js +10 -1
  370. package/dist/convex/label-groups/report.js.map +1 -1
  371. package/dist/convex/label-groups/settings.d.ts +34 -0
  372. package/dist/convex/label-groups/settings.d.ts.map +1 -1
  373. package/dist/convex/label-groups/settings.js +39 -0
  374. package/dist/convex/label-groups/settings.js.map +1 -1
  375. package/dist/convex/label-groups/upload.d.ts +1 -0
  376. package/dist/convex/label-groups/upload.d.ts.map +1 -1
  377. package/dist/convex/label-groups/upload.js +2 -0
  378. package/dist/convex/label-groups/upload.js.map +1 -1
  379. package/dist/convex/label-groups/waitlist.d.ts +5 -0
  380. package/dist/convex/label-groups/waitlist.d.ts.map +1 -1
  381. package/dist/convex/label-groups/waitlist.js +7 -2
  382. package/dist/convex/label-groups/waitlist.js.map +1 -1
  383. package/dist/convex/label-groups/withdrawal.d.ts +1 -1
  384. package/dist/convex/label-groups/withdrawal.js +1 -1
  385. package/dist/convex/label-translations.d.ts.map +1 -1
  386. package/dist/convex/label-translations.js +94 -34
  387. package/dist/convex/label-translations.js.map +1 -1
  388. package/dist/convex/labels.d.ts +203 -2
  389. package/dist/convex/labels.d.ts.map +1 -1
  390. package/dist/convex/legal.d.ts +30 -3
  391. package/dist/convex/legal.d.ts.map +1 -1
  392. package/dist/convex/legal.js +19 -4
  393. package/dist/convex/legal.js.map +1 -1
  394. package/dist/convex/log.js +20 -1
  395. package/dist/convex/log.js.map +1 -1
  396. package/dist/convex/money.d.ts +10 -0
  397. package/dist/convex/money.d.ts.map +1 -0
  398. package/dist/convex/money.js +37 -0
  399. package/dist/convex/money.js.map +1 -0
  400. package/dist/convex/monitoring.d.ts +6 -4
  401. package/dist/convex/monitoring.d.ts.map +1 -1
  402. package/dist/convex/monitoring.js +6 -4
  403. package/dist/convex/monitoring.js.map +1 -1
  404. package/dist/convex/report-rules.d.ts +8 -0
  405. package/dist/convex/report-rules.d.ts.map +1 -1
  406. package/dist/convex/report-rules.js +17 -0
  407. package/dist/convex/report-rules.js.map +1 -1
  408. package/dist/convex/sensitive-actions.d.ts.map +1 -1
  409. package/dist/convex/sensitive-actions.js +1 -0
  410. package/dist/convex/sensitive-actions.js.map +1 -1
  411. package/dist/convex/test-billing.d.ts +83 -0
  412. package/dist/convex/test-billing.d.ts.map +1 -0
  413. package/dist/convex/test-billing.js +131 -0
  414. package/dist/convex/test-billing.js.map +1 -0
  415. package/dist/convex/test-models.d.ts +21 -2
  416. package/dist/convex/test-models.d.ts.map +1 -1
  417. package/dist/convex/test-models.js +86 -6
  418. package/dist/convex/test-models.js.map +1 -1
  419. package/dist/convex/test-moderation.d.ts +24 -0
  420. package/dist/convex/test-moderation.d.ts.map +1 -0
  421. package/dist/convex/test-moderation.js +114 -0
  422. package/dist/convex/test-moderation.js.map +1 -0
  423. package/dist/devtools-client/_nuxt/CiCAOwUc.js +5 -0
  424. package/dist/devtools-client/index.html +1 -1
  425. package/dist/env-registry.js +37 -5
  426. package/dist/eslint.d.mts +2 -1
  427. package/dist/eslint.mjs +2 -1
  428. package/dist/module.d.ts +96 -3
  429. package/dist/module.js +2 -2
  430. package/dist/module.json +1 -1
  431. package/dist/runtime/chunk-recovery.d.ts +13 -0
  432. package/dist/runtime/chunk-recovery.js +1 -0
  433. package/dist/runtime/config.d.ts +95 -14
  434. package/dist/runtime/config.js +13 -1
  435. package/dist/runtime/locales/de.json +208 -26
  436. package/dist/runtime/locales/en.json +207 -25
  437. package/dist/runtime/locales/es.json +206 -24
  438. package/dist/runtime/locales/fr.json +206 -24
  439. package/dist/runtime/locales/ru.json +206 -24
  440. package/dist/runtime/monitoring/sdk/sentry.client.config.js +2 -1
  441. package/dist/runtime/monitoring/sdk/sentry.server.config.js +6 -1
  442. package/dist/runtime/server/chunk-recovery.d.ts +49 -0
  443. package/dist/runtime/server/chunk-recovery.js +44 -0
  444. package/dist/runtime/server/content-wasm.d.ts +13 -0
  445. package/dist/runtime/server/content-wasm.js +9 -0
  446. package/dist/runtime/server/csp.d.ts +22 -0
  447. package/dist/runtime/server/csp.js +18 -0
  448. package/dist/runtime/server/monitoring/csp.d.ts +12 -0
  449. package/dist/runtime/server/monitoring/csp.js +19 -0
  450. package/dist/runtime/server/photo-decoder-csp.d.ts +17 -0
  451. package/dist/runtime/server/photo-decoder-csp.js +9 -0
  452. package/dist/runtime/server/protection/csp.d.ts +1 -7
  453. package/dist/runtime/server/protection/csp.js +4 -17
  454. package/dist/runtime/test-utils/aliases.d.ts +6 -4
  455. package/dist/runtime/test-utils/aliases.js +3 -9
  456. package/dist/runtime/test-utils/base-modules.d.ts +9 -13
  457. package/dist/runtime/test-utils/install.js +4 -2
  458. package/dist/runtime/vue/a11y.js +1 -1
  459. package/dist/runtime/vue/auth-client.d.ts +8 -5
  460. package/dist/runtime/vue/components/account/AccountData.vue +2 -0
  461. package/dist/runtime/vue/components/account/AccountDeletion.css +1 -1
  462. package/dist/runtime/vue/components/account/ActivationChecklist.css +1 -1
  463. package/dist/runtime/vue/components/account/ActivationChecklist.vue +1 -0
  464. package/dist/runtime/vue/components/account/ConsentPrompt.css +1 -1
  465. package/dist/runtime/vue/components/account/ConsentPromptDialog.vue +1 -0
  466. package/dist/runtime/vue/components/account/ConsentPromptStorage.vue +1 -0
  467. package/dist/runtime/vue/components/account/EmailUnsubscribe.css +1 -1
  468. package/dist/runtime/vue/components/account/EmailUnsubscribe.vue +2 -2
  469. package/dist/runtime/vue/components/account/HowDidYouHear.css +1 -1
  470. package/dist/runtime/vue/components/account/HowDidYouHear.vue +1 -0
  471. package/dist/runtime/vue/components/account/KeepAccount.css +1 -1
  472. package/dist/runtime/vue/components/account/OnboardingFlow.css +1 -1
  473. package/dist/runtime/vue/components/account/OnboardingFlow.vue +1 -0
  474. package/dist/runtime/vue/components/account/ProfileIdentity.css +1 -1
  475. package/dist/runtime/vue/components/account/ProfilePreferencesSection.css +1 -1
  476. package/dist/runtime/vue/components/account/ProfilePreferencesSection.vue +3 -1
  477. package/dist/runtime/vue/components/account/ProfileSettings.css +1 -1
  478. package/dist/runtime/vue/components/account/ProfileSettings.vue +1 -0
  479. package/dist/runtime/vue/components/account/SecurityAlerts.css +1 -1
  480. package/dist/runtime/vue/components/account/SecurityAlerts.vue +2 -1
  481. package/dist/runtime/vue/components/account/SecurityPasskeys.css +1 -1
  482. package/dist/runtime/vue/components/account/SecuritySessions.css +1 -1
  483. package/dist/runtime/vue/components/account/SecuritySettings.css +1 -1
  484. package/dist/runtime/vue/components/account/SecuritySettings.vue +1 -0
  485. package/dist/runtime/vue/components/account/security-alerts.d.ts +7 -0
  486. package/dist/runtime/vue/components/account/security-alerts.js +6 -2
  487. package/dist/runtime/vue/components/admin/AdminAccess.css +1 -1
  488. package/dist/runtime/vue/components/admin/AdminAccess.vue +2 -0
  489. package/dist/runtime/vue/components/admin/AdminAccessMemberTickets.d.vue.ts +7 -0
  490. package/dist/runtime/vue/components/admin/AdminAccessMemberTickets.vue +42 -0
  491. package/dist/runtime/vue/components/admin/AdminAccessMemberTickets.vue.d.ts +7 -0
  492. package/dist/runtime/vue/components/admin/AdminAnnouncements.css +1 -1
  493. package/dist/runtime/vue/components/admin/AdminBilling.css +1 -1
  494. package/dist/runtime/vue/components/admin/AdminChart.css +1 -1
  495. package/dist/runtime/vue/components/admin/AdminConsole.css +1 -1
  496. package/dist/runtime/vue/components/admin/AdminExperiments.css +1 -1
  497. package/dist/runtime/vue/components/admin/AdminFlags.css +1 -1
  498. package/dist/runtime/vue/components/admin/AdminModeration.d.vue.ts +3 -0
  499. package/dist/runtime/vue/components/admin/AdminModeration.vue +135 -0
  500. package/dist/runtime/vue/components/admin/AdminModeration.vue.d.ts +3 -0
  501. package/dist/runtime/vue/components/admin/AdminQueue.css +1 -1
  502. package/dist/runtime/vue/components/admin/AdminQueueJob.vue +5 -2
  503. package/dist/runtime/vue/components/admin/AdminReferrals.css +1 -1
  504. package/dist/runtime/vue/components/admin/AdminReports.css +1 -1
  505. package/dist/runtime/vue/components/admin/AdminRevenue.css +1 -1
  506. package/dist/runtime/vue/components/admin/AdminUsers.d.vue.ts +30 -0
  507. package/dist/runtime/vue/components/admin/AdminUsers.vue +1 -0
  508. package/dist/runtime/vue/components/admin/AdminUsers.vue.d.ts +30 -0
  509. package/dist/runtime/vue/components/admin/AdminWorkspaces.d.vue.ts +30 -0
  510. package/dist/runtime/vue/components/admin/AdminWorkspaces.vue +1 -0
  511. package/dist/runtime/vue/components/admin/AdminWorkspaces.vue.d.ts +30 -0
  512. package/dist/runtime/vue/components/admin/admin-access-tab.js +2 -1
  513. package/dist/runtime/vue/components/admin/admin-moderation-tab.d.ts +1 -0
  514. package/dist/runtime/vue/components/admin/admin-moderation-tab.js +34 -0
  515. package/dist/runtime/vue/components/admin/admin-revenue-tab.js +4 -1
  516. package/dist/runtime/vue/components/admin/admin-tabs.js +2 -0
  517. package/dist/runtime/vue/components/admin/admin.css +1 -1
  518. package/dist/runtime/vue/components/auth/AuthForm.css +1 -1
  519. package/dist/runtime/vue/components/auth/AuthForm.d.vue.ts +7 -0
  520. package/dist/runtime/vue/components/auth/AuthForm.vue +4 -4
  521. package/dist/runtime/vue/components/auth/AuthForm.vue.d.ts +7 -0
  522. package/dist/runtime/vue/components/auth/AuthFormChoose.css +1 -1
  523. package/dist/runtime/vue/components/auth/AuthFormHeader.css +1 -1
  524. package/dist/runtime/vue/components/auth/AuthFormPasskeyOffer.css +1 -1
  525. package/dist/runtime/vue/components/auth/InviteRedeem.css +1 -1
  526. package/dist/runtime/vue/components/auth/InviteRedeem.vue +95 -8
  527. package/dist/runtime/vue/components/auth/ReauthenticateCode.css +1 -1
  528. package/dist/runtime/vue/components/auth/ReauthenticateDialog.css +1 -1
  529. package/dist/runtime/vue/components/auth/ReauthenticateDialog.vue +3 -2
  530. package/dist/runtime/vue/components/auth/ReauthenticatePasskey.css +1 -1
  531. package/dist/runtime/vue/components/auth/WaitlistForm.css +1 -1
  532. package/dist/runtime/vue/components/auth/WaitlistForm.d.vue.ts +5 -0
  533. package/dist/runtime/vue/components/auth/WaitlistForm.vue +4 -5
  534. package/dist/runtime/vue/components/auth/WaitlistForm.vue.d.ts +5 -0
  535. package/dist/runtime/vue/components/auth/WaitlistPlace.css +1 -1
  536. package/dist/runtime/vue/components/auth/WaitlistShare.css +1 -1
  537. package/dist/runtime/vue/components/auth/WaitlistShare.vue +1 -7
  538. package/dist/runtime/vue/components/auth/WaitlistStatus.css +1 -1
  539. package/dist/runtime/vue/components/auth/WaitlistStatus.vue +120 -23
  540. package/dist/runtime/vue/components/auth/auth-form.d.ts +1 -1
  541. package/dist/runtime/vue/components/auth/waitlist-form.js +1 -1
  542. package/dist/runtime/vue/components/billing/BillingCheckoutLink.vue +2 -0
  543. package/dist/runtime/vue/components/billing/BillingHistory.css +1 -1
  544. package/dist/runtime/vue/components/billing/BillingHistory.vue +1 -0
  545. package/dist/runtime/vue/components/billing/BillingHistoryOrder.css +1 -1
  546. package/dist/runtime/vue/components/billing/BillingPortalLink.vue +1 -0
  547. package/dist/runtime/vue/components/billing/CancelConfirmGroup.vue +2 -7
  548. package/dist/runtime/vue/components/billing/CancelFlow.css +1 -1
  549. package/dist/runtime/vue/components/billing/CancelFlow.vue +1 -0
  550. package/dist/runtime/vue/components/billing/CancelFlowEnd.vue +3 -1
  551. package/dist/runtime/vue/components/billing/GiftForm.css +1 -0
  552. package/dist/runtime/vue/components/billing/GiftForm.d.vue.ts +105 -0
  553. package/dist/runtime/vue/components/billing/GiftForm.vue +228 -0
  554. package/dist/runtime/vue/components/billing/GiftForm.vue.d.ts +105 -0
  555. package/dist/runtime/vue/components/billing/GiftList.css +1 -1
  556. package/dist/runtime/vue/components/billing/GiftList.d.vue.ts +87 -2
  557. package/dist/runtime/vue/components/billing/GiftList.vue +7 -4
  558. package/dist/runtime/vue/components/billing/GiftList.vue.d.ts +87 -2
  559. package/dist/runtime/vue/components/billing/GiftReceived.vue +11 -3
  560. package/dist/runtime/vue/components/billing/PlanChangeConfirmGroup.d.vue.ts +7 -0
  561. package/dist/runtime/vue/components/billing/PlanChangeConfirmGroup.vue +50 -0
  562. package/dist/runtime/vue/components/billing/PlanChangeConfirmGroup.vue.d.ts +7 -0
  563. package/dist/runtime/vue/components/billing/PricingChangeConfirm.d.vue.ts +4 -0
  564. package/dist/runtime/vue/components/billing/PricingChangeConfirm.vue +17 -0
  565. package/dist/runtime/vue/components/billing/PricingChangeConfirm.vue.d.ts +4 -0
  566. package/dist/runtime/vue/components/billing/PricingPackCard.css +1 -1
  567. package/dist/runtime/vue/components/billing/PricingPlanCard.css +1 -1
  568. package/dist/runtime/vue/components/billing/PricingPlanCard.vue +23 -1
  569. package/dist/runtime/vue/components/billing/PricingTable.css +1 -1
  570. package/dist/runtime/vue/components/billing/PricingTable.d.vue.ts +26 -2
  571. package/dist/runtime/vue/components/billing/PricingTable.vue +106 -20
  572. package/dist/runtime/vue/components/billing/PricingTable.vue.d.ts +26 -2
  573. package/dist/runtime/vue/components/billing/ReferralCard.css +1 -1
  574. package/dist/runtime/vue/components/billing/ReferralCard.d.vue.ts +4 -0
  575. package/dist/runtime/vue/components/billing/ReferralCard.vue +1 -0
  576. package/dist/runtime/vue/components/billing/ReferralCard.vue.d.ts +4 -0
  577. package/dist/runtime/vue/components/billing/ReferralLanding.css +1 -1
  578. package/dist/runtime/vue/components/billing/ReferralLanding.vue +44 -2
  579. package/dist/runtime/vue/components/billing/UpgradePrompt.css +1 -1
  580. package/dist/runtime/vue/components/billing/UpgradePrompt.vue +1 -0
  581. package/dist/runtime/vue/components/billing/UsageHistory.css +1 -1
  582. package/dist/runtime/vue/components/billing/UsageHistory.vue +1 -0
  583. package/dist/runtime/vue/components/billing/WithdrawalButton.css +1 -1
  584. package/dist/runtime/vue/components/billing/WithdrawalButton.vue +1 -0
  585. package/dist/runtime/vue/components/billing/cancel-flow.js +2 -1
  586. package/dist/runtime/vue/components/billing/pricing-table.d.ts +16 -0
  587. package/dist/runtime/vue/components/billing/withdrawal-button.d.ts +3 -2
  588. package/dist/runtime/vue/components/billing/withdrawal-button.js +13 -33
  589. package/dist/runtime/vue/components/shared.css +1 -1
  590. package/dist/runtime/vue/components/shell/AccessDenied.css +1 -1
  591. package/dist/runtime/vue/components/shell/AccessDenied.vue +1 -0
  592. package/dist/runtime/vue/components/shell/AccountMenu.vue +1 -0
  593. package/dist/runtime/vue/components/shell/AiLabel.css +1 -1
  594. package/dist/runtime/vue/components/shell/AiLabel.vue +4 -1
  595. package/dist/runtime/vue/components/shell/AppShell.css +1 -1
  596. package/dist/runtime/vue/components/shell/AppShell.vue +3 -0
  597. package/dist/runtime/vue/components/shell/BackendNotices.vue +1 -0
  598. package/dist/runtime/vue/components/shell/ConfirmDialog.css +1 -1
  599. package/dist/runtime/vue/components/shell/ConnectionStatus.css +1 -1
  600. package/dist/runtime/vue/components/shell/ConnectionStatus.vue +1 -0
  601. package/dist/runtime/vue/components/shell/ContactForm.css +1 -1
  602. package/dist/runtime/vue/components/shell/ContactForm.vue +1 -0
  603. package/dist/runtime/vue/components/shell/FrameMain.vue +2 -0
  604. package/dist/runtime/vue/components/shell/Gate.css +1 -1
  605. package/dist/runtime/vue/components/shell/Gate.vue +2 -0
  606. package/dist/runtime/vue/components/shell/GateQuota.vue +1 -0
  607. package/dist/runtime/vue/components/shell/LegalCompany.d.vue.ts +3 -0
  608. package/dist/runtime/vue/components/shell/LegalCompany.vue +23 -0
  609. package/dist/runtime/vue/components/shell/LegalCompany.vue.d.ts +3 -0
  610. package/dist/runtime/vue/components/shell/LegalContactPoints.d.vue.ts +10 -0
  611. package/dist/runtime/vue/components/shell/LegalContactPoints.vue +51 -0
  612. package/dist/runtime/vue/components/shell/LegalContactPoints.vue.d.ts +10 -0
  613. package/dist/runtime/vue/components/shell/LegalDetail.d.vue.ts +11 -0
  614. package/dist/runtime/vue/components/shell/LegalDetail.vue +30 -0
  615. package/dist/runtime/vue/components/shell/LegalDetail.vue.d.ts +11 -0
  616. package/dist/runtime/vue/components/shell/LegalDocument.css +1 -1
  617. package/dist/runtime/vue/components/shell/LegalDocument.vue +49 -13
  618. package/dist/runtime/vue/components/shell/LegalModeration.d.vue.ts +8 -0
  619. package/dist/runtime/vue/components/shell/LegalModeration.vue +72 -0
  620. package/dist/runtime/vue/components/shell/LegalModeration.vue.d.ts +8 -0
  621. package/dist/runtime/vue/components/shell/LegalProcessors.d.vue.ts +3 -2
  622. package/dist/runtime/vue/components/shell/LegalProcessors.vue +46 -15
  623. package/dist/runtime/vue/components/shell/LegalProcessors.vue.d.ts +3 -2
  624. package/dist/runtime/vue/components/shell/LegalStorage.d.vue.ts +3 -2
  625. package/dist/runtime/vue/components/shell/LegalStorage.vue +49 -16
  626. package/dist/runtime/vue/components/shell/LegalStorage.vue.d.ts +3 -2
  627. package/dist/runtime/vue/components/shell/LegalVersion.d.vue.ts +10 -0
  628. package/dist/runtime/vue/components/shell/LegalVersion.vue +24 -0
  629. package/dist/runtime/vue/components/shell/LegalVersion.vue.d.ts +10 -0
  630. package/dist/runtime/vue/components/shell/NoticeAnnouncement.css +1 -1
  631. package/dist/runtime/vue/components/shell/NoticeDeletion.css +1 -1
  632. package/dist/runtime/vue/components/shell/NoticeGift.css +1 -1
  633. package/dist/runtime/vue/components/shell/NoticeGift.vue +7 -4
  634. package/dist/runtime/vue/components/shell/NoticeImpersonation.css +1 -1
  635. package/dist/runtime/vue/components/shell/NoticeLowCredits.css +1 -1
  636. package/dist/runtime/vue/components/shell/NoticeMaintenance.css +1 -1
  637. package/dist/runtime/vue/components/shell/NoticePastDue.css +1 -1
  638. package/dist/runtime/vue/components/shell/NotificationInbox.css +1 -1
  639. package/dist/runtime/vue/components/shell/NotificationInbox.vue +1 -0
  640. package/dist/runtime/vue/components/shell/ReportAppeal.vue +16 -13
  641. package/dist/runtime/vue/components/shell/ReportNotice.css +1 -1
  642. package/dist/runtime/vue/components/shell/UploadField.css +1 -1
  643. package/dist/runtime/vue/components/shell/UploadField.d.vue.ts +2 -0
  644. package/dist/runtime/vue/components/shell/UploadField.vue +16 -3
  645. package/dist/runtime/vue/components/shell/UploadField.vue.d.ts +2 -0
  646. package/dist/runtime/vue/components/shell/WorkspaceSwitcher.css +1 -1
  647. package/dist/runtime/vue/components/shell/WorkspaceSwitcher.vue +1 -0
  648. package/dist/runtime/vue/components/shell/legal.d.ts +35 -4
  649. package/dist/runtime/vue/components/shell/legal.js +126 -13
  650. package/dist/runtime/vue/components/shell/report-form.js +1 -44
  651. package/dist/runtime/vue/components/shell/upload-field.d.ts +3 -1
  652. package/dist/runtime/vue/components/tokens.css +1 -1
  653. package/dist/runtime/vue/components/workspaces/AcceptInvitation.vue +1 -0
  654. package/dist/runtime/vue/components/workspaces/AuditLog.css +1 -1
  655. package/dist/runtime/vue/components/workspaces/AuditLog.d.vue.ts +1 -0
  656. package/dist/runtime/vue/components/workspaces/AuditLog.vue +1 -0
  657. package/dist/runtime/vue/components/workspaces/AuditLog.vue.d.ts +1 -0
  658. package/dist/runtime/vue/components/workspaces/WorkspaceBilling.css +1 -1
  659. package/dist/runtime/vue/components/workspaces/WorkspaceBilling.vue +29 -50
  660. package/dist/runtime/vue/components/workspaces/WorkspaceBillingPause.d.vue.ts +3 -0
  661. package/dist/runtime/vue/components/workspaces/WorkspaceBillingPause.vue +69 -0
  662. package/dist/runtime/vue/components/workspaces/WorkspaceBillingPause.vue.d.ts +3 -0
  663. package/dist/runtime/vue/components/workspaces/WorkspaceBillingSwitch.d.vue.ts +3 -0
  664. package/dist/runtime/vue/components/workspaces/WorkspaceBillingSwitch.vue +54 -0
  665. package/dist/runtime/vue/components/workspaces/WorkspaceBillingSwitch.vue.d.ts +3 -0
  666. package/dist/runtime/vue/components/workspaces/WorkspaceCredits.css +1 -1
  667. package/dist/runtime/vue/components/workspaces/WorkspaceList.css +1 -1
  668. package/dist/runtime/vue/components/workspaces/WorkspaceSettings.d.vue.ts +40 -2
  669. package/dist/runtime/vue/components/workspaces/WorkspaceSettings.vue +33 -1
  670. package/dist/runtime/vue/components/workspaces/WorkspaceSettings.vue.d.ts +40 -2
  671. package/dist/runtime/vue/components/workspaces/workspace-billing.d.ts +39 -2
  672. package/dist/runtime/vue/components/workspaces/workspace-billing.js +94 -2
  673. package/dist/runtime/vue/components/workspaces/workspace-settings.d.ts +4 -0
  674. package/dist/runtime/vue/composables/billing-format.d.ts +9 -4
  675. package/dist/runtime/vue/composables/billing-format.js +17 -9
  676. package/dist/runtime/vue/composables/billing-provider.js +3 -2
  677. package/dist/runtime/vue/composables/prepare-photo.d.ts +75 -0
  678. package/dist/runtime/vue/composables/prepare-photo.js +223 -0
  679. package/dist/runtime/vue/composables/use-access.d.ts +72 -6
  680. package/dist/runtime/vue/composables/use-access.js +57 -2
  681. package/dist/runtime/vue/composables/use-billing.d.ts +82 -10
  682. package/dist/runtime/vue/composables/use-billing.js +48 -0
  683. package/dist/runtime/vue/composables/use-email-link.d.ts +55 -4
  684. package/dist/runtime/vue/composables/use-email-link.js +9 -9
  685. package/dist/runtime/vue/composables/use-gift-form.d.ts +123 -0
  686. package/dist/runtime/vue/composables/use-gift-form.js +169 -0
  687. package/dist/runtime/vue/composables/use-gift-list.d.ts +44 -4
  688. package/dist/runtime/vue/composables/use-gift-list.js +13 -5
  689. package/dist/runtime/vue/composables/use-install-prompt.d.ts +71 -0
  690. package/dist/runtime/vue/composables/use-install-prompt.js +53 -0
  691. package/dist/runtime/vue/composables/use-labels.js +29 -30
  692. package/dist/runtime/vue/composables/use-login-flow.d.ts +9 -0
  693. package/dist/runtime/vue/composables/use-login-flow.js +8 -1
  694. package/dist/runtime/vue/composables/use-notifications.js +3 -0
  695. package/dist/runtime/vue/composables/use-orders.d.ts +1 -1
  696. package/dist/runtime/vue/composables/use-passkeys.js +2 -2
  697. package/dist/runtime/vue/composables/use-pricing.d.ts +69 -5
  698. package/dist/runtime/vue/composables/use-pricing.js +41 -10
  699. package/dist/runtime/vue/composables/use-push-subscription.js +1 -7
  700. package/dist/runtime/vue/composables/use-referral-invite.d.ts +48 -4
  701. package/dist/runtime/vue/composables/use-referral-invite.js +30 -10
  702. package/dist/runtime/vue/composables/use-referrals.js +2 -1
  703. package/dist/runtime/vue/composables/use-report-appeal.d.ts +86 -0
  704. package/dist/runtime/vue/composables/use-report-appeal.js +61 -0
  705. package/dist/runtime/vue/composables/use-report-form.d.ts +178 -0
  706. package/dist/runtime/vue/composables/use-report-form.js +278 -0
  707. package/dist/runtime/vue/composables/use-return-path.d.ts +5 -4
  708. package/dist/runtime/vue/composables/use-return-path.js +16 -2
  709. package/dist/runtime/vue/composables/use-sign-in-alerts.d.ts +85 -0
  710. package/dist/runtime/vue/composables/use-sign-in-alerts.js +70 -0
  711. package/dist/runtime/vue/composables/use-upload-field.d.ts +32 -6
  712. package/dist/runtime/vue/composables/use-upload-field.js +75 -36
  713. package/dist/runtime/vue/composables/use-waitlist.d.ts +21 -2
  714. package/dist/runtime/vue/composables/use-waitlist.js +29 -5
  715. package/dist/runtime/vue/composables/use-withdrawal.d.ts +63 -0
  716. package/dist/runtime/vue/composables/use-withdrawal.js +38 -0
  717. package/dist/runtime/vue/middleware/page-access.js +2 -2
  718. package/dist/runtime/vue/pages/gifts.vue +11 -0
  719. package/dist/runtime/vue/pages/login.vue +5 -7
  720. package/dist/runtime/vue/pages/report.vue +2 -3
  721. package/dist/runtime/vue/parts.d.ts +5 -0
  722. package/dist/runtime/vue/passkey-ceremony.d.ts +42 -0
  723. package/dist/runtime/vue/passkey-ceremony.js +37 -0
  724. package/dist/runtime/vue/passkey-client.d.ts +11 -49
  725. package/dist/runtime/vue/passkey-client.js +2 -34
  726. package/dist/runtime/vue/plugins/checkout-return.d.ts +5 -4
  727. package/dist/runtime/vue/plugins/checkout-return.js +1 -1
  728. package/dist/runtime/vue/plugins/chunk-recovery.client.d.ts +10 -0
  729. package/dist/runtime/vue/plugins/chunk-recovery.client.js +10 -0
  730. package/dist/runtime/vue/plugins/install-banner.client.d.ts +7 -0
  731. package/dist/runtime/vue/plugins/install-banner.client.js +5 -0
  732. package/dist/runtime/vue/plugins/install-prompt.client.d.ts +7 -0
  733. package/dist/runtime/vue/plugins/install-prompt.client.js +6 -0
  734. package/dist/runtime/vue/plugins/passkey-ceremony.d.ts +3 -1
  735. package/dist/runtime/vue/plugins/passkey-ceremony.js +1 -1
  736. package/dist/runtime/vue/plugins/session-ended.js +2 -3
  737. package/dist/runtime/vue/protection/state.d.ts +6 -0
  738. package/dist/runtime/vue/utils/active-locale.js +8 -0
  739. package/dist/runtime/vue/utils/auth-session.js +1 -1
  740. package/dist/runtime/vue/utils/billing-access.d.ts +1 -1
  741. package/dist/runtime/vue/utils/checkout-return.d.ts +5 -4
  742. package/dist/runtime/vue/utils/checkout-return.js +3 -3
  743. package/dist/runtime/vue/utils/confirm-group.d.ts +18 -0
  744. package/dist/runtime/vue/utils/confirm-group.js +17 -0
  745. package/dist/runtime/vue/utils/display-mode.d.ts +8 -0
  746. package/dist/runtime/vue/utils/display-mode.js +11 -0
  747. package/dist/runtime/vue/utils/heic-absent.d.ts +2 -0
  748. package/dist/runtime/vue/utils/heic-absent.js +3 -0
  749. package/dist/runtime/vue/utils/intl.d.ts +12 -4
  750. package/dist/runtime/vue/utils/intl.js +13 -2
  751. package/dist/runtime/vue/utils/kept-invite.js +6 -29
  752. package/dist/runtime/vue/utils/login-bindings.js +1 -1
  753. package/dist/runtime/vue/utils/page-guard.js +6 -5
  754. package/dist/runtime/vue/utils/page-origin.d.ts +15 -0
  755. package/dist/runtime/vue/utils/page-origin.js +8 -0
  756. package/dist/runtime/vue/utils/page-rules.d.ts +9 -0
  757. package/dist/runtime/vue/utils/page-rules.js +3 -0
  758. package/dist/runtime/vue/utils/passkey-prompt.d.ts +12 -0
  759. package/dist/runtime/vue/utils/passkey-prompt.js +8 -0
  760. package/dist/runtime/vue/utils/plan-change-confirm.d.ts +76 -0
  761. package/dist/runtime/vue/utils/plan-change-confirm.js +39 -0
  762. package/dist/runtime/vue/utils/pricing-bindings.d.ts +7 -1
  763. package/dist/runtime/vue/utils/pricing-bindings.js +21 -0
  764. package/dist/runtime/vue/utils/pricing-seo.js +4 -2
  765. package/dist/runtime/vue/utils/renamed-component.js +1 -1
  766. package/dist/runtime/vue/utils/tab-keep.d.ts +17 -0
  767. package/dist/runtime/vue/utils/tab-keep.js +46 -0
  768. package/dist/shared/{nuxt-backend.KEzfHO2K.mjs → nuxt-backend.9IVxzzft.mjs} +628 -65
  769. package/dist/shared/{nuxt-backend.ikObmtHs.mjs → nuxt-backend.BCjeoX0x.mjs} +2 -26
  770. package/dist/shared/{nuxt-backend.DXEf0rrv.mjs → nuxt-backend.Baxb382E.mjs} +1 -1
  771. package/dist/shared/{nuxt-backend.2m535CLS.mjs → nuxt-backend.BjQoqNIu.mjs} +26 -2
  772. package/dist/shared/{nuxt-backend.Dm1NkY7v.mjs → nuxt-backend.CbR37s_c.mjs} +371 -53
  773. package/dist/types.d.ts +1 -1
  774. package/package.json +18 -13
  775. package/skills/nuxt-backend/SKILL.md +3 -3
  776. package/skills/nuxt-backend/references/api.md +118 -32
  777. package/skills/nuxt-backend/references/renames.json +179 -2015
  778. package/skills/nuxt-backend/references/surface.json +141 -4
  779. package/skills/nuxt-backend-ai/SKILL.md +13 -6
  780. package/skills/nuxt-backend-ai/references/api.md +22 -3
  781. package/skills/nuxt-backend-auth/references/api.md +21 -4
  782. package/skills/nuxt-backend-billing/references/api.md +22 -5
  783. package/skills/nuxt-backend-data/SKILL.md +3 -3
  784. package/skills/nuxt-backend-data/references/api.md +7 -3
  785. package/skills/nuxt-backend-email/SKILL.md +5 -2
  786. package/skills/nuxt-backend-email/references/api.md +3 -1
  787. package/skills/nuxt-backend-growth/references/api.md +5 -0
  788. package/skills/nuxt-backend-ship/SKILL.md +15 -23
  789. package/skills/nuxt-backend-ship/references/api.md +33 -6
  790. package/skills/nuxt-backend-ship/references/operate.md +28 -0
  791. package/skills/nuxt-backend-ui/SKILL.md +13 -4
  792. package/skills/nuxt-backend-upgrade/SKILL.md +20 -14
  793. package/skills/nuxt-backend-upgrade/references/api.md +2 -2
  794. package/skills/nuxt-backend-upgrade/references/upgrade.md +56 -414
  795. package/src/convex/access-tickets.ts +30 -1
  796. package/src/convex/account-data.ts +26 -3
  797. package/src/convex/app.ts +16 -2
  798. package/src/convex/billing-launch.ts +42 -0
  799. package/src/convex/catalog.ts +33 -2
  800. package/src/convex/client/code-binding.ts +1 -1
  801. package/src/convex/client/guards.ts +3 -3
  802. package/src/convex/client/index.ts +4 -3
  803. package/src/convex/client/plugins.ts +43 -19
  804. package/src/convex/components/backend/_generated/api.ts +2 -0
  805. package/src/convex/components/backend/_generated/component.ts +1327 -286
  806. package/src/convex/components/backend/access.ts +109 -16
  807. package/src/convex/components/backend/account.ts +48 -2
  808. package/src/convex/components/backend/adapter.ts +4 -0
  809. package/src/convex/components/backend/billing.ts +94 -17
  810. package/src/convex/components/backend/crons.ts +4 -0
  811. package/src/convex/components/backend/gifts.ts +2 -2
  812. package/src/convex/components/backend/jobs.ts +159 -17
  813. package/src/convex/components/backend/maintenance.ts +14 -1
  814. package/src/convex/components/backend/moderation.ts +57 -0
  815. package/src/convex/components/backend/schema.ts +121 -4
  816. package/src/convex/components/backend/storage.ts +56 -0
  817. package/src/convex/components/backend/subscriptions.ts +1 -1
  818. package/src/convex/constants.ts +20 -4
  819. package/src/convex/delivery.ts +26 -1
  820. package/src/convex/email-templates.ts +124 -21
  821. package/src/convex/emails/notification.ts +22 -0
  822. package/src/convex/emails/renewal-reminder.ts +19 -1
  823. package/src/convex/errors.ts +86 -16
  824. package/src/convex/events.ts +11 -4
  825. package/src/convex/files.ts +48 -6
  826. package/src/convex/integrations/account.ts +4 -0
  827. package/src/convex/integrations/ai/chat.ts +9 -9
  828. package/src/convex/integrations/ai/config.ts +147 -37
  829. package/src/convex/integrations/ai/context.ts +7 -4
  830. package/src/convex/integrations/ai/costs.ts +45 -2
  831. package/src/convex/integrations/ai/embeddings.ts +24 -39
  832. package/src/convex/integrations/ai/images.ts +155 -0
  833. package/src/convex/integrations/ai/job-errors.ts +82 -10
  834. package/src/convex/integrations/ai/jobs.ts +932 -93
  835. package/src/convex/integrations/ai/knowledge.ts +9 -10
  836. package/src/convex/integrations/ai/metering.ts +83 -28
  837. package/src/convex/integrations/ai/model-id.ts +24 -2
  838. package/src/convex/integrations/ai/models.ts +274 -59
  839. package/src/convex/integrations/ai/moderation-providers.ts +373 -0
  840. package/src/convex/integrations/ai/moderation-taxonomy.ts +174 -0
  841. package/src/convex/integrations/ai/moderation.ts +536 -48
  842. package/src/convex/integrations/ai/provenance.ts +10 -1
  843. package/src/convex/integrations/ai/setup.ts +5 -5
  844. package/src/convex/integrations/ai/stream.ts +4 -3
  845. package/src/convex/integrations/ai.ts +24 -6
  846. package/src/convex/integrations/billing/checkout.ts +4 -4
  847. package/src/convex/integrations/billing/context.ts +38 -3
  848. package/src/convex/integrations/billing/credits.ts +27 -7
  849. package/src/convex/integrations/billing/free-plan.ts +120 -24
  850. package/src/convex/integrations/billing/functions.ts +20 -8
  851. package/src/convex/integrations/billing/gifts.ts +34 -6
  852. package/src/convex/integrations/billing/lifecycle.ts +14 -6
  853. package/src/convex/integrations/billing/passes.ts +5 -13
  854. package/src/convex/integrations/billing/pricing.ts +43 -5
  855. package/src/convex/integrations/billing/provider-failure.ts +56 -0
  856. package/src/convex/integrations/billing/rate-limit.ts +46 -0
  857. package/src/convex/integrations/billing/referral-orders.ts +1 -1
  858. package/src/convex/integrations/billing/resync.ts +187 -0
  859. package/src/convex/integrations/billing/rewards.ts +1 -1
  860. package/src/convex/integrations/billing/subscriptions.ts +4 -2
  861. package/src/convex/integrations/billing/types/lifecycle.ts +1 -1
  862. package/src/convex/integrations/billing/types/records.ts +67 -3
  863. package/src/convex/integrations/billing/types/setup.ts +7 -6
  864. package/src/convex/integrations/billing/types/surface.ts +47 -7
  865. package/src/convex/integrations/billing/webhooks.ts +2 -2
  866. package/src/convex/integrations/billing/welcome.ts +103 -0
  867. package/src/convex/integrations/billing.ts +20 -5
  868. package/src/convex/integrations/email-sync.ts +74 -26
  869. package/src/convex/integrations/email.ts +17 -2
  870. package/src/convex/integrations/functions.ts +2 -2
  871. package/src/convex/integrations/inbound.ts +32 -16
  872. package/src/convex/integrations/launch.ts +294 -28
  873. package/src/convex/integrations/notifications.ts +16 -17
  874. package/src/convex/integrations/rate-limit.ts +18 -3
  875. package/src/convex/integrations/referrals.ts +25 -7
  876. package/src/convex/integrations/reports.ts +18 -5
  877. package/src/convex/integrations/retention.ts +73 -5
  878. package/src/convex/integrations/storage.ts +198 -7
  879. package/src/convex/label-format.ts +2 -2
  880. package/src/convex/label-groups/admin.ts +31 -0
  881. package/src/convex/label-groups/audit.ts +1 -0
  882. package/src/convex/label-groups/auth.ts +7 -0
  883. package/src/convex/label-groups/cancelFlow.ts +2 -2
  884. package/src/convex/label-groups/email.ts +2 -1
  885. package/src/convex/label-groups/errors.ts +18 -1
  886. package/src/convex/label-groups/gift.ts +32 -2
  887. package/src/convex/label-groups/legal.ts +31 -0
  888. package/src/convex/label-groups/notifications.ts +5 -3
  889. package/src/convex/label-groups/pastDue.ts +1 -1
  890. package/src/convex/label-groups/pricing.ts +24 -0
  891. package/src/convex/label-groups/referral.ts +6 -2
  892. package/src/convex/label-groups/report.ts +10 -1
  893. package/src/convex/label-groups/settings.ts +39 -0
  894. package/src/convex/label-groups/upload.ts +2 -0
  895. package/src/convex/label-groups/waitlist.ts +7 -2
  896. package/src/convex/label-groups/withdrawal.ts +1 -1
  897. package/src/convex/label-translations.ts +94 -34
  898. package/src/convex/labels.ts +25 -0
  899. package/src/convex/legal.ts +35 -4
  900. package/src/convex/log.ts +20 -1
  901. package/src/convex/money.ts +40 -0
  902. package/src/convex/monitoring.ts +6 -4
  903. package/src/convex/report-rules.ts +19 -0
  904. package/src/convex/sensitive-actions.ts +1 -0
  905. package/src/convex/test-billing.ts +189 -0
  906. package/src/convex/test-models.ts +85 -6
  907. package/src/convex/test-moderation.ts +122 -0
  908. package/src/convex/test.ts +492 -8
  909. package/src/runtime/vue/components/account/AccountData.vue +2 -0
  910. package/src/runtime/vue/components/account/AccountDeletion.css +2 -1
  911. package/src/runtime/vue/components/account/ActivationChecklist.css +7 -2
  912. package/src/runtime/vue/components/account/ActivationChecklist.vue +1 -0
  913. package/src/runtime/vue/components/account/ConsentPrompt.css +10 -5
  914. package/src/runtime/vue/components/account/ConsentPromptDialog.vue +1 -0
  915. package/src/runtime/vue/components/account/ConsentPromptStorage.vue +1 -0
  916. package/src/runtime/vue/components/account/EmailUnsubscribe.css +10 -2
  917. package/src/runtime/vue/components/account/EmailUnsubscribe.vue +2 -2
  918. package/src/runtime/vue/components/account/HowDidYouHear.css +12 -3
  919. package/src/runtime/vue/components/account/HowDidYouHear.vue +1 -0
  920. package/src/runtime/vue/components/account/KeepAccount.css +5 -1
  921. package/src/runtime/vue/components/account/OnboardingFlow.css +8 -3
  922. package/src/runtime/vue/components/account/OnboardingFlow.vue +1 -0
  923. package/src/runtime/vue/components/account/ProfileIdentity.css +1 -1
  924. package/src/runtime/vue/components/account/ProfilePreferencesSection.css +5 -1
  925. package/src/runtime/vue/components/account/ProfilePreferencesSection.vue +4 -2
  926. package/src/runtime/vue/components/account/ProfileSettings.css +5 -1
  927. package/src/runtime/vue/components/account/ProfileSettings.vue +1 -0
  928. package/src/runtime/vue/components/account/SecurityAlerts.css +2 -1
  929. package/src/runtime/vue/components/account/SecurityAlerts.vue +2 -2
  930. package/src/runtime/vue/components/account/SecurityPasskeys.css +5 -3
  931. package/src/runtime/vue/components/account/SecuritySessions.css +1 -1
  932. package/src/runtime/vue/components/account/SecuritySettings.css +2 -1
  933. package/src/runtime/vue/components/account/SecuritySettings.vue +1 -0
  934. package/src/runtime/vue/components/admin/AdminAccess.css +1 -1
  935. package/src/runtime/vue/components/admin/AdminAccess.vue +3 -1
  936. package/src/runtime/vue/components/admin/AdminAccessMemberTickets.vue +51 -0
  937. package/src/runtime/vue/components/admin/AdminAnnouncements.css +4 -2
  938. package/src/runtime/vue/components/admin/AdminBilling.css +1 -1
  939. package/src/runtime/vue/components/admin/AdminChart.css +2 -1
  940. package/src/runtime/vue/components/admin/AdminConsole.css +2 -0
  941. package/src/runtime/vue/components/admin/AdminExperiments.css +2 -1
  942. package/src/runtime/vue/components/admin/AdminFlags.css +4 -2
  943. package/src/runtime/vue/components/admin/AdminModeration.vue +148 -0
  944. package/src/runtime/vue/components/admin/AdminQueue.css +6 -2
  945. package/src/runtime/vue/components/admin/AdminQueueJob.vue +6 -2
  946. package/src/runtime/vue/components/admin/AdminReferrals.css +5 -1
  947. package/src/runtime/vue/components/admin/AdminReports.css +2 -1
  948. package/src/runtime/vue/components/admin/AdminRevenue.css +2 -1
  949. package/src/runtime/vue/components/admin/AdminUsers.vue +1 -0
  950. package/src/runtime/vue/components/admin/AdminWorkspaces.vue +1 -0
  951. package/src/runtime/vue/components/admin/admin.css +4 -3
  952. package/src/runtime/vue/components/auth/AuthForm.css +9 -3
  953. package/src/runtime/vue/components/auth/AuthForm.vue +5 -5
  954. package/src/runtime/vue/components/auth/AuthFormChoose.css +3 -1
  955. package/src/runtime/vue/components/auth/AuthFormHeader.css +1 -1
  956. package/src/runtime/vue/components/auth/AuthFormPasskeyOffer.css +2 -1
  957. package/src/runtime/vue/components/auth/InviteRedeem.css +57 -1
  958. package/src/runtime/vue/components/auth/InviteRedeem.vue +110 -9
  959. package/src/runtime/vue/components/auth/ReauthenticateCode.css +1 -1
  960. package/src/runtime/vue/components/auth/ReauthenticateDialog.css +9 -2
  961. package/src/runtime/vue/components/auth/ReauthenticateDialog.vue +3 -2
  962. package/src/runtime/vue/components/auth/ReauthenticatePasskey.css +1 -1
  963. package/src/runtime/vue/components/auth/WaitlistForm.css +5 -1
  964. package/src/runtime/vue/components/auth/WaitlistForm.vue +6 -6
  965. package/src/runtime/vue/components/auth/WaitlistPlace.css +5 -1
  966. package/src/runtime/vue/components/auth/WaitlistShare.css +8 -3
  967. package/src/runtime/vue/components/auth/WaitlistShare.vue +2 -8
  968. package/src/runtime/vue/components/auth/WaitlistStatus.css +27 -1
  969. package/src/runtime/vue/components/auth/WaitlistStatus.vue +153 -31
  970. package/src/runtime/vue/components/billing/BillingCheckoutLink.vue +2 -0
  971. package/src/runtime/vue/components/billing/BillingHistory.css +3 -2
  972. package/src/runtime/vue/components/billing/BillingHistory.vue +1 -0
  973. package/src/runtime/vue/components/billing/BillingHistoryOrder.css +1 -1
  974. package/src/runtime/vue/components/billing/BillingPortalLink.vue +1 -0
  975. package/src/runtime/vue/components/billing/CancelConfirmGroup.vue +2 -8
  976. package/src/runtime/vue/components/billing/CancelFlow.css +10 -4
  977. package/src/runtime/vue/components/billing/CancelFlow.vue +2 -1
  978. package/src/runtime/vue/components/billing/CancelFlowEnd.vue +3 -1
  979. package/src/runtime/vue/components/billing/GiftForm.css +89 -0
  980. package/src/runtime/vue/components/billing/GiftForm.vue +251 -0
  981. package/src/runtime/vue/components/billing/GiftList.css +7 -2
  982. package/src/runtime/vue/components/billing/GiftList.vue +21 -9
  983. package/src/runtime/vue/components/billing/GiftReceived.vue +11 -3
  984. package/src/runtime/vue/components/billing/PlanChangeConfirmGroup.vue +59 -0
  985. package/src/runtime/vue/components/billing/PricingChangeConfirm.vue +22 -0
  986. package/src/runtime/vue/components/billing/PricingPackCard.css +2 -1
  987. package/src/runtime/vue/components/billing/PricingPlanCard.css +33 -4
  988. package/src/runtime/vue/components/billing/PricingPlanCard.vue +25 -3
  989. package/src/runtime/vue/components/billing/PricingTable.css +2 -2
  990. package/src/runtime/vue/components/billing/PricingTable.vue +164 -31
  991. package/src/runtime/vue/components/billing/ReferralCard.css +8 -3
  992. package/src/runtime/vue/components/billing/ReferralCard.vue +1 -0
  993. package/src/runtime/vue/components/billing/ReferralLanding.css +16 -2
  994. package/src/runtime/vue/components/billing/ReferralLanding.vue +54 -3
  995. package/src/runtime/vue/components/billing/UpgradePrompt.css +8 -3
  996. package/src/runtime/vue/components/billing/UpgradePrompt.vue +1 -0
  997. package/src/runtime/vue/components/billing/UsageHistory.css +3 -2
  998. package/src/runtime/vue/components/billing/UsageHistory.vue +1 -0
  999. package/src/runtime/vue/components/billing/WithdrawalButton.css +8 -2
  1000. package/src/runtime/vue/components/billing/WithdrawalButton.vue +2 -1
  1001. package/src/runtime/vue/components/shared.css +79 -5
  1002. package/src/runtime/vue/components/shell/AccessDenied.css +7 -2
  1003. package/src/runtime/vue/components/shell/AccessDenied.vue +1 -0
  1004. package/src/runtime/vue/components/shell/AccountMenu.vue +1 -0
  1005. package/src/runtime/vue/components/shell/AiLabel.css +3 -2
  1006. package/src/runtime/vue/components/shell/AiLabel.vue +4 -1
  1007. package/src/runtime/vue/components/shell/AppShell.css +7 -3
  1008. package/src/runtime/vue/components/shell/AppShell.vue +3 -0
  1009. package/src/runtime/vue/components/shell/BackendNotices.vue +3 -2
  1010. package/src/runtime/vue/components/shell/ConfirmDialog.css +7 -2
  1011. package/src/runtime/vue/components/shell/ConnectionStatus.css +1 -1
  1012. package/src/runtime/vue/components/shell/ConnectionStatus.vue +1 -0
  1013. package/src/runtime/vue/components/shell/ContactForm.css +10 -1
  1014. package/src/runtime/vue/components/shell/ContactForm.vue +1 -0
  1015. package/src/runtime/vue/components/shell/FrameMain.vue +2 -0
  1016. package/src/runtime/vue/components/shell/Gate.css +7 -2
  1017. package/src/runtime/vue/components/shell/Gate.vue +2 -0
  1018. package/src/runtime/vue/components/shell/GateQuota.vue +1 -0
  1019. package/src/runtime/vue/components/shell/LegalCompany.vue +38 -0
  1020. package/src/runtime/vue/components/shell/LegalContactPoints.vue +74 -0
  1021. package/src/runtime/vue/components/shell/LegalDetail.vue +54 -0
  1022. package/src/runtime/vue/components/shell/LegalDocument.css +21 -4
  1023. package/src/runtime/vue/components/shell/LegalDocument.vue +54 -15
  1024. package/src/runtime/vue/components/shell/LegalModeration.vue +94 -0
  1025. package/src/runtime/vue/components/shell/LegalProcessors.vue +64 -22
  1026. package/src/runtime/vue/components/shell/LegalStorage.vue +64 -23
  1027. package/src/runtime/vue/components/shell/LegalVersion.vue +44 -0
  1028. package/src/runtime/vue/components/shell/NoticeAnnouncement.css +2 -1
  1029. package/src/runtime/vue/components/shell/NoticeDeletion.css +7 -2
  1030. package/src/runtime/vue/components/shell/NoticeGift.css +2 -1
  1031. package/src/runtime/vue/components/shell/NoticeGift.vue +8 -5
  1032. package/src/runtime/vue/components/shell/NoticeImpersonation.css +2 -1
  1033. package/src/runtime/vue/components/shell/NoticeLowCredits.css +9 -2
  1034. package/src/runtime/vue/components/shell/NoticeMaintenance.css +2 -1
  1035. package/src/runtime/vue/components/shell/NoticePastDue.css +8 -2
  1036. package/src/runtime/vue/components/shell/NoticePastDue.vue +1 -1
  1037. package/src/runtime/vue/components/shell/NotificationInbox.css +8 -4
  1038. package/src/runtime/vue/components/shell/NotificationInbox.vue +1 -0
  1039. package/src/runtime/vue/components/shell/ReportAppeal.vue +17 -14
  1040. package/src/runtime/vue/components/shell/ReportNotice.css +2 -1
  1041. package/src/runtime/vue/components/shell/UploadField.css +6 -2
  1042. package/src/runtime/vue/components/shell/UploadField.vue +21 -5
  1043. package/src/runtime/vue/components/shell/WorkspaceSwitcher.css +7 -2
  1044. package/src/runtime/vue/components/shell/WorkspaceSwitcher.vue +1 -0
  1045. package/src/runtime/vue/components/tokens.css +51 -1
  1046. package/src/runtime/vue/components/workspaces/AcceptInvitation.vue +1 -0
  1047. package/src/runtime/vue/components/workspaces/AuditLog.css +3 -2
  1048. package/src/runtime/vue/components/workspaces/AuditLog.vue +1 -0
  1049. package/src/runtime/vue/components/workspaces/WorkspaceBilling.css +76 -2
  1050. package/src/runtime/vue/components/workspaces/WorkspaceBilling.vue +45 -53
  1051. package/src/runtime/vue/components/workspaces/WorkspaceBillingPause.vue +79 -0
  1052. package/src/runtime/vue/components/workspaces/WorkspaceBillingSwitch.vue +63 -0
  1053. package/src/runtime/vue/components/workspaces/WorkspaceCredits.css +2 -0
  1054. package/src/runtime/vue/components/workspaces/WorkspaceList.css +3 -2
  1055. package/src/runtime/vue/components/workspaces/WorkspaceSettings.vue +48 -4
  1056. package/src/runtime/vue/pages/gifts.vue +21 -5
  1057. package/src/runtime/vue/pages/invite.vue +4 -2
  1058. package/src/runtime/vue/pages/login.vue +8 -8
  1059. package/src/runtime/vue/pages/referral.vue +1 -2
  1060. package/src/runtime/vue/pages/report.vue +2 -3
  1061. package/src/runtime/vue/pages/waitlist.vue +8 -5
  1062. package/dist/devtools-client/_nuxt/CfQg3BRt.js +0 -5
@@ -1,12 +1,13 @@
1
- import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs';
1
+ import { readFileSync, readdirSync, existsSync, statSync } from 'node:fs';
2
2
  import { createRequire } from 'node:module';
3
3
  import { resolve, join, dirname, relative, sep } from 'node:path';
4
- import { k as executeEnvPush, f as runConvex, aL as envNames, $ as REQUIRED_DEPLOYMENT_ENV, aM as DEV_ONLY_DEPLOYMENT_ENV, l as generateAuthSecret, aN as DEV_SITE_URL, j as deploymentFlags, aO as finding, e as deployKeyType, r as readEnvFiles, g as resolveFunctionsDir, aP as parseBackendEnvironment, c as billingEnvironment, P as packageDir, aQ as proofKeys, aR as TEST_CHALLENGE_SITE_KEYS, aS as deploymentEnvId, aT as protectionTakes, ac as DEFAULT_AUTH_ROUTE, aU as TEST_CHALLENGE_SECRET_KEYS, aV as PROTECTED_AUTH_ROUTES, aW as PROOF_HEADER, aX as signProof, aY as proofAudience, b as deploymentBackendEnvironment, aZ as deploymentSiteOrigin, n as isLoopbackUrl, a6 as HEALTH_ROUTE, a3 as resolveSiteUrl, a0 as deriveDeploymentUrls, a as deploymentEnvNames, a_ as isLocalDeploymentId, A as configuredDeployment, Z as collectPreflightFindings, F as computeDeployment, a$ as applyProductionPosture, b0 as capabilityOfGroup, b1 as agentFilesFinding, O as installedVersion, _ as OPTIONAL_DEPLOYMENT_ENV, aA as BACKEND_ENV, b2 as pinnedRegion, b3 as namedModels, b4 as usesProvenance, b5 as monitoringDsnFinding, b6 as monitoringFindings, b7 as usageAlertsFinding, b8 as readUsageLimits, b9 as billingWebhookSecretHint, v as backendPathsOf, ba as BACKEND_PATH_KEYS, bb as pathOption, t as pathsSourceOf, bc as aiFeatures, bd as pathsFileFinding, be as brandFileFinding, x as appBrandOf, aC as REMOVED_DEPLOYMENT_ENV, bf as installableFinding, d as deploymentFunctionSpec, bg as mountsComponent } from '../shared/nuxt-backend.KEzfHO2K.mjs';
4
+ import { l as executeEnvPush, f as runConvex, aY as envNames, a4 as REQUIRED_DEPLOYMENT_ENV, aZ as DEV_ONLY_DEPLOYMENT_ENV, m as generateAuthSecret, a_ as DEV_SITE_URL, g as deploymentFlags, a$ as finding, e as deployKeyType, r as readEnvFiles, aP as capabilityOfEnv, k as readTextIfPresent, aO as BACKEND_ENV, j as resolveFunctionsDir, b0 as parseBackendEnvironment, c as billingEnvironment, V as packageDir, b1 as proofKeys, b2 as TEST_CHALLENGE_SITE_KEYS, b3 as deploymentEnvId, b4 as protectionTakes, al as DEFAULT_AUTH_ROUTE, b5 as TEST_CHALLENGE_SECRET_KEYS, b6 as PROTECTED_AUTH_ROUTES, b7 as PROOF_HEADER, b8 as signProof, b9 as proofAudience, b as deploymentBackendEnvironment, ba as deploymentSiteOrigin, p as isLoopbackUrl, ab as HEALTH_ROUTE, a8 as resolveSiteUrl, a5 as deriveDeploymentUrls, a as deploymentEnvNames, bb as isLocalDeploymentId, q as configuredDeployment, J as computeDeployment, a2 as collectPreflightFindings, bc as capabilityOfGroup, bd as agentFilesFinding, U as installedVersion, a3 as OPTIONAL_DEPLOYMENT_ENV, be as chosenRoutes, bf as chosenGateways, bg as pinnedRegion, bh as namedModels, bi as usesProvenance, bj as moderationProviders, bk as monitoringDsnFinding, bl as monitoringFindings, bm as usageAlertsFinding, bn as readUsageLimits, bo as applyProductionPosture, bp as billingWebhookSecretHint, x as backendPathsOf, bq as BACKEND_PATH_KEYS, br as pathOption, v as pathsSourceOf, bs as aiFeatures, bt as pathsFileFinding, bu as brandFileFinding, z as appBrandOf, bv as labelsFileFinding, F as appLabelsOf, aQ as REMOVED_DEPLOYMENT_ENV, bw as checksImages, bx as namesModerationModel, by as GATEWAY_ORDER_UNREAD, bz as routeKeyFor, bA as installableFinding, d as deploymentFunctionSpec, bB as gatewayKeyIsTheFix, bC as DEFAULT_MODERATION_MODEL, bD as mountsComponent, bE as GATEWAY_KEY_FIX } from '../shared/nuxt-backend.9IVxzzft.mjs';
5
5
  import { defineCommand } from 'citty';
6
- import { w as withContract, f as finish, p as progress, b as devScriptFinding } from '../shared/nuxt-backend.2m535CLS.mjs';
6
+ import { w as withContract, f as finish, p as progress, r as renderEnvExample, b as devScriptFinding } from '../shared/nuxt-backend.BjQoqNIu.mjs';
7
7
  import { pathToFileURL } from 'node:url';
8
8
  import { Polar } from '@polar-sh/sdk';
9
9
  import { benefitsList } from '@polar-sh/sdk/funcs/benefitsList.js';
10
+ import { checkoutLinksList } from '@polar-sh/sdk/funcs/checkoutLinksList.js';
10
11
  import { membersListMembers } from '@polar-sh/sdk/funcs/membersListMembers.js';
11
12
  import { organizationsListOrganizations } from '@polar-sh/sdk/funcs/organizationsListOrganizations.js';
12
13
  import { productsList } from '@polar-sh/sdk/funcs/productsList.js';
@@ -14,10 +15,10 @@ import { discountsCreate } from '@polar-sh/sdk/funcs/discountsCreate.js';
14
15
  import { discountsList } from '@polar-sh/sdk/funcs/discountsList.js';
15
16
  import { discountsUpdate } from '@polar-sh/sdk/funcs/discountsUpdate.js';
16
17
  import { ServerList } from '@polar-sh/sdk/lib/config.js';
18
+ import { productsUpdate } from '@polar-sh/sdk/funcs/productsUpdate.js';
17
19
  import { benefitsCreate } from '@polar-sh/sdk/funcs/benefitsCreate.js';
18
20
  import { benefitsUpdate } from '@polar-sh/sdk/funcs/benefitsUpdate.js';
19
21
  import { productsUpdateBenefits } from '@polar-sh/sdk/funcs/productsUpdateBenefits.js';
20
- import { productsUpdate } from '@polar-sh/sdk/funcs/productsUpdate.js';
21
22
  import { organizationsUpdate } from '@polar-sh/sdk/funcs/organizationsUpdate.js';
22
23
  import { webhooksListWebhookEndpoints } from '@polar-sh/sdk/funcs/webhooksListWebhookEndpoints.js';
23
24
  import { webhooksUpdateWebhookEndpoint } from '@polar-sh/sdk/funcs/webhooksUpdateWebhookEndpoint.js';
@@ -25,7 +26,7 @@ import { customersGet } from '@polar-sh/sdk/funcs/customersGet.js';
25
26
  import '@convex-dev/polar';
26
27
  import { metricsLimits } from '@polar-sh/sdk/funcs/metricsLimits.js';
27
28
  import { r as readLastRun, i as installChangedSince, a as formatSize } from './report.mjs';
28
- import { c as convexConfigFinding } from '../shared/nuxt-backend.DXEf0rrv.mjs';
29
+ import { c as convexConfigFinding } from '../shared/nuxt-backend.Baxb382E.mjs';
29
30
 
30
31
  const ENV_DEFAULT_TYPES = ["preview", "dev"];
31
32
  const ENV_DEFAULT_NAMES = [...REQUIRED_DEPLOYMENT_ENV, "BACKEND_ENVIRONMENT"];
@@ -74,6 +75,30 @@ async function runEnvDefaults(rootDir, options) {
74
75
  return { deployment: `defaults:${options.type}`, dev: false, deployedNames: defaultNames, results, missingRequired };
75
76
  }
76
77
 
78
+ const INVITE_LABEL_MAX = 64;
79
+ const ADMIT_BATCH_MAX = 500;
80
+ const ADMISSION_TTL_MS = 30 * 24 * 60 * 60 * 1e3;
81
+ new TextEncoder();
82
+ function admissionEmail(address) {
83
+ return address.trim().toLowerCase();
84
+ }
85
+ const EMAIL_SHAPE = /^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/;
86
+ const RESERVED_DOMAINS = /(?:^|\.)(?:example\.(?:com|net|org)|example|test|invalid|localhost)$/;
87
+ function admissionProblem(address) {
88
+ if (address.length > 254 || !EMAIL_SHAPE.test(address)) return "malformed";
89
+ return RESERVED_DOMAINS.test(address.slice(address.lastIndexOf("@") + 1)) ? "reserved" : null;
90
+ }
91
+ function cleanAddresses(emails) {
92
+ const clean = [];
93
+ const skipped = [];
94
+ for (const email of emails.map(admissionEmail).filter(Boolean)) {
95
+ const problem = admissionProblem(email);
96
+ if (problem) skipped.push({ email, reason: problem });
97
+ else clean.push(email);
98
+ }
99
+ return { clean, skipped };
100
+ }
101
+
77
102
  const SCAN_LIMIT = 8e3;
78
103
  const HAS_ADMIN_QUERY = [
79
104
  "let read = 0",
@@ -110,15 +135,41 @@ function addressOf(answer) {
110
135
  return /^[^\s@]+@[^\s@]+$/.test(email) ? email : null;
111
136
  }
112
137
  const FIRST_ADMIN_ADMISSION_MS = 24 * 60 * 60 * 1e3;
113
- async function admitAddress(rootDir, email, prod) {
138
+ const CLI_ADMISSION_LABEL = "command line";
139
+ function admitRefused(prod, note) {
140
+ return { deployment: prod ? "production" : "dev", status: "refused", admitted: [], skipped: [], expiresAt: null, note };
141
+ }
142
+ async function admitAddresses(rootDir, emails, { prod, label, expiresAt }, run) {
143
+ const deployment = prod ? "production" : "dev";
144
+ const report = (status, admitted, skipped, note) => ({ deployment, status, admitted, skipped, expiresAt, ...note ? { note } : {} });
145
+ if (emails.length === 0) return report("admitted", [], []);
114
146
  try {
115
- const args = { emails: [email], source: "invitation", label: "first-administrator", expiresAt: Date.now() + FIRST_ADMIN_ADMISSION_MS };
116
- await runConvex(rootDir, ["run", ...deploymentFlags({ prod }), "--component", "backend", "access:admit", JSON.stringify(args)]);
117
- return true;
118
- } catch {
119
- return false;
147
+ const args = { emails, source: "invitation", label, expiresAt };
148
+ const { stdout } = await run(rootDir, ["run", ...deploymentFlags({ prod }), "--component", "backend", "access:admit", JSON.stringify(args)]);
149
+ const stored = JSON.parse(stdout || "null") ?? {};
150
+ return report("admitted", stored.admitted ?? [], (stored.skipped ?? []).map((row) => ({ email: row.email, reason: "account" })));
151
+ } catch (error) {
152
+ if (error?.missingFunction === true) return report("missing", [], [], `the ${deployment} deployment's backend has no launch access to admit through (access:admit): push the backend first.`);
153
+ return report("failed", [], [], `the ${deployment} deployment refused the admission (${error instanceof Error ? error.message : String(error)}).`);
120
154
  }
121
155
  }
156
+ async function admitCleaned(rootDir, emails, options, run = runConvex) {
157
+ const { clean, skipped } = cleanAddresses(emails);
158
+ const report = await admitAddresses(rootDir, clean, options, run);
159
+ return { ...report, skipped: [...skipped, ...report.skipped] };
160
+ }
161
+ function admitInputRefusal(emails, label, days) {
162
+ if (emails.length === 0) return "name at least one address: npx nuxt-backend access admit you@example.com";
163
+ if (emails.length > ADMIT_BATCH_MAX) return `at most ${ADMIT_BATCH_MAX} addresses at a time.`;
164
+ if (!label.trim() || label.trim().length > INVITE_LABEL_MAX) return `--label is 1-${INVITE_LABEL_MAX} characters.`;
165
+ if (!Number.isInteger(days) || days < 1 || days > 365) return "--days is a whole number of days from 1 to 365.";
166
+ return null;
167
+ }
168
+ const ADMISSION_DAYS = ADMISSION_TTL_MS / (24 * 60 * 60 * 1e3);
169
+ async function admitAddress(rootDir, email, prod) {
170
+ const { status, admitted } = await admitAddresses(rootDir, [email], { prod, label: "first-administrator", expiresAt: Date.now() + FIRST_ADMIN_ADMISSION_MS }, runConvex);
171
+ return status === "admitted" && admitted.includes(email);
172
+ }
122
173
  async function bootstrapAdmin(rootDir, { prod, ask, print }) {
123
174
  if (await deploymentHasAdmin(rootDir, { prod }) !== false) return null;
124
175
  const answer = await ask("[nuxt-backend] doctor --fix: no account holds the admin role. Make which account the first administrator? Its email (empty to skip): ");
@@ -146,6 +197,14 @@ async function bootstrapAdmin(rootDir, { prod, ask, print }) {
146
197
  print(`[nuxt-backend] doctor --fix: ${email} is the first administrator.`);
147
198
  return email;
148
199
  }
200
+ async function firstAdministratorOnFix(rootDir, { prod, interactive, ask, print }) {
201
+ if (interactive) return bootstrapAdmin(rootDir, { prod, ask, print });
202
+ const hasAdmin = await deploymentHasAdmin(rootDir, { prod });
203
+ if (hasAdmin === true) return null;
204
+ const fix = `Run \`npx nuxt-backend doctor --fix${prod ? " --prod" : ""}\` at a terminal, or \`${setRoleCommand("you@example.com", prod)}\`.`;
205
+ print(hasAdmin === false ? `[nuxt-backend] doctor --fix: no first administrator made: there is no terminal to ask at. ${fix}` : `[nuxt-backend] doctor --fix: could not check for a first administrator: the deployment's accounts did not answer, or hold more than doctor reads. If none holds the admin role, ${fix.charAt(0).toLowerCase()}${fix.slice(1)}`);
206
+ return null;
207
+ }
149
208
 
150
209
  function namesNoFunction(error) {
151
210
  if (typeof error?.missingFunction === "boolean") return error.missingFunction;
@@ -162,10 +221,10 @@ async function runEmailSync(rootDir, { prod = false, dryRun = false, webhook, en
162
221
  }
163
222
  return JSON.parse(stdout);
164
223
  }
165
- async function runInboundSync(rootDir, { prod = false } = {}, run = runConvex) {
224
+ async function runInboundSync(rootDir, { prod = false, dryRun = false } = {}, run = runConvex) {
166
225
  let stdout;
167
226
  try {
168
- ({ stdout } = await run(rootDir, ["run", ...deploymentFlags({ prod }), "email:syncInbound", "{}"]));
227
+ ({ stdout } = await run(rootDir, ["run", ...deploymentFlags({ prod }), "email:syncInbound", JSON.stringify(dryRun ? { dryRun } : {})]));
169
228
  } catch (error) {
170
229
  if (namesNoFunction(error)) return null;
171
230
  throw error;
@@ -177,7 +236,7 @@ function inboundSyncLines(report) {
177
236
  const lines = [` ${(report.inbox ?? "missing").padEnd(13)} inbox ${report.support}`];
178
237
  if (report.domain) lines.push(` \xB7 domain ${report.domain.name}: ${report.domain.status}, receiving ${report.domain.receiving ? "on" : "off"}`);
179
238
  const { webhook } = report;
180
- lines.push(` ${(webhook.state === "ok" ? "exists" : webhook.state).padEnd(13)} webhook inbound events${webhook.added.length ? ` \u2014 added ${webhook.added.join(", ")}` : ""}`);
239
+ lines.push(` ${(webhook.state === "ok" ? "exists" : webhook.state).padEnd(13)} webhook inbound events${webhook.added.length ? ` \u2014 ${webhook.state === "would-update" ? "would add" : "added"} ${webhook.added.join(", ")}` : ""}`);
181
240
  for (const todo of report.todo) lines.push(` todo inbound ${todo}`);
182
241
  return lines;
183
242
  }
@@ -395,6 +454,91 @@ function missingContractFunctions(identifiers) {
395
454
  return missing;
396
455
  }
397
456
 
457
+ const LISTED = /^[\t ]*(?:#[\t ]*)?(?:export[\t ]+)?([A-Z][A-Z0-9_]*)[\t ]*=/gm;
458
+ function listedEnvNames(text) {
459
+ return [...new Set([...text.matchAll(LISTED)].map(([, name]) => name))];
460
+ }
461
+ const READ_ELSEWHERE = /^(?:CONVEX|NUXT|NITRO|VERCEL|NETLIFY|CF|SENTRY|NODE|NPM)_|^(?:PORT|HOST|DEBUG|CI|TZ)$/;
462
+ const SKIPPED = /* @__PURE__ */ new Set(["node_modules", "dist", "coverage", "_generated"]);
463
+ const READ_DOTFOLDERS = /* @__PURE__ */ new Set([".github"]);
464
+ const SOURCE = /\.(?:[cm]?[jt]s|vue|json|jsonc|ya?ml|toml|sh)$/;
465
+ function sourceFiles(dir) {
466
+ let entries;
467
+ try {
468
+ entries = readdirSync(dir, { withFileTypes: true });
469
+ } catch {
470
+ return [];
471
+ }
472
+ return entries.flatMap((entry) => {
473
+ if (entry.name.startsWith(".") && !READ_DOTFOLDERS.has(entry.name) || SKIPPED.has(entry.name)) return [];
474
+ const path = join(dir, entry.name);
475
+ if (entry.isDirectory()) return sourceFiles(path);
476
+ return entry.isFile() && SOURCE.test(entry.name) && !entry.name.endsWith(".d.ts") ? [path] : [];
477
+ });
478
+ }
479
+ const IDENTIFIER = /\b[A-Z][A-Z0-9_]*\b/g;
480
+ function namesTheAppMentions(rootDir, candidates) {
481
+ const found = /* @__PURE__ */ new Set();
482
+ if (candidates.length === 0) return found;
483
+ const wanted = new Set(candidates);
484
+ for (const file of sourceFiles(rootDir)) {
485
+ let text;
486
+ try {
487
+ text = readFileSync(file, "utf8");
488
+ } catch {
489
+ continue;
490
+ }
491
+ for (const [name] of text.matchAll(IDENTIFIER)) {
492
+ if (wanted.has(name)) found.add(name);
493
+ }
494
+ if (found.size === candidates.length) break;
495
+ }
496
+ return found;
497
+ }
498
+ function capabilitiesInUse(rootDir, listed) {
499
+ const env = { ...readEnvFiles(rootDir), ...process.env };
500
+ const used = /* @__PURE__ */ new Set(["data"]);
501
+ for (const name of [...listed, ...Object.keys(env).filter((name2) => env[name2])]) {
502
+ const capability = capabilityOfEnv(name);
503
+ if (capability) used.add(capability);
504
+ }
505
+ return used;
506
+ }
507
+ function drift(missing, unread) {
508
+ return [
509
+ ...missing.length ? [`It lacks ${missing.join(", ")}, which the package reads.`] : [],
510
+ ...unread.length ? [`It lists ${unread.join(", ")}, which neither the package nor the app's code reads.`] : []
511
+ ].join(" ");
512
+ }
513
+ function readEnvExample(rootDir) {
514
+ try {
515
+ return readTextIfPresent(join(rootDir, ".env.example"));
516
+ } catch (error) {
517
+ return { unreadable: error.code ?? (error instanceof Error ? error.message : String(error)) };
518
+ }
519
+ }
520
+ function envExampleFinding(rootDir) {
521
+ const text = readEnvExample(rootDir);
522
+ if (text === void 0) return [];
523
+ if (typeof text !== "string") return [finding("env-example", "warn", `Could not read .env.example (${text.unreadable}): its names were not checked.`, "Make .env.example a file you can read, then run doctor again.")];
524
+ const listed = listedEnvNames(text);
525
+ const used = capabilitiesInUse(rootDir, listed);
526
+ const missing = listedEnvNames(renderEnvExample()).filter((name) => !listed.includes(name) && used.has(capabilityOfEnv(name) ?? "data"));
527
+ const others = listed.filter((name) => !(name in BACKEND_ENV) && !READ_ELSEWHERE.test(name));
528
+ const mentioned = namesTheAppMentions(rootDir, others);
529
+ const unread = others.filter((name) => !mentioned.has(name));
530
+ if (missing.length === 0 && unread.length === 0) return [finding("env-example", "pass", ".env.example lists every name the package reads, and none that nothing reads.")];
531
+ return [finding(
532
+ "env-example",
533
+ "warn",
534
+ `.env.example has drifted. ${drift(missing, unread)}`,
535
+ [
536
+ ...missing.length ? [`Add ${missing.map((name) => `\`# ${name}=\``).join(", ")} under their groups`] : [],
537
+ ...unread.length ? [`remove ${unread.join(", ")}, or leave a name a tool outside the app's code reads`] : []
538
+ ].join("; ").replace(/^./, (first) => first.toUpperCase()).concat(".")
539
+ )];
540
+ }
541
+
398
542
  const TRIAL_PASS_MAX_DAYS = 92;
399
543
  function trialPassDays(trial) {
400
544
  if (!trial?.pass) return void 0;
@@ -962,7 +1106,7 @@ function refuseUnpricedPlans(catalog) {
962
1106
  for (const [key, plan] of Object.entries(catalog.plans ?? {})) {
963
1107
  const line = legacyPlanLine(plan);
964
1108
  if (line) {
965
- throw new Error(`[nuxt-backend] billing sync: plans.${key} has \`interval\` and \`price\`, which became \`prices: { month, year }\` \u2014 write ${line} (the Upgrade page has the rest).`);
1109
+ throw new Error(`[nuxt-backend] billing sync: plans.${key} has \`interval\` and \`price\`, which became \`prices: { month, year }\` \u2014 write ${line} (https://nuxt-backend.dev/docs/build/billing/catalog#declare has the rest).`);
966
1110
  }
967
1111
  if (pricedIntervals(plan).length === 0) {
968
1112
  throw new Error(`[nuxt-backend] billing sync: plans.${key} has no price \u2014 give it \`prices: { month }\`, \`prices: { year }\` or both.`);
@@ -1014,11 +1158,48 @@ function refuseInvalidPrices(catalog) {
1014
1158
  throw new Error(`[nuxt-backend] billing sync: ${free.join(", ")} are all free plans \u2014 a catalog has at most one, which every new billing entity starts on. Price the others, or retire them.`);
1015
1159
  }
1016
1160
  }
1161
+ function onceCreditsProblem(catalog, key, plan) {
1162
+ const grant = plan.credits;
1163
+ if (!grant?.once) return void 0;
1164
+ if (plan.retired || !isFreePlan(plan)) return `plans.${key} grants its credits \`once\`, which only the free plan does: welcome credits for every new billing entity. Drop \`once\` to grant them every cycle`;
1165
+ if (typeof grant.units !== "number" || !Number.isInteger(grant.units) || grant.units <= 0) return `plans.${key} grants its welcome credits \`once\`: \`units\` is one whole number above 0, not one per interval`;
1166
+ const meter = catalog.meters?.[grant.meter];
1167
+ if (!meter) return `plans.${key} grants its welcome credits on \`${grant.meter}\`, which is no meter of the catalog \u2014 declare it in \`meters\``;
1168
+ if (meter.aggregation === "count") return `plans.${key} grants its welcome credits on \`${grant.meter}\`, which counts events: they are given as a refund, which only a sum meter takes`;
1169
+ return void 0;
1170
+ }
1171
+ function refuseOnceCredits(catalog) {
1172
+ for (const [key, plan] of Object.entries(catalog.plans ?? {})) {
1173
+ const problem = onceCreditsProblem(catalog, key, plan);
1174
+ if (problem) throw new Error(`[nuxt-backend] billing sync: ${problem}.`);
1175
+ }
1176
+ }
1017
1177
  function refuseMissingDefaultCurrency(catalog, currency) {
1018
1178
  if (!currency || catalog.currency) return;
1019
1179
  for (const [key, plan] of Object.entries(catalog.plans ?? {})) refuseCurrencies(`plans.${key}`, planPricesByCurrency(plan, currency).map(([code]) => code), currency);
1020
1180
  for (const [key, pack] of Object.entries(catalog.packs ?? {})) refuseCurrencies(`packs.${key}`, packPricesByCurrency(pack, currency).map(([code]) => code), currency);
1021
1181
  }
1182
+ function missingOrganizationCurrency(catalog, currency, organizationCurrency) {
1183
+ if (!organizationCurrency) return [];
1184
+ const lacks = (codes) => !codes.includes(organizationCurrency);
1185
+ return [
1186
+ ...Object.entries(catalog.plans ?? {}).filter(([, plan]) => !plan.retired && !isFreePlan(plan) && lacks(planPricesByCurrency(plan, currency).map(([code]) => code))).map(([key]) => `plans.${key}`),
1187
+ ...Object.entries(catalog.packs ?? {}).filter(([, pack]) => lacks(packPricesByCurrency(pack, currency).map(([code]) => code))).map(([key]) => `packs.${key}`)
1188
+ ];
1189
+ }
1190
+ function organizationCurrencyProblem(missing, organizationCurrency) {
1191
+ return `the organization's default currency is ${organizationCurrency}, and ${missing.join(", ")} ${missing.length === 1 ? "has" : "have"} no price in it: the provider makes no product without one. Add ${organizationCurrency} to ${missing.length === 1 ? "its" : "their"} prices (\`prices: { usd: \u2026, ${organizationCurrency}: \u2026 }\`), or change the organization's default currency in the provider dashboard`;
1192
+ }
1193
+ function refuseMissingOrganizationCurrency(catalog, currency, organizationCurrency) {
1194
+ const missing = missingOrganizationCurrency(catalog, currency, organizationCurrency);
1195
+ if (missing.length > 0) throw new Error(`[nuxt-backend] billing sync: ${organizationCurrencyProblem(missing, organizationCurrency)}.`);
1196
+ }
1197
+ function zeroPrices(plan, currency, organizationCurrency) {
1198
+ const codes = planPricesByCurrency(plan, currency).map(([code]) => code);
1199
+ if (organizationCurrency && !codes.includes(organizationCurrency)) codes.push(organizationCurrency);
1200
+ const named = [...new Set(codes.filter((code) => code !== void 0))];
1201
+ return named.length > 0 ? named.map((code) => [code, 0]) : [[void 0, 0]];
1202
+ }
1022
1203
  function findPlanProduct(products, key, interval) {
1023
1204
  const tagged = (product) => product.metadata;
1024
1205
  return products.find((product) => tagged(product)?.managedBy === MANAGED_BY && tagged(product)?.key === key && tagged(product)?.interval === interval) ?? products.find((product) => tagged(product)?.managedBy === MANAGED_BY && tagged(product)?.key === key && tagged(product)?.interval === void 0 && product.recurringInterval === interval);
@@ -1276,7 +1457,7 @@ async function planBenefits(key, plan, { creditBenefitFor, planCreditKey, benefi
1276
1457
  return [...credits, ...(plan.features ?? []).flatMap((featureKey) => benefitIdByKey.get(featureKey) ?? [])];
1277
1458
  }
1278
1459
  async function syncPassProducts(catalog, context) {
1279
- const { client, ids, managedProducts, ensureProduct, price, currency, quotasByPlan, adopt, dryRun, log } = context;
1460
+ const { client, ids, managedProducts, ensureProduct, price, currency, organizationCurrency, quotasByPlan, adopt, dryRun, log } = context;
1280
1461
  for (const [key, plan, lengths] of giftablePlans(catalog)) {
1281
1462
  const trialDays = trialPassDays(plan.trial);
1282
1463
  const entry = { pass: "", months: {}, ...trialDays === void 0 ? {} : { trialDays } };
@@ -1287,8 +1468,8 @@ async function syncPassProducts(catalog, context) {
1287
1468
  name: `${plan.name} (pass)`,
1288
1469
  description: plan.description,
1289
1470
  recurringInterval: "month",
1290
- // Free is a fixed price of nothing, as the free plan's is.
1291
- prices: price([[currency, 0]], plan),
1471
+ // Free is a fixed price of nothing, as the free plan's is, in each currency of the plan and the organization's.
1472
+ prices: price(zeroPrices(plan, currency, organizationCurrency), plan),
1292
1473
  visibility: "private",
1293
1474
  metadata: { managedBy: MANAGED_BY, key: passKey, passOf: key }
1294
1475
  }), managedProducts.find((item) => isManaged(item.metadata, passKey)), (id) => {
@@ -1334,17 +1515,37 @@ function customerEmailsOff(settings) {
1334
1515
  }
1335
1516
  async function readManagedProducts(polar) {
1336
1517
  const productByKey = {};
1518
+ const keyById = /* @__PURE__ */ new Map();
1337
1519
  for (const product of await listAllPages((page) => productsList(polar, { metadata: { managedBy: MANAGED_BY }, limit: 100, page }))) {
1338
1520
  const { metadata, prices, visibility, benefits } = product;
1339
1521
  if (typeof metadata?.key !== "string") continue;
1340
1522
  const fixed = (prices ?? []).filter((price) => price.amountType === "fixed" && !price.isArchived && typeof price.priceAmount === "number");
1341
- productByKey[metadata.interval === "year" ? planProductKey(metadata.key, "year") : metadata.key] = {
1523
+ const key = metadata.interval === "year" ? planProductKey(metadata.key, "year") : metadata.key;
1524
+ const benefitKeys = (benefits ?? []).flatMap((benefit) => {
1525
+ const tag = benefit.metadata;
1526
+ return tag?.managedBy === MANAGED_BY && typeof tag.key === "string" ? [tag.key] : [];
1527
+ });
1528
+ productByKey[key] = {
1342
1529
  visibility: typeof visibility === "string" ? visibility : "",
1343
1530
  ...fixed.length > 0 ? { prices: Object.fromEntries(fixed.map((price) => [price.priceCurrency ?? "", price.priceAmount])) } : {},
1344
- benefits: benefits?.length ?? 0
1531
+ benefits: benefits?.length ?? 0,
1532
+ benefitKeys
1345
1533
  };
1534
+ keyById.set(product.id, key);
1535
+ }
1536
+ return { productByKey, keyById };
1537
+ }
1538
+ async function readCheckoutLinks(polar, keyById) {
1539
+ try {
1540
+ const links = await listAllPages((page) => checkoutLinksList(polar, { limit: 100, page }));
1541
+ return links.flatMap((link) => {
1542
+ const { label, products } = link;
1543
+ const keys = [...new Set((products ?? []).filter((product) => !product.isArchived).flatMap((product) => keyById.get(product.id) ?? []))];
1544
+ return keys.length > 0 ? [{ label: label ?? null, keys }] : [];
1545
+ });
1546
+ } catch {
1547
+ return void 0;
1346
1548
  }
1347
- return productByKey;
1348
1549
  }
1349
1550
  async function readBillingOrganizationState(options, client) {
1350
1551
  try {
@@ -1359,7 +1560,8 @@ async function readBillingOrganizationState(options, client) {
1359
1560
  benefitTypeByKey[metadata.key] = benefit.type ?? "";
1360
1561
  }
1361
1562
  const { subscriptionSettings: subscription, customerPortalSettings: portal } = organization;
1362
- const productByKey = await readManagedProducts(polar);
1563
+ const { productByKey, keyById } = await readManagedProducts(polar);
1564
+ const checkoutLinks = await readCheckoutLinks(polar, keyById);
1363
1565
  const members = await membersListMembers(polar, { limit: 1 });
1364
1566
  return {
1365
1567
  slug: organization.slug,
@@ -1369,10 +1571,12 @@ async function readBillingOrganizationState(options, client) {
1369
1571
  preventTrialAbuse: subscription.preventTrialAbuse,
1370
1572
  customerEmailsOff: customerEmailsOff(organization.customerEmailSettings),
1371
1573
  portal: { updatePlan: portal.subscription.updatePlan, pause: portal.subscription.pause ?? false },
1574
+ ...typeof organization.defaultPresentmentCurrency === "string" ? { defaultCurrency: organization.defaultPresentmentCurrency.toLowerCase() } : {},
1372
1575
  benefitTypeByKey,
1373
1576
  memberModel: organization.featureSettings?.memberModelEnabled === true,
1374
1577
  membersReadable: members.ok,
1375
- productByKey
1578
+ productByKey,
1579
+ ...checkoutLinks ? { checkoutLinks } : {}
1376
1580
  };
1377
1581
  } catch {
1378
1582
  return null;
@@ -1406,6 +1610,17 @@ function customerEmailsFinding(state) {
1406
1610
  "Turn the provider's customer emails back on in its dashboard (Settings, Customer notifications); the app never sends a copy of them."
1407
1611
  );
1408
1612
  }
1613
+ function checkoutLinksFinding(state) {
1614
+ if (!state.checkoutLinks) return [];
1615
+ if (state.checkoutLinks.length === 0) return [finding("billing-checkout-links", "pass", "No checkout link of the provider's own sells a catalog product: every purchase goes through the app's checkout.")];
1616
+ const links = state.checkoutLinks.map((link) => `${link.label ? `"${link.label}"` : "an unlabelled link"} (${link.keys.join(", ")})`);
1617
+ return [finding(
1618
+ "billing-checkout-links",
1619
+ "warn",
1620
+ `The provider also sells catalog products through checkout links of its own: ${links.join("; ")}. A purchase there names no billing entity, so the buyer pays and the app grants nothing, or a second plan lands beside the free one.`,
1621
+ "Delete those checkout links in the provider's dashboard (Products, Checkout Links), and link to the app's pricing page, whose checkout names the billing entity, instead."
1622
+ )];
1623
+ }
1409
1624
  function stackedSubscriptionsMessage(catalog, offered) {
1410
1625
  const free = freePlanOf(catalog);
1411
1626
  return free ? `The organization lets a customer hold several subscriptions at once beside the free plan (${free[0]}) \u2014 every billing entity holds it, so a checkout outside the package, which does not upgrade it in place, leaves the customer on two plans, and useBilling() reports only the first.` : `The organization lets a customer hold several subscriptions at once while the catalog offers ${offered} plan prices \u2014 someone can end up on two of them, and useBilling() reports only the first.`;
@@ -1462,6 +1677,46 @@ function passProductsFinding(plans, state) {
1462
1677
  "Run `npx nuxt-backend billing sync`: it creates the missing products. Make a public one private in the provider dashboard."
1463
1678
  );
1464
1679
  }
1680
+ function planCreditBenefit(key, plan, interval) {
1681
+ const monthly = interval === "month" || plan.meterCycle === "month";
1682
+ if (!plan.credits || plan.credits.once || planCreditUnits(plan.credits, monthly ? "month" : interval) === void 0) return void 0;
1683
+ return monthly ? `${key}-credits` : `${key}-credits-${interval}`;
1684
+ }
1685
+ function planBenefitProblems(catalog, state) {
1686
+ return Object.entries(catalog.plans ?? {}).filter(([, plan]) => !plan.retired).flatMap(([key, plan]) => pricedIntervals(plan).flatMap((interval) => {
1687
+ const productKey = planProductKey(key, interval);
1688
+ const carried = state.productByKey[productKey]?.benefitKeys;
1689
+ if (!carried) return [];
1690
+ const credits = planCreditBenefit(key, plan, interval);
1691
+ const lacks = [
1692
+ ...credits && !carried.some((name) => name === `${key}-credits` || name.startsWith(`${key}-credits-`)) ? [credits] : [],
1693
+ ...(plan.features ?? []).filter((feature) => feature in (catalog.features ?? {}) && !carried.includes(feature))
1694
+ ];
1695
+ return lacks.length > 0 ? [`product ${productKey} lacks ${lacks.join(", ")}`] : [];
1696
+ }));
1697
+ }
1698
+ function planBenefitsFinding(catalog, state) {
1699
+ const granting = Object.values(catalog.plans ?? {}).some((plan) => !plan.retired && (plan.credits && !plan.credits.once || (plan.features ?? []).length > 0));
1700
+ if (!granting) return [];
1701
+ const problems = planBenefitProblems(catalog, state);
1702
+ return [problems.length === 0 ? finding("billing-plan-benefits", "pass", "Every plan product carries the credits and features the catalog gives its plan.") : finding(
1703
+ "billing-plan-benefits",
1704
+ "warn",
1705
+ `${problems.join("; ")}: ${problems.length === 1 ? "its" : "their"} subscribers are granted none of it.`,
1706
+ "Run `npx nuxt-backend billing sync`: it attaches a missing benefit to the product that exists, and the provider grants it to the product's current subscribers too. A product that grants other credits on the same meter is drift there: swap them in the provider dashboard."
1707
+ )];
1708
+ }
1709
+ function currencyFinding(catalog, state) {
1710
+ const organization = state.defaultCurrency;
1711
+ if (!organization || !catalog.plans && !catalog.packs) return [];
1712
+ const missing = missingOrganizationCurrency(catalog, catalog.currency?.toLowerCase() ?? organization, organization);
1713
+ return [missing.length === 0 ? finding("billing-currency", "pass", `Every plan and pack has a price in ${organization}, the organization's default currency.`) : finding(
1714
+ "billing-currency",
1715
+ "warn",
1716
+ `${organizationCurrencyProblem(missing, organization)}. \`billing sync\` refuses the catalog until they do.`,
1717
+ `Add ${organization} to those prices in billing.catalog.ts and run \`npx nuxt-backend billing sync\`, or make the catalog's currency the organization's default in the provider dashboard.`
1718
+ )];
1719
+ }
1465
1720
  function passFindings(catalog, state) {
1466
1721
  const giftable = giftablePlans(catalog).map(([key, , months]) => [key, months]);
1467
1722
  return giftable.length > 0 ? [passProductsFinding(giftable, state)] : [];
@@ -1491,7 +1746,27 @@ function providerSdkFindings(rootDir) {
1491
1746
  const { version } = sdk;
1492
1747
  return [Number.parseInt(version, 10) >= 1 ? finding("billing-provider-sdk", "warn", `The billing component (@convex-dev/polar 0.9) resolves @polar-sh/sdk ${version}, but it is built on the 0.x SDK, which 1.0 rewrote: checkout, the portal and webhook parsing break on it.`, 'Pin "@polar-sh/sdk": "^0.49.0" in package.json and reinstall, until nuxt-backend supports the 1.x SDK.') : finding("billing-provider-sdk", "pass", `The billing component resolves @polar-sh/sdk ${version}, the line it is built on.`)];
1493
1748
  }
1494
- function collectBillingFindings(catalog, state, { tokenPresent }) {
1749
+ function unreadOrganizationFindings(tokenPresent, deployedToken) {
1750
+ if (tokenPresent) {
1751
+ return [finding(
1752
+ "billing-organization",
1753
+ "warn",
1754
+ "BILLING_ACCESS_TOKEN is set here but the provider would not answer with it (expired, revoked, or issued for the other environment) \u2014 the catalog cross-checks were skipped.",
1755
+ "Issue a fresh organization access token for the billing environment BACKEND_ENVIRONMENT names (the provider sandbox unless it is production), put it in .env.local, and run `npx nuxt-backend env push`."
1756
+ )];
1757
+ }
1758
+ return deployedToken ? [skippedOrganizationFinding(deployedToken.prod)] : [];
1759
+ }
1760
+ function skippedOrganizationFinding(prod) {
1761
+ const flag = prod ? " --prod" : "";
1762
+ return finding(
1763
+ "billing-organization",
1764
+ "warn",
1765
+ `The ${prod ? "production" : "dev"} deployment holds BILLING_ACCESS_TOKEN, and the env doctor reads here does not, so the checks that read the provider were skipped: its organization's settings against the catalog (subscriptions, proration, trials, portal, emails, team customers, checkout links, gift and pass products, feature benefits), the webhook endpoint and the customer mappings.`,
1766
+ `Run them with the deployment's token in the env: \`BILLING_ACCESS_TOKEN=<the deployment's token>${prod ? " BACKEND_ENVIRONMENT=production" : ""} npx nuxt-backend doctor${flag} --only billing\`, or keep it in .env.local.`
1767
+ );
1768
+ }
1769
+ function collectBillingFindings(catalog, state, { tokenPresent, deployedToken = null }) {
1495
1770
  if (!catalog) return [];
1496
1771
  const findings = [];
1497
1772
  const plans = Object.entries(catalog.plans ?? {});
@@ -1515,17 +1790,7 @@ function collectBillingFindings(catalog, state, { tokenPresent }) {
1515
1790
  ));
1516
1791
  }
1517
1792
  findings.push(...promotionLimitsFinding(catalog));
1518
- if (!state) {
1519
- if (tokenPresent) {
1520
- findings.push(finding(
1521
- "billing-organization",
1522
- "warn",
1523
- "BILLING_ACCESS_TOKEN is set here but the provider would not answer with it (expired, revoked, or issued for the other environment) \u2014 the catalog cross-checks were skipped.",
1524
- "Issue a fresh organization access token for the billing environment BACKEND_ENVIRONMENT names (the provider sandbox unless it is production), put it in .env.local, and run `npx nuxt-backend env push`."
1525
- ));
1526
- }
1527
- return findings;
1528
- }
1793
+ if (!state) return [...findings, ...unreadOrganizationFindings(tokenPresent, deployedToken)];
1529
1794
  findings.push(state.allowMultipleSubscriptions && offered > 1 ? finding(
1530
1795
  "billing-multiple-subscriptions",
1531
1796
  "warn",
@@ -1561,6 +1826,9 @@ function collectBillingFindings(catalog, state, { tokenPresent }) {
1561
1826
  findings.push(customerEmailsFinding(state));
1562
1827
  findings.push(...promotionPortalFinding(catalog, state));
1563
1828
  findings.push(teamCustomersFinding(state));
1829
+ findings.push(...checkoutLinksFinding(state));
1830
+ findings.push(...currencyFinding(catalog, state));
1831
+ findings.push(...planBenefitsFinding(catalog, state));
1564
1832
  if (packs.length > 0) findings.push(giftTwinsFinding(packs.map(([key]) => key), state));
1565
1833
  findings.push(...passFindings(catalog, state));
1566
1834
  if (features.length > 0) {
@@ -1613,7 +1881,7 @@ function missingProductionIds(catalog, ids) {
1613
1881
  const discounts = Object.entries(catalog.discounts ?? {}).filter(([key, discount]) => !discount.retired && !ids?.discounts?.[key]).map(([key]) => `discount ${key}`);
1614
1882
  return [...plans, ...packs, ...meters, ...discounts];
1615
1883
  }
1616
- async function productionCatalogFindings(rootDir, environment) {
1884
+ async function productionCatalogFindings(rootDir, environment, launched = true) {
1617
1885
  let catalog;
1618
1886
  let ids;
1619
1887
  try {
@@ -1627,7 +1895,14 @@ async function productionCatalogFindings(rootDir, environment) {
1627
1895
  if (missing.length === 0) return [finding("billing-catalog-production", "pass", "Every plan price, pack, meter and promotion of the catalog has its production id.")];
1628
1896
  const gap = `The catalog has no production id for ${missing.join(", ")}`;
1629
1897
  const hint = "Run npx nuxt-backend billing sync --env production, and commit the billing.generated.ts it writes.";
1630
- return [environment === "production" ? finding("billing-catalog-production", "fail", `${gap}: production refuses their checkout.`, hint) : finding("billing-catalog-production", "warn", `${gap}: once production bills in the production environment, their checkout is refused.`, hint)];
1898
+ if (environment !== "production") return [finding("billing-catalog-production", "warn", `${gap}: once production bills in the production environment, their checkout is refused.`, hint)];
1899
+ return [launched ? finding("billing-catalog-production", "fail", `${gap}: production refuses their checkout.`, hint) : finding("billing-catalog-production", "warn", `${gap}: billing is not launched on production yet, so nothing sells there until it has them.`, hint)];
1900
+ }
1901
+
1902
+ function billingLaunch({ environment, accessToken, products }) {
1903
+ if (!accessToken) return { launched: false, reason: "no_access_token" };
1904
+ if (Object.keys(products ?? {}).length === 0) return { launched: false, reason: "no_catalog" };
1905
+ return { launched: true };
1631
1906
  }
1632
1907
 
1633
1908
  function isProviderNotFound(error) {
@@ -1673,6 +1948,47 @@ function customerMappingFindings(read, { prod }) {
1673
1948
  )];
1674
1949
  }
1675
1950
 
1951
+ const PRELAUNCH_FINDINGS = /* @__PURE__ */ new Set([
1952
+ "billing-access",
1953
+ "deployment-billing-access-token",
1954
+ "billing-webhook-secret",
1955
+ "deployment-billing-webhook-secret",
1956
+ "billing-webhook-route",
1957
+ "billing-catalog-production"
1958
+ ]);
1959
+ async function productionBillingLaunch(rootDir, deployed) {
1960
+ try {
1961
+ if (!(await loadCatalog(rootDir))?.catalog) return null;
1962
+ const products = (await loadGenerated(rootDir)).production?.products;
1963
+ return billingLaunch({ environment: "production", accessToken: deployed.includes("BILLING_ACCESS_TOKEN"), products });
1964
+ } catch {
1965
+ return null;
1966
+ }
1967
+ }
1968
+ const NOT_LAUNCHED_BECAUSE = {
1969
+ no_access_token: "it bills in the provider's production environment and holds no BILLING_ACCESS_TOKEN",
1970
+ no_catalog: "it holds BILLING_ACCESS_TOKEN, but billing.generated.ts has no production products (billing sync --env production has not run)"
1971
+ };
1972
+ function launchSteps(reason) {
1973
+ const token = "put the live organization token in .env.local as BILLING_ACCESS_TOKEN and run `npx nuxt-backend env push --prod`; ";
1974
+ return `Once the provider has reviewed the organization: ${reason === "no_access_token" ? token : ""}run \`npx nuxt-backend billing sync --env production\` with production's deploy key, commit and deploy the billing.generated.ts it writes, then start everyone who joined meanwhile on the free plan: \`npx convex run --prod billing:startFreePlan '{}'\`.`;
1975
+ }
1976
+ function billingLaunchFinding(launch) {
1977
+ if (launch.launched) return finding("billing-launch", "pass", "Billing is launched on production: it holds BILLING_ACCESS_TOKEN and the catalog has production products, so its pricing sells.");
1978
+ return finding(
1979
+ "billing-launch",
1980
+ "warn",
1981
+ `Billing is not launched on production yet: ${NOT_LAUNCHED_BECAUSE[launch.reason]}. Its pricing reads "Plans open soon" and every sale is refused (unavailable, reason not_launched); the rest of the app runs. Until it launches, the token, webhook and production catalog findings warn rather than fail.`,
1982
+ launchSteps(launch.reason)
1983
+ );
1984
+ }
1985
+ function withBillingLaunch(findings, launch) {
1986
+ const said = launch.launched ? [...findings] : findings.map((reported) => PRELAUNCH_FINDINGS.has(reported.id) && reported.status === "warn" ? { ...reported, message: `${reported.message} (billing is not launched yet: see billing-launch)` } : reported);
1987
+ const at = said.findIndex((reported) => reported.capability === "billing");
1988
+ const led = at === -1 ? [...said, billingLaunchFinding(launch)] : [...said.slice(0, at), billingLaunchFinding(launch), ...said.slice(at)];
1989
+ return { findings: led, settled: launch.launched ? [] : [...PRELAUNCH_FINDINGS] };
1990
+ }
1991
+
1676
1992
  const CUSTOMER_EMAILS = [
1677
1993
  "orderConfirmation",
1678
1994
  "subscriptionConfirmation",
@@ -2467,20 +2783,35 @@ async function docsFinding(input, fetcher) {
2467
2783
  return [finding("agent-docs", "warn", `The app declares docs for agents (llms), and ${url} answered ${response?.status ?? "nothing"}${response?.status === 200 ? " with no text document" : ""}.`, "Check the llms options in nuxt.config, and that the build ran its module.")];
2468
2784
  }
2469
2785
  const STATES = /* @__PURE__ */ new Set(["live", "test", "missing", "failing"]);
2470
- async function healthFinding(input, fetcher) {
2471
- const url = `${input.origin}${HEALTH_ROUTE}`;
2786
+ async function readHealth(url, fetcher) {
2472
2787
  const response = await probe(url, { headers: { accept: "application/json" } }, fetcher);
2473
- if (!response) return finding("monitoring-health", "warn", `${url} did not answer.`, "Check the app host's logs.");
2474
- if (response.status === 404) return finding("monitoring-health", "warn", `${url} is not served (404): an uptime check has nothing to ask.`, "Check that the app was built with this package.");
2788
+ if (!response) return { found: finding("monitoring-health", "warn", `${url} did not answer.`, "Check the app host's logs."), answers: false };
2789
+ if (response.status === 404) return { found: finding("monitoring-health", "warn", `${url} is not served (404): an uptime check has nothing to ask.`, "Check that the app was built with this package."), answers: false };
2475
2790
  const body = response.status === 200 || response.status === 503 ? await jsonOf(response) : null;
2476
2791
  const capabilities = body?.capabilities;
2477
2792
  const shaped = body && ["ok", "degraded", "failing"].includes(body.status) && typeof capabilities === "object" && capabilities !== null && Object.values(capabilities).every((state) => STATES.has(state));
2478
- if (!shaped) return finding("monitoring-health", "warn", `${url} answered ${response.status} without the health's shape ({ status, capabilities }).`, "A route of your own shadows it, or a proxy rewrote the answer.");
2793
+ if (!shaped) return { found: finding("monitoring-health", "warn", `${url} answered ${response.status} without the health's shape ({ status, capabilities }).`, "A route of your own shadows it, or a proxy rewrote the answer."), answers: false };
2794
+ return { found: shapedHealthFinding(url, body, capabilities), answers: true };
2795
+ }
2796
+ function shapedHealthFinding(url, body, capabilities) {
2479
2797
  if ("detail" in body) return finding("monitoring-health", "fail", `${url} shows the capabilities' detail to an anonymous caller: their env names and findings.`, "Production names itself development (BACKEND_ENVIRONMENT), which shows the detail to everyone: name it production with npx nuxt-backend env push --prod --force BACKEND_ENVIRONMENT (env push leaves a value already set unless forced).");
2480
2798
  const failing = Object.entries(capabilities).filter(([, state]) => state === "failing").map(([name]) => name);
2481
2799
  if (body.status === "failing") return finding("monitoring-health", "warn", `${url} answers its public shape, and reports the app failing (${failing.join(", ") || "the backend unreachable"}).`, "npx nuxt-backend status --prod says why.");
2482
2800
  return finding("monitoring-health", "pass", `${url} answers its public shape: ${body.status}, ${Object.keys(capabilities).length} capabilities, no detail.`);
2483
2801
  }
2802
+ function uptimeFinding(url) {
2803
+ return finding(
2804
+ "monitoring-uptime",
2805
+ "pass",
2806
+ `Not checked: whether an uptime monitor asks ${url}. doctor reads no monitoring account; the endpoint answers its public shape, so a monitor has something to ask.`,
2807
+ `Without one, an outage is heard of when someone reports it. In Sentry: Monitors, Add Monitor, Uptime, at ${url}, every minute; it opens an issue after three failures in a row. Any uptime service that GETs the URL works the same way.`
2808
+ );
2809
+ }
2810
+ async function healthFindings(input, fetcher) {
2811
+ const url = `${input.origin}${HEALTH_ROUTE}`;
2812
+ const { found, answers } = await readHealth(url, fetcher);
2813
+ return answers ? [found, uptimeFinding(url)] : [found];
2814
+ }
2484
2815
  const PROBE_IDS = [["site", "site-https"], ["auth", "site-gated-page"], ["monitoring", "monitoring-health"]];
2485
2816
  function unprobedSiteFindings(why, fixHint, wants) {
2486
2817
  const first = PROBE_IDS.find(([group]) => wants(group));
@@ -2495,7 +2826,7 @@ async function siteProbeFindings(input, fetcher = fetch) {
2495
2826
  input.wants("auth") ? gatedPageFinding(input, fetcher) : [],
2496
2827
  input.wants("auth") ? authProxyFinding(input, fetcher) : [],
2497
2828
  input.wants("site") ? docsFinding(input, fetcher) : [],
2498
- input.wants("monitoring") ? healthFinding(input, fetcher) : []
2829
+ input.wants("monitoring") ? healthFindings(input, fetcher) : []
2499
2830
  ]);
2500
2831
  return results.flat();
2501
2832
  }
@@ -2524,7 +2855,8 @@ async function loadedBackendOptions(appConfig) {
2524
2855
  return config ? pathsSourceOf(config) : null;
2525
2856
  }
2526
2857
  async function generatedFileFindings(rootDir, appConfig) {
2527
- return [codegenFinding(rootDir), ...pathsFileFinding(rootDir, await loadedBackendOptions(appConfig)), ...brandFileFinding(rootDir, await appBrandOf(await appConfig()))];
2858
+ const config = await appConfig();
2859
+ return [codegenFinding(rootDir), ...pathsFileFinding(rootDir, await loadedBackendOptions(appConfig)), ...brandFileFinding(rootDir, await appBrandOf(config)), ...labelsFileFinding(rootDir, await appLabelsOf(config))];
2528
2860
  }
2529
2861
  async function installableFindings(rootDir, appConfig, { wanted, pushKeys }) {
2530
2862
  const config = wanted ? await appConfig() : null;
@@ -2534,7 +2866,9 @@ async function installableFindings(rootDir, appConfig, { wanted, pushKeys }) {
2534
2866
  return typeof name === "string" ? [name] : [];
2535
2867
  });
2536
2868
  const publicDir = join(rootDir, config.dir?.public ?? "public");
2537
- return installableFinding(publicDir, await appBrandOf(config), { modules, pushKeys });
2869
+ const options = pathsSourceOf(config).installable;
2870
+ const links = config.app?.head?.link ?? [];
2871
+ return installableFinding(publicDir, await appBrandOf(config), { modules, pushKeys, options, links });
2538
2872
  }
2539
2873
  function servesAgentDocs(config) {
2540
2874
  return config?.llms !== void 0 || (config?.modules ?? []).some((entry) => (Array.isArray(entry) ? entry[0] : entry) === "nuxt-llms");
@@ -2589,7 +2923,7 @@ async function pagePathFindings(appConfig, deployed) {
2589
2923
  "Pass the `paths` of paths.generated.ts to defineBackendAuthConfig (auth.config.ts), setupAuth (auth.ts) and setupAccount (account.ts), then let `npx convex dev` push or deploy."
2590
2924
  )];
2591
2925
  }
2592
- async function billingCatalogFindings(rootDir, env) {
2926
+ async function billingCatalogFindings(rootDir, env, { deployed, prod = false } = {}) {
2593
2927
  let catalog;
2594
2928
  try {
2595
2929
  catalog = (await loadCatalog(rootDir))?.catalog ?? null;
@@ -2600,7 +2934,8 @@ async function billingCatalogFindings(rootDir, env) {
2600
2934
  const accessToken = env.BILLING_ACCESS_TOKEN;
2601
2935
  const environment = billingEnvironment(parseBackendEnvironment(env.BACKEND_ENVIRONMENT));
2602
2936
  const state = accessToken ? await readBillingOrganizationState({ accessToken, environment }) : null;
2603
- return collectBillingFindings(catalog, state, { tokenPresent: Boolean(accessToken) });
2937
+ const deployedToken = !accessToken && (await deployed)?.includes("BILLING_ACCESS_TOKEN") ? { prod } : null;
2938
+ return collectBillingFindings(catalog, state, { tokenPresent: Boolean(accessToken), deployedToken });
2604
2939
  }
2605
2940
  async function probeWebhookRoute(url) {
2606
2941
  try {
@@ -2715,6 +3050,9 @@ function listed(names) {
2715
3050
  return names.length < 2 ? names.join("") : `${names.slice(0, -1).join(", ")} and ${names.at(-1)}`;
2716
3051
  }
2717
3052
  const CONVEX_GATEWAY_PROVIDER = "@convex-dev/ai-sdk-provider";
3053
+ const keyFix = (flag) => flag ? GATEWAY_KEY_FIX.prod : GATEWAY_KEY_FIX.dev;
3054
+ const routesNameConvex = (routes) => routes === "unread" || Object.values(routes ?? {}).some((order) => order.includes("convex"));
3055
+ const namesConvex = (order) => order === void 0 || order === "unread" || order.includes("convex");
2718
3056
  const SPENDING_LIMIT = "Cap its spend with `npx convex deployment usage-limits set` (the `aiGatewayCostDollars` limit).";
2719
3057
  function convexGatewayProviderInstalled(rootDir) {
2720
3058
  try {
@@ -2736,29 +3074,104 @@ function cloudRouteFinding(id, models, { keyed, provider, flag }) {
2736
3074
  id,
2737
3075
  "warn",
2738
3076
  `The backend names ${listed(models)}, but no model route is ready on the deployment: ${CONVEX_GATEWAY_PROVIDER} is not installed and AI_GATEWAY_API_KEY is not set, so those model calls are refused.`,
2739
- `Install ${CONVEX_GATEWAY_PROVIDER} (\`pnpm add ${CONVEX_GATEWAY_PROVIDER}\`) to use the Convex AI Gateway on a paid plan, or add AI_GATEWAY_API_KEY to .env.local and run \`npx nuxt-backend env push${flag}\`.`
3077
+ `${keyFix(flag)} Or install ${CONVEX_GATEWAY_PROVIDER} (\`pnpm add ${CONVEX_GATEWAY_PROVIDER}\`) to use the Convex AI Gateway on a paid plan.`
2740
3078
  );
2741
3079
  }
2742
- function gatewayKeyFinding(deployed, { models, local, cloud, provider, prod, region }) {
3080
+ function convexRouteFinding(id, models, { cloud, linked, local, provider, keyed, alone, flag }) {
3081
+ const how = alone ? `setupAi({ gateway: 'convex' }) sends ${listed(models)} through the Convex AI Gateway alone` : `AI_GATEWAY_API_KEY is not set on the deployment, so ${listed(models)} go through the Convex AI Gateway, next in setupAi({ gateway })`;
3082
+ const elsewhere = alone ? `Add 'vercel' to setupAi({ gateway }), then: ${keyFix(flag)}` : keyFix(flag);
3083
+ const install = `Install ${CONVEX_GATEWAY_PROVIDER} (\`pnpm add ${CONVEX_GATEWAY_PROVIDER}\`)`;
3084
+ if (!provider) {
3085
+ return finding(id, "warn", `${how}, but ${CONVEX_GATEWAY_PROVIDER} is not installed: those model calls are refused.`, alone ? `${install}, or: ${elsewhere}` : `${elsewhere} Or: ${install}.`);
3086
+ }
3087
+ if (cloud || linked) {
3088
+ const unused = alone && keyed ? " AI_GATEWAY_API_KEY is set on the deployment and never read." : "";
3089
+ const whose = cloud ? "the team" : "the team of the project this local deployment is linked to";
3090
+ return finding(id, "pass", `${how}, which bills ${whose}; a free plan refuses it (AiGatewayDisabled), and no other gateway is tried.${unused} ${SPENDING_LIMIT}`);
3091
+ }
3092
+ if (local) {
3093
+ const login = "Run `npx convex login` to link the local deployment to a project on a paid plan, then restart `npx nuxt-backend dev`.";
3094
+ return finding(id, "warn", `${how}, which an anonymous local deployment cannot reach: those model calls are refused.`, alone ? `${login} Or: ${elsewhere}` : `${elsewhere} Or: ${login}`);
3095
+ }
3096
+ return finding(id, "warn", `${how}, which a self-hosted deployment never has: those model calls are refused.`, elsewhere);
3097
+ }
3098
+ function gatewayKeyFinding(deployed, { models, local, linked, cloud, provider, prod, region, gateways = ["convex", "vercel"], routes }) {
2743
3099
  const id = deploymentEnvId("AI_GATEWAY_API_KEY");
2744
3100
  const flag = prod ? " --prod" : "";
2745
3101
  const keyed = deployed.includes("AI_GATEWAY_API_KEY");
2746
3102
  if (models.length === 0) {
2747
3103
  return finding(id, "pass", keyed ? "AI_GATEWAY_API_KEY is set on the deployment." : "AI_GATEWAY_API_KEY is not set, and no backend file names a provider/model id that needs a model route.");
2748
3104
  }
2749
- if (region) {
2750
- if (keyed) return finding(id, "pass", `AI_GATEWAY_API_KEY is set on the deployment: ${listed(models)} go through the Vercel AI Gateway, pinned to the '${region}' inference region.`);
2751
- return finding(id, "warn", `The backend pins its model calls to the '${region}' inference region, which only the Vercel AI Gateway serves, but AI_GATEWAY_API_KEY is not set on the deployment: ${listed(models)} are refused.`, `Add AI_GATEWAY_API_KEY to .env.local and run \`npx nuxt-backend env push${flag}\`.`);
2752
- }
2753
- if (cloud) return cloudRouteFinding(id, models, { keyed, provider, flag });
3105
+ if (gateways === "unread" || routes === "unread") return unreadOrderFinding(id, models, routes === "unread" ? "routes" : "gateway");
3106
+ const routeless = Object.entries(routes ?? {}).find(([, order]) => !order.includes("vercel"))?.[0];
3107
+ if (region) return regionRouteFinding(id, models, { region, keyed, vercel: gateways.includes("vercel"), routeless, flag });
3108
+ const facts = { keyed, cloud, linked, local, provider, flag };
3109
+ const groups = routedGroups(models, gateways, routes);
3110
+ if (groups.length === 1 && groups[0].key === void 0) return orderRouteFinding(id, models, { gateways, ...facts });
3111
+ return routesFinding(id, groups.map((group) => ({ group, found: orderRouteFinding(id, group.models, { gateways: group.order, ...facts }) })));
3112
+ }
3113
+ function unreadOrderFinding(id, models, option) {
3114
+ const literal = option === "gateway" ? "'convex', 'vercel' or a list of them" : "a map of quoted model ids or patterns to 'convex', 'vercel' or a list of them";
3115
+ return finding(
3116
+ id,
3117
+ "warn",
3118
+ `${GATEWAY_ORDER_UNREAD}: setupAi({ ${option} }) is no literal it reads (a variable, the shorthand { ${option} }, ${option === "gateway" ? "an empty list" : "a computed key"}, spread options, or two setupAi calls that differ), so the route of ${listed(models)} is not checked.`,
3119
+ `Write \`${option}\` in setupAi as ${literal}, in one setupAi call, then run doctor again.`
3120
+ );
3121
+ }
3122
+ function routedGroups(models, gateways, routes) {
3123
+ const groups = /* @__PURE__ */ new Map();
3124
+ for (const model of models) {
3125
+ const key = routes ? routeKeyFor(model, routes) : void 0;
3126
+ const group = groups.get(key) ?? { key, order: key === void 0 ? gateways : routes[key], models: [] };
3127
+ group.models.push(model);
3128
+ groups.set(key, group);
3129
+ }
3130
+ return [...groups.values()];
3131
+ }
3132
+ const STATUS_RANK = { pass: 0, warn: 1, fail: 2 };
3133
+ function routesFinding(id, parts) {
3134
+ const routed = (text, key) => text.replace(/setupAi\(\{ gateway(?:: '[a-z]+')? \}\)/g, `its route '${key}' in setupAi({ routes })`);
3135
+ const said = parts.map(({ group, found }) => {
3136
+ if (group.key === void 0) return { ...found, message: `Under setupAi({ gateway })'s order: ${found.message}` };
3137
+ const unread = group.order.length === 1 && group.order[0] === "convex" ? ` AI_GATEWAY_API_KEY is never read for ${listed(group.models)}.` : "";
3138
+ return { ...found, message: `Routed by '${group.key}' (${group.order.join(", then ")}): ${routed(found.message, group.key)}${unread}`, fixHint: routed(found.fixHint, group.key) };
3139
+ });
3140
+ const worst = said.reduce((a, b) => STATUS_RANK[b.status] > STATUS_RANK[a.status] ? b : a);
3141
+ const hints = [...new Set(said.map((part) => part.fixHint).filter(Boolean))].sort((a, b) => Number(gatewayKeyIsTheFix({ fixHint: b })) - Number(gatewayKeyIsTheFix({ fixHint: a })));
3142
+ return finding(id, worst.status, said.map((part) => part.message).join(" "), hints.join(" "));
3143
+ }
3144
+ function orderRouteFinding(id, models, { gateways, ...facts }) {
3145
+ const vercelFirst = gateways[0] === "vercel";
3146
+ if (!gateways.includes("convex")) return vercelRouteFinding(id, models, facts);
3147
+ if (vercelFirst && facts.keyed) return finding(id, "pass", `AI_GATEWAY_API_KEY is set on the deployment: ${listed(models)} go through the Vercel AI Gateway, first in setupAi({ gateway }).`);
3148
+ if (vercelFirst || !gateways.includes("vercel")) return convexRouteFinding(id, models, { ...facts, alone: !vercelFirst });
3149
+ return defaultRouteFinding(id, models, facts);
3150
+ }
3151
+ function vercelRouteFinding(id, models, { keyed, flag }) {
3152
+ if (keyed) return finding(id, "pass", `AI_GATEWAY_API_KEY is set on the deployment: ${listed(models)} go through the Vercel AI Gateway (setupAi({ gateway: 'vercel' })).`);
3153
+ return finding(id, "warn", `setupAi({ gateway: 'vercel' }) sends ${listed(models)} through the Vercel AI Gateway alone, but AI_GATEWAY_API_KEY is not set on the deployment: those model calls are refused.`, keyFix(flag));
3154
+ }
3155
+ function defaultRouteFinding(id, models, { cloud, linked, local, provider, keyed, flag }) {
3156
+ if (cloud || linked) return cloudRouteFinding(id, models, { keyed, provider, flag });
2754
3157
  if (keyed) return finding(id, "pass", `AI_GATEWAY_API_KEY is set on the deployment: ${listed(models)} go through the Vercel AI Gateway.`);
2755
3158
  return finding(
2756
3159
  id,
2757
3160
  "warn",
2758
- `The backend names ${listed(models)}, but AI_GATEWAY_API_KEY is not set on the deployment${local && provider ? ", so those model calls go to the Convex AI Gateway only when the deployment is linked to a team that has it, and are refused otherwise" : ": those model calls are refused"}.`,
2759
- `Add AI_GATEWAY_API_KEY to .env.local and run \`npx nuxt-backend env push${flag}\`.`
3161
+ `The backend names ${listed(models)}, but AI_GATEWAY_API_KEY is not set on the deployment${local && provider ? ", and an anonymous local deployment cannot reach the Convex AI Gateway: those model calls are refused" : ": those model calls are refused"}.`,
3162
+ local && provider ? `${keyFix(flag)} Or run \`npx convex login\` to link the local deployment to a project on a paid plan.` : keyFix(flag)
2760
3163
  );
2761
3164
  }
3165
+ function regionRouteFinding(id, models, { region, keyed, vercel, routeless, flag }) {
3166
+ if (!vercel) {
3167
+ return finding(id, "warn", `The backend pins its model calls to the '${region}' inference region, which only the Vercel AI Gateway serves, but setupAi({ gateway }) does not name 'vercel': setupAi refuses the pin, and the push fails.`, "Add 'vercel' to setupAi({ gateway }), or drop inferenceRegion.");
3168
+ }
3169
+ if (routeless) {
3170
+ return finding(id, "warn", `The backend pins its model calls to the '${region}' inference region, which only the Vercel AI Gateway serves, but the route for '${routeless}' in setupAi({ routes }) does not name 'vercel': setupAi refuses the pin, and the push fails.`, `Add 'vercel' to the route for '${routeless}', or drop inferenceRegion.`);
3171
+ }
3172
+ if (keyed) return finding(id, "pass", `AI_GATEWAY_API_KEY is set on the deployment: ${listed(models)} go through the Vercel AI Gateway, pinned to the '${region}' inference region.`);
3173
+ return finding(id, "warn", `The backend pins its model calls to the '${region}' inference region, which only the Vercel AI Gateway serves, but AI_GATEWAY_API_KEY is not set on the deployment: ${listed(models)} are refused.`, keyFix(flag));
3174
+ }
2762
3175
  function provenanceKeyFinding(name, deployed, { on, prod }) {
2763
3176
  const id = deploymentEnvId(name);
2764
3177
  if (!on) return finding(id, "pass", `${name} is not needed: no backend file turns provenance on.`);
@@ -2804,10 +3217,10 @@ function declaredFeatureFindings(rootDir, { wants, deployed, prod }) {
2804
3217
  ];
2805
3218
  }
2806
3219
  function deploymentRoute(kind, prod) {
2807
- if (prod) return { local: false, cloud: kind !== "self-hosted" };
2808
- return { local: ["local", "anonymous"].includes(kind), cloud: ["cloud-dev", "preview", "production"].includes(kind) };
3220
+ if (prod) return { local: false, linked: false, cloud: kind !== "self-hosted" };
3221
+ return { local: ["local", "anonymous"].includes(kind), linked: kind === "local", cloud: ["cloud-dev", "preview", "production"].includes(kind) };
2809
3222
  }
2810
- function deploymentEnvFindings(rootDir, deployed, { prod, local, cloud, posture }) {
3223
+ function deploymentEnvFindings(rootDir, deployed, { prod, local, linked, cloud, posture }) {
2811
3224
  const sandboxInbox = prod && posture?.environment === "sandbox" && reExportsName(rootDir, "getSandboxInbox");
2812
3225
  if (!deployed) {
2813
3226
  return [finding("deployment-env", "warn", "Could not read the deployment env (no deployment configured, or `npx convex env list` failed).", "Run `npx convex dev` once to provision, then re-run doctor.")];
@@ -2818,17 +3231,81 @@ function deploymentEnvFindings(rootDir, deployed, { prod, local, cloud, posture
2818
3231
  // A name with no finding of its own (the marketing sender, the region) reports nothing yet.
2819
3232
  // The dev inbox's opt-in reports only once it is set: unset is every app's state, and nothing to say.
2820
3233
  ...Object.entries(OPTIONAL_DEPLOYMENT_ENV).filter(([name]) => !name.startsWith("PROTECTION_") && BACKEND_ENV[name].findings.length > 0 && (name !== "EMAIL_DEV_INBOX" || deployed.includes(name) || sandboxInbox)).map(([name, degradation]) => {
2821
- if (name === "AI_GATEWAY_API_KEY") return gatewayKeyFinding(deployed, { models: namedModels(rootDir), local, cloud, provider: convexGatewayProviderInstalled(rootDir), prod, region: pinnedRegion(rootDir) });
3234
+ if (name === "AI_GATEWAY_API_KEY") return gatewayKeyFinding(deployed, { models: namedModels(rootDir), local, linked, cloud, provider: convexGatewayProviderInstalled(rootDir), prod, region: pinnedRegion(rootDir), gateways: chosenGateways(rootDir), routes: chosenRoutes(rootDir) });
2822
3235
  if (name === "PROVENANCE_PRIVATE_KEY" || name === "PROVENANCE_CERTIFICATE") return provenanceKeyFinding(name, deployed, { on: usesProvenance(rootDir), prod });
3236
+ if (isModerationKey(name)) return moderationKeyFinding(name, moderationProviders(rootDir), deployed, { prod });
2823
3237
  if (name === "MONITORING_DSN") return monitoringDsnFinding(deployed.includes(name), { prod });
2824
3238
  if (name === "EMAIL_DEV_INBOX") return devInboxFinding({ prod, posture, set: deployed.includes(name) });
2825
3239
  const valued = posture ? productionEnvFinding(name, deployed, posture) : null;
2826
3240
  if (valued) return valued;
2827
3241
  return optionalDeploymentEnvFinding(name, degradation, deployed.includes(name), { prod });
2828
3242
  }),
2829
- removedEnvFinding(deployed, { prod })
3243
+ removedEnvFinding(deployed, { prod }),
3244
+ moderationImagesFinding(rootDir, deployed, { cloud, linked, prod }),
3245
+ moderationProvidersFinding(rootDir)
2830
3246
  ];
2831
3247
  }
3248
+ const EU_AZURE_REGIONS = /* @__PURE__ */ new Set(["austriaeast", "belgiumcentral", "denmarkeast", "francecentral", "francesouth", "germanynorth", "germanywestcentral", "italynorth", "northeurope", "polandcentral", "spaincentral", "swedencentral", "swedensouth", "westeurope"]);
3249
+ function moderationProvidersFinding(rootDir) {
3250
+ const id = "ai-moderation-providers";
3251
+ const providers = moderationProviders(rootDir);
3252
+ if (providers.length === 0) return finding(id, "pass", "The backend names no moderation provider: its safety classifier checks content alone.");
3253
+ const knownAbuse = providers.some((provider) => provider.id === "arachnid-shield");
3254
+ const problems = [unmatchedImages(rootDir, knownAbuse), regionOutsideEu(rootDir, providers)].filter((problem) => problem !== void 0);
3255
+ const minors = checksImages(rootDir) ? ` ${MINORS_NOTE}` : "";
3256
+ if (problems.length === 0) return finding(id, "pass", `The backend names ${listed(providers.map((provider) => provider.id))}${knownAbuse ? ", a known-abuse match first" : ""}.${minors}`);
3257
+ return finding(id, "warn", `${problems.map((problem) => problem.message).join(" ")}${minors}`, problems.map((problem) => problem.fix).join(" "));
3258
+ }
3259
+ const MINORS_NOTE = "No image provider judges minors in an image: child sexual abuse material no hash list knows is caught as `S4` by a classifier that reads images (Llama Guard 4), and otherwise only as `sexual`, which `block` covers.";
3260
+ const MODERATION_KEYS = /* @__PURE__ */ new Set(["CONTENT_SAFETY_ENDPOINT", "CONTENT_SAFETY_KEY", "SECOND_OPINION_KEY", "KNOWN_ABUSE_KEY"]);
3261
+ function isModerationKey(name) {
3262
+ return MODERATION_KEYS.has(name);
3263
+ }
3264
+ function moderationKeyFinding(name, providers, deployed, { prod }) {
3265
+ const id = deploymentEnvId(name);
3266
+ const readers = providers.filter((provider) => provider.env.includes(name)).map((provider) => provider.id);
3267
+ if (readers.length === 0) return finding(id, "pass", `${name} is not needed: no backend file names a moderation provider that reads it.`);
3268
+ if (deployed.includes(name)) return finding(id, "pass", `${name} is set on the deployment: ${listed(readers)} can check content.`);
3269
+ return finding(
3270
+ id,
3271
+ "warn",
3272
+ `The backend names ${listed(readers)}, but ${name} is not set on the deployment: every check it is asked for is refused, and the content is refused as unchecked.`,
3273
+ `Add ${name} to .env.local and run \`npx nuxt-backend env push${prod ? " --prod" : ""}\`.`
3274
+ );
3275
+ }
3276
+ function unmatchedImages(rootDir, knownAbuse) {
3277
+ if (knownAbuse || !checksImages(rootDir)) return void 0;
3278
+ return { message: "The backend checks images with no known-abuse match: no hash list stands between an upload of known child sexual abuse material and the other providers.", fix: "Add `knownAbuse: arachnidShield()` to setupAi({ moderation }) (free once your organization is vetted)." };
3279
+ }
3280
+ function regionOutsideEu(rootDir, providers) {
3281
+ const azure = providers.find((provider) => provider.id === "azure-content-safety");
3282
+ if (pinnedRegion(rootDir) !== "eu" || azure === void 0 || EU_AZURE_REGIONS.has(azure.region ?? "")) return void 0;
3283
+ const named = azure.region ? `'${azure.region}'` : "no region";
3284
+ return { message: `The backend pins its model calls to the EU, but azureContentSafety() names ${named}, which is no EU region: images it checks are processed outside the EU.`, fix: "Create the Content Safety resource in an EU region, such as francecentral, and name it in azureContentSafety({ region })." };
3285
+ }
3286
+ function answeringGateway(order, { keyed, convex }) {
3287
+ return order.find((gateway) => gateway === "vercel" ? keyed : convex);
3288
+ }
3289
+ function moderationImagesFinding(rootDir, deployed, { cloud, linked, prod }) {
3290
+ const id = "ai-moderation-images";
3291
+ if (!checksImages(rootDir)) return finding(id, "pass", "No backend file checks images with the safety classifier.");
3292
+ if (namesModerationModel(rootDir)) return finding(id, "pass", "The backend checks images with the classifier it names in setupAi({ moderation: { model } }).");
3293
+ const order = chosenGateways(rootDir);
3294
+ const routes = chosenRoutes(rootDir);
3295
+ if (order === "unread" || routes === "unread") return finding(id, "pass", `${GATEWAY_ORDER_UNREAD}, so which classifier checks the backend's images is not known.`);
3296
+ const pinned = pinnedRegion(rootDir) !== void 0;
3297
+ const convex = (cloud || linked || prod) && convexGatewayProviderInstalled(rootDir);
3298
+ const routed = routes ? routeKeyFor(DEFAULT_MODERATION_MODEL, routes) : void 0;
3299
+ const classifierOrder = routed === void 0 ? order ?? ["convex", "vercel"] : routes[routed];
3300
+ const answers = pinned ? "vercel" : answeringGateway(classifierOrder, { keyed: deployed.includes("AI_GATEWAY_API_KEY"), convex });
3301
+ if (answers !== "vercel") return finding(id, "pass", "The backend checks images with Llama Guard 4, through the Convex AI Gateway, which reads them.");
3302
+ return finding(
3303
+ id,
3304
+ "warn",
3305
+ `The backend checks images, but its default safety classifier goes through the Vercel AI Gateway here${pinned ? " (inference is pinned to a region)" : ""}, which serves none that reads images: openai/gpt-oss-safeguard-20b reads text only, so every check with images is refused as unchecked.`,
3306
+ "Route moderation through the Convex AI Gateway (a paid Convex plan, @convex-dev/ai-sdk-provider installed, and 'convex' first in setupAi({ gateway })), or name a classifier that reads images in setupAi({ moderation: { model } })."
3307
+ );
3308
+ }
2832
3309
  async function envDefaultsFindings(rootDir) {
2833
3310
  const names = await projectEnvDefaultNames(rootDir, "preview");
2834
3311
  if (!names) return [];
@@ -2925,13 +3402,14 @@ function readSurface(rootDir, { prod, reachable, siteUrl, wants, probes }) {
2925
3402
  function productionBillsIn({ environment }) {
2926
3403
  return environment === "unset" || environment === "unread" ? environment : billingEnvironment(environment);
2927
3404
  }
2928
- async function productionPostureFindings(rootDir, posture, wants) {
3405
+ async function productionPostureFindings(rootDir, posture, wants, { launch, deployed, cloud }) {
2929
3406
  if (!posture) return [];
2930
3407
  return [
2931
3408
  ...wants("auth") ? siteOriginFinding(posture) : [],
2932
3409
  ...wants("email") ? emailPostureFindings(posture) : [],
2933
- ...wants("billing") ? await productionCatalogFindings(rootDir, productionBillsIn(posture)) : [],
2934
- ...wants("ai") ? aiSpendLimitFinding(rootDir, posture) : []
3410
+ ...wants("billing") ? await productionCatalogFindings(rootDir, productionBillsIn(posture), launch?.launched ?? true) : [],
3411
+ ...wants("ai") ? aiSpendLimitFinding(rootDir, posture) : [],
3412
+ ...wants("ai") ? aiGatewayBudgetFinding(rootDir, posture, { deployed, cloud }) : []
2935
3413
  ];
2936
3414
  }
2937
3415
  function aiSpendLimitFinding(rootDir, posture) {
@@ -2946,12 +3424,52 @@ function aiSpendLimitFinding(rootDir, posture) {
2946
3424
  "Pass `spendLimit: { usdPerDay }` to setupAi in backend/ai.ts: once a UTC day costs that much, pause_ai turns on until the day ends."
2947
3425
  )];
2948
3426
  }
3427
+ const GATEWAY_CAP = {
3428
+ convex: {
3429
+ name: "the Convex AI Gateway",
3430
+ cap: "the team's spending limit, on its billing page",
3431
+ fix: "For the Convex AI Gateway, set the team's spending limit on its billing page in the Convex dashboard."
3432
+ },
3433
+ vercel: {
3434
+ name: "the Vercel AI Gateway",
3435
+ cap: "a budget on its key, the project or the team",
3436
+ fix: "For the Vercel AI Gateway: `vercel ai-gateway budgets set api-key <the key production holds> --amount <dollars> --refresh-period monthly`."
3437
+ }
3438
+ };
3439
+ function productionGateways(rootDir, deployed, cloud) {
3440
+ const models = namedModels(rootDir);
3441
+ const order = chosenGateways(rootDir);
3442
+ const routes = chosenRoutes(rootDir);
3443
+ if (models.length === 0 || order === "unread" || routes === "unread") return [];
3444
+ const keyed = deployed.includes("AI_GATEWAY_API_KEY");
3445
+ if (pinnedRegion(rootDir) !== void 0) return keyed ? ["vercel"] : [];
3446
+ const facts = { keyed, convex: cloud && convexGatewayProviderInstalled(rootDir) };
3447
+ const answering = routedGroups(models, order ?? ["convex", "vercel"], routes).map((group) => answeringGateway(group.order, facts));
3448
+ return [...new Set(answering.filter((gateway) => gateway !== void 0))];
3449
+ }
3450
+ function aiGatewayBudgetFinding(rootDir, posture, { deployed, cloud }) {
3451
+ if (posture.environment === "sandbox") return [];
3452
+ const { setupAi, spendLimit } = aiFeatures(rootDir);
3453
+ const gateways = setupAi ? productionGateways(rootDir, deployed, cloud) : [];
3454
+ if (gateways.length === 0) return [];
3455
+ const through = `Production's model calls go through ${gateways.map((gateway) => GATEWAY_CAP[gateway].name).join(" and ")}`;
3456
+ const unchecked = `Not checked: ${gateways.map((gateway) => `${GATEWAY_CAP[gateway].name}'s own cap, ${GATEWAY_CAP[gateway].cap}`).join("; ")}, as doctor reads no account of ${gateways.length === 1 ? "it" : "theirs"}.`;
3457
+ const fixes = gateways.map((gateway) => GATEWAY_CAP[gateway].fix).join(" ");
3458
+ if (spendLimit) return [finding("ai-gateway-budget", "pass", `${through}, and setupAi's daily spendLimit pauses AI once a UTC day's spend reaches it. ${unchecked}`, fixes)];
3459
+ return [finding(
3460
+ "ai-gateway-budget",
3461
+ "warn",
3462
+ `${through}, and setupAi sets no spendLimit: nothing doctor can read caps what they cost in dollars. ${unchecked}`,
3463
+ `Pass \`spendLimit: { usdPerDay }\` to setupAi in backend/ai.ts: once a UTC day costs that much, AI pauses itself until the day ends. And cap the gateway: ${fixes}`
3464
+ )];
3465
+ }
2949
3466
  async function scaffoldFindings(rootDir, appConfig) {
2950
3467
  return [
2951
3468
  ...await generatedFileFindings(rootDir, appConfig),
2952
3469
  ...devScriptFinding(rootDir),
2953
3470
  await convexConfigFinding(rootDir),
2954
3471
  agentFilesFinding(rootDir, installedVersion(rootDir)),
3472
+ ...envExampleFinding(rootDir),
2955
3473
  nameCollisionFinding(rootDir),
2956
3474
  ...bundleDuplicatesFindings(rootDir)
2957
3475
  ];
@@ -2962,7 +3480,7 @@ async function localFeatureFindings(rootDir, { env, wants, deployed, prod, appCo
2962
3480
  ...wants("monitoring") ? monitoringFindings(rootDir, { env, deployed, prod }) : [],
2963
3481
  ...declaredFeatureFindings(rootDir, { wants, deployed, prod }),
2964
3482
  // Production's own usage warnings: Convex emails the team; the deployment cannot read its usage itself.
2965
- ...wants("monitoring") && prod ? [usageAlertsFinding(await readUsageLimits(rootDir), { convexGateway: convexGatewayProviderInstalled(rootDir) })] : [],
3483
+ ...wants("monitoring") && prod ? [usageAlertsFinding(await readUsageLimits(rootDir), { convexGateway: convexGatewayProviderInstalled(rootDir) && (namesConvex(chosenGateways(rootDir)) || routesNameConvex(chosenRoutes(rootDir))) })] : [],
2966
3484
  ...wants("auth") ? await consentFindings(rootDir, { prod }) : [],
2967
3485
  // The installable app iPhone and iPad take web push from: the brand and the two icons.
2968
3486
  ...await installableFindings(rootDir, appConfig, { wanted: wants("notifications"), pushKeys: Boolean(env.PUSH_PUBLIC_KEY) || (deployed ?? []).includes("PUSH_PUBLIC_KEY") })
@@ -2974,16 +3492,19 @@ async function runDoctorChecks(rootDir, { prod, only, deployedNames, posture: gi
2974
3492
  const env = { ...readEnvFiles(rootDir), ...process.env };
2975
3493
  const appConfig = appConfigLoader(rootDir);
2976
3494
  const siteUrl = resolveSiteUrl({ env, derived: deriveDeploymentUrls(rootDir, env) });
2977
- const [{ deployed, surface, posture }, catalog, metrics] = await Promise.all([
3495
+ const namesRead = deployedNames !== void 0 ? Promise.resolve(deployedNames) : deploymentEnvNames(rootDir, { prod });
3496
+ const [{ deployed, surface, posture, launch }, catalog, metrics] = await Promise.all([
2978
3497
  (async () => {
2979
- const names = deployedNames !== void 0 ? deployedNames : await deploymentEnvNames(rootDir, { prod });
3498
+ const names = await namesRead;
2980
3499
  const posture2 = given ?? (prod && names ? readProductionPosture(rootDir, names, wants) : Promise.resolve(null));
2981
3500
  const [surface2, defaults, read] = await Promise.all([
2982
3501
  deployedSurfaceFindings(rootDir, { prod, deployed: names, env, local: !prod && isLocalDeploymentId(configuredDeployment(rootDir)), siteUrl, wants, posture: posture2, appConfig }),
2983
3502
  names !== null && !prod && wants("deployment") ? envDefaultsFindings(rootDir) : [],
2984
3503
  posture2
2985
3504
  ]);
2986
- return { deployed: names, surface: [...surface2, ...defaults, ...await productionPostureFindings(rootDir, read, wants)], posture: read };
3505
+ const launch2 = read && wants("billing") && productionBillsIn(read) === "production" ? await productionBillingLaunch(rootDir, names ?? []) : null;
3506
+ const cloud = deploymentRoute(computeDeployment(rootDir, env).kind, true).cloud;
3507
+ return { deployed: names, surface: [...surface2, ...defaults, ...await productionPostureFindings(rootDir, read, wants, { launch: launch2, deployed: names ?? [], cloud })], posture: read, launch: launch2 };
2987
3508
  })(),
2988
3509
  // Billing catalog cross-checks: what backend/billing.catalog.ts declares
2989
3510
  // against the organization's own subscription + portal settings. Every
@@ -2991,7 +3512,7 @@ async function runDoctorChecks(rootDir, { prod, only, deployedNames, posture: gi
2991
3512
  // provider, only the catalog-only checks (see collectBillingFindings).
2992
3513
  // Local files and the provider only, so they run beside the deployment
2993
3514
  // reads.
2994
- wants("billing") ? billingCatalogFindings(rootDir, env) : [],
3515
+ wants("billing") ? billingCatalogFindings(rootDir, env, { deployed: namesRead, prod }) : [],
2995
3516
  // The funnel's activation kind, recorded by a backend file; then the
2996
3517
  // Revenue view's metrics read, with the token visible here (analytics).
2997
3518
  wants("analytics") ? Promise.resolve(activationFindings(rootDir)) : [],
@@ -3011,7 +3532,11 @@ async function runDoctorChecks(rootDir, { prod, only, deployedNames, posture: gi
3011
3532
  ...catalog,
3012
3533
  ...metrics
3013
3534
  ].filter((reported) => wantsCapability(reported.capability));
3014
- return prod ? applyProductionPosture(findings, posture ? /* @__PURE__ */ new Set(["deployment-backend-environment"]) : void 0) : findings;
3535
+ return prod ? productionFindings(findings, { posture, launch }) : findings;
3536
+ }
3537
+ function productionFindings(findings, { posture, launch }) {
3538
+ const launched = launch ? withBillingLaunch(findings, launch) : { findings, settled: [] };
3539
+ return applyProductionPosture(launched.findings, /* @__PURE__ */ new Set([...posture ? ["deployment-backend-environment"] : [], ...launched.settled]));
3015
3540
  }
3016
3541
 
3017
3542
  const doctor = {
@@ -3021,4 +3546,4 @@ const doctor = {
3021
3546
  runDoctorChecks: runDoctorChecks
3022
3547
  };
3023
3548
 
3024
- export { email as $, findPlanProduct as A, isUntaggedPlanProduct as B, planCreditUnits as C, planQuotasBenefits as D, providerTrialOf as E, pushPlanTrial as F, attachPlanQuotas as G, isFreePlan as H, BILLING_WEBHOOK_PROVISION_EVENTS as I, planProductKey as J, recordPlanProduct as K, loadGenerated as L, MANAGED_BY as M, renderGenerated as N, probeWebhookRoute as O, PROVIDER_COMPONENT as P, runEmailSync as Q, planSettingChanges as R, planEndpointChanges as S, applyProviderChanges as T, billingProviderTarget as U, providerClient as V, readProviderOrganization as W, readProviderEndpoint as X, emailSyncRefusal as Y, runDoctorChecks as Z, readProductionPosture as _, refuseInvalidPrices as a, runEnvDefaults as a0, bootstrapAdmin as a1, runEmailSyncCommand as a2, ENV_DEFAULT_TYPES as a3, REQUIRED_FUNCTION_EXPORTS as a4, doctor as a5, refuseInvalidGifts as b, refuseInvalidQuotas as c, refuseInvalidDiscounts as d, listAllPages as e, freePlanOf as f, refuseMissingDefaultCurrency as g, refuseUnpricedDiscounts as h, isManaged as i, ensurePlanQuotas as j, retirePlan as k, loadCatalog as l, attachRetiredPlanQuotas as m, recordQuotaKeys as n, packPricesByCurrency as o, pricedIntervals as p, syncDiscounts as q, refuseUnpricedPlans as r, syncPassProducts as s, planQuotasKeys as t, derivedPassKeys as u, droppedQuotasKeys as v, unpricedPlanProducts as w, providerClientOptions as x, planQuotasKey as y, planPricesByCurrency as z };
3549
+ export { applyProviderChanges as $, planQuotasKey as A, planPricesByCurrency as B, findPlanProduct as C, isUntaggedPlanProduct as D, planCreditUnits as E, planQuotasBenefits as F, isFreePlan as G, zeroPrices as H, providerTrialOf as I, pushPlanTrial as J, attachPlanQuotas as K, BILLING_WEBHOOK_PROVISION_EVENTS as L, MANAGED_BY as M, planProductKey as N, recordPlanProduct as O, PROVIDER_COMPONENT as P, loadGenerated as Q, renderGenerated as R, runEmailSync as S, runInboundSync as T, emailSyncLines as U, runEmailSyncCommand as V, probeWebhookRoute as W, emailSyncRefusal as X, inboundSyncLines as Y, planSettingChanges as Z, planEndpointChanges as _, refuseInvalidPrices as a, billingProviderTarget as a0, providerClient as a1, readProviderOrganization as a2, readProviderEndpoint as a3, ADMISSION_DAYS as a4, CLI_ADMISSION_LABEL as a5, admitInputRefusal as a6, admitRefused as a7, admitCleaned as a8, runDoctorChecks as a9, readProductionPosture as aa, email as ab, runEnvDefaults as ac, firstAdministratorOnFix as ad, ENV_DEFAULT_TYPES as ae, REQUIRED_FUNCTION_EXPORTS as af, doctor as ag, refuseOnceCredits as b, refuseInvalidGifts as c, refuseInvalidQuotas as d, refuseInvalidDiscounts as e, freePlanOf as f, listAllPages as g, refuseMissingDefaultCurrency as h, isManaged as i, refuseMissingOrganizationCurrency as j, refuseUnpricedDiscounts as k, loadCatalog as l, ensurePlanQuotas as m, retirePlan as n, attachRetiredPlanQuotas as o, pricedIntervals as p, recordQuotaKeys as q, refuseUnpricedPlans as r, packPricesByCurrency as s, syncPassProducts as t, syncDiscounts as u, planQuotasKeys as v, derivedPassKeys as w, droppedQuotasKeys as x, unpricedPlanProducts as y, providerClientOptions as z };