nuxt-backend 0.1.0 → 0.2.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 (2968) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +261 -657
  3. package/dist/analyze/types.js +4 -0
  4. package/dist/capabilities/detect.js +217 -0
  5. package/dist/capabilities/health.js +29 -0
  6. package/dist/capabilities/registry.js +205 -0
  7. package/dist/capabilities/status.js +61 -0
  8. package/dist/capabilities/types.js +19 -0
  9. package/dist/chunks/catalog.mjs +39 -0
  10. package/dist/chunks/doctor.mjs +2965 -0
  11. package/dist/chunks/email-previews.mjs +77 -0
  12. package/dist/chunks/health.mjs +35 -0
  13. package/dist/chunks/index.mjs +234 -0
  14. package/dist/chunks/install.mjs +63 -0
  15. package/dist/chunks/report.mjs +150 -0
  16. package/dist/chunks/run.mjs +318 -0
  17. package/dist/chunks/server.mjs +1010 -0
  18. package/dist/cli.d.mts +1 -0
  19. package/dist/cli.mjs +3550 -0
  20. package/dist/convex/access-tickets.d.ts +134 -0
  21. package/dist/convex/access-tickets.d.ts.map +1 -0
  22. package/dist/convex/access-tickets.js +104 -0
  23. package/dist/convex/access-tickets.js.map +1 -0
  24. package/dist/convex/account-data.d.ts +457 -0
  25. package/dist/convex/account-data.d.ts.map +1 -0
  26. package/dist/convex/account-data.js +458 -0
  27. package/dist/convex/account-data.js.map +1 -0
  28. package/dist/convex/activation-rules.d.ts +89 -0
  29. package/dist/convex/activation-rules.d.ts.map +1 -0
  30. package/dist/convex/activation-rules.js +85 -0
  31. package/dist/convex/activation-rules.js.map +1 -0
  32. package/dist/convex/announcements.d.ts +50 -0
  33. package/dist/convex/announcements.d.ts.map +1 -0
  34. package/dist/convex/announcements.js +26 -0
  35. package/dist/convex/announcements.js.map +1 -0
  36. package/dist/convex/app.d.ts +107 -0
  37. package/dist/convex/app.d.ts.map +1 -0
  38. package/dist/convex/app.js +130 -0
  39. package/dist/convex/app.js.map +1 -0
  40. package/dist/convex/auth-secrets.d.ts +70 -0
  41. package/dist/convex/auth-secrets.d.ts.map +1 -0
  42. package/dist/convex/auth-secrets.js +102 -0
  43. package/dist/convex/auth-secrets.js.map +1 -0
  44. package/dist/convex/auth.config.d.ts +25 -1
  45. package/dist/convex/auth.config.d.ts.map +1 -1
  46. package/dist/convex/auth.config.js +20 -2
  47. package/dist/convex/auth.config.js.map +1 -1
  48. package/dist/convex/bytes.d.ts +3 -0
  49. package/dist/convex/bytes.d.ts.map +1 -0
  50. package/dist/convex/bytes.js +11 -0
  51. package/dist/convex/bytes.js.map +1 -0
  52. package/dist/convex/c2pa/cbor.d.ts +12 -0
  53. package/dist/convex/c2pa/cbor.d.ts.map +1 -0
  54. package/dist/convex/c2pa/cbor.js +81 -0
  55. package/dist/convex/c2pa/cbor.js.map +1 -0
  56. package/dist/convex/c2pa/der.d.ts +23 -0
  57. package/dist/convex/c2pa/der.d.ts.map +1 -0
  58. package/dist/convex/c2pa/der.js +88 -0
  59. package/dist/convex/c2pa/der.js.map +1 -0
  60. package/dist/convex/c2pa/formats.d.ts +25 -0
  61. package/dist/convex/c2pa/formats.d.ts.map +1 -0
  62. package/dist/convex/c2pa/formats.js +276 -0
  63. package/dist/convex/c2pa/formats.js.map +1 -0
  64. package/dist/convex/c2pa/jumbf.d.ts +16 -0
  65. package/dist/convex/c2pa/jumbf.d.ts.map +1 -0
  66. package/dist/convex/c2pa/jumbf.js +41 -0
  67. package/dist/convex/c2pa/jumbf.js.map +1 -0
  68. package/dist/convex/c2pa/manifest.d.ts +39 -0
  69. package/dist/convex/c2pa/manifest.d.ts.map +1 -0
  70. package/dist/convex/c2pa/manifest.js +161 -0
  71. package/dist/convex/c2pa/manifest.js.map +1 -0
  72. package/dist/convex/catalog.d.ts +459 -0
  73. package/dist/convex/catalog.d.ts.map +1 -0
  74. package/dist/convex/catalog.js +341 -0
  75. package/dist/convex/catalog.js.map +1 -0
  76. package/dist/convex/client/age-gate.d.ts +38 -0
  77. package/dist/convex/client/age-gate.d.ts.map +1 -0
  78. package/dist/convex/client/age-gate.js +129 -0
  79. package/dist/convex/client/age-gate.js.map +1 -0
  80. package/dist/convex/client/audit.d.ts +36 -0
  81. package/dist/convex/client/audit.d.ts.map +1 -0
  82. package/dist/convex/client/audit.js +278 -0
  83. package/dist/convex/client/audit.js.map +1 -0
  84. package/dist/convex/client/auth-types.d.ts +342 -0
  85. package/dist/convex/client/auth-types.d.ts.map +1 -0
  86. package/dist/convex/client/auth-types.js +2 -0
  87. package/dist/convex/client/auth-types.js.map +1 -0
  88. package/dist/convex/client/better-auth-options.d.ts +21 -0
  89. package/dist/convex/client/better-auth-options.d.ts.map +1 -0
  90. package/dist/convex/client/better-auth-options.js +468 -0
  91. package/dist/convex/client/better-auth-options.js.map +1 -0
  92. package/dist/convex/client/code-binding.d.ts +23 -0
  93. package/dist/convex/client/code-binding.d.ts.map +1 -0
  94. package/dist/convex/client/code-binding.js +100 -0
  95. package/dist/convex/client/code-binding.js.map +1 -0
  96. package/dist/convex/client/codes.d.ts +26 -0
  97. package/dist/convex/client/codes.d.ts.map +1 -0
  98. package/dist/convex/client/codes.js +46 -0
  99. package/dist/convex/client/codes.js.map +1 -0
  100. package/dist/convex/client/component.d.ts +185 -0
  101. package/dist/convex/client/component.d.ts.map +1 -0
  102. package/dist/convex/client/component.js +139 -0
  103. package/dist/convex/client/component.js.map +1 -0
  104. package/dist/convex/client/devices.d.ts +2 -0
  105. package/dist/convex/client/devices.d.ts.map +1 -0
  106. package/dist/convex/client/devices.js +188 -0
  107. package/dist/convex/client/devices.js.map +1 -0
  108. package/dist/convex/client/email.d.ts +10 -0
  109. package/dist/convex/client/email.d.ts.map +1 -0
  110. package/dist/convex/client/email.js +78 -0
  111. package/dist/convex/client/email.js.map +1 -0
  112. package/dist/convex/client/entities.d.ts +22 -0
  113. package/dist/convex/client/entities.d.ts.map +1 -0
  114. package/dist/convex/client/entities.js +82 -0
  115. package/dist/convex/client/entities.js.map +1 -0
  116. package/dist/convex/client/guards.d.ts +121 -0
  117. package/dist/convex/client/guards.d.ts.map +1 -0
  118. package/dist/convex/client/guards.js +874 -0
  119. package/dist/convex/client/guards.js.map +1 -0
  120. package/dist/convex/client/guest-claim.d.ts +21 -0
  121. package/dist/convex/client/guest-claim.d.ts.map +1 -0
  122. package/dist/convex/client/guest-claim.js +45 -0
  123. package/dist/convex/client/guest-claim.js.map +1 -0
  124. package/dist/convex/client/hooks.d.ts +23 -0
  125. package/dist/convex/client/hooks.d.ts.map +1 -0
  126. package/dist/convex/client/hooks.js +69 -0
  127. package/dist/convex/client/hooks.js.map +1 -0
  128. package/dist/convex/client/identity.d.ts +3 -0
  129. package/dist/convex/client/identity.d.ts.map +1 -0
  130. package/dist/convex/client/identity.js +8 -0
  131. package/dist/convex/client/identity.js.map +1 -0
  132. package/dist/convex/client/index.d.ts +1817 -11540
  133. package/dist/convex/client/index.d.ts.map +1 -1
  134. package/dist/convex/client/index.js +226 -200
  135. package/dist/convex/client/index.js.map +1 -1
  136. package/dist/convex/client/launch-gate.d.ts +69 -0
  137. package/dist/convex/client/launch-gate.d.ts.map +1 -0
  138. package/dist/convex/client/launch-gate.js +212 -0
  139. package/dist/convex/client/launch-gate.js.map +1 -0
  140. package/dist/convex/client/notices.d.ts +11 -0
  141. package/dist/convex/client/notices.d.ts.map +1 -0
  142. package/dist/convex/client/notices.js +38 -0
  143. package/dist/convex/client/notices.js.map +1 -0
  144. package/dist/convex/client/passkey-only.d.ts +86 -0
  145. package/dist/convex/client/passkey-only.d.ts.map +1 -0
  146. package/dist/convex/client/passkey-only.js +339 -0
  147. package/dist/convex/client/passkey-only.js.map +1 -0
  148. package/dist/convex/client/plugins.d.ts +1686 -0
  149. package/dist/convex/client/plugins.d.ts.map +1 -0
  150. package/dist/convex/client/plugins.js +185 -0
  151. package/dist/convex/client/plugins.js.map +1 -0
  152. package/dist/convex/client/refusals.d.ts +16 -0
  153. package/dist/convex/client/refusals.d.ts.map +1 -0
  154. package/dist/convex/client/refusals.js +32 -0
  155. package/dist/convex/client/refusals.js.map +1 -0
  156. package/dist/convex/client/request-origin.d.ts +13 -0
  157. package/dist/convex/client/request-origin.d.ts.map +1 -0
  158. package/dist/convex/client/request-origin.js +99 -0
  159. package/dist/convex/client/request-origin.js.map +1 -0
  160. package/dist/convex/client/request-session.d.ts +33 -0
  161. package/dist/convex/client/request-session.d.ts.map +1 -0
  162. package/dist/convex/client/request-session.js +62 -0
  163. package/dist/convex/client/request-session.js.map +1 -0
  164. package/dist/convex/client/runtime.d.ts +93 -0
  165. package/dist/convex/client/runtime.d.ts.map +1 -0
  166. package/dist/convex/client/runtime.js +10 -0
  167. package/dist/convex/client/runtime.js.map +1 -0
  168. package/dist/convex/client/secret-rotation.d.ts +16 -0
  169. package/dist/convex/client/secret-rotation.d.ts.map +1 -0
  170. package/dist/convex/client/secret-rotation.js +113 -0
  171. package/dist/convex/client/secret-rotation.js.map +1 -0
  172. package/dist/convex/client/sessions.d.ts +28 -0
  173. package/dist/convex/client/sessions.d.ts.map +1 -0
  174. package/dist/convex/client/sessions.js +36 -0
  175. package/dist/convex/client/sessions.js.map +1 -0
  176. package/dist/convex/client/workspaces.d.ts +40 -0
  177. package/dist/convex/client/workspaces.d.ts.map +1 -0
  178. package/dist/convex/client/workspaces.js +110 -0
  179. package/dist/convex/client/workspaces.js.map +1 -0
  180. package/dist/convex/components/backend/_generated/api.d.ts +116 -0
  181. package/dist/convex/components/backend/_generated/api.d.ts.map +1 -0
  182. package/dist/convex/components/backend/_generated/api.js.map +1 -0
  183. package/dist/convex/components/backend/_generated/component.d.ts +3875 -0
  184. package/dist/convex/components/backend/_generated/component.d.ts.map +1 -0
  185. package/dist/convex/components/backend/_generated/component.js.map +1 -0
  186. package/dist/convex/components/backend/_generated/dataModel.d.ts.map +1 -0
  187. package/dist/convex/components/backend/_generated/dataModel.js.map +1 -0
  188. package/dist/convex/components/backend/_generated/server.d.ts +138 -0
  189. package/dist/convex/components/backend/_generated/server.d.ts.map +1 -0
  190. package/dist/convex/components/backend/_generated/server.js +80 -0
  191. package/dist/convex/components/backend/_generated/server.js.map +1 -0
  192. package/dist/convex/components/backend/access.d.ts +188 -0
  193. package/dist/convex/components/backend/access.d.ts.map +1 -0
  194. package/dist/convex/components/backend/access.js +428 -0
  195. package/dist/convex/components/backend/access.js.map +1 -0
  196. package/dist/convex/components/backend/account.d.ts +626 -0
  197. package/dist/convex/components/backend/account.d.ts.map +1 -0
  198. package/dist/convex/components/backend/account.js +1013 -0
  199. package/dist/convex/components/backend/account.js.map +1 -0
  200. package/dist/convex/components/backend/adapter.d.ts.map +1 -0
  201. package/dist/convex/components/backend/adapter.js +42 -0
  202. package/dist/convex/components/backend/adapter.js.map +1 -0
  203. package/dist/convex/components/backend/ai.d.ts +210 -0
  204. package/dist/convex/components/backend/ai.d.ts.map +1 -0
  205. package/dist/convex/components/backend/ai.js +382 -0
  206. package/dist/convex/components/backend/ai.js.map +1 -0
  207. package/dist/convex/components/backend/alerts.d.ts +87 -0
  208. package/dist/convex/components/backend/alerts.d.ts.map +1 -0
  209. package/dist/convex/components/backend/alerts.js +182 -0
  210. package/dist/convex/components/backend/alerts.js.map +1 -0
  211. package/dist/convex/components/backend/announcements.d.ts +155 -0
  212. package/dist/convex/components/backend/announcements.d.ts.map +1 -0
  213. package/dist/convex/components/backend/announcements.js +253 -0
  214. package/dist/convex/components/backend/announcements.js.map +1 -0
  215. package/dist/convex/components/backend/audit.d.ts +185 -0
  216. package/dist/convex/components/backend/audit.d.ts.map +1 -0
  217. package/dist/convex/components/backend/audit.js +315 -0
  218. package/dist/convex/components/backend/audit.js.map +1 -0
  219. package/dist/convex/components/backend/billing.d.ts +345 -0
  220. package/dist/convex/components/backend/billing.d.ts.map +1 -0
  221. package/dist/convex/components/backend/billing.js +740 -0
  222. package/dist/convex/components/backend/billing.js.map +1 -0
  223. package/dist/convex/components/backend/consents.d.ts +121 -0
  224. package/dist/convex/components/backend/consents.d.ts.map +1 -0
  225. package/dist/convex/components/backend/consents.js +148 -0
  226. package/dist/convex/components/backend/consents.js.map +1 -0
  227. package/dist/convex/components/backend/convex.config.d.ts +60 -0
  228. package/dist/convex/components/backend/convex.config.d.ts.map +1 -0
  229. package/dist/convex/components/backend/convex.config.js +73 -0
  230. package/dist/convex/components/backend/convex.config.js.map +1 -0
  231. package/dist/convex/components/backend/costs.d.ts +130 -0
  232. package/dist/convex/components/backend/costs.d.ts.map +1 -0
  233. package/dist/convex/components/backend/costs.js +260 -0
  234. package/dist/convex/components/backend/costs.js.map +1 -0
  235. package/dist/convex/components/backend/crons.d.ts +3 -0
  236. package/dist/convex/components/backend/crons.d.ts.map +1 -0
  237. package/dist/convex/components/backend/crons.js +22 -0
  238. package/dist/convex/components/backend/crons.js.map +1 -0
  239. package/dist/convex/components/backend/devices.d.ts +67 -0
  240. package/dist/convex/components/backend/devices.d.ts.map +1 -0
  241. package/dist/convex/components/backend/devices.js +184 -0
  242. package/dist/convex/components/backend/devices.js.map +1 -0
  243. package/dist/convex/components/backend/email.d.ts +304 -0
  244. package/dist/convex/components/backend/email.d.ts.map +1 -0
  245. package/dist/convex/components/backend/email.js +628 -0
  246. package/dist/convex/components/backend/email.js.map +1 -0
  247. package/dist/convex/components/backend/erasures.d.ts +41 -0
  248. package/dist/convex/components/backend/erasures.d.ts.map +1 -0
  249. package/dist/convex/components/backend/erasures.js +70 -0
  250. package/dist/convex/components/backend/erasures.js.map +1 -0
  251. package/dist/convex/components/backend/flags.d.ts +56 -0
  252. package/dist/convex/components/backend/flags.d.ts.map +1 -0
  253. package/dist/convex/components/backend/flags.js +81 -0
  254. package/dist/convex/components/backend/flags.js.map +1 -0
  255. package/dist/convex/components/backend/funnel.d.ts +452 -0
  256. package/dist/convex/components/backend/funnel.d.ts.map +1 -0
  257. package/dist/convex/components/backend/funnel.js +525 -0
  258. package/dist/convex/components/backend/funnel.js.map +1 -0
  259. package/dist/convex/components/backend/gifts.d.ts +438 -0
  260. package/dist/convex/components/backend/gifts.d.ts.map +1 -0
  261. package/dist/convex/components/backend/gifts.js +711 -0
  262. package/dist/convex/components/backend/gifts.js.map +1 -0
  263. package/dist/convex/components/backend/inbound.d.ts +121 -0
  264. package/dist/convex/components/backend/inbound.d.ts.map +1 -0
  265. package/dist/convex/components/backend/inbound.js +367 -0
  266. package/dist/convex/components/backend/inbound.js.map +1 -0
  267. package/dist/convex/components/backend/jobs.d.ts +785 -0
  268. package/dist/convex/components/backend/jobs.d.ts.map +1 -0
  269. package/dist/convex/components/backend/jobs.js +912 -0
  270. package/dist/convex/components/backend/jobs.js.map +1 -0
  271. package/dist/convex/components/backend/keys.d.ts +9 -0
  272. package/dist/convex/components/backend/keys.d.ts.map +1 -0
  273. package/dist/convex/components/backend/keys.js +49 -0
  274. package/dist/convex/components/backend/keys.js.map +1 -0
  275. package/dist/convex/components/backend/lifecycle.d.ts +123 -0
  276. package/dist/convex/components/backend/lifecycle.d.ts.map +1 -0
  277. package/dist/convex/components/backend/lifecycle.js +337 -0
  278. package/dist/convex/components/backend/lifecycle.js.map +1 -0
  279. package/dist/convex/components/backend/lifecycleActivity.d.ts +9 -0
  280. package/dist/convex/components/backend/lifecycleActivity.d.ts.map +1 -0
  281. package/dist/convex/components/backend/lifecycleActivity.js +31 -0
  282. package/dist/convex/components/backend/lifecycleActivity.js.map +1 -0
  283. package/dist/convex/components/backend/maintenance.d.ts +115 -0
  284. package/dist/convex/components/backend/maintenance.d.ts.map +1 -0
  285. package/dist/convex/components/backend/maintenance.js +428 -0
  286. package/dist/convex/components/backend/maintenance.js.map +1 -0
  287. package/dist/convex/components/backend/migrations.d.ts +47 -0
  288. package/dist/convex/components/backend/migrations.d.ts.map +1 -0
  289. package/dist/convex/components/backend/migrations.js +115 -0
  290. package/dist/convex/components/backend/migrations.js.map +1 -0
  291. package/dist/convex/components/backend/monitoring.d.ts +29 -0
  292. package/dist/convex/components/backend/monitoring.d.ts.map +1 -0
  293. package/dist/convex/components/backend/monitoring.js +56 -0
  294. package/dist/convex/components/backend/monitoring.js.map +1 -0
  295. package/dist/convex/components/backend/notifications.d.ts +257 -0
  296. package/dist/convex/components/backend/notifications.d.ts.map +1 -0
  297. package/dist/convex/components/backend/notifications.js +439 -0
  298. package/dist/convex/components/backend/notifications.js.map +1 -0
  299. package/dist/convex/components/backend/onboarding.d.ts +16 -0
  300. package/dist/convex/components/backend/onboarding.d.ts.map +1 -0
  301. package/dist/convex/components/backend/onboarding.js +51 -0
  302. package/dist/convex/components/backend/onboarding.js.map +1 -0
  303. package/dist/convex/components/backend/parties.d.ts +39 -0
  304. package/dist/convex/components/backend/parties.d.ts.map +1 -0
  305. package/dist/convex/components/backend/parties.js +66 -0
  306. package/dist/convex/components/backend/parties.js.map +1 -0
  307. package/dist/convex/components/backend/posture.d.ts +3 -0
  308. package/dist/convex/components/backend/posture.d.ts.map +1 -0
  309. package/dist/convex/components/backend/posture.js +33 -0
  310. package/dist/convex/components/backend/posture.js.map +1 -0
  311. package/dist/convex/components/backend/preferences.d.ts +343 -0
  312. package/dist/convex/components/backend/preferences.d.ts.map +1 -0
  313. package/dist/convex/components/backend/preferences.js +684 -0
  314. package/dist/convex/components/backend/preferences.js.map +1 -0
  315. package/dist/convex/components/backend/push.d.ts +56 -0
  316. package/dist/convex/components/backend/push.d.ts.map +1 -0
  317. package/dist/convex/components/backend/push.js +91 -0
  318. package/dist/convex/components/backend/push.js.map +1 -0
  319. package/dist/convex/components/backend/referrals.d.ts +277 -0
  320. package/dist/convex/components/backend/referrals.d.ts.map +1 -0
  321. package/dist/convex/components/backend/referrals.js +711 -0
  322. package/dist/convex/components/backend/referrals.js.map +1 -0
  323. package/dist/convex/components/backend/reports.d.ts +218 -0
  324. package/dist/convex/components/backend/reports.d.ts.map +1 -0
  325. package/dist/convex/components/backend/reports.js +598 -0
  326. package/dist/convex/components/backend/reports.js.map +1 -0
  327. package/dist/convex/components/backend/schema.d.ts +6962 -0
  328. package/dist/convex/components/backend/schema.d.ts.map +1 -0
  329. package/dist/convex/components/backend/schema.js +2117 -0
  330. package/dist/convex/components/backend/schema.js.map +1 -0
  331. package/dist/convex/components/backend/storage.d.ts +236 -0
  332. package/dist/convex/components/backend/storage.d.ts.map +1 -0
  333. package/dist/convex/components/backend/storage.js +679 -0
  334. package/dist/convex/components/backend/storage.js.map +1 -0
  335. package/dist/convex/components/backend/subscriptions.d.ts +185 -0
  336. package/dist/convex/components/backend/subscriptions.d.ts.map +1 -0
  337. package/dist/convex/components/backend/subscriptions.js +259 -0
  338. package/dist/convex/components/backend/subscriptions.js.map +1 -0
  339. package/dist/convex/components/backend/suppressions.d.ts +68 -0
  340. package/dist/convex/components/backend/suppressions.d.ts.map +1 -0
  341. package/dist/convex/components/backend/suppressions.js +107 -0
  342. package/dist/convex/components/backend/suppressions.js.map +1 -0
  343. package/dist/convex/components/backend/waitlist.d.ts +202 -0
  344. package/dist/convex/components/backend/waitlist.d.ts.map +1 -0
  345. package/dist/convex/components/backend/waitlist.js +693 -0
  346. package/dist/convex/components/backend/waitlist.js.map +1 -0
  347. package/dist/convex/components/backend/wake.d.ts +2 -0
  348. package/dist/convex/components/backend/wake.d.ts.map +1 -0
  349. package/dist/convex/components/backend/wake.js +14 -0
  350. package/dist/convex/components/backend/wake.js.map +1 -0
  351. package/dist/convex/components/backend/webhooks.d.ts +64 -0
  352. package/dist/convex/components/backend/webhooks.d.ts.map +1 -0
  353. package/dist/convex/components/backend/webhooks.js +265 -0
  354. package/dist/convex/components/backend/webhooks.js.map +1 -0
  355. package/dist/convex/consent-rules.d.ts +72 -0
  356. package/dist/convex/consent-rules.d.ts.map +1 -0
  357. package/dist/convex/consent-rules.js +108 -0
  358. package/dist/convex/consent-rules.js.map +1 -0
  359. package/dist/convex/constants.d.ts +177 -0
  360. package/dist/convex/constants.d.ts.map +1 -0
  361. package/dist/convex/constants.js +185 -0
  362. package/dist/convex/constants.js.map +1 -0
  363. package/dist/convex/delivery.d.ts +39 -0
  364. package/dist/convex/delivery.d.ts.map +1 -0
  365. package/dist/convex/delivery.js +71 -0
  366. package/dist/convex/delivery.js.map +1 -0
  367. package/dist/convex/email-blocks.d.ts +35 -0
  368. package/dist/convex/email-blocks.d.ts.map +1 -0
  369. package/dist/convex/email-blocks.js +79 -0
  370. package/dist/convex/email-blocks.js.map +1 -0
  371. package/dist/convex/email-helpers.d.ts +44 -0
  372. package/dist/convex/email-helpers.d.ts.map +1 -0
  373. package/dist/convex/email-helpers.js +87 -0
  374. package/dist/convex/email-helpers.js.map +1 -0
  375. package/dist/convex/email-html.d.ts +14 -0
  376. package/dist/convex/email-html.d.ts.map +1 -0
  377. package/dist/convex/email-html.js +18 -0
  378. package/dist/convex/email-html.js.map +1 -0
  379. package/dist/convex/email-posture.d.ts +78 -0
  380. package/dist/convex/email-posture.d.ts.map +1 -0
  381. package/dist/convex/email-posture.js +151 -0
  382. package/dist/convex/email-posture.js.map +1 -0
  383. package/dist/convex/email-preferences.d.ts +163 -0
  384. package/dist/convex/email-preferences.d.ts.map +1 -0
  385. package/dist/convex/email-preferences.js +230 -0
  386. package/dist/convex/email-preferences.js.map +1 -0
  387. package/dist/convex/email-scheme.d.ts +12 -0
  388. package/dist/convex/email-scheme.d.ts.map +1 -0
  389. package/dist/convex/email-scheme.js +17 -0
  390. package/dist/convex/email-scheme.js.map +1 -0
  391. package/dist/convex/email-templates.d.ts +534 -0
  392. package/dist/convex/email-templates.d.ts.map +1 -0
  393. package/dist/convex/email-templates.js +481 -0
  394. package/dist/convex/email-templates.js.map +1 -0
  395. package/dist/convex/email-theme.d.ts +63 -0
  396. package/dist/convex/email-theme.d.ts.map +1 -0
  397. package/dist/convex/email-theme.js +130 -0
  398. package/dist/convex/email-theme.js.map +1 -0
  399. package/dist/convex/email-validators.d.ts +37 -0
  400. package/dist/convex/email-validators.d.ts.map +1 -0
  401. package/dist/convex/email-validators.js +26 -0
  402. package/dist/convex/email-validators.js.map +1 -0
  403. package/dist/convex/emails/appeal-decided.d.ts +4 -0
  404. package/dist/convex/emails/appeal-decided.d.ts.map +1 -0
  405. package/dist/convex/emails/appeal-decided.js +15 -0
  406. package/dist/convex/emails/appeal-decided.js.map +1 -0
  407. package/dist/convex/emails/content-restricted.d.ts +9 -0
  408. package/dist/convex/emails/content-restricted.d.ts.map +1 -0
  409. package/dist/convex/emails/content-restricted.js +28 -0
  410. package/dist/convex/emails/content-restricted.js.map +1 -0
  411. package/dist/convex/emails/deletion-canceled.d.ts +4 -0
  412. package/dist/convex/emails/deletion-canceled.d.ts.map +1 -0
  413. package/dist/convex/emails/deletion-canceled.js +7 -0
  414. package/dist/convex/emails/deletion-canceled.js.map +1 -0
  415. package/dist/convex/emails/deletion-scheduled.d.ts +4 -0
  416. package/dist/convex/emails/deletion-scheduled.d.ts.map +1 -0
  417. package/dist/convex/emails/deletion-scheduled.js +17 -0
  418. package/dist/convex/emails/deletion-scheduled.js.map +1 -0
  419. package/dist/convex/emails/email-changed.d.ts +4 -0
  420. package/dist/convex/emails/email-changed.d.ts.map +1 -0
  421. package/dist/convex/emails/email-changed.js +12 -0
  422. package/dist/convex/emails/email-changed.js.map +1 -0
  423. package/dist/convex/emails/gift-pass-ending.d.ts +4 -0
  424. package/dist/convex/emails/gift-pass-ending.d.ts.map +1 -0
  425. package/dist/convex/emails/gift-pass-ending.js +17 -0
  426. package/dist/convex/emails/gift-pass-ending.js.map +1 -0
  427. package/dist/convex/emails/gift.d.ts +4 -0
  428. package/dist/convex/emails/gift.d.ts.map +1 -0
  429. package/dist/convex/emails/gift.js +17 -0
  430. package/dist/convex/emails/gift.js.map +1 -0
  431. package/dist/convex/emails/invite.d.ts +9 -0
  432. package/dist/convex/emails/invite.d.ts.map +1 -0
  433. package/dist/convex/emails/invite.js +26 -0
  434. package/dist/convex/emails/invite.js.map +1 -0
  435. package/dist/convex/emails/new-device.d.ts +8 -0
  436. package/dist/convex/emails/new-device.d.ts.map +1 -0
  437. package/dist/convex/emails/new-device.js +20 -0
  438. package/dist/convex/emails/new-device.js.map +1 -0
  439. package/dist/convex/emails/notice-decided.d.ts +4 -0
  440. package/dist/convex/emails/notice-decided.d.ts.map +1 -0
  441. package/dist/convex/emails/notice-decided.js +15 -0
  442. package/dist/convex/emails/notice-decided.js.map +1 -0
  443. package/dist/convex/emails/notice-received.d.ts +4 -0
  444. package/dist/convex/emails/notice-received.d.ts.map +1 -0
  445. package/dist/convex/emails/notice-received.js +14 -0
  446. package/dist/convex/emails/notice-received.js.map +1 -0
  447. package/dist/convex/emails/otp.d.ts +10 -0
  448. package/dist/convex/emails/otp.d.ts.map +1 -0
  449. package/dist/convex/emails/otp.js +47 -0
  450. package/dist/convex/emails/otp.js.map +1 -0
  451. package/dist/convex/emails/passkey-recovered.d.ts +8 -0
  452. package/dist/convex/emails/passkey-recovered.d.ts.map +1 -0
  453. package/dist/convex/emails/passkey-recovered.js +20 -0
  454. package/dist/convex/emails/passkey-recovered.js.map +1 -0
  455. package/dist/convex/emails/renewal-reminder.d.ts +4 -0
  456. package/dist/convex/emails/renewal-reminder.d.ts.map +1 -0
  457. package/dist/convex/emails/renewal-reminder.js +19 -0
  458. package/dist/convex/emails/renewal-reminder.js.map +1 -0
  459. package/dist/convex/emails/topic-confirmation.d.ts +4 -0
  460. package/dist/convex/emails/topic-confirmation.d.ts.map +1 -0
  461. package/dist/convex/emails/topic-confirmation.js +16 -0
  462. package/dist/convex/emails/topic-confirmation.js.map +1 -0
  463. package/dist/convex/emails/waitlist-admitted.d.ts +4 -0
  464. package/dist/convex/emails/waitlist-admitted.d.ts.map +1 -0
  465. package/dist/convex/emails/waitlist-admitted.js +15 -0
  466. package/dist/convex/emails/waitlist-admitted.js.map +1 -0
  467. package/dist/convex/emails/waitlist-confirmation.d.ts +4 -0
  468. package/dist/convex/emails/waitlist-confirmation.d.ts.map +1 -0
  469. package/dist/convex/emails/waitlist-confirmation.js +18 -0
  470. package/dist/convex/emails/waitlist-confirmation.js.map +1 -0
  471. package/dist/convex/emails/welcome.d.ts +4 -0
  472. package/dist/convex/emails/welcome.d.ts.map +1 -0
  473. package/dist/convex/emails/welcome.js +14 -0
  474. package/dist/convex/emails/welcome.js.map +1 -0
  475. package/dist/convex/emails/withdrawal-receipt.d.ts +4 -0
  476. package/dist/convex/emails/withdrawal-receipt.d.ts.map +1 -0
  477. package/dist/convex/emails/withdrawal-receipt.js +15 -0
  478. package/dist/convex/emails/withdrawal-receipt.js.map +1 -0
  479. package/dist/convex/environment.d.ts +43 -0
  480. package/dist/convex/environment.d.ts.map +1 -0
  481. package/dist/convex/environment.js +64 -0
  482. package/dist/convex/environment.js.map +1 -0
  483. package/dist/convex/errors.d.ts +297 -0
  484. package/dist/convex/errors.d.ts.map +1 -0
  485. package/dist/convex/errors.js +382 -0
  486. package/dist/convex/errors.js.map +1 -0
  487. package/dist/convex/events.d.ts +875 -0
  488. package/dist/convex/events.d.ts.map +1 -0
  489. package/dist/convex/events.js +717 -0
  490. package/dist/convex/events.js.map +1 -0
  491. package/dist/convex/files.d.ts +57 -0
  492. package/dist/convex/files.d.ts.map +1 -0
  493. package/dist/convex/files.js +415 -0
  494. package/dist/convex/files.js.map +1 -0
  495. package/dist/convex/flags.d.ts +171 -0
  496. package/dist/convex/flags.d.ts.map +1 -0
  497. package/dist/convex/flags.js +270 -0
  498. package/dist/convex/flags.js.map +1 -0
  499. package/dist/convex/funnel-rules.d.ts +151 -0
  500. package/dist/convex/funnel-rules.d.ts.map +1 -0
  501. package/dist/convex/funnel-rules.js +163 -0
  502. package/dist/convex/funnel-rules.js.map +1 -0
  503. package/dist/convex/inbound-rules.d.ts +128 -0
  504. package/dist/convex/inbound-rules.d.ts.map +1 -0
  505. package/dist/convex/inbound-rules.js +175 -0
  506. package/dist/convex/inbound-rules.js.map +1 -0
  507. package/dist/convex/integrations/access.d.ts +163 -0
  508. package/dist/convex/integrations/access.d.ts.map +1 -0
  509. package/dist/convex/integrations/access.js +199 -0
  510. package/dist/convex/integrations/access.js.map +1 -0
  511. package/dist/convex/integrations/account.d.ts +458 -0
  512. package/dist/convex/integrations/account.d.ts.map +1 -0
  513. package/dist/convex/integrations/account.js +587 -0
  514. package/dist/convex/integrations/account.js.map +1 -0
  515. package/dist/convex/integrations/admin.d.ts +272 -0
  516. package/dist/convex/integrations/admin.d.ts.map +1 -0
  517. package/dist/convex/integrations/admin.js +198 -0
  518. package/dist/convex/integrations/admin.js.map +1 -0
  519. package/dist/convex/integrations/ai/account-export.d.ts +11 -0
  520. package/dist/convex/integrations/ai/account-export.d.ts.map +1 -0
  521. package/dist/convex/integrations/ai/account-export.js +44 -0
  522. package/dist/convex/integrations/ai/account-export.js.map +1 -0
  523. package/dist/convex/integrations/ai/chat.d.ts +104 -0
  524. package/dist/convex/integrations/ai/chat.d.ts.map +1 -0
  525. package/dist/convex/integrations/ai/chat.js +385 -0
  526. package/dist/convex/integrations/ai/chat.js.map +1 -0
  527. package/dist/convex/integrations/ai/config.d.ts +746 -0
  528. package/dist/convex/integrations/ai/config.d.ts.map +1 -0
  529. package/dist/convex/integrations/ai/config.js +2 -0
  530. package/dist/convex/integrations/ai/config.js.map +1 -0
  531. package/dist/convex/integrations/ai/context.d.ts +40 -0
  532. package/dist/convex/integrations/ai/context.d.ts.map +1 -0
  533. package/dist/convex/integrations/ai/context.js +53 -0
  534. package/dist/convex/integrations/ai/context.js.map +1 -0
  535. package/dist/convex/integrations/ai/costs.d.ts +40 -0
  536. package/dist/convex/integrations/ai/costs.d.ts.map +1 -0
  537. package/dist/convex/integrations/ai/costs.js +72 -0
  538. package/dist/convex/integrations/ai/costs.js.map +1 -0
  539. package/dist/convex/integrations/ai/embeddings.d.ts +23 -0
  540. package/dist/convex/integrations/ai/embeddings.d.ts.map +1 -0
  541. package/dist/convex/integrations/ai/embeddings.js +75 -0
  542. package/dist/convex/integrations/ai/embeddings.js.map +1 -0
  543. package/dist/convex/integrations/ai/job-errors.d.ts +50 -0
  544. package/dist/convex/integrations/ai/job-errors.d.ts.map +1 -0
  545. package/dist/convex/integrations/ai/job-errors.js +100 -0
  546. package/dist/convex/integrations/ai/job-errors.js.map +1 -0
  547. package/dist/convex/integrations/ai/jobs.d.ts +286 -0
  548. package/dist/convex/integrations/ai/jobs.d.ts.map +1 -0
  549. package/dist/convex/integrations/ai/jobs.js +973 -0
  550. package/dist/convex/integrations/ai/jobs.js.map +1 -0
  551. package/dist/convex/integrations/ai/knowledge.d.ts +120 -0
  552. package/dist/convex/integrations/ai/knowledge.d.ts.map +1 -0
  553. package/dist/convex/integrations/ai/knowledge.js +336 -0
  554. package/dist/convex/integrations/ai/knowledge.js.map +1 -0
  555. package/dist/convex/integrations/ai/metering.d.ts +47 -0
  556. package/dist/convex/integrations/ai/metering.d.ts.map +1 -0
  557. package/dist/convex/integrations/ai/metering.js +361 -0
  558. package/dist/convex/integrations/ai/metering.js.map +1 -0
  559. package/dist/convex/integrations/ai/model-id.d.ts +8 -0
  560. package/dist/convex/integrations/ai/model-id.d.ts.map +1 -0
  561. package/dist/convex/integrations/ai/model-id.js +15 -0
  562. package/dist/convex/integrations/ai/model-id.js.map +1 -0
  563. package/dist/convex/integrations/ai/models.d.ts +162 -0
  564. package/dist/convex/integrations/ai/models.d.ts.map +1 -0
  565. package/dist/convex/integrations/ai/models.js +383 -0
  566. package/dist/convex/integrations/ai/models.js.map +1 -0
  567. package/dist/convex/integrations/ai/moderation.d.ts +57 -0
  568. package/dist/convex/integrations/ai/moderation.d.ts.map +1 -0
  569. package/dist/convex/integrations/ai/moderation.js +172 -0
  570. package/dist/convex/integrations/ai/moderation.js.map +1 -0
  571. package/dist/convex/integrations/ai/pricing.d.ts +88 -0
  572. package/dist/convex/integrations/ai/pricing.d.ts.map +1 -0
  573. package/dist/convex/integrations/ai/pricing.js +135 -0
  574. package/dist/convex/integrations/ai/pricing.js.map +1 -0
  575. package/dist/convex/integrations/ai/provenance.d.ts +87 -0
  576. package/dist/convex/integrations/ai/provenance.d.ts.map +1 -0
  577. package/dist/convex/integrations/ai/provenance.js +137 -0
  578. package/dist/convex/integrations/ai/provenance.js.map +1 -0
  579. package/dist/convex/integrations/ai/setup.d.ts +20 -0
  580. package/dist/convex/integrations/ai/setup.d.ts.map +1 -0
  581. package/dist/convex/integrations/ai/setup.js +53 -0
  582. package/dist/convex/integrations/ai/setup.js.map +1 -0
  583. package/dist/convex/integrations/ai/stream.d.ts +10 -0
  584. package/dist/convex/integrations/ai/stream.d.ts.map +1 -0
  585. package/dist/convex/integrations/ai/stream.js +159 -0
  586. package/dist/convex/integrations/ai/stream.js.map +1 -0
  587. package/dist/convex/integrations/ai.d.ts +37 -0
  588. package/dist/convex/integrations/ai.d.ts.map +1 -0
  589. package/dist/convex/integrations/ai.js +4 -0
  590. package/dist/convex/integrations/ai.js.map +1 -0
  591. package/dist/convex/integrations/announcements.d.ts +239 -0
  592. package/dist/convex/integrations/announcements.d.ts.map +1 -0
  593. package/dist/convex/integrations/announcements.js +313 -0
  594. package/dist/convex/integrations/announcements.js.map +1 -0
  595. package/dist/convex/integrations/audit.d.ts +272 -0
  596. package/dist/convex/integrations/audit.d.ts.map +1 -0
  597. package/dist/convex/integrations/audit.js +268 -0
  598. package/dist/convex/integrations/audit.js.map +1 -0
  599. package/dist/convex/integrations/authorization.d.ts +147 -0
  600. package/dist/convex/integrations/authorization.d.ts.map +1 -0
  601. package/dist/convex/integrations/authorization.js +210 -0
  602. package/dist/convex/integrations/authorization.js.map +1 -0
  603. package/dist/convex/integrations/billing/activity.d.ts +24 -0
  604. package/dist/convex/integrations/billing/activity.d.ts.map +1 -0
  605. package/dist/convex/integrations/billing/activity.js +40 -0
  606. package/dist/convex/integrations/billing/activity.js.map +1 -0
  607. package/dist/convex/integrations/billing/checkout.d.ts +78 -0
  608. package/dist/convex/integrations/billing/checkout.d.ts.map +1 -0
  609. package/dist/convex/integrations/billing/checkout.js +484 -0
  610. package/dist/convex/integrations/billing/checkout.js.map +1 -0
  611. package/dist/convex/integrations/billing/claim-discount.d.ts +17 -0
  612. package/dist/convex/integrations/billing/claim-discount.d.ts.map +1 -0
  613. package/dist/convex/integrations/billing/claim-discount.js +40 -0
  614. package/dist/convex/integrations/billing/claim-discount.js.map +1 -0
  615. package/dist/convex/integrations/billing/context.d.ts +157 -0
  616. package/dist/convex/integrations/billing/context.d.ts.map +1 -0
  617. package/dist/convex/integrations/billing/context.js +400 -0
  618. package/dist/convex/integrations/billing/context.js.map +1 -0
  619. package/dist/convex/integrations/billing/credits.d.ts +40 -0
  620. package/dist/convex/integrations/billing/credits.d.ts.map +1 -0
  621. package/dist/convex/integrations/billing/credits.js +215 -0
  622. package/dist/convex/integrations/billing/credits.js.map +1 -0
  623. package/dist/convex/integrations/billing/customers.d.ts +60 -0
  624. package/dist/convex/integrations/billing/customers.d.ts.map +1 -0
  625. package/dist/convex/integrations/billing/customers.js +302 -0
  626. package/dist/convex/integrations/billing/customers.js.map +1 -0
  627. package/dist/convex/integrations/billing/discounts.d.ts +26 -0
  628. package/dist/convex/integrations/billing/discounts.d.ts.map +1 -0
  629. package/dist/convex/integrations/billing/discounts.js +71 -0
  630. package/dist/convex/integrations/billing/discounts.js.map +1 -0
  631. package/dist/convex/integrations/billing/entitlements.d.ts +16 -0
  632. package/dist/convex/integrations/billing/entitlements.d.ts.map +1 -0
  633. package/dist/convex/integrations/billing/entitlements.js +180 -0
  634. package/dist/convex/integrations/billing/entitlements.js.map +1 -0
  635. package/dist/convex/integrations/billing/erasure.d.ts +10 -0
  636. package/dist/convex/integrations/billing/erasure.d.ts.map +1 -0
  637. package/dist/convex/integrations/billing/erasure.js +90 -0
  638. package/dist/convex/integrations/billing/erasure.js.map +1 -0
  639. package/dist/convex/integrations/billing/events.d.ts +80 -0
  640. package/dist/convex/integrations/billing/events.d.ts.map +1 -0
  641. package/dist/convex/integrations/billing/events.js +209 -0
  642. package/dist/convex/integrations/billing/events.js.map +1 -0
  643. package/dist/convex/integrations/billing/features.d.ts +32 -0
  644. package/dist/convex/integrations/billing/features.d.ts.map +1 -0
  645. package/dist/convex/integrations/billing/features.js +79 -0
  646. package/dist/convex/integrations/billing/features.js.map +1 -0
  647. package/dist/convex/integrations/billing/free-plan.d.ts +53 -0
  648. package/dist/convex/integrations/billing/free-plan.d.ts.map +1 -0
  649. package/dist/convex/integrations/billing/free-plan.js +219 -0
  650. package/dist/convex/integrations/billing/free-plan.js.map +1 -0
  651. package/dist/convex/integrations/billing/functions.d.ts +349 -0
  652. package/dist/convex/integrations/billing/functions.d.ts.map +1 -0
  653. package/dist/convex/integrations/billing/functions.js +434 -0
  654. package/dist/convex/integrations/billing/functions.js.map +1 -0
  655. package/dist/convex/integrations/billing/gift-access.d.ts +39 -0
  656. package/dist/convex/integrations/billing/gift-access.d.ts.map +1 -0
  657. package/dist/convex/integrations/billing/gift-access.js +39 -0
  658. package/dist/convex/integrations/billing/gift-access.js.map +1 -0
  659. package/dist/convex/integrations/billing/gift-manage.d.ts +66 -0
  660. package/dist/convex/integrations/billing/gift-manage.d.ts.map +1 -0
  661. package/dist/convex/integrations/billing/gift-manage.js +261 -0
  662. package/dist/convex/integrations/billing/gift-manage.js.map +1 -0
  663. package/dist/convex/integrations/billing/gift-rules.d.ts +19 -0
  664. package/dist/convex/integrations/billing/gift-rules.d.ts.map +1 -0
  665. package/dist/convex/integrations/billing/gift-rules.js +49 -0
  666. package/dist/convex/integrations/billing/gift-rules.js.map +1 -0
  667. package/dist/convex/integrations/billing/gifts.d.ts +123 -0
  668. package/dist/convex/integrations/billing/gifts.d.ts.map +1 -0
  669. package/dist/convex/integrations/billing/gifts.js +712 -0
  670. package/dist/convex/integrations/billing/gifts.js.map +1 -0
  671. package/dist/convex/integrations/billing/history.d.ts +22 -0
  672. package/dist/convex/integrations/billing/history.d.ts.map +1 -0
  673. package/dist/convex/integrations/billing/history.js +212 -0
  674. package/dist/convex/integrations/billing/history.js.map +1 -0
  675. package/dist/convex/integrations/billing/lifecycle.d.ts +102 -0
  676. package/dist/convex/integrations/billing/lifecycle.d.ts.map +1 -0
  677. package/dist/convex/integrations/billing/lifecycle.js +495 -0
  678. package/dist/convex/integrations/billing/lifecycle.js.map +1 -0
  679. package/dist/convex/integrations/billing/passes.d.ts +70 -0
  680. package/dist/convex/integrations/billing/passes.d.ts.map +1 -0
  681. package/dist/convex/integrations/billing/passes.js +408 -0
  682. package/dist/convex/integrations/billing/passes.js.map +1 -0
  683. package/dist/convex/integrations/billing/pricing.d.ts +51 -0
  684. package/dist/convex/integrations/billing/pricing.d.ts.map +1 -0
  685. package/dist/convex/integrations/billing/pricing.js +320 -0
  686. package/dist/convex/integrations/billing/pricing.js.map +1 -0
  687. package/dist/convex/integrations/billing/provider-client.d.ts +11 -0
  688. package/dist/convex/integrations/billing/provider-client.d.ts.map +1 -0
  689. package/dist/convex/integrations/billing/provider-client.js +9 -0
  690. package/dist/convex/integrations/billing/provider-client.js.map +1 -0
  691. package/dist/convex/integrations/billing/provider-events.d.ts +26 -0
  692. package/dist/convex/integrations/billing/provider-events.d.ts.map +1 -0
  693. package/dist/convex/integrations/billing/provider-events.js +194 -0
  694. package/dist/convex/integrations/billing/provider-events.js.map +1 -0
  695. package/dist/convex/integrations/billing/purchase.d.ts +63 -0
  696. package/dist/convex/integrations/billing/purchase.d.ts.map +1 -0
  697. package/dist/convex/integrations/billing/purchase.js +288 -0
  698. package/dist/convex/integrations/billing/purchase.js.map +1 -0
  699. package/dist/convex/integrations/billing/quotas.d.ts +47 -0
  700. package/dist/convex/integrations/billing/quotas.d.ts.map +1 -0
  701. package/dist/convex/integrations/billing/quotas.js +162 -0
  702. package/dist/convex/integrations/billing/quotas.js.map +1 -0
  703. package/dist/convex/integrations/billing/referral-orders.d.ts +26 -0
  704. package/dist/convex/integrations/billing/referral-orders.d.ts.map +1 -0
  705. package/dist/convex/integrations/billing/referral-orders.js +33 -0
  706. package/dist/convex/integrations/billing/referral-orders.js.map +1 -0
  707. package/dist/convex/integrations/billing/revenue.d.ts +12 -0
  708. package/dist/convex/integrations/billing/revenue.d.ts.map +1 -0
  709. package/dist/convex/integrations/billing/revenue.js +175 -0
  710. package/dist/convex/integrations/billing/revenue.js.map +1 -0
  711. package/dist/convex/integrations/billing/rewards.d.ts +78 -0
  712. package/dist/convex/integrations/billing/rewards.d.ts.map +1 -0
  713. package/dist/convex/integrations/billing/rewards.js +113 -0
  714. package/dist/convex/integrations/billing/rewards.js.map +1 -0
  715. package/dist/convex/integrations/billing/subscriptions.d.ts +79 -0
  716. package/dist/convex/integrations/billing/subscriptions.d.ts.map +1 -0
  717. package/dist/convex/integrations/billing/subscriptions.js +331 -0
  718. package/dist/convex/integrations/billing/subscriptions.js.map +1 -0
  719. package/dist/convex/integrations/billing/types/base.d.ts +78 -0
  720. package/dist/convex/integrations/billing/types/base.d.ts.map +1 -0
  721. package/dist/convex/integrations/billing/types/base.js +2 -0
  722. package/dist/convex/integrations/billing/types/base.js.map +1 -0
  723. package/dist/convex/integrations/billing/types/lifecycle.d.ts +147 -0
  724. package/dist/convex/integrations/billing/types/lifecycle.d.ts.map +1 -0
  725. package/dist/convex/integrations/billing/types/lifecycle.js +2 -0
  726. package/dist/convex/integrations/billing/types/lifecycle.js.map +1 -0
  727. package/dist/convex/integrations/billing/types/options.d.ts +369 -0
  728. package/dist/convex/integrations/billing/types/options.d.ts.map +1 -0
  729. package/dist/convex/integrations/billing/types/options.js +2 -0
  730. package/dist/convex/integrations/billing/types/options.js.map +1 -0
  731. package/dist/convex/integrations/billing/types/records.d.ts +517 -0
  732. package/dist/convex/integrations/billing/types/records.d.ts.map +1 -0
  733. package/dist/convex/integrations/billing/types/records.js +3 -0
  734. package/dist/convex/integrations/billing/types/records.js.map +1 -0
  735. package/dist/convex/integrations/billing/types/revenue.d.ts +94 -0
  736. package/dist/convex/integrations/billing/types/revenue.d.ts.map +1 -0
  737. package/dist/convex/integrations/billing/types/revenue.js +34 -0
  738. package/dist/convex/integrations/billing/types/revenue.js.map +1 -0
  739. package/dist/convex/integrations/billing/types/setup.d.ts +891 -0
  740. package/dist/convex/integrations/billing/types/setup.d.ts.map +1 -0
  741. package/dist/convex/integrations/billing/types/setup.js +2 -0
  742. package/dist/convex/integrations/billing/types/setup.js.map +1 -0
  743. package/dist/convex/integrations/billing/types/surface.d.ts +661 -0
  744. package/dist/convex/integrations/billing/types/surface.d.ts.map +1 -0
  745. package/dist/convex/integrations/billing/types/surface.js +2 -0
  746. package/dist/convex/integrations/billing/types/surface.js.map +1 -0
  747. package/dist/convex/integrations/billing/webhooks.d.ts +16 -0
  748. package/dist/convex/integrations/billing/webhooks.d.ts.map +1 -0
  749. package/dist/convex/integrations/billing/webhooks.js +317 -0
  750. package/dist/convex/integrations/billing/webhooks.js.map +1 -0
  751. package/dist/convex/integrations/billing.d.ts +48 -0
  752. package/dist/convex/integrations/billing.d.ts.map +1 -0
  753. package/dist/convex/integrations/billing.js +192 -0
  754. package/dist/convex/integrations/billing.js.map +1 -0
  755. package/dist/convex/integrations/email-lifecycle.d.ts +57 -0
  756. package/dist/convex/integrations/email-lifecycle.d.ts.map +1 -0
  757. package/dist/convex/integrations/email-lifecycle.js +180 -0
  758. package/dist/convex/integrations/email-lifecycle.js.map +1 -0
  759. package/dist/convex/integrations/email-preferences.d.ts +227 -0
  760. package/dist/convex/integrations/email-preferences.d.ts.map +1 -0
  761. package/dist/convex/integrations/email-preferences.js +287 -0
  762. package/dist/convex/integrations/email-preferences.js.map +1 -0
  763. package/dist/convex/integrations/email-suppressions.d.ts +63 -0
  764. package/dist/convex/integrations/email-suppressions.d.ts.map +1 -0
  765. package/dist/convex/integrations/email-suppressions.js +120 -0
  766. package/dist/convex/integrations/email-suppressions.js.map +1 -0
  767. package/dist/convex/integrations/email-sync.d.ts +131 -0
  768. package/dist/convex/integrations/email-sync.d.ts.map +1 -0
  769. package/dist/convex/integrations/email-sync.js +422 -0
  770. package/dist/convex/integrations/email-sync.js.map +1 -0
  771. package/dist/convex/integrations/email.d.ts +756 -0
  772. package/dist/convex/integrations/email.d.ts.map +1 -0
  773. package/dist/convex/integrations/email.js +463 -0
  774. package/dist/convex/integrations/email.js.map +1 -0
  775. package/dist/convex/integrations/flags.d.ts +200 -0
  776. package/dist/convex/integrations/flags.d.ts.map +1 -0
  777. package/dist/convex/integrations/flags.js +295 -0
  778. package/dist/convex/integrations/flags.js.map +1 -0
  779. package/dist/convex/integrations/functions.d.ts +298 -0
  780. package/dist/convex/integrations/functions.d.ts.map +1 -0
  781. package/dist/convex/integrations/functions.js +380 -0
  782. package/dist/convex/integrations/functions.js.map +1 -0
  783. package/dist/convex/integrations/health.d.ts +2 -0
  784. package/dist/convex/integrations/health.d.ts.map +1 -0
  785. package/dist/convex/integrations/health.js +145 -0
  786. package/dist/convex/integrations/health.js.map +1 -0
  787. package/dist/convex/integrations/http.d.ts +102 -0
  788. package/dist/convex/integrations/http.d.ts.map +1 -0
  789. package/dist/convex/integrations/http.js +108 -0
  790. package/dist/convex/integrations/http.js.map +1 -0
  791. package/dist/convex/integrations/inbound.d.ts +194 -0
  792. package/dist/convex/integrations/inbound.d.ts.map +1 -0
  793. package/dist/convex/integrations/inbound.js +502 -0
  794. package/dist/convex/integrations/inbound.js.map +1 -0
  795. package/dist/convex/integrations/launch.d.ts +240 -0
  796. package/dist/convex/integrations/launch.d.ts.map +1 -0
  797. package/dist/convex/integrations/launch.js +360 -0
  798. package/dist/convex/integrations/launch.js.map +1 -0
  799. package/dist/convex/integrations/monitoring.d.ts +135 -0
  800. package/dist/convex/integrations/monitoring.d.ts.map +1 -0
  801. package/dist/convex/integrations/monitoring.js +226 -0
  802. package/dist/convex/integrations/monitoring.js.map +1 -0
  803. package/dist/convex/integrations/notifications.d.ts +205 -0
  804. package/dist/convex/integrations/notifications.d.ts.map +1 -0
  805. package/dist/convex/integrations/notifications.js +290 -0
  806. package/dist/convex/integrations/notifications.js.map +1 -0
  807. package/dist/convex/integrations/rate-limit.d.ts +428 -0
  808. package/dist/convex/integrations/rate-limit.d.ts.map +1 -0
  809. package/dist/convex/integrations/rate-limit.js +294 -0
  810. package/dist/convex/integrations/rate-limit.js.map +1 -0
  811. package/dist/convex/integrations/referrals.d.ts +340 -0
  812. package/dist/convex/integrations/referrals.d.ts.map +1 -0
  813. package/dist/convex/integrations/referrals.js +304 -0
  814. package/dist/convex/integrations/referrals.js.map +1 -0
  815. package/dist/convex/integrations/reports.d.ts +231 -0
  816. package/dist/convex/integrations/reports.d.ts.map +1 -0
  817. package/dist/convex/integrations/reports.js +491 -0
  818. package/dist/convex/integrations/reports.js.map +1 -0
  819. package/dist/convex/integrations/retention.d.ts +88 -0
  820. package/dist/convex/integrations/retention.d.ts.map +1 -0
  821. package/dist/convex/integrations/retention.js +117 -0
  822. package/dist/convex/integrations/retention.js.map +1 -0
  823. package/dist/convex/integrations/search.d.ts +91 -0
  824. package/dist/convex/integrations/search.d.ts.map +1 -0
  825. package/dist/convex/integrations/search.js +117 -0
  826. package/dist/convex/integrations/search.js.map +1 -0
  827. package/dist/convex/integrations/storage.d.ts +207 -0
  828. package/dist/convex/integrations/storage.d.ts.map +1 -0
  829. package/dist/convex/integrations/storage.js +373 -0
  830. package/dist/convex/integrations/storage.js.map +1 -0
  831. package/dist/convex/integrations/waitlist.d.ts +213 -0
  832. package/dist/convex/integrations/waitlist.d.ts.map +1 -0
  833. package/dist/convex/integrations/waitlist.js +260 -0
  834. package/dist/convex/integrations/waitlist.js.map +1 -0
  835. package/dist/convex/integrations/webhook-guard.d.ts +179 -0
  836. package/dist/convex/integrations/webhook-guard.d.ts.map +1 -0
  837. package/dist/convex/integrations/webhook-guard.js +183 -0
  838. package/dist/convex/integrations/webhook-guard.js.map +1 -0
  839. package/dist/convex/integrations/webhooks.d.ts +70 -0
  840. package/dist/convex/integrations/webhooks.d.ts.map +1 -0
  841. package/dist/convex/integrations/webhooks.js +109 -0
  842. package/dist/convex/integrations/webhooks.js.map +1 -0
  843. package/dist/convex/integrations/workflows.d.ts +130 -0
  844. package/dist/convex/integrations/workflows.d.ts.map +1 -0
  845. package/dist/convex/integrations/workflows.js +142 -0
  846. package/dist/convex/integrations/workflows.js.map +1 -0
  847. package/dist/convex/jobs-policy.d.ts +191 -0
  848. package/dist/convex/jobs-policy.d.ts.map +1 -0
  849. package/dist/convex/jobs-policy.js +291 -0
  850. package/dist/convex/jobs-policy.js.map +1 -0
  851. package/dist/convex/label-format.d.ts +29 -0
  852. package/dist/convex/label-format.d.ts.map +1 -0
  853. package/dist/convex/label-format.js +60 -0
  854. package/dist/convex/label-format.js.map +1 -0
  855. package/dist/convex/label-groups/access.d.ts +19 -0
  856. package/dist/convex/label-groups/access.d.ts.map +1 -0
  857. package/dist/convex/label-groups/access.js +21 -0
  858. package/dist/convex/label-groups/access.js.map +1 -0
  859. package/dist/convex/label-groups/account.d.ts +27 -0
  860. package/dist/convex/label-groups/account.d.ts.map +1 -0
  861. package/dist/convex/label-groups/account.js +27 -0
  862. package/dist/convex/label-groups/account.js.map +1 -0
  863. package/dist/convex/label-groups/activation.d.ts +19 -0
  864. package/dist/convex/label-groups/activation.d.ts.map +1 -0
  865. package/dist/convex/label-groups/activation.js +22 -0
  866. package/dist/convex/label-groups/activation.js.map +1 -0
  867. package/dist/convex/label-groups/admin.d.ts +823 -0
  868. package/dist/convex/label-groups/admin.d.ts.map +1 -0
  869. package/dist/convex/label-groups/admin.js +858 -0
  870. package/dist/convex/label-groups/admin.js.map +1 -0
  871. package/dist/convex/label-groups/ai.d.ts +14 -0
  872. package/dist/convex/label-groups/ai.d.ts.map +1 -0
  873. package/dist/convex/label-groups/ai.js +15 -0
  874. package/dist/convex/label-groups/ai.js.map +1 -0
  875. package/dist/convex/label-groups/announcement.d.ts +12 -0
  876. package/dist/convex/label-groups/announcement.d.ts.map +1 -0
  877. package/dist/convex/label-groups/announcement.js +14 -0
  878. package/dist/convex/label-groups/announcement.js.map +1 -0
  879. package/dist/convex/label-groups/audit.d.ts +169 -0
  880. package/dist/convex/label-groups/audit.d.ts.map +1 -0
  881. package/dist/convex/label-groups/audit.js +172 -0
  882. package/dist/convex/label-groups/audit.js.map +1 -0
  883. package/dist/convex/label-groups/auth.d.ts +61 -0
  884. package/dist/convex/label-groups/auth.d.ts.map +1 -0
  885. package/dist/convex/label-groups/auth.js +76 -0
  886. package/dist/convex/label-groups/auth.js.map +1 -0
  887. package/dist/convex/label-groups/cancelFlow.d.ts +44 -0
  888. package/dist/convex/label-groups/cancelFlow.d.ts.map +1 -0
  889. package/dist/convex/label-groups/cancelFlow.js +47 -0
  890. package/dist/convex/label-groups/cancelFlow.js.map +1 -0
  891. package/dist/convex/label-groups/connection.d.ts +11 -0
  892. package/dist/convex/label-groups/connection.d.ts.map +1 -0
  893. package/dist/convex/label-groups/connection.js +13 -0
  894. package/dist/convex/label-groups/connection.js.map +1 -0
  895. package/dist/convex/label-groups/consent.d.ts +36 -0
  896. package/dist/convex/label-groups/consent.d.ts.map +1 -0
  897. package/dist/convex/label-groups/consent.js +42 -0
  898. package/dist/convex/label-groups/consent.js.map +1 -0
  899. package/dist/convex/label-groups/contact.d.ts +21 -0
  900. package/dist/convex/label-groups/contact.d.ts.map +1 -0
  901. package/dist/convex/label-groups/contact.js +24 -0
  902. package/dist/convex/label-groups/contact.js.map +1 -0
  903. package/dist/convex/label-groups/credits.d.ts +11 -0
  904. package/dist/convex/label-groups/credits.d.ts.map +1 -0
  905. package/dist/convex/label-groups/credits.js +12 -0
  906. package/dist/convex/label-groups/credits.js.map +1 -0
  907. package/dist/convex/label-groups/deletion.d.ts +18 -0
  908. package/dist/convex/label-groups/deletion.d.ts.map +1 -0
  909. package/dist/convex/label-groups/deletion.js +19 -0
  910. package/dist/convex/label-groups/deletion.js.map +1 -0
  911. package/dist/convex/label-groups/email.d.ts +237 -0
  912. package/dist/convex/label-groups/email.d.ts.map +1 -0
  913. package/dist/convex/label-groups/email.js +207 -0
  914. package/dist/convex/label-groups/email.js.map +1 -0
  915. package/dist/convex/label-groups/errors.d.ts +100 -0
  916. package/dist/convex/label-groups/errors.d.ts.map +1 -0
  917. package/dist/convex/label-groups/errors.js +117 -0
  918. package/dist/convex/label-groups/errors.js.map +1 -0
  919. package/dist/convex/label-groups/feedback.d.ts +17 -0
  920. package/dist/convex/label-groups/feedback.d.ts.map +1 -0
  921. package/dist/convex/label-groups/feedback.js +17 -0
  922. package/dist/convex/label-groups/feedback.js.map +1 -0
  923. package/dist/convex/label-groups/gift.d.ts +54 -0
  924. package/dist/convex/label-groups/gift.d.ts.map +1 -0
  925. package/dist/convex/label-groups/gift.js +59 -0
  926. package/dist/convex/label-groups/gift.js.map +1 -0
  927. package/dist/convex/label-groups/history.d.ts +23 -0
  928. package/dist/convex/label-groups/history.d.ts.map +1 -0
  929. package/dist/convex/label-groups/history.js +25 -0
  930. package/dist/convex/label-groups/history.js.map +1 -0
  931. package/dist/convex/label-groups/impersonation.d.ts +13 -0
  932. package/dist/convex/label-groups/impersonation.d.ts.map +1 -0
  933. package/dist/convex/label-groups/impersonation.js +14 -0
  934. package/dist/convex/label-groups/impersonation.js.map +1 -0
  935. package/dist/convex/label-groups/invitation.d.ts +23 -0
  936. package/dist/convex/label-groups/invitation.d.ts.map +1 -0
  937. package/dist/convex/label-groups/invitation.js +25 -0
  938. package/dist/convex/label-groups/invitation.js.map +1 -0
  939. package/dist/convex/label-groups/legal.d.ts +139 -0
  940. package/dist/convex/label-groups/legal.d.ts.map +1 -0
  941. package/dist/convex/label-groups/legal.js +144 -0
  942. package/dist/convex/label-groups/legal.js.map +1 -0
  943. package/dist/convex/label-groups/maintenance.d.ts +11 -0
  944. package/dist/convex/label-groups/maintenance.d.ts.map +1 -0
  945. package/dist/convex/label-groups/maintenance.js +12 -0
  946. package/dist/convex/label-groups/maintenance.js.map +1 -0
  947. package/dist/convex/label-groups/notifications.d.ts +169 -0
  948. package/dist/convex/label-groups/notifications.d.ts.map +1 -0
  949. package/dist/convex/label-groups/notifications.js +85 -0
  950. package/dist/convex/label-groups/notifications.js.map +1 -0
  951. package/dist/convex/label-groups/onboarding.d.ts +57 -0
  952. package/dist/convex/label-groups/onboarding.d.ts.map +1 -0
  953. package/dist/convex/label-groups/onboarding.js +59 -0
  954. package/dist/convex/label-groups/onboarding.js.map +1 -0
  955. package/dist/convex/label-groups/pastDue.d.ts +9 -0
  956. package/dist/convex/label-groups/pastDue.d.ts.map +1 -0
  957. package/dist/convex/label-groups/pastDue.js +10 -0
  958. package/dist/convex/label-groups/pastDue.js.map +1 -0
  959. package/dist/convex/label-groups/preferences.d.ts +46 -0
  960. package/dist/convex/label-groups/preferences.d.ts.map +1 -0
  961. package/dist/convex/label-groups/preferences.js +46 -0
  962. package/dist/convex/label-groups/preferences.js.map +1 -0
  963. package/dist/convex/label-groups/pricing.d.ts +73 -0
  964. package/dist/convex/label-groups/pricing.d.ts.map +1 -0
  965. package/dist/convex/label-groups/pricing.js +95 -0
  966. package/dist/convex/label-groups/pricing.js.map +1 -0
  967. package/dist/convex/label-groups/profile.d.ts +34 -0
  968. package/dist/convex/label-groups/profile.d.ts.map +1 -0
  969. package/dist/convex/label-groups/profile.js +39 -0
  970. package/dist/convex/label-groups/profile.js.map +1 -0
  971. package/dist/convex/label-groups/quota.d.ts +19 -0
  972. package/dist/convex/label-groups/quota.d.ts.map +1 -0
  973. package/dist/convex/label-groups/quota.js +25 -0
  974. package/dist/convex/label-groups/quota.js.map +1 -0
  975. package/dist/convex/label-groups/reauthenticate.d.ts +21 -0
  976. package/dist/convex/label-groups/reauthenticate.d.ts.map +1 -0
  977. package/dist/convex/label-groups/reauthenticate.js +22 -0
  978. package/dist/convex/label-groups/reauthenticate.js.map +1 -0
  979. package/dist/convex/label-groups/referral.d.ts +50 -0
  980. package/dist/convex/label-groups/referral.d.ts.map +1 -0
  981. package/dist/convex/label-groups/referral.js +53 -0
  982. package/dist/convex/label-groups/referral.js.map +1 -0
  983. package/dist/convex/label-groups/report.d.ts +56 -0
  984. package/dist/convex/label-groups/report.d.ts.map +1 -0
  985. package/dist/convex/label-groups/report.js +56 -0
  986. package/dist/convex/label-groups/report.js.map +1 -0
  987. package/dist/convex/label-groups/security.d.ts +54 -0
  988. package/dist/convex/label-groups/security.d.ts.map +1 -0
  989. package/dist/convex/label-groups/security.js +63 -0
  990. package/dist/convex/label-groups/security.js.map +1 -0
  991. package/dist/convex/label-groups/settings.d.ts +79 -0
  992. package/dist/convex/label-groups/settings.d.ts.map +1 -0
  993. package/dist/convex/label-groups/settings.js +89 -0
  994. package/dist/convex/label-groups/settings.js.map +1 -0
  995. package/dist/convex/label-groups/shell.d.ts +48 -0
  996. package/dist/convex/label-groups/shell.d.ts.map +1 -0
  997. package/dist/convex/label-groups/shell.js +54 -0
  998. package/dist/convex/label-groups/shell.js.map +1 -0
  999. package/dist/convex/label-groups/source.d.ts +28 -0
  1000. package/dist/convex/label-groups/source.d.ts.map +1 -0
  1001. package/dist/convex/label-groups/source.js +32 -0
  1002. package/dist/convex/label-groups/source.js.map +1 -0
  1003. package/dist/convex/label-groups/upgrade.d.ts +16 -0
  1004. package/dist/convex/label-groups/upgrade.d.ts.map +1 -0
  1005. package/dist/convex/label-groups/upgrade.js +20 -0
  1006. package/dist/convex/label-groups/upgrade.js.map +1 -0
  1007. package/dist/convex/label-groups/upload.d.ts +18 -0
  1008. package/dist/convex/label-groups/upload.d.ts.map +1 -0
  1009. package/dist/convex/label-groups/upload.js +19 -0
  1010. package/dist/convex/label-groups/upload.js.map +1 -0
  1011. package/dist/convex/label-groups/usage.d.ts +12 -0
  1012. package/dist/convex/label-groups/usage.d.ts.map +1 -0
  1013. package/dist/convex/label-groups/usage.js +12 -0
  1014. package/dist/convex/label-groups/usage.js.map +1 -0
  1015. package/dist/convex/label-groups/waitlist.d.ts +44 -0
  1016. package/dist/convex/label-groups/waitlist.d.ts.map +1 -0
  1017. package/dist/convex/label-groups/waitlist.js +45 -0
  1018. package/dist/convex/label-groups/waitlist.js.map +1 -0
  1019. package/dist/convex/label-groups/withdrawal.d.ts +18 -0
  1020. package/dist/convex/label-groups/withdrawal.d.ts.map +1 -0
  1021. package/dist/convex/label-groups/withdrawal.js +18 -0
  1022. package/dist/convex/label-groups/withdrawal.js.map +1 -0
  1023. package/dist/convex/label-translations.d.ts +4 -0
  1024. package/dist/convex/label-translations.d.ts.map +1 -0
  1025. package/dist/convex/label-translations.js +1782 -0
  1026. package/dist/convex/label-translations.js.map +1 -0
  1027. package/dist/convex/labels.d.ts +2520 -0
  1028. package/dist/convex/labels.d.ts.map +1 -0
  1029. package/dist/convex/labels.js +114 -0
  1030. package/dist/convex/labels.js.map +1 -0
  1031. package/dist/convex/legal.d.ts +309 -0
  1032. package/dist/convex/legal.d.ts.map +1 -0
  1033. package/dist/convex/legal.js +270 -0
  1034. package/dist/convex/legal.js.map +1 -0
  1035. package/dist/convex/lifecycle-flows.d.ts +75 -0
  1036. package/dist/convex/lifecycle-flows.d.ts.map +1 -0
  1037. package/dist/convex/lifecycle-flows.js +56 -0
  1038. package/dist/convex/lifecycle-flows.js.map +1 -0
  1039. package/dist/convex/local-origins.d.ts +3 -0
  1040. package/dist/convex/local-origins.d.ts.map +1 -0
  1041. package/dist/convex/local-origins.js +25 -0
  1042. package/dist/convex/local-origins.js.map +1 -0
  1043. package/dist/convex/locale.d.ts +26 -0
  1044. package/dist/convex/locale.d.ts.map +1 -0
  1045. package/dist/convex/locale.js +99 -0
  1046. package/dist/convex/locale.js.map +1 -0
  1047. package/dist/convex/log.d.ts +2 -0
  1048. package/dist/convex/log.d.ts.map +1 -0
  1049. package/dist/convex/log.js +147 -0
  1050. package/dist/convex/log.js.map +1 -0
  1051. package/dist/convex/loopback.d.ts +5 -0
  1052. package/dist/convex/loopback.d.ts.map +1 -0
  1053. package/dist/convex/loopback.js +20 -0
  1054. package/dist/convex/loopback.js.map +1 -0
  1055. package/dist/convex/monitoring.d.ts +226 -0
  1056. package/dist/convex/monitoring.d.ts.map +1 -0
  1057. package/dist/convex/monitoring.js +419 -0
  1058. package/dist/convex/monitoring.js.map +1 -0
  1059. package/dist/convex/notifications.d.ts +327 -0
  1060. package/dist/convex/notifications.d.ts.map +1 -0
  1061. package/dist/convex/notifications.js +180 -0
  1062. package/dist/convex/notifications.js.map +1 -0
  1063. package/dist/convex/package-migrations.d.ts +44 -0
  1064. package/dist/convex/package-migrations.d.ts.map +1 -0
  1065. package/dist/convex/package-migrations.js +32 -0
  1066. package/dist/convex/package-migrations.js.map +1 -0
  1067. package/dist/convex/paths.d.ts +35 -0
  1068. package/dist/convex/paths.d.ts.map +1 -0
  1069. package/dist/convex/paths.js +34 -0
  1070. package/dist/convex/paths.js.map +1 -0
  1071. package/dist/convex/pauses.d.ts +27 -0
  1072. package/dist/convex/pauses.d.ts.map +1 -0
  1073. package/dist/convex/pauses.js +36 -0
  1074. package/dist/convex/pauses.js.map +1 -0
  1075. package/dist/convex/proof.d.ts +152 -0
  1076. package/dist/convex/proof.d.ts.map +1 -0
  1077. package/dist/convex/proof.js +272 -0
  1078. package/dist/convex/proof.js.map +1 -0
  1079. package/dist/convex/referral-rules.d.ts +83 -0
  1080. package/dist/convex/referral-rules.d.ts.map +1 -0
  1081. package/dist/convex/referral-rules.js +110 -0
  1082. package/dist/convex/referral-rules.js.map +1 -0
  1083. package/dist/convex/report-rules.d.ts +9 -0
  1084. package/dist/convex/report-rules.d.ts.map +1 -0
  1085. package/dist/convex/report-rules.js +10 -0
  1086. package/dist/convex/report-rules.js.map +1 -0
  1087. package/dist/convex/sandbox-inbox.d.ts +56 -0
  1088. package/dist/convex/sandbox-inbox.d.ts.map +1 -0
  1089. package/dist/convex/sandbox-inbox.js +125 -0
  1090. package/dist/convex/sandbox-inbox.js.map +1 -0
  1091. package/dist/convex/sensitive-actions.d.ts +40 -0
  1092. package/dist/convex/sensitive-actions.d.ts.map +1 -0
  1093. package/dist/convex/sensitive-actions.js +220 -0
  1094. package/dist/convex/sensitive-actions.js.map +1 -0
  1095. package/dist/convex/test-models.d.ts +34 -0
  1096. package/dist/convex/test-models.d.ts.map +1 -0
  1097. package/dist/convex/test-models.js +121 -0
  1098. package/dist/convex/test-models.js.map +1 -0
  1099. package/dist/convex/tokens.d.ts +69 -0
  1100. package/dist/convex/tokens.d.ts.map +1 -0
  1101. package/dist/convex/tokens.js +101 -0
  1102. package/dist/convex/tokens.js.map +1 -0
  1103. package/dist/convex/urls.d.ts +9 -0
  1104. package/dist/convex/urls.d.ts.map +1 -0
  1105. package/dist/convex/urls.js +15 -0
  1106. package/dist/convex/urls.js.map +1 -0
  1107. package/dist/convex/visitor.d.ts +2 -0
  1108. package/dist/convex/visitor.d.ts.map +1 -0
  1109. package/dist/convex/visitor.js +51 -0
  1110. package/dist/convex/visitor.js.map +1 -0
  1111. package/dist/convex/waitlist-rules.d.ts +72 -0
  1112. package/dist/convex/waitlist-rules.d.ts.map +1 -0
  1113. package/dist/convex/waitlist-rules.js +119 -0
  1114. package/dist/convex/waitlist-rules.js.map +1 -0
  1115. package/dist/convex/web-push.d.ts +105 -0
  1116. package/dist/convex/web-push.d.ts.map +1 -0
  1117. package/dist/convex/web-push.js +192 -0
  1118. package/dist/convex/web-push.js.map +1 -0
  1119. package/dist/convex/webhook-signatures.d.ts +39 -0
  1120. package/dist/convex/webhook-signatures.d.ts.map +1 -0
  1121. package/dist/convex/webhook-signatures.js +140 -0
  1122. package/dist/convex/webhook-signatures.js.map +1 -0
  1123. package/dist/devtools/rpc-types.js +23 -0
  1124. package/dist/devtools-client/_nuxt/CfQg3BRt.js +5 -0
  1125. package/dist/devtools-client/_nuxt/entry.DsMplBp-.css +1 -0
  1126. package/dist/devtools-client/icon.svg +11 -0
  1127. package/dist/devtools-client/index.html +1 -0
  1128. package/dist/env-registry.js +217 -0
  1129. package/dist/eslint.d.mts +33 -0
  1130. package/dist/eslint.mjs +39 -0
  1131. package/dist/findings/types.js +1 -0
  1132. package/dist/module.d.ts +128 -32
  1133. package/dist/module.js +15 -275
  1134. package/dist/module.json +6 -2
  1135. package/dist/runtime/config.d.ts +172 -0
  1136. package/dist/runtime/config.js +65 -0
  1137. package/dist/runtime/devtools/bridge.d.ts +12 -0
  1138. package/dist/runtime/devtools/bridge.js +70 -0
  1139. package/dist/runtime/devtools/events.d.ts +11 -0
  1140. package/dist/runtime/devtools/events.js +116 -0
  1141. package/dist/runtime/devtools/on-demand.d.ts +11 -0
  1142. package/dist/runtime/devtools/on-demand.js +101 -0
  1143. package/dist/runtime/devtools/plugin.client.d.ts +8 -0
  1144. package/dist/runtime/devtools/plugin.client.js +201 -0
  1145. package/dist/runtime/devtools/types.d.ts +248 -0
  1146. package/dist/runtime/devtools/types.js +0 -0
  1147. package/dist/runtime/devtools/webhook-feed.d.ts +15 -0
  1148. package/dist/runtime/devtools/webhook-feed.js +26 -0
  1149. package/dist/runtime/image/provider.d.ts +25 -0
  1150. package/dist/runtime/image/provider.js +9 -0
  1151. package/dist/runtime/locales/de.json +2724 -0
  1152. package/dist/runtime/locales/en.json +2724 -0
  1153. package/dist/runtime/locales/es.json +2724 -0
  1154. package/dist/runtime/locales/fr.json +2724 -0
  1155. package/dist/runtime/locales/ru.json +2724 -0
  1156. package/dist/runtime/monitoring/report.d.ts +35 -0
  1157. package/dist/runtime/monitoring/report.js +23 -0
  1158. package/dist/runtime/monitoring/sdk/capture.client.d.ts +11 -0
  1159. package/dist/runtime/monitoring/sdk/capture.client.js +14 -0
  1160. package/dist/runtime/monitoring/sdk/capture.server.d.ts +9 -0
  1161. package/dist/runtime/monitoring/sdk/capture.server.js +9 -0
  1162. package/dist/runtime/monitoring/sdk/feedback.d.ts +5 -0
  1163. package/dist/runtime/monitoring/sdk/feedback.js +21 -0
  1164. package/dist/runtime/monitoring/sdk/observe.client.d.ts +32 -0
  1165. package/dist/runtime/monitoring/sdk/observe.client.js +42 -0
  1166. package/dist/runtime/monitoring/sdk/preset.d.ts +74 -0
  1167. package/dist/runtime/monitoring/sdk/preset.js +49 -0
  1168. package/dist/runtime/monitoring/sdk/replay.d.ts +1 -0
  1169. package/dist/runtime/monitoring/sdk/replay.js +1 -0
  1170. package/dist/runtime/monitoring/sdk/sentry.client.config.d.ts +1 -0
  1171. package/dist/runtime/monitoring/sdk/sentry.client.config.js +13 -0
  1172. package/dist/runtime/monitoring/sdk/sentry.server.config.d.ts +1 -0
  1173. package/dist/runtime/monitoring/sdk/sentry.server.config.js +12 -0
  1174. package/dist/runtime/protection/botid-absent.d.ts +4 -0
  1175. package/dist/runtime/protection/botid-absent.js +5 -0
  1176. package/dist/runtime/server/backend-url.d.ts +17 -0
  1177. package/dist/runtime/server/backend-url.js +9 -0
  1178. package/dist/runtime/server/manifest.d.ts +2 -0
  1179. package/dist/runtime/server/manifest.js +6 -0
  1180. package/dist/runtime/server/monitoring/backend-calls.d.ts +9 -0
  1181. package/dist/runtime/server/monitoring/backend-calls.js +17 -0
  1182. package/dist/runtime/server/monitoring/capture.d.ts +15 -0
  1183. package/dist/runtime/server/monitoring/capture.js +24 -0
  1184. package/dist/runtime/server/monitoring/health.d.ts +15 -0
  1185. package/dist/runtime/server/monitoring/health.js +48 -0
  1186. package/dist/runtime/server/monitoring/local-log-route.d.ts +5 -0
  1187. package/dist/runtime/server/monitoring/local-log-route.js +32 -0
  1188. package/dist/runtime/server/monitoring/local-log.d.ts +19 -0
  1189. package/dist/runtime/server/monitoring/local-log.js +38 -0
  1190. package/dist/runtime/server/protection/csp.d.ts +17 -0
  1191. package/dist/runtime/server/protection/csp.js +28 -0
  1192. package/dist/runtime/server/protection/gate.d.ts +37 -0
  1193. package/dist/runtime/server/protection/gate.js +94 -0
  1194. package/dist/runtime/server/push-worker-source.d.ts +2 -0
  1195. package/dist/runtime/server/push-worker-source.js +25 -0
  1196. package/dist/runtime/server/push-worker.d.ts +2 -0
  1197. package/dist/runtime/server/push-worker.js +9 -0
  1198. package/dist/runtime/server/site-url.d.ts +5 -0
  1199. package/dist/runtime/server/site-url.js +5 -0
  1200. package/dist/runtime/server/tsconfig.json +6 -0
  1201. package/dist/runtime/server/visitor-ip.d.ts +4 -0
  1202. package/dist/runtime/server/visitor-ip.js +5 -0
  1203. package/dist/runtime/test-utils/aliases.d.ts +39 -0
  1204. package/dist/runtime/test-utils/aliases.js +26 -0
  1205. package/dist/runtime/test-utils/auth-answers.d.ts +85 -0
  1206. package/dist/runtime/test-utils/auth-answers.js +194 -0
  1207. package/dist/runtime/test-utils/auth-client.d.ts +3 -0
  1208. package/dist/runtime/test-utils/auth-client.js +69 -0
  1209. package/dist/runtime/test-utils/base-modules.d.ts +17 -0
  1210. package/dist/runtime/test-utils/client.d.ts +24 -0
  1211. package/dist/runtime/test-utils/client.js +29 -0
  1212. package/dist/runtime/test-utils/email.d.ts +29 -0
  1213. package/dist/runtime/test-utils/email.js +7 -0
  1214. package/dist/runtime/test-utils/index.d.ts +20 -0
  1215. package/dist/runtime/test-utils/index.js +7 -0
  1216. package/dist/runtime/test-utils/install.d.ts +58 -0
  1217. package/dist/runtime/test-utils/install.js +114 -0
  1218. package/dist/runtime/test-utils/mock.d.ts +245 -0
  1219. package/dist/runtime/test-utils/mock.js +130 -0
  1220. package/dist/runtime/vue/a11y.d.ts +74 -0
  1221. package/dist/runtime/vue/a11y.js +94 -0
  1222. package/dist/runtime/vue/auth-client.d.ts +40 -0
  1223. package/dist/runtime/vue/auth-client.js +7 -0
  1224. package/dist/runtime/vue/components/account/AccountData.css +1 -0
  1225. package/dist/runtime/vue/components/account/AccountData.d.vue.ts +55 -0
  1226. package/dist/runtime/vue/components/account/AccountData.vue +150 -0
  1227. package/dist/runtime/vue/components/account/AccountData.vue.d.ts +55 -0
  1228. package/dist/runtime/vue/components/account/AccountDeletion.css +1 -0
  1229. package/dist/runtime/vue/components/account/AccountDeletion.d.vue.ts +3 -0
  1230. package/dist/runtime/vue/components/account/AccountDeletion.vue +95 -0
  1231. package/dist/runtime/vue/components/account/AccountDeletion.vue.d.ts +3 -0
  1232. package/dist/runtime/vue/components/account/AccountExport.css +1 -0
  1233. package/dist/runtime/vue/components/account/AccountExport.d.vue.ts +3 -0
  1234. package/dist/runtime/vue/components/account/AccountExport.vue +65 -0
  1235. package/dist/runtime/vue/components/account/AccountExport.vue.d.ts +3 -0
  1236. package/dist/runtime/vue/components/account/ActivationChecklist.css +1 -0
  1237. package/dist/runtime/vue/components/account/ActivationChecklist.d.vue.ts +22 -0
  1238. package/dist/runtime/vue/components/account/ActivationChecklist.vue +121 -0
  1239. package/dist/runtime/vue/components/account/ActivationChecklist.vue.d.ts +22 -0
  1240. package/dist/runtime/vue/components/account/ConsentPrompt.css +1 -0
  1241. package/dist/runtime/vue/components/account/ConsentPrompt.d.vue.ts +53 -0
  1242. package/dist/runtime/vue/components/account/ConsentPrompt.vue +106 -0
  1243. package/dist/runtime/vue/components/account/ConsentPrompt.vue.d.ts +53 -0
  1244. package/dist/runtime/vue/components/account/ConsentPromptAge.d.vue.ts +16 -0
  1245. package/dist/runtime/vue/components/account/ConsentPromptAge.vue +26 -0
  1246. package/dist/runtime/vue/components/account/ConsentPromptAge.vue.d.ts +16 -0
  1247. package/dist/runtime/vue/components/account/ConsentPromptDialog.d.vue.ts +49 -0
  1248. package/dist/runtime/vue/components/account/ConsentPromptDialog.vue +116 -0
  1249. package/dist/runtime/vue/components/account/ConsentPromptDialog.vue.d.ts +49 -0
  1250. package/dist/runtime/vue/components/account/ConsentPromptItem.d.vue.ts +28 -0
  1251. package/dist/runtime/vue/components/account/ConsentPromptItem.vue +44 -0
  1252. package/dist/runtime/vue/components/account/ConsentPromptItem.vue.d.ts +28 -0
  1253. package/dist/runtime/vue/components/account/ConsentPromptStorage.d.vue.ts +15 -0
  1254. package/dist/runtime/vue/components/account/ConsentPromptStorage.vue +67 -0
  1255. package/dist/runtime/vue/components/account/ConsentPromptStorage.vue.d.ts +15 -0
  1256. package/dist/runtime/vue/components/account/EmailUnsubscribe.css +1 -0
  1257. package/dist/runtime/vue/components/account/EmailUnsubscribe.d.vue.ts +13 -0
  1258. package/dist/runtime/vue/components/account/EmailUnsubscribe.vue +107 -0
  1259. package/dist/runtime/vue/components/account/EmailUnsubscribe.vue.d.ts +13 -0
  1260. package/dist/runtime/vue/components/account/HowDidYouHear.css +1 -0
  1261. package/dist/runtime/vue/components/account/HowDidYouHear.d.vue.ts +24 -0
  1262. package/dist/runtime/vue/components/account/HowDidYouHear.vue +149 -0
  1263. package/dist/runtime/vue/components/account/HowDidYouHear.vue.d.ts +24 -0
  1264. package/dist/runtime/vue/components/account/KeepAccount.css +1 -0
  1265. package/dist/runtime/vue/components/account/KeepAccount.d.vue.ts +10 -0
  1266. package/dist/runtime/vue/components/account/KeepAccount.vue +54 -0
  1267. package/dist/runtime/vue/components/account/KeepAccount.vue.d.ts +10 -0
  1268. package/dist/runtime/vue/components/account/OnboardingFlow.css +1 -0
  1269. package/dist/runtime/vue/components/account/OnboardingFlow.d.vue.ts +77 -0
  1270. package/dist/runtime/vue/components/account/OnboardingFlow.vue +138 -0
  1271. package/dist/runtime/vue/components/account/OnboardingFlow.vue.d.ts +77 -0
  1272. package/dist/runtime/vue/components/account/OnboardingPlan.d.vue.ts +3 -0
  1273. package/dist/runtime/vue/components/account/OnboardingPlan.vue +36 -0
  1274. package/dist/runtime/vue/components/account/OnboardingPlan.vue.d.ts +3 -0
  1275. package/dist/runtime/vue/components/account/OnboardingProfile.d.vue.ts +3 -0
  1276. package/dist/runtime/vue/components/account/OnboardingProfile.vue +111 -0
  1277. package/dist/runtime/vue/components/account/OnboardingProfile.vue.d.ts +3 -0
  1278. package/dist/runtime/vue/components/account/OnboardingStepActions.d.vue.ts +10 -0
  1279. package/dist/runtime/vue/components/account/OnboardingStepActions.vue +38 -0
  1280. package/dist/runtime/vue/components/account/OnboardingStepActions.vue.d.ts +10 -0
  1281. package/dist/runtime/vue/components/account/OnboardingTeammates.d.vue.ts +3 -0
  1282. package/dist/runtime/vue/components/account/OnboardingTeammates.vue +102 -0
  1283. package/dist/runtime/vue/components/account/OnboardingTeammates.vue.d.ts +3 -0
  1284. package/dist/runtime/vue/components/account/OnboardingWorkspace.d.vue.ts +3 -0
  1285. package/dist/runtime/vue/components/account/OnboardingWorkspace.vue +154 -0
  1286. package/dist/runtime/vue/components/account/OnboardingWorkspace.vue.d.ts +3 -0
  1287. package/dist/runtime/vue/components/account/ProfileEmailSection.d.vue.ts +4 -0
  1288. package/dist/runtime/vue/components/account/ProfileEmailSection.vue +97 -0
  1289. package/dist/runtime/vue/components/account/ProfileEmailSection.vue.d.ts +4 -0
  1290. package/dist/runtime/vue/components/account/ProfileIdentity.css +1 -0
  1291. package/dist/runtime/vue/components/account/ProfileIdentity.d.vue.ts +3 -0
  1292. package/dist/runtime/vue/components/account/ProfileIdentity.vue +50 -0
  1293. package/dist/runtime/vue/components/account/ProfileIdentity.vue.d.ts +3 -0
  1294. package/dist/runtime/vue/components/account/ProfileLanguageSection.d.vue.ts +3 -0
  1295. package/dist/runtime/vue/components/account/ProfileLanguageSection.vue +43 -0
  1296. package/dist/runtime/vue/components/account/ProfileLanguageSection.vue.d.ts +3 -0
  1297. package/dist/runtime/vue/components/account/ProfileNameSection.d.vue.ts +3 -0
  1298. package/dist/runtime/vue/components/account/ProfileNameSection.vue +35 -0
  1299. package/dist/runtime/vue/components/account/ProfileNameSection.vue.d.ts +3 -0
  1300. package/dist/runtime/vue/components/account/ProfilePreferencesSection.css +1 -0
  1301. package/dist/runtime/vue/components/account/ProfilePreferencesSection.d.vue.ts +4 -0
  1302. package/dist/runtime/vue/components/account/ProfilePreferencesSection.vue +155 -0
  1303. package/dist/runtime/vue/components/account/ProfilePreferencesSection.vue.d.ts +4 -0
  1304. package/dist/runtime/vue/components/account/ProfileSettings.css +1 -0
  1305. package/dist/runtime/vue/components/account/ProfileSettings.d.vue.ts +61 -0
  1306. package/dist/runtime/vue/components/account/ProfileSettings.vue +201 -0
  1307. package/dist/runtime/vue/components/account/ProfileSettings.vue.d.ts +61 -0
  1308. package/dist/runtime/vue/components/account/SecurityAlerts.css +1 -0
  1309. package/dist/runtime/vue/components/account/SecurityAlerts.d.vue.ts +4 -0
  1310. package/dist/runtime/vue/components/account/SecurityAlerts.vue +70 -0
  1311. package/dist/runtime/vue/components/account/SecurityAlerts.vue.d.ts +4 -0
  1312. package/dist/runtime/vue/components/account/SecurityPasskeys.css +1 -0
  1313. package/dist/runtime/vue/components/account/SecurityPasskeys.d.vue.ts +4 -0
  1314. package/dist/runtime/vue/components/account/SecurityPasskeys.vue +152 -0
  1315. package/dist/runtime/vue/components/account/SecurityPasskeys.vue.d.ts +4 -0
  1316. package/dist/runtime/vue/components/account/SecuritySessions.css +1 -0
  1317. package/dist/runtime/vue/components/account/SecuritySessions.d.vue.ts +4 -0
  1318. package/dist/runtime/vue/components/account/SecuritySessions.vue +84 -0
  1319. package/dist/runtime/vue/components/account/SecuritySessions.vue.d.ts +4 -0
  1320. package/dist/runtime/vue/components/account/SecuritySettings.css +1 -0
  1321. package/dist/runtime/vue/components/account/SecuritySettings.d.vue.ts +87 -0
  1322. package/dist/runtime/vue/components/account/SecuritySettings.vue +225 -0
  1323. package/dist/runtime/vue/components/account/SecuritySettings.vue.d.ts +87 -0
  1324. package/dist/runtime/vue/components/account/account-data.d.ts +49 -0
  1325. package/dist/runtime/vue/components/account/account-data.js +10 -0
  1326. package/dist/runtime/vue/components/account/activation-checklist.d.ts +10 -0
  1327. package/dist/runtime/vue/components/account/activation-checklist.js +0 -0
  1328. package/dist/runtime/vue/components/account/consent-prompt.d.ts +28 -0
  1329. package/dist/runtime/vue/components/account/consent-prompt.js +0 -0
  1330. package/dist/runtime/vue/components/account/how-did-you-hear.d.ts +10 -0
  1331. package/dist/runtime/vue/components/account/how-did-you-hear.js +3 -0
  1332. package/dist/runtime/vue/components/account/onboarding-flow.d.ts +30 -0
  1333. package/dist/runtime/vue/components/account/onboarding-flow.js +0 -0
  1334. package/dist/runtime/vue/components/account/profile-settings.d.ts +68 -0
  1335. package/dist/runtime/vue/components/account/profile-settings.js +10 -0
  1336. package/dist/runtime/vue/components/account/security-alerts.d.ts +13 -0
  1337. package/dist/runtime/vue/components/account/security-alerts.js +20 -0
  1338. package/dist/runtime/vue/components/account/security-settings.d.ts +69 -0
  1339. package/dist/runtime/vue/components/account/security-settings.js +10 -0
  1340. package/dist/runtime/vue/components/admin/AdminAccess.css +1 -0
  1341. package/dist/runtime/vue/components/admin/AdminAccess.d.vue.ts +7 -0
  1342. package/dist/runtime/vue/components/admin/AdminAccess.vue +46 -0
  1343. package/dist/runtime/vue/components/admin/AdminAccess.vue.d.ts +7 -0
  1344. package/dist/runtime/vue/components/admin/AdminAccessAdmissions.d.vue.ts +7 -0
  1345. package/dist/runtime/vue/components/admin/AdminAccessAdmissions.vue +51 -0
  1346. package/dist/runtime/vue/components/admin/AdminAccessAdmissions.vue.d.ts +7 -0
  1347. package/dist/runtime/vue/components/admin/AdminAccessAdmit.d.vue.ts +6 -0
  1348. package/dist/runtime/vue/components/admin/AdminAccessAdmit.vue +65 -0
  1349. package/dist/runtime/vue/components/admin/AdminAccessAdmit.vue.d.ts +6 -0
  1350. package/dist/runtime/vue/components/admin/AdminAccessCreate.d.vue.ts +6 -0
  1351. package/dist/runtime/vue/components/admin/AdminAccessCreate.vue +78 -0
  1352. package/dist/runtime/vue/components/admin/AdminAccessCreate.vue.d.ts +6 -0
  1353. package/dist/runtime/vue/components/admin/AdminAccessInvites.d.vue.ts +7 -0
  1354. package/dist/runtime/vue/components/admin/AdminAccessInvites.vue +47 -0
  1355. package/dist/runtime/vue/components/admin/AdminAccessInvites.vue.d.ts +7 -0
  1356. package/dist/runtime/vue/components/admin/AdminAccessPhase.d.vue.ts +7 -0
  1357. package/dist/runtime/vue/components/admin/AdminAccessPhase.vue +43 -0
  1358. package/dist/runtime/vue/components/admin/AdminAccessPhase.vue.d.ts +7 -0
  1359. package/dist/runtime/vue/components/admin/AdminAccessRevoke.d.vue.ts +10 -0
  1360. package/dist/runtime/vue/components/admin/AdminAccessRevoke.vue +18 -0
  1361. package/dist/runtime/vue/components/admin/AdminAccessRevoke.vue.d.ts +10 -0
  1362. package/dist/runtime/vue/components/admin/AdminAccessTable.d.vue.ts +18 -0
  1363. package/dist/runtime/vue/components/admin/AdminAccessTable.vue +50 -0
  1364. package/dist/runtime/vue/components/admin/AdminAccessTable.vue.d.ts +18 -0
  1365. package/dist/runtime/vue/components/admin/AdminAnalytics.css +1 -0
  1366. package/dist/runtime/vue/components/admin/AdminAnalytics.d.vue.ts +3 -0
  1367. package/dist/runtime/vue/components/admin/AdminAnalytics.vue +34 -0
  1368. package/dist/runtime/vue/components/admin/AdminAnalytics.vue.d.ts +3 -0
  1369. package/dist/runtime/vue/components/admin/AdminAnnouncements.css +1 -0
  1370. package/dist/runtime/vue/components/admin/AdminAnnouncements.d.vue.ts +7 -0
  1371. package/dist/runtime/vue/components/admin/AdminAnnouncements.vue +79 -0
  1372. package/dist/runtime/vue/components/admin/AdminAnnouncements.vue.d.ts +7 -0
  1373. package/dist/runtime/vue/components/admin/AdminAnnouncementsCompose.d.vue.ts +6 -0
  1374. package/dist/runtime/vue/components/admin/AdminAnnouncementsCompose.vue +132 -0
  1375. package/dist/runtime/vue/components/admin/AdminAnnouncementsCompose.vue.d.ts +6 -0
  1376. package/dist/runtime/vue/components/admin/AdminAnnouncementsItem.d.vue.ts +8 -0
  1377. package/dist/runtime/vue/components/admin/AdminAnnouncementsItem.vue +81 -0
  1378. package/dist/runtime/vue/components/admin/AdminAnnouncementsItem.vue.d.ts +8 -0
  1379. package/dist/runtime/vue/components/admin/AdminBilling.css +1 -0
  1380. package/dist/runtime/vue/components/admin/AdminBilling.d.vue.ts +3 -0
  1381. package/dist/runtime/vue/components/admin/AdminBilling.vue +200 -0
  1382. package/dist/runtime/vue/components/admin/AdminBilling.vue.d.ts +3 -0
  1383. package/dist/runtime/vue/components/admin/AdminChart.css +1 -0
  1384. package/dist/runtime/vue/components/admin/AdminChart.d.vue.ts +10 -0
  1385. package/dist/runtime/vue/components/admin/AdminChart.vue +31 -0
  1386. package/dist/runtime/vue/components/admin/AdminChart.vue.d.ts +10 -0
  1387. package/dist/runtime/vue/components/admin/AdminConsole.css +1 -0
  1388. package/dist/runtime/vue/components/admin/AdminConsole.d.vue.ts +38 -0
  1389. package/dist/runtime/vue/components/admin/AdminConsole.vue +131 -0
  1390. package/dist/runtime/vue/components/admin/AdminConsole.vue.d.ts +38 -0
  1391. package/dist/runtime/vue/components/admin/AdminCosts.css +1 -0
  1392. package/dist/runtime/vue/components/admin/AdminCosts.d.vue.ts +3 -0
  1393. package/dist/runtime/vue/components/admin/AdminCosts.vue +120 -0
  1394. package/dist/runtime/vue/components/admin/AdminCosts.vue.d.ts +3 -0
  1395. package/dist/runtime/vue/components/admin/AdminDrawerFrame.d.vue.ts +24 -0
  1396. package/dist/runtime/vue/components/admin/AdminDrawerFrame.vue +71 -0
  1397. package/dist/runtime/vue/components/admin/AdminDrawerFrame.vue.d.ts +24 -0
  1398. package/dist/runtime/vue/components/admin/AdminExperiments.css +1 -0
  1399. package/dist/runtime/vue/components/admin/AdminExperiments.d.vue.ts +3 -0
  1400. package/dist/runtime/vue/components/admin/AdminExperiments.vue +159 -0
  1401. package/dist/runtime/vue/components/admin/AdminExperiments.vue.d.ts +3 -0
  1402. package/dist/runtime/vue/components/admin/AdminFlags.css +1 -0
  1403. package/dist/runtime/vue/components/admin/AdminFlags.d.vue.ts +9 -0
  1404. package/dist/runtime/vue/components/admin/AdminFlags.vue +429 -0
  1405. package/dist/runtime/vue/components/admin/AdminFlags.vue.d.ts +9 -0
  1406. package/dist/runtime/vue/components/admin/AdminGrowth.css +1 -0
  1407. package/dist/runtime/vue/components/admin/AdminGrowth.d.vue.ts +3 -0
  1408. package/dist/runtime/vue/components/admin/AdminGrowth.vue +204 -0
  1409. package/dist/runtime/vue/components/admin/AdminGrowth.vue.d.ts +3 -0
  1410. package/dist/runtime/vue/components/admin/AdminInbox.css +1 -0
  1411. package/dist/runtime/vue/components/admin/AdminInbox.d.vue.ts +3 -0
  1412. package/dist/runtime/vue/components/admin/AdminInbox.vue +81 -0
  1413. package/dist/runtime/vue/components/admin/AdminInbox.vue.d.ts +3 -0
  1414. package/dist/runtime/vue/components/admin/AdminInboxMessage.d.vue.ts +8 -0
  1415. package/dist/runtime/vue/components/admin/AdminInboxMessage.vue +107 -0
  1416. package/dist/runtime/vue/components/admin/AdminInboxMessage.vue.d.ts +8 -0
  1417. package/dist/runtime/vue/components/admin/AdminListFrame.d.vue.ts +29 -0
  1418. package/dist/runtime/vue/components/admin/AdminListFrame.vue +77 -0
  1419. package/dist/runtime/vue/components/admin/AdminListFrame.vue.d.ts +29 -0
  1420. package/dist/runtime/vue/components/admin/AdminListTail.d.vue.ts +14 -0
  1421. package/dist/runtime/vue/components/admin/AdminListTail.vue +38 -0
  1422. package/dist/runtime/vue/components/admin/AdminListTail.vue.d.ts +14 -0
  1423. package/dist/runtime/vue/components/admin/AdminQueue.css +1 -0
  1424. package/dist/runtime/vue/components/admin/AdminQueue.d.vue.ts +3 -0
  1425. package/dist/runtime/vue/components/admin/AdminQueue.vue +90 -0
  1426. package/dist/runtime/vue/components/admin/AdminQueue.vue.d.ts +3 -0
  1427. package/dist/runtime/vue/components/admin/AdminQueueControls.d.vue.ts +10 -0
  1428. package/dist/runtime/vue/components/admin/AdminQueueControls.vue +56 -0
  1429. package/dist/runtime/vue/components/admin/AdminQueueControls.vue.d.ts +10 -0
  1430. package/dist/runtime/vue/components/admin/AdminQueueJob.d.vue.ts +10 -0
  1431. package/dist/runtime/vue/components/admin/AdminQueueJob.vue +49 -0
  1432. package/dist/runtime/vue/components/admin/AdminQueueJob.vue.d.ts +10 -0
  1433. package/dist/runtime/vue/components/admin/AdminQueueJobs.d.vue.ts +8 -0
  1434. package/dist/runtime/vue/components/admin/AdminQueueJobs.vue +82 -0
  1435. package/dist/runtime/vue/components/admin/AdminQueueJobs.vue.d.ts +8 -0
  1436. package/dist/runtime/vue/components/admin/AdminQueueModels.d.vue.ts +10 -0
  1437. package/dist/runtime/vue/components/admin/AdminQueueModels.vue +84 -0
  1438. package/dist/runtime/vue/components/admin/AdminQueueModels.vue.d.ts +10 -0
  1439. package/dist/runtime/vue/components/admin/AdminQueueTier.d.vue.ts +10 -0
  1440. package/dist/runtime/vue/components/admin/AdminQueueTier.vue +83 -0
  1441. package/dist/runtime/vue/components/admin/AdminQueueTier.vue.d.ts +10 -0
  1442. package/dist/runtime/vue/components/admin/AdminQueueTiers.d.vue.ts +10 -0
  1443. package/dist/runtime/vue/components/admin/AdminQueueTiers.vue +40 -0
  1444. package/dist/runtime/vue/components/admin/AdminQueueTiers.vue.d.ts +10 -0
  1445. package/dist/runtime/vue/components/admin/AdminReferrals.css +1 -0
  1446. package/dist/runtime/vue/components/admin/AdminReferrals.d.vue.ts +7 -0
  1447. package/dist/runtime/vue/components/admin/AdminReferrals.vue +245 -0
  1448. package/dist/runtime/vue/components/admin/AdminReferrals.vue.d.ts +7 -0
  1449. package/dist/runtime/vue/components/admin/AdminReports.css +1 -0
  1450. package/dist/runtime/vue/components/admin/AdminReports.d.vue.ts +7 -0
  1451. package/dist/runtime/vue/components/admin/AdminReports.vue +122 -0
  1452. package/dist/runtime/vue/components/admin/AdminReports.vue.d.ts +7 -0
  1453. package/dist/runtime/vue/components/admin/AdminReportsAppeal.d.vue.ts +9 -0
  1454. package/dist/runtime/vue/components/admin/AdminReportsAppeal.vue +55 -0
  1455. package/dist/runtime/vue/components/admin/AdminReportsAppeal.vue.d.ts +9 -0
  1456. package/dist/runtime/vue/components/admin/AdminReportsDecision.d.vue.ts +14 -0
  1457. package/dist/runtime/vue/components/admin/AdminReportsDecision.vue +72 -0
  1458. package/dist/runtime/vue/components/admin/AdminReportsDecision.vue.d.ts +14 -0
  1459. package/dist/runtime/vue/components/admin/AdminReportsNotice.d.vue.ts +8 -0
  1460. package/dist/runtime/vue/components/admin/AdminReportsNotice.vue +47 -0
  1461. package/dist/runtime/vue/components/admin/AdminReportsNotice.vue.d.ts +8 -0
  1462. package/dist/runtime/vue/components/admin/AdminReportsSubject.d.vue.ts +8 -0
  1463. package/dist/runtime/vue/components/admin/AdminReportsSubject.vue +76 -0
  1464. package/dist/runtime/vue/components/admin/AdminReportsSubject.vue.d.ts +8 -0
  1465. package/dist/runtime/vue/components/admin/AdminRevenue.css +1 -0
  1466. package/dist/runtime/vue/components/admin/AdminRevenue.d.vue.ts +3 -0
  1467. package/dist/runtime/vue/components/admin/AdminRevenue.vue +197 -0
  1468. package/dist/runtime/vue/components/admin/AdminRevenue.vue.d.ts +3 -0
  1469. package/dist/runtime/vue/components/admin/AdminSuppressions.css +1 -0
  1470. package/dist/runtime/vue/components/admin/AdminSuppressions.d.vue.ts +3 -0
  1471. package/dist/runtime/vue/components/admin/AdminSuppressions.vue +98 -0
  1472. package/dist/runtime/vue/components/admin/AdminSuppressions.vue.d.ts +3 -0
  1473. package/dist/runtime/vue/components/admin/AdminSystem.d.vue.ts +3 -0
  1474. package/dist/runtime/vue/components/admin/AdminSystem.vue +125 -0
  1475. package/dist/runtime/vue/components/admin/AdminSystem.vue.d.ts +3 -0
  1476. package/dist/runtime/vue/components/admin/AdminTabDialogs.d.vue.ts +8 -0
  1477. package/dist/runtime/vue/components/admin/AdminTabDialogs.vue +18 -0
  1478. package/dist/runtime/vue/components/admin/AdminTabDialogs.vue.d.ts +8 -0
  1479. package/dist/runtime/vue/components/admin/AdminTabStatus.d.vue.ts +7 -0
  1480. package/dist/runtime/vue/components/admin/AdminTabStatus.vue +26 -0
  1481. package/dist/runtime/vue/components/admin/AdminTabStatus.vue.d.ts +7 -0
  1482. package/dist/runtime/vue/components/admin/AdminUserDrawer.d.vue.ts +4 -0
  1483. package/dist/runtime/vue/components/admin/AdminUserDrawer.vue +294 -0
  1484. package/dist/runtime/vue/components/admin/AdminUserDrawer.vue.d.ts +4 -0
  1485. package/dist/runtime/vue/components/admin/AdminUsers.d.vue.ts +863 -0
  1486. package/dist/runtime/vue/components/admin/AdminUsers.vue +157 -0
  1487. package/dist/runtime/vue/components/admin/AdminUsers.vue.d.ts +863 -0
  1488. package/dist/runtime/vue/components/admin/AdminUsersTable.d.vue.ts +3 -0
  1489. package/dist/runtime/vue/components/admin/AdminUsersTable.vue +108 -0
  1490. package/dist/runtime/vue/components/admin/AdminUsersTable.vue.d.ts +3 -0
  1491. package/dist/runtime/vue/components/admin/AdminWaitlist.css +1 -0
  1492. package/dist/runtime/vue/components/admin/AdminWaitlist.d.vue.ts +7 -0
  1493. package/dist/runtime/vue/components/admin/AdminWaitlist.vue +63 -0
  1494. package/dist/runtime/vue/components/admin/AdminWaitlist.vue.d.ts +7 -0
  1495. package/dist/runtime/vue/components/admin/AdminWaitlistActions.d.vue.ts +6 -0
  1496. package/dist/runtime/vue/components/admin/AdminWaitlistActions.vue +58 -0
  1497. package/dist/runtime/vue/components/admin/AdminWaitlistActions.vue.d.ts +6 -0
  1498. package/dist/runtime/vue/components/admin/AdminWaitlistFilter.d.vue.ts +6 -0
  1499. package/dist/runtime/vue/components/admin/AdminWaitlistFilter.vue +86 -0
  1500. package/dist/runtime/vue/components/admin/AdminWaitlistFilter.vue.d.ts +6 -0
  1501. package/dist/runtime/vue/components/admin/AdminWaitlistSummary.d.vue.ts +8 -0
  1502. package/dist/runtime/vue/components/admin/AdminWaitlistSummary.vue +63 -0
  1503. package/dist/runtime/vue/components/admin/AdminWaitlistSummary.vue.d.ts +8 -0
  1504. package/dist/runtime/vue/components/admin/AdminWaitlistTable.d.vue.ts +6 -0
  1505. package/dist/runtime/vue/components/admin/AdminWaitlistTable.vue +75 -0
  1506. package/dist/runtime/vue/components/admin/AdminWaitlistTable.vue.d.ts +6 -0
  1507. package/dist/runtime/vue/components/admin/AdminWebhooks.css +1 -0
  1508. package/dist/runtime/vue/components/admin/AdminWebhooks.d.vue.ts +3 -0
  1509. package/dist/runtime/vue/components/admin/AdminWebhooks.vue +141 -0
  1510. package/dist/runtime/vue/components/admin/AdminWebhooks.vue.d.ts +3 -0
  1511. package/dist/runtime/vue/components/admin/AdminWorkspaceDrawer.d.vue.ts +4 -0
  1512. package/dist/runtime/vue/components/admin/AdminWorkspaceDrawer.vue +99 -0
  1513. package/dist/runtime/vue/components/admin/AdminWorkspaceDrawer.vue.d.ts +4 -0
  1514. package/dist/runtime/vue/components/admin/AdminWorkspaces.d.vue.ts +846 -0
  1515. package/dist/runtime/vue/components/admin/AdminWorkspaces.vue +90 -0
  1516. package/dist/runtime/vue/components/admin/AdminWorkspaces.vue.d.ts +846 -0
  1517. package/dist/runtime/vue/components/admin/AdminWorkspacesTable.d.vue.ts +3 -0
  1518. package/dist/runtime/vue/components/admin/AdminWorkspacesTable.vue +81 -0
  1519. package/dist/runtime/vue/components/admin/AdminWorkspacesTable.vue.d.ts +3 -0
  1520. package/dist/runtime/vue/components/admin/admin-access-tab.d.ts +2 -0
  1521. package/dist/runtime/vue/components/admin/admin-access-tab.js +88 -0
  1522. package/dist/runtime/vue/components/admin/admin-analytics-tab.d.ts +1 -0
  1523. package/dist/runtime/vue/components/admin/admin-analytics-tab.js +19 -0
  1524. package/dist/runtime/vue/components/admin/admin-announcements-tab.d.ts +2 -0
  1525. package/dist/runtime/vue/components/admin/admin-announcements-tab.js +97 -0
  1526. package/dist/runtime/vue/components/admin/admin-billing-tab.d.ts +1 -0
  1527. package/dist/runtime/vue/components/admin/admin-billing-tab.js +43 -0
  1528. package/dist/runtime/vue/components/admin/admin-costs-tab.d.ts +1 -0
  1529. package/dist/runtime/vue/components/admin/admin-costs-tab.js +23 -0
  1530. package/dist/runtime/vue/components/admin/admin-experiments-tab.d.ts +1 -0
  1531. package/dist/runtime/vue/components/admin/admin-experiments-tab.js +60 -0
  1532. package/dist/runtime/vue/components/admin/admin-growth-tab.d.ts +1 -0
  1533. package/dist/runtime/vue/components/admin/admin-growth-tab.js +58 -0
  1534. package/dist/runtime/vue/components/admin/admin-inbox-tab.d.ts +4 -0
  1535. package/dist/runtime/vue/components/admin/admin-inbox-tab.js +44 -0
  1536. package/dist/runtime/vue/components/admin/admin-reports-tab.d.ts +21 -0
  1537. package/dist/runtime/vue/components/admin/admin-reports-tab.js +89 -0
  1538. package/dist/runtime/vue/components/admin/admin-revenue-tab.d.ts +12 -0
  1539. package/dist/runtime/vue/components/admin/admin-revenue-tab.js +81 -0
  1540. package/dist/runtime/vue/components/admin/admin-suppressions-tab.d.ts +1 -0
  1541. package/dist/runtime/vue/components/admin/admin-suppressions-tab.js +27 -0
  1542. package/dist/runtime/vue/components/admin/admin-tabs.d.ts +86 -0
  1543. package/dist/runtime/vue/components/admin/admin-tabs.js +69 -0
  1544. package/dist/runtime/vue/components/admin/admin-views.d.ts +34 -0
  1545. package/dist/runtime/vue/components/admin/admin-views.js +22 -0
  1546. package/dist/runtime/vue/components/admin/admin-waitlist-tab.d.ts +2 -0
  1547. package/dist/runtime/vue/components/admin/admin-waitlist-tab.js +93 -0
  1548. package/dist/runtime/vue/components/admin/admin-webhooks-tab.d.ts +5 -0
  1549. package/dist/runtime/vue/components/admin/admin-webhooks-tab.js +35 -0
  1550. package/dist/runtime/vue/components/admin/admin.css +1 -0
  1551. package/dist/runtime/vue/components/admin/admin.d.ts +132 -0
  1552. package/dist/runtime/vue/components/admin/admin.js +96 -0
  1553. package/dist/runtime/vue/components/auth/AuthForm.css +1 -0
  1554. package/dist/runtime/vue/components/auth/AuthForm.d.vue.ts +90 -0
  1555. package/dist/runtime/vue/components/auth/AuthForm.vue +192 -0
  1556. package/dist/runtime/vue/components/auth/AuthForm.vue.d.ts +90 -0
  1557. package/dist/runtime/vue/components/auth/AuthFormAge.css +1 -0
  1558. package/dist/runtime/vue/components/auth/AuthFormAge.d.vue.ts +3 -0
  1559. package/dist/runtime/vue/components/auth/AuthFormAge.vue +42 -0
  1560. package/dist/runtime/vue/components/auth/AuthFormAge.vue.d.ts +3 -0
  1561. package/dist/runtime/vue/components/auth/AuthFormAgreement.css +1 -0
  1562. package/dist/runtime/vue/components/auth/AuthFormAgreement.d.vue.ts +3 -0
  1563. package/dist/runtime/vue/components/auth/AuthFormAgreement.vue +31 -0
  1564. package/dist/runtime/vue/components/auth/AuthFormAgreement.vue.d.ts +3 -0
  1565. package/dist/runtime/vue/components/auth/AuthFormChoose.css +1 -0
  1566. package/dist/runtime/vue/components/auth/AuthFormChoose.d.vue.ts +3 -0
  1567. package/dist/runtime/vue/components/auth/AuthFormChoose.vue +44 -0
  1568. package/dist/runtime/vue/components/auth/AuthFormChoose.vue.d.ts +3 -0
  1569. package/dist/runtime/vue/components/auth/AuthFormCode.d.vue.ts +3 -0
  1570. package/dist/runtime/vue/components/auth/AuthFormCode.vue +46 -0
  1571. package/dist/runtime/vue/components/auth/AuthFormCode.vue.d.ts +3 -0
  1572. package/dist/runtime/vue/components/auth/AuthFormEmail.d.vue.ts +3 -0
  1573. package/dist/runtime/vue/components/auth/AuthFormEmail.vue +40 -0
  1574. package/dist/runtime/vue/components/auth/AuthFormEmail.vue.d.ts +3 -0
  1575. package/dist/runtime/vue/components/auth/AuthFormError.css +1 -0
  1576. package/dist/runtime/vue/components/auth/AuthFormError.d.vue.ts +3 -0
  1577. package/dist/runtime/vue/components/auth/AuthFormError.vue +18 -0
  1578. package/dist/runtime/vue/components/auth/AuthFormError.vue.d.ts +3 -0
  1579. package/dist/runtime/vue/components/auth/AuthFormHeader.css +1 -0
  1580. package/dist/runtime/vue/components/auth/AuthFormHeader.d.vue.ts +3 -0
  1581. package/dist/runtime/vue/components/auth/AuthFormHeader.vue +25 -0
  1582. package/dist/runtime/vue/components/auth/AuthFormHeader.vue.d.ts +3 -0
  1583. package/dist/runtime/vue/components/auth/AuthFormInviteCode.css +1 -0
  1584. package/dist/runtime/vue/components/auth/AuthFormInviteCode.d.vue.ts +3 -0
  1585. package/dist/runtime/vue/components/auth/AuthFormInviteCode.vue +48 -0
  1586. package/dist/runtime/vue/components/auth/AuthFormInviteCode.vue.d.ts +3 -0
  1587. package/dist/runtime/vue/components/auth/AuthFormPasskey.d.vue.ts +3 -0
  1588. package/dist/runtime/vue/components/auth/AuthFormPasskey.vue +26 -0
  1589. package/dist/runtime/vue/components/auth/AuthFormPasskey.vue.d.ts +3 -0
  1590. package/dist/runtime/vue/components/auth/AuthFormPasskeyOffer.css +1 -0
  1591. package/dist/runtime/vue/components/auth/AuthFormPasskeyOffer.d.vue.ts +3 -0
  1592. package/dist/runtime/vue/components/auth/AuthFormPasskeyOffer.vue +46 -0
  1593. package/dist/runtime/vue/components/auth/AuthFormPasskeyOffer.vue.d.ts +3 -0
  1594. package/dist/runtime/vue/components/auth/AuthFormRecover.css +1 -0
  1595. package/dist/runtime/vue/components/auth/AuthFormRecover.d.vue.ts +3 -0
  1596. package/dist/runtime/vue/components/auth/AuthFormRecover.vue +52 -0
  1597. package/dist/runtime/vue/components/auth/AuthFormRecover.vue.d.ts +3 -0
  1598. package/dist/runtime/vue/components/auth/AuthFormUndeliverable.css +1 -0
  1599. package/dist/runtime/vue/components/auth/AuthFormUndeliverable.d.vue.ts +3 -0
  1600. package/dist/runtime/vue/components/auth/AuthFormUndeliverable.vue +29 -0
  1601. package/dist/runtime/vue/components/auth/AuthFormUndeliverable.vue.d.ts +3 -0
  1602. package/dist/runtime/vue/components/auth/AuthFormWaitlisted.css +1 -0
  1603. package/dist/runtime/vue/components/auth/AuthFormWaitlisted.d.vue.ts +3 -0
  1604. package/dist/runtime/vue/components/auth/AuthFormWaitlisted.vue +36 -0
  1605. package/dist/runtime/vue/components/auth/AuthFormWaitlisted.vue.d.ts +3 -0
  1606. package/dist/runtime/vue/components/auth/InviteRedeem.css +1 -0
  1607. package/dist/runtime/vue/components/auth/InviteRedeem.d.vue.ts +3 -0
  1608. package/dist/runtime/vue/components/auth/InviteRedeem.vue +47 -0
  1609. package/dist/runtime/vue/components/auth/InviteRedeem.vue.d.ts +3 -0
  1610. package/dist/runtime/vue/components/auth/ReauthenticateCode.css +1 -0
  1611. package/dist/runtime/vue/components/auth/ReauthenticateCode.d.vue.ts +3 -0
  1612. package/dist/runtime/vue/components/auth/ReauthenticateCode.vue +57 -0
  1613. package/dist/runtime/vue/components/auth/ReauthenticateCode.vue.d.ts +3 -0
  1614. package/dist/runtime/vue/components/auth/ReauthenticateDialog.css +1 -0
  1615. package/dist/runtime/vue/components/auth/ReauthenticateDialog.d.vue.ts +43 -0
  1616. package/dist/runtime/vue/components/auth/ReauthenticateDialog.vue +136 -0
  1617. package/dist/runtime/vue/components/auth/ReauthenticateDialog.vue.d.ts +43 -0
  1618. package/dist/runtime/vue/components/auth/ReauthenticatePasskey.css +1 -0
  1619. package/dist/runtime/vue/components/auth/ReauthenticatePasskey.d.vue.ts +3 -0
  1620. package/dist/runtime/vue/components/auth/ReauthenticatePasskey.vue +36 -0
  1621. package/dist/runtime/vue/components/auth/ReauthenticatePasskey.vue.d.ts +3 -0
  1622. package/dist/runtime/vue/components/auth/WaitlistCode.css +1 -0
  1623. package/dist/runtime/vue/components/auth/WaitlistCode.d.vue.ts +3 -0
  1624. package/dist/runtime/vue/components/auth/WaitlistCode.vue +55 -0
  1625. package/dist/runtime/vue/components/auth/WaitlistCode.vue.d.ts +3 -0
  1626. package/dist/runtime/vue/components/auth/WaitlistForm.css +1 -0
  1627. package/dist/runtime/vue/components/auth/WaitlistForm.d.vue.ts +74 -0
  1628. package/dist/runtime/vue/components/auth/WaitlistForm.vue +81 -0
  1629. package/dist/runtime/vue/components/auth/WaitlistForm.vue.d.ts +74 -0
  1630. package/dist/runtime/vue/components/auth/WaitlistJoin.css +1 -0
  1631. package/dist/runtime/vue/components/auth/WaitlistJoin.d.vue.ts +3 -0
  1632. package/dist/runtime/vue/components/auth/WaitlistJoin.vue +97 -0
  1633. package/dist/runtime/vue/components/auth/WaitlistJoin.vue.d.ts +3 -0
  1634. package/dist/runtime/vue/components/auth/WaitlistPlace.css +1 -0
  1635. package/dist/runtime/vue/components/auth/WaitlistPlace.d.vue.ts +3 -0
  1636. package/dist/runtime/vue/components/auth/WaitlistPlace.vue +68 -0
  1637. package/dist/runtime/vue/components/auth/WaitlistPlace.vue.d.ts +3 -0
  1638. package/dist/runtime/vue/components/auth/WaitlistShare.css +1 -0
  1639. package/dist/runtime/vue/components/auth/WaitlistShare.d.vue.ts +3 -0
  1640. package/dist/runtime/vue/components/auth/WaitlistShare.vue +65 -0
  1641. package/dist/runtime/vue/components/auth/WaitlistShare.vue.d.ts +3 -0
  1642. package/dist/runtime/vue/components/auth/WaitlistStatus.css +1 -0
  1643. package/dist/runtime/vue/components/auth/WaitlistStatus.d.vue.ts +3 -0
  1644. package/dist/runtime/vue/components/auth/WaitlistStatus.vue +58 -0
  1645. package/dist/runtime/vue/components/auth/WaitlistStatus.vue.d.ts +3 -0
  1646. package/dist/runtime/vue/components/auth/auth-form.d.ts +52 -0
  1647. package/dist/runtime/vue/components/auth/auth-form.js +31 -0
  1648. package/dist/runtime/vue/components/auth/reauthenticate.d.ts +31 -0
  1649. package/dist/runtime/vue/components/auth/reauthenticate.js +10 -0
  1650. package/dist/runtime/vue/components/auth/waitlist-form.d.ts +10 -0
  1651. package/dist/runtime/vue/components/auth/waitlist-form.js +9 -0
  1652. package/dist/runtime/vue/components/billing/BillingCheckoutLink.d.vue.ts +50 -0
  1653. package/dist/runtime/vue/components/billing/BillingCheckoutLink.vue +63 -0
  1654. package/dist/runtime/vue/components/billing/BillingCheckoutLink.vue.d.ts +50 -0
  1655. package/dist/runtime/vue/components/billing/BillingHistory.css +1 -0
  1656. package/dist/runtime/vue/components/billing/BillingHistory.d.vue.ts +51 -0
  1657. package/dist/runtime/vue/components/billing/BillingHistory.vue +98 -0
  1658. package/dist/runtime/vue/components/billing/BillingHistory.vue.d.ts +51 -0
  1659. package/dist/runtime/vue/components/billing/BillingHistoryOrder.css +1 -0
  1660. package/dist/runtime/vue/components/billing/BillingHistoryOrder.d.vue.ts +4 -0
  1661. package/dist/runtime/vue/components/billing/BillingHistoryOrder.vue +49 -0
  1662. package/dist/runtime/vue/components/billing/BillingHistoryOrder.vue.d.ts +4 -0
  1663. package/dist/runtime/vue/components/billing/BillingPortalLink.d.vue.ts +31 -0
  1664. package/dist/runtime/vue/components/billing/BillingPortalLink.vue +39 -0
  1665. package/dist/runtime/vue/components/billing/BillingPortalLink.vue.d.ts +31 -0
  1666. package/dist/runtime/vue/components/billing/CancelConfirmGroup.d.vue.ts +7 -0
  1667. package/dist/runtime/vue/components/billing/CancelConfirmGroup.vue +47 -0
  1668. package/dist/runtime/vue/components/billing/CancelConfirmGroup.vue.d.ts +7 -0
  1669. package/dist/runtime/vue/components/billing/CancelFlow.css +1 -0
  1670. package/dist/runtime/vue/components/billing/CancelFlow.d.vue.ts +66 -0
  1671. package/dist/runtime/vue/components/billing/CancelFlow.vue +97 -0
  1672. package/dist/runtime/vue/components/billing/CancelFlow.vue.d.ts +66 -0
  1673. package/dist/runtime/vue/components/billing/CancelFlowEnd.d.vue.ts +3 -0
  1674. package/dist/runtime/vue/components/billing/CancelFlowEnd.vue +42 -0
  1675. package/dist/runtime/vue/components/billing/CancelFlowEnd.vue.d.ts +3 -0
  1676. package/dist/runtime/vue/components/billing/CancelFlowOffer.d.vue.ts +3 -0
  1677. package/dist/runtime/vue/components/billing/CancelFlowOffer.vue +29 -0
  1678. package/dist/runtime/vue/components/billing/CancelFlowOffer.vue.d.ts +3 -0
  1679. package/dist/runtime/vue/components/billing/CancelFlowQuestion.d.vue.ts +3 -0
  1680. package/dist/runtime/vue/components/billing/CancelFlowQuestion.vue +51 -0
  1681. package/dist/runtime/vue/components/billing/CancelFlowQuestion.vue.d.ts +3 -0
  1682. package/dist/runtime/vue/components/billing/GiftList.css +1 -0
  1683. package/dist/runtime/vue/components/billing/GiftList.d.vue.ts +8 -0
  1684. package/dist/runtime/vue/components/billing/GiftList.vue +118 -0
  1685. package/dist/runtime/vue/components/billing/GiftList.vue.d.ts +8 -0
  1686. package/dist/runtime/vue/components/billing/GiftReceived.d.vue.ts +28 -0
  1687. package/dist/runtime/vue/components/billing/GiftReceived.vue +62 -0
  1688. package/dist/runtime/vue/components/billing/GiftReceived.vue.d.ts +28 -0
  1689. package/dist/runtime/vue/components/billing/GiftSent.d.vue.ts +27 -0
  1690. package/dist/runtime/vue/components/billing/GiftSent.vue +121 -0
  1691. package/dist/runtime/vue/components/billing/GiftSent.vue.d.ts +27 -0
  1692. package/dist/runtime/vue/components/billing/PricingCancelConfirm.d.vue.ts +3 -0
  1693. package/dist/runtime/vue/components/billing/PricingCancelConfirm.vue +13 -0
  1694. package/dist/runtime/vue/components/billing/PricingCancelConfirm.vue.d.ts +3 -0
  1695. package/dist/runtime/vue/components/billing/PricingCurrencySelect.d.vue.ts +3 -0
  1696. package/dist/runtime/vue/components/billing/PricingCurrencySelect.vue +45 -0
  1697. package/dist/runtime/vue/components/billing/PricingCurrencySelect.vue.d.ts +3 -0
  1698. package/dist/runtime/vue/components/billing/PricingEmailOptOut.css +1 -0
  1699. package/dist/runtime/vue/components/billing/PricingEmailOptOut.d.vue.ts +10 -0
  1700. package/dist/runtime/vue/components/billing/PricingEmailOptOut.vue +23 -0
  1701. package/dist/runtime/vue/components/billing/PricingEmailOptOut.vue.d.ts +10 -0
  1702. package/dist/runtime/vue/components/billing/PricingPackCard.css +1 -0
  1703. package/dist/runtime/vue/components/billing/PricingPackCard.d.vue.ts +4 -0
  1704. package/dist/runtime/vue/components/billing/PricingPackCard.vue +75 -0
  1705. package/dist/runtime/vue/components/billing/PricingPackCard.vue.d.ts +4 -0
  1706. package/dist/runtime/vue/components/billing/PricingPeriodSwitch.d.vue.ts +3 -0
  1707. package/dist/runtime/vue/components/billing/PricingPeriodSwitch.vue +46 -0
  1708. package/dist/runtime/vue/components/billing/PricingPeriodSwitch.vue.d.ts +3 -0
  1709. package/dist/runtime/vue/components/billing/PricingPlanCard.css +1 -0
  1710. package/dist/runtime/vue/components/billing/PricingPlanCard.d.vue.ts +4 -0
  1711. package/dist/runtime/vue/components/billing/PricingPlanCard.vue +134 -0
  1712. package/dist/runtime/vue/components/billing/PricingPlanCard.vue.d.ts +4 -0
  1713. package/dist/runtime/vue/components/billing/PricingPromotion.d.vue.ts +7 -0
  1714. package/dist/runtime/vue/components/billing/PricingPromotion.vue +20 -0
  1715. package/dist/runtime/vue/components/billing/PricingPromotion.vue.d.ts +7 -0
  1716. package/dist/runtime/vue/components/billing/PricingTable.css +1 -0
  1717. package/dist/runtime/vue/components/billing/PricingTable.d.vue.ts +145 -0
  1718. package/dist/runtime/vue/components/billing/PricingTable.vue +541 -0
  1719. package/dist/runtime/vue/components/billing/PricingTable.vue.d.ts +145 -0
  1720. package/dist/runtime/vue/components/billing/ReferralCard.css +1 -0
  1721. package/dist/runtime/vue/components/billing/ReferralCard.d.vue.ts +67 -0
  1722. package/dist/runtime/vue/components/billing/ReferralCard.vue +178 -0
  1723. package/dist/runtime/vue/components/billing/ReferralCard.vue.d.ts +67 -0
  1724. package/dist/runtime/vue/components/billing/ReferralLanding.css +1 -0
  1725. package/dist/runtime/vue/components/billing/ReferralLanding.d.vue.ts +3 -0
  1726. package/dist/runtime/vue/components/billing/ReferralLanding.vue +100 -0
  1727. package/dist/runtime/vue/components/billing/ReferralLanding.vue.d.ts +3 -0
  1728. package/dist/runtime/vue/components/billing/UpgradePrompt.css +1 -0
  1729. package/dist/runtime/vue/components/billing/UpgradePrompt.d.vue.ts +45 -0
  1730. package/dist/runtime/vue/components/billing/UpgradePrompt.vue +96 -0
  1731. package/dist/runtime/vue/components/billing/UpgradePrompt.vue.d.ts +45 -0
  1732. package/dist/runtime/vue/components/billing/UsageHistory.css +1 -0
  1733. package/dist/runtime/vue/components/billing/UsageHistory.d.vue.ts +34 -0
  1734. package/dist/runtime/vue/components/billing/UsageHistory.vue +76 -0
  1735. package/dist/runtime/vue/components/billing/UsageHistory.vue.d.ts +34 -0
  1736. package/dist/runtime/vue/components/billing/UsageHistoryEvent.css +1 -0
  1737. package/dist/runtime/vue/components/billing/UsageHistoryEvent.d.vue.ts +4 -0
  1738. package/dist/runtime/vue/components/billing/UsageHistoryEvent.vue +22 -0
  1739. package/dist/runtime/vue/components/billing/UsageHistoryEvent.vue.d.ts +4 -0
  1740. package/dist/runtime/vue/components/billing/WithdrawalButton.css +1 -0
  1741. package/dist/runtime/vue/components/billing/WithdrawalButton.d.vue.ts +33 -0
  1742. package/dist/runtime/vue/components/billing/WithdrawalButton.vue +93 -0
  1743. package/dist/runtime/vue/components/billing/WithdrawalButton.vue.d.ts +33 -0
  1744. package/dist/runtime/vue/components/billing/billing-history.d.ts +43 -0
  1745. package/dist/runtime/vue/components/billing/billing-history.js +10 -0
  1746. package/dist/runtime/vue/components/billing/billing-links.d.ts +9 -0
  1747. package/dist/runtime/vue/components/billing/billing-links.js +17 -0
  1748. package/dist/runtime/vue/components/billing/cancel-flow.d.ts +81 -0
  1749. package/dist/runtime/vue/components/billing/cancel-flow.js +97 -0
  1750. package/dist/runtime/vue/components/billing/pricing-table.d.ts +195 -0
  1751. package/dist/runtime/vue/components/billing/pricing-table.js +10 -0
  1752. package/dist/runtime/vue/components/billing/upgrade-prompt.d.ts +38 -0
  1753. package/dist/runtime/vue/components/billing/upgrade-prompt.js +30 -0
  1754. package/dist/runtime/vue/components/billing/usage-history.d.ts +28 -0
  1755. package/dist/runtime/vue/components/billing/usage-history.js +8 -0
  1756. package/dist/runtime/vue/components/billing/withdrawal-button.d.ts +44 -0
  1757. package/dist/runtime/vue/components/billing/withdrawal-button.js +71 -0
  1758. package/dist/runtime/vue/components/renamed-billing-links.d.ts +1 -0
  1759. package/dist/runtime/vue/components/renamed-billing-links.js +4 -0
  1760. package/dist/runtime/vue/components/renamed-storage-image.d.ts +1 -0
  1761. package/dist/runtime/vue/components/renamed-storage-image.js +3 -0
  1762. package/dist/runtime/vue/components/shared.css +1 -0
  1763. package/dist/runtime/vue/components/shell/AccessDenied.css +1 -0
  1764. package/dist/runtime/vue/components/shell/AccessDenied.d.vue.ts +54 -0
  1765. package/dist/runtime/vue/components/shell/AccessDenied.vue +158 -0
  1766. package/dist/runtime/vue/components/shell/AccessDenied.vue.d.ts +54 -0
  1767. package/dist/runtime/vue/components/shell/AccessDeniedPage.d.vue.ts +10 -0
  1768. package/dist/runtime/vue/components/shell/AccessDeniedPage.vue +16 -0
  1769. package/dist/runtime/vue/components/shell/AccessDeniedPage.vue.d.ts +10 -0
  1770. package/dist/runtime/vue/components/shell/AccountMenu.css +1 -0
  1771. package/dist/runtime/vue/components/shell/AccountMenu.d.vue.ts +3 -0
  1772. package/dist/runtime/vue/components/shell/AccountMenu.vue +85 -0
  1773. package/dist/runtime/vue/components/shell/AccountMenu.vue.d.ts +3 -0
  1774. package/dist/runtime/vue/components/shell/AiLabel.css +1 -0
  1775. package/dist/runtime/vue/components/shell/AiLabel.d.vue.ts +31 -0
  1776. package/dist/runtime/vue/components/shell/AiLabel.vue +39 -0
  1777. package/dist/runtime/vue/components/shell/AiLabel.vue.d.ts +31 -0
  1778. package/dist/runtime/vue/components/shell/AppShell.css +1 -0
  1779. package/dist/runtime/vue/components/shell/AppShell.d.vue.ts +61 -0
  1780. package/dist/runtime/vue/components/shell/AppShell.vue +90 -0
  1781. package/dist/runtime/vue/components/shell/AppShell.vue.d.ts +61 -0
  1782. package/dist/runtime/vue/components/shell/BackendNotices.d.vue.ts +17 -0
  1783. package/dist/runtime/vue/components/shell/BackendNotices.vue +34 -0
  1784. package/dist/runtime/vue/components/shell/BackendNotices.vue.d.ts +17 -0
  1785. package/dist/runtime/vue/components/shell/ConfirmDialog.css +1 -0
  1786. package/dist/runtime/vue/components/shell/ConfirmDialog.d.vue.ts +11 -0
  1787. package/dist/runtime/vue/components/shell/ConfirmDialog.vue +55 -0
  1788. package/dist/runtime/vue/components/shell/ConfirmDialog.vue.d.ts +11 -0
  1789. package/dist/runtime/vue/components/shell/ConnectionStatus.css +1 -0
  1790. package/dist/runtime/vue/components/shell/ConnectionStatus.d.vue.ts +25 -0
  1791. package/dist/runtime/vue/components/shell/ConnectionStatus.vue +66 -0
  1792. package/dist/runtime/vue/components/shell/ConnectionStatus.vue.d.ts +25 -0
  1793. package/dist/runtime/vue/components/shell/ContactForm.css +1 -0
  1794. package/dist/runtime/vue/components/shell/ContactForm.d.vue.ts +23 -0
  1795. package/dist/runtime/vue/components/shell/ContactForm.vue +108 -0
  1796. package/dist/runtime/vue/components/shell/ContactForm.vue.d.ts +23 -0
  1797. package/dist/runtime/vue/components/shell/ErrorPage.d.vue.ts +8 -0
  1798. package/dist/runtime/vue/components/shell/ErrorPage.vue +21 -0
  1799. package/dist/runtime/vue/components/shell/ErrorPage.vue.d.ts +8 -0
  1800. package/dist/runtime/vue/components/shell/FrameConnectionStatus.d.vue.ts +3 -0
  1801. package/dist/runtime/vue/components/shell/FrameConnectionStatus.vue +10 -0
  1802. package/dist/runtime/vue/components/shell/FrameConnectionStatus.vue.d.ts +3 -0
  1803. package/dist/runtime/vue/components/shell/FrameMain.d.vue.ts +22 -0
  1804. package/dist/runtime/vue/components/shell/FrameMain.vue +51 -0
  1805. package/dist/runtime/vue/components/shell/FrameMain.vue.d.ts +22 -0
  1806. package/dist/runtime/vue/components/shell/Gate.css +1 -0
  1807. package/dist/runtime/vue/components/shell/Gate.d.vue.ts +49 -0
  1808. package/dist/runtime/vue/components/shell/Gate.vue +148 -0
  1809. package/dist/runtime/vue/components/shell/Gate.vue.d.ts +49 -0
  1810. package/dist/runtime/vue/components/shell/GateQuota.d.vue.ts +34 -0
  1811. package/dist/runtime/vue/components/shell/GateQuota.vue +74 -0
  1812. package/dist/runtime/vue/components/shell/GateQuota.vue.d.ts +34 -0
  1813. package/dist/runtime/vue/components/shell/LegalDataMap.d.vue.ts +7 -0
  1814. package/dist/runtime/vue/components/shell/LegalDataMap.vue +34 -0
  1815. package/dist/runtime/vue/components/shell/LegalDataMap.vue.d.ts +7 -0
  1816. package/dist/runtime/vue/components/shell/LegalDocument.css +1 -0
  1817. package/dist/runtime/vue/components/shell/LegalDocument.d.vue.ts +7 -0
  1818. package/dist/runtime/vue/components/shell/LegalDocument.vue +248 -0
  1819. package/dist/runtime/vue/components/shell/LegalDocument.vue.d.ts +7 -0
  1820. package/dist/runtime/vue/components/shell/LegalProcessors.d.vue.ts +7 -0
  1821. package/dist/runtime/vue/components/shell/LegalProcessors.vue +49 -0
  1822. package/dist/runtime/vue/components/shell/LegalProcessors.vue.d.ts +7 -0
  1823. package/dist/runtime/vue/components/shell/LegalStorage.d.vue.ts +7 -0
  1824. package/dist/runtime/vue/components/shell/LegalStorage.vue +47 -0
  1825. package/dist/runtime/vue/components/shell/LegalStorage.vue.d.ts +7 -0
  1826. package/dist/runtime/vue/components/shell/ListPager.d.vue.ts +8 -0
  1827. package/dist/runtime/vue/components/shell/ListPager.vue +38 -0
  1828. package/dist/runtime/vue/components/shell/ListPager.vue.d.ts +8 -0
  1829. package/dist/runtime/vue/components/shell/NoticeAnnouncement.css +1 -0
  1830. package/dist/runtime/vue/components/shell/NoticeAnnouncement.d.vue.ts +8 -0
  1831. package/dist/runtime/vue/components/shell/NoticeAnnouncement.vue +108 -0
  1832. package/dist/runtime/vue/components/shell/NoticeAnnouncement.vue.d.ts +8 -0
  1833. package/dist/runtime/vue/components/shell/NoticeDeletion.css +1 -0
  1834. package/dist/runtime/vue/components/shell/NoticeDeletion.d.vue.ts +7 -0
  1835. package/dist/runtime/vue/components/shell/NoticeDeletion.vue +68 -0
  1836. package/dist/runtime/vue/components/shell/NoticeDeletion.vue.d.ts +7 -0
  1837. package/dist/runtime/vue/components/shell/NoticeGift.css +1 -0
  1838. package/dist/runtime/vue/components/shell/NoticeGift.d.vue.ts +14 -0
  1839. package/dist/runtime/vue/components/shell/NoticeGift.vue +138 -0
  1840. package/dist/runtime/vue/components/shell/NoticeGift.vue.d.ts +14 -0
  1841. package/dist/runtime/vue/components/shell/NoticeImpersonation.css +1 -0
  1842. package/dist/runtime/vue/components/shell/NoticeImpersonation.d.vue.ts +14 -0
  1843. package/dist/runtime/vue/components/shell/NoticeImpersonation.vue +90 -0
  1844. package/dist/runtime/vue/components/shell/NoticeImpersonation.vue.d.ts +14 -0
  1845. package/dist/runtime/vue/components/shell/NoticeLowCredits.css +1 -0
  1846. package/dist/runtime/vue/components/shell/NoticeLowCredits.d.vue.ts +50 -0
  1847. package/dist/runtime/vue/components/shell/NoticeLowCredits.vue +168 -0
  1848. package/dist/runtime/vue/components/shell/NoticeLowCredits.vue.d.ts +50 -0
  1849. package/dist/runtime/vue/components/shell/NoticeMaintenance.css +1 -0
  1850. package/dist/runtime/vue/components/shell/NoticeMaintenance.d.vue.ts +7 -0
  1851. package/dist/runtime/vue/components/shell/NoticeMaintenance.vue +35 -0
  1852. package/dist/runtime/vue/components/shell/NoticeMaintenance.vue.d.ts +7 -0
  1853. package/dist/runtime/vue/components/shell/NoticePastDue.css +1 -0
  1854. package/dist/runtime/vue/components/shell/NoticePastDue.d.vue.ts +7 -0
  1855. package/dist/runtime/vue/components/shell/NoticePastDue.vue +64 -0
  1856. package/dist/runtime/vue/components/shell/NoticePastDue.vue.d.ts +7 -0
  1857. package/dist/runtime/vue/components/shell/NotificationInbox.css +1 -0
  1858. package/dist/runtime/vue/components/shell/NotificationInbox.d.vue.ts +18 -0
  1859. package/dist/runtime/vue/components/shell/NotificationInbox.vue +78 -0
  1860. package/dist/runtime/vue/components/shell/NotificationInbox.vue.d.ts +18 -0
  1861. package/dist/runtime/vue/components/shell/NotificationInboxBell.d.vue.ts +3 -0
  1862. package/dist/runtime/vue/components/shell/NotificationInboxBell.vue +37 -0
  1863. package/dist/runtime/vue/components/shell/NotificationInboxBell.vue.d.ts +3 -0
  1864. package/dist/runtime/vue/components/shell/NotificationInboxItem.d.vue.ts +4 -0
  1865. package/dist/runtime/vue/components/shell/NotificationInboxItem.vue +48 -0
  1866. package/dist/runtime/vue/components/shell/NotificationInboxItem.vue.d.ts +4 -0
  1867. package/dist/runtime/vue/components/shell/PageFrame.d.vue.ts +35 -0
  1868. package/dist/runtime/vue/components/shell/PageFrame.vue +79 -0
  1869. package/dist/runtime/vue/components/shell/PageFrame.vue.d.ts +35 -0
  1870. package/dist/runtime/vue/components/shell/PagedList.d.vue.ts +46 -0
  1871. package/dist/runtime/vue/components/shell/PagedList.vue +98 -0
  1872. package/dist/runtime/vue/components/shell/PagedList.vue.d.ts +46 -0
  1873. package/dist/runtime/vue/components/shell/ReportAppeal.d.vue.ts +7 -0
  1874. package/dist/runtime/vue/components/shell/ReportAppeal.vue +90 -0
  1875. package/dist/runtime/vue/components/shell/ReportAppeal.vue.d.ts +7 -0
  1876. package/dist/runtime/vue/components/shell/ReportNotice.css +1 -0
  1877. package/dist/runtime/vue/components/shell/ReportNotice.d.vue.ts +3 -0
  1878. package/dist/runtime/vue/components/shell/ReportNotice.vue +158 -0
  1879. package/dist/runtime/vue/components/shell/ReportNotice.vue.d.ts +3 -0
  1880. package/dist/runtime/vue/components/shell/UploadField.css +1 -0
  1881. package/dist/runtime/vue/components/shell/UploadField.d.vue.ts +29 -0
  1882. package/dist/runtime/vue/components/shell/UploadField.vue +74 -0
  1883. package/dist/runtime/vue/components/shell/UploadField.vue.d.ts +29 -0
  1884. package/dist/runtime/vue/components/shell/WorkspaceSwitcher.css +1 -0
  1885. package/dist/runtime/vue/components/shell/WorkspaceSwitcher.d.vue.ts +3 -0
  1886. package/dist/runtime/vue/components/shell/WorkspaceSwitcher.vue +126 -0
  1887. package/dist/runtime/vue/components/shell/WorkspaceSwitcher.vue.d.ts +3 -0
  1888. package/dist/runtime/vue/components/shell/access-denied.d.ts +27 -0
  1889. package/dist/runtime/vue/components/shell/access-denied.js +1 -0
  1890. package/dist/runtime/vue/components/shell/ai-label.d.ts +5 -0
  1891. package/dist/runtime/vue/components/shell/ai-label.js +0 -0
  1892. package/dist/runtime/vue/components/shell/app-shell.d.ts +11 -0
  1893. package/dist/runtime/vue/components/shell/app-shell.js +1 -0
  1894. package/dist/runtime/vue/components/shell/connection-status.d.ts +24 -0
  1895. package/dist/runtime/vue/components/shell/connection-status.js +31 -0
  1896. package/dist/runtime/vue/components/shell/contact-form.d.ts +15 -0
  1897. package/dist/runtime/vue/components/shell/contact-form.js +0 -0
  1898. package/dist/runtime/vue/components/shell/gate.d.ts +76 -0
  1899. package/dist/runtime/vue/components/shell/gate.js +0 -0
  1900. package/dist/runtime/vue/components/shell/legal.d.ts +24 -0
  1901. package/dist/runtime/vue/components/shell/legal.js +69 -0
  1902. package/dist/runtime/vue/components/shell/notices.d.ts +99 -0
  1903. package/dist/runtime/vue/components/shell/notices.js +6 -0
  1904. package/dist/runtime/vue/components/shell/notification-inbox.d.ts +11 -0
  1905. package/dist/runtime/vue/components/shell/notification-inbox.js +0 -0
  1906. package/dist/runtime/vue/components/shell/report-form.d.ts +1 -0
  1907. package/dist/runtime/vue/components/shell/report-form.js +117 -0
  1908. package/dist/runtime/vue/components/shell/upload-field.d.ts +16 -0
  1909. package/dist/runtime/vue/components/shell/upload-field.js +0 -0
  1910. package/dist/runtime/vue/components/tokens.css +1 -0
  1911. package/dist/runtime/vue/components/workspaces/AcceptInvitation.css +1 -0
  1912. package/dist/runtime/vue/components/workspaces/AcceptInvitation.d.vue.ts +52 -0
  1913. package/dist/runtime/vue/components/workspaces/AcceptInvitation.vue +156 -0
  1914. package/dist/runtime/vue/components/workspaces/AcceptInvitation.vue.d.ts +52 -0
  1915. package/dist/runtime/vue/components/workspaces/AcceptInvitationActions.css +1 -0
  1916. package/dist/runtime/vue/components/workspaces/AcceptInvitationActions.d.vue.ts +4 -0
  1917. package/dist/runtime/vue/components/workspaces/AcceptInvitationActions.vue +30 -0
  1918. package/dist/runtime/vue/components/workspaces/AcceptInvitationActions.vue.d.ts +4 -0
  1919. package/dist/runtime/vue/components/workspaces/AuditLog.css +1 -0
  1920. package/dist/runtime/vue/components/workspaces/AuditLog.d.vue.ts +185 -0
  1921. package/dist/runtime/vue/components/workspaces/AuditLog.vue +77 -0
  1922. package/dist/runtime/vue/components/workspaces/AuditLog.vue.d.ts +185 -0
  1923. package/dist/runtime/vue/components/workspaces/AuditLogEvent.css +1 -0
  1924. package/dist/runtime/vue/components/workspaces/AuditLogEvent.d.vue.ts +4 -0
  1925. package/dist/runtime/vue/components/workspaces/AuditLogEvent.vue +30 -0
  1926. package/dist/runtime/vue/components/workspaces/AuditLogEvent.vue.d.ts +4 -0
  1927. package/dist/runtime/vue/components/workspaces/WorkspaceBilling.css +1 -0
  1928. package/dist/runtime/vue/components/workspaces/WorkspaceBilling.d.vue.ts +4 -0
  1929. package/dist/runtime/vue/components/workspaces/WorkspaceBilling.vue +236 -0
  1930. package/dist/runtime/vue/components/workspaces/WorkspaceBilling.vue.d.ts +4 -0
  1931. package/dist/runtime/vue/components/workspaces/WorkspaceCredits.css +1 -0
  1932. package/dist/runtime/vue/components/workspaces/WorkspaceCredits.d.vue.ts +4 -0
  1933. package/dist/runtime/vue/components/workspaces/WorkspaceCredits.vue +53 -0
  1934. package/dist/runtime/vue/components/workspaces/WorkspaceCredits.vue.d.ts +4 -0
  1935. package/dist/runtime/vue/components/workspaces/WorkspaceList.css +1 -0
  1936. package/dist/runtime/vue/components/workspaces/WorkspaceList.d.vue.ts +4 -0
  1937. package/dist/runtime/vue/components/workspaces/WorkspaceList.vue +92 -0
  1938. package/dist/runtime/vue/components/workspaces/WorkspaceList.vue.d.ts +4 -0
  1939. package/dist/runtime/vue/components/workspaces/WorkspaceSettings.css +1 -0
  1940. package/dist/runtime/vue/components/workspaces/WorkspaceSettings.d.vue.ts +117 -0
  1941. package/dist/runtime/vue/components/workspaces/WorkspaceSettings.vue +216 -0
  1942. package/dist/runtime/vue/components/workspaces/WorkspaceSettings.vue.d.ts +117 -0
  1943. package/dist/runtime/vue/components/workspaces/accept-invitation.d.ts +21 -0
  1944. package/dist/runtime/vue/components/workspaces/accept-invitation.js +10 -0
  1945. package/dist/runtime/vue/components/workspaces/audit-log.d.ts +29 -0
  1946. package/dist/runtime/vue/components/workspaces/audit-log.js +33 -0
  1947. package/dist/runtime/vue/components/workspaces/workspace-billing.d.ts +77 -0
  1948. package/dist/runtime/vue/components/workspaces/workspace-billing.js +74 -0
  1949. package/dist/runtime/vue/components/workspaces/workspace-settings.d.ts +81 -0
  1950. package/dist/runtime/vue/components/workspaces/workspace-settings.js +10 -0
  1951. package/dist/runtime/vue/composables/base-aliases.d.ts +8 -0
  1952. package/dist/runtime/vue/composables/base-aliases.js +2 -0
  1953. package/dist/runtime/vue/composables/billing-format.d.ts +14 -0
  1954. package/dist/runtime/vue/composables/billing-format.js +40 -0
  1955. package/dist/runtime/vue/composables/billing-provider.d.ts +38 -0
  1956. package/dist/runtime/vue/composables/billing-provider.js +160 -0
  1957. package/dist/runtime/vue/composables/use-access.d.ts +154 -0
  1958. package/dist/runtime/vue/composables/use-access.js +100 -0
  1959. package/dist/runtime/vue/composables/use-account.d.ts +120 -0
  1960. package/dist/runtime/vue/composables/use-account.js +60 -0
  1961. package/dist/runtime/vue/composables/use-activation.d.ts +89 -0
  1962. package/dist/runtime/vue/composables/use-activation.js +74 -0
  1963. package/dist/runtime/vue/composables/use-admin.d.ts +149 -0
  1964. package/dist/runtime/vue/composables/use-admin.js +97 -0
  1965. package/dist/runtime/vue/composables/use-ai-costs.d.ts +42 -0
  1966. package/dist/runtime/vue/composables/use-ai-costs.js +38 -0
  1967. package/dist/runtime/vue/composables/use-ai-label.d.ts +62 -0
  1968. package/dist/runtime/vue/composables/use-ai-label.js +47 -0
  1969. package/dist/runtime/vue/composables/use-ai-stream.d.ts +71 -0
  1970. package/dist/runtime/vue/composables/use-ai-stream.js +126 -0
  1971. package/dist/runtime/vue/composables/use-announcements.d.ts +110 -0
  1972. package/dist/runtime/vue/composables/use-announcements.js +78 -0
  1973. package/dist/runtime/vue/composables/use-app-shell.d.ts +131 -0
  1974. package/dist/runtime/vue/composables/use-app-shell.js +206 -0
  1975. package/dist/runtime/vue/composables/use-audit-log.d.ts +90 -0
  1976. package/dist/runtime/vue/composables/use-audit-log.js +44 -0
  1977. package/dist/runtime/vue/composables/use-auth.d.ts +59 -0
  1978. package/dist/runtime/vue/composables/use-auth.js +15 -0
  1979. package/dist/runtime/vue/composables/use-backend-config.d.ts +8 -0
  1980. package/dist/runtime/vue/composables/use-backend-config.js +17 -0
  1981. package/dist/runtime/vue/composables/use-backend-page-path.d.ts +18 -0
  1982. package/dist/runtime/vue/composables/use-backend-page-path.js +33 -0
  1983. package/dist/runtime/vue/composables/use-billing.d.ts +787 -0
  1984. package/dist/runtime/vue/composables/use-billing.js +144 -0
  1985. package/dist/runtime/vue/composables/use-campaign.d.ts +40 -0
  1986. package/dist/runtime/vue/composables/use-campaign.js +31 -0
  1987. package/dist/runtime/vue/composables/use-chat.d.ts +72 -0
  1988. package/dist/runtime/vue/composables/use-chat.js +69 -0
  1989. package/dist/runtime/vue/composables/use-consents.d.ts +144 -0
  1990. package/dist/runtime/vue/composables/use-consents.js +109 -0
  1991. package/dist/runtime/vue/composables/use-contact-form.d.ts +104 -0
  1992. package/dist/runtime/vue/composables/use-contact-form.js +141 -0
  1993. package/dist/runtime/vue/composables/use-credits.d.ts +92 -0
  1994. package/dist/runtime/vue/composables/use-credits.js +67 -0
  1995. package/dist/runtime/vue/composables/use-deletion-notice.d.ts +45 -0
  1996. package/dist/runtime/vue/composables/use-deletion-notice.js +38 -0
  1997. package/dist/runtime/vue/composables/use-email-change.d.ts +57 -0
  1998. package/dist/runtime/vue/composables/use-email-change.js +71 -0
  1999. package/dist/runtime/vue/composables/use-email-link.d.ts +26 -0
  2000. package/dist/runtime/vue/composables/use-email-link.js +62 -0
  2001. package/dist/runtime/vue/composables/use-email-preferences.d.ts +90 -0
  2002. package/dist/runtime/vue/composables/use-email-preferences.js +40 -0
  2003. package/dist/runtime/vue/composables/use-email-status.d.ts +59 -0
  2004. package/dist/runtime/vue/composables/use-email-status.js +20 -0
  2005. package/dist/runtime/vue/composables/use-experiment.d.ts +75 -0
  2006. package/dist/runtime/vue/composables/use-experiment.js +60 -0
  2007. package/dist/runtime/vue/composables/use-features.d.ts +74 -0
  2008. package/dist/runtime/vue/composables/use-features.js +31 -0
  2009. package/dist/runtime/vue/composables/use-flags.d.ts +98 -0
  2010. package/dist/runtime/vue/composables/use-flags.js +50 -0
  2011. package/dist/runtime/vue/composables/use-funnel.d.ts +32 -0
  2012. package/dist/runtime/vue/composables/use-funnel.js +20 -0
  2013. package/dist/runtime/vue/composables/use-gift-list.d.ts +60 -0
  2014. package/dist/runtime/vue/composables/use-gift-list.js +104 -0
  2015. package/dist/runtime/vue/composables/use-gifts.d.ts +90 -0
  2016. package/dist/runtime/vue/composables/use-gifts.js +68 -0
  2017. package/dist/runtime/vue/composables/use-how-did-you-hear.d.ts +46 -0
  2018. package/dist/runtime/vue/composables/use-how-did-you-hear.js +51 -0
  2019. package/dist/runtime/vue/composables/use-human-check.d.ts +57 -0
  2020. package/dist/runtime/vue/composables/use-human-check.js +14 -0
  2021. package/dist/runtime/vue/composables/use-inbox-admin.d.ts +43 -0
  2022. package/dist/runtime/vue/composables/use-inbox-admin.js +31 -0
  2023. package/dist/runtime/vue/composables/use-job-queue.d.ts +108 -0
  2024. package/dist/runtime/vue/composables/use-job-queue.js +47 -0
  2025. package/dist/runtime/vue/composables/use-job.d.ts +68 -0
  2026. package/dist/runtime/vue/composables/use-job.js +30 -0
  2027. package/dist/runtime/vue/composables/use-keep-account.d.ts +20 -0
  2028. package/dist/runtime/vue/composables/use-keep-account.js +38 -0
  2029. package/dist/runtime/vue/composables/use-labels.d.ts +67 -0
  2030. package/dist/runtime/vue/composables/use-labels.js +114 -0
  2031. package/dist/runtime/vue/composables/use-login-flow.d.ts +167 -0
  2032. package/dist/runtime/vue/composables/use-login-flow.js +284 -0
  2033. package/dist/runtime/vue/composables/use-notification-inbox.d.ts +81 -0
  2034. package/dist/runtime/vue/composables/use-notification-inbox.js +96 -0
  2035. package/dist/runtime/vue/composables/use-notifications.d.ts +107 -0
  2036. package/dist/runtime/vue/composables/use-notifications.js +100 -0
  2037. package/dist/runtime/vue/composables/use-onboarding.d.ts +87 -0
  2038. package/dist/runtime/vue/composables/use-onboarding.js +86 -0
  2039. package/dist/runtime/vue/composables/use-orders.d.ts +83 -0
  2040. package/dist/runtime/vue/composables/use-orders.js +44 -0
  2041. package/dist/runtime/vue/composables/use-passkeys.d.ts +76 -0
  2042. package/dist/runtime/vue/composables/use-passkeys.js +66 -0
  2043. package/dist/runtime/vue/composables/use-pricing.d.ts +136 -0
  2044. package/dist/runtime/vue/composables/use-pricing.js +135 -0
  2045. package/dist/runtime/vue/composables/use-push-subscription.d.ts +67 -0
  2046. package/dist/runtime/vue/composables/use-push-subscription.js +85 -0
  2047. package/dist/runtime/vue/composables/use-reauthentication.d.ts +105 -0
  2048. package/dist/runtime/vue/composables/use-reauthentication.js +168 -0
  2049. package/dist/runtime/vue/composables/use-referral-admin.d.ts +30 -0
  2050. package/dist/runtime/vue/composables/use-referral-admin.js +30 -0
  2051. package/dist/runtime/vue/composables/use-referral-invite.d.ts +29 -0
  2052. package/dist/runtime/vue/composables/use-referral-invite.js +61 -0
  2053. package/dist/runtime/vue/composables/use-referrals.d.ts +87 -0
  2054. package/dist/runtime/vue/composables/use-referrals.js +109 -0
  2055. package/dist/runtime/vue/composables/use-return-path.d.ts +21 -0
  2056. package/dist/runtime/vue/composables/use-return-path.js +8 -0
  2057. package/dist/runtime/vue/composables/use-revenue.d.ts +45 -0
  2058. package/dist/runtime/vue/composables/use-revenue.js +42 -0
  2059. package/dist/runtime/vue/composables/use-sandbox-inbox.d.ts +64 -0
  2060. package/dist/runtime/vue/composables/use-sandbox-inbox.js +55 -0
  2061. package/dist/runtime/vue/composables/use-search.d.ts +39 -0
  2062. package/dist/runtime/vue/composables/use-search.js +30 -0
  2063. package/dist/runtime/vue/composables/use-sessions.d.ts +79 -0
  2064. package/dist/runtime/vue/composables/use-sessions.js +55 -0
  2065. package/dist/runtime/vue/composables/use-share-link.d.ts +59 -0
  2066. package/dist/runtime/vue/composables/use-share-link.js +51 -0
  2067. package/dist/runtime/vue/composables/use-suppressions-admin.d.ts +38 -0
  2068. package/dist/runtime/vue/composables/use-suppressions-admin.js +32 -0
  2069. package/dist/runtime/vue/composables/use-upload-field.d.ts +85 -0
  2070. package/dist/runtime/vue/composables/use-upload-field.js +129 -0
  2071. package/dist/runtime/vue/composables/use-usage.d.ts +68 -0
  2072. package/dist/runtime/vue/composables/use-usage.js +44 -0
  2073. package/dist/runtime/vue/composables/use-waitlist-admin.d.ts +56 -0
  2074. package/dist/runtime/vue/composables/use-waitlist-admin.js +43 -0
  2075. package/dist/runtime/vue/composables/use-waitlist-step.d.ts +1 -0
  2076. package/dist/runtime/vue/composables/use-waitlist-step.js +11 -0
  2077. package/dist/runtime/vue/composables/use-waitlist.d.ts +184 -0
  2078. package/dist/runtime/vue/composables/use-waitlist.js +178 -0
  2079. package/dist/runtime/vue/composables/use-webhook-log.d.ts +32 -0
  2080. package/dist/runtime/vue/composables/use-webhook-log.js +30 -0
  2081. package/dist/runtime/vue/composables/use-workflow.d.ts +37 -0
  2082. package/dist/runtime/vue/composables/use-workflow.js +10 -0
  2083. package/dist/runtime/vue/composables/use-workspace.d.ts +149 -0
  2084. package/dist/runtime/vue/composables/use-workspace.js +126 -0
  2085. package/dist/runtime/vue/middleware/page-access.d.ts +13 -0
  2086. package/dist/runtime/vue/middleware/page-access.js +18 -0
  2087. package/dist/runtime/vue/pages/accept-invitation.d.vue.ts +3 -0
  2088. package/dist/runtime/vue/pages/accept-invitation.vue +16 -0
  2089. package/dist/runtime/vue/pages/accept-invitation.vue.d.ts +3 -0
  2090. package/dist/runtime/vue/pages/accessibility.d.vue.ts +3 -0
  2091. package/dist/runtime/vue/pages/accessibility.vue +17 -0
  2092. package/dist/runtime/vue/pages/accessibility.vue.d.ts +3 -0
  2093. package/dist/runtime/vue/pages/admin.d.vue.ts +3 -0
  2094. package/dist/runtime/vue/pages/admin.vue +45 -0
  2095. package/dist/runtime/vue/pages/admin.vue.d.ts +3 -0
  2096. package/dist/runtime/vue/pages/gifts.d.vue.ts +3 -0
  2097. package/dist/runtime/vue/pages/gifts.vue +17 -0
  2098. package/dist/runtime/vue/pages/gifts.vue.d.ts +3 -0
  2099. package/dist/runtime/vue/pages/invite.d.vue.ts +3 -0
  2100. package/dist/runtime/vue/pages/invite.vue +18 -0
  2101. package/dist/runtime/vue/pages/invite.vue.d.ts +3 -0
  2102. package/dist/runtime/vue/pages/keep-account.d.vue.ts +3 -0
  2103. package/dist/runtime/vue/pages/keep-account.vue +22 -0
  2104. package/dist/runtime/vue/pages/keep-account.vue.d.ts +3 -0
  2105. package/dist/runtime/vue/pages/login.d.vue.ts +3 -0
  2106. package/dist/runtime/vue/pages/login.vue +44 -0
  2107. package/dist/runtime/vue/pages/login.vue.d.ts +3 -0
  2108. package/dist/runtime/vue/pages/pricing.d.vue.ts +3 -0
  2109. package/dist/runtime/vue/pages/pricing.vue +39 -0
  2110. package/dist/runtime/vue/pages/pricing.vue.d.ts +3 -0
  2111. package/dist/runtime/vue/pages/privacy.d.vue.ts +3 -0
  2112. package/dist/runtime/vue/pages/privacy.vue +17 -0
  2113. package/dist/runtime/vue/pages/privacy.vue.d.ts +3 -0
  2114. package/dist/runtime/vue/pages/profile.d.vue.ts +3 -0
  2115. package/dist/runtime/vue/pages/profile.vue +16 -0
  2116. package/dist/runtime/vue/pages/profile.vue.d.ts +3 -0
  2117. package/dist/runtime/vue/pages/referral.d.vue.ts +3 -0
  2118. package/dist/runtime/vue/pages/referral.vue +18 -0
  2119. package/dist/runtime/vue/pages/referral.vue.d.ts +3 -0
  2120. package/dist/runtime/vue/pages/report.d.vue.ts +3 -0
  2121. package/dist/runtime/vue/pages/report.vue +29 -0
  2122. package/dist/runtime/vue/pages/report.vue.d.ts +3 -0
  2123. package/dist/runtime/vue/pages/security.d.vue.ts +3 -0
  2124. package/dist/runtime/vue/pages/security.vue +22 -0
  2125. package/dist/runtime/vue/pages/security.vue.d.ts +3 -0
  2126. package/dist/runtime/vue/pages/settings.d.vue.ts +3 -0
  2127. package/dist/runtime/vue/pages/settings.vue +26 -0
  2128. package/dist/runtime/vue/pages/settings.vue.d.ts +3 -0
  2129. package/dist/runtime/vue/pages/subprocessors.d.vue.ts +3 -0
  2130. package/dist/runtime/vue/pages/subprocessors.vue +17 -0
  2131. package/dist/runtime/vue/pages/subprocessors.vue.d.ts +3 -0
  2132. package/dist/runtime/vue/pages/terms.d.vue.ts +3 -0
  2133. package/dist/runtime/vue/pages/terms.vue +17 -0
  2134. package/dist/runtime/vue/pages/terms.vue.d.ts +3 -0
  2135. package/dist/runtime/vue/pages/unsubscribe.d.vue.ts +3 -0
  2136. package/dist/runtime/vue/pages/unsubscribe.vue +28 -0
  2137. package/dist/runtime/vue/pages/unsubscribe.vue.d.ts +3 -0
  2138. package/dist/runtime/vue/pages/waitlist.d.vue.ts +3 -0
  2139. package/dist/runtime/vue/pages/waitlist.vue +18 -0
  2140. package/dist/runtime/vue/pages/waitlist.vue.d.ts +3 -0
  2141. package/dist/runtime/vue/pages/welcome.d.vue.ts +3 -0
  2142. package/dist/runtime/vue/pages/welcome.vue +20 -0
  2143. package/dist/runtime/vue/pages/welcome.vue.d.ts +3 -0
  2144. package/dist/runtime/vue/parts.d.ts +203 -0
  2145. package/dist/runtime/vue/parts.js +0 -0
  2146. package/dist/runtime/vue/passkey-client.d.ts +65 -0
  2147. package/dist/runtime/vue/passkey-client.js +119 -0
  2148. package/dist/runtime/vue/plugins/checkout-return.d.ts +14 -0
  2149. package/dist/runtime/vue/plugins/checkout-return.js +23 -0
  2150. package/dist/runtime/vue/plugins/email-presence.d.ts +12 -0
  2151. package/dist/runtime/vue/plugins/email-presence.js +14 -0
  2152. package/dist/runtime/vue/plugins/first-touch.d.ts +9 -0
  2153. package/dist/runtime/vue/plugins/first-touch.js +19 -0
  2154. package/dist/runtime/vue/plugins/locale-sync.d.ts +10 -0
  2155. package/dist/runtime/vue/plugins/locale-sync.js +20 -0
  2156. package/dist/runtime/vue/plugins/monitoring-log.client.d.ts +10 -0
  2157. package/dist/runtime/vue/plugins/monitoring-log.client.js +26 -0
  2158. package/dist/runtime/vue/plugins/noindex.d.ts +13 -0
  2159. package/dist/runtime/vue/plugins/noindex.js +11 -0
  2160. package/dist/runtime/vue/plugins/onboarding-redirect.d.ts +14 -0
  2161. package/dist/runtime/vue/plugins/onboarding-redirect.js +23 -0
  2162. package/dist/runtime/vue/plugins/passkey-ceremony.d.ts +9 -0
  2163. package/dist/runtime/vue/plugins/passkey-ceremony.js +8 -0
  2164. package/dist/runtime/vue/plugins/protection.client.d.ts +9 -0
  2165. package/dist/runtime/vue/plugins/protection.client.js +22 -0
  2166. package/dist/runtime/vue/plugins/session-ended.d.ts +14 -0
  2167. package/dist/runtime/vue/plugins/session-ended.js +22 -0
  2168. package/dist/runtime/vue/plugins/trusted-types.client.d.ts +8 -0
  2169. package/dist/runtime/vue/plugins/trusted-types.client.js +9 -0
  2170. package/dist/runtime/vue/protection/challenge.d.ts +9 -0
  2171. package/dist/runtime/vue/protection/challenge.js +93 -0
  2172. package/dist/runtime/vue/protection/state.d.ts +172 -0
  2173. package/dist/runtime/vue/protection/state.js +74 -0
  2174. package/dist/runtime/vue/trusted-types.d.ts +27 -0
  2175. package/dist/runtime/vue/trusted-types.js +46 -0
  2176. package/dist/runtime/vue/utils/access-rules.d.ts +45 -0
  2177. package/dist/runtime/vue/utils/access-rules.js +2 -0
  2178. package/dist/runtime/vue/utils/action-state.d.ts +65 -0
  2179. package/dist/runtime/vue/utils/action-state.js +46 -0
  2180. package/dist/runtime/vue/utils/active-locale.d.ts +30 -0
  2181. package/dist/runtime/vue/utils/active-locale.js +28 -0
  2182. package/dist/runtime/vue/utils/admin-changes.d.ts +1 -0
  2183. package/dist/runtime/vue/utils/admin-changes.js +41 -0
  2184. package/dist/runtime/vue/utils/auth-read.d.ts +15 -0
  2185. package/dist/runtime/vue/utils/auth-read.js +8 -0
  2186. package/dist/runtime/vue/utils/auth-result.d.ts +8 -0
  2187. package/dist/runtime/vue/utils/auth-result.js +7 -0
  2188. package/dist/runtime/vue/utils/auth-session.d.ts +48 -0
  2189. package/dist/runtime/vue/utils/auth-session.js +122 -0
  2190. package/dist/runtime/vue/utils/auth-steps.d.ts +30 -0
  2191. package/dist/runtime/vue/utils/auth-steps.js +44 -0
  2192. package/dist/runtime/vue/utils/backend-error.d.ts +22 -0
  2193. package/dist/runtime/vue/utils/backend-error.js +38 -0
  2194. package/dist/runtime/vue/utils/billing-access.d.ts +33 -0
  2195. package/dist/runtime/vue/utils/billing-access.js +20 -0
  2196. package/dist/runtime/vue/utils/cancel-confirm.d.ts +38 -0
  2197. package/dist/runtime/vue/utils/cancel-confirm.js +20 -0
  2198. package/dist/runtime/vue/utils/challenge-caption.d.ts +2 -0
  2199. package/dist/runtime/vue/utils/challenge-caption.js +2 -0
  2200. package/dist/runtime/vue/utils/checkout-return.d.ts +33 -0
  2201. package/dist/runtime/vue/utils/checkout-return.js +39 -0
  2202. package/dist/runtime/vue/utils/confirmation.d.ts +19 -0
  2203. package/dist/runtime/vue/utils/confirmation.js +23 -0
  2204. package/dist/runtime/vue/utils/currency.d.ts +4 -0
  2205. package/dist/runtime/vue/utils/currency.js +60 -0
  2206. package/dist/runtime/vue/utils/cursor-pages.d.ts +37 -0
  2207. package/dist/runtime/vue/utils/cursor-pages.js +42 -0
  2208. package/dist/runtime/vue/utils/email-presence.d.ts +1 -0
  2209. package/dist/runtime/vue/utils/email-presence.js +31 -0
  2210. package/dist/runtime/vue/utils/first-touch.d.ts +1 -0
  2211. package/dist/runtime/vue/utils/first-touch.js +22 -0
  2212. package/dist/runtime/vue/utils/focus-return.d.ts +41 -0
  2213. package/dist/runtime/vue/utils/focus-return.js +60 -0
  2214. package/dist/runtime/vue/utils/frame-notices.d.ts +8 -0
  2215. package/dist/runtime/vue/utils/frame-notices.js +10 -0
  2216. package/dist/runtime/vue/utils/hydrated.d.ts +12 -0
  2217. package/dist/runtime/vue/utils/hydrated.js +11 -0
  2218. package/dist/runtime/vue/utils/intl.d.ts +6 -0
  2219. package/dist/runtime/vue/utils/intl.js +9 -0
  2220. package/dist/runtime/vue/utils/kept-invite.d.ts +12 -0
  2221. package/dist/runtime/vue/utils/kept-invite.js +37 -0
  2222. package/dist/runtime/vue/utils/label-fallback.d.ts +3 -0
  2223. package/dist/runtime/vue/utils/label-fallback.js +2 -0
  2224. package/dist/runtime/vue/utils/label-registry.d.ts +1 -0
  2225. package/dist/runtime/vue/utils/label-registry.js +15 -0
  2226. package/dist/runtime/vue/utils/last-sign-in.d.ts +23 -0
  2227. package/dist/runtime/vue/utils/last-sign-in.js +45 -0
  2228. package/dist/runtime/vue/utils/live-query.d.ts +36 -0
  2229. package/dist/runtime/vue/utils/live-query.js +37 -0
  2230. package/dist/runtime/vue/utils/local-sign-out.d.ts +19 -0
  2231. package/dist/runtime/vue/utils/local-sign-out.js +18 -0
  2232. package/dist/runtime/vue/utils/login-bindings.d.ts +52 -0
  2233. package/dist/runtime/vue/utils/login-bindings.js +78 -0
  2234. package/dist/runtime/vue/utils/namespace.d.ts +9 -0
  2235. package/dist/runtime/vue/utils/namespace.js +22 -0
  2236. package/dist/runtime/vue/utils/onboarding-redirect.d.ts +25 -0
  2237. package/dist/runtime/vue/utils/onboarding-redirect.js +49 -0
  2238. package/dist/runtime/vue/utils/open-url.d.ts +13 -0
  2239. package/dist/runtime/vue/utils/open-url.js +12 -0
  2240. package/dist/runtime/vue/utils/page-access.d.ts +64 -0
  2241. package/dist/runtime/vue/utils/page-access.js +56 -0
  2242. package/dist/runtime/vue/utils/page-guard.d.ts +30 -0
  2243. package/dist/runtime/vue/utils/page-guard.js +84 -0
  2244. package/dist/runtime/vue/utils/page-rules.d.ts +34 -0
  2245. package/dist/runtime/vue/utils/page-rules.js +35 -0
  2246. package/dist/runtime/vue/utils/page-turns.d.ts +36 -0
  2247. package/dist/runtime/vue/utils/page-turns.js +24 -0
  2248. package/dist/runtime/vue/utils/passkey-signals.d.ts +32 -0
  2249. package/dist/runtime/vue/utils/passkey-signals.js +58 -0
  2250. package/dist/runtime/vue/utils/pricing-bindings.d.ts +51 -0
  2251. package/dist/runtime/vue/utils/pricing-bindings.js +39 -0
  2252. package/dist/runtime/vue/utils/pricing-seo.d.ts +1 -0
  2253. package/dist/runtime/vue/utils/pricing-seo.js +26 -0
  2254. package/dist/runtime/vue/utils/push-device.d.ts +55 -0
  2255. package/dist/runtime/vue/utils/push-device.js +77 -0
  2256. package/dist/runtime/vue/utils/reader.d.ts +1 -0
  2257. package/dist/runtime/vue/utils/reader.js +9 -0
  2258. package/dist/runtime/vue/utils/renamed-component.d.ts +1 -0
  2259. package/dist/runtime/vue/utils/renamed-component.js +17 -0
  2260. package/dist/runtime/vue/utils/roles.d.ts +4 -0
  2261. package/dist/runtime/vue/utils/roles.js +11 -0
  2262. package/dist/runtime/vue/utils/sandbox-code.d.ts +11 -0
  2263. package/dist/runtime/vue/utils/sandbox-code.js +16 -0
  2264. package/dist/runtime/vue/utils/session-end.d.ts +49 -0
  2265. package/dist/runtime/vue/utils/session-end.js +41 -0
  2266. package/dist/runtime/vue/utils/settings-message.d.ts +21 -0
  2267. package/dist/runtime/vue/utils/settings-message.js +6 -0
  2268. package/dist/runtime/vue/utils/shown-first.d.ts +1 -0
  2269. package/dist/runtime/vue/utils/shown-first.js +23 -0
  2270. package/dist/runtime/vue/utils/slug.d.ts +1 -0
  2271. package/dist/runtime/vue/utils/slug.js +7 -0
  2272. package/dist/runtime/vue/utils/storage-choice.d.ts +23 -0
  2273. package/dist/runtime/vue/utils/storage-choice.js +43 -0
  2274. package/dist/runtime/vue/utils/upgrade-offer.d.ts +25 -0
  2275. package/dist/runtime/vue/utils/upgrade-offer.js +18 -0
  2276. package/dist/runtime/vue/utils/vnodes.d.ts +1 -0
  2277. package/dist/runtime/vue/utils/vnodes.js +15 -0
  2278. package/dist/shared/nuxt-backend.-uB5CGw-.mjs +1154 -0
  2279. package/dist/shared/nuxt-backend.2YoiKo8j.mjs +167 -0
  2280. package/dist/shared/nuxt-backend.C62dpRH3.mjs +27 -0
  2281. package/dist/shared/nuxt-backend.CPq101Wi.mjs +571 -0
  2282. package/dist/shared/nuxt-backend.OQMX-0U7.mjs +3559 -0
  2283. package/dist/shared/nuxt-backend.S5C2b-4I.mjs +143 -0
  2284. package/dist/types.d.ts +8 -2
  2285. package/package.json +375 -90
  2286. package/skills/nuxt-backend/SKILL.md +142 -0
  2287. package/skills/nuxt-backend/references/api.md +759 -0
  2288. package/skills/nuxt-backend/references/install.md +188 -0
  2289. package/skills/nuxt-backend/references/renames.json +2129 -0
  2290. package/skills/nuxt-backend/references/surface.json +1424 -0
  2291. package/skills/nuxt-backend-ai/SKILL.md +79 -0
  2292. package/skills/nuxt-backend-ai/references/api.md +56 -0
  2293. package/skills/nuxt-backend-auth/SKILL.md +168 -0
  2294. package/skills/nuxt-backend-auth/references/api.md +159 -0
  2295. package/skills/nuxt-backend-billing/SKILL.md +174 -0
  2296. package/skills/nuxt-backend-billing/references/api.md +104 -0
  2297. package/skills/nuxt-backend-data/SKILL.md +88 -0
  2298. package/skills/nuxt-backend-data/references/api.md +79 -0
  2299. package/skills/nuxt-backend-email/SKILL.md +111 -0
  2300. package/skills/nuxt-backend-email/references/api.md +127 -0
  2301. package/skills/nuxt-backend-growth/SKILL.md +47 -0
  2302. package/skills/nuxt-backend-growth/references/api.md +38 -0
  2303. package/skills/nuxt-backend-ship/SKILL.md +187 -0
  2304. package/skills/nuxt-backend-ship/references/api.md +215 -0
  2305. package/skills/nuxt-backend-ui/SKILL.md +83 -0
  2306. package/skills/nuxt-backend-ui/references/api.md +39 -0
  2307. package/skills/nuxt-backend-upgrade/SKILL.md +73 -0
  2308. package/skills/nuxt-backend-upgrade/references/api.md +23 -0
  2309. package/skills/nuxt-backend-upgrade/references/upgrade.md +512 -0
  2310. package/src/convex/access-tickets.ts +188 -0
  2311. package/src/convex/account-data.ts +501 -0
  2312. package/src/convex/activation-rules.ts +149 -0
  2313. package/src/convex/announcements.ts +31 -0
  2314. package/src/convex/app.ts +138 -0
  2315. package/src/convex/auth-secrets.ts +124 -0
  2316. package/src/convex/auth.config.ts +30 -3
  2317. package/src/convex/bytes.ts +10 -0
  2318. package/src/convex/c2pa/cbor.ts +88 -0
  2319. package/src/convex/c2pa/der.ts +108 -0
  2320. package/src/convex/c2pa/formats.ts +309 -0
  2321. package/src/convex/c2pa/jumbf.ts +46 -0
  2322. package/src/convex/c2pa/manifest.ts +195 -0
  2323. package/src/convex/catalog.ts +748 -0
  2324. package/src/convex/client/age-gate.ts +129 -0
  2325. package/src/convex/client/audit.ts +332 -0
  2326. package/src/convex/client/auth-types.ts +387 -0
  2327. package/src/convex/client/better-auth-options.ts +488 -0
  2328. package/src/convex/client/code-binding.ts +107 -0
  2329. package/src/convex/client/codes.ts +48 -0
  2330. package/src/convex/client/component.ts +181 -0
  2331. package/src/convex/client/devices.ts +205 -0
  2332. package/src/convex/client/email.ts +80 -0
  2333. package/src/convex/client/entities.ts +117 -0
  2334. package/src/convex/client/guards.ts +956 -0
  2335. package/src/convex/client/guest-claim.ts +63 -0
  2336. package/src/convex/client/hooks.ts +79 -0
  2337. package/src/convex/client/identity.ts +8 -0
  2338. package/src/convex/client/index.ts +268 -276
  2339. package/src/convex/client/launch-gate.ts +223 -0
  2340. package/src/convex/client/notices.ts +39 -0
  2341. package/src/convex/client/passkey-only.ts +398 -0
  2342. package/src/convex/client/plugins.ts +211 -0
  2343. package/src/convex/client/refusals.ts +39 -0
  2344. package/src/convex/client/request-origin.ts +109 -0
  2345. package/src/convex/client/request-session.ts +73 -0
  2346. package/src/convex/client/runtime.ts +95 -0
  2347. package/src/convex/client/secret-rotation.ts +113 -0
  2348. package/src/convex/client/sessions.ts +55 -0
  2349. package/src/convex/client/workspaces.ts +150 -0
  2350. package/src/convex/components/backend/_generated/api.ts +132 -0
  2351. package/src/convex/components/backend/_generated/component.ts +5827 -0
  2352. package/src/convex/components/backend/_generated/server.ts +175 -0
  2353. package/src/convex/components/backend/access.ts +441 -0
  2354. package/src/convex/components/backend/account.ts +1064 -0
  2355. package/src/convex/components/backend/adapter.ts +61 -0
  2356. package/src/convex/components/backend/ai.ts +412 -0
  2357. package/src/convex/components/backend/alerts.ts +208 -0
  2358. package/src/convex/components/backend/announcements.ts +275 -0
  2359. package/src/convex/components/backend/audit.ts +341 -0
  2360. package/src/convex/components/backend/billing.ts +775 -0
  2361. package/src/convex/components/backend/consents.ts +167 -0
  2362. package/src/convex/components/backend/convex.config.ts +75 -0
  2363. package/src/convex/components/backend/costs.ts +286 -0
  2364. package/src/convex/components/backend/crons.ts +26 -0
  2365. package/src/convex/components/backend/devices.ts +198 -0
  2366. package/src/convex/components/backend/email.ts +660 -0
  2367. package/src/convex/components/backend/erasures.ts +72 -0
  2368. package/src/convex/components/backend/flags.ts +85 -0
  2369. package/src/convex/components/backend/funnel.ts +596 -0
  2370. package/src/convex/components/backend/gifts.ts +728 -0
  2371. package/src/convex/components/backend/inbound.ts +391 -0
  2372. package/src/convex/components/backend/jobs.ts +944 -0
  2373. package/src/convex/components/backend/keys.ts +50 -0
  2374. package/src/convex/components/backend/lifecycle.ts +350 -0
  2375. package/src/convex/components/backend/lifecycleActivity.ts +29 -0
  2376. package/src/convex/components/backend/maintenance.ts +495 -0
  2377. package/src/convex/components/backend/migrations.ts +120 -0
  2378. package/src/convex/components/backend/monitoring.ts +63 -0
  2379. package/src/convex/components/backend/notifications.ts +510 -0
  2380. package/src/convex/components/backend/onboarding.ts +54 -0
  2381. package/src/convex/components/backend/parties.ts +75 -0
  2382. package/src/convex/components/backend/posture.ts +37 -0
  2383. package/src/convex/components/backend/preferences.ts +690 -0
  2384. package/src/convex/components/backend/push.ts +95 -0
  2385. package/src/convex/components/backend/referrals.ts +763 -0
  2386. package/src/convex/components/backend/reports.ts +609 -0
  2387. package/src/convex/components/backend/schema.ts +2183 -0
  2388. package/src/convex/components/backend/storage.ts +699 -0
  2389. package/src/convex/components/backend/subscriptions.ts +268 -0
  2390. package/src/convex/components/backend/suppressions.ts +115 -0
  2391. package/src/convex/components/backend/waitlist.ts +727 -0
  2392. package/src/convex/components/backend/wake.ts +13 -0
  2393. package/src/convex/components/backend/webhooks.ts +296 -0
  2394. package/src/convex/consent-rules.ts +159 -0
  2395. package/src/convex/constants.ts +192 -0
  2396. package/src/convex/delivery.ts +81 -0
  2397. package/src/convex/email-blocks.ts +119 -0
  2398. package/src/convex/email-helpers.ts +91 -0
  2399. package/src/convex/email-html.ts +20 -0
  2400. package/src/convex/email-posture.ts +233 -0
  2401. package/src/convex/email-preferences.ts +310 -0
  2402. package/src/convex/email-scheme.ts +18 -0
  2403. package/src/convex/email-templates.ts +1021 -0
  2404. package/src/convex/email-theme.ts +201 -0
  2405. package/src/convex/email-validators.ts +27 -0
  2406. package/src/convex/emails/appeal-decided.ts +16 -0
  2407. package/src/convex/emails/content-restricted.ts +29 -0
  2408. package/src/convex/emails/deletion-canceled.ts +8 -0
  2409. package/src/convex/emails/deletion-scheduled.ts +18 -0
  2410. package/src/convex/emails/email-changed.ts +13 -0
  2411. package/src/convex/emails/gift-pass-ending.ts +18 -0
  2412. package/src/convex/emails/gift.ts +18 -0
  2413. package/src/convex/emails/invite.ts +28 -0
  2414. package/src/convex/emails/new-device.ts +21 -0
  2415. package/src/convex/emails/notice-decided.ts +16 -0
  2416. package/src/convex/emails/notice-received.ts +15 -0
  2417. package/src/convex/emails/otp.ts +48 -0
  2418. package/src/convex/emails/passkey-recovered.ts +21 -0
  2419. package/src/convex/emails/renewal-reminder.ts +20 -0
  2420. package/src/convex/emails/topic-confirmation.ts +17 -0
  2421. package/src/convex/emails/waitlist-admitted.ts +16 -0
  2422. package/src/convex/emails/waitlist-confirmation.ts +19 -0
  2423. package/src/convex/emails/welcome.ts +15 -0
  2424. package/src/convex/emails/withdrawal-receipt.ts +16 -0
  2425. package/src/convex/environment.ts +75 -0
  2426. package/src/convex/errors.ts +418 -0
  2427. package/src/convex/events.ts +840 -0
  2428. package/src/convex/files.ts +420 -0
  2429. package/src/convex/flags.ts +344 -0
  2430. package/src/convex/funnel-rules.ts +273 -0
  2431. package/src/convex/inbound-rules.ts +212 -0
  2432. package/src/convex/integrations/access.ts +278 -0
  2433. package/src/convex/integrations/account.ts +1044 -0
  2434. package/src/convex/integrations/admin.ts +509 -0
  2435. package/src/convex/integrations/ai/account-export.ts +53 -0
  2436. package/src/convex/integrations/ai/chat.ts +530 -0
  2437. package/src/convex/integrations/ai/config.ts +747 -0
  2438. package/src/convex/integrations/ai/context.ts +93 -0
  2439. package/src/convex/integrations/ai/costs.ts +80 -0
  2440. package/src/convex/integrations/ai/embeddings.ts +109 -0
  2441. package/src/convex/integrations/ai/job-errors.ts +131 -0
  2442. package/src/convex/integrations/ai/jobs.ts +1268 -0
  2443. package/src/convex/integrations/ai/knowledge.ts +489 -0
  2444. package/src/convex/integrations/ai/metering.ts +394 -0
  2445. package/src/convex/integrations/ai/model-id.ts +16 -0
  2446. package/src/convex/integrations/ai/models.ts +465 -0
  2447. package/src/convex/integrations/ai/moderation.ts +224 -0
  2448. package/src/convex/integrations/ai/pricing.ts +170 -0
  2449. package/src/convex/integrations/ai/provenance.ts +213 -0
  2450. package/src/convex/integrations/ai/setup.ts +58 -0
  2451. package/src/convex/integrations/ai/stream.ts +178 -0
  2452. package/src/convex/integrations/ai.ts +84 -0
  2453. package/src/convex/integrations/announcements.ts +442 -0
  2454. package/src/convex/integrations/audit.ts +523 -0
  2455. package/src/convex/integrations/authorization.ts +366 -0
  2456. package/src/convex/integrations/billing/activity.ts +70 -0
  2457. package/src/convex/integrations/billing/checkout.ts +501 -0
  2458. package/src/convex/integrations/billing/claim-discount.ts +45 -0
  2459. package/src/convex/integrations/billing/context.ts +492 -0
  2460. package/src/convex/integrations/billing/credits.ts +237 -0
  2461. package/src/convex/integrations/billing/customers.ts +346 -0
  2462. package/src/convex/integrations/billing/discounts.ts +96 -0
  2463. package/src/convex/integrations/billing/entitlements.ts +218 -0
  2464. package/src/convex/integrations/billing/erasure.ts +99 -0
  2465. package/src/convex/integrations/billing/events.ts +225 -0
  2466. package/src/convex/integrations/billing/features.ts +91 -0
  2467. package/src/convex/integrations/billing/free-plan.ts +242 -0
  2468. package/src/convex/integrations/billing/functions.ts +494 -0
  2469. package/src/convex/integrations/billing/gift-access.ts +44 -0
  2470. package/src/convex/integrations/billing/gift-manage.ts +281 -0
  2471. package/src/convex/integrations/billing/gift-rules.ts +49 -0
  2472. package/src/convex/integrations/billing/gifts.ts +741 -0
  2473. package/src/convex/integrations/billing/history.ts +232 -0
  2474. package/src/convex/integrations/billing/lifecycle.ts +510 -0
  2475. package/src/convex/integrations/billing/passes.ts +430 -0
  2476. package/src/convex/integrations/billing/pricing.ts +383 -0
  2477. package/src/convex/integrations/billing/provider-client.ts +15 -0
  2478. package/src/convex/integrations/billing/provider-events.ts +220 -0
  2479. package/src/convex/integrations/billing/purchase.ts +347 -0
  2480. package/src/convex/integrations/billing/quotas.ts +205 -0
  2481. package/src/convex/integrations/billing/referral-orders.ts +45 -0
  2482. package/src/convex/integrations/billing/revenue.ts +194 -0
  2483. package/src/convex/integrations/billing/rewards.ts +171 -0
  2484. package/src/convex/integrations/billing/subscriptions.ts +421 -0
  2485. package/src/convex/integrations/billing/types/base.ts +99 -0
  2486. package/src/convex/integrations/billing/types/lifecycle.ts +139 -0
  2487. package/src/convex/integrations/billing/types/options.ts +386 -0
  2488. package/src/convex/integrations/billing/types/records.ts +543 -0
  2489. package/src/convex/integrations/billing/types/revenue.ts +123 -0
  2490. package/src/convex/integrations/billing/types/setup.ts +576 -0
  2491. package/src/convex/integrations/billing/types/surface.ts +624 -0
  2492. package/src/convex/integrations/billing/webhooks.ts +330 -0
  2493. package/src/convex/integrations/billing.ts +262 -0
  2494. package/src/convex/integrations/email-lifecycle.ts +265 -0
  2495. package/src/convex/integrations/email-preferences.ts +417 -0
  2496. package/src/convex/integrations/email-suppressions.ts +176 -0
  2497. package/src/convex/integrations/email-sync.ts +517 -0
  2498. package/src/convex/integrations/email.ts +1224 -0
  2499. package/src/convex/integrations/flags.ts +492 -0
  2500. package/src/convex/integrations/functions.ts +485 -0
  2501. package/src/convex/integrations/health.ts +180 -0
  2502. package/src/convex/integrations/http.ts +198 -0
  2503. package/src/convex/integrations/inbound.ts +712 -0
  2504. package/src/convex/integrations/launch.ts +614 -0
  2505. package/src/convex/integrations/monitoring.ts +259 -0
  2506. package/src/convex/integrations/notifications.ts +541 -0
  2507. package/src/convex/integrations/rate-limit.ts +318 -0
  2508. package/src/convex/integrations/referrals.ts +504 -0
  2509. package/src/convex/integrations/reports.ts +719 -0
  2510. package/src/convex/integrations/retention.ts +196 -0
  2511. package/src/convex/integrations/search.ts +188 -0
  2512. package/src/convex/integrations/storage.ts +595 -0
  2513. package/src/convex/integrations/waitlist.ts +429 -0
  2514. package/src/convex/integrations/webhook-guard.ts +348 -0
  2515. package/src/convex/integrations/webhooks.ts +176 -0
  2516. package/src/convex/integrations/workflows.ts +218 -0
  2517. package/src/convex/jobs-policy.ts +390 -0
  2518. package/src/convex/label-format.ts +73 -0
  2519. package/src/convex/label-groups/access.ts +23 -0
  2520. package/src/convex/label-groups/account.ts +29 -0
  2521. package/src/convex/label-groups/activation.ts +24 -0
  2522. package/src/convex/label-groups/admin.ts +860 -0
  2523. package/src/convex/label-groups/ai.ts +17 -0
  2524. package/src/convex/label-groups/announcement.ts +16 -0
  2525. package/src/convex/label-groups/audit.ts +174 -0
  2526. package/src/convex/label-groups/auth.ts +78 -0
  2527. package/src/convex/label-groups/cancelFlow.ts +49 -0
  2528. package/src/convex/label-groups/connection.ts +15 -0
  2529. package/src/convex/label-groups/consent.ts +44 -0
  2530. package/src/convex/label-groups/contact.ts +26 -0
  2531. package/src/convex/label-groups/credits.ts +14 -0
  2532. package/src/convex/label-groups/deletion.ts +21 -0
  2533. package/src/convex/label-groups/email.ts +209 -0
  2534. package/src/convex/label-groups/errors.ts +119 -0
  2535. package/src/convex/label-groups/feedback.ts +19 -0
  2536. package/src/convex/label-groups/gift.ts +62 -0
  2537. package/src/convex/label-groups/history.ts +27 -0
  2538. package/src/convex/label-groups/impersonation.ts +16 -0
  2539. package/src/convex/label-groups/invitation.ts +27 -0
  2540. package/src/convex/label-groups/legal.ts +147 -0
  2541. package/src/convex/label-groups/maintenance.ts +14 -0
  2542. package/src/convex/label-groups/notifications.ts +87 -0
  2543. package/src/convex/label-groups/onboarding.ts +61 -0
  2544. package/src/convex/label-groups/pastDue.ts +12 -0
  2545. package/src/convex/label-groups/preferences.ts +48 -0
  2546. package/src/convex/label-groups/pricing.ts +97 -0
  2547. package/src/convex/label-groups/profile.ts +41 -0
  2548. package/src/convex/label-groups/quota.ts +27 -0
  2549. package/src/convex/label-groups/reauthenticate.ts +24 -0
  2550. package/src/convex/label-groups/referral.ts +55 -0
  2551. package/src/convex/label-groups/report.ts +58 -0
  2552. package/src/convex/label-groups/security.ts +65 -0
  2553. package/src/convex/label-groups/settings.ts +91 -0
  2554. package/src/convex/label-groups/shell.ts +56 -0
  2555. package/src/convex/label-groups/source.ts +34 -0
  2556. package/src/convex/label-groups/upgrade.ts +22 -0
  2557. package/src/convex/label-groups/upload.ts +21 -0
  2558. package/src/convex/label-groups/usage.ts +14 -0
  2559. package/src/convex/label-groups/waitlist.ts +47 -0
  2560. package/src/convex/label-groups/withdrawal.ts +20 -0
  2561. package/src/convex/label-translations.ts +1784 -0
  2562. package/src/convex/labels.ts +134 -0
  2563. package/src/convex/legal.ts +351 -0
  2564. package/src/convex/lifecycle-flows.ts +91 -0
  2565. package/src/convex/local-origins.ts +25 -0
  2566. package/src/convex/locale.ts +96 -0
  2567. package/src/convex/log.ts +148 -0
  2568. package/src/convex/loopback.ts +20 -0
  2569. package/src/convex/monitoring.ts +550 -0
  2570. package/src/convex/notifications.ts +291 -0
  2571. package/src/convex/package-migrations.ts +49 -0
  2572. package/src/convex/paths.ts +78 -0
  2573. package/src/convex/pauses.ts +56 -0
  2574. package/src/convex/proof.ts +323 -0
  2575. package/src/convex/referral-rules.ts +147 -0
  2576. package/src/convex/report-rules.ts +15 -0
  2577. package/src/convex/sandbox-inbox.ts +176 -0
  2578. package/src/convex/sensitive-actions.ts +276 -0
  2579. package/src/convex/test-models.ts +129 -0
  2580. package/src/convex/test.ts +325 -14
  2581. package/src/convex/tokens.ts +106 -0
  2582. package/src/convex/urls.ts +15 -0
  2583. package/src/convex/visitor.ts +54 -0
  2584. package/src/convex/waitlist-rules.ts +151 -0
  2585. package/src/convex/web-push.ts +243 -0
  2586. package/src/convex/webhook-signatures.ts +167 -0
  2587. package/src/runtime/vue/components/account/AccountData.css +46 -0
  2588. package/src/runtime/vue/components/account/AccountData.vue +185 -0
  2589. package/src/runtime/vue/components/account/AccountDeletion.css +45 -0
  2590. package/src/runtime/vue/components/account/AccountDeletion.vue +102 -0
  2591. package/src/runtime/vue/components/account/AccountExport.css +38 -0
  2592. package/src/runtime/vue/components/account/AccountExport.vue +66 -0
  2593. package/src/runtime/vue/components/account/ActivationChecklist.css +131 -0
  2594. package/src/runtime/vue/components/account/ActivationChecklist.vue +150 -0
  2595. package/src/runtime/vue/components/account/ConsentPrompt.css +181 -0
  2596. package/src/runtime/vue/components/account/ConsentPrompt.vue +149 -0
  2597. package/src/runtime/vue/components/account/ConsentPromptAge.vue +40 -0
  2598. package/src/runtime/vue/components/account/ConsentPromptDialog.vue +151 -0
  2599. package/src/runtime/vue/components/account/ConsentPromptItem.vue +60 -0
  2600. package/src/runtime/vue/components/account/ConsentPromptStorage.vue +82 -0
  2601. package/src/runtime/vue/components/account/EmailUnsubscribe.css +70 -0
  2602. package/src/runtime/vue/components/account/EmailUnsubscribe.vue +118 -0
  2603. package/src/runtime/vue/components/account/HowDidYouHear.css +115 -0
  2604. package/src/runtime/vue/components/account/HowDidYouHear.vue +183 -0
  2605. package/src/runtime/vue/components/account/KeepAccount.css +43 -0
  2606. package/src/runtime/vue/components/account/KeepAccount.vue +63 -0
  2607. package/src/runtime/vue/components/account/OnboardingFlow.css +200 -0
  2608. package/src/runtime/vue/components/account/OnboardingFlow.vue +172 -0
  2609. package/src/runtime/vue/components/account/OnboardingPlan.vue +42 -0
  2610. package/src/runtime/vue/components/account/OnboardingProfile.vue +119 -0
  2611. package/src/runtime/vue/components/account/OnboardingStepActions.vue +45 -0
  2612. package/src/runtime/vue/components/account/OnboardingTeammates.vue +107 -0
  2613. package/src/runtime/vue/components/account/OnboardingWorkspace.vue +174 -0
  2614. package/src/runtime/vue/components/account/ProfileEmailSection.vue +104 -0
  2615. package/src/runtime/vue/components/account/ProfileIdentity.css +57 -0
  2616. package/src/runtime/vue/components/account/ProfileIdentity.vue +51 -0
  2617. package/src/runtime/vue/components/account/ProfileLanguageSection.vue +44 -0
  2618. package/src/runtime/vue/components/account/ProfileNameSection.vue +36 -0
  2619. package/src/runtime/vue/components/account/ProfilePreferencesSection.css +127 -0
  2620. package/src/runtime/vue/components/account/ProfilePreferencesSection.vue +168 -0
  2621. package/src/runtime/vue/components/account/ProfileSettings.css +64 -0
  2622. package/src/runtime/vue/components/account/ProfileSettings.vue +255 -0
  2623. package/src/runtime/vue/components/account/SecurityAlerts.css +47 -0
  2624. package/src/runtime/vue/components/account/SecurityAlerts.vue +79 -0
  2625. package/src/runtime/vue/components/account/SecurityPasskeys.css +79 -0
  2626. package/src/runtime/vue/components/account/SecurityPasskeys.vue +160 -0
  2627. package/src/runtime/vue/components/account/SecuritySessions.css +21 -0
  2628. package/src/runtime/vue/components/account/SecuritySessions.vue +88 -0
  2629. package/src/runtime/vue/components/account/SecuritySettings.css +80 -0
  2630. package/src/runtime/vue/components/account/SecuritySettings.vue +283 -0
  2631. package/src/runtime/vue/components/admin/AdminAccess.css +77 -0
  2632. package/src/runtime/vue/components/admin/AdminAccess.vue +62 -0
  2633. package/src/runtime/vue/components/admin/AdminAccessAdmissions.vue +59 -0
  2634. package/src/runtime/vue/components/admin/AdminAccessAdmit.vue +73 -0
  2635. package/src/runtime/vue/components/admin/AdminAccessCreate.vue +86 -0
  2636. package/src/runtime/vue/components/admin/AdminAccessInvites.vue +56 -0
  2637. package/src/runtime/vue/components/admin/AdminAccessPhase.vue +51 -0
  2638. package/src/runtime/vue/components/admin/AdminAccessRevoke.vue +25 -0
  2639. package/src/runtime/vue/components/admin/AdminAccessTable.vue +65 -0
  2640. package/src/runtime/vue/components/admin/AdminAnalytics.css +24 -0
  2641. package/src/runtime/vue/components/admin/AdminAnalytics.vue +45 -0
  2642. package/src/runtime/vue/components/admin/AdminAnnouncements.css +94 -0
  2643. package/src/runtime/vue/components/admin/AdminAnnouncements.vue +97 -0
  2644. package/src/runtime/vue/components/admin/AdminAnnouncementsCompose.vue +140 -0
  2645. package/src/runtime/vue/components/admin/AdminAnnouncementsItem.vue +89 -0
  2646. package/src/runtime/vue/components/admin/AdminBilling.css +74 -0
  2647. package/src/runtime/vue/components/admin/AdminBilling.vue +214 -0
  2648. package/src/runtime/vue/components/admin/AdminChart.css +57 -0
  2649. package/src/runtime/vue/components/admin/AdminChart.vue +45 -0
  2650. package/src/runtime/vue/components/admin/AdminConsole.css +30 -0
  2651. package/src/runtime/vue/components/admin/AdminConsole.vue +179 -0
  2652. package/src/runtime/vue/components/admin/AdminCosts.css +64 -0
  2653. package/src/runtime/vue/components/admin/AdminCosts.vue +133 -0
  2654. package/src/runtime/vue/components/admin/AdminDrawerFrame.vue +83 -0
  2655. package/src/runtime/vue/components/admin/AdminExperiments.css +99 -0
  2656. package/src/runtime/vue/components/admin/AdminExperiments.vue +174 -0
  2657. package/src/runtime/vue/components/admin/AdminFlags.css +77 -0
  2658. package/src/runtime/vue/components/admin/AdminFlags.vue +486 -0
  2659. package/src/runtime/vue/components/admin/AdminGrowth.css +98 -0
  2660. package/src/runtime/vue/components/admin/AdminGrowth.vue +218 -0
  2661. package/src/runtime/vue/components/admin/AdminInbox.css +98 -0
  2662. package/src/runtime/vue/components/admin/AdminInbox.vue +96 -0
  2663. package/src/runtime/vue/components/admin/AdminInboxMessage.vue +116 -0
  2664. package/src/runtime/vue/components/admin/AdminListFrame.vue +88 -0
  2665. package/src/runtime/vue/components/admin/AdminListTail.vue +50 -0
  2666. package/src/runtime/vue/components/admin/AdminQueue.css +91 -0
  2667. package/src/runtime/vue/components/admin/AdminQueue.vue +108 -0
  2668. package/src/runtime/vue/components/admin/AdminQueueControls.vue +64 -0
  2669. package/src/runtime/vue/components/admin/AdminQueueJob.vue +62 -0
  2670. package/src/runtime/vue/components/admin/AdminQueueJobs.vue +90 -0
  2671. package/src/runtime/vue/components/admin/AdminQueueModels.vue +96 -0
  2672. package/src/runtime/vue/components/admin/AdminQueueTier.vue +97 -0
  2673. package/src/runtime/vue/components/admin/AdminQueueTiers.vue +47 -0
  2674. package/src/runtime/vue/components/admin/AdminReferrals.css +76 -0
  2675. package/src/runtime/vue/components/admin/AdminReferrals.vue +262 -0
  2676. package/src/runtime/vue/components/admin/AdminReports.css +88 -0
  2677. package/src/runtime/vue/components/admin/AdminReports.vue +141 -0
  2678. package/src/runtime/vue/components/admin/AdminReportsAppeal.vue +64 -0
  2679. package/src/runtime/vue/components/admin/AdminReportsDecision.vue +83 -0
  2680. package/src/runtime/vue/components/admin/AdminReportsNotice.vue +57 -0
  2681. package/src/runtime/vue/components/admin/AdminReportsSubject.vue +86 -0
  2682. package/src/runtime/vue/components/admin/AdminRevenue.css +92 -0
  2683. package/src/runtime/vue/components/admin/AdminRevenue.vue +212 -0
  2684. package/src/runtime/vue/components/admin/AdminSuppressions.css +44 -0
  2685. package/src/runtime/vue/components/admin/AdminSuppressions.vue +111 -0
  2686. package/src/runtime/vue/components/admin/AdminSystem.vue +150 -0
  2687. package/src/runtime/vue/components/admin/AdminTabDialogs.vue +30 -0
  2688. package/src/runtime/vue/components/admin/AdminTabStatus.vue +38 -0
  2689. package/src/runtime/vue/components/admin/AdminUserDrawer.vue +309 -0
  2690. package/src/runtime/vue/components/admin/AdminUsers.vue +200 -0
  2691. package/src/runtime/vue/components/admin/AdminUsersTable.vue +109 -0
  2692. package/src/runtime/vue/components/admin/AdminWaitlist.css +71 -0
  2693. package/src/runtime/vue/components/admin/AdminWaitlist.vue +80 -0
  2694. package/src/runtime/vue/components/admin/AdminWaitlistActions.vue +68 -0
  2695. package/src/runtime/vue/components/admin/AdminWaitlistFilter.vue +94 -0
  2696. package/src/runtime/vue/components/admin/AdminWaitlistSummary.vue +72 -0
  2697. package/src/runtime/vue/components/admin/AdminWaitlistTable.vue +84 -0
  2698. package/src/runtime/vue/components/admin/AdminWebhooks.css +68 -0
  2699. package/src/runtime/vue/components/admin/AdminWebhooks.vue +155 -0
  2700. package/src/runtime/vue/components/admin/AdminWorkspaceDrawer.vue +106 -0
  2701. package/src/runtime/vue/components/admin/AdminWorkspaces.vue +121 -0
  2702. package/src/runtime/vue/components/admin/AdminWorkspacesTable.vue +82 -0
  2703. package/src/runtime/vue/components/admin/admin.css +281 -0
  2704. package/src/runtime/vue/components/auth/AuthForm.css +142 -0
  2705. package/src/runtime/vue/components/auth/AuthForm.vue +239 -0
  2706. package/src/runtime/vue/components/auth/AuthFormAge.css +12 -0
  2707. package/src/runtime/vue/components/auth/AuthFormAge.vue +46 -0
  2708. package/src/runtime/vue/components/auth/AuthFormAgreement.css +17 -0
  2709. package/src/runtime/vue/components/auth/AuthFormAgreement.vue +43 -0
  2710. package/src/runtime/vue/components/auth/AuthFormChoose.css +36 -0
  2711. package/src/runtime/vue/components/auth/AuthFormChoose.vue +50 -0
  2712. package/src/runtime/vue/components/auth/AuthFormCode.vue +47 -0
  2713. package/src/runtime/vue/components/auth/AuthFormEmail.vue +41 -0
  2714. package/src/runtime/vue/components/auth/AuthFormError.css +15 -0
  2715. package/src/runtime/vue/components/auth/AuthFormError.vue +19 -0
  2716. package/src/runtime/vue/components/auth/AuthFormHeader.css +18 -0
  2717. package/src/runtime/vue/components/auth/AuthFormHeader.vue +28 -0
  2718. package/src/runtime/vue/components/auth/AuthFormInviteCode.css +17 -0
  2719. package/src/runtime/vue/components/auth/AuthFormInviteCode.vue +49 -0
  2720. package/src/runtime/vue/components/auth/AuthFormPasskey.vue +27 -0
  2721. package/src/runtime/vue/components/auth/AuthFormPasskeyOffer.css +29 -0
  2722. package/src/runtime/vue/components/auth/AuthFormPasskeyOffer.vue +52 -0
  2723. package/src/runtime/vue/components/auth/AuthFormRecover.css +19 -0
  2724. package/src/runtime/vue/components/auth/AuthFormRecover.vue +57 -0
  2725. package/src/runtime/vue/components/auth/AuthFormUndeliverable.css +21 -0
  2726. package/src/runtime/vue/components/auth/AuthFormUndeliverable.vue +35 -0
  2727. package/src/runtime/vue/components/auth/AuthFormWaitlisted.css +25 -0
  2728. package/src/runtime/vue/components/auth/AuthFormWaitlisted.vue +42 -0
  2729. package/src/runtime/vue/components/auth/InviteRedeem.css +34 -0
  2730. package/src/runtime/vue/components/auth/InviteRedeem.vue +63 -0
  2731. package/src/runtime/vue/components/auth/ReauthenticateCode.css +21 -0
  2732. package/src/runtime/vue/components/auth/ReauthenticateCode.vue +59 -0
  2733. package/src/runtime/vue/components/auth/ReauthenticateDialog.css +95 -0
  2734. package/src/runtime/vue/components/auth/ReauthenticateDialog.vue +180 -0
  2735. package/src/runtime/vue/components/auth/ReauthenticatePasskey.css +24 -0
  2736. package/src/runtime/vue/components/auth/ReauthenticatePasskey.vue +37 -0
  2737. package/src/runtime/vue/components/auth/WaitlistCode.css +24 -0
  2738. package/src/runtime/vue/components/auth/WaitlistCode.vue +57 -0
  2739. package/src/runtime/vue/components/auth/WaitlistForm.css +80 -0
  2740. package/src/runtime/vue/components/auth/WaitlistForm.vue +119 -0
  2741. package/src/runtime/vue/components/auth/WaitlistJoin.css +46 -0
  2742. package/src/runtime/vue/components/auth/WaitlistJoin.vue +99 -0
  2743. package/src/runtime/vue/components/auth/WaitlistPlace.css +53 -0
  2744. package/src/runtime/vue/components/auth/WaitlistPlace.vue +78 -0
  2745. package/src/runtime/vue/components/auth/WaitlistShare.css +68 -0
  2746. package/src/runtime/vue/components/auth/WaitlistShare.vue +76 -0
  2747. package/src/runtime/vue/components/auth/WaitlistStatus.css +19 -0
  2748. package/src/runtime/vue/components/auth/WaitlistStatus.vue +75 -0
  2749. package/src/runtime/vue/components/billing/BillingCheckoutLink.vue +103 -0
  2750. package/src/runtime/vue/components/billing/BillingHistory.css +71 -0
  2751. package/src/runtime/vue/components/billing/BillingHistory.vue +131 -0
  2752. package/src/runtime/vue/components/billing/BillingHistoryOrder.css +63 -0
  2753. package/src/runtime/vue/components/billing/BillingHistoryOrder.vue +52 -0
  2754. package/src/runtime/vue/components/billing/BillingPortalLink.vue +65 -0
  2755. package/src/runtime/vue/components/billing/CancelConfirmGroup.vue +55 -0
  2756. package/src/runtime/vue/components/billing/CancelFlow.css +94 -0
  2757. package/src/runtime/vue/components/billing/CancelFlow.vue +123 -0
  2758. package/src/runtime/vue/components/billing/CancelFlowEnd.vue +43 -0
  2759. package/src/runtime/vue/components/billing/CancelFlowOffer.vue +30 -0
  2760. package/src/runtime/vue/components/billing/CancelFlowQuestion.vue +52 -0
  2761. package/src/runtime/vue/components/billing/GiftList.css +101 -0
  2762. package/src/runtime/vue/components/billing/GiftList.vue +125 -0
  2763. package/src/runtime/vue/components/billing/GiftReceived.vue +71 -0
  2764. package/src/runtime/vue/components/billing/GiftSent.vue +138 -0
  2765. package/src/runtime/vue/components/billing/PricingCancelConfirm.vue +14 -0
  2766. package/src/runtime/vue/components/billing/PricingCurrencySelect.vue +53 -0
  2767. package/src/runtime/vue/components/billing/PricingEmailOptOut.css +34 -0
  2768. package/src/runtime/vue/components/billing/PricingEmailOptOut.vue +32 -0
  2769. package/src/runtime/vue/components/billing/PricingPackCard.css +25 -0
  2770. package/src/runtime/vue/components/billing/PricingPackCard.vue +75 -0
  2771. package/src/runtime/vue/components/billing/PricingPeriodSwitch.vue +52 -0
  2772. package/src/runtime/vue/components/billing/PricingPlanCard.css +106 -0
  2773. package/src/runtime/vue/components/billing/PricingPlanCard.vue +140 -0
  2774. package/src/runtime/vue/components/billing/PricingPromotion.vue +24 -0
  2775. package/src/runtime/vue/components/billing/PricingTable.css +94 -0
  2776. package/src/runtime/vue/components/billing/PricingTable.vue +710 -0
  2777. package/src/runtime/vue/components/billing/ReferralCard.css +100 -0
  2778. package/src/runtime/vue/components/billing/ReferralCard.vue +203 -0
  2779. package/src/runtime/vue/components/billing/ReferralLanding.css +52 -0
  2780. package/src/runtime/vue/components/billing/ReferralLanding.vue +112 -0
  2781. package/src/runtime/vue/components/billing/UpgradePrompt.css +55 -0
  2782. package/src/runtime/vue/components/billing/UpgradePrompt.vue +144 -0
  2783. package/src/runtime/vue/components/billing/UsageHistory.css +61 -0
  2784. package/src/runtime/vue/components/billing/UsageHistory.vue +98 -0
  2785. package/src/runtime/vue/components/billing/UsageHistoryEvent.css +39 -0
  2786. package/src/runtime/vue/components/billing/UsageHistoryEvent.vue +23 -0
  2787. package/src/runtime/vue/components/billing/WithdrawalButton.css +59 -0
  2788. package/src/runtime/vue/components/billing/WithdrawalButton.vue +111 -0
  2789. package/src/runtime/vue/components/shared.css +131 -0
  2790. package/src/runtime/vue/components/shell/AccessDenied.css +77 -0
  2791. package/src/runtime/vue/components/shell/AccessDenied.vue +207 -0
  2792. package/src/runtime/vue/components/shell/AccessDeniedPage.vue +25 -0
  2793. package/src/runtime/vue/components/shell/AccountMenu.css +87 -0
  2794. package/src/runtime/vue/components/shell/AccountMenu.vue +92 -0
  2795. package/src/runtime/vue/components/shell/AiLabel.css +68 -0
  2796. package/src/runtime/vue/components/shell/AiLabel.vue +65 -0
  2797. package/src/runtime/vue/components/shell/AppShell.css +188 -0
  2798. package/src/runtime/vue/components/shell/AppShell.vue +122 -0
  2799. package/src/runtime/vue/components/shell/BackendNotices.vue +67 -0
  2800. package/src/runtime/vue/components/shell/ConfirmDialog.css +67 -0
  2801. package/src/runtime/vue/components/shell/ConfirmDialog.vue +76 -0
  2802. package/src/runtime/vue/components/shell/ConnectionStatus.css +36 -0
  2803. package/src/runtime/vue/components/shell/ConnectionStatus.vue +102 -0
  2804. package/src/runtime/vue/components/shell/ContactForm.css +94 -0
  2805. package/src/runtime/vue/components/shell/ContactForm.vue +133 -0
  2806. package/src/runtime/vue/components/shell/ErrorPage.vue +33 -0
  2807. package/src/runtime/vue/components/shell/FrameConnectionStatus.vue +18 -0
  2808. package/src/runtime/vue/components/shell/FrameMain.vue +54 -0
  2809. package/src/runtime/vue/components/shell/Gate.css +51 -0
  2810. package/src/runtime/vue/components/shell/Gate.vue +207 -0
  2811. package/src/runtime/vue/components/shell/GateQuota.vue +87 -0
  2812. package/src/runtime/vue/components/shell/LegalDataMap.vue +46 -0
  2813. package/src/runtime/vue/components/shell/LegalDocument.css +126 -0
  2814. package/src/runtime/vue/components/shell/LegalDocument.vue +266 -0
  2815. package/src/runtime/vue/components/shell/LegalProcessors.vue +61 -0
  2816. package/src/runtime/vue/components/shell/LegalStorage.vue +60 -0
  2817. package/src/runtime/vue/components/shell/ListPager.vue +46 -0
  2818. package/src/runtime/vue/components/shell/NoticeAnnouncement.css +54 -0
  2819. package/src/runtime/vue/components/shell/NoticeAnnouncement.vue +128 -0
  2820. package/src/runtime/vue/components/shell/NoticeDeletion.css +57 -0
  2821. package/src/runtime/vue/components/shell/NoticeDeletion.vue +83 -0
  2822. package/src/runtime/vue/components/shell/NoticeGift.css +51 -0
  2823. package/src/runtime/vue/components/shell/NoticeGift.vue +172 -0
  2824. package/src/runtime/vue/components/shell/NoticeImpersonation.css +44 -0
  2825. package/src/runtime/vue/components/shell/NoticeImpersonation.vue +107 -0
  2826. package/src/runtime/vue/components/shell/NoticeLowCredits.css +62 -0
  2827. package/src/runtime/vue/components/shell/NoticeLowCredits.vue +219 -0
  2828. package/src/runtime/vue/components/shell/NoticeMaintenance.css +30 -0
  2829. package/src/runtime/vue/components/shell/NoticeMaintenance.vue +42 -0
  2830. package/src/runtime/vue/components/shell/NoticePastDue.css +46 -0
  2831. package/src/runtime/vue/components/shell/NoticePastDue.vue +76 -0
  2832. package/src/runtime/vue/components/shell/NotificationInbox.css +220 -0
  2833. package/src/runtime/vue/components/shell/NotificationInbox.vue +104 -0
  2834. package/src/runtime/vue/components/shell/NotificationInboxBell.vue +38 -0
  2835. package/src/runtime/vue/components/shell/NotificationInboxItem.vue +51 -0
  2836. package/src/runtime/vue/components/shell/PageFrame.vue +121 -0
  2837. package/src/runtime/vue/components/shell/PagedList.vue +114 -0
  2838. package/src/runtime/vue/components/shell/ReportAppeal.vue +103 -0
  2839. package/src/runtime/vue/components/shell/ReportNotice.css +58 -0
  2840. package/src/runtime/vue/components/shell/ReportNotice.vue +170 -0
  2841. package/src/runtime/vue/components/shell/UploadField.css +79 -0
  2842. package/src/runtime/vue/components/shell/UploadField.vue +99 -0
  2843. package/src/runtime/vue/components/shell/WorkspaceSwitcher.css +128 -0
  2844. package/src/runtime/vue/components/shell/WorkspaceSwitcher.vue +136 -0
  2845. package/src/runtime/vue/components/tokens.css +96 -0
  2846. package/src/runtime/vue/components/workspaces/AcceptInvitation.css +35 -0
  2847. package/src/runtime/vue/components/workspaces/AcceptInvitation.vue +199 -0
  2848. package/src/runtime/vue/components/workspaces/AcceptInvitationActions.css +21 -0
  2849. package/src/runtime/vue/components/workspaces/AcceptInvitationActions.vue +31 -0
  2850. package/src/runtime/vue/components/workspaces/AuditLog.css +61 -0
  2851. package/src/runtime/vue/components/workspaces/AuditLog.vue +103 -0
  2852. package/src/runtime/vue/components/workspaces/AuditLogEvent.css +53 -0
  2853. package/src/runtime/vue/components/workspaces/AuditLogEvent.vue +31 -0
  2854. package/src/runtime/vue/components/workspaces/WorkspaceBilling.css +112 -0
  2855. package/src/runtime/vue/components/workspaces/WorkspaceBilling.vue +267 -0
  2856. package/src/runtime/vue/components/workspaces/WorkspaceCredits.css +30 -0
  2857. package/src/runtime/vue/components/workspaces/WorkspaceCredits.vue +57 -0
  2858. package/src/runtime/vue/components/workspaces/WorkspaceList.css +77 -0
  2859. package/src/runtime/vue/components/workspaces/WorkspaceList.vue +95 -0
  2860. package/src/runtime/vue/components/workspaces/WorkspaceSettings.css +58 -0
  2861. package/src/runtime/vue/components/workspaces/WorkspaceSettings.vue +268 -0
  2862. package/src/runtime/vue/pages/accept-invitation.vue +24 -0
  2863. package/src/runtime/vue/pages/accessibility.vue +26 -0
  2864. package/src/runtime/vue/pages/admin.vue +63 -0
  2865. package/src/runtime/vue/pages/gifts.vue +27 -0
  2866. package/src/runtime/vue/pages/invite.vue +26 -0
  2867. package/src/runtime/vue/pages/keep-account.vue +31 -0
  2868. package/src/runtime/vue/pages/login.vue +65 -0
  2869. package/src/runtime/vue/pages/pricing.vue +54 -0
  2870. package/src/runtime/vue/pages/privacy.vue +27 -0
  2871. package/src/runtime/vue/pages/profile.vue +22 -0
  2872. package/src/runtime/vue/pages/referral.vue +28 -0
  2873. package/src/runtime/vue/pages/report.vue +44 -0
  2874. package/src/runtime/vue/pages/security.vue +32 -0
  2875. package/src/runtime/vue/pages/settings.vue +38 -0
  2876. package/src/runtime/vue/pages/subprocessors.vue +26 -0
  2877. package/src/runtime/vue/pages/terms.vue +27 -0
  2878. package/src/runtime/vue/pages/unsubscribe.vue +38 -0
  2879. package/src/runtime/vue/pages/waitlist.vue +28 -0
  2880. package/src/runtime/vue/pages/welcome.vue +31 -0
  2881. package/dist/convex/component/_generated/api.d.ts +0 -36
  2882. package/dist/convex/component/_generated/api.d.ts.map +0 -1
  2883. package/dist/convex/component/_generated/api.js.map +0 -1
  2884. package/dist/convex/component/_generated/component.d.ts +0 -549
  2885. package/dist/convex/component/_generated/component.d.ts.map +0 -1
  2886. package/dist/convex/component/_generated/component.js.map +0 -1
  2887. package/dist/convex/component/_generated/dataModel.d.ts.map +0 -1
  2888. package/dist/convex/component/_generated/dataModel.js.map +0 -1
  2889. package/dist/convex/component/_generated/server.d.ts +0 -121
  2890. package/dist/convex/component/_generated/server.d.ts.map +0 -1
  2891. package/dist/convex/component/_generated/server.js +0 -78
  2892. package/dist/convex/component/_generated/server.js.map +0 -1
  2893. package/dist/convex/component/adapter.d.ts.map +0 -1
  2894. package/dist/convex/component/adapter.js +0 -23
  2895. package/dist/convex/component/adapter.js.map +0 -1
  2896. package/dist/convex/component/constants.d.ts +0 -3
  2897. package/dist/convex/component/constants.d.ts.map +0 -1
  2898. package/dist/convex/component/constants.js +0 -3
  2899. package/dist/convex/component/constants.js.map +0 -1
  2900. package/dist/convex/component/convex.config.d.ts +0 -14
  2901. package/dist/convex/component/convex.config.d.ts.map +0 -1
  2902. package/dist/convex/component/convex.config.js +0 -15
  2903. package/dist/convex/component/convex.config.js.map +0 -1
  2904. package/dist/convex/component/schema.d.ts +0 -278
  2905. package/dist/convex/component/schema.d.ts.map +0 -1
  2906. package/dist/convex/component/schema.js +0 -91
  2907. package/dist/convex/component/schema.js.map +0 -1
  2908. package/dist/runtime/nuxt/auth/middleware.d.ts +0 -12
  2909. package/dist/runtime/nuxt/auth/middleware.js +0 -31
  2910. package/dist/runtime/nuxt/auth/proxy.d.ts +0 -6
  2911. package/dist/runtime/nuxt/auth/proxy.js +0 -11
  2912. package/dist/runtime/nuxt/auth/server.d.ts +0 -86
  2913. package/dist/runtime/nuxt/auth/server.js +0 -110
  2914. package/dist/runtime/nuxt/config.d.ts +0 -7
  2915. package/dist/runtime/nuxt/config.js +0 -12
  2916. package/dist/runtime/nuxt/index.d.ts +0 -102
  2917. package/dist/runtime/nuxt/index.js +0 -77
  2918. package/dist/runtime/vue/auth/client.d.ts +0 -14
  2919. package/dist/runtime/vue/auth/client.js +0 -7
  2920. package/dist/runtime/vue/auth/cross-domain.d.ts +0 -8
  2921. package/dist/runtime/vue/auth/cross-domain.js +0 -34
  2922. package/dist/runtime/vue/auth/helpers.d.ts +0 -52
  2923. package/dist/runtime/vue/auth/helpers.js +0 -35
  2924. package/dist/runtime/vue/auth/hydration.d.ts +0 -14
  2925. package/dist/runtime/vue/auth/hydration.js +0 -23
  2926. package/dist/runtime/vue/auth/index.d.ts +0 -79
  2927. package/dist/runtime/vue/auth/index.js +0 -81
  2928. package/dist/runtime/vue/auth/plugin.client.d.ts +0 -6
  2929. package/dist/runtime/vue/auth/plugin.client.js +0 -30
  2930. package/dist/runtime/vue/auth/plugin.server.d.ts +0 -17
  2931. package/dist/runtime/vue/auth/plugin.server.js +0 -29
  2932. package/dist/runtime/vue/auth/use-auth.d.ts +0 -84
  2933. package/dist/runtime/vue/auth/use-auth.js +0 -77
  2934. package/dist/runtime/vue/client.d.ts +0 -245
  2935. package/dist/runtime/vue/client.js +0 -341
  2936. package/dist/runtime/vue/composables/use-action.d.ts +0 -45
  2937. package/dist/runtime/vue/composables/use-action.js +0 -10
  2938. package/dist/runtime/vue/composables/use-connection-state.d.ts +0 -25
  2939. package/dist/runtime/vue/composables/use-connection-state.js +0 -13
  2940. package/dist/runtime/vue/composables/use-mutation.d.ts +0 -60
  2941. package/dist/runtime/vue/composables/use-mutation.js +0 -36
  2942. package/dist/runtime/vue/composables/use-paginated-query.d.ts +0 -101
  2943. package/dist/runtime/vue/composables/use-paginated-query.js +0 -508
  2944. package/dist/runtime/vue/composables/use-queries.d.ts +0 -45
  2945. package/dist/runtime/vue/composables/use-queries.js +0 -32
  2946. package/dist/runtime/vue/composables/use-query.d.ts +0 -82
  2947. package/dist/runtime/vue/composables/use-query.js +0 -63
  2948. package/dist/runtime/vue/composables/use-subscription.d.ts +0 -14
  2949. package/dist/runtime/vue/composables/use-subscription.js +0 -15
  2950. package/dist/runtime/vue/hydration.d.ts +0 -42
  2951. package/dist/runtime/vue/hydration.js +0 -18
  2952. package/dist/runtime/vue/index.d.ts +0 -29
  2953. package/dist/runtime/vue/index.js +0 -38
  2954. package/dist/runtime/vue/queries-observer.d.ts +0 -38
  2955. package/dist/runtime/vue/queries-observer.js +0 -127
  2956. package/src/convex/component/_generated/api.ts +0 -52
  2957. package/src/convex/component/_generated/component.ts +0 -1338
  2958. package/src/convex/component/_generated/server.ts +0 -156
  2959. package/src/convex/component/adapter.ts +0 -42
  2960. package/src/convex/component/constants.ts +0 -2
  2961. package/src/convex/component/convex.config.ts +0 -16
  2962. package/src/convex/component/schema.ts +0 -93
  2963. /package/dist/convex/{component → components/backend}/_generated/api.js +0 -0
  2964. /package/dist/convex/{component → components/backend}/_generated/component.js +0 -0
  2965. /package/dist/convex/{component → components/backend}/_generated/dataModel.d.ts +0 -0
  2966. /package/dist/convex/{component → components/backend}/_generated/dataModel.js +0 -0
  2967. /package/dist/convex/{component → components/backend}/adapter.d.ts +0 -0
  2968. /package/src/convex/{component → components/backend}/_generated/dataModel.ts +0 -0
package/dist/cli.mjs ADDED
@@ -0,0 +1,3550 @@
1
+ #!/usr/bin/env node
2
+ import { defineCommand, parseArgs, runMain } from 'citty';
3
+ import { writeFileSync, existsSync, readFileSync, readdirSync, mkdirSync, mkdtempSync, rmSync, cpSync, symlinkSync } from 'node:fs';
4
+ import { resolve, join, posix, relative, dirname, isAbsolute, sep } from 'node:path';
5
+ import { C as CAPABILITY_STATES, d as deploymentFunctionSpec, a as deploymentEnvNames, i as isHttpUrl, b as deploymentBackendEnvironment, c as billingEnvironment, s as siteFromCloudUrl, r as resolveFunctionsDir, e as readTextIfPresent, f as runConvex, g as deploymentFlags, h as readEnvFiles, j as deployKeyType, k as executeEnvPush, l as generateAuthSecret, m as setDeploymentEnv, n as isLoopbackUrl, o as nonProductionDeployKey, p as spawnConvex, B as BACKEND_ENV_NAMES, D as DERIVED_DEPLOYMENT_ENV, q as scaffoldBackendFiles, t as pathsSourceOf, u as syncPathsFile, v as backendPathsOf, w as pathsFileLocation, x as appBrandOf, y as syncBrandFile, z as brandFileLocation, A as configuredDeployment, E as isDevDeploymentId, M as MCP_SDK, F as computeDeployment, G as appMonitoringDsn, H as monitoringSdkInstalled, I as detectCapabilities, J as DEPLOYMENT_KIND_LABEL, K as CAPABILITY_NAMES, R as REGISTERED_UI, L as uiPath, N as BACKEND_PAGE_DEFS, O as installedVersion, P as packageDir, Q as uiEntry, S as ConvexCliError, T as agentsMdVersion, U as packageVersion, V as doctorReport, W as formatPreflightSummary, X as runEnvPush, Y as devPushRefusal } from './shared/nuxt-backend.OQMX-0U7.mjs';
6
+ import { s as setUpProject, n as nextCommands$1, f as formatNextSteps, a as setUpAgentFiles } from './shared/nuxt-backend.S5C2b-4I.mjs';
7
+ import { M as MANAGED_BY, i as isManaged, r as refuseUnpricedPlans, a as refuseInvalidPrices, b as refuseInvalidGifts, c as refuseInvalidQuotas, d as refuseInvalidDiscounts, l as listAllPages, e as refuseMissingDefaultCurrency, f as refuseUnpricedDiscounts, g as ensurePlanQuotas, h as retirePlan, p as pricedIntervals, j as attachRetiredPlanQuotas, k as recordQuotaKeys, m as packPricesByCurrency, s as syncPassProducts, n as syncDiscounts, o as planQuotasKeys, q as derivedPassKeys, t as droppedQuotasKeys, u as unpricedPlanProducts, v as providerClientOptions, w as planQuotasKey, x as planPricesByCurrency, y as findPlanProduct, z as isUntaggedPlanProduct, A as planCreditUnits, B as planQuotasBenefits, C as providerTrialOf, D as pushPlanTrial, E as attachPlanQuotas, F as isFreePlan, G as BILLING_WEBHOOK_PROVISION_EVENTS, H as planProductKey, I as recordPlanProduct, J as loadGenerated, K as renderGenerated, L as loadCatalog, N as probeWebhookRoute, O as runEmailSync, P as planSettingChanges, Q as planEndpointChanges, R as applyProviderChanges, S as billingProviderTarget, T as providerClient, U as readProviderOrganization, V as readProviderEndpoint, W as emailSyncRefusal, X as runDoctorChecks, Y as readProductionPosture, Z as email, _ as runEnvDefaults, $ as bootstrapAdmin, a0 as runEmailSyncCommand, a1 as ENV_DEFAULT_TYPES } from './chunks/doctor.mjs';
8
+ import { createInterface } from 'node:readline';
9
+ import { webhooksResetWebhookEndpointSecret } from '@polar-sh/sdk/funcs/webhooksResetWebhookEndpointSecret.js';
10
+ import { w as withContract, p as progress, a as adoptBackendDevScript, d as dev } from './shared/nuxt-backend.2YoiKo8j.mjs';
11
+ import { runAnalyze, halvesOf } from './chunks/run.mjs';
12
+ import { f as formatReport, b as budgetFailures, a as formatSize, p as parseSize, B as BUDGET_FLAGS } from './chunks/report.mjs';
13
+ import { Polar } from '@polar-sh/sdk';
14
+ import { metersCreate } from '@polar-sh/sdk/funcs/metersCreate.js';
15
+ import { metersList } from '@polar-sh/sdk/funcs/metersList.js';
16
+ import { benefitsCreate } from '@polar-sh/sdk/funcs/benefitsCreate.js';
17
+ import { benefitsList } from '@polar-sh/sdk/funcs/benefitsList.js';
18
+ import { customFieldsCreate } from '@polar-sh/sdk/funcs/customFieldsCreate.js';
19
+ import { customFieldsList } from '@polar-sh/sdk/funcs/customFieldsList.js';
20
+ import { productsCreate } from '@polar-sh/sdk/funcs/productsCreate.js';
21
+ import { productsList } from '@polar-sh/sdk/funcs/productsList.js';
22
+ import { productsUpdateBenefits } from '@polar-sh/sdk/funcs/productsUpdateBenefits.js';
23
+ import { webhooksCreateWebhookEndpoint } from '@polar-sh/sdk/funcs/webhooksCreateWebhookEndpoint.js';
24
+ import { webhooksListWebhookEndpoints } from '@polar-sh/sdk/funcs/webhooksListWebhookEndpoints.js';
25
+ import { productsUpdate } from '@polar-sh/sdk/funcs/productsUpdate.js';
26
+ import { organizationsListOrganizations } from '@polar-sh/sdk/funcs/organizationsListOrganizations.js';
27
+ import { randomBytes } from 'node:crypto';
28
+ import { spawn } from 'node:child_process';
29
+ import { Resend } from 'resend';
30
+ import { f as fixConvexConfig } from './shared/nuxt-backend.CPq101Wi.mjs';
31
+ import { isSandboxAddress, findCode } from '../dist/runtime/vue/utils/sandbox-code.js';
32
+ import { styleText } from 'node:util';
33
+ import { v } from 'convex/values';
34
+ import { D as DARK_SCHEME_QUERY, t as textDirection } from './shared/nuxt-backend.C62dpRH3.mjs';
35
+ import { setTimeout } from 'node:timers/promises';
36
+ import { tmpdir } from 'node:os';
37
+ import 'node:url';
38
+ import 'node:module';
39
+ import 'dedent';
40
+ import 'defu';
41
+ import '@polar-sh/sdk/funcs/membersListMembers.js';
42
+ import '@polar-sh/sdk/funcs/discountsCreate.js';
43
+ import '@polar-sh/sdk/funcs/discountsList.js';
44
+ import '@polar-sh/sdk/funcs/discountsUpdate.js';
45
+ import '@polar-sh/sdk/lib/config.js';
46
+ import '@polar-sh/sdk/funcs/benefitsUpdate.js';
47
+ import '@polar-sh/sdk/funcs/organizationsUpdate.js';
48
+ import '@polar-sh/sdk/funcs/webhooksUpdateWebhookEndpoint.js';
49
+ import '@polar-sh/sdk/funcs/metricsLimits.js';
50
+
51
+ function capabilitySummary(states) {
52
+ return CAPABILITY_STATES.map((state) => [state, states.filter((each) => each === state).length]).filter(([, count]) => count > 0).map(([state, count]) => `${count} ${state}`).join(" \xB7 ");
53
+ }
54
+ function healthStatus(states) {
55
+ if (states.includes("failing")) return "failing";
56
+ if (states.includes("missing")) return "degraded";
57
+ return "ok";
58
+ }
59
+
60
+ function askOnTerminal(question, { secret = false } = {}) {
61
+ const terminal = createInterface({ input: process.stdin, output: process.stderr, terminal: true });
62
+ if (secret) {
63
+ const muted = terminal;
64
+ let asked = false;
65
+ muted._writeToOutput = (text) => {
66
+ if (!asked) {
67
+ asked = true;
68
+ muted.output.write(text);
69
+ }
70
+ };
71
+ }
72
+ return new Promise((resolve) => {
73
+ terminal.question(question, (answer) => {
74
+ if (secret) process.stderr.write("\n");
75
+ terminal.close();
76
+ resolve(answer.trim());
77
+ });
78
+ });
79
+ }
80
+
81
+ async function readSyncDeployment(rootDir, prod) {
82
+ const [spec, envNames] = await Promise.all([
83
+ deploymentFunctionSpec(rootDir, { prod }),
84
+ deploymentEnvNames(rootDir, { prod })
85
+ ]);
86
+ return {
87
+ url: spec?.url ?? null,
88
+ envNames,
89
+ billingEnvironment: envNames === null ? null : await deployedBillingEnvironment(rootDir, prod, envNames)
90
+ };
91
+ }
92
+ async function deployedBillingEnvironment(rootDir, prod, envNames) {
93
+ if (!envNames.includes("BACKEND_ENVIRONMENT")) return "sandbox";
94
+ const environment = await deploymentBackendEnvironment(rootDir, { prod });
95
+ return environment === null ? null : billingEnvironment(environment);
96
+ }
97
+ const CLOUD_URL = /^https:\/\/([a-z0-9-]+)\.convex\.cloud\/?$/;
98
+ const CLOUD_SITE_URL = /^https:\/\/([a-z0-9-]+)\.convex\.site(?:[/?#]|$)/;
99
+ function deploymentLabel(url, prod) {
100
+ const kind = prod ? "production deployment" : "deployment";
101
+ if (!url) return `the ${kind}`;
102
+ const slug = CLOUD_URL.exec(url)?.[1];
103
+ return slug ? `${kind} ${slug}` : `the ${kind} at ${url}`;
104
+ }
105
+ function isLoopback(url) {
106
+ try {
107
+ const { hostname } = new URL(url);
108
+ return hostname === "localhost" || hostname.endsWith(".localhost") || hostname === "[::1]" || hostname === "0.0.0.0" || /^127\./.test(hostname);
109
+ } catch {
110
+ return false;
111
+ }
112
+ }
113
+ function planWebhook(option, { prod, deployment, env }) {
114
+ if (option === "off") return { skip: "Webhook left alone (--webhook off)." };
115
+ if (option && !isHttpUrl(option)) return { refusal: "--webhook takes an http(s) URL, or off." };
116
+ const flag = prod ? " --prod" : "";
117
+ const unavailable = ({ reason, remedy }) => prod ? { refusal: `--env production refused: ${reason} ${remedy}, or pass --webhook off to leave the webhook alone.` } : { skip: `Webhook skipped: ${reason} ${remedy}.` };
118
+ const target = option ? { url: option } : derivedWebhookUrl(deployment, env, flag);
119
+ if (!("url" in target)) return unavailable(target);
120
+ const mismatch = deploymentMismatch(target.url, deployment.url, flag);
121
+ if (mismatch) return { refusal: mismatch };
122
+ if (deployment.envNames === null) {
123
+ return unavailable({
124
+ reason: `the deployment's env could not be read (\`npx convex env list${flag}\` failed), so where the endpoint's secret goes could not be checked.`,
125
+ remedy: "Make the deployment reachable and run billing sync again"
126
+ });
127
+ }
128
+ return { url: target.url, secretSet: deployment.envNames.includes("BILLING_WEBHOOK_SECRET") };
129
+ }
130
+ function derivedWebhookUrl(deployment, env, flag) {
131
+ const passUrl = "Pass --webhook <url>";
132
+ const tunnel = `${passUrl} \u2014 a public tunnel to it`;
133
+ const site = env.NUXT_PUBLIC_CONVEX_SITE_URL || (deployment.url ? siteFromCloudUrl(deployment.url) : null);
134
+ if (site) {
135
+ const url = `${site.replace(/\/+$/, "")}/billing/events`;
136
+ return isLoopback(url) ? { reason: `the site URL is on this machine (${site}), where the provider cannot deliver.`, remedy: tunnel } : { url };
137
+ }
138
+ if (!deployment.url) return { reason: `the deployment could not be read (\`npx convex function-spec${flag}\` failed), so its site URL is unknown.`, remedy: passUrl };
139
+ if (isLoopback(deployment.url)) return { reason: `the deployment runs on this machine (${deployment.url}), where the provider cannot deliver.`, remedy: tunnel };
140
+ return { reason: `no site URL derives from the deployment's own (${deployment.url}).`, remedy: "Set NUXT_PUBLIC_CONVEX_SITE_URL, or pass --webhook <url>" };
141
+ }
142
+ function deploymentMismatch(url, deploymentUrl, flag) {
143
+ const endpointSlug = CLOUD_SITE_URL.exec(url)?.[1];
144
+ const deploymentSlug = deploymentUrl ? CLOUD_URL.exec(deploymentUrl)?.[1] : void 0;
145
+ if (!endpointSlug || !deploymentSlug || endpointSlug === deploymentSlug) return null;
146
+ return `The webhook URL ${url} is deployment ${endpointSlug}'s, but its secret would be stored on ${deploymentSlug}, the deployment \`convex env set${flag}\` writes. Pass --webhook with ${deploymentSlug}'s URL, or correct the site URL in the env.`;
147
+ }
148
+ function productsRefreshBlocker(deployment, environment, prod) {
149
+ const flag = prod ? " --prod" : "";
150
+ const refresh = `\`npx convex run${flag} billing:syncProducts\``;
151
+ const where = deploymentLabel(deployment.url, prod);
152
+ if (deployment.envNames === null) return `the deployment's env could not be read. Once it is reachable, run ${refresh}.`;
153
+ if (!deployment.envNames.includes("BILLING_ACCESS_TOKEN")) {
154
+ return prod ? `${where} has no BILLING_ACCESS_TOKEN, so it cannot read the products. Set the production organization token there (\`npx convex env set --prod BILLING_ACCESS_TOKEN\` asks for it), then run ${refresh}.` : `${where} has no BILLING_ACCESS_TOKEN yet, so it cannot read the products. Forward it from .env.local with \`npx nuxt-backend env push\`, then run ${refresh}.`;
155
+ }
156
+ if (deployment.billingEnvironment !== null && deployment.billingEnvironment !== environment) {
157
+ const why = deployment.envNames.includes("BACKEND_ENVIRONMENT") ? "BACKEND_ENVIRONMENT says so" : "BACKEND_ENVIRONMENT is unset";
158
+ const fix = environment === "production" ? `Run \`npx convex env set${flag} BACKEND_ENVIRONMENT production\`` : `Set BACKEND_ENVIRONMENT to development, preview or sandbox (\`npx convex env set${flag} BACKEND_ENVIRONMENT sandbox\`)`;
159
+ return `${where} runs the ${deployment.billingEnvironment} billing environment (${why}), not ${environment}, so it would load the other catalog. ${fix}, then ${refresh}.`;
160
+ }
161
+ return null;
162
+ }
163
+
164
+ function describeMeterDrift(existing, wanted) {
165
+ const parts = [];
166
+ const liveFunc = typeof existing.aggregation?.func === "string" ? existing.aggregation.func : void 0;
167
+ const liveProperty = typeof existing.aggregation?.property === "string" ? existing.aggregation.property : void 0;
168
+ const wantedFunc = wanted.property ? "sum" : "count";
169
+ if (liveFunc !== void 0 && (liveFunc !== wantedFunc || wanted.property !== void 0 && liveProperty !== wanted.property)) {
170
+ const describe = (func, property) => func === "sum" ? `sum of '${property ?? "?"}'` : func ?? "unknown";
171
+ parts.push(`aggregates by ${describe(liveFunc, liveProperty)}, catalog says ${describe(wantedFunc, wanted.property)}`);
172
+ }
173
+ const liveEventName = existing.filter?.clauses?.find((clause) => clause.property === "name")?.value;
174
+ if (typeof liveEventName === "string" && liveEventName !== wanted.eventName) {
175
+ parts.push(`counts events named "${liveEventName}", catalog says "${wanted.eventName}"`);
176
+ }
177
+ return parts.length > 0 ? parts.join("; ") : void 0;
178
+ }
179
+ function liveFixedPrice(live, wanted) {
180
+ const inCurrency = wanted.priceCurrency ? live.find((price) => price.priceCurrency === wanted.priceCurrency) : void 0;
181
+ if (inCurrency) return inCurrency;
182
+ const only = live.length === 1 ? live[0] : void 0;
183
+ return only && (!wanted.priceCurrency || !only.priceCurrency) ? only : void 0;
184
+ }
185
+ function meterCycleDrift(existing, wanted) {
186
+ const live = existing.meterInterval ?? null;
187
+ const meant = wanted.meterInterval ?? null;
188
+ return "meterInterval" in existing && live !== meant ? [`meter cycle ${live ?? "none"}, catalog says ${meant ?? "none"}`] : [];
189
+ }
190
+ function describeProductDrift(existing, wanted) {
191
+ const parts = meterCycleDrift(existing, wanted);
192
+ if (typeof existing.name === "string" && existing.name !== wanted.name) {
193
+ parts.push(`named "${existing.name}", catalog says "${wanted.name}"`);
194
+ }
195
+ const live = (existing.prices ?? []).filter((price) => price.amountType === "fixed" && price.isArchived !== true);
196
+ const fixed = (wanted.prices ?? []).filter((entry) => entry.amountType === "fixed");
197
+ for (const price of fixed) {
198
+ const current = liveFixedPrice(live, price);
199
+ if (price.priceAmount === void 0 || current?.priceAmount === void 0 || current.priceAmount === price.priceAmount) continue;
200
+ const currency = fixed.length > 1 && price.priceCurrency ? ` ${price.priceCurrency}` : "";
201
+ parts.push(`priced ${current.priceAmount}${currency}, catalog says ${price.priceAmount}${currency}`);
202
+ }
203
+ return parts.length > 0 ? parts.join("; ") : void 0;
204
+ }
205
+ function missingCurrencyPrices(existing, wanted) {
206
+ const live = new Set((existing.prices ?? []).filter((price) => price.amountType === "fixed" && !price.isArchived).map((price) => price.priceCurrency));
207
+ if (live.size === 0 || live.has(void 0)) return [];
208
+ return wanted.filter((price) => {
209
+ const currency = price.priceCurrency;
210
+ return price.amountType === "fixed" && currency !== void 0 && !live.has(currency);
211
+ });
212
+ }
213
+ function describeBenefitDrift(existing, wanted) {
214
+ if (existing.type !== "meter_credit" || wanted.type !== "meter_credit") return void 0;
215
+ const live = existing.properties ?? {};
216
+ const catalog = wanted.properties ?? {};
217
+ const parts = [];
218
+ if (typeof live.units === "number" && live.units !== catalog.units) parts.push(`grants ${live.units} units, catalog says ${String(catalog.units)}`);
219
+ if (typeof live.rollover === "boolean" && live.rollover !== catalog.rollover) parts.push(`rollover ${live.rollover ? "on" : "off"}, catalog says ${catalog.rollover ? "on" : "off"}`);
220
+ return parts.length > 0 ? parts.join("; ") : void 0;
221
+ }
222
+ function existsOrDrift(kind, key, id, drifted, remedy) {
223
+ if (!drifted) return { action: "exists", kind, key, id };
224
+ return { action: "drift", kind, key, id, note: `${drifted} \u2014 ${remedy}` };
225
+ }
226
+ async function resolvePriceCurrency(catalog, client, log) {
227
+ if (catalog.currency) return catalog.currency.toLowerCase();
228
+ if (!catalog.plans && !catalog.packs) return void 0;
229
+ let organizations;
230
+ try {
231
+ organizations = await organizationsListOrganizations(client, { limit: 1 });
232
+ } catch {
233
+ organizations = void 0;
234
+ }
235
+ const organization = organizations?.ok ? organizations.value?.result.items[0] : void 0;
236
+ if (!organization) {
237
+ log.push({ action: "warn", kind: "currency", key: "provider default", note: "organization unreadable \u2014 set `currency` in the catalog to pin one" });
238
+ return void 0;
239
+ }
240
+ const currency = organization.defaultPresentmentCurrency;
241
+ log.push({ action: "exists", kind: "currency", key: currency, note: "organization default \u2014 set `currency` in the catalog to pin one" });
242
+ return currency;
243
+ }
244
+ function customFieldCreatePayload(key, field) {
245
+ const base = {
246
+ slug: field.slug ?? key,
247
+ name: field.name ?? key,
248
+ metadata: { managedBy: MANAGED_BY, key }
249
+ };
250
+ switch (field.type) {
251
+ case "select":
252
+ return { ...base, type: "select", properties: { options: field.options ?? [] } };
253
+ case "number":
254
+ return { ...base, type: "number", properties: {} };
255
+ case "checkbox":
256
+ return { ...base, type: "checkbox", properties: {} };
257
+ case "date":
258
+ return { ...base, type: "date", properties: {} };
259
+ default:
260
+ return { ...base, type: "text", properties: {} };
261
+ }
262
+ }
263
+
264
+ function giftProductKey(packKey) {
265
+ return `${packKey}-gift`;
266
+ }
267
+ function fixedPrices(product) {
268
+ const prices = product?.prices ?? [];
269
+ return prices.filter((price) => price.amountType === "fixed" && !price.isArchived && typeof price.priceAmount === "number").map((price) => ({ priceAmount: price.priceAmount, ...price.priceCurrency ? { priceCurrency: price.priceCurrency } : {} }));
270
+ }
271
+ function fixedPriceCreate(price) {
272
+ return { amountType: "fixed", priceAmount: price.priceAmount, ...price.priceCurrency ? { priceCurrency: price.priceCurrency } : {} };
273
+ }
274
+ function giftTwinPrices(live, pack, catalog) {
275
+ if (live.length === 0) return catalog;
276
+ const taxBehavior = pack.taxBehavior ? { taxBehavior: pack.taxBehavior } : {};
277
+ return live.map((price) => ({ ...fixedPriceCreate(price), ...taxBehavior }));
278
+ }
279
+ function showPrices(prices) {
280
+ if (prices.length === 0) return "unknown";
281
+ return prices.map((price) => [price.priceAmount, price.priceCurrency].filter((part) => part !== void 0).join(" ")).join(", ");
282
+ }
283
+ function samePrices(a, b) {
284
+ const key = (prices) => prices.map((price) => `${price.priceCurrency ?? ""}:${price.priceAmount}`).sort().join("|");
285
+ return key(a) === key(b);
286
+ }
287
+ async function addCurrencyPrices(client, product, wanted, key, { dryRun, log }) {
288
+ if (!product) return;
289
+ const missing = missingCurrencyPrices(product, wanted);
290
+ if (missing.length === 0) return;
291
+ const note = `adds its price in ${missing.map((price) => price.priceCurrency).join(", ")}`;
292
+ if (dryRun) {
293
+ log.push({ action: "would-update", kind: "product", key, id: product.id, note });
294
+ return;
295
+ }
296
+ const kept = (product.prices ?? []).filter((price) => price.id && !price.isArchived).map((price) => ({ id: price.id }));
297
+ const updated = await productsUpdate(client, { id: product.id, productUpdate: { prices: [...kept, ...missing] } });
298
+ if (!updated.ok) throw updated.error;
299
+ product.prices = updated.value.prices;
300
+ log.push({ action: "updated", kind: "product", key, id: product.id, note });
301
+ }
302
+ async function alignGiftTwinPrices(client, pack, twin, giftKey, { dryRun, log }) {
303
+ const twinPrices = fixedPrices(twin);
304
+ if (pack.length === 0 || samePrices(twinPrices, pack)) return;
305
+ const note = `priced ${showPrices(twinPrices)}, the pack is ${showPrices(pack)}`;
306
+ if (dryRun) {
307
+ log.push({ action: "would-update", kind: "product", key: giftKey, id: twin.id, note });
308
+ return;
309
+ }
310
+ const updated = await productsUpdate(client, { id: twin.id, productUpdate: { prices: pack.map(fixedPriceCreate) } });
311
+ if (!updated.ok) throw updated.error;
312
+ log.push({ action: "updated", kind: "product", key: giftKey, id: twin.id, note });
313
+ }
314
+ async function detachGiftTwinBenefits(client, twin, giftKey, { dryRun, log }) {
315
+ const count = twin.benefits?.length ?? 0;
316
+ if (count === 0) return;
317
+ const note = `carried ${count} benefit${count === 1 ? "" : "s"}; a gift product grants nothing`;
318
+ if (dryRun) {
319
+ log.push({ action: "would-update", kind: "product", key: giftKey, id: twin.id, note });
320
+ return;
321
+ }
322
+ const updated = await productsUpdateBenefits(client, { id: twin.id, productBenefitsUpdate: { benefits: [] } });
323
+ if (!updated.ok) throw updated.error;
324
+ log.push({ action: "updated", kind: "product", key: giftKey, id: twin.id, note });
325
+ }
326
+ async function alignGiftTwin(client, managedProducts, packKey, options) {
327
+ const giftKey = giftProductKey(packKey);
328
+ const twin = managedProducts.find((item) => isManaged(item.metadata, giftKey));
329
+ if (!twin) return;
330
+ const pack = fixedPrices(managedProducts.find((item) => isManaged(item.metadata, packKey)));
331
+ await alignGiftTwinPrices(client, pack, twin, giftKey, options);
332
+ await detachGiftTwinBenefits(client, twin, giftKey, options);
333
+ }
334
+ function moveGiftTwins(ids, catalog) {
335
+ const twins = new Map(Object.keys(catalog.packs ?? {}).map((pack) => [giftProductKey(pack), pack]));
336
+ const gifts = Object.entries(ids.products).flatMap(([key, id]) => twins.has(key) ? [[twins.get(key), id]] : []);
337
+ if (gifts.length === 0) return;
338
+ ids.gifts = Object.fromEntries(gifts);
339
+ ids.products = Object.fromEntries(Object.entries(ids.products).filter(([key]) => !twins.has(key)));
340
+ }
341
+
342
+ function planCreditKey(plan, interval, untaggedYearly = false) {
343
+ if (untaggedYearly) return interval === "year" ? `${plan}-credits` : `${plan}-credits-month`;
344
+ return interval === "month" ? `${plan}-credits` : `${plan}-credits-${interval}`;
345
+ }
346
+ function catalogKeys(catalog) {
347
+ return [catalog.meters, catalog.plans, catalog.packs, catalog.features, catalog.customFields].flatMap((entries) => Object.keys(entries ?? {}));
348
+ }
349
+ function recordFallbackCurrency(ids, catalog, currency) {
350
+ if (!currency) return;
351
+ const codes = new Set([
352
+ currency,
353
+ ...Object.values(catalog.plans ?? {}).flatMap((plan) => planPricesByCurrency(plan, currency).map(([code]) => code)),
354
+ ...Object.values(catalog.packs ?? {}).flatMap((pack) => packPricesByCurrency(pack, currency).map(([code]) => code))
355
+ ].filter((code) => code !== void 0));
356
+ if (codes.size > 1) ids.currency = currency;
357
+ }
358
+ function recordFreePlan(ids, key, plan) {
359
+ if (!plan.retired && isFreePlan(plan) && ids.plans?.[key]?.month) ids.free = key;
360
+ }
361
+ function fixedPricesOf(amounts, taxBehavior) {
362
+ return amounts.map(([code, amount]) => ({ amountType: "fixed", priceAmount: amount, ...code ? { priceCurrency: code } : {}, ...taxBehavior }));
363
+ }
364
+ function refuseDerivedKeyCollisions(catalog) {
365
+ const keys = new Set(catalogKeys(catalog));
366
+ const taken = Object.keys(catalog.packs ?? {}).map(giftProductKey).filter((key) => keys.has(key));
367
+ if (taken.length > 0) {
368
+ throw new Error(`[nuxt-backend] billing sync: ${taken.join(", ")} ${taken.length === 1 ? "is" : "are"} the key of a pack's gift product \u2014 rename the catalog entry.`);
369
+ }
370
+ const quotas = Object.keys(catalog.plans ?? {}).map(planQuotasKey).filter((key) => keys.has(key));
371
+ if (quotas.length > 0) {
372
+ throw new Error(`[nuxt-backend] billing sync: ${quotas.join(", ")} ${quotas.length === 1 ? "is" : "are"} the key of a plan's quotas benefit \u2014 rename the catalog entry.`);
373
+ }
374
+ }
375
+ async function syncBillingCatalog(catalog, options, client = new Polar(providerClientOptions({
376
+ accessToken: options.accessToken,
377
+ environment: options.environment
378
+ }))) {
379
+ const log = [];
380
+ const ids = { products: {}, meters: {} };
381
+ const { dryRun, adopt } = options;
382
+ refuseDerivedKeyCollisions(catalog);
383
+ refuseUnpricedPlans(catalog);
384
+ refuseInvalidPrices(catalog);
385
+ refuseInvalidGifts(catalog, new Set(catalogKeys(catalog)));
386
+ refuseInvalidQuotas(catalog);
387
+ refuseInvalidDiscounts(catalog);
388
+ const managedMeters = await listAllPages((page) => metersList(client, { metadata: { managedBy: MANAGED_BY }, limit: 100, page }));
389
+ const managedBenefits = await listAllPages((page) => benefitsList(client, { limit: 100, page }));
390
+ const managedProducts = await listAllPages((page) => productsList(client, { metadata: { managedBy: MANAGED_BY }, limit: 100, page }));
391
+ const managedCustomFields = catalog.customFields ? await listAllPages((page) => customFieldsList(client, { limit: 100, page })) : [];
392
+ const currency = await resolvePriceCurrency(catalog, client, log);
393
+ refuseMissingDefaultCurrency(catalog, currency);
394
+ refuseUnpricedDiscounts(catalog, currency);
395
+ recordFallbackCurrency(ids, catalog, currency);
396
+ for (const [key, meter] of Object.entries(catalog.meters ?? {})) {
397
+ const aggregation = meter.aggregation ?? "sum";
398
+ const property = aggregation === "sum" ? meter.property ?? "amount" : void 0;
399
+ const eventName = meter.eventName ?? key;
400
+ const record = (meterId) => {
401
+ ids.meters[key] = { meterId, eventName, ...property ? { property } : {} };
402
+ };
403
+ if (adopt[key]) {
404
+ record(adopt[key]);
405
+ log.push({ action: "adopted", kind: "meter", key, id: adopt[key] });
406
+ continue;
407
+ }
408
+ const existing = managedMeters.find((item) => isManaged(item.metadata, key));
409
+ if (existing) {
410
+ record(existing.id);
411
+ log.push(existsOrDrift(
412
+ "meter",
413
+ key,
414
+ existing.id,
415
+ describeMeterDrift(existing, { property, eventName }),
416
+ "spends will not count as the catalog expects; rename the catalog key to publish a new meter"
417
+ ));
418
+ continue;
419
+ }
420
+ if (dryRun) {
421
+ log.push({ action: "would-create", kind: "meter", key });
422
+ continue;
423
+ }
424
+ const created = await metersCreate(client, {
425
+ name: key,
426
+ filter: { conjunction: "and", clauses: [{ property: "name", operator: "eq", value: eventName }] },
427
+ aggregation: property ? { func: "sum", property } : { func: "count" },
428
+ metadata: { managedBy: MANAGED_BY, key }
429
+ });
430
+ if (!created.ok) throw created.error;
431
+ record(created.value.id);
432
+ log.push({ action: "created", kind: "meter", key, id: created.value.id });
433
+ }
434
+ const customFieldIdByKey = /* @__PURE__ */ new Map();
435
+ for (const [key, field] of Object.entries(catalog.customFields ?? {})) {
436
+ if (adopt[key]) {
437
+ customFieldIdByKey.set(key, adopt[key]);
438
+ log.push({ action: "adopted", kind: "custom-field", key, id: adopt[key] });
439
+ continue;
440
+ }
441
+ const existing = managedCustomFields.find((item) => isManaged(item.metadata, key));
442
+ if (existing) {
443
+ customFieldIdByKey.set(key, existing.id);
444
+ log.push({ action: "exists", kind: "custom-field", key, id: existing.id });
445
+ continue;
446
+ }
447
+ if (dryRun) {
448
+ log.push({ action: "would-create", kind: "custom-field", key });
449
+ continue;
450
+ }
451
+ const created = await customFieldsCreate(client, customFieldCreatePayload(key, field));
452
+ if (!created.ok) throw created.error;
453
+ customFieldIdByKey.set(key, created.value.id);
454
+ log.push({ action: "created", kind: "custom-field", key, id: created.value.id });
455
+ }
456
+ const attachCustomFields = (productKey, keys) => (keys ?? []).flatMap((fieldKey) => {
457
+ const customFieldId = customFieldIdByKey.get(fieldKey);
458
+ if (!customFieldId) {
459
+ if (!dryRun) log.push({ action: "warn", kind: "product", key: productKey, note: `custom field '${fieldKey}' is not in the catalog` });
460
+ return [];
461
+ }
462
+ return [{ customFieldId, required: catalog.customFields?.[fieldKey]?.required ?? false }];
463
+ });
464
+ const benefitIdByKey = /* @__PURE__ */ new Map();
465
+ const createdBenefits = /* @__PURE__ */ new Map();
466
+ const ensureBenefit = async (key, create, fallback) => {
467
+ const made = createdBenefits.get(key);
468
+ if (made) return made;
469
+ const existing = managedBenefits.find((item) => isManaged(item.metadata, key));
470
+ if (existing) {
471
+ benefitIdByKey.set(key, existing.id);
472
+ log.push(existsOrDrift(
473
+ "benefit",
474
+ key,
475
+ existing.id,
476
+ describeBenefitDrift(existing, create()),
477
+ "change the grant in the provider dashboard (new grants follow it) or put the catalog back"
478
+ ));
479
+ return existing.id;
480
+ }
481
+ if (dryRun) {
482
+ log.push({ action: "would-create", kind: "benefit", key });
483
+ return null;
484
+ }
485
+ let created = await benefitsCreate(client, create());
486
+ if (!created.ok && fallback) {
487
+ const retried = await benefitsCreate(client, fallback.payload());
488
+ if (retried.ok) {
489
+ log.push({ action: "warn", kind: "benefit", key, note: fallback.note });
490
+ created = retried;
491
+ }
492
+ }
493
+ if (!created.ok) throw created.error;
494
+ benefitIdByKey.set(key, created.value.id);
495
+ createdBenefits.set(key, created.value.id);
496
+ log.push({ action: "created", kind: "benefit", key, id: created.value.id });
497
+ return created.value.id;
498
+ };
499
+ for (const [key, feature] of Object.entries(catalog.features ?? {})) {
500
+ await ensureBenefit(
501
+ key,
502
+ () => ({
503
+ type: "feature_flag",
504
+ description: feature.description,
505
+ properties: {},
506
+ metadata: { managedBy: MANAGED_BY, key }
507
+ }),
508
+ {
509
+ payload: () => ({
510
+ type: "custom",
511
+ description: feature.description,
512
+ properties: { note: null },
513
+ metadata: { managedBy: MANAGED_BY, key }
514
+ }),
515
+ note: "the provider rejected the native feature-flag benefit \u2014 created a custom benefit instead"
516
+ }
517
+ );
518
+ }
519
+ const creditBenefitFor = async (benefitKey, grant, defaultRollover) => {
520
+ const meterIds = ids.meters[grant.meter];
521
+ if (!meterIds) {
522
+ log.push({ action: "warn", kind: "benefit", key: benefitKey, note: `meter '${grant.meter}' is not in the catalog` });
523
+ return null;
524
+ }
525
+ return ensureBenefit(benefitKey, () => ({
526
+ type: "meter_credit",
527
+ description: `${grant.units} credits`,
528
+ properties: { units: grant.units, rollover: grant.rollover ?? defaultRollover, meterId: meterIds.meterId },
529
+ metadata: { managedBy: MANAGED_BY, key: benefitKey }
530
+ }));
531
+ };
532
+ const ensureProduct = async (key, benefits, create, existing, record = (id) => {
533
+ ids.products[key] = id;
534
+ }) => {
535
+ if (adopt[key]) {
536
+ record(adopt[key]);
537
+ log.push({ action: "adopted", kind: "product", key, id: adopt[key], note: "benefits left as-is" });
538
+ return void 0;
539
+ }
540
+ if (existing) {
541
+ record(existing.id);
542
+ log.push(existsOrDrift(
543
+ "product",
544
+ key,
545
+ existing.id,
546
+ describeProductDrift(existing, create()),
547
+ "a created product is never rewritten; rename the catalog key to publish a new one"
548
+ ));
549
+ return existing;
550
+ }
551
+ if (dryRun) {
552
+ log.push({ action: "would-create", kind: "product", key });
553
+ return void 0;
554
+ }
555
+ const created = await productsCreate(client, create());
556
+ if (!created.ok) throw created.error;
557
+ record(created.value.id);
558
+ log.push({ action: "created", kind: "product", key, id: created.value.id });
559
+ const attach = benefits.filter((id) => id !== null);
560
+ if (attach.length > 0) {
561
+ const updated = await productsUpdateBenefits(client, { id: created.value.id, productBenefitsUpdate: { benefits: attach } });
562
+ if (!updated.ok) throw updated.error;
563
+ }
564
+ return void 0;
565
+ };
566
+ const pricesFor = (key, product, amounts) => {
567
+ const taxBehavior = product.taxBehavior ? { taxBehavior: product.taxBehavior } : {};
568
+ const priceCurrency = currency ? { priceCurrency: currency } : {};
569
+ const usage = "usage" in product ? product.usage ?? [] : [];
570
+ return [
571
+ ...fixedPricesOf(amounts, taxBehavior),
572
+ ...usage.flatMap((price) => {
573
+ if (!(price.meter in (catalog.meters ?? {}))) {
574
+ log.push({ action: "warn", kind: "product", key, note: `usage price meter '${price.meter}' is not in the catalog` });
575
+ return [];
576
+ }
577
+ const meterIds = ids.meters[price.meter];
578
+ if (!meterIds) return [];
579
+ return [{
580
+ amountType: "metered_unit",
581
+ meterId: meterIds.meterId,
582
+ unitAmount: price.unitAmount,
583
+ ...price.cap === void 0 ? {} : { capAmount: price.cap },
584
+ ...priceCurrency,
585
+ ...taxBehavior
586
+ }];
587
+ })
588
+ ];
589
+ };
590
+ const ensurePlanProduct = async (key, plan, interval, quotasId) => {
591
+ const productKey = planProductKey(key, interval);
592
+ const existing = findPlanProduct(managedProducts, key, interval);
593
+ const untaggedYearly = isUntaggedPlanProduct(findPlanProduct(managedProducts, key, "year"));
594
+ const benefits = [];
595
+ const monthly = interval === "year" && plan.meterCycle === "month";
596
+ const grantInterval = monthly ? "month" : interval;
597
+ const units = plan.credits ? planCreditUnits(plan.credits, grantInterval) : void 0;
598
+ if (plan.credits && units !== void 0) benefits.push(await creditBenefitFor(planCreditKey(key, grantInterval, untaggedYearly && !monthly), { ...plan.credits, units }, false));
599
+ for (const featureKey of plan.features ?? []) {
600
+ const id = benefitIdByKey.get(featureKey);
601
+ if (id) benefits.push(id);
602
+ else if (!dryRun) log.push({ action: "warn", kind: "product", key: productKey, note: `feature '${featureKey}' is not in the catalog` });
603
+ }
604
+ benefits.push(...planQuotasBenefits(key, productKey, quotasId, { adopt, log }));
605
+ const attachedCustomFields = attachCustomFields(productKey, plan.customFields);
606
+ const amounts = planPricesByCurrency(plan, currency).map(([code, byInterval]) => [code, byInterval[interval]]);
607
+ const prices = pricesFor(productKey, plan, amounts);
608
+ const trial = providerTrialOf(plan.trial);
609
+ const found = await ensureProduct(productKey, benefits, () => ({
610
+ name: plan.name,
611
+ description: plan.description,
612
+ recurringInterval: interval,
613
+ prices,
614
+ // A trial is interval + count; the provider defaults the count to 1.
615
+ // A reverse trial is a pass the package starts, so the product has none.
616
+ ...trial ? { trialInterval: trial.interval, trialIntervalCount: trial.count ?? 1 } : {},
617
+ // The meter cycle is set once, as the product is made: the provider never changes it.
618
+ ...monthly ? { meterInterval: "month", meterIntervalCount: 1 } : {},
619
+ ...attachedCustomFields.length > 0 ? { attachedCustomFields } : {},
620
+ metadata: { managedBy: MANAGED_BY, key, interval }
621
+ }), existing, (id) => recordPlanProduct(ids, key, interval, id));
622
+ if (!found) return;
623
+ if (amounts.length > 1) await addCurrencyPrices(client, found, prices, productKey, { dryRun, log });
624
+ await pushPlanTrial(client, found, productKey, trial, { dryRun, log });
625
+ await attachPlanQuotas(client, found, productKey, quotasId, { dryRun, log });
626
+ };
627
+ const quotasByPlan = /* @__PURE__ */ new Map();
628
+ for (const [key, plan] of Object.entries(catalog.plans ?? {})) {
629
+ const quotasId = await ensurePlanQuotas(client, managedBenefits, key, plan, { dryRun, log });
630
+ quotasByPlan.set(key, quotasId);
631
+ if (plan.retired) {
632
+ await retirePlan(client, managedProducts, key, pricedIntervals(plan), { dryRun, log, ids, adopt });
633
+ await attachRetiredPlanQuotas(client, managedProducts, key, quotasId, { dryRun, log, adopt });
634
+ } else for (const interval of pricedIntervals(plan)) await ensurePlanProduct(key, plan, interval, quotasId);
635
+ recordFreePlan(ids, key, plan);
636
+ }
637
+ recordQuotaKeys(ids, catalog);
638
+ const ensureGiftTwin = async (key, pack, prices) => {
639
+ const giftKey = giftProductKey(key);
640
+ const giftPrices = giftTwinPrices(fixedPrices(managedProducts.find((item) => isManaged(item.metadata, key))), pack, prices);
641
+ await ensureProduct(giftKey, [], () => ({
642
+ name: `${pack.name} (gift)`,
643
+ description: pack.description,
644
+ recurringInterval: null,
645
+ prices: giftPrices,
646
+ visibility: "private",
647
+ metadata: { managedBy: MANAGED_BY, key: giftKey, giftOf: key }
648
+ }), managedProducts.find((item) => isManaged(item.metadata, giftKey)));
649
+ await alignGiftTwin(client, managedProducts, key, { dryRun, log });
650
+ };
651
+ for (const [key, pack] of Object.entries(catalog.packs ?? {})) {
652
+ if (pack.credits.rollover === false) {
653
+ log.push({ action: "warn", kind: "product", key, note: "rollover is off: unspent credits from this pack lapse at the customer's next billing cycle, and pricing compares no per-credit price for it" });
654
+ }
655
+ const benefit = await creditBenefitFor(`${key}-credits`, pack.credits, true);
656
+ const attachedCustomFields = attachCustomFields(key, pack.customFields);
657
+ const amounts = packPricesByCurrency(pack, currency);
658
+ const prices = pricesFor(key, pack, amounts);
659
+ const found = await ensureProduct(key, [benefit], () => ({
660
+ name: pack.name,
661
+ description: pack.description,
662
+ recurringInterval: null,
663
+ prices,
664
+ ...attachedCustomFields.length > 0 ? { attachedCustomFields } : {},
665
+ metadata: { managedBy: MANAGED_BY, key }
666
+ }), managedProducts.find((item) => isManaged(item.metadata, key)));
667
+ if (amounts.length > 1) await addCurrencyPrices(client, found, prices, key, { dryRun, log });
668
+ await ensureGiftTwin(key, pack, prices);
669
+ }
670
+ moveGiftTwins(ids, catalog);
671
+ await syncPassProducts(catalog, {
672
+ client,
673
+ ids,
674
+ managedProducts,
675
+ ensureProduct,
676
+ creditBenefitFor,
677
+ benefitIdByKey,
678
+ quotasByPlan,
679
+ planCreditKey,
680
+ price: (amounts, plan) => fixedPricesOf(amounts, plan.taxBehavior ? { taxBehavior: plan.taxBehavior } : {}),
681
+ currency,
682
+ adopt,
683
+ dryRun,
684
+ log
685
+ });
686
+ const packKeys = Object.keys(catalog.packs ?? {}).filter((key) => key in ids.products);
687
+ if (packKeys.length > 0) ids.packs = packKeys;
688
+ if (catalog.discounts) {
689
+ await syncDiscounts(catalog, {
690
+ client,
691
+ limitTarget: { environment: options.environment, accessToken: options.accessToken },
692
+ ids,
693
+ currency,
694
+ dryRun,
695
+ adopt,
696
+ log
697
+ });
698
+ }
699
+ const knownKeys = /* @__PURE__ */ new Set([
700
+ ...catalogKeys(catalog),
701
+ ...Object.keys(catalog.plans ?? {}).flatMap((key) => [planCreditKey(key, "month"), planCreditKey(key, "year"), planCreditKey(key, "month", true)]),
702
+ // A plan that drops its quotas leaves its quotas benefit attached: drift.
703
+ ...planQuotasKeys(catalog),
704
+ ...Object.keys(catalog.packs ?? {}).map((key) => `${key}-credits`),
705
+ ...Object.keys(catalog.packs ?? {}).map(giftProductKey),
706
+ ...derivedPassKeys(catalog)
707
+ ]);
708
+ const droppedQuotas = new Set(droppedQuotasKeys(catalog));
709
+ log.push(...unpricedPlanProducts(catalog, managedProducts));
710
+ for (const [kind, items] of [["meter", managedMeters], ["product", managedProducts], ["benefit", managedBenefits], ["custom-field", managedCustomFields]]) {
711
+ for (const item of items) {
712
+ const metadata = item.metadata;
713
+ if (metadata?.managedBy !== MANAGED_BY) continue;
714
+ const key = typeof metadata.key === "string" ? metadata.key : "";
715
+ if (key && !knownKeys.has(key)) {
716
+ const note = droppedQuotas.has(key) ? "its plan sets no quotas now: emptied above, and still attached to the plan's products until you detach it in the provider dashboard" : "managed remotely but no longer in the catalog (never deleted automatically)";
717
+ log.push({ action: "drift", kind, key, id: item.id, note });
718
+ }
719
+ }
720
+ }
721
+ const webhook = options.webhookUrl ? await ensureWebhookEndpoint(client, options.webhookUrl, options, log) : void 0;
722
+ return { log, ids, ...webhook ? { webhook } : {} };
723
+ }
724
+ async function ensureWebhookEndpoint(client, url, { dryRun, webhookBlocked }, log) {
725
+ const endpoints = await listAllPages((page) => webhooksListWebhookEndpoints(client, { limit: 100, page }));
726
+ const existing = endpoints.find((endpoint) => endpoint.url === url);
727
+ if (existing) {
728
+ const disabled = existing.enabled === false ? { note: "disabled at the provider \u2014 it receives nothing until it is enabled again" } : {};
729
+ log.push({ action: "exists", kind: "webhook", key: url, id: existing.id, ...disabled });
730
+ return dryRun ? void 0 : { id: existing.id, secret: existing.secret || void 0, created: false };
731
+ }
732
+ if (webhookBlocked) {
733
+ log.push({ action: "warn", kind: "webhook", key: url, note: webhookBlocked });
734
+ return void 0;
735
+ }
736
+ if (dryRun) {
737
+ log.push({ action: "would-create", kind: "webhook", key: url });
738
+ return void 0;
739
+ }
740
+ const created = await webhooksCreateWebhookEndpoint(client, { url, format: "raw", events: [...BILLING_WEBHOOK_PROVISION_EVENTS] });
741
+ if (!created.ok) throw created.error;
742
+ log.push({ action: "created", kind: "webhook", key: url, id: created.value.id });
743
+ return { id: created.value.id, secret: created.value.secret, created: true };
744
+ }
745
+
746
+ function parseAdopt(raw) {
747
+ const adopt = {};
748
+ for (const pair of (raw ?? "").split(",").filter(Boolean)) {
749
+ const [key, id] = pair.split("=");
750
+ if (key && id) adopt[key.trim()] = id.trim();
751
+ }
752
+ return adopt;
753
+ }
754
+ function deployKeyRefusal$1(type, prod, deployed) {
755
+ if (type === null) return null;
756
+ const reachesProduction = type === "prod" || type === "project";
757
+ if (prod && !reachesProduction) {
758
+ return `--env production refused: CONVEX_DEPLOY_KEY is a ${type} deployment key, so the webhook secret would land on that deployment instead of production. Use the production deploy key.`;
759
+ }
760
+ if (!prod && reachesProduction && !(type === "prod" && deployed === "sandbox")) {
761
+ return type === "prod" ? "Sandbox sync refused: CONVEX_DEPLOY_KEY is a production deploy key, and the Convex CLI follows it whatever the flags say \u2014 the sandbox webhook secret would replace production's. Unset it for a sandbox sync, or sync production with --env production. (A demo or staging deployment whose BACKEND_ENVIRONMENT is sandbox takes a sandbox sync with its own production key.)" : "Sandbox sync refused: CONVEX_DEPLOY_KEY is a project deploy key, so the Convex CLI would write the deployment that key selects, not the dev deployment .env.local names. Unset it for a sandbox sync, or sync production with --env production.";
762
+ }
763
+ return null;
764
+ }
765
+ function resolveSyncEnvironment(options, deployed) {
766
+ const environment = options.environment || billingEnvironment(deployed ?? void 0);
767
+ if (environment === "sandbox" || environment === "production") return { environment };
768
+ return { refusal: `Unknown billing environment '${environment}' \u2014 use sandbox or production.` };
769
+ }
770
+ async function resolveSyncInputs(rootDir, options, deps) {
771
+ const localEnv = readEnvFiles(rootDir);
772
+ const keyType = deployKeyType({ ...localEnv, ...process.env });
773
+ const needsDeployment = !options.environment || options.environment === "sandbox" && keyType === "prod";
774
+ const deployed = needsDeployment ? await (deps.readEnvironment ?? ((dir) => deploymentBackendEnvironment(dir)))(rootDir) : null;
775
+ const target = resolveSyncEnvironment(options, deployed);
776
+ if ("refusal" in target) return target;
777
+ const { environment } = target;
778
+ const prod = environment === "production" || options.production === true;
779
+ const keyRefusal = deployKeyRefusal$1(keyType, prod, deployed);
780
+ if (keyRefusal) return { refusal: keyRefusal };
781
+ const accessToken = options.accessToken || process.env.BILLING_ACCESS_TOKEN || localEnv.BILLING_ACCESS_TOKEN;
782
+ if (!accessToken) {
783
+ return { refusal: "BILLING_ACCESS_TOKEN is not set (env or .env.local) \u2014 create an organization access token in the provider dashboard." };
784
+ }
785
+ const loaded = await loadCatalog(rootDir);
786
+ if (!loaded) {
787
+ return { refusal: "No billing.catalog.ts found \u2014 run `npx nuxt-backend init` (or create backend/billing.catalog.ts) first." };
788
+ }
789
+ const unreadable = await loadGenerated(rootDir).then(() => null, (error) => error.message);
790
+ if (unreadable) return { refusal: unreadable };
791
+ return { environment, prod, accessToken, catalog: loaded.catalog, adopt: parseAdopt(options.adopt), localEnv };
792
+ }
793
+ async function writeGenerated(rootDir, environment, ids, print) {
794
+ const generated = await loadGenerated(rootDir);
795
+ generated[environment] = ids;
796
+ const path = join(rootDir, resolveFunctionsDir(rootDir), "billing.generated.ts");
797
+ const text = renderGenerated(generated);
798
+ if (readTextIfPresent(path) === text) {
799
+ print(`[nuxt-backend] ${path} holds these ids already.`);
800
+ return null;
801
+ }
802
+ writeFileSync(path, text);
803
+ print(`[nuxt-backend] Wrote ${path}: commit it, and push the backend for the deployment to read it.`);
804
+ return path;
805
+ }
806
+ function webhookSyncOptions(plan, { force, where }) {
807
+ if (!("url" in plan)) return {};
808
+ if (!plan.secretSet || force) return { webhookUrl: plan.url };
809
+ return {
810
+ webhookUrl: plan.url,
811
+ webhookBlocked: `not created: ${where} already holds a BILLING_WEBHOOK_SECRET, which a new endpoint's secret would replace \u2014 run again with --force to create it and store its secret`
812
+ };
813
+ }
814
+ async function settleWebhook(rootDir, plan, { result, dryRun, ...context }, deps, print) {
815
+ if ("skip" in plan) {
816
+ print(`[nuxt-backend] ${plan.skip}`);
817
+ return { url: null, action: "skipped", secret: "none", note: plan.skip };
818
+ }
819
+ const entry = result.log.find((item) => item.kind === "webhook");
820
+ if (entry?.action === "warn") return { url: plan.url, action: "skipped", secret: "kept", note: entry.note ?? "" };
821
+ if (dryRun) return { url: plan.url, action: entry?.action === "exists" ? "exists" : "would-create", secret: "none" };
822
+ if (!result.webhook) return { url: plan.url, action: "skipped", secret: "none", note: "the provider sync reported no endpoint" };
823
+ return storeEndpointSecret(rootDir, plan, result.webhook, context, deps, print);
824
+ }
825
+ async function storeEndpointSecret(rootDir, plan, endpoint, { force, prod, where }, deps, print) {
826
+ const { url } = plan;
827
+ const action = endpoint.created ? "created" : "exists";
828
+ if (!endpoint.created && plan.secretSet && !force) {
829
+ const note2 = `kept the BILLING_WEBHOOK_SECRET already on ${where} (--force replaces it with this endpoint's)`;
830
+ print(`[nuxt-backend] Webhook endpoint exists; ${note2}.`);
831
+ return { url, action, secret: "kept", note: note2 };
832
+ }
833
+ const error = endpoint.secret ? await setWebhookSecret(rootDir, endpoint.secret, prod, deps) : "the provider did not report it";
834
+ if (error === null) {
835
+ print(`[nuxt-backend] ${storedLine(endpoint.created, plan.secretSet, where)}`);
836
+ return { url, action, secret: "stored" };
837
+ }
838
+ const setByHand = `\`npx convex env set${prod ? " --prod" : ""} BILLING_WEBHOOK_SECRET\` asks for it \u2014 copy it from the provider dashboard (Webhooks \u2192 the endpoint)`;
839
+ const note = `its secret could not be stored on ${where} (${error}). Run billing sync again once that is fixed \u2014 it finds the endpoint and stores the secret \u2014 or set it yourself: ${setByHand}`;
840
+ print(`[nuxt-backend] Webhook endpoint ${endpoint.created ? "created" : "found"}, but ${note}.`);
841
+ return { url, action, secret: "not-stored", note };
842
+ }
843
+ function storedLine(created, replaced, where) {
844
+ if (created) return `Stored the new endpoint's secret on ${where} as BILLING_WEBHOOK_SECRET.`;
845
+ return replaced ? `Replaced BILLING_WEBHOOK_SECRET on ${where} with the endpoint's secret (--force).` : `Stored the existing endpoint's secret on ${where} as BILLING_WEBHOOK_SECRET, which it lacked.`;
846
+ }
847
+ async function setWebhookSecret(rootDir, secret, prod, { setEnv }) {
848
+ const [outcome] = await executeEnvPush(rootDir, [{ name: "BILLING_WEBHOOK_SECRET", action: "update", detail: "the webhook endpoint billing sync provisioned", value: secret }], { prod, ...setEnv ? { setEnv } : {} });
849
+ return outcome?.outcome === "set" ? null : outcome?.error ?? "unknown error";
850
+ }
851
+ async function refreshProducts(rootDir, context, deps, print) {
852
+ const { deployment, environment, prod, where } = context;
853
+ const blocker = productsRefreshBlocker(deployment, environment, prod);
854
+ if (blocker) {
855
+ print(`[nuxt-backend] Products not loaded: ${blocker}`);
856
+ return { status: "skipped", note: blocker };
857
+ }
858
+ try {
859
+ await (deps.syncProducts ?? ((dir, onProd) => runConvex(dir, ["run", ...deploymentFlags({ prod: onProd }), "billing:syncProducts"], { timeout: 12e4 }).then(() => {
860
+ })))(rootDir, prod);
861
+ print(`[nuxt-backend] Loaded the products on ${where} (billing:syncProducts).`);
862
+ return { status: "synced" };
863
+ } catch (error) {
864
+ const note = `billing:syncProducts failed on ${where} (${error instanceof Error ? error.message : String(error)}). Run it again once that is fixed: npx convex run${prod ? " --prod" : ""} billing:syncProducts`;
865
+ print(`[nuxt-backend] ${note}`);
866
+ return { status: "failed", note };
867
+ }
868
+ }
869
+ async function resolveSyncTarget(rootDir, options, deps) {
870
+ const inputs = await resolveSyncInputs(rootDir, options, deps);
871
+ if ("refusal" in inputs) return inputs;
872
+ const { prod, localEnv } = inputs;
873
+ const deployment = await (deps.readDeployment ?? readSyncDeployment)(rootDir, prod);
874
+ const plan = planWebhook(options.webhook, { prod, deployment, env: prod ? process.env : { ...localEnv, ...process.env } });
875
+ return "refusal" in plan ? plan : { inputs, deployment, plan };
876
+ }
877
+ async function runBillingSync(rootDir, options, deps = {}) {
878
+ const print = deps.print ?? ((line) => console.log(line));
879
+ const target = await resolveSyncTarget(rootDir, options, deps);
880
+ if ("refusal" in target) {
881
+ console.error(`[nuxt-backend] ${target.refusal}`);
882
+ return { exitCode: 1, report: null, refusal: target.refusal };
883
+ }
884
+ const { inputs: { environment, prod, accessToken, catalog, adopt }, deployment, plan } = target;
885
+ const dryRun = options.dryRun === true;
886
+ const context = { force: options.force === true, prod, where: deploymentLabel(deployment.url, prod) };
887
+ print(`[nuxt-backend] billing sync \u2192 ${environment} (${deployment.url ? context.where : "deployment not readable"})${dryRun ? " \u2014 dry run" : ""}`);
888
+ const result = await (deps.sync ?? syncBillingCatalog)(catalog, { rootDir, environment, accessToken, dryRun, adopt, ...webhookSyncOptions(plan, context) });
889
+ for (const entry of result.log) {
890
+ print(` ${entry.action.padEnd(12)} ${entry.kind.padEnd(8)} ${entry.key}${entry.id ? ` (${entry.id})` : ""}${entry.note ? ` \u2014 ${entry.note}` : ""}`);
891
+ }
892
+ const webhook = await settleWebhook(rootDir, plan, { ...context, result, dryRun }, deps, print);
893
+ const generated = dryRun ? null : await writeGenerated(rootDir, environment, result.ids, print);
894
+ const products = dryRun ? { status: "skipped", note: "dry run" } : await refreshProducts(rootDir, { deployment, environment, prod, where: context.where }, deps, print);
895
+ return {
896
+ exitCode: webhook.secret === "not-stored" ? 1 : 0,
897
+ report: { environment, dryRun, deployment: deployment.url, log: result.log, generated, webhook, products }
898
+ };
899
+ }
900
+ const billingSync = withContract("billing sync", {
901
+ sideEffects: ["writes provider accounts", "writes project files", "writes the dev deployment", "writes production"],
902
+ json: '{ environment, dryRun, deployment, log: [{ action, kind, key, id?, note? }], generated, webhook: { url, action: "created" | "exists" | "would-create" | "skipped", secret: "stored" | "kept" | "not-stored" | "none", note? }, products: { status: "synced" | "failed" | "skipped", note? } }',
903
+ exitCodes: {
904
+ 0: "Synced, or a dry run. A webhook or product step that could not run is reported, not fatal",
905
+ 1: "Refused or failed: unknown environment, no access token or catalog, a catalog plan still in the 0.1 shape (`interval` and `price`) or priced at no interval, an id map (`billing.generated.ts`) that does not load, a deploy key for the other kind of deployment, a production webhook URL that cannot be derived, a webhook URL on a deployment other than the one written, a provider error, or a webhook secret that belongs on the deployment and could not be stored"
906
+ }
907
+ }, defineCommand({
908
+ meta: { name: "sync", description: "Push backend/billing.catalog.ts \u2014 meters, custom fields, feature/credit benefits, plans (a product per monthly and yearly price, trials, usage prices, tax behaviour; retired plans archived) and packs \u2014 to the billing provider, store the webhook endpoint's secret on the deployment, write billing.generated.ts (find-or-create, never deletes; drift reported) and load the deployment's products. Sandbox writes the deployment .env.local names; production writes the production deployment" },
909
+ args: {
910
+ "cwd": { type: "string", description: "Project directory", default: "." },
911
+ "env": { type: "string", description: "Target environment: sandbox | production (default: the environment the deployment bills in, read from its BACKEND_ENVIRONMENT, else sandbox)" },
912
+ "dry-run": { type: "boolean", description: "Print the plan without creating anything", default: false },
913
+ "webhook": { type: "string", description: 'Provision the webhook endpoint at this URL (default: <site>/billing/events of the deployment written; pass "off" to skip)' },
914
+ "force": { type: "boolean", description: "Store the webhook endpoint's secret even over a BILLING_WEBHOOK_SECRET the deployment already holds", default: false },
915
+ "adopt": { type: "string", description: "Adopt existing objects (products, meters, custom fields): key=<id>[,key=<id>\u2026] \u2014 recorded as-is, benefits untouched" },
916
+ "json": { type: "boolean", description: "Print the outcome as one JSON document; progress goes to stderr", default: false }
917
+ },
918
+ async run({ args }) {
919
+ const { exitCode, report } = await runBillingSync(resolve(process.cwd(), args.cwd), {
920
+ ...args.env ? { environment: args.env } : {},
921
+ dryRun: args["dry-run"],
922
+ ...args.webhook ? { webhook: args.webhook } : {},
923
+ force: args.force,
924
+ ...args.adopt ? { adopt: args.adopt } : {}
925
+ }, { print: progress(args.json) });
926
+ if (args.json && report) console.log(JSON.stringify(report, null, 2));
927
+ if (exitCode !== 0) process.exitCode = exitCode;
928
+ }
929
+ }));
930
+ const billing = defineCommand({
931
+ meta: { name: "billing", description: "Billing catalog helpers" },
932
+ subCommands: { sync: billingSync }
933
+ });
934
+
935
+ const REPLAY_HINT = "Replay what the provider held back while it was off: the admin console's Webhooks tab, https://nuxt-backend.dev/docs/ship/operate/replay.";
936
+ async function readBilling(rootDir, prod) {
937
+ const catalog = (await loadCatalog(rootDir).catch(() => null))?.catalog;
938
+ const env = { ...readEnvFiles(rootDir), ...process.env };
939
+ const target = billingProviderTarget(env, prod);
940
+ if (!catalog || !target) return null;
941
+ const client = providerClient(target.accessToken, target.environment);
942
+ const plan = planWebhook(void 0, { prod, deployment: await readSyncDeployment(rootDir, prod), env: prod ? process.env : env });
943
+ const [organization, endpoint] = await Promise.all([readProviderOrganization(client), "url" in plan ? readProviderEndpoint(client, plan.url) : null]);
944
+ return { catalog, client, organization, endpoint };
945
+ }
946
+ async function confirmed(changes, confirm, report) {
947
+ const kept = [];
948
+ for (const change of changes) {
949
+ if (await confirm(change)) kept.push(change);
950
+ else report.skipped.push(change.key);
951
+ }
952
+ return kept;
953
+ }
954
+ async function fixBilling(rootDir, { prod, confirm, print, report, probe }) {
955
+ const read = await readBilling(rootDir, prod);
956
+ if (!read) return;
957
+ const { catalog, client, organization, endpoint } = read;
958
+ const off = endpoint !== null && !endpoint.enabled;
959
+ const routeHealthy = !off || (await probe(endpoint.url)).state === "mounted";
960
+ if (!routeHealthy) {
961
+ print(`[nuxt-backend] doctor --fix: the billing webhook endpoint stays off: its route does not answer the probe yet. Fix the route (doctor's billing-webhook-route), then run doctor --fix again.`);
962
+ }
963
+ const changes = [
964
+ ...organization ? planSettingChanges(catalog, organization) : [],
965
+ ...endpoint ? planEndpointChanges(endpoint, { routeHealthy }) : []
966
+ ];
967
+ const accepted = await confirmed(changes, confirm, report);
968
+ if (accepted.length === 0) return;
969
+ await applyProviderChanges(client, { organization, endpoint }, accepted);
970
+ for (const change of accepted) {
971
+ report.applied.push(change.key);
972
+ print(`[nuxt-backend] doctor --fix: billing provider: ${change.description}`);
973
+ }
974
+ if (accepted.some((change) => change.key === "webhook-enabled")) {
975
+ report.reenabled.push("billing");
976
+ print(`[nuxt-backend] ${REPLAY_HINT}`);
977
+ }
978
+ }
979
+ async function fixEmail(rootDir, { prod, confirm, print, report, probe, emailSync }) {
980
+ const read = await emailSync(rootDir, { prod, dryRun: true }).catch(() => null);
981
+ const url = read?.webhook.url;
982
+ if (!read || !url || read.webhook.enabled !== false) return;
983
+ if ((await probe(url)).state !== "mounted") {
984
+ print("[nuxt-backend] doctor --fix: the email webhook stays off: its route does not answer the probe yet. Fix the route (doctor's email-webhook-route), then run doctor --fix again.");
985
+ return;
986
+ }
987
+ const change = { description: `Turn the email webhook ${url} back on: its route answers the probe now.` };
988
+ if (!await confirm(change)) {
989
+ report.skipped.push("email-webhook-enabled");
990
+ return;
991
+ }
992
+ await emailSync(rootDir, { prod, enableWebhook: true });
993
+ report.applied.push("email-webhook-enabled");
994
+ report.reenabled.push("email");
995
+ print(`[nuxt-backend] doctor --fix: email provider: ${change.description}`);
996
+ print(`[nuxt-backend] ${REPLAY_HINT}`);
997
+ }
998
+ async function fixProviderSettings(rootDir, { prod, confirm, print, billing = true, email = true }, deps = {}) {
999
+ const report = { applied: [], skipped: [], reenabled: [] };
1000
+ const probe = deps.probe ?? probeWebhookRoute;
1001
+ const emailSync = deps.emailSync ?? runEmailSync;
1002
+ const steps = [
1003
+ ...billing ? [["billing", () => fixBilling(rootDir, { prod, confirm, print, report, probe })]] : [],
1004
+ ...email ? [["email", () => fixEmail(rootDir, { prod, confirm, print, report, probe, emailSync })]] : []
1005
+ ];
1006
+ for (const [provider, step] of steps) {
1007
+ try {
1008
+ await step();
1009
+ } catch (error) {
1010
+ print(`[nuxt-backend] doctor --fix: the ${provider} provider refused a change: ${error instanceof Error ? error.message : String(error)}`);
1011
+ }
1012
+ }
1013
+ if (report.skipped.length > 0) print(`[nuxt-backend] doctor --fix: left as they are (not confirmed): ${report.skipped.join(", ")}.`);
1014
+ return report;
1015
+ }
1016
+ function changeConfirmation({ yes, interactive, ask, print }) {
1017
+ return async ({ description }) => {
1018
+ if (yes) return true;
1019
+ if (!interactive) {
1020
+ print(`[nuxt-backend] doctor --fix: would ${description.charAt(0).toLowerCase()}${description.slice(1)} Run at a terminal to confirm it, or pass --yes.`);
1021
+ return false;
1022
+ }
1023
+ return /^y(?:es)?$/i.test((await ask(`${description} Apply? [y/N] `)).trim());
1024
+ };
1025
+ }
1026
+
1027
+ const AUTH_SECRET_WINDOW_MS = 30 * 24 * 60 * 60 * 1e3;
1028
+ const ENTRY = /^(\d{1,12}):(\S.*)$/;
1029
+ function parseAuthSecret(raw) {
1030
+ const value = raw?.trim();
1031
+ if (!value) return null;
1032
+ const parts = value.split(",").map((part) => part.trim());
1033
+ const matched = parts.map((part) => ENTRY.exec(part));
1034
+ if (parts.length === 0 || matched.some((match) => !match)) return { current: value, previous: [], entries: null };
1035
+ const entries = matched.map((match) => ({ version: Number(match[1]), value: match[2].trim() }));
1036
+ if (new Set(entries.map((entry) => entry.version)).size !== entries.length) return { current: value, previous: [], entries: null };
1037
+ return { current: entries[0].value, previous: entries.slice(1).map((entry) => entry.value), entries };
1038
+ }
1039
+ function formatAuthSecret(entries) {
1040
+ return entries.map((entry) => `${entry.version}:${entry.value}`).join(",");
1041
+ }
1042
+ function retirementDue(secrets, now, windowMs = AUTH_SECRET_WINDOW_MS) {
1043
+ const started = secrets.entries?.[0]?.version;
1044
+ return started === void 0 || started * 1e3 + windowMs <= now;
1045
+ }
1046
+
1047
+ function parseSecretList(raw) {
1048
+ return (raw ?? "").split(",").map((entry) => entry.trim()).filter(Boolean);
1049
+ }
1050
+
1051
+ const ROTATED_SECRETS = ["AUTH_SECRET", "EMAIL_WEBHOOK_SECRET", "BILLING_WEBHOOK_SECRET"];
1052
+ const GUIDED_ELSEWHERE = {
1053
+ PROTECTION_PROOF_SECRET: "`new,old` on the deployment, then the new value in the app's env and a redeploy of the app, then the new value alone on the deployment: https://nuxt-backend.dev/docs/ship/security/secrets#what-rotates-and-how",
1054
+ PUSH_PUBLIC_KEY: "only after a leak: a new key pair ends every push subscription. https://nuxt-backend.dev/docs/ship/security/secrets#what-rotates-and-how",
1055
+ PUSH_PRIVATE_KEY: "only after a leak: a new key pair ends every push subscription. https://nuxt-backend.dev/docs/ship/security/secrets#what-rotates-and-how",
1056
+ BILLING_ACCESS_TOKEN: "a provider token: make a new one in the provider's dashboard, `env push --force BILLING_ACCESS_TOKEN`, then revoke the old one.",
1057
+ EMAIL_API_KEY: "a provider token: make a new one in the provider's dashboard, `env push --force EMAIL_API_KEY`, then revoke the old one.",
1058
+ AI_GATEWAY_API_KEY: "a provider token: make a new one in the provider's dashboard, `env push --force AI_GATEWAY_API_KEY`, then revoke the old one."
1059
+ };
1060
+ async function deploymentValue(rootDir, name, prod) {
1061
+ const { stdout } = await runConvex(rootDir, ["env", "get", ...deploymentFlags({ prod }), name]);
1062
+ return stdout.trim() || null;
1063
+ }
1064
+ async function runKeys(rootDir, fn, prod) {
1065
+ const { stdout } = await runConvex(rootDir, ["run", ...deploymentFlags({ prod }), "--component", "backend", `keys:${fn}`, "{}"]);
1066
+ return JSON.parse(stdout);
1067
+ }
1068
+ async function staleInvites(rootDir, keyVersion, now, prod) {
1069
+ const { stdout } = await runConvex(rootDir, ["run", ...deploymentFlags({ prod }), "--component", "backend", "access:staleInvites", JSON.stringify({ keyVersion, now })]);
1070
+ return JSON.parse(stdout);
1071
+ }
1072
+ async function resetBillingSecret(rootDir, prod) {
1073
+ const env = { ...readEnvFiles(rootDir), ...process.env };
1074
+ const target = billingProviderTarget(env, prod);
1075
+ if (!target) return { refusal: `BILLING_ACCESS_TOKEN is not visible here${prod ? " (under --prod, only the process env speaks for production)" : ""}: the endpoint's secret is reset with it.` };
1076
+ const plan = planWebhook(void 0, { prod, deployment: await readSyncDeployment(rootDir, prod), env: prod ? process.env : env });
1077
+ if (!("url" in plan)) return { refusal: "skip" in plan ? plan.skip : plan.refusal };
1078
+ const client = providerClient(target.accessToken, target.environment);
1079
+ const endpoint = await readProviderEndpoint(client, plan.url);
1080
+ if (!endpoint) return { refusal: `The billing provider has no webhook endpoint at ${plan.url}. Run \`npx nuxt-backend billing sync${prod ? " --env production" : ""}\` to create it.` };
1081
+ const reset = await webhooksResetWebhookEndpointSecret(client, { id: endpoint.id });
1082
+ if (!reset.ok) throw reset.error;
1083
+ return { secret: reset.value.secret };
1084
+ }
1085
+ function versionAt(now) {
1086
+ return Math.floor(now / 1e3);
1087
+ }
1088
+ function authSteps(rootDir, { prod, dryRun }, deps, print, output) {
1089
+ const step = (entry) => {
1090
+ output.steps.push(entry);
1091
+ print(` ${entry.outcome.padEnd(8)} ${entry.step}${entry.note ? ` \u2014 ${entry.note}` : ""}`);
1092
+ };
1093
+ const keys = async (fn, description) => {
1094
+ if (dryRun) return step({ step: description, outcome: "planned" });
1095
+ const { expired = 0, removed = 0 } = await deps.runKeys(rootDir, fn, prod);
1096
+ step({ step: description, outcome: "done", note: fn === "rotate" ? `${expired} expired` : `${removed} removed` });
1097
+ };
1098
+ return {
1099
+ write: async (description, value) => {
1100
+ if (dryRun) return step({ step: description, outcome: "planned" });
1101
+ await deps.setEnv(rootDir, "AUTH_SECRET", value, prod);
1102
+ step({ step: description, outcome: "done" });
1103
+ },
1104
+ /**
1105
+ * Before a retirement: warn of the open invite codes and links still under
1106
+ * the older secret, which stop working with it. Read-only, so a dry run
1107
+ * counts too; a failed count warns that it could not and goes on.
1108
+ */
1109
+ countStaleInvites: async (keyVersion) => {
1110
+ const description = "count the open invite codes still hashed under the old AUTH_SECRET (access:staleInvites)";
1111
+ try {
1112
+ const { count, more } = await deps.staleInvites(rootDir, keyVersion, deps.now(), prod);
1113
+ const total = `${count}${more ? "+" : ""}`;
1114
+ step({ step: description, outcome: "done", note: `${total} open` });
1115
+ if (count > 0) print(` Warning: open invite codes or links still hashed under the old AUTH_SECRET: ${total}. Each one stops working when it retires, and its holder needs a new one.`);
1116
+ } catch {
1117
+ step({ step: description, outcome: "skipped", note: "the count failed" });
1118
+ print(" Warning: the open invite codes under the old AUTH_SECRET could not be counted. Any not used since the rotation stop working when it retires.");
1119
+ }
1120
+ },
1121
+ rotateKeys: () => keys("rotate", "expire the session signing keys (keys:rotate): the next token is signed with a new key, the old keys stay published"),
1122
+ retireKeys: () => keys("retire", "remove the session signing keys the rotation expired (keys:retire)")
1123
+ };
1124
+ }
1125
+ async function retirePrevious(current, steps, { retire, now }) {
1126
+ const signing = current.entries[0];
1127
+ if (!retire && !retirementDue(current, now)) {
1128
+ throw new RotateRefusal(`A rotation is under way: the previous AUTH_SECRET verifies until ${new Date(signing.version * 1e3 + AUTH_SECRET_WINDOW_MS).toISOString()}. Run \`env rotate AUTH_SECRET\` again then to retire it, or now with --retire.`);
1129
+ }
1130
+ await steps.countStaleInvites(signing.version);
1131
+ await steps.retireKeys();
1132
+ await steps.write("retire the previous AUTH_SECRET: the current one alone signs and verifies", formatAuthSecret([signing]));
1133
+ }
1134
+ async function rotateAuthSecret(rootDir, flags, deps, print) {
1135
+ const { prod, dryRun, retire } = flags;
1136
+ const output = { name: "AUTH_SECRET", deployment: prod ? "production" : "dev", dryRun, steps: [], state: "unchanged" };
1137
+ const current = parseAuthSecret(await deps.getEnv(rootDir, "AUTH_SECRET", prod));
1138
+ if (!current) throw new RotateRefusal(`AUTH_SECRET is not set on the ${prod ? "production " : ""}deployment: set one first (\`npx nuxt-backend env push${prod ? " --prod" : ""}\`).`);
1139
+ const steps = authSteps(rootDir, flags, deps, print, output);
1140
+ const now = deps.now();
1141
+ const finished = dryRun ? "rotating" : "rotated";
1142
+ if (current.previous.length > 0) {
1143
+ await retirePrevious(current, steps, { retire, now });
1144
+ return { ...output, state: finished };
1145
+ }
1146
+ const signing = { version: versionAt(now), value: deps.newSecret() };
1147
+ const kept = current.entries ? current.entries[0] : { version: 0, value: current.current };
1148
+ await steps.write("set a new AUTH_SECRET beside the old one: the new one signs, the old one still verifies", formatAuthSecret([signing, kept]));
1149
+ await steps.rotateKeys();
1150
+ if (retire) {
1151
+ await steps.countStaleInvites(signing.version);
1152
+ await steps.retireKeys();
1153
+ await steps.write("retire the old AUTH_SECRET at once (--retire): sessions and links it signed stop working", formatAuthSecret([signing]));
1154
+ return { ...output, state: finished };
1155
+ }
1156
+ const retiresAt = new Date(signing.version * 1e3 + AUTH_SECRET_WINDOW_MS).toISOString();
1157
+ print(` The old AUTH_SECRET verifies until ${retiresAt}. Run \`npx nuxt-backend env rotate AUTH_SECRET${prod ? " --prod" : ""}\` then to retire it.`);
1158
+ if (!prod && readEnvFiles(rootDir).AUTH_SECRET) {
1159
+ print(" .env.local still holds the old AUTH_SECRET: nothing pushes it over the deployment's, but `env push --force AUTH_SECRET` would. Remove it from .env.local, or leave --force alone.");
1160
+ }
1161
+ return { ...output, state: "rotating", retiresAt };
1162
+ }
1163
+ async function rotateEmailSecret(rootDir, { prod, dryRun }, deps, print) {
1164
+ const output = { name: "EMAIL_WEBHOOK_SECRET", deployment: prod ? "production" : "dev", dryRun, steps: [], state: "unchanged" };
1165
+ const report = await deps.emailSync(rootDir, { prod, dryRun, rotateWebhookSecret: true });
1166
+ if (!report) throw new RotateRefusal("The deployment has no email:syncEmail. Re-export it from backend/email.ts (`export const { syncEmail } = email.api`), then push the backend.");
1167
+ if (report.key !== "full") throw new RotateRefusal(report.key === "missing" ? "EMAIL_API_KEY is not set on the deployment." : "EMAIL_API_KEY may only send: rotating the webhook's secret needs a full-access key.");
1168
+ if (!report.webhook.url || report.webhook.action === "missing") throw new RotateRefusal("The email provider has no webhook for the deployment's /email/events. Run `npx nuxt-backend email sync` to create it.");
1169
+ const description = "rotate the webhook's signing secret at the email provider: it signs with the new and the old one for 24 hours";
1170
+ if (dryRun) {
1171
+ output.steps.push({ step: description, outcome: "planned" }, { step: "store the new secret on the deployment as EMAIL_WEBHOOK_SECRET", outcome: "planned" });
1172
+ } else {
1173
+ if (!report.webhook.secret) throw new RotateRefusal("The email provider did not return the new signing secret.");
1174
+ output.steps.push({ step: description, outcome: "done" });
1175
+ await deps.setEnv(rootDir, "EMAIL_WEBHOOK_SECRET", report.webhook.secret, prod);
1176
+ output.steps.push({ step: "store the new secret on the deployment as EMAIL_WEBHOOK_SECRET", outcome: "done" });
1177
+ output.state = "rotated";
1178
+ }
1179
+ for (const entry of output.steps) print(` ${entry.outcome.padEnd(8)} ${entry.step}`);
1180
+ return output;
1181
+ }
1182
+ async function rotateBillingSecret(rootDir, { prod, dryRun }, deps, print) {
1183
+ const output = { name: "BILLING_WEBHOOK_SECRET", deployment: prod ? "production" : "dev", dryRun, steps: [], state: "unchanged" };
1184
+ const step = (entry) => {
1185
+ output.steps.push(entry);
1186
+ print(` ${entry.outcome.padEnd(8)} ${entry.step}`);
1187
+ };
1188
+ const old = parseSecretList(await deps.getEnv(rootDir, "BILLING_WEBHOOK_SECRET", prod) ?? void 0)[0];
1189
+ if (!old) throw new RotateRefusal("BILLING_WEBHOOK_SECRET is not set on the deployment: `npx nuxt-backend billing sync` stores the endpoint's secret there.");
1190
+ const steps = [
1191
+ "reset the endpoint's secret at the billing provider: it signs with the new one at once",
1192
+ "write `new,old` as BILLING_WEBHOOK_SECRET: a delivery signed before the reset still verifies",
1193
+ "write the new secret alone as BILLING_WEBHOOK_SECRET"
1194
+ ];
1195
+ if (dryRun) {
1196
+ for (const description of steps) step({ step: description, outcome: "planned" });
1197
+ return output;
1198
+ }
1199
+ const reset = await deps.resetBillingSecret(rootDir, prod);
1200
+ if ("refusal" in reset) throw new RotateRefusal(reset.refusal);
1201
+ step({ step: steps[0], outcome: "done" });
1202
+ await deps.setEnv(rootDir, "BILLING_WEBHOOK_SECRET", `${reset.secret},${old}`, prod);
1203
+ step({ step: steps[1], outcome: "done", note: "a delivery refused in between is retried by the provider" });
1204
+ await deps.setEnv(rootDir, "BILLING_WEBHOOK_SECRET", reset.secret, prod);
1205
+ step({ step: steps[2], outcome: "done" });
1206
+ output.state = "rotated";
1207
+ return output;
1208
+ }
1209
+ class RotateRefusal extends Error {
1210
+ }
1211
+ function rotateRefusal(rootDir, name, prod) {
1212
+ if (!ROTATED_SECRETS.includes(name)) {
1213
+ const elsewhere = GUIDED_ELSEWHERE[name];
1214
+ return elsewhere ? `${name} keeps steps of its own: ${elsewhere}` : `${name} is no secret env rotate rotates. It takes ${ROTATED_SECRETS.join(", ")}.`;
1215
+ }
1216
+ return emailSyncRefusal(rootDir, prod);
1217
+ }
1218
+ function resolveDeps(deps) {
1219
+ return {
1220
+ getEnv: deps.getEnv ?? deploymentValue,
1221
+ setEnv: deps.setEnv ?? ((dir, envName, value, isProd) => setDeploymentEnv(dir, envName, value, { prod: isProd })),
1222
+ runKeys: deps.runKeys ?? runKeys,
1223
+ staleInvites: deps.staleInvites ?? staleInvites,
1224
+ emailSync: deps.emailSync ?? runEmailSync,
1225
+ resetBillingSecret: deps.resetBillingSecret ?? resetBillingSecret,
1226
+ newSecret: deps.newSecret ?? generateAuthSecret,
1227
+ now: deps.now ?? Date.now
1228
+ };
1229
+ }
1230
+ const ROTATIONS = {
1231
+ AUTH_SECRET: rotateAuthSecret,
1232
+ EMAIL_WEBHOOK_SECRET: rotateEmailSecret,
1233
+ BILLING_WEBHOOK_SECRET: rotateBillingSecret
1234
+ };
1235
+ async function runRotate(rootDir, name, options, print, deps = {}) {
1236
+ const prod = options.prod === true;
1237
+ const refusal = rotateRefusal(rootDir, name, prod);
1238
+ if (refusal) {
1239
+ print(`[nuxt-backend] env rotate refused: ${refusal}`);
1240
+ return { exitCode: 1, output: null };
1241
+ }
1242
+ const resolved = resolveDeps(deps);
1243
+ const flags = { prod, dryRun: options.dryRun === true, retire: options.retire === true };
1244
+ print(`[nuxt-backend] env rotate ${name} \u2192 ${prod ? "production" : "the dev deployment"}${flags.dryRun ? " \u2014 dry run" : ""}`);
1245
+ try {
1246
+ return { exitCode: 0, output: await ROTATIONS[name](rootDir, flags, resolved, print) };
1247
+ } catch (error) {
1248
+ print(`[nuxt-backend] env rotate ${error instanceof RotateRefusal ? "refused" : "failed"}: ${error instanceof Error ? error.message : String(error)}`);
1249
+ return { exitCode: 1, output: null };
1250
+ }
1251
+ }
1252
+ const envRotate = withContract("env rotate", {
1253
+ sideEffects: ["writes the dev deployment", "writes provider accounts"],
1254
+ byFlag: {
1255
+ "--prod": ["writes production"],
1256
+ "--dry-run": ["reads only"]
1257
+ },
1258
+ json: "`{ name, deployment, dryRun, steps: [{ step, outcome, note? }], state, retiresAt? }`: the steps it took and the secret's new state; values never appear",
1259
+ exitCodes: {
1260
+ 0: "rotated, or a dry run",
1261
+ 1: "refused, or a step failed"
1262
+ }
1263
+ }, defineCommand({
1264
+ meta: { name: "rotate", description: "Rotate AUTH_SECRET, EMAIL_WEBHOOK_SECRET or BILLING_WEBHOOK_SECRET with no downtime: the new value beside the old, then the old retired" },
1265
+ args: {
1266
+ "name": { type: "positional", description: "The secret: AUTH_SECRET, EMAIL_WEBHOOK_SECRET or BILLING_WEBHOOK_SECRET", required: true },
1267
+ "cwd": { type: "string", description: "Project directory", default: "." },
1268
+ "prod": { type: "boolean", description: "Rotate production's secret", default: false },
1269
+ "dry-run": { type: "boolean", description: "Print each step it would take, and change nothing", default: false },
1270
+ "retire": { type: "boolean", description: "AUTH_SECRET: retire the old value now, not after the 30-day window (after a leak)", default: false },
1271
+ "json": { type: "boolean", description: "Print the outcome as one JSON document; progress goes to stderr", default: false }
1272
+ },
1273
+ async run({ args }) {
1274
+ const { exitCode, output } = await runRotate(resolve(process.cwd(), args.cwd), String(args.name), { prod: args.prod, dryRun: args["dry-run"], retire: args.retire }, progress(args.json));
1275
+ if (args.json && output) console.log(JSON.stringify(output, null, 2));
1276
+ if (exitCode !== 0) process.exitCode = exitCode;
1277
+ }
1278
+ }));
1279
+
1280
+ const FLAG_OF_BUNDLE = {
1281
+ convex: "max-convex",
1282
+ client: "max-client",
1283
+ server: "max-server"
1284
+ };
1285
+ function readOptions(args) {
1286
+ const only = args.only;
1287
+ if (only !== void 0 && only !== "convex" && only !== "nuxt") return { refusal: `--only takes convex or nuxt, not "${only}".` };
1288
+ const halves = halvesOf(only);
1289
+ const limits = {};
1290
+ for (const bundle of Object.keys(FLAG_OF_BUNDLE)) {
1291
+ const given = args[FLAG_OF_BUNDLE[bundle]];
1292
+ if (given === void 0) continue;
1293
+ const bytes = parseSize(given);
1294
+ if (bytes === null) return { refusal: `${BUDGET_FLAGS[bundle]} takes a size such as 8MB or 350kB, not "${given}".` };
1295
+ const half = bundle === "convex" ? "convex" : "nuxt";
1296
+ if (!halves.includes(half)) return { refusal: `${BUDGET_FLAGS[bundle]} needs the ${half === "nuxt" ? "Nuxt build" : "Convex bundle"}: drop --only ${only}.` };
1297
+ limits[bundle] = bytes;
1298
+ }
1299
+ return { ...only ? { only } : {}, limits };
1300
+ }
1301
+ const analyze = withContract("analyze", {
1302
+ sideEffects: ["reads only"],
1303
+ json: "`{ version, ranAt, bundles: [{ id, title, bytes, gzipBytes, sourceMapBytes, parts, packages, shares, insights, notes }], budgets: [{ bundle, flag, limit, bytes, over, grew }], failures: [{ half, message }] }`: `id` is `convex`, `client` or `server`, and `bytes` is the code without source maps; progress goes to stderr",
1304
+ exitCodes: {
1305
+ 0: "measured, and within every budget given",
1306
+ 1: "a bundle is over its budget, `backend/_generated/` is missing, a build failed, or a flag was refused"
1307
+ }
1308
+ }, defineCommand({
1309
+ meta: { name: "analyze", description: "Measure the backend's Convex bundle and the Nuxt app's client and server bundles: the largest packages, the share nuxt-backend and your code bring, and the insights that would shrink them. --max-convex, --max-client and --max-server fail a bundle over its budget" },
1310
+ args: {
1311
+ "cwd": { type: "string", description: "Project directory", default: "." },
1312
+ "only": { type: "string", description: "Measure one half: convex (seconds, no Nuxt build) or nuxt" },
1313
+ "max-convex": { type: "string", description: "Fail when the Convex bundle's code, without source maps, is larger (8MB, 500kB)" },
1314
+ "max-client": { type: "string", description: "Fail when the Nuxt client bundle is larger" },
1315
+ "max-server": { type: "string", description: "Fail when the Nuxt server bundle is larger" },
1316
+ "json": { type: "boolean", description: "Print the report as one JSON document; progress goes to stderr", default: false }
1317
+ },
1318
+ async run({ args }) {
1319
+ const options = readOptions(args);
1320
+ if ("refusal" in options) {
1321
+ console.error(`[nuxt-backend] analyze refused: ${options.refusal}`);
1322
+ process.exitCode = 1;
1323
+ return;
1324
+ }
1325
+ const rootDir = resolve(process.cwd(), args.cwd);
1326
+ const print = progress(args.json);
1327
+ const report = await runAnalyze(rootDir, options, { print: (line) => console.error(line) });
1328
+ if (args.json) console.log(JSON.stringify(report, null, 2));
1329
+ else print(formatReport(report).join("\n"));
1330
+ const over = budgetFailures(report);
1331
+ for (const line of over) console.error(`[nuxt-backend] over budget: ${line}`);
1332
+ if (over.length > 0 || report.failures.length > 0) process.exitCode = 1;
1333
+ else if (!args.json && options.limits && Object.keys(options.limits).length > 0) {
1334
+ print(`[nuxt-backend] every bundle is within its budget (${Object.entries(options.limits).map(([bundle, bytes]) => `${bundle} ${formatSize(bytes)}`).join(", ")})`);
1335
+ }
1336
+ }
1337
+ }));
1338
+
1339
+ const BUILD_COMMAND = "npx convex deploy --cmd 'npm run build' --cmd-url-env-var-name NUXT_PUBLIC_BACKEND_URL";
1340
+ function isVercelLinked(rootDir) {
1341
+ return existsSync(join(rootDir, ".vercel", "project.json"));
1342
+ }
1343
+ function buildCommandAdvice(rootDir) {
1344
+ const path = join(rootDir, "vercel.json");
1345
+ let command;
1346
+ try {
1347
+ command = existsSync(path) ? JSON.parse(readFileSync(path, "utf8")).buildCommand : void 0;
1348
+ } catch {
1349
+ return "vercel.json does not parse: fix it, so the build command it holds can be read.";
1350
+ }
1351
+ if (typeof command === "string" && /convex deploy|nuxt-backend deploy --build/.test(command)) return null;
1352
+ return `Check the project's build command ships the backend first: ${BUILD_COMMAND} (Settings, Build and Deployment, or buildCommand in vercel.json).`;
1353
+ }
1354
+ function vercelEnvNames(listing) {
1355
+ return [...new Set(listing.split("\n").map((line) => line.trim().split(/\s+/)[0] ?? "").filter((name) => /^[A-Z_][A-Z0-9_]*$/.test(name)))];
1356
+ }
1357
+ class VercelCliError extends Error {
1358
+ }
1359
+ function runVercel(rootDir, args, input) {
1360
+ const windows = process.platform === "win32";
1361
+ return new Promise((resolve, reject) => {
1362
+ const child = spawn(windows ? "vercel.cmd" : "vercel", args, { cwd: rootDir, stdio: "pipe", shell: windows, windowsHide: true });
1363
+ let output = "";
1364
+ child.stdout.setEncoding("utf8").on("data", (chunk) => {
1365
+ output += chunk;
1366
+ });
1367
+ child.stderr.setEncoding("utf8").on("data", (chunk) => {
1368
+ output += chunk;
1369
+ });
1370
+ child.on("error", (error) => {
1371
+ reject(new VercelCliError(error.code === "ENOENT" ? "the Vercel CLI is not installed: npm i -g vercel, then vercel login" : `vercel ${args[0]} could not start (${error.code ?? "unknown error"})`));
1372
+ });
1373
+ child.on("close", (code) => {
1374
+ if (code === 0) return resolve(output);
1375
+ const tail = output.split("\n").map((line) => line.trim()).filter(Boolean).slice(-2).join(" ");
1376
+ reject(new VercelCliError(`vercel ${args.slice(0, 2).join(" ")} exited with code ${code}${tail ? `: ${tail}` : ""}`));
1377
+ });
1378
+ child.stdin.on("error", () => {
1379
+ });
1380
+ child.stdin.end(input);
1381
+ });
1382
+ }
1383
+ function deployHost(rootDir) {
1384
+ if (!isVercelLinked(rootDir)) {
1385
+ return { kind: "other", envNames: async () => null, addEnv: async () => {
1386
+ throw new VercelCliError("no Vercel project is linked");
1387
+ } };
1388
+ }
1389
+ return {
1390
+ kind: "vercel",
1391
+ envNames: () => runVercel(rootDir, ["env", "ls", "production"]).then(vercelEnvNames, () => null),
1392
+ addEnv: async (name, value) => {
1393
+ await runVercel(rootDir, ["env", "add", name, "production"], value);
1394
+ }
1395
+ };
1396
+ }
1397
+
1398
+ function generateSecret() {
1399
+ return randomBytes(32).toString("base64");
1400
+ }
1401
+ function productionOrigin(value) {
1402
+ if (!value) return null;
1403
+ try {
1404
+ const url = new URL(value.trim());
1405
+ return url.protocol === "https:" && !isLoopbackUrl(url.href) ? url.origin : null;
1406
+ } catch {
1407
+ return null;
1408
+ }
1409
+ }
1410
+ const LIGHT = { done: "\u2713", unchanged: "\xB7", planned: "\u2192", skipped: "\u2013", failed: "\u2717" };
1411
+ function formatStep(step) {
1412
+ return `${LIGHT[step.outcome]} ${step.capability.padEnd(10)} ${step.title}: ${step.detail}`;
1413
+ }
1414
+ function record(state, step) {
1415
+ state.steps.push(step);
1416
+ state.deps.print(formatStep(step));
1417
+ if (step.outcome === "failed" && ["deployment", "environment"].includes(step.id)) state.stopped = true;
1418
+ }
1419
+ async function write(state, name, value) {
1420
+ if (state.options.dryRun) return null;
1421
+ try {
1422
+ await state.deps.backend.setEnv(name, value);
1423
+ state.names.add(name);
1424
+ return null;
1425
+ } catch (error) {
1426
+ return error instanceof Error ? error.message : String(error);
1427
+ }
1428
+ }
1429
+ async function writeStep(state, base, name, value, detail) {
1430
+ if (state.options.dryRun) return record(state, { ...base, outcome: "planned", detail: `would set ${name}: ${detail}` });
1431
+ const error = await write(state, name, value);
1432
+ record(state, error ? { ...base, outcome: "failed", detail: error } : { ...base, outcome: "done", detail: `${name} ${detail}` });
1433
+ }
1434
+ const YES = /^y(?:es)?$/i;
1435
+ async function deploymentStep(state) {
1436
+ const base = { id: "deployment", capability: "data", title: "The deployment" };
1437
+ const { backend, env, ask } = state.deps;
1438
+ let names = await backend.envNames();
1439
+ if (names) {
1440
+ state.names = new Set(names);
1441
+ return record(state, { ...base, outcome: "unchanged", detail: "linked the project's production deployment" });
1442
+ }
1443
+ if (env.CONVEX_DEPLOY_KEY) {
1444
+ return record(state, { ...base, outcome: "failed", detail: "production does not answer with the CONVEX_DEPLOY_KEY in the shell: check the key, or unset it to use your Convex login." });
1445
+ }
1446
+ if (state.options.dryRun) {
1447
+ return record(state, { ...base, outcome: "planned", detail: "production does not answer: would ask, then create the project's production deployment (npx convex deployment create --type prod --default)" });
1448
+ }
1449
+ const create = ask && YES.test(await ask("Production does not answer. Create the project's production deployment, and make it the default? Say yes only when the project has none yet (y/N): "));
1450
+ if (!create) {
1451
+ return record(state, { ...base, outcome: "failed", detail: "production does not answer: check your Convex login (npx convex login) and the network, and run deploy again. When the project has no production deployment yet, run deploy at a terminal and say yes, or create it with npx convex deployment create --type prod --default." });
1452
+ }
1453
+ try {
1454
+ await backend.create();
1455
+ } catch (error) {
1456
+ return record(state, { ...base, outcome: "failed", detail: `could not create the production deployment (${error instanceof Error ? error.message : String(error)}). Sign in with npx convex login, link the project in this folder (npx nuxt-backend dev does once), and run deploy again.` });
1457
+ }
1458
+ names = await backend.envNames();
1459
+ if (!names) return record(state, { ...base, outcome: "failed", detail: "created the production deployment, and it does not answer yet: run deploy again." });
1460
+ state.names = new Set(names);
1461
+ record(state, { ...base, outcome: "done", detail: "created the project's production deployment" });
1462
+ }
1463
+ async function environmentStep(state) {
1464
+ const base = { id: "environment", capability: "data", title: "The environment" };
1465
+ const target = state.options.sandbox ? "sandbox" : "production";
1466
+ const current = state.names.has("BACKEND_ENVIRONMENT") ? await state.deps.backend.environment() : void 0;
1467
+ if (current === null) {
1468
+ return record(state, { ...base, outcome: "failed", detail: "BACKEND_ENVIRONMENT is set on production and its value could not be read. Set it yourself (npx convex env set --prod BACKEND_ENVIRONMENT production), then run deploy again." });
1469
+ }
1470
+ if (current === "sandbox" && target === "production") {
1471
+ state.environment = "sandbox";
1472
+ return record(state, { ...base, outcome: "unchanged", detail: "BACKEND_ENVIRONMENT stays sandbox: a demo or staging app. deploy never makes one live on its own; set production on it yourself to go live." });
1473
+ }
1474
+ state.environment = target;
1475
+ if (current === target) return record(state, { ...base, outcome: "unchanged", detail: `BACKEND_ENVIRONMENT is ${target}` });
1476
+ await writeStep(state, base, "BACKEND_ENVIRONMENT", target, `${current ?? "unset"} \u2192 ${target}`);
1477
+ }
1478
+ async function authSecretStep(state) {
1479
+ const base = { id: "auth-secret", capability: "auth", title: "The auth secret" };
1480
+ if (state.names.has("AUTH_SECRET")) return record(state, { ...base, outcome: "unchanged", detail: "AUTH_SECRET is set on production" });
1481
+ await writeStep(state, base, "AUTH_SECRET", generateSecret(), "generated for production");
1482
+ }
1483
+ async function siteUrlStep(state) {
1484
+ const base = { id: "site-url", capability: "auth", title: "The site URL" };
1485
+ if (state.names.has("SITE_URL")) return record(state, { ...base, outcome: "unchanged", detail: "SITE_URL is set on production" });
1486
+ const { env, ask } = state.deps;
1487
+ const given = env.SITE_URL || env.NUXT_SITE_URL || (env.VERCEL_PROJECT_PRODUCTION_URL ? `https://${env.VERCEL_PROJECT_PRODUCTION_URL}` : "") || (ask ? await ask("The app's public origin (SITE_URL), such as https://app.example.com: ") : "");
1488
+ if (!given) {
1489
+ return record(state, { ...base, outcome: "skipped", detail: "needs the app's public origin: run deploy at a terminal, or with SITE_URL=https://\u2026 in the shell. The backend push waits for it." });
1490
+ }
1491
+ const origin = productionOrigin(given);
1492
+ if (!origin) return record(state, { ...base, outcome: "failed", detail: `"${given}" is not an https origin off this machine, which production's SITE_URL must be.` });
1493
+ await writeStep(state, base, "SITE_URL", origin, origin);
1494
+ }
1495
+ const PROVIDER_KEYS = {
1496
+ BILLING_ACCESS_TOKEN: { id: "billing-token", capability: "billing", title: "The billing token", field: "billingToken", what: (sandbox) => `the ${sandbox ? "sandbox" : "production"} billing access token (an organization token from Polar's ${sandbox ? "sandbox" : "dashboard"})` },
1497
+ EMAIL_API_KEY: { id: "email-key", capability: "email", title: "The email key", field: "emailKey", what: () => "the email API key (a full-access key from Resend)" }
1498
+ };
1499
+ async function providerKeyStep(state, name) {
1500
+ const { id, capability, title, field, what } = PROVIDER_KEYS[name];
1501
+ const base = { id, capability, title };
1502
+ const set = state.names.has(name);
1503
+ const label = what(state.environment === "sandbox");
1504
+ const { env, ask } = state.deps;
1505
+ const value = env[name] || (ask ? await ask(`Paste ${label}${set ? " to sync with (production has one; Enter to skip)" : " (Enter to skip)"}: `, { secret: true }) : "");
1506
+ if (value) state[field] = value;
1507
+ if (set) return record(state, { ...base, outcome: "unchanged", detail: `${name} is set on production${value ? "" : `; the steps that call the provider need it here too: give it in the shell as ${name}, or at a terminal`}` });
1508
+ if (!value) return record(state, { ...base, outcome: "skipped", detail: `needs ${label}: in a terminal deploy asks for it; elsewhere set ${name} in the shell, and run deploy again` });
1509
+ await writeStep(state, base, name, value, "set on production");
1510
+ }
1511
+ async function protectionStep(state) {
1512
+ const base = { id: "protection-secret", capability: "protection", title: "The bot check's proof secret" };
1513
+ const { host } = state.deps;
1514
+ const deployed = state.names.has("PROTECTION_PROOF_SECRET");
1515
+ if (host.kind !== "vercel") {
1516
+ return record(state, { ...base, outcome: "skipped", detail: deployed ? "set on production; off Vercel nothing signs a proof, so set it on your host by hand or rely on the challenge keys" : "off Vercel nothing signs a proof: set the challenge keys instead (/docs/services/bot-protection)" });
1517
+ }
1518
+ if (state.hostNames === null) return record(state, { ...base, outcome: "skipped", detail: "the Vercel project's env could not be read (vercel env ls production): check your Vercel login and run deploy again" });
1519
+ const onHost = state.hostNames.includes("PROTECTION_PROOF_SECRET");
1520
+ if (deployed && onHost) return record(state, { ...base, outcome: "unchanged", detail: "PROTECTION_PROOF_SECRET is on production and in the app's env" });
1521
+ if (onHost) return record(state, { ...base, outcome: "skipped", detail: "the Vercel project holds one production lacks: remove it there (vercel env rm PROTECTION_PROOF_SECRET production), and run deploy again for a new pair" });
1522
+ if (state.options.dryRun) return record(state, { ...base, outcome: "planned", detail: "would generate PROTECTION_PROOF_SECRET for production and the app" });
1523
+ const secret = generateSecret();
1524
+ const error = await write(state, "PROTECTION_PROOF_SECRET", secret);
1525
+ if (error) return record(state, { ...base, outcome: "failed", detail: error });
1526
+ state.proofSecret = secret;
1527
+ record(state, { ...base, outcome: "done", detail: "PROTECTION_PROOF_SECRET generated and set on production; the app's half follows with its env" });
1528
+ }
1529
+ async function devInboxStep(state) {
1530
+ if (state.environment !== "sandbox") return;
1531
+ const base = { id: "dev-inbox", capability: "email", title: "The dev inbox" };
1532
+ if (state.names.has("EMAIL_DEV_INBOX")) return record(state, { ...base, outcome: "unchanged", detail: "EMAIL_DEV_INBOX is set on the sandbox" });
1533
+ await writeStep(state, base, "EMAIL_DEV_INBOX", "1", "set: the demo's pages read the sign-in codes of its test addresses");
1534
+ }
1535
+ async function backendStep(state) {
1536
+ const base = { id: "backend", capability: "data", title: "The backend" };
1537
+ const lacking = ["AUTH_SECRET", "SITE_URL"].filter((name) => !state.names.has(name));
1538
+ if (state.options.dryRun) return record(state, { ...base, outcome: "planned", detail: "would push backend/ to production (npx convex deploy)" });
1539
+ if (lacking.length > 0) return record(state, { ...base, outcome: "skipped", detail: `the push fails until production holds ${lacking.join(" and ")}` });
1540
+ const code = await state.deps.backend.push();
1541
+ state.url = await state.deps.backend.url();
1542
+ record(state, code === 0 ? { ...base, outcome: "done", detail: `pushed backend/ to ${state.url ?? "production"}` } : { ...base, outcome: "failed", detail: `npx convex deploy exited with code ${code}: its output above says why` });
1543
+ }
1544
+ function providerFailure(error, key) {
1545
+ const message = error instanceof Error ? error.message : String(error);
1546
+ return message.split(key).join("[redacted]").replace(/\s+/g, " ").trim();
1547
+ }
1548
+ async function billingStep(state) {
1549
+ const base = { id: "billing-catalog", capability: "billing", title: "The billing catalog" };
1550
+ if (!state.billingToken) {
1551
+ record(state, { ...base, outcome: "skipped", detail: "needs the billing access token here: give it at a terminal, or as BILLING_ACCESS_TOKEN in the shell" });
1552
+ return null;
1553
+ }
1554
+ const environment = state.environment === "sandbox" ? "sandbox" : "production";
1555
+ let synced;
1556
+ try {
1557
+ synced = await state.deps.billingSync({ environment, production: true, accessToken: state.billingToken, dryRun: state.options.dryRun });
1558
+ } catch (error) {
1559
+ record(state, { ...base, outcome: "failed", detail: `${providerFailure(error, state.billingToken)}: check the billing access token and the network, and run deploy again` });
1560
+ return null;
1561
+ }
1562
+ const { exitCode, report, refusal } = synced;
1563
+ if (!report) {
1564
+ record(state, { ...base, outcome: "failed", detail: refusal ?? "billing sync failed" });
1565
+ return null;
1566
+ }
1567
+ const detail = `synced to Polar's ${environment === "sandbox" ? "sandbox" : "production"}; webhook ${report.webhook.action}, secret ${report.webhook.secret}; products ${report.products.status}`;
1568
+ record(state, { ...base, outcome: exitCode !== 0 ? "failed" : state.options.dryRun ? "planned" : "done", detail: report.webhook.note ? `${detail} (${report.webhook.note})` : detail });
1569
+ return report.generated;
1570
+ }
1571
+ async function catalogIdsStep(state, generated) {
1572
+ if (!generated) return;
1573
+ const base = { id: "billing-ids", capability: "billing", title: "The catalog ids" };
1574
+ const commit = `Commit ${generated}: the app's next build pushes the backend from the repository.`;
1575
+ if (!state.steps.some((step) => step.id === "backend" && step.outcome === "done")) {
1576
+ return record(state, { ...base, outcome: "skipped", detail: `billing sync wrote new ids, and the backend was not pushed: the next push carries them. ${commit}` });
1577
+ }
1578
+ const code = await state.deps.backend.push();
1579
+ record(state, code === 0 ? { ...base, outcome: "done", detail: `billing sync wrote new ids: pushed the backend again, so production reads them. ${commit}` } : { ...base, outcome: "failed", detail: `billing sync wrote new ids, and npx convex deploy exited with code ${code}: run deploy again. ${commit}` });
1580
+ }
1581
+ async function emailEndpoint(state) {
1582
+ const url = state.url ?? (state.options.dryRun ? await state.deps.backend.url() : null);
1583
+ const site = state.deps.env.NUXT_PUBLIC_CONVEX_SITE_URL || (url ? siteFromCloudUrl(url) : null);
1584
+ return site ? `${site.replace(/\/+$/, "")}/email/events` : null;
1585
+ }
1586
+ async function storeEmailSecret(state, base, endpoint, result) {
1587
+ const secret = result.action === "created" || !state.names.has("EMAIL_WEBHOOK_SECRET") ? result.secret : void 0;
1588
+ const error = secret ? await write(state, "EMAIL_WEBHOOK_SECRET", secret) : null;
1589
+ const found = result.action === "created" ? "created" : "found";
1590
+ if (error) return record(state, { ...base, outcome: "failed", detail: `${found} the webhook at ${endpoint}, and its secret could not be stored: ${error}. Set it with npx convex env set --prod EMAIL_WEBHOOK_SECRET, which asks for it.` });
1591
+ record(state, { ...base, outcome: secret ? "done" : "unchanged", detail: `${found} the webhook at ${endpoint}; EMAIL_WEBHOOK_SECRET ${secret ? "stored" : "kept"} on production` });
1592
+ }
1593
+ async function emailWebhookStep(state) {
1594
+ const base = { id: "email-webhook", capability: "email", title: "The email webhook" };
1595
+ if (!state.emailKey) return record(state, { ...base, outcome: "skipped", detail: "needs the email API key here: give it at a terminal, or as EMAIL_API_KEY in the shell" });
1596
+ const endpoint = await emailEndpoint(state);
1597
+ if (!endpoint) return record(state, { ...base, outcome: "skipped", detail: "production's HTTP origin is not known yet: run deploy again once the backend is pushed, or set NUXT_PUBLIC_CONVEX_SITE_URL for a custom domain" });
1598
+ let result;
1599
+ try {
1600
+ result = await state.deps.emailWebhook(state.emailKey, endpoint, { dryRun: state.options.dryRun });
1601
+ } catch (error) {
1602
+ return record(state, { ...base, outcome: "failed", detail: `${error instanceof Error ? error.message : String(error)} (a key restricted to sending cannot manage webhooks)` });
1603
+ }
1604
+ if (state.options.dryRun) return record(state, { ...base, outcome: "planned", detail: `${result.action === "exists" ? "found" : "would create"} the webhook at ${endpoint}` });
1605
+ await storeEmailSecret(state, base, endpoint, result);
1606
+ }
1607
+ async function emailSyncStep(state) {
1608
+ const base = { id: "email-sync", capability: "email", title: "The email topics and flows" };
1609
+ if (!state.deps.emailSync) return record(state, { ...base, outcome: "skipped", detail: "not run here" });
1610
+ if (!state.emailKey && !state.names.has("EMAIL_API_KEY")) return record(state, { ...base, outcome: "skipped", detail: "needs the email API key on production" });
1611
+ let report;
1612
+ try {
1613
+ report = await state.deps.emailSync({ dryRun: state.options.dryRun });
1614
+ } catch (error) {
1615
+ return record(state, { ...base, outcome: "failed", detail: `${error instanceof Error ? error.message : String(error)}: run npx nuxt-backend email sync --prod` });
1616
+ }
1617
+ record(state, { ...base, ...emailSyncOutcome(report, state.options.dryRun) });
1618
+ }
1619
+ function emailSyncOutcome(report, dryRun) {
1620
+ if (!report) return { outcome: "skipped", detail: "production has no email:syncEmail: backend/email.ts predates 0.2.0 (npx nuxt-backend upgrade)" };
1621
+ if (report.key !== "full") return { outcome: "failed", detail: report.key === "missing" ? "EMAIL_API_KEY is not set on production" : "EMAIL_API_KEY may only send: topics, segments and flows need a full-access key" };
1622
+ const changed = report.log.filter((entry) => entry.action !== "exists").map((entry) => `${entry.kind} ${entry.key}`);
1623
+ if (dryRun) return { outcome: "planned", detail: changed.length ? `would make ${changed.join(", ")}` : "nothing to change" };
1624
+ return changed.length ? { outcome: "done", detail: `made ${changed.join(", ")}` } : { outcome: "unchanged", detail: `${report.topics} topic${report.topics === 1 ? "" : "s"}, every one in place` };
1625
+ }
1626
+ async function hostValues(state) {
1627
+ const names = state.hostNames ?? [];
1628
+ const url = state.url ?? await state.deps.backend.url();
1629
+ const wanted = [];
1630
+ if (!names.includes("NUXT_PUBLIC_BACKEND_URL") && url) wanted.push({ name: "NUXT_PUBLIC_BACKEND_URL", value: async () => url });
1631
+ if (!names.includes("CONVEX_DEPLOY_KEY")) wanted.push({ name: "CONVEX_DEPLOY_KEY", value: () => state.deps.backend.createDeployKey() });
1632
+ if (state.proofSecret) wanted.push({ name: "PROTECTION_PROOF_SECRET", value: async () => state.proofSecret });
1633
+ return wanted;
1634
+ }
1635
+ async function appEnvStep(state) {
1636
+ const base = { id: "app-env", capability: "hosting", title: "The app's env" };
1637
+ const { host, buildAdvice } = state.deps;
1638
+ const advice = buildAdvice ? ` ${buildAdvice}` : "";
1639
+ if (host.kind !== "vercel") {
1640
+ const url = state.url ?? await state.deps.backend.url();
1641
+ return record(state, { ...base, outcome: "skipped", detail: `set on your host's production env: NUXT_PUBLIC_BACKEND_URL=${url ?? "<production's convex.cloud URL>"}, and CONVEX_DEPLOY_KEY, a production deploy key (npx convex deployment token create <name> --prod prints one), with the build command ${BUILD_COMMAND}. On Vercel, run vercel link and deploy again.` });
1642
+ }
1643
+ if (state.hostNames === null) return record(state, { ...base, outcome: "failed", detail: "the Vercel project's env could not be read (vercel env ls production): check your Vercel login and run deploy again" });
1644
+ const wanted = await hostValues(state);
1645
+ if (wanted.length === 0) return record(state, { ...base, outcome: "unchanged", detail: `the Vercel project's production env holds what the app needs.${advice}` });
1646
+ const names = wanted.map((entry) => entry.name).join(", ");
1647
+ if (state.options.dryRun) return record(state, { ...base, outcome: "planned", detail: `would add ${names} to the Vercel project's production env.${advice}` });
1648
+ for (const { name, value } of wanted) {
1649
+ try {
1650
+ await host.addEnv(name, await value());
1651
+ } catch (error) {
1652
+ return record(state, { ...base, outcome: "failed", detail: `${name}: ${error instanceof Error ? error.message : String(error)}` });
1653
+ }
1654
+ }
1655
+ record(state, { ...base, outcome: "done", detail: `added ${names} to the Vercel project's production env. Redeploy the app for it to read them: push to the production branch, or vercel deploy --prod.${advice}` });
1656
+ }
1657
+ const GATE_CAPABILITIES = ["protection", "monitoring", "hosting"];
1658
+ async function gateStep(state) {
1659
+ const base = { id: "gate", capability: "hosting", title: "doctor --prod" };
1660
+ if (state.options.dryRun) {
1661
+ record(state, { ...base, outcome: "planned", detail: "would run doctor --prod" });
1662
+ return null;
1663
+ }
1664
+ const findings = await state.deps.doctor();
1665
+ const count = (status) => findings.filter((finding) => finding.status === status).length;
1666
+ const failing = findings.filter((finding) => finding.status === "fail");
1667
+ const lacking = findings.filter((finding) => finding.status !== "pass" && (finding.status === "fail" || GATE_CAPABILITIES.includes(finding.capability)));
1668
+ for (const finding of lacking) state.deps.print(` ${finding.status === "fail" ? "\u2717" : "\u26A0"} ${finding.title}: ${finding.message}${finding.fixHint ? `
1669
+ \u21B3 ${finding.fixHint}` : ""}`);
1670
+ record(state, failing.length > 0 ? { ...base, outcome: "failed", detail: `${failing.length} failing, ${count("warn")} warning: the fixes are above` } : { ...base, outcome: "done", detail: `production passes, with ${count("warn")} warning${count("warn") === 1 ? "" : "s"}` });
1671
+ return { pass: count("pass"), warn: count("warn"), fail: failing.length, failing: failing.map((finding) => finding.id) };
1672
+ }
1673
+ const ENV_STEPS = [
1674
+ authSecretStep,
1675
+ siteUrlStep,
1676
+ (state) => providerKeyStep(state, "BILLING_ACCESS_TOKEN"),
1677
+ (state) => providerKeyStep(state, "EMAIL_API_KEY"),
1678
+ protectionStep,
1679
+ devInboxStep
1680
+ ];
1681
+ async function runDeploy(options, deps) {
1682
+ const state = { options, deps, steps: [], names: /* @__PURE__ */ new Set(), environment: options.sandbox ? "sandbox" : "production", stopped: false };
1683
+ let doctor = null;
1684
+ await deploymentStep(state);
1685
+ if (!state.stopped) await environmentStep(state);
1686
+ if (!state.stopped) {
1687
+ state.hostNames = await deps.host.envNames();
1688
+ for (const step of ENV_STEPS) await step(state);
1689
+ await backendStep(state);
1690
+ await catalogIdsStep(state, await billingStep(state));
1691
+ await emailWebhookStep(state);
1692
+ await emailSyncStep(state);
1693
+ await appEnvStep(state);
1694
+ doctor = await gateStep(state);
1695
+ }
1696
+ const report = { dryRun: options.dryRun, environment: state.environment, host: deps.host.kind, steps: state.steps, doctor };
1697
+ return { exitCode: state.steps.some((step) => step.outcome === "failed") ? 1 : 0, report };
1698
+ }
1699
+
1700
+ function buildCmd(preview, env) {
1701
+ if (!preview) return "npm run build";
1702
+ const site = env.VERCEL_BRANCH_URL ? ' --site-url "https://$VERCEL_BRANCH_URL"' : "";
1703
+ return `npx nuxt-backend env push --preview${site} && npm run build`;
1704
+ }
1705
+ async function firstPushEnv(deps) {
1706
+ const names = await deps.backend.envNames();
1707
+ if (!names) return "production does not answer with the CONVEX_DEPLOY_KEY of this build: check the key in the host's env.";
1708
+ if (!names.includes("AUTH_SECRET")) {
1709
+ await deps.backend.setEnv("AUTH_SECRET", generateSecret());
1710
+ deps.print("[nuxt-backend] deploy --build: generated AUTH_SECRET for production");
1711
+ }
1712
+ if (!names.includes("SITE_URL")) {
1713
+ const host = deps.env.VERCEL_PROJECT_PRODUCTION_URL;
1714
+ const origin = productionOrigin(deps.env.SITE_URL || (host ? `https://${host}` : void 0));
1715
+ if (!origin) return "production has no SITE_URL, and this build names no https origin for it: set SITE_URL in the host's env, or on production (npx convex env set --prod SITE_URL).";
1716
+ await deps.backend.setEnv("SITE_URL", origin);
1717
+ deps.print(`[nuxt-backend] deploy --build: SITE_URL is ${origin}`);
1718
+ }
1719
+ return null;
1720
+ }
1721
+ async function runBuild(deps) {
1722
+ const type = deployKeyType({ ...deps.env });
1723
+ if (type === null || type === "dev") {
1724
+ deps.print(`[nuxt-backend] deploy --build refused: it runs in the host's build, with a production or preview CONVEX_DEPLOY_KEY in the host's env${type === "dev" ? ", not a dev one" : ""}. On Vercel, add Convex through the Marketplace, or set the key from the Convex dashboard.`);
1725
+ return 1;
1726
+ }
1727
+ const preview = type === "preview";
1728
+ if (!preview) {
1729
+ const refusal = await firstPushEnv(deps);
1730
+ if (refusal) {
1731
+ deps.print(`[nuxt-backend] deploy --build: ${refusal}`);
1732
+ return 1;
1733
+ }
1734
+ }
1735
+ return deps.convexDeploy(["deploy", "--cmd", buildCmd(preview, deps.env), "--cmd-url-env-var-name", "NUXT_PUBLIC_BACKEND_URL"]);
1736
+ }
1737
+
1738
+ const EMAIL_WEBHOOK_EVENTS = [
1739
+ "email.sent",
1740
+ "email.delivered",
1741
+ "email.delivery_delayed",
1742
+ "email.bounced",
1743
+ "email.complained",
1744
+ "email.opened",
1745
+ "email.clicked",
1746
+ "email.failed",
1747
+ "email.scheduled",
1748
+ "email.received",
1749
+ "inbox.email.received",
1750
+ "email.suppressed",
1751
+ "contact.created",
1752
+ "contact.updated",
1753
+ "contact.deleted",
1754
+ "contact.topics.updated",
1755
+ "domain.created",
1756
+ "domain.updated",
1757
+ "domain.deleted",
1758
+ "suppression.added",
1759
+ "suppression.removed",
1760
+ "topic.created",
1761
+ "topic.updated",
1762
+ "topic.deleted"
1763
+ ];
1764
+ function providerError(step, error) {
1765
+ return new Error(`${step} failed${error?.message ? `: ${error.message}` : ""}`);
1766
+ }
1767
+ async function ensureEmailWebhook(apiKey, url, { dryRun = false, client } = {}) {
1768
+ const webhooks = client ?? new Resend(apiKey).webhooks;
1769
+ const listed = await webhooks.list();
1770
+ if (listed.error || !listed.data) throw providerError("Listing the email webhooks", listed.error);
1771
+ const existing = listed.data.data.find((webhook) => webhook.endpoint.replace(/\/+$/, "") === url);
1772
+ if (existing) {
1773
+ if (dryRun) return { action: "exists" };
1774
+ const read = await webhooks.get(existing.id);
1775
+ if (read.error || !read.data) throw providerError("Reading the email webhook", read.error);
1776
+ return { action: "exists", secret: read.data.signing_secret };
1777
+ }
1778
+ if (dryRun) return { action: "would-create" };
1779
+ const created = await webhooks.create({ endpoint: url, events: [...EMAIL_WEBHOOK_EVENTS] });
1780
+ if (created.error || !created.data) throw providerError("Creating the email webhook", created.error);
1781
+ return { action: "created", secret: created.data.signing_secret };
1782
+ }
1783
+
1784
+ const HOST_KEY_NAME = "nuxt-backend-host";
1785
+ function deployKeyOf(output) {
1786
+ const key = output.split("\n").map((line) => line.trim()).reverse().find((line) => /^[\w-]+:[\w:-]+\|\S+$/.test(line));
1787
+ if (!key) throw new Error("npx convex deployment token create printed no deploy key");
1788
+ return key;
1789
+ }
1790
+ function convexBackend(rootDir, { json }) {
1791
+ const prod = { prod: true };
1792
+ return {
1793
+ envNames: () => deploymentEnvNames(rootDir, prod),
1794
+ environment: () => deploymentBackendEnvironment(rootDir, prod),
1795
+ create: async () => {
1796
+ await runConvex(rootDir, ["deployment", "create", "--type", "prod", "--default"], { timeout: 12e4 });
1797
+ },
1798
+ setEnv: (name, value) => setDeploymentEnv(rootDir, name, value, prod),
1799
+ // At a terminal the push prints as it goes; under --json its output stays off stdout.
1800
+ push: () => json ? runConvex(rootDir, ["deploy"], { timeout: 6e5 }).then(() => 0, () => 1) : spawnConvex(rootDir, ["deploy"]),
1801
+ url: async () => (await deploymentFunctionSpec(rootDir, prod))?.url ?? null,
1802
+ createDeployKey: async () => deployKeyOf((await runConvex(rootDir, ["deployment", "token", "create", HOST_KEY_NAME, "--prod"])).stdout)
1803
+ };
1804
+ }
1805
+ function interactive(json) {
1806
+ return !json && Boolean(process.stdin.isTTY) && !process.env.CI;
1807
+ }
1808
+ const deploy = withContract("deploy", {
1809
+ sideEffects: ["writes production", "writes provider accounts", "writes project files"],
1810
+ byFlag: {
1811
+ "--dry-run": ["reads only"],
1812
+ "--build": ["writes production", "writes a preview deployment"]
1813
+ },
1814
+ json: "`{ dryRun, environment, host, steps: [{ id, capability, title, outcome, detail }], doctor }`: `outcome` is `done`, `unchanged`, `planned`, `skipped` or `failed`, `doctor` is `{ pass, warn, fail, failing }` or null; values never appear",
1815
+ exitCodes: {
1816
+ 0: "production passes `doctor --prod`, or a dry run; a step that waits on a key only you hold is skipped, not failed",
1817
+ 1: "refused, a step failed, or `doctor --prod` fails"
1818
+ }
1819
+ }, defineCommand({
1820
+ meta: { name: "deploy", description: "Take production from nothing to a passing doctor --prod: link or create the production deployment, push its env, push the backend, sync the billing catalog, register both webhooks, write the app's env into the Vercel project, then run doctor --prod. Safe to run again" },
1821
+ args: {
1822
+ "cwd": { type: "string", description: "Project directory", default: "." },
1823
+ "dry-run": { type: "boolean", description: "Print every step it would take, and change nothing", default: false },
1824
+ "sandbox": { type: "boolean", description: "A demo or staging app: set BACKEND_ENVIRONMENT=sandbox instead of production, and sync to the providers' test modes", default: false },
1825
+ "build": { type: "boolean", description: "Run as the host's build command: put the env the first push needs on production (AUTH_SECRET, SITE_URL from the host), then convex deploy builds the app against the backend", default: false },
1826
+ "json": { type: "boolean", description: "Print the outcome as one JSON document; progress goes to stderr", default: false }
1827
+ },
1828
+ async run({ args }) {
1829
+ const rootDir = resolve(process.cwd(), args.cwd);
1830
+ const print = progress(args.json);
1831
+ if (args.build) {
1832
+ if (args.sandbox || args["dry-run"]) {
1833
+ console.error("[nuxt-backend] deploy --build takes no other flag: it never sets BACKEND_ENVIRONMENT, and it writes.");
1834
+ process.exitCode = 1;
1835
+ return;
1836
+ }
1837
+ process.exitCode = await runBuild({ backend: convexBackend(rootDir, { json: false }), convexDeploy: (deployArgs) => spawnConvex(rootDir, deployArgs), env: process.env, print: (line) => console.error(line) });
1838
+ return;
1839
+ }
1840
+ const key = nonProductionDeployKey({ ...readEnvFiles(rootDir), ...process.env });
1841
+ if (key) {
1842
+ console.error(`[nuxt-backend] deploy refused: CONVEX_DEPLOY_KEY is a ${key} deployment key, and the Convex CLI would act on that deployment instead of production. Use the production deploy key, or unset it to use your Convex login.`);
1843
+ process.exitCode = 1;
1844
+ return;
1845
+ }
1846
+ const host = deployHost(rootDir);
1847
+ print(`[nuxt-backend] deploy \u2192 production${args.sandbox ? " as a sandbox" : ""}, ${host.kind === "vercel" ? "the linked Vercel project" : "a host you set by hand"}${args["dry-run"] ? " \u2014 dry run" : ""}`);
1848
+ const { exitCode, report } = await runDeploy({ dryRun: args["dry-run"], sandbox: args.sandbox }, {
1849
+ backend: convexBackend(rootDir, { json: args.json }),
1850
+ host,
1851
+ ...interactive(args.json) ? { ask: askOnTerminal } : {},
1852
+ env: process.env,
1853
+ billingSync: (options) => runBillingSync(rootDir, options, { print }),
1854
+ emailWebhook: (apiKey, url, options) => ensureEmailWebhook(apiKey, url, options),
1855
+ emailSync: ({ dryRun }) => runEmailSync(rootDir, { prod: true, dryRun }),
1856
+ doctor: () => runDoctorChecks(rootDir, { prod: true }),
1857
+ buildAdvice: host.kind === "vercel" ? buildCommandAdvice(rootDir) : null,
1858
+ print
1859
+ });
1860
+ if (args.json) console.log(JSON.stringify(report, null, 2));
1861
+ if (exitCode !== 0) process.exitCode = exitCode;
1862
+ }
1863
+ }));
1864
+
1865
+ function bareFlags(rawArgs, flags) {
1866
+ return rawArgs.map((arg, index) => {
1867
+ const next = rawArgs[index + 1];
1868
+ return flags.includes(arg) && (next === void 0 || next.startsWith("-")) ? `${arg}=` : arg;
1869
+ });
1870
+ }
1871
+ const EVERY_NAME = BACKEND_ENV_NAMES.filter((name) => !DERIVED_DEPLOYMENT_ENV.has(name));
1872
+ function forcedNames(raw) {
1873
+ return typeof raw === "string" ? raw.split(",").map((name) => name.trim()).filter(Boolean) : [];
1874
+ }
1875
+ function forcesEveryName(raw) {
1876
+ const names = forcedNames(raw);
1877
+ return raw === true || typeof raw === "string" && names.length === 0 || names.some((name) => name.toLowerCase() === "all");
1878
+ }
1879
+ function parseForce(raw) {
1880
+ if (raw === void 0 || raw === false || raw !== true && typeof raw !== "string") return null;
1881
+ const named = forcedNames(raw).filter((name) => name.toLowerCase() !== "all").map((name) => name.toUpperCase());
1882
+ return new Set(forcesEveryName(raw) ? [...EVERY_NAME, ...named] : named);
1883
+ }
1884
+ function forceRefusal(raw, { prod }) {
1885
+ if (!prod || !forcesEveryName(raw)) return null;
1886
+ return "env push --prod refused: a bare --force (or all) would replace every value on production with .env.local's, which are the dev deployment's. Name what to replace, such as --force BILLING_ACCESS_TOKEN.";
1887
+ }
1888
+ function parseEnvPushArgs(rawArgs, args) {
1889
+ return parseArgs(bareFlags(rawArgs, ["--preview", "--force"]), args);
1890
+ }
1891
+
1892
+ async function repairProjectFiles(rootDir, print = () => {
1893
+ }) {
1894
+ const written = scaffoldBackendFiles(rootDir, { log: print });
1895
+ const changes = await fixConvexConfig(rootDir);
1896
+ for (const change of changes) print(`[nuxt-backend] doctor --fix: ${change}`);
1897
+ const config = await loadConfig(rootDir);
1898
+ const source = config ? pathsSourceOf(config) : null;
1899
+ if (source && syncPathsFile(rootDir, backendPathsOf(source)) === "written") {
1900
+ const line = `${pathsFileLocation(rootDir).name} \u2192 the paths nuxt.config declares`;
1901
+ changes.push(line);
1902
+ print(`[nuxt-backend] doctor --fix: ${line}`);
1903
+ }
1904
+ const brand = await appBrandOf(config);
1905
+ if (brand && syncBrandFile(rootDir, brand) === "written") {
1906
+ const line = `${brandFileLocation(rootDir).name} \u2192 the brand app.config declares`;
1907
+ changes.push(line);
1908
+ print(`[nuxt-backend] doctor --fix: ${line}`);
1909
+ }
1910
+ const devScript = adoptBackendDevScript(rootDir, { onlyCombined: true });
1911
+ if (devScript?.changed) {
1912
+ changes.push(`scripts.dev \u2192 \`${devScript.script}\``);
1913
+ print(`[nuxt-backend] doctor --fix: scripts.dev \u2192 \`${devScript.script}\``);
1914
+ }
1915
+ return { written, changes };
1916
+ }
1917
+ async function loadConfig(rootDir) {
1918
+ try {
1919
+ const { loadNuxtConfig } = await import('@nuxt/kit');
1920
+ return await loadNuxtConfig({ cwd: rootDir });
1921
+ } catch {
1922
+ return null;
1923
+ }
1924
+ }
1925
+
1926
+ const DEFAULT_INBOX_ADDRESS = "delivered@resend.dev";
1927
+ function inboxRefusal(rootDir, { prod, address }) {
1928
+ if (prod) return "inbox reads dev deployments only: --prod is refused. A sign-in code on a production deployment belongs to its owner's mailbox.";
1929
+ const keyType = deployKeyType({ ...readEnvFiles(rootDir), ...process.env });
1930
+ if (keyType !== null && keyType !== "dev") {
1931
+ return `inbox reads dev deployments only: CONVEX_DEPLOY_KEY is a ${keyType === "prod" ? "production" : keyType} deploy key, and the Convex CLI would read that deployment. Unset it to read the dev deployment .env.local names.`;
1932
+ }
1933
+ if (keyType === null) {
1934
+ if (process.env.CONVEX_SELF_HOSTED_URL || readEnvFiles(rootDir).CONVEX_SELF_HOSTED_URL) {
1935
+ return "inbox reads dev deployments only, and a self-hosted deployment does not say whether it is one.";
1936
+ }
1937
+ const deployment = configuredDeployment(rootDir);
1938
+ const kind = deployment?.split(":")[0];
1939
+ if (!isDevDeploymentId(deployment)) {
1940
+ return kind ? `inbox reads dev deployments only, and CONVEX_DEPLOYMENT is ${kind}:\u2026 \u2014 not a dev, local or anonymous one.` : "No dev deployment is configured: run `npx nuxt-backend dev` once, then read the inbox.";
1941
+ }
1942
+ }
1943
+ if (!isSandboxAddress(address)) {
1944
+ return `${address} has no dev inbox: only the provider's test addresses do (${DEFAULT_INBOX_ADDRESS}, or delivered+<label>@resend.dev). Sign in with one of them.`;
1945
+ }
1946
+ return null;
1947
+ }
1948
+ async function readInbox(rootDir, address, run = runConvex) {
1949
+ const normalized = address.trim().toLowerCase();
1950
+ const { stdout } = await run(rootDir, ["run", "--component", "backend", "email:inbox", JSON.stringify({ address: normalized })]);
1951
+ const raw = JSON.parse(stdout);
1952
+ if (!Array.isArray(raw)) throw new Error(`email:inbox returned ${typeof raw === "object" ? JSON.stringify(raw)?.slice(0, 80) : typeof raw}, not a list of messages`);
1953
+ const messages = raw.map((message) => ({
1954
+ from: message.from,
1955
+ subject: message.subject,
1956
+ receivedAt: message.receivedAt,
1957
+ code: findCode(message) ?? null
1958
+ }));
1959
+ const keyed = deployKeyType({ ...readEnvFiles(rootDir), ...process.env }) !== null;
1960
+ return { address: normalized, deployment: keyed ? null : configuredDeployment(rootDir), messages, code: messages[0]?.code ?? null };
1961
+ }
1962
+ function ago(then, now = Date.now()) {
1963
+ const seconds = Math.max(0, Math.round((now - then) / 1e3));
1964
+ return seconds < 60 ? `${seconds}s ago` : `${Math.round(seconds / 60)}m ago`;
1965
+ }
1966
+ const inbox = withContract("inbox", {
1967
+ sideEffects: ["reads only"],
1968
+ json: "`{ address, deployment, messages: [{ from, subject, receivedAt, code }], code }`: newest first, `code` the newest message's; bodies are never printed",
1969
+ exitCodes: {
1970
+ 0: "the inbox was read; it may be empty (`code` null)",
1971
+ 1: "refused \u2014 `--prod`, a deploy key for anything but a dev deployment, a deployment that is not dev-class, an address with no dev inbox \u2014 or the read failed"
1972
+ }
1973
+ }, defineCommand({
1974
+ meta: { name: "inbox", description: "Print the sign-in codes a dev deployment sent to a sandbox address (default delivered@resend.dev)" },
1975
+ args: {
1976
+ address: { type: "positional", description: "The sandbox address to read, such as delivered+agent@resend.dev", required: false },
1977
+ cwd: { type: "string", description: "Project directory", default: "." },
1978
+ json: { type: "boolean", description: "Machine-readable output", default: false },
1979
+ prod: { type: "boolean", description: "Refused: the inbox is read on dev deployments only", default: false }
1980
+ },
1981
+ async run({ args }) {
1982
+ const rootDir = resolve(process.cwd(), args.cwd);
1983
+ const address = args.address?.trim() || DEFAULT_INBOX_ADDRESS;
1984
+ const refusal = inboxRefusal(rootDir, { prod: args.prod, address });
1985
+ if (refusal) {
1986
+ console.error(`[nuxt-backend] ${refusal}`);
1987
+ process.exitCode = 1;
1988
+ return;
1989
+ }
1990
+ let report;
1991
+ try {
1992
+ report = await readInbox(rootDir, address);
1993
+ } catch (error) {
1994
+ console.error(`[nuxt-backend] Could not read the inbox: ${error instanceof Error ? error.message : String(error)}. Is \`npx nuxt-backend dev\` running, has the backend been pushed, and is EMAIL_API_KEY set on the deployment with full access?`);
1995
+ process.exitCode = 1;
1996
+ return;
1997
+ }
1998
+ if (args.json) {
1999
+ console.log(JSON.stringify(report, null, 2));
2000
+ return;
2001
+ }
2002
+ if (report.messages.length === 0) {
2003
+ console.log(`[nuxt-backend] No mail to ${report.address} in the last hour. Request a sign-in code for it, then read again (nothing is sent while EMAIL_API_KEY is unset on the deployment).`);
2004
+ return;
2005
+ }
2006
+ for (const message of report.messages) {
2007
+ console.log(`${(message.code ?? "------").padEnd(8)} ${ago(message.receivedAt).padEnd(8)} ${message.subject}`);
2008
+ }
2009
+ }
2010
+ }));
2011
+
2012
+ function isMissingMcpSdk(error) {
2013
+ const { code, message } = error ?? {};
2014
+ return (code === "ERR_MODULE_NOT_FOUND" || code === "MODULE_NOT_FOUND") && typeof message === "string" && message.includes(MCP_SDK);
2015
+ }
2016
+ function mcpStartRefusal(rootDir, prod) {
2017
+ if (!existsSync(rootDir)) return `${rootDir} does not exist: pass the project directory with --cwd.`;
2018
+ if (!prod) return null;
2019
+ const type = nonProductionDeployKey({ ...readEnvFiles(rootDir), ...process.env });
2020
+ return type ? `--prod refused: CONVEX_DEPLOY_KEY is a ${type} deployment key, and the Convex CLI would read that deployment instead of production.` : null;
2021
+ }
2022
+ const mcp = withContract("mcp", {
2023
+ sideEffects: ["writes the dev deployment", "writes provider accounts"],
2024
+ byFlag: { "--prod": ["reads only"] },
2025
+ json: "none: it speaks MCP on stdin and stdout until the client closes it",
2026
+ exitCodes: {
2027
+ 0: "the client closed the connection",
2028
+ 1: "it could not start: no such project directory, @modelcontextprotocol/sdk not installed, or --prod refused for a deploy key of another deployment"
2029
+ }
2030
+ }, defineCommand({
2031
+ meta: { name: "mcp", description: "Run the developer MCP server for your coding agent over stdio: the project's state, the docs, and the Convex, billing, email and hosting consoles on your own logins; every tool that writes asks you first" },
2032
+ args: {
2033
+ cwd: { type: "string", description: "Project directory", default: "." },
2034
+ prod: { type: "boolean", description: "Read production: the project, billing, email and hosting tools read it, the data tools read only its logs and insights, and every write is refused", default: false }
2035
+ },
2036
+ async run({ args }) {
2037
+ const rootDir = resolve(process.cwd(), args.cwd);
2038
+ const refusal = mcpStartRefusal(rootDir, args.prod);
2039
+ if (refusal) {
2040
+ console.error(`[nuxt-backend] ${refusal}`);
2041
+ process.exitCode = 1;
2042
+ return;
2043
+ }
2044
+ let server;
2045
+ try {
2046
+ server = await import('./chunks/server.mjs');
2047
+ } catch (error) {
2048
+ if (!isMissingMcpSdk(error)) throw error;
2049
+ console.error(`[nuxt-backend] ${MCP_SDK} is not installed: run \`npm install -D ${MCP_SDK}\` (or \`npx nuxt-backend init --agents\`, which adds it), then restart your agent.`);
2050
+ process.exitCode = 1;
2051
+ return;
2052
+ }
2053
+ await server.runDeveloperMcp({ rootDir, prod: args.prod });
2054
+ }
2055
+ }));
2056
+
2057
+ async function collectStatus(rootDir, { prod }) {
2058
+ const env = { ...readEnvFiles(rootDir), ...process.env };
2059
+ const deployedNames = await deploymentEnvNames(rootDir, { prod });
2060
+ const posture = prod && deployedNames ? readProductionPosture(rootDir, deployedNames, () => true) : null;
2061
+ const [findings, switches] = await Promise.all([
2062
+ runDoctorChecks(rootDir, { prod, deployedNames, ...posture ? { posture } : {} }),
2063
+ posture ? posture.then(switchesOf) : readSwitches(rootDir, { prod }, deployedNames ?? [])
2064
+ ]);
2065
+ const local = computeDeployment(rootDir, env);
2066
+ const deployment = prod ? { kind: "production" } : { kind: local.kind, ...local.id ? { id: local.id } : {} };
2067
+ const app = { monitoring: !prod && Boolean(appMonitoringDsn(env)) && monitoringSdkInstalled(rootDir) };
2068
+ const capabilities = detectCapabilities({ env, deployed: deployedNames ? new Set(deployedNames) : null, switches, deployment: deployment.kind, findings, prod, app });
2069
+ return { deployment, status: healthStatus(capabilities.map((capability) => capability.state)), capabilities, summary: capabilitySummary(capabilities.map((capability) => capability.state)) };
2070
+ }
2071
+ function switchesOf(posture) {
2072
+ const { environment } = posture;
2073
+ return environment === "unset" || environment === "unread" ? {} : { BACKEND_ENVIRONMENT: environment };
2074
+ }
2075
+ async function readSwitches(rootDir, target, names) {
2076
+ if (!names.includes("BACKEND_ENVIRONMENT")) return {};
2077
+ const environment = await deploymentBackendEnvironment(rootDir, target);
2078
+ return environment === null ? {} : { BACKEND_ENVIRONMENT: environment };
2079
+ }
2080
+ const STATE_GLYPH = { live: "\u25CF", test: "\u25D0", missing: "\u25CB", failing: "\u2717" };
2081
+ function terminalShowsColor(stream = process.stdout) {
2082
+ return stream.isTTY === true && stream.hasColors?.() === true;
2083
+ }
2084
+ const STATE_COLOR = { live: "green", test: "yellow", missing: "gray", failing: "red" };
2085
+ const FINDING_GLYPH = { pass: "\u2713", warn: "\u26A0", fail: "\u2717" };
2086
+ const NAME_WIDTH = Math.max(...CAPABILITY_NAMES.map((name) => name.length));
2087
+ function formatStatus(report, { color = false, prod = false } = {}) {
2088
+ const light = (state) => color ? styleText(STATE_COLOR[state], STATE_GLYPH[state], { validateStream: false }) : STATE_GLYPH[state];
2089
+ const { deployment } = report;
2090
+ const lines = [`nuxt-backend status \xB7 ${deployment.id ? `${deployment.id} (${DEPLOYMENT_KIND_LABEL[deployment.kind]})` : DEPLOYMENT_KIND_LABEL[deployment.kind]}`, ""];
2091
+ for (const capability of report.capabilities) {
2092
+ lines.push(`${light(capability.state)} ${capability.name.padEnd(NAME_WIDTH)} ${capability.state.padEnd(10)} ${capability.providers.join(", ")}: ${capability.reason}`);
2093
+ if (capability.missingEnv.length > 0) lines.push(` unset: ${capability.missingEnv.join(", ")}`);
2094
+ if (capability.top) lines.push(` ${FINDING_GLYPH[capability.top.status]} ${capability.top.title}: ${capability.top.message}`);
2095
+ }
2096
+ const attention = report.capabilities.filter((capability) => capability.top).map((capability) => capability.name);
2097
+ lines.push("", attention.length > 0 ? `${report.summary} \u2014 fixes: npx nuxt-backend doctor --only ${attention.join(",")}${prod ? " --prod" : ""}` : report.summary);
2098
+ return lines;
2099
+ }
2100
+
2101
+ v.object({
2102
+ perWeek: v.union(v.number(), v.null()),
2103
+ quietHours: v.union(v.object({ start: v.number(), end: v.number() }), v.null()),
2104
+ sunsetAfterMs: v.number()
2105
+ });
2106
+ new TextEncoder();
2107
+ const LAYOUT_FOOTER_END = "<!--nb-footer-end-->";
2108
+
2109
+ function escapeHtml(value) {
2110
+ return value.replace(/[&<>"']/g, (c) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" })[c] ?? c);
2111
+ }
2112
+
2113
+ const KINDS = ["kicker", "heading", "paragraph", "code", "button", "note"];
2114
+ const SAFE_URL = /^(?:https?:\/\/|mailto:)/i;
2115
+ function kindOf(block, index) {
2116
+ const keys = block !== null && typeof block === "object" ? Object.keys(block) : [];
2117
+ const kind = keys[0];
2118
+ if (keys.length !== 1 || kind === void 0 || !KINDS.includes(kind)) {
2119
+ throw new TypeError(`[nuxt-backend] email blocks[${index}] must have exactly one of ${KINDS.map((name) => `\`${name}\``).join(", ")}, got ${JSON.stringify(block)}.`);
2120
+ }
2121
+ return kind;
2122
+ }
2123
+ function textOf(block, kind, index) {
2124
+ const value = block[kind];
2125
+ if (typeof value !== "string") throw new TypeError(`[nuxt-backend] email blocks[${index}].${kind} must be text, got ${JSON.stringify(value)}.`);
2126
+ return value;
2127
+ }
2128
+ function buttonOf(block, index) {
2129
+ const value = block.button;
2130
+ if (value === null || typeof value !== "object" || typeof value.label !== "string" || typeof value.url !== "string") {
2131
+ throw new TypeError(`[nuxt-backend] email blocks[${index}].button must be { label, url }, both text.`);
2132
+ }
2133
+ if (!SAFE_URL.test(value.url.trim())) throw new TypeError(`[nuxt-backend] email blocks[${index}].button.url must start with https://, http:// or mailto:, got ${JSON.stringify(value.url)}.`);
2134
+ return { label: value.label, url: value.url.trim() };
2135
+ }
2136
+ const lines = (value) => escapeHtml(value).replace(/\r?\n/g, "<br>");
2137
+ function renderBlocks(blocks, theme) {
2138
+ const { colors, fonts } = theme;
2139
+ const body = `font-family:${escapeHtml(fonts.body)}`;
2140
+ const display = `font-family:${escapeHtml(fonts.heading)}`;
2141
+ const markup = [];
2142
+ const plain = [];
2143
+ let heading;
2144
+ let paragraph;
2145
+ blocks.forEach((block, index) => {
2146
+ const kind = kindOf(block, index);
2147
+ if (kind === "button") {
2148
+ const { label, url } = buttonOf(block, index);
2149
+ markup.push(`<p style="margin:0 0 20px"><a class="nb-button" href="${escapeHtml(url)}" style="display:inline-block;padding:11px 20px;border-radius:8px;background:${colors.accent};color:${colors.accentText};${body};font-weight:600;text-decoration:none">${escapeHtml(label)}</a></p>`);
2150
+ plain.push(`${label}: ${url}`);
2151
+ return;
2152
+ }
2153
+ const text = textOf(block, kind, index);
2154
+ plain.push(text);
2155
+ switch (kind) {
2156
+ case "kicker":
2157
+ markup.push(`<p class="nb-accent" style="margin:0 0 8px;${display};font-size:12px;line-height:1.4;font-weight:700;letter-spacing:0.12em;text-transform:uppercase;color:${colors.accent}">${escapeHtml(text)}</p>`);
2158
+ break;
2159
+ case "heading":
2160
+ heading ??= text;
2161
+ markup.push(`<h1 class="nb-ink" style="margin:0 0 16px;${display};font-size:24px;line-height:1.25;font-weight:700;color:${colors.text}">${escapeHtml(text)}</h1>`);
2162
+ break;
2163
+ case "paragraph":
2164
+ paragraph ??= text;
2165
+ markup.push(`<p class="nb-ink" style="margin:0 0 16px;color:${colors.text}">${lines(text)}</p>`);
2166
+ break;
2167
+ case "code":
2168
+ markup.push(`<table role="presentation" cellpadding="0" cellspacing="0" border="0" style="margin:0 0 16px"><tr><td class="nb-plate" align="center" style="padding:14px 22px;border-radius:8px;background:${colors.accent};color:${colors.accentText};${display};font-size:32px;line-height:1.1;font-weight:700;letter-spacing:0.28em;text-indent:0.28em">${escapeHtml(text)}</td></tr></table>`);
2169
+ break;
2170
+ case "note":
2171
+ markup.push(`<p class="nb-muted" style="margin:0 0 16px;font-size:14px;color:${colors.muted};overflow-wrap:anywhere">${lines(text)}</p>`);
2172
+ break;
2173
+ }
2174
+ });
2175
+ const preheader = paragraph ?? heading;
2176
+ return { html: markup.join(""), text: plain.join("\n\n"), ...preheader ? { preheader } : {} };
2177
+ }
2178
+
2179
+ function layoutStyles({ dark }) {
2180
+ const text = (selector, color) => `${selector}{color:${color}!important}`;
2181
+ return `:root{color-scheme:light dark;supported-color-schemes:light dark}body{margin:0;padding:0}${DARK_SCHEME_QUERY}{.nb-page{background:${dark.background}!important}.nb-card{background:${dark.card}!important;border-color:${dark.rule}!important}` + text(".nb-ink,.nb-ink a", dark.text) + text(".nb-muted,.nb-muted a", dark.muted) + text(".nb-accent", dark.accent) + `.nb-plate,a.nb-button{background:${dark.accent}!important;color:${dark.accentText}!important}}${text("[data-ogsc] .nb-ink,[data-ogsc] .nb-ink a", dark.text)}` + text("[data-ogsc] .nb-muted", dark.muted) + text("[data-ogsc] .nb-accent", dark.accent) + `[data-ogsb] .nb-page{background:${dark.background}!important}[data-ogsb] .nb-card{background:${dark.card}!important}[data-ogsb] .nb-plate,[data-ogsb] a.nb-button{background:${dark.accent}!important}[data-ogsc] .nb-plate,[data-ogsc] a.nb-button{color:${dark.accentText}!important}`;
2182
+ }
2183
+
2184
+ function deletionCanceled({ email }, context) {
2185
+ const { t } = context;
2186
+ const body = t("email.deletionCanceled.body");
2187
+ return { to: email, subject: t("email.deletionCanceled.subject"), blocks: [{ paragraph: body }], preheader: body };
2188
+ }
2189
+
2190
+ const ABSOLUTE_LINK = /^(?:https?:\/\/|mailto:)/i;
2191
+ function linkBlocks(url, label, { t }) {
2192
+ const link = url.trim();
2193
+ if (!ABSOLUTE_LINK.test(link)) return link ? [{ note: link }] : [];
2194
+ return [{ button: { label, url: link } }, { note: `${t("email.link.fallback")}
2195
+ ${link}` }];
2196
+ }
2197
+ function describeOrigin(origin, { t, locale }) {
2198
+ const parts = [];
2199
+ const { browser, os } = origin.device ?? {};
2200
+ if (browser && os) parts.push(t("email.origin.device", { browser, os }));
2201
+ else if (browser || os) parts.push(browser ?? os);
2202
+ const country = origin.place?.country ? regionName(origin.place.country, locale) : void 0;
2203
+ const place = [origin.place?.city, country].filter(Boolean).join(", ");
2204
+ if (place) parts.push(t("email.origin.place", { place }));
2205
+ const time = new Intl.DateTimeFormat(locale, { year: "numeric", month: "short", day: "numeric", hour: "2-digit", minute: "2-digit", timeZone: origin.timeZone ?? "UTC", timeZoneName: "short" }).format(origin.at);
2206
+ parts.push(t("email.origin.time", { time }));
2207
+ return t("email.origin.summary", { details: parts.join(", ") });
2208
+ }
2209
+ function regionName(code, locale) {
2210
+ try {
2211
+ return new Intl.DisplayNames([locale], { type: "region" }).of(code) ?? code;
2212
+ } catch {
2213
+ return code;
2214
+ }
2215
+ }
2216
+ const LINK = /(?:[a-z][\w+.-]*:\/\/|www\.)\S*|\b[\w-]+(?:\.[\w-]+)*\.(?:com|net|org|io|co|app|dev|ai|me|info|biz|xyz|online|site|store|shop|link|click|top|club|live|pro|tech|cloud|page|ly|gg|tv|uk|de|ru|fr|us|ca|au|in|cn|jp|nl|br|es|it|pl|ch|se|eu|cc)(?![\w-])(?:\/\S*)?/gi;
2217
+ const IDEOGRAPHIC_STOP = /[。。]/g;
2218
+ const FORMAT_CHARACTERS = /\p{Cf}/gu;
2219
+ function readable(text) {
2220
+ return text.normalize("NFKC").replace(IDEOGRAPHIC_STOP, ".").replace(FORMAT_CHARACTERS, "");
2221
+ }
2222
+ function plainName(name, max) {
2223
+ if (name === void 0) return void 0;
2224
+ const plain = readable(name).replace(LINK, " ").replace(/\s+/g, " ").trim().slice(0, max).trim();
2225
+ return plain || void 0;
2226
+ }
2227
+
2228
+ function deletionScheduled({ email, deletesAt, keepUrl }, context) {
2229
+ const { t } = context;
2230
+ const date = new Intl.DateTimeFormat(context.locale, { dateStyle: "long", timeZone: "UTC" }).format(deletesAt);
2231
+ const intro = t("email.deletionScheduled.intro", { date });
2232
+ const warning = t("email.deletionScheduled.warning");
2233
+ const link = context.link(keepUrl);
2234
+ return {
2235
+ to: email,
2236
+ subject: t("email.deletionScheduled.subject"),
2237
+ blocks: [{ paragraph: intro }, ...linkBlocks(link, t("email.deletionScheduled.action"), context), { note: warning }],
2238
+ text: `${intro}
2239
+
2240
+ ${link}
2241
+
2242
+ ${warning}`,
2243
+ preheader: intro
2244
+ };
2245
+ }
2246
+
2247
+ function emailChanged({ email, newEmail }, context) {
2248
+ const { t } = context;
2249
+ const intro = t("email.emailChanged.intro", { newEmail });
2250
+ return {
2251
+ to: email,
2252
+ subject: t("email.emailChanged.subject"),
2253
+ blocks: [{ paragraph: intro }, { note: t("email.emailChanged.warning") }],
2254
+ preheader: intro
2255
+ };
2256
+ }
2257
+
2258
+ function giftPassEnding({ email, plan, workspace, endsAt, keepUrl, trial }, context) {
2259
+ const { t } = context;
2260
+ const date = new Date(endsAt).toLocaleDateString(context.locale, { dateStyle: "long" });
2261
+ const intro = t(trial ? "email.giftPassEnding.trialIntro" : "email.giftPassEnding.intro", { plan, date, workspace: workspace || t("email.giftPassEnding.workspace") });
2262
+ const link = context.link(keepUrl);
2263
+ return {
2264
+ to: email,
2265
+ subject: t("email.giftPassEnding.subject", { plan, date }),
2266
+ blocks: [{ paragraph: intro }, ...linkBlocks(link, t("email.giftPassEnding.action", { plan }), context)],
2267
+ text: `${intro}
2268
+
2269
+ ${link}`,
2270
+ preheader: intro
2271
+ };
2272
+ }
2273
+
2274
+ function gift({ recipientEmail, purchaserName, item, months, claimUrl, reminder }, context) {
2275
+ const { t } = context;
2276
+ const sender = purchaserName || t("email.gift.sender");
2277
+ const what = months === void 0 ? item : t("email.gift.itemPass", { count: months, plan: item });
2278
+ const intro = reminder ? t("email.gift.reminderIntro", { sender, item: what }) : t("email.gift.intro", { sender, item: what });
2279
+ const link = context.link(claimUrl);
2280
+ return {
2281
+ to: recipientEmail,
2282
+ subject: reminder ? t("email.gift.reminderSubject", { sender }) : t("email.gift.subject", { sender }),
2283
+ blocks: [{ paragraph: intro }, ...linkBlocks(link, t("email.gift.action"), context)],
2284
+ text: `${intro}
2285
+
2286
+ ${link}`,
2287
+ preheader: intro
2288
+ };
2289
+ }
2290
+
2291
+ const INVITER_NAME_LENGTH = 40;
2292
+ const WORKSPACE_NAME_LENGTH = 60;
2293
+ function invite({ email, url, inviterName, inviterEmail, workspaceName, role }, context) {
2294
+ const { t } = context;
2295
+ const inviter = plainName(inviterName, INVITER_NAME_LENGTH) ?? inviterEmail;
2296
+ const workspace = plainName(workspaceName, WORKSPACE_NAME_LENGTH);
2297
+ const intro = workspace ? t("email.invite.intro", { inviter, workspace, role }) : t("email.invite.introUnnamed", { inviter, role });
2298
+ const link = context.link(url);
2299
+ return {
2300
+ to: email,
2301
+ subject: workspace ? t("email.invite.subject", { workspace }) : t("email.invite.subjectUnnamed"),
2302
+ blocks: [{ paragraph: intro }, ...linkBlocks(link, t("email.invite.action"), context)],
2303
+ text: `${intro}
2304
+
2305
+ ${link}`,
2306
+ preheader: intro
2307
+ };
2308
+ }
2309
+
2310
+ function otp({ email, otp: otp2, type, reason, requestedFrom }, context) {
2311
+ const { t } = context;
2312
+ const origin = requestedFrom ? describeOrigin(requestedFrom, context) : "";
2313
+ const originText = origin ? `
2314
+
2315
+ ${origin}` : "";
2316
+ const originBlocks = origin ? [{ note: origin }] : [];
2317
+ if (reason === "passkey-only") {
2318
+ const intro = t("email.otp.passkeyOnly.intro");
2319
+ const recover = t("email.otp.passkeyOnly.recover");
2320
+ return {
2321
+ to: email,
2322
+ subject: t("email.otp.passkeyOnly.subject"),
2323
+ blocks: [{ paragraph: intro }, { paragraph: recover }, ...originBlocks],
2324
+ text: `${intro}
2325
+
2326
+ ${recover}${originText}`,
2327
+ preheader: intro
2328
+ };
2329
+ }
2330
+ if (reason === "email-change") {
2331
+ const intro = t("email.otp.emailChange.intro");
2332
+ const warning = t("email.otp.emailChange.warning");
2333
+ return {
2334
+ to: email,
2335
+ subject: t("email.otp.emailChange.subject"),
2336
+ blocks: [{ paragraph: intro }, { code: otp2 }, ...originBlocks, { note: warning }],
2337
+ text: `${intro}
2338
+
2339
+ ${otp2}${originText}
2340
+
2341
+ ${warning}`,
2342
+ preheader: intro
2343
+ };
2344
+ }
2345
+ const subject = t(`email.otp.subject.${type}`);
2346
+ const expiry = t("email.otp.expiry");
2347
+ return {
2348
+ to: email,
2349
+ subject,
2350
+ blocks: [{ paragraph: `${subject}:` }, { code: otp2 }, ...originBlocks, { note: expiry }],
2351
+ text: `${subject}: ${otp2}${originText}
2352
+
2353
+ ${expiry}`,
2354
+ preheader: subject
2355
+ };
2356
+ }
2357
+
2358
+ function passkeyRecovered({ email, requestedFrom, url }, context) {
2359
+ const { t } = context;
2360
+ const origin = requestedFrom ? ` ${describeOrigin(requestedFrom, context)}` : "";
2361
+ const intro = `${t("email.passkeyRecovered.intro")}${origin} ${t("email.passkeyRecovered.warning")}`;
2362
+ const link = context.link(url);
2363
+ return {
2364
+ to: email,
2365
+ subject: t("email.passkeyRecovered.subject"),
2366
+ blocks: [{ paragraph: intro }, ...linkBlocks(link, t("email.passkeyRecovered.action"), context)],
2367
+ text: `${intro}
2368
+
2369
+ ${link}`,
2370
+ preheader: intro
2371
+ };
2372
+ }
2373
+
2374
+ function newDevice({ email, requestedFrom, url }, context) {
2375
+ const { t } = context;
2376
+ const origin = requestedFrom ? ` ${describeOrigin(requestedFrom, context)}` : "";
2377
+ const intro = `${t("email.newDevice.intro")}${origin} ${t("email.newDevice.warning")}`;
2378
+ const link = context.link(url);
2379
+ return {
2380
+ to: email,
2381
+ subject: t("email.newDevice.subject"),
2382
+ blocks: [{ paragraph: intro }, ...linkBlocks(link, t("email.newDevice.action"), context)],
2383
+ text: `${intro}
2384
+
2385
+ ${link}`,
2386
+ preheader: intro
2387
+ };
2388
+ }
2389
+
2390
+ function topicConfirmation({ email, topic, confirmUrl }, context) {
2391
+ const { t } = context;
2392
+ const intro = t("email.topicConfirmation.intro", { topic });
2393
+ const note = t("email.topicConfirmation.note");
2394
+ const link = context.link(confirmUrl);
2395
+ return {
2396
+ to: email,
2397
+ subject: t("email.topicConfirmation.subject", { topic }),
2398
+ blocks: [{ paragraph: intro }, ...linkBlocks(link, t("email.topicConfirmation.action"), context), { note }],
2399
+ text: `${intro}
2400
+
2401
+ ${link}
2402
+
2403
+ ${note}`,
2404
+ preheader: intro
2405
+ };
2406
+ }
2407
+
2408
+ function renewalReminder({ email, plan, amount, currency, interval, intervalCount, renewsAt, manageUrl }, context) {
2409
+ const { t } = context;
2410
+ const date = new Intl.DateTimeFormat(context.locale, { dateStyle: "long", timeZone: "UTC" }).format(renewsAt);
2411
+ const price = new Intl.NumberFormat(context.locale, { style: "currency", currency: currency.toUpperCase() || "USD" }).format(amount / 100);
2412
+ const every = t(`email.renewalReminder.every.${interval === "day" || interval === "week" ? interval : "month"}`, { count: intervalCount });
2413
+ const intro = t("email.renewalReminder.intro", { plan, price, every, date });
2414
+ const cancel = t("email.renewalReminder.cancel");
2415
+ const link = context.link(manageUrl);
2416
+ return {
2417
+ to: email,
2418
+ subject: t("email.renewalReminder.subject", { plan }),
2419
+ blocks: [{ paragraph: intro }, { paragraph: cancel }, ...linkBlocks(link, t("email.renewalReminder.action"), context)],
2420
+ text: `${intro}
2421
+
2422
+ ${cancel}
2423
+
2424
+ ${link}`,
2425
+ preheader: intro
2426
+ };
2427
+ }
2428
+
2429
+ function waitlistAdmitted({ email, signInUrl }, context) {
2430
+ const { t } = context;
2431
+ const intro = t("email.waitlistAdmitted.intro");
2432
+ const link = context.link(signInUrl);
2433
+ return {
2434
+ to: email,
2435
+ subject: t("email.waitlistAdmitted.subject"),
2436
+ blocks: [{ paragraph: intro }, ...linkBlocks(link, t("email.waitlistAdmitted.action"), context)],
2437
+ text: `${intro}
2438
+
2439
+ ${link}`,
2440
+ preheader: intro
2441
+ };
2442
+ }
2443
+
2444
+ function noticeReceived({ email, url, intimate }, context) {
2445
+ const { t } = context;
2446
+ const intro = url ? t("email.noticeReceived.intro", { url }) : t("email.noticeReceived.introUnlinked");
2447
+ const next = t(intimate ? "email.noticeReceived.intimate" : "email.noticeReceived.next");
2448
+ return {
2449
+ to: email,
2450
+ subject: t("email.noticeReceived.subject"),
2451
+ blocks: [{ paragraph: intro }, { paragraph: next }],
2452
+ text: `${intro}
2453
+
2454
+ ${next}`,
2455
+ preheader: intro
2456
+ };
2457
+ }
2458
+
2459
+ function noticeDecided({ email, url, outcome, reason }, context) {
2460
+ const { t } = context;
2461
+ const intro = url ? t(`email.noticeDecided.${outcome}`, { url }) : t(`email.noticeDecided.${outcome}Unlinked`);
2462
+ const why = t("email.noticeDecided.reason", { reason });
2463
+ const redress = t("email.noticeDecided.redress");
2464
+ return {
2465
+ to: email,
2466
+ subject: t("email.noticeDecided.subject"),
2467
+ blocks: [{ paragraph: intro }, { paragraph: why }, { note: redress }],
2468
+ text: `${intro}
2469
+
2470
+ ${why}
2471
+
2472
+ ${redress}`,
2473
+ preheader: intro
2474
+ };
2475
+ }
2476
+
2477
+ function contentRestricted({ email, title, reason, ground, notice, appealUrl, appealUntil }, context) {
2478
+ const { t } = context;
2479
+ const intro = t("email.contentRestricted.intro", { title });
2480
+ const why = t("email.contentRestricted.reason", { reason });
2481
+ const basis = t(notice ? "email.contentRestricted.notice" : "email.contentRestricted.reports");
2482
+ const grounds = t(ground === "illegal" ? "email.contentRestricted.illegal" : "email.contentRestricted.terms");
2483
+ const person = t("email.contentRestricted.person");
2484
+ const date = new Intl.DateTimeFormat(context.locale, { dateStyle: "long", timeZone: "UTC" }).format(appealUntil);
2485
+ const appeal = t("email.contentRestricted.appeal", { date });
2486
+ const redress = t("email.contentRestricted.redress");
2487
+ const link = context.link(appealUrl);
2488
+ const facts = [why, basis, grounds, person].join(" ");
2489
+ return {
2490
+ to: email,
2491
+ subject: t("email.contentRestricted.subject"),
2492
+ blocks: [{ paragraph: intro }, { paragraph: facts }, { paragraph: appeal }, ...linkBlocks(link, t("email.contentRestricted.action"), context), { note: redress }],
2493
+ text: `${intro}
2494
+
2495
+ ${facts}
2496
+
2497
+ ${appeal}
2498
+ ${link}
2499
+
2500
+ ${redress}`,
2501
+ preheader: intro
2502
+ };
2503
+ }
2504
+
2505
+ function appealDecided({ email, title, outcome, reason }, context) {
2506
+ const { t } = context;
2507
+ const intro = t(outcome === "reversed" ? "email.appealDecided.reversed" : "email.appealDecided.upheld", { title });
2508
+ const why = t("email.appealDecided.reason", { reason });
2509
+ const redress = t("email.appealDecided.redress");
2510
+ return {
2511
+ to: email,
2512
+ subject: t("email.appealDecided.subject"),
2513
+ blocks: [{ paragraph: intro }, { paragraph: why }, { note: redress }],
2514
+ text: `${intro}
2515
+
2516
+ ${why}
2517
+
2518
+ ${redress}`,
2519
+ preheader: intro
2520
+ };
2521
+ }
2522
+
2523
+ function waitlistConfirmation({ email, statusUrl, position, total }, context) {
2524
+ const { t } = context;
2525
+ const intro = position && total ? t("email.waitlistConfirmation.intro", { position: position.toLocaleString(context.locale), total: total.toLocaleString(context.locale) }) : t("email.waitlistConfirmation.introUnplaced");
2526
+ const note = t("email.waitlistConfirmation.note");
2527
+ const link = context.link(statusUrl);
2528
+ return {
2529
+ to: email,
2530
+ subject: t("email.waitlistConfirmation.subject"),
2531
+ blocks: [{ paragraph: intro }, { paragraph: note }, ...linkBlocks(link, t("email.waitlistConfirmation.action"), context)],
2532
+ text: `${intro}
2533
+
2534
+ ${note}
2535
+
2536
+ ${link}`,
2537
+ preheader: intro
2538
+ };
2539
+ }
2540
+
2541
+ function welcome({ email, name }, context) {
2542
+ const { t } = context;
2543
+ const greeting = name ? t("email.welcome.greetingNamed", { name }) : t("email.welcome.greeting");
2544
+ const body = t("email.welcome.body");
2545
+ return {
2546
+ to: email,
2547
+ subject: t("email.welcome.subject"),
2548
+ blocks: [{ heading: `${greeting} \u{1F389}` }, { paragraph: body }],
2549
+ text: `${greeting} ${body}`,
2550
+ preheader: body
2551
+ };
2552
+ }
2553
+
2554
+ function withdrawalReceipt({ email, plan, withdrawnAt }, context) {
2555
+ const { t } = context;
2556
+ const at = new Intl.DateTimeFormat(context.locale, { dateStyle: "long", timeStyle: "short", timeZone: "UTC" }).format(withdrawnAt);
2557
+ const intro = t("email.withdrawalReceipt.intro", { plan, at });
2558
+ const next = t("email.withdrawalReceipt.next");
2559
+ return {
2560
+ to: email,
2561
+ subject: t("email.withdrawalReceipt.subject", { plan }),
2562
+ blocks: [{ paragraph: intro }, { paragraph: next }],
2563
+ text: `${intro}
2564
+
2565
+ ${next}`,
2566
+ preheader: intro
2567
+ };
2568
+ }
2569
+
2570
+ const fontOf = (stack) => `font-family:${escapeHtml(stack)}`;
2571
+ function isDocument(markup) {
2572
+ return /^\s*(?:<!doctype|<html)/i.test(markup);
2573
+ }
2574
+ function withNode(t, key, param, node, text) {
2575
+ const marker = "\0node\0";
2576
+ return {
2577
+ html: escapeHtml(t(key, { [param]: marker })).replace(marker, node),
2578
+ text: t(key, { [param]: text })
2579
+ };
2580
+ }
2581
+ function footer({ t, brand, theme }) {
2582
+ if (!brand.name) return { html: "", text: "" };
2583
+ const name = escapeHtml(brand.name);
2584
+ const node = brand.url ? `<a href="${escapeHtml(brand.url)}" style="color:${theme.colors.muted};text-decoration:underline">${name}</a>` : name;
2585
+ const words = withNode(t, "email.layout.sentBy", "brand", node, brand.name);
2586
+ const site = brand.url && brand.name !== hostOf(brand.url) ? `
2587
+ ${brand.url}` : "";
2588
+ return { html: words.html, text: `
2589
+
2590
+ \u2014 ${words.text}${site}` };
2591
+ }
2592
+ function header$1({ brand, theme }) {
2593
+ if (brand.logo) {
2594
+ const image = `<img src="${escapeHtml(brand.logo)}" alt="${escapeHtml(brand.name)}" height="32" style="display:block;height:32px;width:auto;border:0;outline:none">`;
2595
+ return brand.url ? `<a href="${escapeHtml(brand.url)}" style="text-decoration:none">${image}</a>` : image;
2596
+ }
2597
+ if (!brand.name) return "";
2598
+ return `<span class="nb-ink" style="${fontOf(theme.fonts.heading)};font-size:18px;font-weight:700;color:${theme.colors.text}">${escapeHtml(brand.name)}</span>`;
2599
+ }
2600
+ function previewText(text) {
2601
+ return text.replace(/\s+/g, " ").trim().slice(0, 140);
2602
+ }
2603
+ function bodyOf(message, context) {
2604
+ const { blocks, preheader, html: own, text } = message;
2605
+ if (blocks === void 0) return { html: own, text, preheader };
2606
+ if (own !== void 0) throw new TypeError("[nuxt-backend] an email takes `blocks` or `html`, not both.");
2607
+ const rendered = renderBlocks(blocks, context.theme);
2608
+ return { html: rendered.html, text: text ?? rendered.text, preheader: preheader ?? rendered.preheader };
2609
+ }
2610
+ function documentOf(subject, body, footerHtml, context) {
2611
+ const { theme } = context;
2612
+ const { colors } = theme;
2613
+ const top = header$1(context);
2614
+ const font = fontOf(theme.fonts.body);
2615
+ return `<!doctype html><html lang="${escapeHtml(context.locale)}" dir="${textDirection(context.locale)}"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="color-scheme" content="light dark"><meta name="supported-color-schemes" content="light dark"><title>${escapeHtml(subject)}</title><style>${layoutStyles(theme)}</style></head><body class="nb-page" style="margin:0;padding:0;background:${colors.background}">` + (body.preheader ? `<div style="display:none;max-height:0;overflow:hidden;opacity:0">${escapeHtml(previewText(body.preheader))}</div>` : "") + `<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" class="nb-page" style="background:${colors.background}"><tr><td align="center" style="padding:32px 12px"><table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="max-width:560px">` + (top ? `<tr><td style="padding:0 4px 16px;${font}">${top}</td></tr>` : "") + `<tr><td class="nb-card nb-ink" style="background:${colors.card};border:1px solid ${colors.rule};border-radius:12px;padding:28px 24px;${font};font-size:16px;line-height:1.5;color:${colors.text}">${body.html}</td></tr>` + (footerHtml ? `<tr><td class="nb-muted" style="padding:16px 4px;${font};font-size:13px;line-height:1.5;color:${colors.muted}">${footerHtml}${LAYOUT_FOOTER_END}</td></tr>` : "") + "</table></td></tr></table></body></html>";
2616
+ }
2617
+ function withLayout(message, context) {
2618
+ const { blocks: _blocks, preheader: _preheader, html: _html, text: _text, ...rest } = message;
2619
+ const body = bodyOf(message, context);
2620
+ const foot = footer(context);
2621
+ const text = body.text === void 0 ? {} : { text: `${body.text}${foot.text}` };
2622
+ if (body.html === void 0) return { ...rest, ...text };
2623
+ const html2 = isDocument(body.html) ? body.html : documentOf(rest.subject, { html: body.html, preheader: body.preheader }, foot.html, context);
2624
+ return { ...rest, html: html2, ...text };
2625
+ }
2626
+ const PACKAGED_EMAIL_TEMPLATES = {
2627
+ otp: inLayout(otp),
2628
+ passkeyRecovered: inLayout(passkeyRecovered),
2629
+ newDevice: inLayout(newDevice),
2630
+ emailChanged: inLayout(emailChanged),
2631
+ deletionScheduled: inLayout(deletionScheduled),
2632
+ deletionCanceled: inLayout(deletionCanceled),
2633
+ welcome: inLayout(welcome),
2634
+ invite: inLayout(invite),
2635
+ gift: inLayout(gift),
2636
+ giftPassEnding: inLayout(giftPassEnding),
2637
+ waitlistConfirmation: inLayout(waitlistConfirmation),
2638
+ waitlistAdmitted: inLayout(waitlistAdmitted),
2639
+ topicConfirmation: inLayout(topicConfirmation),
2640
+ noticeReceived: inLayout(noticeReceived),
2641
+ noticeDecided: inLayout(noticeDecided),
2642
+ contentRestricted: inLayout(contentRestricted),
2643
+ appealDecided: inLayout(appealDecided),
2644
+ renewalReminder: inLayout(renewalReminder),
2645
+ withdrawalReceipt: inLayout(withdrawalReceipt)
2646
+ };
2647
+ function inLayout(template) {
2648
+ return (data, context) => withLayout(template(data, context), context);
2649
+ }
2650
+ function emailTemplateFile(name) {
2651
+ return `${name.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)}.ts`;
2652
+ }
2653
+ function hostOf(url) {
2654
+ try {
2655
+ return new URL(url).host;
2656
+ } catch {
2657
+ return "";
2658
+ }
2659
+ }
2660
+
2661
+ const STAMP = /nuxt-backend eject: ([^@\s]+)@([\w.+-]+)/;
2662
+ function srcDir(rootDir) {
2663
+ return existsSync(join(rootDir, "app")) ? "app" : ".";
2664
+ }
2665
+ function packaged(path) {
2666
+ for (const candidate of [join(packageDir, path), join(packageDir, path.replace(/^src\//, "dist/"))]) {
2667
+ if (existsSync(candidate)) return candidate;
2668
+ }
2669
+ return void 0;
2670
+ }
2671
+ function ejectables(rootDir) {
2672
+ const app = srcDir(rootDir);
2673
+ const components = REGISTERED_UI.map((entry) => {
2674
+ const base = `src/runtime/vue/components/${uiPath(entry)}`;
2675
+ const files = [{ source: `${base}.vue`, destination: posix.join(app, "components", `${entry.name}.vue`) }];
2676
+ if (packaged(`${base}.css`)) files.push({ source: `${base}.css`, destination: posix.join(app, "components", `${entry.name}.css`) });
2677
+ return { target: entry.name, kind: entry.kind === "part" ? "part" : "component", files };
2678
+ });
2679
+ const pages = BACKEND_PAGE_DEFS.map((def) => ({
2680
+ target: `page:${def.key}`,
2681
+ kind: "page",
2682
+ files: [{ source: `src/runtime/vue/pages/${def.file}.vue`, destination: posix.join(app, "pages", `${def.defaultPath.replace(/^\//, "") || "index"}.vue`) }]
2683
+ }));
2684
+ const emails = Object.keys(PACKAGED_EMAIL_TEMPLATES).map((name) => ({
2685
+ target: `email:${name}`,
2686
+ kind: "email",
2687
+ files: [{ source: `src/convex/emails/${emailTemplateFile(name)}`, destination: posix.join(resolveFunctionsDir(rootDir), "emails", emailTemplateFile(name)) }]
2688
+ }));
2689
+ return [...components, ...pages, ...emails];
2690
+ }
2691
+ function distance(a, b) {
2692
+ const row = Array.from({ length: b.length + 1 }, (_, index) => index);
2693
+ for (let i = 1; i <= a.length; i++) {
2694
+ let previous = row[0];
2695
+ row[0] = i;
2696
+ for (let j = 1; j <= b.length; j++) {
2697
+ const current = row[j];
2698
+ row[j] = Math.min(row[j] + 1, row[j - 1] + 1, previous + (a[i - 1] === b[j - 1] ? 0 : 1));
2699
+ previous = current;
2700
+ }
2701
+ }
2702
+ return row[b.length];
2703
+ }
2704
+ function closeMatches(target, names) {
2705
+ const wanted = target.toLowerCase();
2706
+ const bare = (name) => name.toLowerCase().replace(/^\w+:/, "");
2707
+ const near = (name) => bare(name).includes(wanted) || wanted.includes(bare(name)) || distance(wanted, bare(name)) <= Math.ceil(wanted.length / 3);
2708
+ return names.filter(near).sort((a, b) => distance(wanted, bare(a)) - distance(wanted, bare(b))).slice(0, 3);
2709
+ }
2710
+ function rewriteImports(text, source) {
2711
+ const from = posix.dirname(source.replace(/^src\/runtime\/vue\//, ""));
2712
+ return text.replace(/from '(\.{1,2}\/[^']+)'/g, (match, specifier) => {
2713
+ const target = posix.normalize(posix.join(from, specifier));
2714
+ if (target === "parts") return "from '#backend/parts'";
2715
+ if (target === "a11y") return "from '#backend/a11y'";
2716
+ return `from '#backend/runtime/${target}'`;
2717
+ });
2718
+ }
2719
+ function pageMeta(key) {
2720
+ const def = BACKEND_PAGE_DEFS.find((entry) => entry.key === key);
2721
+ if (!def.auth) return null;
2722
+ const rules = def.access ? `{ ${Object.entries(def.access).map(([key2, value]) => `${key2}: ${JSON.stringify(value).replace(/"/g, "'")}`).join(", ")} }` : "true";
2723
+ return `definePageMeta({ auth: ${rules} })`;
2724
+ }
2725
+ function emailCopy(name, text, stamp) {
2726
+ const source = text.replace(/from '\.\.\/email-(?:templates|helpers)\.js'/g, "from 'nuxt-backend/email'");
2727
+ return [
2728
+ `// ${stamp}`,
2729
+ `// Sent in place of the packaged \`${name}\` email: ../email.ts lists it in \`setupEmail\`'s \`templates\`.`,
2730
+ source
2731
+ ].join("\n");
2732
+ }
2733
+ function addEmailTemplate(text, name) {
2734
+ const file = emailTemplateFile(name).replace(/\.ts$/, "");
2735
+ if (text.includes(`from './emails/${file}'`)) return text;
2736
+ const imported = `import { ${name} } from './emails/${file}'
2737
+ `;
2738
+ const lastImport = [...text.matchAll(/^import .+$/gm)].at(-1);
2739
+ const withImport = lastImport ? `${text.slice(0, lastImport.index + lastImport[0].length + 1)}${imported}${text.slice(lastImport.index + lastImport[0].length + 1)}` : `${imported}${text}`;
2740
+ if (/templates: \{/.test(withImport)) return withImport.replace(/templates: \{/, `templates: { ${name},`);
2741
+ if (/setupEmail\(components\)/.test(withImport)) return withImport.replace(/setupEmail\(components\)/, `setupEmail(components, { templates: { ${name} } })`);
2742
+ if (/setupEmail\(components, \{/.test(withImport)) return withImport.replace(/setupEmail\(components, \{/, `setupEmail(components, { templates: { ${name} },`);
2743
+ return false;
2744
+ }
2745
+ class EjectError extends Error {
2746
+ name = "EjectError";
2747
+ }
2748
+ function copyEmail(rootDir, found, stamp, write) {
2749
+ const name = found.target.slice("email:".length);
2750
+ const file = found.files[0];
2751
+ const source = packaged(file.source);
2752
+ if (!source) throw new EjectError(`The installed nuxt-backend ships no ${file.source}: reinstall it, then eject again.`);
2753
+ write(file.destination, emailCopy(name, readFileSync(source, "utf8"), stamp));
2754
+ const emailPath = posix.join(resolveFunctionsDir(rootDir), "email.ts");
2755
+ const emailFile = join(rootDir, emailPath);
2756
+ const before = existsSync(emailFile) ? readFileSync(emailFile, "utf8") : void 0;
2757
+ const edited = before === void 0 ? false : addEmailTemplate(before, name);
2758
+ if (edited === false) return `Add \`${name}\` to \`setupEmail\`'s \`templates\` in ${emailPath}: \`import { ${name} } from './emails/${emailTemplateFile(name).replace(/\.ts$/, "")}'\`.`;
2759
+ if (edited !== before) write(emailPath, edited);
2760
+ return void 0;
2761
+ }
2762
+ function vueCopy(found, source, text, stamp) {
2763
+ let copy = `<!-- ${stamp} -->
2764
+ ${rewriteImports(text, source)}`;
2765
+ const meta = found.kind === "page" ? pageMeta(found.target.slice("page:".length)) : null;
2766
+ if (meta) copy = copy.replace(/\ndefineOptions\(/, `
2767
+ ${meta}
2768
+ defineOptions(`);
2769
+ const css = found.files.find((other) => other.source.endsWith(".css"));
2770
+ return css ? `${copy.trimEnd()}
2771
+
2772
+ <style src="./${posix.basename(css.destination)}"></style>
2773
+ ` : copy;
2774
+ }
2775
+ function find(rootDir, target) {
2776
+ const all = ejectables(rootDir);
2777
+ const found = all.find((entry) => entry.target === target) ?? all.find((entry) => entry.target.toLowerCase() === target.toLowerCase());
2778
+ if (found) return found;
2779
+ const matches = closeMatches(target, all.map((entry) => entry.target));
2780
+ throw new EjectError(`\`${target}\` is no part, page or email to eject.${matches.length ? ` Did you mean ${matches.map((name) => `\`${name}\``).join(", ")}?` : ""} \`npx nuxt-backend eject --list\` prints them all.`);
2781
+ }
2782
+ function eject(rootDir, target, options = {}) {
2783
+ const found = find(rootDir, target);
2784
+ const version = installedVersion(rootDir);
2785
+ const stamp = `nuxt-backend eject: ${found.target}@${version}`;
2786
+ const taken = found.files.filter((file) => existsSync(join(rootDir, file.destination)));
2787
+ if (taken.length && !options.force) throw new EjectError(`${taken.map((file) => file.destination).join(" and ")} already exists: pass --force to overwrite it.`);
2788
+ const written = [];
2789
+ const write = (destination, text) => {
2790
+ mkdirSync(dirname(join(rootDir, destination)), { recursive: true });
2791
+ writeFileSync(join(rootDir, destination), text);
2792
+ written.push(destination);
2793
+ };
2794
+ if (found.kind === "email") {
2795
+ const todo = copyEmail(rootDir, found, stamp, write);
2796
+ return { target: found.target, version, written, ...todo ? { todo } : {} };
2797
+ }
2798
+ for (const file of found.files) {
2799
+ const source = packaged(file.source);
2800
+ if (!source) throw new EjectError(`The installed nuxt-backend ships no ${file.source}: reinstall it, then eject again.`);
2801
+ const text = readFileSync(source, "utf8");
2802
+ write(file.destination, file.source.endsWith(".css") ? `/* ${stamp} */
2803
+ ${text}` : vueCopy(found, file.source, text, stamp));
2804
+ }
2805
+ return { target: found.target, version, written };
2806
+ }
2807
+ function ejectedFiles(rootDir) {
2808
+ const app = srcDir(rootDir);
2809
+ const dirs = [posix.join(app, "components"), posix.join(app, "pages"), posix.join(resolveFunctionsDir(rootDir), "emails")];
2810
+ const found = [];
2811
+ const walk = (dir) => {
2812
+ const absolute = join(rootDir, dir);
2813
+ if (!existsSync(absolute)) return;
2814
+ for (const entry of readdirSync(absolute, { withFileTypes: true })) {
2815
+ const path = posix.join(dir, entry.name);
2816
+ if (entry.isDirectory()) walk(path);
2817
+ else if (/\.(?:vue|css|ts)$/.test(entry.name)) {
2818
+ const head = readFileSync(join(rootDir, path), "utf8").slice(0, 200);
2819
+ const stamp = head.match(STAMP);
2820
+ if (stamp) found.push({ target: stamp[1], version: stamp[2], file: path });
2821
+ }
2822
+ }
2823
+ };
2824
+ for (const dir of dirs) walk(dir);
2825
+ return found;
2826
+ }
2827
+ function packagedSource(installed, fetcher = fetch) {
2828
+ return async (version, path) => {
2829
+ if (version === installed) {
2830
+ const local = packaged(path);
2831
+ return local ? readFileSync(local, "utf8") : void 0;
2832
+ }
2833
+ try {
2834
+ const response = await fetcher(`https://cdn.jsdelivr.net/npm/nuxt-backend@${encodeURIComponent(version)}/${path}`);
2835
+ return response.ok ? await response.text() : void 0;
2836
+ } catch {
2837
+ return void 0;
2838
+ }
2839
+ };
2840
+ }
2841
+ function sourceOf(rootDir, ejected) {
2842
+ const entry = ejectables(rootDir).find((candidate) => candidate.target === ejected.target);
2843
+ if (!entry) return void 0;
2844
+ const extension = posix.extname(ejected.file);
2845
+ return entry.files.find((file) => posix.extname(file.source) === extension)?.source;
2846
+ }
2847
+ function stillShipped(target) {
2848
+ if (target.startsWith("page:")) return BACKEND_PAGE_DEFS.some((def) => `page:${def.key}` === target);
2849
+ if (target.startsWith("email:")) return target.slice("email:".length) in PACKAGED_EMAIL_TEMPLATES;
2850
+ return uiEntry(target) !== void 0;
2851
+ }
2852
+ const shown = (rootDir, file) => relative(process.cwd(), join(rootDir, file)) || file;
2853
+ const ejectCommand = withContract("eject", {
2854
+ sideEffects: ["writes project files"],
2855
+ byFlag: { "--list": ["reads only"] },
2856
+ json: "each file it wrote, with the version stamped in it: `{ target, version, written, todo? }`; with `--list`, `[{ target, kind, ejected }]`",
2857
+ exitCodes: {
2858
+ 0: "the source was copied",
2859
+ 1: "the name is unknown, or a file is in the way and `--force` was not given"
2860
+ }
2861
+ }, defineCommand({
2862
+ meta: { name: "eject", description: "Copy a part's, a page's or an email's packaged source into the app, stamped with its version, so the app owns it" },
2863
+ args: {
2864
+ target: { type: "positional", description: "A part or a component (`PricingPlanCard`), `page:<key>` or `email:<name>`", required: false },
2865
+ cwd: { type: "string", description: "Project directory", default: "." },
2866
+ list: { type: "boolean", description: "Print every name it can eject, and change nothing", default: false },
2867
+ force: { type: "boolean", description: "Overwrite a file of that name already in the app", default: false },
2868
+ json: { type: "boolean", description: "Machine-readable output", default: false }
2869
+ },
2870
+ run({ args }) {
2871
+ const rootDir = resolve(process.cwd(), args.cwd);
2872
+ if (args.list || !args.target) {
2873
+ const ejected = new Set(ejectedFiles(rootDir).map((file) => file.target));
2874
+ const list = ejectables(rootDir).map((entry) => ({ target: entry.target, kind: entry.kind, ejected: ejected.has(entry.target) }));
2875
+ console.log(args.json ? JSON.stringify(list, null, 2) : list.map((entry) => `${entry.ejected ? "\u2713" : " "} ${entry.target.padEnd(28)} ${entry.kind}`).join("\n"));
2876
+ if (!args.list && !args.target) process.exitCode = 1;
2877
+ return;
2878
+ }
2879
+ try {
2880
+ const report = eject(rootDir, args.target, { force: args.force });
2881
+ if (args.json) {
2882
+ console.log(JSON.stringify(report, null, 2));
2883
+ return;
2884
+ }
2885
+ for (const file of report.written) console.log(`\u2714 ${shown(rootDir, file).padEnd(40)} from nuxt-backend ${report.version}`);
2886
+ if (report.todo) console.log(` \u21B3 ${report.todo}`);
2887
+ } catch (error) {
2888
+ if (!(error instanceof EjectError)) throw error;
2889
+ console.error(`[nuxt-backend] eject: ${error.message}`);
2890
+ process.exitCode = 1;
2891
+ }
2892
+ }
2893
+ }));
2894
+
2895
+ const PACKAGE_MIGRATIONS = [
2896
+ {
2897
+ name: "personalWorkspaces",
2898
+ table: "user",
2899
+ since: "0.2.0",
2900
+ does: "gives each signed-in user without a workspace the personal one their sign-in would have made"
2901
+ },
2902
+ {
2903
+ name: "activeWorkspaces",
2904
+ table: "session",
2905
+ since: "0.2.0",
2906
+ does: "activates a workspace on each live session that has none, so a signed-in user need not sign in again"
2907
+ }
2908
+ ];
2909
+
2910
+ const COMPONENT = "backend";
2911
+ function missingFunction(error) {
2912
+ const text = error instanceof ConvexCliError ? error.stderrTail : String(error);
2913
+ return /could not find function|•\s*[\w/.-]+:\w+/i.test(text);
2914
+ }
2915
+ async function call(rootDir, fn, prod) {
2916
+ const { stdout } = await runConvex(rootDir, ["run", "--component", COMPONENT, ...deploymentFlags({ prod }), `migrations:${fn}`, "{}"], { timeout: 6e4 });
2917
+ return JSON.parse(stdout);
2918
+ }
2919
+ function overall(migrations) {
2920
+ if (migrations.length === 0) return "none";
2921
+ if (migrations.some((migration) => migration.state === "failed")) return "failed";
2922
+ if (migrations.every((migration) => migration.state === "done")) return "done";
2923
+ return migrations.some((migration) => migration.state === "running") ? "running" : "pending";
2924
+ }
2925
+ function unread() {
2926
+ return PACKAGE_MIGRATIONS.map(({ name, since, does }) => ({ name, since, does, state: "pending", processed: 0 }));
2927
+ }
2928
+ const settled = (state) => state === "done" || state === "none" || state === "failed";
2929
+ async function readStatus(rootDir, options) {
2930
+ const deployment = options.prod ? "production" : "dev";
2931
+ if (!options.prod && !configuredDeployment(rootDir) && deployKeyType({ ...readEnvFiles(rootDir), ...process.env }) === null) {
2932
+ return { deployment, state: "skipped", reason: "no dev deployment is configured: `npx nuxt-backend dev` sets one up", migrations: unread() };
2933
+ }
2934
+ try {
2935
+ return await call(rootDir, "status", options.prod);
2936
+ } catch (error) {
2937
+ if (missingFunction(error)) return { deployment, state: "needs-push", reason: `the ${deployment} deployment runs a backend older than this version: push it first`, migrations: unread() };
2938
+ return { deployment, state: options.prod ? "failed" : "skipped", reason: `the ${deployment} deployment did not answer: ${error instanceof Error ? error.message : String(error)}`, migrations: unread() };
2939
+ }
2940
+ }
2941
+ async function follow(rootDir, started, options) {
2942
+ let migrations = started;
2943
+ const deadline = Date.now() + (options.wait ?? 12e4);
2944
+ while (!settled(overall(migrations)) && Date.now() < deadline) {
2945
+ options.print?.(`[nuxt-backend] upgrade: ${migrations.filter((migration) => migration.state === "done").length} of ${migrations.length} package migrations done\u2026`);
2946
+ await setTimeout(options.interval ?? 1500);
2947
+ migrations = await call(rootDir, "status", options.prod).catch(() => migrations);
2948
+ }
2949
+ return migrations;
2950
+ }
2951
+ async function migrateData(rootDir, options) {
2952
+ const deployment = options.prod ? "production" : "dev";
2953
+ const status = await readStatus(rootDir, options);
2954
+ if (!Array.isArray(status)) return status;
2955
+ const before = overall(status);
2956
+ if (options.dryRun || before === "done" || before === "none") return { deployment, state: before, migrations: status };
2957
+ let started;
2958
+ try {
2959
+ started = await call(rootDir, "run", options.prod);
2960
+ } catch (error) {
2961
+ return { deployment, state: "failed", reason: `starting the migrations failed: ${error instanceof Error ? error.message : String(error)}`, migrations: status };
2962
+ }
2963
+ const migrations = await follow(rootDir, started, options);
2964
+ const state = overall(migrations);
2965
+ return { deployment, state: state === "pending" ? "running" : state, migrations };
2966
+ }
2967
+
2968
+ const MAX_CELLS = 4e6;
2969
+ function subsequences(left, right) {
2970
+ const width = right.length + 1;
2971
+ const lengths = new Uint32Array((left.length + 1) * width);
2972
+ const at = (i, j) => lengths[i * width + j];
2973
+ for (let i = left.length - 1; i >= 0; i--) {
2974
+ for (let j = right.length - 1; j >= 0; j--) lengths[i * width + j] = left[i] === right[j] ? at(i + 1, j + 1) + 1 : Math.max(at(i + 1, j), at(i, j + 1));
2975
+ }
2976
+ return at;
2977
+ }
2978
+ function stepAt(left, right, i, j, at) {
2979
+ if (i < left.length && j < right.length && left[i] === right[j]) return " ";
2980
+ if (j === right.length) return "-";
2981
+ if (i === left.length) return "+";
2982
+ return at(i + 1, j) >= at(i, j + 1) ? "-" : "+";
2983
+ }
2984
+ function matched(left, right) {
2985
+ if (left.length * right.length > MAX_CELLS) return [...left.map((line) => ({ kind: "-", line })), ...right.map((line) => ({ kind: "+", line }))];
2986
+ const at = subsequences(left, right);
2987
+ const result = [];
2988
+ let i = 0;
2989
+ let j = 0;
2990
+ while (i < left.length || j < right.length) {
2991
+ const kind = stepAt(left, right, i, j, at);
2992
+ result.push({ kind, line: kind === "+" ? right[j] : left[i] });
2993
+ if (kind !== "+") i++;
2994
+ if (kind !== "-") j++;
2995
+ }
2996
+ return result;
2997
+ }
2998
+ function operations(a, b) {
2999
+ let head = 0;
3000
+ while (head < a.length && head < b.length && a[head] === b[head]) head++;
3001
+ let tail = 0;
3002
+ while (tail < a.length - head && tail < b.length - head && a[a.length - 1 - tail] === b[b.length - 1 - tail]) tail++;
3003
+ const kept = (lines) => lines.map((line) => ({ kind: " ", line }));
3004
+ return [...kept(a.slice(0, head)), ...matched(a.slice(head, a.length - tail), b.slice(head, b.length - tail)), ...kept(a.slice(a.length - tail))];
3005
+ }
3006
+ function unifiedDiff(path, before, after, context = 1) {
3007
+ const normal = (text) => text.replace(/^\uFEFF/, "").replace(/\r\n/g, "\n");
3008
+ if (normal(before) === normal(after)) return "";
3009
+ const ops = operations(normal(before).split("\n"), normal(after).split("\n"));
3010
+ const changed = ops.flatMap((op, index) => op.kind === " " ? [] : [index]);
3011
+ const ranges = [];
3012
+ for (const index of changed) {
3013
+ const last = ranges.at(-1);
3014
+ if (last && index - context <= last[1]) last[1] = Math.min(ops.length, index + context + 1);
3015
+ else ranges.push([Math.max(0, index - context), Math.min(ops.length, index + context + 1)]);
3016
+ }
3017
+ const lines = [`--- a/${path}`, `+++ b/${path}`];
3018
+ let oldLine = 1;
3019
+ let newLine = 1;
3020
+ const starts = ops.map((op) => {
3021
+ const at = { old: oldLine, new: newLine };
3022
+ if (op.kind !== "+") oldLine++;
3023
+ if (op.kind !== "-") newLine++;
3024
+ return at;
3025
+ });
3026
+ for (const [start, end] of ranges) {
3027
+ const slice = ops.slice(start, end);
3028
+ const oldCount = slice.filter((op) => op.kind !== "+").length;
3029
+ const newCount = slice.filter((op) => op.kind !== "-").length;
3030
+ lines.push(`@@ -${starts[start].old},${oldCount} +${starts[start].new},${newCount} @@`, ...slice.map((op) => `${op.kind}${op.line}`));
3031
+ }
3032
+ return lines.join("\n");
3033
+ }
3034
+
3035
+ async function ejectedChanges(rootDir, options = {}) {
3036
+ const to = installedVersion(rootDir);
3037
+ const source = options.source ?? packagedSource(to);
3038
+ const files = ejectedFiles(rootDir).filter((file) => file.version !== to && (!options.only || file.target === options.only));
3039
+ return Promise.all(files.map(async (ejected) => {
3040
+ const base = { target: ejected.target, file: ejected.file, from: ejected.version, to };
3041
+ const path = sourceOf(rootDir, ejected);
3042
+ if (!path || !stillShipped(ejected.target)) return { ...base, changes: null, removed: true };
3043
+ const [before, after] = await Promise.all([source(ejected.version, path), source(to, path)]);
3044
+ if (before === void 0 || after === void 0) return { ...base, changes: null };
3045
+ const diff = unifiedDiff(path, before, after);
3046
+ const changes = diff.split("\n").filter((line) => line.startsWith("@@")).length;
3047
+ return { ...base, changes, ...options.diff ? { diff } : {} };
3048
+ }));
3049
+ }
3050
+ function formatEjected(changes) {
3051
+ if (changes.length === 0) return [];
3052
+ const lines = ["Ejected files"];
3053
+ for (const change of changes) {
3054
+ const versions = `${change.from} \u2192 ${change.to}`;
3055
+ const what = change.removed ? "no longer shipped: the packaged part, page or email is gone" : change.changes === null ? `the ${change.from} source could not be read` : `${change.changes} upstream change${change.changes === 1 ? "" : "s"}`;
3056
+ lines.push(` ${change.target.padEnd(20)} ${versions.padEnd(18)} ${what}`);
3057
+ if (change.diff) lines.push(...change.diff.split("\n").map((line) => ` ${line}`));
3058
+ else if (!change.removed && change.changes) lines.push(` ${" ".repeat(20)} npx nuxt-backend upgrade --diff ${change.target}`);
3059
+ }
3060
+ return lines;
3061
+ }
3062
+
3063
+ const indented = (block) => block.split("\n").map((line) => ` ${line}`);
3064
+ function header(report) {
3065
+ return [`nuxt-backend upgrade: \u2192 ${report.to}${report.dryRun ? " \u2014 dry run, nothing written" : ""}`];
3066
+ }
3067
+ function scaffold(report) {
3068
+ const { written, changes, diffs = [] } = report.scaffold;
3069
+ const lines = ["Scaffold (the repairs `doctor --fix` makes)"];
3070
+ if (written.length === 0 && changes.length === 0) lines.push(" \xB7 nothing to repair");
3071
+ lines.push(...written.map((file) => ` ${report.dryRun ? "would write" : "\u2713 wrote"} ${file}`));
3072
+ lines.push(...changes.map((change) => ` ${report.dryRun ? "would change" : "\u2713"} ${change}`));
3073
+ return [...lines, ...diffs.flatMap(indented)];
3074
+ }
3075
+ const MARKS = { done: "\u2713", running: "\u2026", pending: "\xB7", failed: "\u2717" };
3076
+ function data(report) {
3077
+ const { deployment, state, reason, migrations } = report.data;
3078
+ const lines = [`Data (the package's own migrations, ${deployment} deployment)`];
3079
+ if (reason) return [...lines, ` ${state === "failed" ? "\u2717" : "\xB7"} ${state}: ${reason}`];
3080
+ if (state === "none") lines.push(" \xB7 this version has none");
3081
+ for (const migration of migrations) {
3082
+ const read = migration.processed ? ` (${migration.processed} read)` : "";
3083
+ lines.push(` ${MARKS[migration.state]} ${migration.name.padEnd(20)} ${migration.state}${read} \u2014 ${migration.does}${migration.error ? `: ${migration.error}` : ""}`);
3084
+ }
3085
+ if (state === "running") lines.push(" The migrations go on in the deployment; run the command again to see them finish.");
3086
+ return lines;
3087
+ }
3088
+ function formatUpgrade(report) {
3089
+ return [
3090
+ ...header(report),
3091
+ "",
3092
+ ...scaffold(report),
3093
+ "",
3094
+ ...report.ejected.length ? [...formatEjected(report.ejected), ""] : [],
3095
+ ...data(report),
3096
+ "",
3097
+ "Next",
3098
+ ...report.next.map((command) => ` ${command}`)
3099
+ ];
3100
+ }
3101
+
3102
+ function filesUnder(dir, prefix = "") {
3103
+ if (!existsSync(dir)) return [];
3104
+ return readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {
3105
+ const path = `${prefix}${entry.name}`;
3106
+ if (entry.isDirectory()) return entry.name === "node_modules" ? [] : filesUnder(join(dir, entry.name), `${path}/`);
3107
+ return entry.isFile() ? [path] : [];
3108
+ });
3109
+ }
3110
+ function projectCopy(scratch, rootDir, functionsDir) {
3111
+ const path = relative(rootDir, resolve(rootDir, functionsDir));
3112
+ if (isAbsolute(path)) return void 0;
3113
+ const up = path.split(sep).filter((segment) => segment === "..").length;
3114
+ const kept = up === 0 ? [] : resolve(rootDir).split(sep).filter(Boolean).slice(-up).map((segment) => segment.replace(/:/g, ""));
3115
+ return join(scratch, ...kept);
3116
+ }
3117
+ function copyProject(rootDir, scratch, functionsDir) {
3118
+ mkdirSync(scratch, { recursive: true });
3119
+ const read = [functionsDir, "convex.json", "package.json"];
3120
+ for (const path of read.filter((item) => existsSync(join(rootDir, item)))) {
3121
+ cpSync(join(rootDir, path), join(scratch, path), { recursive: true, dereference: true, filter: (source) => !source.includes(join(rootDir, "node_modules")) });
3122
+ }
3123
+ if (existsSync(join(rootDir, "node_modules"))) symlinkSync(join(rootDir, "node_modules"), join(scratch, "node_modules"), "junction");
3124
+ }
3125
+ async function planRepairs(rootDir) {
3126
+ const scratchDir = mkdtempSync(join(tmpdir(), "nuxt-backend-upgrade-"));
3127
+ try {
3128
+ const functionsDir = resolveFunctionsDir(rootDir);
3129
+ const scratch = projectCopy(scratchDir, rootDir, functionsDir);
3130
+ if (!scratch) return { written: [], changes: [`${functionsDir}: on another drive, which the dry run cannot copy; \`npx nuxt-backend doctor\` names what the repairs would change`], files: [] };
3131
+ copyProject(rootDir, scratch, functionsDir);
3132
+ const { written, changes } = await repairProjectFiles(scratch);
3133
+ const files = [...filesUnder(join(scratch, functionsDir), `${functionsDir}/`), "convex.json", "package.json"].flatMap((path) => {
3134
+ if (!existsSync(join(scratch, path))) return [];
3135
+ const after = readFileSync(join(scratch, path), "utf-8");
3136
+ const before = existsSync(join(rootDir, path)) ? readFileSync(join(rootDir, path), "utf-8") : "";
3137
+ return after === before ? [] : [{ path, before, after }];
3138
+ });
3139
+ return { written, changes, files };
3140
+ } finally {
3141
+ rmSync(scratchDir, { recursive: true, force: true });
3142
+ }
3143
+ }
3144
+
3145
+ const PRODUCTION_DEPLOY = "npx convex deploy --cmd 'npm run build' --cmd-url-env-var-name NUXT_PUBLIC_BACKEND_URL";
3146
+ function nextCommands(rootDir, report, prod) {
3147
+ const next = [];
3148
+ if (report.dryRun) next.push(`npx nuxt-backend upgrade${prod ? " --prod --yes" : ""}`);
3149
+ if (!report.dryRun && report.data.state === "needs-push") next.push(...prod ? [PRODUCTION_DEPLOY, "npx nuxt-backend upgrade --prod --yes"] : ["npx nuxt-backend dev", "npx nuxt-backend upgrade"]);
3150
+ if (agentsMdVersion(rootDir) !== report.to) next.push("npx nuxt-backend init --agents");
3151
+ next.push(`npx nuxt-backend doctor${prod ? " --prod" : ""}`, "npx nuxt typecheck");
3152
+ return [...new Set(next)];
3153
+ }
3154
+ async function runUpgrade(rootDir, options) {
3155
+ const to = installedVersion(rootDir);
3156
+ let scaffold;
3157
+ if (options.dryRun) {
3158
+ const planned = await planRepairs(rootDir);
3159
+ scaffold = { written: planned.written, changes: planned.changes, diffs: planned.files.filter((file) => !planned.written.includes(file.path)).map((file) => unifiedDiff(file.path, file.before, file.after)) };
3160
+ } else {
3161
+ options.print("[nuxt-backend] upgrade: the repairs doctor --fix makes\u2026");
3162
+ scaffold = await repairProjectFiles(rootDir);
3163
+ }
3164
+ const ejected = await ejectedChanges(rootDir);
3165
+ options.print(`[nuxt-backend] upgrade: the package's data migrations, ${options.prod ? "production" : "dev"} deployment\u2026`);
3166
+ const data = await migrateData(rootDir, { prod: options.prod, dryRun: options.dryRun, print: options.print });
3167
+ const report = { to, dryRun: options.dryRun, scaffold, ejected, data };
3168
+ return { ...report, next: nextCommands(rootDir, report, options.prod) };
3169
+ }
3170
+ function refusal(rootDir, args) {
3171
+ if (args.prod && !args.yes && !args["dry-run"]) return "--prod migrates the production data: add --yes to confirm, or --dry-run to see where it stands.";
3172
+ const env = { ...readEnvFiles(rootDir), ...process.env };
3173
+ const foreign = args.prod ? nonProductionDeployKey(env) : deployKeyType(env);
3174
+ if (args.prod && foreign) return `CONVEX_DEPLOY_KEY is a ${foreign} deploy key, and the Convex CLI would migrate that deployment instead of production. Use the production deploy key.`;
3175
+ if (!args.prod && foreign !== null && foreign !== "dev") return `CONVEX_DEPLOY_KEY is a ${foreign} deploy key, and the Convex CLI follows it whatever the flags say, so the dev data migrations would run on that deployment. Unset it to migrate the dev deployment, or run with --prod --yes for production.`;
3176
+ return void 0;
3177
+ }
3178
+ function failed(report, prod) {
3179
+ const productionLeft = prod && !["done", "none", "running", "pending"].includes(report.data.state);
3180
+ return report.data.state === "failed" || productionLeft;
3181
+ }
3182
+ const upgrade = withContract("upgrade", {
3183
+ sideEffects: ["writes project files", "writes the dev deployment"],
3184
+ byFlag: {
3185
+ "--dry-run": ["reads only"],
3186
+ "--diff": ["reads only"],
3187
+ "--prod --yes": ["writes project files", "writes production"]
3188
+ },
3189
+ json: "`{ to, dryRun, scaffold: { written, changes, diffs }, ejected: [{ target, file, from, to, changes }], data: { deployment, state, reason, migrations }, next }`: `data.state` is `done`, `running`, `pending`, `none`, `skipped`, `needs-push` or `failed`; `scaffold.diffs` comes with `--dry-run` only; with `--diff`, `[{ target, file, from, to, changes, diff }]` alone; progress goes to stderr",
3190
+ exitCodes: {
3191
+ 0: "done: the scaffold repaired; the data migrated, still migrating, waiting for a push, or skipped with no dev deployment",
3192
+ 1: "refused, a data migration failed, or with `--prod`, production could not be migrated"
3193
+ }
3194
+ }, defineCommand({
3195
+ meta: { name: "upgrade", description: "Move the app to the installed version: repair the scaffold as doctor --fix does, and run the package's data migrations. It rewrites none of the app's code" },
3196
+ args: {
3197
+ "cwd": { type: "string", description: "Project directory", default: "." },
3198
+ "dry-run": { type: "boolean", description: "Show what the scaffold repairs would change, as diffs, and where the data migrations stand; write nothing", default: false },
3199
+ "diff": { type: "string", description: "Print the upstream changes to each ejected file, or to the one named, as a unified diff; write nothing" },
3200
+ "prod": { type: "boolean", description: "Run the data migrations on the production deployment; needs --yes", default: false },
3201
+ "yes": { type: "boolean", description: "Confirm --prod: the production data is migrated", default: false },
3202
+ "json": { type: "boolean", description: "Machine-readable output", default: false }
3203
+ },
3204
+ async run({ args }) {
3205
+ const rootDir = resolve(process.cwd(), args.cwd);
3206
+ if (args.diff !== void 0) {
3207
+ const only = typeof args.diff === "string" && args.diff !== "" && args.diff !== "true" ? args.diff : void 0;
3208
+ const changes = await ejectedChanges(rootDir, { diff: true, only });
3209
+ console.log(args.json ? JSON.stringify(changes, null, 2) : (changes.length ? formatEjected(changes) : ["No ejected file names an older version."]).join("\n"));
3210
+ return;
3211
+ }
3212
+ const refused = refusal(rootDir, args);
3213
+ if (refused) {
3214
+ console.error(`[nuxt-backend] upgrade refused: ${refused}`);
3215
+ process.exitCode = 1;
3216
+ return;
3217
+ }
3218
+ const report = await runUpgrade(rootDir, { dryRun: args["dry-run"], prod: args.prod, print: progress(args.json) });
3219
+ console.log(args.json ? JSON.stringify(report, null, 2) : formatUpgrade(report).join("\n"));
3220
+ if (failed(report, args.prod)) process.exitCode = 1;
3221
+ }
3222
+ }));
3223
+
3224
+ function refuseNonProductionKey(prod, rootDir) {
3225
+ if (!prod) return false;
3226
+ const type = nonProductionDeployKey({ ...readEnvFiles(rootDir), ...process.env });
3227
+ if (!type) return false;
3228
+ console.error(`[nuxt-backend] --prod refused: CONVEX_DEPLOY_KEY is a ${type} deployment key, and the Convex CLI would act on that deployment instead of production. Use the production deploy key (Convex dashboard \u2192 Settings, or your host's production environment).`);
3229
+ process.exitCode = 1;
3230
+ return true;
3231
+ }
3232
+ function refuseDevFixKey(rootDir) {
3233
+ const refusal = devPushRefusal(rootDir);
3234
+ if (!refusal) return false;
3235
+ console.error(`[nuxt-backend] doctor --fix refused: ${refusal}`);
3236
+ process.exitCode = 1;
3237
+ return true;
3238
+ }
3239
+ const cwdArg = {
3240
+ cwd: { type: "string", description: "Project directory", default: "." }
3241
+ };
3242
+ function projectRoot(args) {
3243
+ return resolve(process.cwd(), args.cwd);
3244
+ }
3245
+ async function addModuleToNuxtConfig(rootDir) {
3246
+ const configPath = ["nuxt.config.ts", "nuxt.config.js", "nuxt.config.mjs"].map((name) => join(rootDir, name)).find(existsSync);
3247
+ if (!configPath) return false;
3248
+ try {
3249
+ const { loadFile, writeFile } = await import('magicast');
3250
+ const { addNuxtModule } = await import('magicast/helpers');
3251
+ const config = await loadFile(configPath);
3252
+ addNuxtModule(config, "nuxt-backend");
3253
+ await writeFile(config, configPath);
3254
+ return true;
3255
+ } catch {
3256
+ return false;
3257
+ }
3258
+ }
3259
+ function refreshAgentFiles(rootDir, json, print) {
3260
+ const { agentsMd, mcpJson, skills, messages, mcpSdkDependency } = setUpAgentFiles(rootDir, true, print);
3261
+ if (agentsMd === "malformed") process.exitCode = 1;
3262
+ if (messages.length === 0 && !mcpSdkDependency) print(`[nuxt-backend] AGENTS.md, .mcp.json and the agent skills are current for nuxt-backend ${installedVersion(rootDir)}`);
3263
+ if (mcpSdkDependency) print(`[nuxt-backend] Run \`npm install\` to link it, then restart your agent.`);
3264
+ if (json) {
3265
+ const report = { agentsMd, mcpJson, skills, mcpSdkDependency };
3266
+ console.log(JSON.stringify(report, null, 2));
3267
+ }
3268
+ }
3269
+ const init = withContract("init", {
3270
+ sideEffects: ["writes project files"],
3271
+ json: "`{ created, agentsMd, mcpJson, skills, appComponent, devScript, convexDependency, mcpSdkDependency, nuxtConfig, next }`, or `{ agentsMd, mcpJson, skills, mcpSdkDependency }` with `--agents`, where `skills` is `{ installed, refreshed, removed, stale }`, each a list of skill names; progress goes to stderr",
3272
+ exitCodes: {
3273
+ 0: "done: every file written, or already in place",
3274
+ 1: "a file could not be written, or AGENTS.md was refused: its nuxt-backend markers don't pair up"
3275
+ }
3276
+ }, defineCommand({
3277
+ meta: { name: "init", description: "Scaffold the backend files, .env.example, and nuxt.config wiring (re-run to restore missing files; --force to reset)" },
3278
+ args: {
3279
+ ...cwdArg,
3280
+ force: { type: "boolean", description: "Overwrite existing scaffold files and .env.example, replace AGENTS.md's nuxt-backend section, and replace or remove agent skill copies another version wrote", default: false },
3281
+ // No default: a bare `init` writes the agent files beside the scaffold, `--agents` refreshes only them, `--no-agents` skips them.
3282
+ agents: { type: "boolean", description: "Coding-agent files: --agents rewrites only AGENTS.md's nuxt-backend section, .mcp.json and the agent skills in .agents/skills for the installed version, and adds the MCP SDK to devDependencies when missing; --no-agents skips them all" },
3283
+ json: { type: "boolean", description: "Machine-readable output", default: false }
3284
+ },
3285
+ async run({ args }) {
3286
+ const rootDir = projectRoot(args);
3287
+ const print = progress(args.json);
3288
+ if (args.agents === true) {
3289
+ refreshAgentFiles(rootDir, args.json, print);
3290
+ return;
3291
+ }
3292
+ const { start, ...setup } = setUpProject(rootDir, { force: args.force, agents: args.agents !== false, print });
3293
+ if (setup.agentsMd === "malformed") process.exitCode = 1;
3294
+ const listed = await addModuleToNuxtConfig(rootDir);
3295
+ print(listed ? "[nuxt-backend] Added 'nuxt-backend' to nuxt.config modules" : "[nuxt-backend] Add the module yourself: modules: ['nuxt-backend'] in nuxt.config.ts");
3296
+ if (args.json) {
3297
+ const report = { ...setup, nuxtConfig: listed ? "listed" : "manual", next: nextCommands$1({ ...setup, start }) };
3298
+ console.log(JSON.stringify(report, null, 2));
3299
+ return;
3300
+ }
3301
+ console.log(`
3302
+ ${formatNextSteps({ ...setup, start })}
3303
+ `);
3304
+ }
3305
+ }));
3306
+ async function repairProject(rootDir, prod, print, { interactive, yes, only }) {
3307
+ await repairProjectFiles(rootDir, print);
3308
+ const run = await runEnvPush(rootDir, { prod });
3309
+ if (!run) {
3310
+ print("[nuxt-backend] doctor --fix: no deployment reachable \u2014 env not pushed.");
3311
+ return null;
3312
+ }
3313
+ print(`[nuxt-backend] doctor --fix: env push \u2192 ${run.deployment ?? "deployment"}`);
3314
+ reportEnvPush(run, { json: false, dryRun: false, print });
3315
+ if (interactive) await bootstrapAdmin(rootDir, { prod, ask: askOnTerminal, print });
3316
+ print("[nuxt-backend] doctor --fix: email sync");
3317
+ await runEmailSyncCommand(rootDir, { prod }, print);
3318
+ const wanted = (capability) => !only || only.length === 0 || only.includes(capability);
3319
+ if (wanted("billing") || wanted("email")) {
3320
+ print("[nuxt-backend] doctor --fix: provider settings");
3321
+ await fixProviderSettings(rootDir, { prod, confirm: changeConfirmation({ yes, interactive, ask: askOnTerminal, print }), print, billing: wanted("billing"), email: wanted("email") });
3322
+ }
3323
+ const set = run.results.filter((result) => result.outcome === "set").map((result) => result.action.name);
3324
+ return [.../* @__PURE__ */ new Set([...run.deployedNames, ...set])];
3325
+ }
3326
+ function reportEnvPush(run, { json, dryRun, print = console.log }) {
3327
+ const failed = run.results.filter((result) => result.outcome === "failed");
3328
+ if (json) {
3329
+ console.log(JSON.stringify({
3330
+ deployment: run.deployment,
3331
+ dev: run.dev,
3332
+ results: run.results.map(({ action, outcome, error }) => ({ name: action.name, action: action.action, detail: action.detail, outcome, error })),
3333
+ missingRequired: run.missingRequired
3334
+ }, null, 2));
3335
+ } else {
3336
+ const label = { set: dryRun ? "would set" : "set", planned: "would set", skipped: "\xB7", failed: "\u2717" };
3337
+ for (const { action, outcome, error } of run.results) {
3338
+ const verb = action.action === "skip" ? "skipped" : action.action === "unset" ? "unset" : action.action === "missing" ? "MISSING" : label[outcome];
3339
+ print(` ${verb.padEnd(9)} ${action.name.padEnd(24)} ${error ?? action.detail}`);
3340
+ }
3341
+ if (run.missingRequired.length > 0) {
3342
+ print(`
3343
+ Required env missing: ${run.missingRequired.join(", ")} \u2014 see the line above for where each comes from, then push again.`);
3344
+ }
3345
+ }
3346
+ return failed.length > 0 || run.missingRequired.length > 0;
3347
+ }
3348
+ function ciBranch(env2 = process.env) {
3349
+ if (env2.VERCEL) return env2.VERCEL_GIT_COMMIT_REF ?? null;
3350
+ if (env2.NETLIFY) return env2.HEAD ?? null;
3351
+ if (env2.CF_PAGES || env2.WORKERS_CI) return env2.CF_PAGES_BRANCH ?? env2.WORKERS_CI_BRANCH ?? null;
3352
+ if (env2.CI) return env2.GITHUB_HEAD_REF ?? env2.CI_COMMIT_REF_NAME ?? null;
3353
+ return null;
3354
+ }
3355
+ function envPushTarget(args) {
3356
+ const preview = args.preview;
3357
+ const defaults = args.defaults;
3358
+ if ([args.prod, preview !== void 0, defaults !== void 0].filter(Boolean).length > 1) {
3359
+ return { refusal: "env push takes one target: --prod, --preview or --defaults." };
3360
+ }
3361
+ if (defaults !== void 0) {
3362
+ if (!ENV_DEFAULT_TYPES.includes(defaults)) {
3363
+ return { refusal: `--defaults takes ${ENV_DEFAULT_TYPES.join(" or ")}${defaults.startsWith("prod") ? ": production never starts from generated values" : ""}.` };
3364
+ }
3365
+ return { kind: "defaults", type: defaults };
3366
+ }
3367
+ if (preview !== void 0) {
3368
+ const name = preview || ciBranch();
3369
+ if (!name) return { refusal: "--preview needs the preview deployment's name: the branch `convex deploy` named it after (outside a CI build that names one, pass it: --preview <name>)." };
3370
+ return { kind: "preview", name };
3371
+ }
3372
+ return { kind: "deployment", prod: args.prod };
3373
+ }
3374
+ function parseSiteUrl(raw) {
3375
+ if (raw === void 0 || raw.trim() === "") return void 0;
3376
+ try {
3377
+ const url = new URL(raw.trim());
3378
+ if (url.protocol === "http:" || url.protocol === "https:") return url.href.replace(/\/+$/, "");
3379
+ } catch {
3380
+ }
3381
+ console.error(`[nuxt-backend] --site-url must be an http(s) URL, such as https://my-branch.example.app \u2014 got "${raw}".`);
3382
+ process.exitCode = 1;
3383
+ return null;
3384
+ }
3385
+ function deployKeyRefusal(target, rootDir) {
3386
+ const type = deployKeyType({ ...readEnvFiles(rootDir), ...process.env });
3387
+ if (target.kind === "preview" && type !== null && type !== "preview") {
3388
+ return `--preview refused: CONVEX_DEPLOY_KEY is a ${type} deploy key, and the Convex CLI would act on that deployment instead of the preview. Use a preview deploy key, or unset it to use your login.`;
3389
+ }
3390
+ if (target.kind === "defaults" && type === "prod") {
3391
+ return "--defaults refused: CONVEX_DEPLOY_KEY is a production deploy key. Write project env defaults with your login, or a dev or preview key.";
3392
+ }
3393
+ if (target.kind === "deployment" && !target.prod) {
3394
+ const refusal = devPushRefusal(rootDir);
3395
+ if (refusal) return `env push refused: ${refusal}`;
3396
+ }
3397
+ return null;
3398
+ }
3399
+ const envPushArgs = {
3400
+ ...cwdArg,
3401
+ "prod": { type: "boolean", description: "Act on the production deployment; never invent values; fail on missing required env", default: false },
3402
+ "preview": { type: "string", description: "Act on the preview deployment of this name (empty: the branch the CI build names, as convex deploy does); fills AUTH_SECRET, test-mode email and sandbox billing" },
3403
+ "defaults": { type: "string", description: "Write the project env defaults new deployments of this type start with: preview or dev" },
3404
+ "site-url": { type: "string", description: "The SITE_URL to write, replacing the one already set (a preview's own origin)" },
3405
+ "dry-run": { type: "boolean", description: "Print the plan without setting anything", default: false },
3406
+ "force": { type: "string", description: 'Replace values already on the deployment with the local ones: a comma-separated list of names, or every name but BACKEND_ENVIRONMENT when bare (or "all"), which --prod refuses' },
3407
+ "json": { type: "boolean", description: "Machine-readable output", default: false }
3408
+ };
3409
+ const envPush = withContract("env push", {
3410
+ sideEffects: ["writes the dev deployment"],
3411
+ byFlag: {
3412
+ "--prod": ["writes production"],
3413
+ "--preview": ["writes a preview deployment"],
3414
+ "--defaults": ["writes project env defaults"],
3415
+ "--dry-run": ["reads only"]
3416
+ },
3417
+ json: "`{ deployment, dev, results: [{ name, action, detail, outcome, error }], missingRequired }`: `deployment` names what was written (`dev:<slug>`, `production`, `preview:<name>`, `defaults:<type>`); values never appear",
3418
+ exitCodes: {
3419
+ 0: "every value set, or nothing to set",
3420
+ 1: "refused, no deployment (or project defaults) reachable, a set failed, or required env is missing"
3421
+ }
3422
+ }, defineCommand({
3423
+ meta: { name: "push", description: "Sync backend env from .env(.local) to the Convex deployment (dev deployments also get AUTH_SECRET/SITE_URL provisioned)" },
3424
+ args: envPushArgs,
3425
+ async run({ rawArgs }) {
3426
+ const args = parseEnvPushArgs(rawArgs, envPushArgs);
3427
+ const rootDir = projectRoot(args);
3428
+ const target = envPushTarget(args);
3429
+ const siteUrl = parseSiteUrl(args["site-url"]);
3430
+ if (siteUrl === null) return;
3431
+ const refusal = "refusal" in target ? target.refusal : deployKeyRefusal(target, rootDir) ?? forceRefusal(args.force, { prod: target.kind === "deployment" && target.prod });
3432
+ if (refusal || "refusal" in target) {
3433
+ console.error(`[nuxt-backend] ${refusal}`);
3434
+ process.exitCode = 1;
3435
+ return;
3436
+ }
3437
+ const resolved = target;
3438
+ if (resolved.kind === "deployment" && refuseNonProductionKey(resolved.prod, rootDir)) return;
3439
+ const force = parseForce(args.force);
3440
+ const common = { dryRun: args["dry-run"], ...force ? { force } : {}, ...siteUrl ? { siteUrl } : {} };
3441
+ const run = resolved.kind === "defaults" ? await runEnvDefaults(rootDir, { type: resolved.type, ...common }) : await runEnvPush(rootDir, { ...common, ...resolved.kind === "preview" ? { preview: resolved.name } : { prod: resolved.prod } });
3442
+ if (!run) {
3443
+ console.error(resolved.kind === "defaults" ? "[nuxt-backend] Could not read the project's env defaults: they exist for cloud projects, with your Convex login or a deploy key. Run `npx convex dev` once with a cloud deployment, then push again." : "[nuxt-backend] No Convex deployment reachable \u2014 run `npx convex dev` once, then push again.");
3444
+ process.exitCode = 1;
3445
+ return;
3446
+ }
3447
+ if (!args.json) {
3448
+ const label = resolved.kind === "defaults" ? `project env defaults for new ${resolved.type} deployments` : run.deployment ?? "deployment";
3449
+ console.log(`[nuxt-backend] env push \u2192 ${label}${run.dev ? " (dev)" : ""}${args["dry-run"] ? " \u2014 dry run" : ""}`);
3450
+ }
3451
+ const problems = reportEnvPush(run, { json: args.json, dryRun: args["dry-run"] });
3452
+ if (problems) process.exitCode = 1;
3453
+ }
3454
+ }));
3455
+ const env = defineCommand({
3456
+ meta: { name: "env", description: "Deployment environment helpers" },
3457
+ subCommands: { push: envPush, rotate: envRotate }
3458
+ });
3459
+ function parseOnly(raw) {
3460
+ if (typeof raw !== "string" || raw.trim() === "") return void 0;
3461
+ const names = raw.split(",").map((name) => name.trim().toLowerCase()).filter(Boolean);
3462
+ const unknown = names.filter((name) => !CAPABILITY_NAMES.includes(name));
3463
+ if (unknown.length > 0) {
3464
+ console.error(`[nuxt-backend] doctor --only: ${unknown.join(", ")} is not a capability. Capabilities: ${CAPABILITY_NAMES.join(", ")}.`);
3465
+ process.exitCode = 1;
3466
+ return null;
3467
+ }
3468
+ return names;
3469
+ }
3470
+ const doctor = withContract("doctor", {
3471
+ sideEffects: ["reads only"],
3472
+ byFlag: {
3473
+ "--fix": ["writes project files", "writes the dev deployment", "writes provider accounts"],
3474
+ "--fix --prod": ["writes project files", "writes production", "writes provider accounts"]
3475
+ },
3476
+ json: "`{ $schema, findings, summary }`, described by https://nuxt-backend.dev/schemas/doctor.json; with `--fix`, the repair's progress goes to stderr",
3477
+ exitCodes: {
3478
+ 0: "no finding failed (warnings allowed)",
3479
+ 1: "a finding failed, or the flags were refused"
3480
+ }
3481
+ }, defineCommand({
3482
+ meta: { name: "doctor", description: "Check the project + deployment configuration" },
3483
+ args: {
3484
+ ...cwdArg,
3485
+ json: { type: "boolean", description: "Machine-readable output", default: false },
3486
+ fix: { type: "boolean", description: "Repair what doctor can: restore missing scaffold files, add missing mounts and routes, push env (`env push`), at a terminal make the first administrator, and apply the provider settings the billing findings recommend and turn a webhook endpoint back on, each after you confirm it", default: false },
3487
+ yes: { type: "boolean", description: "With --fix: apply the provider changes without asking (for a script or CI)", default: false },
3488
+ prod: { type: "boolean", description: "Check the production deployment: missing email/billing config becomes a failure, its switches and email are read, and its live site is probed", default: false },
3489
+ only: { type: "string", description: `Check only these capabilities, comma-separated: ${CAPABILITY_NAMES.join(", ")}` }
3490
+ },
3491
+ async run({ args }) {
3492
+ const rootDir = projectRoot(args);
3493
+ const only = parseOnly(args.only);
3494
+ if (only === null) return;
3495
+ if (refuseNonProductionKey(args.prod, rootDir)) return;
3496
+ if (args.fix && !args.prod && refuseDevFixKey(rootDir)) return;
3497
+ const interactive = !args.json && Boolean(process.stdin.isTTY);
3498
+ const deployedNames = args.fix ? await repairProject(rootDir, args.prod, progress(args.json), { interactive, yes: args.yes, only }) : void 0;
3499
+ const reported = await runDoctorChecks(rootDir, { prod: args.prod, ...only ? { only } : {}, ...deployedNames !== void 0 ? { deployedNames } : {} });
3500
+ if (args.json) {
3501
+ console.log(JSON.stringify(doctorReport(reported), null, 2));
3502
+ } else {
3503
+ const icon = { pass: "\u2713", warn: "\u26A0", fail: "\u2717" };
3504
+ for (const finding of reported) {
3505
+ console.log(`${icon[finding.status]} ${finding.title}: ${finding.message}${finding.fixHint ? `
3506
+ \u21B3 ${finding.fixHint}` : ""}`);
3507
+ }
3508
+ console.log(`
3509
+ ${formatPreflightSummary(reported)}`);
3510
+ }
3511
+ if (reported.some((finding) => finding.status === "fail")) {
3512
+ process.exitCode = 1;
3513
+ }
3514
+ }
3515
+ }));
3516
+ const status = withContract("status", {
3517
+ sideEffects: ["reads only"],
3518
+ json: "`{ deployment, status, capabilities: [{ name, title, state, reason, providers, missingEnv, findings, top, docsUrl, devtools }], summary }`: `state` is `live`, `test`, `missing` or `failing`, `status` is `ok`, `degraded` or `failing`",
3519
+ exitCodes: {
3520
+ 0: "no capability is failing (missing and test capabilities allowed)",
3521
+ 1: "a capability is failing, or --prod was refused"
3522
+ }
3523
+ }, defineCommand({
3524
+ meta: { name: "status", description: "Show each capability's state \u2014 live, test, missing or failing \u2014 with its providers, unset env and most pressing finding" },
3525
+ args: {
3526
+ ...cwdArg,
3527
+ json: { type: "boolean", description: "Machine-readable output", default: false },
3528
+ prod: { type: "boolean", description: "The production deployment's capabilities, under doctor's production posture and its live probes", default: false }
3529
+ },
3530
+ async run({ args }) {
3531
+ const rootDir = projectRoot(args);
3532
+ if (refuseNonProductionKey(args.prod, rootDir)) return;
3533
+ const report = await collectStatus(rootDir, { prod: args.prod });
3534
+ if (args.json) console.log(JSON.stringify(report, null, 2));
3535
+ else console.log(formatStatus(report, { prod: args.prod, color: terminalShowsColor() }).join("\n"));
3536
+ if (report.status === "failing") process.exitCode = 1;
3537
+ }
3538
+ }));
3539
+ const main = defineCommand({
3540
+ meta: {
3541
+ name: "nuxt-backend",
3542
+ version: packageVersion(),
3543
+ description: "The complete backend for a Nuxt app on Convex \u2014 scaffold and check your project"
3544
+ },
3545
+ subCommands: { init, dev, doctor, status, env, billing, email, inbox, upgrade, eject: ejectCommand, deploy, analyze, mcp }
3546
+ });
3547
+
3548
+ void runMain(main);
3549
+
3550
+ export { DEFAULT_INBOX_ADDRESS as D, runBillingSync as a, collectStatus as c, inboxRefusal as i, readInbox as r };