nuxt-backend 0.5.1 → 0.6.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.
- package/README.md +5 -2
- package/dist/capabilities/registry.js +1 -1
- package/dist/chunks/catalog.mjs +1 -1
- package/dist/chunks/{index.mjs → devtools.mjs} +2 -2
- package/dist/chunks/doctor.mjs +14 -6
- package/dist/chunks/email-previews.mjs +1 -1
- package/dist/chunks/health.mjs +2 -2
- package/dist/chunks/install.mjs +4 -4
- package/dist/chunks/run.mjs +1 -1
- package/dist/chunks/server.mjs +15 -4
- package/dist/cli.mjs +24 -4
- package/dist/convex/access-tickets.d.ts +17 -2
- package/dist/convex/access-tickets.d.ts.map +1 -1
- package/dist/convex/account-data.d.ts +4 -4
- package/dist/convex/account-data.d.ts.map +1 -1
- package/dist/convex/account-data.js +5 -4
- package/dist/convex/account-data.js.map +1 -1
- package/dist/convex/app.d.ts +1 -0
- package/dist/convex/app.d.ts.map +1 -1
- package/dist/convex/app.js +2 -1
- package/dist/convex/app.js.map +1 -1
- package/dist/convex/client/better-auth-options.d.ts.map +1 -1
- package/dist/convex/client/better-auth-options.js +12 -3
- package/dist/convex/client/better-auth-options.js.map +1 -1
- package/dist/convex/client/component.d.ts +4 -0
- package/dist/convex/client/component.d.ts.map +1 -1
- package/dist/convex/client/index.d.ts +5 -0
- package/dist/convex/client/index.d.ts.map +1 -1
- package/dist/convex/client/launch-gate.d.ts.map +1 -1
- package/dist/convex/client/launch-gate.js +30 -1
- package/dist/convex/client/launch-gate.js.map +1 -1
- package/dist/convex/client/plugins.d.ts.map +1 -1
- package/dist/convex/client/plugins.js +3 -0
- package/dist/convex/client/plugins.js.map +1 -1
- package/dist/convex/client/two-factor.d.ts +7 -0
- package/dist/convex/client/two-factor.d.ts.map +1 -0
- package/dist/convex/client/two-factor.js +57 -0
- package/dist/convex/client/two-factor.js.map +1 -0
- package/dist/convex/components/backend/_generated/api.d.ts +2 -0
- package/dist/convex/components/backend/_generated/api.d.ts.map +1 -1
- package/dist/convex/components/backend/_generated/api.js.map +1 -1
- package/dist/convex/components/backend/_generated/component.d.ts +292 -10
- package/dist/convex/components/backend/_generated/component.d.ts.map +1 -1
- package/dist/convex/components/backend/account.d.ts +63 -17
- package/dist/convex/components/backend/account.d.ts.map +1 -1
- package/dist/convex/components/backend/account.js +24 -1
- package/dist/convex/components/backend/account.js.map +1 -1
- package/dist/convex/components/backend/adapter.d.ts.map +1 -1
- package/dist/convex/components/backend/adapter.js +7 -2
- package/dist/convex/components/backend/adapter.js.map +1 -1
- package/dist/convex/components/backend/ai.d.ts +1 -1
- package/dist/convex/components/backend/billing.d.ts +10 -0
- package/dist/convex/components/backend/billing.d.ts.map +1 -1
- package/dist/convex/components/backend/billing.js +2 -1
- package/dist/convex/components/backend/billing.js.map +1 -1
- package/dist/convex/components/backend/commerce.d.ts +229 -0
- package/dist/convex/components/backend/commerce.d.ts.map +1 -0
- package/dist/convex/components/backend/commerce.js +392 -0
- package/dist/convex/components/backend/commerce.js.map +1 -0
- package/dist/convex/components/backend/funnel.d.ts +6 -6
- package/dist/convex/components/backend/jobs.d.ts +1 -1
- package/dist/convex/components/backend/referrals.d.ts +2 -2
- package/dist/convex/components/backend/schema.d.ts +327 -21
- package/dist/convex/components/backend/schema.d.ts.map +1 -1
- package/dist/convex/components/backend/schema.js +108 -1
- package/dist/convex/components/backend/schema.js.map +1 -1
- package/dist/convex/components/backend/waitlist.d.ts +42 -6
- package/dist/convex/components/backend/waitlist.d.ts.map +1 -1
- package/dist/convex/components/backend/waitlist.js +142 -39
- package/dist/convex/components/backend/waitlist.js.map +1 -1
- package/dist/convex/email-templates.d.ts +12 -0
- package/dist/convex/email-templates.d.ts.map +1 -1
- package/dist/convex/email-templates.js +3 -0
- package/dist/convex/email-templates.js.map +1 -1
- package/dist/convex/emails/waitlist-friend-joined.d.ts +9 -0
- package/dist/convex/emails/waitlist-friend-joined.d.ts.map +1 -0
- package/dist/convex/emails/waitlist-friend-joined.js +22 -0
- package/dist/convex/emails/waitlist-friend-joined.js.map +1 -0
- package/dist/convex/errors.d.ts +6 -6
- package/dist/convex/errors.d.ts.map +1 -1
- package/dist/convex/errors.js +14 -2
- package/dist/convex/errors.js.map +1 -1
- package/dist/convex/events.d.ts +19 -0
- package/dist/convex/events.d.ts.map +1 -1
- package/dist/convex/events.js +14 -0
- package/dist/convex/events.js.map +1 -1
- package/dist/convex/integrations/billing/checkout.d.ts +2 -2
- package/dist/convex/integrations/billing/checkout.d.ts.map +1 -1
- package/dist/convex/integrations/billing/checkout.js +79 -11
- package/dist/convex/integrations/billing/checkout.js.map +1 -1
- package/dist/convex/integrations/billing/commerce-entitlements.d.ts +12 -0
- package/dist/convex/integrations/billing/commerce-entitlements.d.ts.map +1 -0
- package/dist/convex/integrations/billing/commerce-entitlements.js +78 -0
- package/dist/convex/integrations/billing/commerce-entitlements.js.map +1 -0
- package/dist/convex/integrations/billing/commerce-events.d.ts +15 -0
- package/dist/convex/integrations/billing/commerce-events.d.ts.map +1 -0
- package/dist/convex/integrations/billing/commerce-events.js +433 -0
- package/dist/convex/integrations/billing/commerce-events.js.map +1 -0
- package/dist/convex/integrations/billing/commerce-history.d.ts +20 -0
- package/dist/convex/integrations/billing/commerce-history.d.ts.map +1 -0
- package/dist/convex/integrations/billing/commerce-history.js +106 -0
- package/dist/convex/integrations/billing/commerce-history.js.map +1 -0
- package/dist/convex/integrations/billing/commerce-webhooks.d.ts +23 -0
- package/dist/convex/integrations/billing/commerce-webhooks.d.ts.map +1 -0
- package/dist/convex/integrations/billing/commerce-webhooks.js +49 -0
- package/dist/convex/integrations/billing/commerce-webhooks.js.map +1 -0
- package/dist/convex/integrations/billing/commerce.d.ts +100 -0
- package/dist/convex/integrations/billing/commerce.d.ts.map +1 -0
- package/dist/convex/integrations/billing/commerce.js +323 -0
- package/dist/convex/integrations/billing/commerce.js.map +1 -0
- package/dist/convex/integrations/billing/context.d.ts +8 -0
- package/dist/convex/integrations/billing/context.d.ts.map +1 -1
- package/dist/convex/integrations/billing/context.js +14 -2
- package/dist/convex/integrations/billing/context.js.map +1 -1
- package/dist/convex/integrations/billing/credits.d.ts +1 -1
- package/dist/convex/integrations/billing/credits.d.ts.map +1 -1
- package/dist/convex/integrations/billing/credits.js +49 -28
- package/dist/convex/integrations/billing/credits.js.map +1 -1
- package/dist/convex/integrations/billing/customers.d.ts +1 -1
- package/dist/convex/integrations/billing/customers.d.ts.map +1 -1
- package/dist/convex/integrations/billing/customers.js +15 -1
- package/dist/convex/integrations/billing/customers.js.map +1 -1
- package/dist/convex/integrations/billing/entitlements.d.ts +1 -1
- package/dist/convex/integrations/billing/entitlements.d.ts.map +1 -1
- package/dist/convex/integrations/billing/entitlements.js +6 -1
- package/dist/convex/integrations/billing/entitlements.js.map +1 -1
- package/dist/convex/integrations/billing/erasure.d.ts +1 -1
- package/dist/convex/integrations/billing/erasure.d.ts.map +1 -1
- package/dist/convex/integrations/billing/erasure.js +10 -5
- package/dist/convex/integrations/billing/erasure.js.map +1 -1
- package/dist/convex/integrations/billing/free-plan.d.ts +6 -1
- package/dist/convex/integrations/billing/free-plan.d.ts.map +1 -1
- package/dist/convex/integrations/billing/free-plan.js +22 -4
- package/dist/convex/integrations/billing/free-plan.js.map +1 -1
- package/dist/convex/integrations/billing/functions.d.ts +1 -1
- package/dist/convex/integrations/billing/functions.d.ts.map +1 -1
- package/dist/convex/integrations/billing/functions.js +3 -2
- package/dist/convex/integrations/billing/functions.js.map +1 -1
- package/dist/convex/integrations/billing/gifts.d.ts.map +1 -1
- package/dist/convex/integrations/billing/gifts.js +3 -0
- package/dist/convex/integrations/billing/gifts.js.map +1 -1
- package/dist/convex/integrations/billing/history.d.ts +1 -1
- package/dist/convex/integrations/billing/history.d.ts.map +1 -1
- package/dist/convex/integrations/billing/history.js +6 -1
- package/dist/convex/integrations/billing/history.js.map +1 -1
- package/dist/convex/integrations/billing/lifecycle.d.ts +1 -1
- package/dist/convex/integrations/billing/lifecycle.d.ts.map +1 -1
- package/dist/convex/integrations/billing/lifecycle.js +4 -1
- package/dist/convex/integrations/billing/lifecycle.js.map +1 -1
- package/dist/convex/integrations/billing/providers/capabilities.d.ts +17 -0
- package/dist/convex/integrations/billing/providers/capabilities.d.ts.map +1 -0
- package/dist/convex/integrations/billing/providers/capabilities.js +77 -0
- package/dist/convex/integrations/billing/providers/capabilities.js.map +1 -0
- package/dist/convex/integrations/billing/providers/consent.d.ts +52 -0
- package/dist/convex/integrations/billing/providers/consent.d.ts.map +1 -0
- package/dist/convex/integrations/billing/providers/consent.js +79 -0
- package/dist/convex/integrations/billing/providers/consent.js.map +1 -0
- package/dist/convex/integrations/billing/providers/creem.d.ts +22 -0
- package/dist/convex/integrations/billing/providers/creem.d.ts.map +1 -0
- package/dist/convex/integrations/billing/providers/creem.js +208 -0
- package/dist/convex/integrations/billing/providers/creem.js.map +1 -0
- package/dist/convex/integrations/billing/providers/dodo.d.ts +15 -0
- package/dist/convex/integrations/billing/providers/dodo.d.ts.map +1 -0
- package/dist/convex/integrations/billing/providers/dodo.js +197 -0
- package/dist/convex/integrations/billing/providers/dodo.js.map +1 -0
- package/dist/convex/integrations/billing/providers/http.d.ts +41 -0
- package/dist/convex/integrations/billing/providers/http.d.ts.map +1 -0
- package/dist/convex/integrations/billing/providers/http.js +146 -0
- package/dist/convex/integrations/billing/providers/http.js.map +1 -0
- package/dist/convex/integrations/billing/providers/index.d.ts +35 -0
- package/dist/convex/integrations/billing/providers/index.d.ts.map +1 -0
- package/dist/convex/integrations/billing/providers/index.js +62 -0
- package/dist/convex/integrations/billing/providers/index.js.map +1 -0
- package/dist/convex/integrations/billing/providers/stripe.d.ts +28 -0
- package/dist/convex/integrations/billing/providers/stripe.d.ts.map +1 -0
- package/dist/convex/integrations/billing/providers/stripe.js +327 -0
- package/dist/convex/integrations/billing/providers/stripe.js.map +1 -0
- package/dist/convex/integrations/billing/providers/types.d.ts +263 -0
- package/dist/convex/integrations/billing/providers/types.d.ts.map +1 -0
- package/dist/convex/integrations/billing/providers/types.js +48 -0
- package/dist/convex/integrations/billing/providers/types.js.map +1 -0
- package/dist/convex/integrations/billing/subscriptions.d.ts +1 -1
- package/dist/convex/integrations/billing/subscriptions.d.ts.map +1 -1
- package/dist/convex/integrations/billing/subscriptions.js +20 -6
- package/dist/convex/integrations/billing/subscriptions.js.map +1 -1
- package/dist/convex/integrations/billing/types/setup.d.ts +64 -1
- package/dist/convex/integrations/billing/types/setup.d.ts.map +1 -1
- package/dist/convex/integrations/billing.d.ts +4 -1
- package/dist/convex/integrations/billing.d.ts.map +1 -1
- package/dist/convex/integrations/billing.js +12 -2
- package/dist/convex/integrations/billing.js.map +1 -1
- package/dist/convex/integrations/email.d.ts +1 -1
- package/dist/convex/integrations/email.d.ts.map +1 -1
- package/dist/convex/integrations/email.js.map +1 -1
- package/dist/convex/integrations/launch.d.ts +27 -2
- package/dist/convex/integrations/launch.d.ts.map +1 -1
- package/dist/convex/integrations/launch.js +15 -3
- package/dist/convex/integrations/launch.js.map +1 -1
- package/dist/convex/integrations/presence.d.ts +110 -0
- package/dist/convex/integrations/presence.d.ts.map +1 -0
- package/dist/convex/integrations/presence.js +92 -0
- package/dist/convex/integrations/presence.js.map +1 -0
- package/dist/convex/integrations/waitlist.d.ts +41 -7
- package/dist/convex/integrations/waitlist.d.ts.map +1 -1
- package/dist/convex/integrations/waitlist.js +45 -6
- package/dist/convex/integrations/waitlist.js.map +1 -1
- package/dist/convex/integrations/webhook-guard.d.ts +8 -0
- package/dist/convex/integrations/webhook-guard.d.ts.map +1 -1
- package/dist/convex/integrations/webhook-guard.js +11 -4
- package/dist/convex/integrations/webhook-guard.js.map +1 -1
- package/dist/convex/label-groups/admin.d.ts +9 -0
- package/dist/convex/label-groups/admin.d.ts.map +1 -1
- package/dist/convex/label-groups/admin.js +9 -0
- package/dist/convex/label-groups/admin.js.map +1 -1
- package/dist/convex/label-groups/audit.d.ts +2 -0
- package/dist/convex/label-groups/audit.d.ts.map +1 -1
- package/dist/convex/label-groups/audit.js +2 -0
- package/dist/convex/label-groups/audit.js.map +1 -1
- package/dist/convex/label-groups/auth.d.ts +9 -0
- package/dist/convex/label-groups/auth.d.ts.map +1 -1
- package/dist/convex/label-groups/auth.js +10 -0
- package/dist/convex/label-groups/auth.js.map +1 -1
- package/dist/convex/label-groups/email.d.ts +6 -0
- package/dist/convex/label-groups/email.d.ts.map +1 -1
- package/dist/convex/label-groups/email.js +7 -0
- package/dist/convex/label-groups/email.js.map +1 -1
- package/dist/convex/label-groups/errors.d.ts +4 -0
- package/dist/convex/label-groups/errors.d.ts.map +1 -1
- package/dist/convex/label-groups/errors.js +4 -0
- package/dist/convex/label-groups/errors.js.map +1 -1
- package/dist/convex/label-groups/security.d.ts +19 -0
- package/dist/convex/label-groups/security.d.ts.map +1 -1
- package/dist/convex/label-groups/security.js +20 -0
- package/dist/convex/label-groups/security.js.map +1 -1
- package/dist/convex/label-groups/waitlist.d.ts +8 -0
- package/dist/convex/label-groups/waitlist.d.ts.map +1 -1
- package/dist/convex/label-groups/waitlist.js +9 -0
- package/dist/convex/label-groups/waitlist.js.map +1 -1
- package/dist/convex/label-translations.d.ts.map +1 -1
- package/dist/convex/label-translations.js +24 -0
- package/dist/convex/label-translations.js.map +1 -1
- package/dist/convex/labels.d.ts +57 -0
- package/dist/convex/labels.d.ts.map +1 -1
- package/dist/convex/log.js +2 -0
- package/dist/convex/log.js.map +1 -1
- package/dist/convex/sensitive-actions.d.ts.map +1 -1
- package/dist/convex/sensitive-actions.js +11 -0
- package/dist/convex/sensitive-actions.js.map +1 -1
- package/dist/convex/waitlist-rules.d.ts +63 -9
- package/dist/convex/waitlist-rules.d.ts.map +1 -1
- package/dist/convex/waitlist-rules.js +38 -7
- package/dist/convex/waitlist-rules.js.map +1 -1
- package/dist/devtools-client/_nuxt/DHNi4uhO.js +6 -0
- package/dist/devtools-client/index.html +1 -1
- package/dist/env-registry.js +9 -0
- package/dist/module.d.ts +14 -2
- package/dist/module.js +2 -2
- package/dist/module.json +2 -2
- package/dist/runtime/locales/de.json +58 -1
- package/dist/runtime/locales/en.json +60 -3
- package/dist/runtime/locales/es.json +58 -1
- package/dist/runtime/locales/fr.json +58 -1
- package/dist/runtime/locales/ru.json +58 -1
- package/dist/runtime/server/monitoring/backend-calls.d.ts +3 -3
- package/dist/runtime/server/monitoring/backend-calls.js +2 -2
- package/dist/runtime/server/monitoring/health.js +2 -2
- package/dist/runtime/vue/auth-client.d.ts +3 -2
- package/dist/runtime/vue/auth-client.js +2 -1
- package/dist/runtime/vue/components/account/SecuritySettings.d.vue.ts +25 -2
- package/dist/runtime/vue/components/account/SecuritySettings.vue +52 -2
- package/dist/runtime/vue/components/account/SecuritySettings.vue.d.ts +25 -2
- package/dist/runtime/vue/components/account/SecurityTwoFactor.css +1 -0
- package/dist/runtime/vue/components/account/SecurityTwoFactor.d.vue.ts +4 -0
- package/dist/runtime/vue/components/account/SecurityTwoFactor.vue +107 -0
- package/dist/runtime/vue/components/account/SecurityTwoFactor.vue.d.ts +4 -0
- package/dist/runtime/vue/components/account/security-settings.d.ts +18 -1
- package/dist/runtime/vue/components/admin/AdminUsers.d.vue.ts +11 -2
- package/dist/runtime/vue/components/admin/AdminUsers.vue.d.ts +11 -2
- package/dist/runtime/vue/components/admin/AdminWaitlist.css +1 -1
- package/dist/runtime/vue/components/admin/AdminWaitlistActions.vue +41 -1
- package/dist/runtime/vue/components/admin/AdminWorkspaces.d.vue.ts +9 -0
- package/dist/runtime/vue/components/admin/AdminWorkspaces.vue.d.ts +9 -0
- package/dist/runtime/vue/components/admin/admin-waitlist-tab.js +28 -0
- package/dist/runtime/vue/components/auth/AuthForm.d.vue.ts +9 -0
- package/dist/runtime/vue/components/auth/AuthForm.vue +8 -0
- package/dist/runtime/vue/components/auth/AuthForm.vue.d.ts +9 -0
- package/dist/runtime/vue/components/auth/AuthFormTwoFactor.css +1 -0
- package/dist/runtime/vue/components/auth/AuthFormTwoFactor.d.vue.ts +3 -0
- package/dist/runtime/vue/components/auth/AuthFormTwoFactor.vue +70 -0
- package/dist/runtime/vue/components/auth/AuthFormTwoFactor.vue.d.ts +3 -0
- package/dist/runtime/vue/components/auth/AuthFormWaitlisted.vue +7 -2
- package/dist/runtime/vue/components/auth/WaitlistForm.d.vue.ts +8 -0
- package/dist/runtime/vue/components/auth/WaitlistForm.vue.d.ts +8 -0
- package/dist/runtime/vue/components/auth/WaitlistPlace.css +1 -1
- package/dist/runtime/vue/components/auth/WaitlistPlace.vue +37 -0
- package/dist/runtime/vue/components/auth/WaitlistShare.vue +2 -2
- package/dist/runtime/vue/components/auth/auth-form.d.ts +2 -0
- package/dist/runtime/vue/components/workspaces/AuditLog.d.vue.ts +2 -0
- package/dist/runtime/vue/components/workspaces/AuditLog.vue.d.ts +2 -0
- package/dist/runtime/vue/components/workspaces/WorkspaceSettings.d.vue.ts +2 -2
- package/dist/runtime/vue/components/workspaces/WorkspaceSettings.vue.d.ts +2 -2
- package/dist/runtime/vue/composables/use-login-flow.d.ts +19 -4
- package/dist/runtime/vue/composables/use-login-flow.js +31 -0
- package/dist/runtime/vue/composables/use-room-presence.d.ts +63 -0
- package/dist/runtime/vue/composables/use-room-presence.js +31 -0
- package/dist/runtime/vue/composables/use-two-factor.d.ts +58 -0
- package/dist/runtime/vue/composables/use-two-factor.js +49 -0
- package/dist/runtime/vue/composables/use-waitlist-admin.d.ts +5 -0
- package/dist/runtime/vue/composables/use-waitlist-admin.js +5 -1
- package/dist/runtime/vue/composables/use-waitlist.d.ts +4 -0
- package/dist/runtime/vue/composables/use-waitlist.js +1 -1
- package/dist/runtime/vue/parts.d.ts +8 -1
- package/dist/runtime/vue/two-factor-client.d.ts +15 -0
- package/dist/runtime/vue/two-factor-client.js +19 -0
- package/dist/runtime/vue/utils/auth-session.js +10 -1
- package/dist/runtime/vue/utils/login-bindings.js +1 -0
- package/dist/runtime/vue/utils/page-guard.d.ts +2 -2
- package/dist/runtime/vue/utils/page-guard.js +2 -2
- package/dist/shared/{nuxt-backend.BvKvJ1mo.mjs → nuxt-backend.CM_p0XQE.mjs} +1 -1
- package/dist/shared/{nuxt-backend.DRuHg-IQ.mjs → nuxt-backend.C_Y_BtBs.mjs} +2 -2
- package/dist/shared/{nuxt-backend.suXOnqOQ.mjs → nuxt-backend.ChvlbHQq.mjs} +42 -7
- package/dist/shared/{nuxt-backend.0r1vvS1c.mjs → nuxt-backend.D16peTIt.mjs} +56 -34
- package/dist/shared/{nuxt-backend.zY6UDqDu.mjs → nuxt-backend.D4JXvCP6.mjs} +3 -2
- package/dist/types.d.ts +1 -1
- package/package.json +19 -10
- package/skills/nuxt-backend/SKILL.md +18 -18
- package/skills/nuxt-backend/references/api.md +30 -5
- package/skills/nuxt-backend/references/install.md +1 -1
- package/skills/nuxt-backend/references/renames.json +8 -0
- package/skills/nuxt-backend/references/surface.json +62 -2
- package/skills/nuxt-backend-auth/SKILL.md +8 -2
- package/skills/nuxt-backend-auth/references/api.md +3 -1
- package/skills/nuxt-backend-billing/SKILL.md +15 -0
- package/skills/nuxt-backend-billing/references/api.md +14 -1
- package/skills/nuxt-backend-data/SKILL.md +1 -0
- package/skills/nuxt-backend-data/references/api.md +10 -1
- package/skills/nuxt-backend-email/references/api.md +1 -1
- package/skills/nuxt-backend-ship/SKILL.md +2 -1
- package/skills/nuxt-backend-upgrade/references/upgrade.md +6 -0
- package/src/convex/access-tickets.ts +10 -2
- package/src/convex/account-data.ts +5 -4
- package/src/convex/app.ts +2 -1
- package/src/convex/client/better-auth-options.ts +12 -3
- package/src/convex/client/launch-gate.ts +28 -1
- package/src/convex/client/plugins.ts +3 -0
- package/src/convex/client/two-factor.ts +66 -0
- package/src/convex/components/backend/_generated/api.ts +2 -0
- package/src/convex/components/backend/_generated/component.ts +500 -2
- package/src/convex/components/backend/account.ts +25 -1
- package/src/convex/components/backend/adapter.ts +7 -2
- package/src/convex/components/backend/billing.ts +2 -1
- package/src/convex/components/backend/commerce.ts +408 -0
- package/src/convex/components/backend/schema.ts +110 -1
- package/src/convex/components/backend/waitlist.ts +144 -40
- package/src/convex/email-templates.ts +16 -0
- package/src/convex/emails/waitlist-friend-joined.ts +23 -0
- package/src/convex/errors.ts +15 -2
- package/src/convex/events.ts +14 -0
- package/src/convex/integrations/billing/checkout.ts +78 -11
- package/src/convex/integrations/billing/commerce-entitlements.ts +92 -0
- package/src/convex/integrations/billing/commerce-events.ts +487 -0
- package/src/convex/integrations/billing/commerce-history.ts +110 -0
- package/src/convex/integrations/billing/commerce-webhooks.ts +69 -0
- package/src/convex/integrations/billing/commerce.ts +366 -0
- package/src/convex/integrations/billing/context.ts +19 -2
- package/src/convex/integrations/billing/credits.ts +47 -27
- package/src/convex/integrations/billing/customers.ts +15 -1
- package/src/convex/integrations/billing/entitlements.ts +5 -1
- package/src/convex/integrations/billing/erasure.ts +11 -6
- package/src/convex/integrations/billing/free-plan.ts +30 -5
- package/src/convex/integrations/billing/functions.ts +3 -2
- package/src/convex/integrations/billing/gifts.ts +2 -0
- package/src/convex/integrations/billing/history.ts +9 -0
- package/src/convex/integrations/billing/lifecycle.ts +3 -1
- package/src/convex/integrations/billing/providers/capabilities.ts +78 -0
- package/src/convex/integrations/billing/providers/consent.ts +94 -0
- package/src/convex/integrations/billing/providers/creem.ts +225 -0
- package/src/convex/integrations/billing/providers/dodo.ts +214 -0
- package/src/convex/integrations/billing/providers/http.ts +168 -0
- package/src/convex/integrations/billing/providers/index.ts +65 -0
- package/src/convex/integrations/billing/providers/stripe.ts +345 -0
- package/src/convex/integrations/billing/providers/types.ts +281 -0
- package/src/convex/integrations/billing/subscriptions.ts +20 -6
- package/src/convex/integrations/billing/types/setup.ts +63 -1
- package/src/convex/integrations/billing.ts +46 -3
- package/src/convex/integrations/email.ts +1 -0
- package/src/convex/integrations/launch.ts +45 -7
- package/src/convex/integrations/presence.ts +160 -0
- package/src/convex/integrations/waitlist.ts +84 -12
- package/src/convex/integrations/webhook-guard.ts +20 -4
- package/src/convex/label-groups/admin.ts +9 -0
- package/src/convex/label-groups/audit.ts +2 -0
- package/src/convex/label-groups/auth.ts +10 -0
- package/src/convex/label-groups/email.ts +7 -0
- package/src/convex/label-groups/errors.ts +4 -0
- package/src/convex/label-groups/security.ts +20 -0
- package/src/convex/label-groups/waitlist.ts +9 -0
- package/src/convex/label-translations.ts +24 -0
- package/src/convex/log.ts +2 -0
- package/src/convex/sensitive-actions.ts +11 -0
- package/src/convex/waitlist-rules.ts +84 -8
- package/src/runtime/vue/components/account/SecuritySettings.vue +58 -4
- package/src/runtime/vue/components/account/SecurityTwoFactor.css +68 -0
- package/src/runtime/vue/components/account/SecurityTwoFactor.vue +113 -0
- package/src/runtime/vue/components/admin/AdminWaitlist.css +1 -0
- package/src/runtime/vue/components/admin/AdminWaitlistActions.vue +44 -2
- package/src/runtime/vue/components/auth/AuthForm.vue +8 -0
- package/src/runtime/vue/components/auth/AuthFormTwoFactor.css +40 -0
- package/src/runtime/vue/components/auth/AuthFormTwoFactor.vue +75 -0
- package/src/runtime/vue/components/auth/AuthFormWaitlisted.vue +11 -4
- package/src/runtime/vue/components/auth/WaitlistPlace.css +16 -0
- package/src/runtime/vue/components/auth/WaitlistPlace.vue +49 -2
- package/src/runtime/vue/components/auth/WaitlistShare.vue +4 -3
- package/dist/devtools-client/_nuxt/CiCAOwUc.js +0 -5
package/src/convex/app.ts
CHANGED
|
@@ -102,7 +102,8 @@ export const backendEnv = {
|
|
|
102
102
|
EMAIL_WEBHOOK_SECRET: v.optional(v.string()),
|
|
103
103
|
// The dev inbox's page reader, opted into with `1` outside production; read by the app's own getSandboxInbox, never forwarded.
|
|
104
104
|
EMAIL_DEV_INBOX: v.optional(v.string()),
|
|
105
|
-
// Billing — optional.
|
|
105
|
+
// Billing — optional. The merchant of record: polar when unset.
|
|
106
|
+
BILLING_PROVIDER: v.optional(v.union(v.literal('polar'), v.literal('stripe'), v.literal('dodo'), v.literal('creem'))),
|
|
106
107
|
BILLING_ACCESS_TOKEN: v.optional(v.string()),
|
|
107
108
|
BILLING_WEBHOOK_SECRET: v.optional(v.string()),
|
|
108
109
|
// AI — optional; the gateway's own name, never renamed.
|
|
@@ -21,6 +21,7 @@ import { authRefusal } from './refusals.js'
|
|
|
21
21
|
import { pausedData } from '../pauses.js'
|
|
22
22
|
import { type DatabaseHooks, mergeDatabaseHooks } from './hooks.js'
|
|
23
23
|
import { ACCOUNT_FIELDS, administratorsOf, defaultAdmin, type DefaultAuthPlugin, defaultLastLoginMethod, defaultPasskey, SESSION_FIELDS, sessionSignInMethod } from './plugins.js'
|
|
24
|
+
import { defaultTwoFactor, twoFactorAfterCode } from './two-factor.js'
|
|
24
25
|
import { isAdministrator } from '../integrations/access.js'
|
|
25
26
|
import { CLIENT_IP_HEADER, protectionEnv } from '../proof.js'
|
|
26
27
|
import { resolveBackendPaths } from '../paths.js'
|
|
@@ -65,8 +66,9 @@ export function sessionClaims({ user, session }: { user: Record<string, unknown>
|
|
|
65
66
|
// plugin swallows it and sets no cookie.
|
|
66
67
|
if (session.passkeyRecovery) throw authRefusal('forbidden', { reason: 'passkey_required' })
|
|
67
68
|
// How the account last signed in is the sign-in form's, not a caller's:
|
|
68
|
-
// it changes with every sign-in and says nothing a function needs.
|
|
69
|
-
|
|
69
|
+
// it changes with every sign-in and says nothing a function needs. So is
|
|
70
|
+
// whether it has an authenticator app, which the security page reads.
|
|
71
|
+
const { id: _id, image: _image, lastLoginMethod: _lastLoginMethod, twoFactorEnabled: _twoFactor, onboardedAt: _onboardedAt, activationDismissedAt: _dismissedAt, ...fields } = user
|
|
70
72
|
const claims = Object.fromEntries(Object.entries(fields).filter(([key]) => !RESERVED_CLAIMS.includes(key)))
|
|
71
73
|
// The package's own `locale` field is the standard claim of that name,
|
|
72
74
|
// as a language tag only: no other value reaches it.
|
|
@@ -91,7 +93,9 @@ export function sessionClaims({ user, session }: { user: Record<string, unknown>
|
|
|
91
93
|
* none). `undefined` when it adds neither.
|
|
92
94
|
*/
|
|
93
95
|
function openedSession(session: Record<string, unknown>, activeOrganizationId: string | undefined, hookCtx: unknown): { data: Record<string, unknown> } | undefined {
|
|
94
|
-
|
|
96
|
+
// A session that replaces another keeps its method (the authenticator app's turning on copies the old one's fields).
|
|
97
|
+
const kept = typeof session.signInMethod === 'string' ? session.signInMethod : null
|
|
98
|
+
const signInMethod = session.impersonatedBy ? null : kept ?? sessionSignInMethod((hookCtx as { path?: string } | null)?.path)
|
|
95
99
|
if (!activeOrganizationId && !signInMethod) return undefined
|
|
96
100
|
return { data: { ...session, ...(activeOrganizationId ? { activeOrganizationId } : {}), ...(signInMethod ? { signInMethod } : {}) } }
|
|
97
101
|
}
|
|
@@ -190,6 +194,8 @@ export function buildAuthOptions<DM extends GenericDataModel = GenericDataModel>
|
|
|
190
194
|
// takes a proof.
|
|
191
195
|
const protection = protectionEnv()
|
|
192
196
|
const challenge = protection.challengeSecretKey && !userPluginIds.has('captcha') ? challengePlugin(protection.challengeSecretKey, protection.proofSecret) : undefined
|
|
197
|
+
// The authenticator app's second step runs after a code on the two-factor plugin in use: the package's, or an app's own.
|
|
198
|
+
const twoFactorPlugin = (userPlugins.find(plugin => plugin.id === 'two-factor') ?? defaultTwoFactor()) as ReturnType<typeof defaultTwoFactor>
|
|
193
199
|
const defaultPlugins = [
|
|
194
200
|
emailOTP({
|
|
195
201
|
sendVerificationOTP: makeSendVerificationOTP(runtime),
|
|
@@ -215,6 +221,9 @@ export function buildAuthOptions<DM extends GenericDataModel = GenericDataModel>
|
|
|
215
221
|
// Passkey-only accounts: the switch, the recovery code and its session.
|
|
216
222
|
passkeyOnlyPlugin({ administrators, runtime }) as DefaultAuthPlugin,
|
|
217
223
|
organization(organizationOptions(options.workspaces, runtime, sendInvitationEmail)),
|
|
224
|
+
// An authenticator app as a second factor after a sign-in code, for an account that turns it on.
|
|
225
|
+
twoFactorPlugin as DefaultAuthPlugin,
|
|
226
|
+
twoFactorAfterCode(twoFactorPlugin) as DefaultAuthPlugin,
|
|
218
227
|
...(challenge ? [challenge as DefaultAuthPlugin] : []),
|
|
219
228
|
// Sessions signed before an AUTH_SECRET rotation keep working until the previous secret retires.
|
|
220
229
|
secretRotationPlugin(),
|
|
@@ -27,6 +27,8 @@ const SIGN_IN_PATH = '/sign-in/email-otp'
|
|
|
27
27
|
const ADMIN_CREATE_PATH = '/admin/create-user'
|
|
28
28
|
/** The emailOTP plugin's attempt limit, as the package sets it. */
|
|
29
29
|
const ALLOWED_ATTEMPTS = 3
|
|
30
|
+
/** A day, for the one "a friend joined" email a day a sharer gets. */
|
|
31
|
+
const DAY_MS = 24 * 60 * 60 * 1000
|
|
30
32
|
|
|
31
33
|
/** The body field an invite code or an access link's token rides in, on the code check. */
|
|
32
34
|
export const INVITE_FIELD = 'inviteCode'
|
|
@@ -62,10 +64,33 @@ function ticketRequired(phase: AccessPhase, invite: string | null, waitlist?: Wa
|
|
|
62
64
|
reason: 'ticket_required',
|
|
63
65
|
phase,
|
|
64
66
|
...(invite ? { invite } : {}),
|
|
65
|
-
|
|
67
|
+
// The place only where the waitlist shows rank; the status link always, while the entry waits.
|
|
68
|
+
...(waitlist?.waiting ? { waitlist: { token: waitlist.token, ...(waitlist.position ? { position: waitlist.position, total: waitlist.total } : {}) } } : {}),
|
|
66
69
|
})
|
|
67
70
|
}
|
|
68
71
|
|
|
72
|
+
/**
|
|
73
|
+
* Tell the friend whose link a new entry came through that it worked: one
|
|
74
|
+
* email a day at most, whoever else joins that day. It cannot fail the code
|
|
75
|
+
* check.
|
|
76
|
+
*/
|
|
77
|
+
async function tellSharer<DM extends GenericDataModel>(runtime: AuthRuntime<DM> | undefined, ctx: AuthMutationCtx, sharer: NonNullable<WaitlistRecord['sharer']>, site: string | undefined): Promise<void> {
|
|
78
|
+
try {
|
|
79
|
+
if (!runtime?.email || !site) throw new Error(site ? 'no email instance is wired into setupAuth' : 'SITE_URL is not set')
|
|
80
|
+
const day = Math.floor(Date.now() / DAY_MS)
|
|
81
|
+
const entry = sharer.token.slice(0, sharer.token.indexOf('.'))
|
|
82
|
+
await runtime.email.sendTemplate(ctx, 'waitlistFriendJoined', {
|
|
83
|
+
email: sharer.email,
|
|
84
|
+
statusUrl: `${site}${runtime?.paths?.waitlist ?? DEFAULT_WAITLIST_PATH}#${sharer.token}`,
|
|
85
|
+
friends: sharer.friends,
|
|
86
|
+
days: Math.floor(sharer.credit / DAY_MS),
|
|
87
|
+
}, { ...(sharer.locale ? { fallbackLocale: sharer.locale } : {}), idempotencyKey: `nuxt-backend:waitlist-friend:${entry}:${day}` })
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
logBackend('warn', 'waitlist.friend_unsent', 'A friend joined through a waitlist link, but the sharer was not emailed; the credit stands.', error)
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
69
94
|
/**
|
|
70
95
|
* A new address's code checked in early access: its waitlist entry is
|
|
71
96
|
* recorded (once), the join lands on the activity trail, and the first time
|
|
@@ -79,11 +104,13 @@ async function recordWaitlistEntry<DM extends GenericDataModel>(runtime: AuthRun
|
|
|
79
104
|
if (!entry.created) return entry
|
|
80
105
|
try {
|
|
81
106
|
await runtime?.audit?.recordBackendEvent(ctx as never, { type: 'waitlist.joined', actor: null, data: { source: entry.source, referred: entry.referred, news: entry.news } })
|
|
107
|
+
if (entry.sharer) await runtime?.audit?.recordBackendEvent(ctx as never, { type: 'waitlist.friend_joined', actor: null, data: { friends: entry.sharer.friends } })
|
|
82
108
|
}
|
|
83
109
|
catch (error) {
|
|
84
110
|
logBackend('warn', 'waitlist.confirmation_unsent', 'A new waitlist entry was recorded, but its join event did not reach the activity trail; the entry stands.', error)
|
|
85
111
|
}
|
|
86
112
|
const site = readEnv('SITE_URL')?.replace(/\/+$/, '')
|
|
113
|
+
if (entry.sharer?.notify) await tellSharer(runtime, ctx, entry.sharer, site)
|
|
87
114
|
try {
|
|
88
115
|
if (!runtime?.email || !site) throw new Error(site ? 'no email instance is wired into setupAuth' : 'SITE_URL is not set')
|
|
89
116
|
await runtime.email.sendTemplate(ctx, 'waitlistConfirmation', {
|
|
@@ -64,6 +64,9 @@ const SESSION_SIGN_IN_ROUTES: Readonly<Record<string, SignInMethod>> = {
|
|
|
64
64
|
'/sign-in/email-otp': 'email-otp',
|
|
65
65
|
'/email-otp/verify-email': 'email-otp',
|
|
66
66
|
'/passkey/verify-authentication': 'passkey',
|
|
67
|
+
// The authenticator app's step after a code: the session the code began.
|
|
68
|
+
'/two-factor/verify-totp': 'email-otp',
|
|
69
|
+
'/two-factor/verify-backup-code': 'email-otp',
|
|
67
70
|
}
|
|
68
71
|
|
|
69
72
|
/**
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { BetterAuthPlugin } from 'better-auth'
|
|
2
|
+
import { twoFactor } from 'better-auth/plugins'
|
|
3
|
+
|
|
4
|
+
// The authenticator app: a second factor after the sign-in code, for an
|
|
5
|
+
// account that turns it on. Better Auth's two-factor plugin holds the
|
|
6
|
+
// secret (encrypted under the auth secret), the backup codes and the
|
|
7
|
+
// challenge between the two steps; it asks for the second factor after a
|
|
8
|
+
// password sign-in only, and the package has none, so its own step runs
|
|
9
|
+
// here after the code. A passkey is a second factor of its own (the device,
|
|
10
|
+
// and the person's fingerprint or PIN), so a passkey sign-in asks for none.
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The routes after which an account with an authenticator app is asked for
|
|
14
|
+
* its code: the sign-in code, and verifying the address, which opens a
|
|
15
|
+
* session too where an app sets `emailVerification.autoSignInAfterVerification`.
|
|
16
|
+
* The step acts only where the route opened one, and honours a trusted
|
|
17
|
+
* device on each.
|
|
18
|
+
*/
|
|
19
|
+
const FIRST_FACTOR_ROUTES: ReadonlySet<string> = new Set(['/sign-in/email-otp', '/email-otp/verify-email'])
|
|
20
|
+
|
|
21
|
+
/** The id of the step that asks for the second factor after a code. */
|
|
22
|
+
export const TWO_FACTOR_STEP_PLUGIN_ID = 'two-factor-after-code'
|
|
23
|
+
|
|
24
|
+
/** How long the second step waits for the app's code, in seconds. */
|
|
25
|
+
export const TWO_FACTOR_CHALLENGE_SECONDS = 600
|
|
26
|
+
|
|
27
|
+
/** How long a device the person trusted skips the second step, in seconds (thirty days). */
|
|
28
|
+
export const TRUSTED_DEVICE_SECONDS = 30 * 24 * 60 * 60
|
|
29
|
+
|
|
30
|
+
type TwoFactorPlugin = ReturnType<typeof twoFactor>
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Better Auth's two-factor plugin as the package runs it: TOTP from an
|
|
34
|
+
* authenticator app, with backup codes, turned on and off without a
|
|
35
|
+
* password (the package's accounts have none; the request guard asks for a
|
|
36
|
+
* recent sign-in instead), and no emailed second code (the first factor is
|
|
37
|
+
* one already).
|
|
38
|
+
*
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
export function defaultTwoFactor(): TwoFactorPlugin {
|
|
42
|
+
return twoFactor({
|
|
43
|
+
allowPasswordless: true,
|
|
44
|
+
twoFactorCookieMaxAge: TWO_FACTOR_CHALLENGE_SECONDS,
|
|
45
|
+
trustDeviceMaxAge: TRUSTED_DEVICE_SECONDS,
|
|
46
|
+
backupCodeOptions: { storeBackupCodes: 'encrypted' },
|
|
47
|
+
})
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The second step after a sign-in code: the two-factor plugin's own, run on
|
|
52
|
+
* {@link FIRST_FACTOR_ROUTES}. An account with the app turned on gets
|
|
53
|
+
* `{ twoFactorRedirect: true, twoFactorMethods }` and no session; the code
|
|
54
|
+
* from the app (`/two-factor/verify-totp`) or a backup code then opens it.
|
|
55
|
+
*
|
|
56
|
+
* @internal
|
|
57
|
+
*/
|
|
58
|
+
export function twoFactorAfterCode(plugin: TwoFactorPlugin): BetterAuthPlugin {
|
|
59
|
+
const step = plugin.hooks.after[0]!
|
|
60
|
+
return {
|
|
61
|
+
id: TWO_FACTOR_STEP_PLUGIN_ID,
|
|
62
|
+
hooks: {
|
|
63
|
+
after: [{ matcher: context => FIRST_FACTOR_ROUTES.has(context.path ?? ''), handler: step.handler }],
|
|
64
|
+
},
|
|
65
|
+
} satisfies BetterAuthPlugin
|
|
66
|
+
}
|
|
@@ -16,6 +16,7 @@ import type * as alerts from "../alerts.js";
|
|
|
16
16
|
import type * as announcements from "../announcements.js";
|
|
17
17
|
import type * as audit from "../audit.js";
|
|
18
18
|
import type * as billing from "../billing.js";
|
|
19
|
+
import type * as commerce from "../commerce.js";
|
|
19
20
|
import type * as consents from "../consents.js";
|
|
20
21
|
import type * as costs from "../costs.js";
|
|
21
22
|
import type * as crons from "../crons.js";
|
|
@@ -65,6 +66,7 @@ const fullApi: ApiFromModules<{
|
|
|
65
66
|
announcements: typeof announcements;
|
|
66
67
|
audit: typeof audit;
|
|
67
68
|
billing: typeof billing;
|
|
69
|
+
commerce: typeof commerce;
|
|
68
70
|
consents: typeof consents;
|
|
69
71
|
costs: typeof costs;
|
|
70
72
|
crons: typeof crons;
|