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
|
@@ -36,6 +36,15 @@
|
|
|
36
36
|
"ageQuestion": "Сколько вам лет?",
|
|
37
37
|
"ageSubmit": "Продолжить",
|
|
38
38
|
"ageChecking": "Проверяем…",
|
|
39
|
+
"twoFactorIntro": "Введите 6-значный код из приложения-аутентификатора.",
|
|
40
|
+
"twoFactorBackupIntro": "Введите один из резервных кодов, сохранённых при включении приложения-аутентификатора. Каждый действует один раз.",
|
|
41
|
+
"twoFactorCode": "Код подтверждения",
|
|
42
|
+
"twoFactorBackupCode": "Резервный код",
|
|
43
|
+
"twoFactorTrustDevice": "Не спрашивать на этом устройстве 30 дней",
|
|
44
|
+
"twoFactorSubmit": "Подтвердить",
|
|
45
|
+
"twoFactorChecking": "Проверяем код…",
|
|
46
|
+
"twoFactorUseBackup": "Использовать резервный код",
|
|
47
|
+
"twoFactorUseApp": "Использовать приложение-аутентификатор",
|
|
39
48
|
"haveInviteCode": "У меня есть код приглашения",
|
|
40
49
|
"undeliverable": "Сейчас мы не можем отправить письмо на этот адрес. Укажите другой адрес или свяжитесь с нами.",
|
|
41
50
|
"tryAnotherEmail": "Указать другой адрес",
|
|
@@ -111,6 +120,25 @@
|
|
|
111
120
|
"removeNamed": "Удалить ключ доступа {name}",
|
|
112
121
|
"removing": "Удаляем…",
|
|
113
122
|
"removeConfirm": "Удалить ключ доступа «{name}»?",
|
|
123
|
+
"twoFactor": "Приложение-аутентификатор",
|
|
124
|
+
"twoFactorHint": "После кода входа запрашивать ещё и код из приложения-аутентификатора. Для входа с ключом доступа он не нужен.",
|
|
125
|
+
"twoFactorOn": "Включено: после кода входа запрашивается код из приложения-аутентификатора.",
|
|
126
|
+
"twoFactorStart": "Настроить приложение-аутентификатор",
|
|
127
|
+
"twoFactorStarting": "Подготовка…",
|
|
128
|
+
"twoFactorScan": "Добавьте этот аккаунт в приложение-аутентификатор: откройте ссылку на этом устройстве или введите ключ.",
|
|
129
|
+
"twoFactorOpenApp": "Открыть в приложении-аутентификаторе",
|
|
130
|
+
"twoFactorKey": "Ключ: {secret}",
|
|
131
|
+
"twoFactorCode": "Код из приложения",
|
|
132
|
+
"twoFactorConfirm": "Включить",
|
|
133
|
+
"twoFactorConfirming": "Проверяем код…",
|
|
134
|
+
"twoFactorEnabled": "Приложение-аутентификатор включено.",
|
|
135
|
+
"twoFactorDisable": "Выключить",
|
|
136
|
+
"twoFactorDisabling": "Выключаем…",
|
|
137
|
+
"twoFactorDisableConfirm": "Выключить приложение-аутентификатор? Кода входа снова будет достаточно.",
|
|
138
|
+
"twoFactorDisabled": "Приложение-аутентификатор выключено.",
|
|
139
|
+
"backupCodes": "Резервные коды: каждый один раз заменяет приложение. Храните их в надёжном месте. Они показываются один раз.",
|
|
140
|
+
"backupCodesNew": "Создать новые резервные коды",
|
|
141
|
+
"backupCodesMaking": "Создаём новые коды…",
|
|
114
142
|
"sessions": "Активные сеансы",
|
|
115
143
|
"sessionsLoading": "Загружаем сеансы…",
|
|
116
144
|
"unknownDevice": "Неизвестное устройство",
|
|
@@ -517,7 +545,9 @@
|
|
|
517
545
|
"joined": "{actor}: запись в список ожидания",
|
|
518
546
|
"admitted": "{actor}: допуск людей из списка ожидания",
|
|
519
547
|
"declined": "{actor}: отклонение заявок из списка ожидания",
|
|
520
|
-
"left": "{actor}: выход из списка ожидания"
|
|
548
|
+
"left": "{actor}: выход из списка ожидания",
|
|
549
|
+
"friend_joined": "{actor}: запись в список ожидания по ссылке друга",
|
|
550
|
+
"wave_planned": "{actor}: план следующей волны"
|
|
521
551
|
},
|
|
522
552
|
"report": {
|
|
523
553
|
"decided": "{actor}: решение по жалобе на контент",
|
|
@@ -1314,6 +1344,15 @@
|
|
|
1314
1344
|
"declineConfirm": "Отклонить {count} заявку? Её пропуск будет отозван. | Отклонить заявки ({count})? Их пропуски будут отозваны.",
|
|
1315
1345
|
"abuseConfirm": "Удалить {count} заявку как злоупотребление? Бонус, который она принесла поделившемуся с ней другу, будет отозван. | Удалить заявки ({count}) как злоупотребление? Бонусы, которые каждая принесла поделившемуся с ней другу, будут отозваны.",
|
|
1316
1346
|
"noEntries": "Здесь пока никого.",
|
|
1347
|
+
"planTitle": "Следующая волна",
|
|
1348
|
+
"planHint": "Люди в очереди видят только, попадают ли они в неё и сколько друзей для этого нужно, но не её размер.",
|
|
1349
|
+
"planSize": "Сколько человек",
|
|
1350
|
+
"planOpensAt": "Дата открытия (необязательно)",
|
|
1351
|
+
"plan": "Запланировать",
|
|
1352
|
+
"planning": "Планируем…",
|
|
1353
|
+
"planned": "Следующая волна запланирована.",
|
|
1354
|
+
"planCleared": "План сброшен.",
|
|
1355
|
+
"planClear": "Сбросить план",
|
|
1317
1356
|
"capsTitle": "Вместимость волны",
|
|
1318
1357
|
"capsHint": "Волну ограничивают допустимое для развёртывания число кодов для входа и дневная квота почтового тарифа.",
|
|
1319
1358
|
"capCodes": "Осталось кодов для входа в этот час: {left} из {limit}",
|
|
@@ -1698,6 +1737,13 @@
|
|
|
1698
1737
|
"back": "Указать другой адрес",
|
|
1699
1738
|
"placed": "Вы #{position} из {total}",
|
|
1700
1739
|
"placedUnknown": "Вы в списке ожидания.",
|
|
1740
|
+
"joinedOn": "Вы записались {date}.",
|
|
1741
|
+
"credit": "Ваши друзья продвинули вас в очереди на {count} день. | Ваши друзья продвинули вас в очереди. Дней: {count}.",
|
|
1742
|
+
"creditHours": "Ваши друзья продвинули вас в очереди на {count} час. | Ваши друзья продвинули вас в очереди. Часов: {count}.",
|
|
1743
|
+
"creditMinutes": "Ваши друзья продвинули вас в очереди на {count} минуту. | Ваши друзья продвинули вас в очереди. Минут: {count}.",
|
|
1744
|
+
"waveIn": "Пока что вы в следующей волне.",
|
|
1745
|
+
"waveShort": "Ещё {count} друг — и вы в следующей волне. | Друзей до следующей волны: {count}.",
|
|
1746
|
+
"waveOpens": "Следующая волна открывается {date}.",
|
|
1701
1747
|
"disclosure": "Мы открываем доступ волнами и можем учитывать другие критерии. Ваше место в очереди может измениться.",
|
|
1702
1748
|
"admitted": "Доступ открыт. Зарегистрируйтесь с адресом, который вы указали при записи.",
|
|
1703
1749
|
"signUp": "Зарегистрироваться",
|
|
@@ -1707,6 +1753,7 @@
|
|
|
1707
1753
|
"dropReferral": "Я не от друга",
|
|
1708
1754
|
"shareTitle": "Поднимитесь в списке",
|
|
1709
1755
|
"shareIntro": "Каждый друг, записавшийся по вашей ссылке, поднимает вас выше — учитывается до {cap} друзей.",
|
|
1756
|
+
"shareIntroOpen": "Каждый друг, записавшийся по вашей ссылке, поднимает вас выше — без ограничений.",
|
|
1710
1757
|
"shareLink": "Ваша ссылка",
|
|
1711
1758
|
"copy": "Копировать",
|
|
1712
1759
|
"copied": "Скопировано",
|
|
@@ -2606,6 +2653,7 @@
|
|
|
2606
2653
|
"forbidden_invitation_refused": "Это приглашение нельзя отправить.",
|
|
2607
2654
|
"forbidden_ticket_required": "Сейчас для регистрации нужно приглашение.",
|
|
2608
2655
|
"forbidden_consent_required": "Примите обновлённые условия, чтобы продолжить.",
|
|
2656
|
+
"forbidden_two_factor_required": "Введите код из приложения-аутентификатора, чтобы завершить вход.",
|
|
2609
2657
|
"forbidden_age_required": "Укажите свой возраст, чтобы продолжить.",
|
|
2610
2658
|
"forbidden_under_age": "Мы не можем создать для вас аккаунт.",
|
|
2611
2659
|
"forbidden_sole_owner": "Вы единственный владелец пространства, в котором есть другие участники. Сначала сделайте владельцем кого-то из них.",
|
|
@@ -2634,6 +2682,9 @@
|
|
|
2634
2682
|
"invalid_input_invite_expired": "Срок действия инвайт-кода истёк.",
|
|
2635
2683
|
"invalid_input_invite_used_up": "Этот инвайт-код уже исчерпан.",
|
|
2636
2684
|
"invalid_input_invite_revoked": "Этот инвайт-код больше не действует.",
|
|
2685
|
+
"invalid_input_twoFactorCode": "Код неверный. Проверьте приложение-аутентификатор и попробуйте снова.",
|
|
2686
|
+
"invalid_input_backup_code": "Резервный код неверный или уже использован.",
|
|
2687
|
+
"invalid_input_two_factor_expired": "Вход занял слишком много времени. Начните заново с новым кодом входа.",
|
|
2637
2688
|
"invalid_input_recoveryCode": "Код восстановления неверный или уже использован.",
|
|
2638
2689
|
"invalid_input_passkeys": "Аккаунту со входом только по ключу доступа нужен ключ доступа. Добавьте ключ или сначала снова разрешите коды для входа.",
|
|
2639
2690
|
"invalid_input_slug": "Это имя занято. Попробуйте другое.",
|
|
@@ -2868,6 +2919,12 @@
|
|
|
2868
2919
|
"note": "Мы допускаем людей волнами и можем допускать и по другим критериям. Ваше место может меняться. По этой ссылке его можно проверить в любой момент. Код для входа ей не нужен, поэтому никому не пересылайте это письмо.",
|
|
2869
2920
|
"action": "Посмотреть своё место"
|
|
2870
2921
|
},
|
|
2922
|
+
"waitlistFriendJoined": {
|
|
2923
|
+
"subject": "По вашей ссылке записался друг",
|
|
2924
|
+
"intro": "По вашей ссылке в список ожидания записался друг. Пока это {count} друг. | По вашей ссылке в список ожидания записался друг. Друзей пока: {count}.",
|
|
2925
|
+
"note": "Каждый друг, записавшийся по вашей ссылке, поднимает вас выше в очереди.",
|
|
2926
|
+
"action": "Посмотреть своё место"
|
|
2927
|
+
},
|
|
2871
2928
|
"topicConfirmation": {
|
|
2872
2929
|
"subject": "Подтвердите: {topic}",
|
|
2873
2930
|
"intro": "Вы попросили присылать вам {topic}. Подтвердите одним нажатием — и рассылка начнётся.",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ConvexBetterAuthEvent, type ConvexBetterAuthOptions, type ConvexBetterAuthService } from 'nuxt-convex-module/better-auth/server';
|
|
2
2
|
/**
|
|
3
3
|
* The signed-in caller's backend client for one request: the base module's
|
|
4
|
-
* `
|
|
4
|
+
* `convexBetterAuthNuxt(event)`, whose calls (`fetchAuthQuery`, `fetchAuthMutation`,
|
|
5
5
|
* `fetchAuthAction`, `preloadAuthQuery`) are reported when they fail. It
|
|
6
6
|
* takes the event either `defineEventHandler` passes, from `nuxt/server` or
|
|
7
7
|
* the auto-imported one, or `useRequestEvent()` during SSR.
|
|
8
8
|
*/
|
|
9
|
-
export declare function backendAuth(event:
|
|
9
|
+
export declare function backendAuth(event: ConvexBetterAuthEvent, opts?: ConvexBetterAuthOptions): ConvexBetterAuthService;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { getFunctionName } from "convex/server";
|
|
2
|
-
import {
|
|
2
|
+
import { convexBetterAuthNuxt } from "nuxt-convex-module/better-auth/server";
|
|
3
3
|
import { capturingBackendCall } from "./capture.js";
|
|
4
4
|
function reported(helper) {
|
|
5
5
|
const call = helper;
|
|
6
6
|
return ((ref, ...rest) => capturingBackendCall(getFunctionName(ref), () => call(ref, ...rest)));
|
|
7
7
|
}
|
|
8
8
|
export function backendAuth(event, opts) {
|
|
9
|
-
const service =
|
|
9
|
+
const service = convexBetterAuthNuxt(event, opts);
|
|
10
10
|
return {
|
|
11
11
|
...service,
|
|
12
12
|
fetchAuthQuery: reported(service.fetchAuthQuery),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineEventHandler, getRequestHeader, setResponseStatus, useRuntimeConfig } from "nuxt/server";
|
|
2
|
-
import {
|
|
2
|
+
import { convexBetterAuthNuxt } from "nuxt-convex-module/better-auth/server";
|
|
3
3
|
import { DEFAULT_HEALTH_PATH } from "../../../convex/constants.js";
|
|
4
4
|
import { readSiteUrl } from "../site-url.js";
|
|
5
5
|
const BACKEND_TIMEOUT_MS = 5e3;
|
|
@@ -17,7 +17,7 @@ function appReports() {
|
|
|
17
17
|
async function sessionToken(event) {
|
|
18
18
|
if (!getRequestHeader(event, "cookie")) return void 0;
|
|
19
19
|
try {
|
|
20
|
-
return await
|
|
20
|
+
return await convexBetterAuthNuxt(event).getToken();
|
|
21
21
|
} catch {
|
|
22
22
|
return void 0;
|
|
23
23
|
}
|
|
@@ -5,16 +5,17 @@ import { type AdminClientPlugin } from './admin-client.js';
|
|
|
5
5
|
import { type OrganizationClientPlugin } from './organization-client.js';
|
|
6
6
|
import { passkeyClient } from './passkey-client.js';
|
|
7
7
|
import { protectionClient } from './protection/state.js';
|
|
8
|
+
import { type TwoFactorClientPlugin } from './two-factor-client.js';
|
|
8
9
|
/**
|
|
9
10
|
* The plugins below, as the client's type reads them. Named rather than
|
|
10
11
|
* inferred, so the declaration file says this line instead of every plugin's
|
|
11
12
|
* type spelled out (about 150 kB of the package). The two generic plugins
|
|
12
13
|
* are named with the options a call without any infers.
|
|
13
14
|
*/
|
|
14
|
-
type BackendAuthPlugin = ReturnType<typeof convexClient> | ReturnType<typeof emailOTPClient> | ReturnType<typeof passkeyClient> | AdminClientPlugin | OrganizationClientPlugin | ReturnType<typeof protectionClient
|
|
15
|
+
type BackendAuthPlugin = ReturnType<typeof convexClient> | ReturnType<typeof emailOTPClient> | ReturnType<typeof passkeyClient> | AdminClientPlugin | OrganizationClientPlugin | ReturnType<typeof protectionClient> | TwoFactorClientPlugin;
|
|
15
16
|
/**
|
|
16
17
|
* The backend's Better Auth client — the client-side counterpart of the
|
|
17
|
-
* server setup this package ships: passwordless sign-in (OTP + passkeys),
|
|
18
|
+
* server setup this package ships: passwordless sign-in (OTP + passkeys, an authenticator app after a code),
|
|
18
19
|
* admin (roles/ban/impersonation), and organizations (workspaces). Wired into
|
|
19
20
|
* `nuxt-convex-module` as its `betterAuth.authClient`, so the package's auth session
|
|
20
21
|
* is typed with exactly these plugins.
|
|
@@ -5,5 +5,6 @@ import { adminClient } from "./admin-client.js";
|
|
|
5
5
|
import { organizationClient } from "./organization-client.js";
|
|
6
6
|
import { passkeyClient } from "./passkey-client.js";
|
|
7
7
|
import { protectionClient } from "./protection/state.js";
|
|
8
|
-
|
|
8
|
+
import { twoFactorClient } from "./two-factor-client.js";
|
|
9
|
+
const plugins = [convexClient(), emailOTPClient(), passkeyClient(), adminClient(), organizationClient(), protectionClient(), twoFactorClient()];
|
|
9
10
|
export const authClient = createAuthClient({ plugins });
|
|
@@ -11,17 +11,21 @@ type __VLS_Slots = SecuritySettingsSlots;
|
|
|
11
11
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
12
|
error: (_message: string) => void;
|
|
13
13
|
"signed-out": () => void;
|
|
14
|
+
"sessions-revoked": () => void;
|
|
14
15
|
"passkey-added": () => void;
|
|
15
16
|
"passkey-removed": (_id: string) => void;
|
|
17
|
+
"two-factor-enabled": () => void;
|
|
18
|
+
"two-factor-disabled": () => void;
|
|
16
19
|
"session-revoked": (_id: string) => void;
|
|
17
|
-
"sessions-revoked": () => void;
|
|
18
20
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
19
21
|
onError?: ((_message: string) => any) | undefined;
|
|
20
22
|
"onSigned-out"?: (() => any) | undefined;
|
|
23
|
+
"onSessions-revoked"?: (() => any) | undefined;
|
|
21
24
|
"onPasskey-added"?: (() => any) | undefined;
|
|
22
25
|
"onPasskey-removed"?: ((_id: string) => any) | undefined;
|
|
26
|
+
"onTwo-factor-enabled"?: (() => any) | undefined;
|
|
27
|
+
"onTwo-factor-disabled"?: (() => any) | undefined;
|
|
23
28
|
"onSession-revoked"?: ((_id: string) => any) | undefined;
|
|
24
|
-
"onSessions-revoked"?: (() => any) | undefined;
|
|
25
29
|
}>, {
|
|
26
30
|
confirm: (message: string) => boolean | Promise<boolean>;
|
|
27
31
|
labels: LabelOverrides<{
|
|
@@ -42,6 +46,25 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
42
46
|
removeNamed: string;
|
|
43
47
|
removing: string;
|
|
44
48
|
removeConfirm: string;
|
|
49
|
+
twoFactor: string;
|
|
50
|
+
twoFactorHint: string;
|
|
51
|
+
twoFactorOn: string;
|
|
52
|
+
twoFactorStart: string;
|
|
53
|
+
twoFactorStarting: string;
|
|
54
|
+
twoFactorScan: string;
|
|
55
|
+
twoFactorOpenApp: string;
|
|
56
|
+
twoFactorKey: string;
|
|
57
|
+
twoFactorCode: string;
|
|
58
|
+
twoFactorConfirm: string;
|
|
59
|
+
twoFactorConfirming: string;
|
|
60
|
+
twoFactorEnabled: string;
|
|
61
|
+
twoFactorDisable: string;
|
|
62
|
+
twoFactorDisabling: string;
|
|
63
|
+
twoFactorDisableConfirm: string;
|
|
64
|
+
twoFactorDisabled: string;
|
|
65
|
+
backupCodes: string;
|
|
66
|
+
backupCodesNew: string;
|
|
67
|
+
backupCodesMaking: string;
|
|
45
68
|
sessions: string;
|
|
46
69
|
sessionsLoading: string;
|
|
47
70
|
unknownDevice: string;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { computed, nextTick, ref } from "vue";
|
|
2
|
+
import { computed, nextTick, ref, watch } from "vue";
|
|
3
3
|
import { busyAttributes } from "../../a11y";
|
|
4
4
|
import { useLabels } from "../../composables/use-labels";
|
|
5
5
|
import { usePasskeys } from "../../composables/use-passkeys";
|
|
6
6
|
import { useReauthentication } from "../../composables/use-reauthentication";
|
|
7
7
|
import { parseUserAgent, useSessions } from "../../composables/use-sessions";
|
|
8
|
+
import { useTwoFactor } from "../../composables/use-two-factor";
|
|
8
9
|
import { useAuthSession } from "../../utils/auth-session";
|
|
9
10
|
import { useConfirmation } from "../../utils/confirmation";
|
|
10
11
|
import { focusedIn, focusStranded, returnFocus } from "../../utils/focus-return";
|
|
@@ -15,13 +16,15 @@ import { useSignInAlertsState } from "./security-alerts";
|
|
|
15
16
|
import { provideSecurityView } from "./security-settings";
|
|
16
17
|
defineOptions({ name: "SecuritySettings" });
|
|
17
18
|
const props = defineProps({
|
|
18
|
-
sections: { type: Array, required: false, default: () => ["passkeys", "sessions", "alerts", "danger"] },
|
|
19
|
+
sections: { type: Array, required: false, default: () => ["passkeys", "twoFactor", "sessions", "alerts", "danger"] },
|
|
19
20
|
confirm: { type: Function, required: false, default: void 0 },
|
|
20
21
|
labels: { type: null, required: false, default: void 0 }
|
|
21
22
|
});
|
|
22
23
|
const emit = defineEmits({
|
|
23
24
|
"passkey-added": () => true,
|
|
24
25
|
"passkey-removed": (_id) => true,
|
|
26
|
+
"two-factor-enabled": () => true,
|
|
27
|
+
"two-factor-disabled": () => true,
|
|
25
28
|
"session-revoked": (_id) => true,
|
|
26
29
|
"sessions-revoked": () => true,
|
|
27
30
|
"signed-out": () => true,
|
|
@@ -31,6 +34,7 @@ const slots = defineSlots();
|
|
|
31
34
|
const auth = useAuthSession();
|
|
32
35
|
const passkeys = usePasskeys();
|
|
33
36
|
const sessions = useSessions();
|
|
37
|
+
const twoFactor = useTwoFactor();
|
|
34
38
|
const alerts = useSignInAlertsState();
|
|
35
39
|
const { withReauthentication } = useReauthentication();
|
|
36
40
|
const labels = useLabels("security", () => props.labels);
|
|
@@ -85,6 +89,7 @@ const signOut = () => run("sign-out", async () => {
|
|
|
85
89
|
const context = computed(() => ({
|
|
86
90
|
user: auth.user.value,
|
|
87
91
|
passkeys,
|
|
92
|
+
twoFactor,
|
|
88
93
|
sessions,
|
|
89
94
|
alerts,
|
|
90
95
|
message: message.value,
|
|
@@ -93,6 +98,18 @@ const context = computed(() => ({
|
|
|
93
98
|
signOut
|
|
94
99
|
}));
|
|
95
100
|
const recoveryCode = ref(null);
|
|
101
|
+
const twoFactorCode = ref("");
|
|
102
|
+
const backupCodes = ref(null);
|
|
103
|
+
const accountId = () => auth.user.value?.id ?? null;
|
|
104
|
+
watch(accountId, () => {
|
|
105
|
+
backupCodes.value = null;
|
|
106
|
+
twoFactorCode.value = "";
|
|
107
|
+
});
|
|
108
|
+
async function forSameAccount(action) {
|
|
109
|
+
const askedFor = accountId();
|
|
110
|
+
const answer = await action();
|
|
111
|
+
return accountId() === askedFor ? answer : void 0;
|
|
112
|
+
}
|
|
96
113
|
provideSecurityView({
|
|
97
114
|
labels,
|
|
98
115
|
context,
|
|
@@ -119,6 +136,32 @@ provideSecurityView({
|
|
|
119
136
|
const answer = await withReauthentication(() => passkeys.setPasskeyOnly(on));
|
|
120
137
|
recoveryCode.value = answer.recoveryCode;
|
|
121
138
|
}),
|
|
139
|
+
twoFactorCode,
|
|
140
|
+
backupCodes,
|
|
141
|
+
startTwoFactor: () => run("two-factor:start", async () => {
|
|
142
|
+
const setup = await forSameAccount(() => withReauthentication(() => twoFactor.start()));
|
|
143
|
+
if (!setup) return;
|
|
144
|
+
twoFactorCode.value = "";
|
|
145
|
+
backupCodes.value = setup.backupCodes;
|
|
146
|
+
}),
|
|
147
|
+
confirmTwoFactor: () => run("two-factor:confirm", async () => {
|
|
148
|
+
await twoFactor.confirm(twoFactorCode.value);
|
|
149
|
+
twoFactorCode.value = "";
|
|
150
|
+
emit("two-factor-enabled");
|
|
151
|
+
}, () => t("twoFactorEnabled")),
|
|
152
|
+
disableTwoFactor: async () => {
|
|
153
|
+
const key = "two-factor:disable";
|
|
154
|
+
if (!await confirmed(key, t("twoFactorDisableConfirm"))) return;
|
|
155
|
+
await run(key, async () => {
|
|
156
|
+
await withReauthentication(() => twoFactor.disable());
|
|
157
|
+
backupCodes.value = null;
|
|
158
|
+
emit("two-factor-disabled");
|
|
159
|
+
}, () => t("twoFactorDisabled"));
|
|
160
|
+
},
|
|
161
|
+
regenerateBackupCodes: () => run("two-factor:backup-codes", async () => {
|
|
162
|
+
const codes = await forSameAccount(() => withReauthentication(() => twoFactor.regenerateBackupCodes()));
|
|
163
|
+
if (codes) backupCodes.value = codes;
|
|
164
|
+
}),
|
|
122
165
|
saveRename: (row) => run(`passkey:rename:${row.id}`, async () => {
|
|
123
166
|
const name = editName.value.trim();
|
|
124
167
|
if (name && name !== row.name) await passkeys.rename(row.id, name);
|
|
@@ -164,6 +207,13 @@ provideSecurityView({
|
|
|
164
207
|
>
|
|
165
208
|
<SecurityPasskeys :passkeys="passkeys" />
|
|
166
209
|
</slot>
|
|
210
|
+
<slot
|
|
211
|
+
v-else-if="section === 'twoFactor'"
|
|
212
|
+
name="twoFactor"
|
|
213
|
+
v-bind="context"
|
|
214
|
+
>
|
|
215
|
+
<SecurityTwoFactor :two-factor="twoFactor" />
|
|
216
|
+
</slot>
|
|
167
217
|
<slot
|
|
168
218
|
v-else-if="section === 'sessions'"
|
|
169
219
|
name="sessions"
|
|
@@ -11,17 +11,21 @@ type __VLS_Slots = SecuritySettingsSlots;
|
|
|
11
11
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
12
|
error: (_message: string) => void;
|
|
13
13
|
"signed-out": () => void;
|
|
14
|
+
"sessions-revoked": () => void;
|
|
14
15
|
"passkey-added": () => void;
|
|
15
16
|
"passkey-removed": (_id: string) => void;
|
|
17
|
+
"two-factor-enabled": () => void;
|
|
18
|
+
"two-factor-disabled": () => void;
|
|
16
19
|
"session-revoked": (_id: string) => void;
|
|
17
|
-
"sessions-revoked": () => void;
|
|
18
20
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
19
21
|
onError?: ((_message: string) => any) | undefined;
|
|
20
22
|
"onSigned-out"?: (() => any) | undefined;
|
|
23
|
+
"onSessions-revoked"?: (() => any) | undefined;
|
|
21
24
|
"onPasskey-added"?: (() => any) | undefined;
|
|
22
25
|
"onPasskey-removed"?: ((_id: string) => any) | undefined;
|
|
26
|
+
"onTwo-factor-enabled"?: (() => any) | undefined;
|
|
27
|
+
"onTwo-factor-disabled"?: (() => any) | undefined;
|
|
23
28
|
"onSession-revoked"?: ((_id: string) => any) | undefined;
|
|
24
|
-
"onSessions-revoked"?: (() => any) | undefined;
|
|
25
29
|
}>, {
|
|
26
30
|
confirm: (message: string) => boolean | Promise<boolean>;
|
|
27
31
|
labels: LabelOverrides<{
|
|
@@ -42,6 +46,25 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
42
46
|
removeNamed: string;
|
|
43
47
|
removing: string;
|
|
44
48
|
removeConfirm: string;
|
|
49
|
+
twoFactor: string;
|
|
50
|
+
twoFactorHint: string;
|
|
51
|
+
twoFactorOn: string;
|
|
52
|
+
twoFactorStart: string;
|
|
53
|
+
twoFactorStarting: string;
|
|
54
|
+
twoFactorScan: string;
|
|
55
|
+
twoFactorOpenApp: string;
|
|
56
|
+
twoFactorKey: string;
|
|
57
|
+
twoFactorCode: string;
|
|
58
|
+
twoFactorConfirm: string;
|
|
59
|
+
twoFactorConfirming: string;
|
|
60
|
+
twoFactorEnabled: string;
|
|
61
|
+
twoFactorDisable: string;
|
|
62
|
+
twoFactorDisabling: string;
|
|
63
|
+
twoFactorDisableConfirm: string;
|
|
64
|
+
twoFactorDisabled: string;
|
|
65
|
+
backupCodes: string;
|
|
66
|
+
backupCodesNew: string;
|
|
67
|
+
backupCodesMaking: string;
|
|
45
68
|
sessions: string;
|
|
46
69
|
sessionsLoading: string;
|
|
47
70
|
unknownDevice: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer nuxt-backend{[data-security=backup-codes-note],[data-security=two-factor-hint],[data-security=two-factor-scan]{color:var(--bk-muted);font-size:.85rem;line-height:1.5;margin:0}[data-security=backup-codes],[data-security=two-factor-setup]{border:var(--bk-border-width-surface,var(--bk-border-width)) solid var(--bk-edge);border-radius:var(--bk-radius);box-shadow:var(--bk-shadow);display:flex;flex-direction:column;gap:.6rem;padding:.75rem .8rem}[data-security=backup-code] :where(code),[data-security=two-factor-key]{font-variant-numeric:tabular-nums;letter-spacing:.08em;overflow-wrap:anywhere}[data-security=input-two-factor-code]{background:transparent;border:var(--bk-border-width-control,var(--bk-border-width)) solid var(--bk-edge);border-radius:var(--bk-radius-control);color:inherit;font:inherit;font-variant-numeric:tabular-nums;letter-spacing:.15em;max-width:10rem;padding:.3rem .5rem}[data-security=two-factor-confirm],[data-security=two-factor-start]{align-self:flex-start;background:var(--bk-accent);border-color:var(--bk-accent);color:var(--bk-on-accent)}[data-security=section-two-factor][data-state=on] [data-security=two-factor-hint]{color:var(--bk-ok)}[data-security=backup-code-list]{display:grid;gap:.35rem 1rem;grid-template-columns:repeat(auto-fill,minmax(9rem,1fr));list-style:none;margin:0;padding:0}}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SecurityTwoFactorProps } from '../../parts.js';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<SecurityTwoFactorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SecurityTwoFactorProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { busyAttributes } from "../../a11y";
|
|
3
|
+
import { useSecurityView } from "./security-settings";
|
|
4
|
+
defineOptions({ name: "SecurityTwoFactor" });
|
|
5
|
+
defineProps({
|
|
6
|
+
twoFactor: { type: Object, required: true }
|
|
7
|
+
});
|
|
8
|
+
const view = useSecurityView("SecurityTwoFactor");
|
|
9
|
+
const { t } = view.labels;
|
|
10
|
+
const { twoFactorCode } = view;
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<section
|
|
15
|
+
data-security="section-two-factor"
|
|
16
|
+
tabindex="-1"
|
|
17
|
+
:data-state="twoFactor.enabled.value ? 'on' : 'off'"
|
|
18
|
+
>
|
|
19
|
+
<h3 data-security="section-title">
|
|
20
|
+
{{ t("twoFactor") }}
|
|
21
|
+
</h3>
|
|
22
|
+
<p data-security="two-factor-hint">
|
|
23
|
+
{{ twoFactor.enabled.value ? t("twoFactorOn") : t("twoFactorHint") }}
|
|
24
|
+
</p>
|
|
25
|
+
<template v-if="!twoFactor.enabled.value">
|
|
26
|
+
<form
|
|
27
|
+
v-if="twoFactor.pendingSetup.value"
|
|
28
|
+
data-security="two-factor-setup"
|
|
29
|
+
@submit.prevent="view.confirmTwoFactor()"
|
|
30
|
+
>
|
|
31
|
+
<p data-security="two-factor-scan">
|
|
32
|
+
{{ t("twoFactorScan") }}
|
|
33
|
+
</p>
|
|
34
|
+
<a
|
|
35
|
+
data-security="two-factor-link"
|
|
36
|
+
:href="twoFactor.pendingSetup.value.totpURI"
|
|
37
|
+
>{{ t("twoFactorOpenApp") }}</a>
|
|
38
|
+
<code data-security="two-factor-key">{{ t("twoFactorKey", { secret: twoFactor.pendingSetup.value.secret }) }}</code>
|
|
39
|
+
<label data-security="label-two-factor-code">
|
|
40
|
+
{{ t("twoFactorCode") }}
|
|
41
|
+
<input
|
|
42
|
+
v-model="twoFactorCode"
|
|
43
|
+
data-security="input-two-factor-code"
|
|
44
|
+
type="text"
|
|
45
|
+
inputmode="numeric"
|
|
46
|
+
autocomplete="one-time-code"
|
|
47
|
+
pattern="[0-9 ]*"
|
|
48
|
+
maxlength="7"
|
|
49
|
+
required
|
|
50
|
+
>
|
|
51
|
+
</label>
|
|
52
|
+
<button
|
|
53
|
+
data-security="two-factor-confirm"
|
|
54
|
+
type="submit"
|
|
55
|
+
v-bind="busyAttributes(view.busy('two-factor:confirm'))"
|
|
56
|
+
>
|
|
57
|
+
{{ view.busy("two-factor:confirm") ? t("twoFactorConfirming") : t("twoFactorConfirm") }}
|
|
58
|
+
</button>
|
|
59
|
+
</form>
|
|
60
|
+
<button
|
|
61
|
+
v-else
|
|
62
|
+
data-security="two-factor-start"
|
|
63
|
+
type="button"
|
|
64
|
+
v-bind="busyAttributes(view.busy('two-factor:start'))"
|
|
65
|
+
@click="view.startTwoFactor()"
|
|
66
|
+
>
|
|
67
|
+
{{ view.busy("two-factor:start") ? t("twoFactorStarting") : t("twoFactorStart") }}
|
|
68
|
+
</button>
|
|
69
|
+
</template>
|
|
70
|
+
<template v-else>
|
|
71
|
+
<button
|
|
72
|
+
data-security="backup-codes-new"
|
|
73
|
+
type="button"
|
|
74
|
+
v-bind="busyAttributes(view.busy('two-factor:backup-codes'))"
|
|
75
|
+
@click="view.regenerateBackupCodes()"
|
|
76
|
+
>
|
|
77
|
+
{{ view.busy("two-factor:backup-codes") ? t("backupCodesMaking") : t("backupCodesNew") }}
|
|
78
|
+
</button>
|
|
79
|
+
<button
|
|
80
|
+
data-security="two-factor-disable"
|
|
81
|
+
type="button"
|
|
82
|
+
v-bind="busyAttributes(view.busy('two-factor:disable'))"
|
|
83
|
+
@click="view.disableTwoFactor()"
|
|
84
|
+
>
|
|
85
|
+
{{ view.busy("two-factor:disable") ? t("twoFactorDisabling") : t("twoFactorDisable") }}
|
|
86
|
+
</button>
|
|
87
|
+
</template>
|
|
88
|
+
<div
|
|
89
|
+
v-if="view.backupCodes.value"
|
|
90
|
+
data-security="backup-codes"
|
|
91
|
+
role="status"
|
|
92
|
+
>
|
|
93
|
+
<p data-security="backup-codes-note">
|
|
94
|
+
{{ t("backupCodes") }}
|
|
95
|
+
</p>
|
|
96
|
+
<ul data-security="backup-code-list">
|
|
97
|
+
<li
|
|
98
|
+
v-for="code in view.backupCodes.value"
|
|
99
|
+
:key="code"
|
|
100
|
+
data-security="backup-code"
|
|
101
|
+
>
|
|
102
|
+
<code>{{ code }}</code>
|
|
103
|
+
</li>
|
|
104
|
+
</ul>
|
|
105
|
+
</div>
|
|
106
|
+
</section>
|
|
107
|
+
</template>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SecurityTwoFactorProps } from '../../parts.js';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<SecurityTwoFactorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SecurityTwoFactorProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -2,12 +2,15 @@ import { type ComputedRef, type Ref } from 'vue';
|
|
|
2
2
|
import type { UseLabelsReturn } from '../../composables/use-labels.js';
|
|
3
3
|
import type { Passkey, UsePasskeysReturn } from '../../composables/use-passkeys.js';
|
|
4
4
|
import type { SessionInfo, UseSessionsReturn } from '../../composables/use-sessions.js';
|
|
5
|
+
import type { UseTwoFactorReturn } from '../../composables/use-two-factor.js';
|
|
5
6
|
import type { SettingsMessage } from '../../utils/settings-message.js';
|
|
6
7
|
import type { SignInAlertsState } from './security-alerts.js';
|
|
7
|
-
export type SecuritySection = 'passkeys' | 'sessions' | 'alerts' | 'danger';
|
|
8
|
+
export type SecuritySection = 'passkeys' | 'twoFactor' | 'sessions' | 'alerts' | 'danger';
|
|
8
9
|
export interface SecuritySlotContext {
|
|
9
10
|
user: Record<string, unknown> | null | undefined;
|
|
10
11
|
passkeys: UsePasskeysReturn;
|
|
12
|
+
/** The authenticator app after a sign-in code. */
|
|
13
|
+
twoFactor: UseTwoFactorReturn;
|
|
11
14
|
sessions: UseSessionsReturn;
|
|
12
15
|
/** The account's latest sign-ins from a new device. */
|
|
13
16
|
alerts: SignInAlertsState;
|
|
@@ -26,6 +29,8 @@ export interface SecuritySettingsSlots {
|
|
|
26
29
|
passkey: (context: SecuritySlotContext & {
|
|
27
30
|
entry: Passkey;
|
|
28
31
|
}) => unknown;
|
|
32
|
+
/** The authenticator app: turning it on with its first code, the backup codes, turning it off. */
|
|
33
|
+
twoFactor: (context: SecuritySlotContext) => unknown;
|
|
29
34
|
/** The whole sessions section. */
|
|
30
35
|
sessions: (context: SecuritySlotContext) => unknown;
|
|
31
36
|
/** One session row, with the session. */
|
|
@@ -60,6 +65,18 @@ export interface SecurityView {
|
|
|
60
65
|
/** The recovery code the last passkey-only switch answered, shown until the page goes. */
|
|
61
66
|
recoveryCode: Ref<string | null>;
|
|
62
67
|
startRename: (row: Passkey) => void;
|
|
68
|
+
/** Begin turning the authenticator app on, behind a recent sign-in: the link and the backup codes land in `twoFactor.pendingSetup`. */
|
|
69
|
+
startTwoFactor: () => Promise<void>;
|
|
70
|
+
/** The first code the app shows, typed to confirm the setup. */
|
|
71
|
+
twoFactorCode: Ref<string>;
|
|
72
|
+
/** Check `twoFactorCode` and turn the step on. */
|
|
73
|
+
confirmTwoFactor: () => Promise<void>;
|
|
74
|
+
/** Turn the authenticator app off, behind a recent sign-in. */
|
|
75
|
+
disableTwoFactor: () => Promise<void>;
|
|
76
|
+
/** New backup codes, behind a recent sign-in: they land in `backupCodes`. */
|
|
77
|
+
regenerateBackupCodes: () => Promise<void>;
|
|
78
|
+
/** The backup codes the last setup or regeneration answered, shown until the page goes. */
|
|
79
|
+
backupCodes: Ref<string[] | null>;
|
|
63
80
|
revokeSession: (row: SessionInfo) => Promise<void>;
|
|
64
81
|
revokeOthers: () => Promise<void>;
|
|
65
82
|
/** A passkey's name as the rows show it. */
|
|
@@ -20,15 +20,15 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
20
20
|
banned: (_userId: string) => void;
|
|
21
21
|
impersonated: (_userId: string) => void;
|
|
22
22
|
unbanned: (_userId: string) => void;
|
|
23
|
-
"sessions-revoked": (_userId: string) => void;
|
|
24
23
|
"role-changed": (_userId: string, _role: string) => void;
|
|
24
|
+
"sessions-revoked": (_userId: string) => void;
|
|
25
25
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
26
26
|
onError?: ((_message: string) => any) | undefined;
|
|
27
27
|
onBanned?: ((_userId: string) => any) | undefined;
|
|
28
28
|
onImpersonated?: ((_userId: string) => any) | undefined;
|
|
29
29
|
onUnbanned?: ((_userId: string) => any) | undefined;
|
|
30
|
-
"onSessions-revoked"?: ((_userId: string) => any) | undefined;
|
|
31
30
|
"onRole-changed"?: ((_userId: string, _role: string) => any) | undefined;
|
|
31
|
+
"onSessions-revoked"?: ((_userId: string) => any) | undefined;
|
|
32
32
|
}>, {
|
|
33
33
|
roles: string[];
|
|
34
34
|
userId: string;
|
|
@@ -764,6 +764,15 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
764
764
|
declineConfirm: string;
|
|
765
765
|
abuseConfirm: string;
|
|
766
766
|
noEntries: string;
|
|
767
|
+
planTitle: string;
|
|
768
|
+
planHint: string;
|
|
769
|
+
planSize: string;
|
|
770
|
+
planOpensAt: string;
|
|
771
|
+
plan: string;
|
|
772
|
+
planning: string;
|
|
773
|
+
planned: string;
|
|
774
|
+
planCleared: string;
|
|
775
|
+
planClear: string;
|
|
767
776
|
capsTitle: string;
|
|
768
777
|
capsHint: string;
|
|
769
778
|
capCodes: string;
|