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
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { busyAttributes } from '../../a11y'
|
|
3
|
+
import type { SecurityTwoFactorProps } from '../../parts'
|
|
4
|
+
import { useSecurityView } from './security-settings'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* `<SecuritySettings>`'s authenticator app: the button that sets one up,
|
|
8
|
+
* then the link and the key to add the account to the app with the field
|
|
9
|
+
* for its first code, the backup codes a setup or a regeneration answered
|
|
10
|
+
* (shown once), and turning it off.
|
|
11
|
+
*/
|
|
12
|
+
defineOptions({ name: 'SecurityTwoFactor' })
|
|
13
|
+
defineProps<SecurityTwoFactorProps>()
|
|
14
|
+
const view = useSecurityView('SecurityTwoFactor')
|
|
15
|
+
const { t } = view.labels
|
|
16
|
+
const { twoFactorCode } = view
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<section
|
|
21
|
+
data-security="section-two-factor"
|
|
22
|
+
tabindex="-1"
|
|
23
|
+
:data-state="twoFactor.enabled.value ? 'on' : 'off'"
|
|
24
|
+
>
|
|
25
|
+
<h3 data-security="section-title">
|
|
26
|
+
{{ t('twoFactor') }}
|
|
27
|
+
</h3>
|
|
28
|
+
<p data-security="two-factor-hint">
|
|
29
|
+
{{ twoFactor.enabled.value ? t('twoFactorOn') : t('twoFactorHint') }}
|
|
30
|
+
</p>
|
|
31
|
+
<template v-if="!twoFactor.enabled.value">
|
|
32
|
+
<form
|
|
33
|
+
v-if="twoFactor.pendingSetup.value"
|
|
34
|
+
data-security="two-factor-setup"
|
|
35
|
+
@submit.prevent="view.confirmTwoFactor()"
|
|
36
|
+
>
|
|
37
|
+
<p data-security="two-factor-scan">
|
|
38
|
+
{{ t('twoFactorScan') }}
|
|
39
|
+
</p>
|
|
40
|
+
<a
|
|
41
|
+
data-security="two-factor-link"
|
|
42
|
+
:href="twoFactor.pendingSetup.value.totpURI"
|
|
43
|
+
>{{ t('twoFactorOpenApp') }}</a>
|
|
44
|
+
<code data-security="two-factor-key">{{ t('twoFactorKey', { secret: twoFactor.pendingSetup.value.secret }) }}</code>
|
|
45
|
+
<label data-security="label-two-factor-code">
|
|
46
|
+
{{ t('twoFactorCode') }}
|
|
47
|
+
<input
|
|
48
|
+
v-model="twoFactorCode"
|
|
49
|
+
data-security="input-two-factor-code"
|
|
50
|
+
type="text"
|
|
51
|
+
inputmode="numeric"
|
|
52
|
+
autocomplete="one-time-code"
|
|
53
|
+
pattern="[0-9 ]*"
|
|
54
|
+
maxlength="7"
|
|
55
|
+
required
|
|
56
|
+
>
|
|
57
|
+
</label>
|
|
58
|
+
<button
|
|
59
|
+
data-security="two-factor-confirm"
|
|
60
|
+
type="submit"
|
|
61
|
+
v-bind="busyAttributes(view.busy('two-factor:confirm'))"
|
|
62
|
+
>
|
|
63
|
+
{{ view.busy('two-factor:confirm') ? t('twoFactorConfirming') : t('twoFactorConfirm') }}
|
|
64
|
+
</button>
|
|
65
|
+
</form>
|
|
66
|
+
<button
|
|
67
|
+
v-else
|
|
68
|
+
data-security="two-factor-start"
|
|
69
|
+
type="button"
|
|
70
|
+
v-bind="busyAttributes(view.busy('two-factor:start'))"
|
|
71
|
+
@click="view.startTwoFactor()"
|
|
72
|
+
>
|
|
73
|
+
{{ view.busy('two-factor:start') ? t('twoFactorStarting') : t('twoFactorStart') }}
|
|
74
|
+
</button>
|
|
75
|
+
</template>
|
|
76
|
+
<template v-else>
|
|
77
|
+
<button
|
|
78
|
+
data-security="backup-codes-new"
|
|
79
|
+
type="button"
|
|
80
|
+
v-bind="busyAttributes(view.busy('two-factor:backup-codes'))"
|
|
81
|
+
@click="view.regenerateBackupCodes()"
|
|
82
|
+
>
|
|
83
|
+
{{ view.busy('two-factor:backup-codes') ? t('backupCodesMaking') : t('backupCodesNew') }}
|
|
84
|
+
</button>
|
|
85
|
+
<button
|
|
86
|
+
data-security="two-factor-disable"
|
|
87
|
+
type="button"
|
|
88
|
+
v-bind="busyAttributes(view.busy('two-factor:disable'))"
|
|
89
|
+
@click="view.disableTwoFactor()"
|
|
90
|
+
>
|
|
91
|
+
{{ view.busy('two-factor:disable') ? t('twoFactorDisabling') : t('twoFactorDisable') }}
|
|
92
|
+
</button>
|
|
93
|
+
</template>
|
|
94
|
+
<div
|
|
95
|
+
v-if="view.backupCodes.value"
|
|
96
|
+
data-security="backup-codes"
|
|
97
|
+
role="status"
|
|
98
|
+
>
|
|
99
|
+
<p data-security="backup-codes-note">
|
|
100
|
+
{{ t('backupCodes') }}
|
|
101
|
+
</p>
|
|
102
|
+
<ul data-security="backup-code-list">
|
|
103
|
+
<li
|
|
104
|
+
v-for="code in view.backupCodes.value"
|
|
105
|
+
:key="code"
|
|
106
|
+
data-security="backup-code"
|
|
107
|
+
>
|
|
108
|
+
<code>{{ code }}</code>
|
|
109
|
+
</li>
|
|
110
|
+
</ul>
|
|
111
|
+
</div>
|
|
112
|
+
</section>
|
|
113
|
+
</template>
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
/**
|
|
3
3
|
* What an administrator does with the waiting people: admit the next N in
|
|
4
|
-
* line,
|
|
4
|
+
* line, plan the next wave (which each waiting person reads only as "in it"
|
|
5
|
+
* or "N friends short"), or approve, decline or remove as abuse the entries
|
|
6
|
+
* ticked.
|
|
5
7
|
*
|
|
6
8
|
* Internal: a part of `AdminWaitlist.vue`.
|
|
7
9
|
*
|
|
@@ -10,7 +12,7 @@
|
|
|
10
12
|
import type { WaitlistTab } from './admin-waitlist-tab'
|
|
11
13
|
|
|
12
14
|
const props = defineProps<{ tab: WaitlistTab }>()
|
|
13
|
-
const { t, running, selected, next } = props.tab
|
|
15
|
+
const { t, running, selected, next, plan } = props.tab
|
|
14
16
|
|
|
15
17
|
/** A button's `aria-disabled`: busy while its change runs, and unavailable until something is ticked. */
|
|
16
18
|
const state = (key: string) => props.tab.busy(key) ?? (selected.value.length ? undefined : 'true')
|
|
@@ -39,6 +41,46 @@ const state = (key: string) => props.tab.busy(key) ?? (selected.value.length ? u
|
|
|
39
41
|
{{ running === 'next' ? t('waitlist.approving') : t('waitlist.approveNext') }}
|
|
40
42
|
</button>
|
|
41
43
|
</form>
|
|
44
|
+
<form
|
|
45
|
+
data-admin="waitlist-plan"
|
|
46
|
+
:aria-label="t('waitlist.planTitle')"
|
|
47
|
+
@submit.prevent="tab.planWave()"
|
|
48
|
+
>
|
|
49
|
+
<label>
|
|
50
|
+
{{ t('waitlist.planSize') }}
|
|
51
|
+
<input
|
|
52
|
+
v-model="plan.size"
|
|
53
|
+
type="number"
|
|
54
|
+
required
|
|
55
|
+
min="1"
|
|
56
|
+
:max="tab.planMax"
|
|
57
|
+
inputmode="numeric"
|
|
58
|
+
>
|
|
59
|
+
</label>
|
|
60
|
+
<label>
|
|
61
|
+
{{ t('waitlist.planOpensAt') }}
|
|
62
|
+
<input
|
|
63
|
+
v-model="plan.opensAt"
|
|
64
|
+
type="date"
|
|
65
|
+
>
|
|
66
|
+
</label>
|
|
67
|
+
<button
|
|
68
|
+
type="submit"
|
|
69
|
+
data-admin="waitlist-plan-save"
|
|
70
|
+
:aria-disabled="tab.busy('plan')"
|
|
71
|
+
>
|
|
72
|
+
{{ running === 'plan' ? t('waitlist.planning') : t('waitlist.plan') }}
|
|
73
|
+
</button>
|
|
74
|
+
<button
|
|
75
|
+
type="button"
|
|
76
|
+
data-admin="waitlist-plan-clear"
|
|
77
|
+
:aria-disabled="tab.busy('plan')"
|
|
78
|
+
@click="tab.planWave(true)"
|
|
79
|
+
>
|
|
80
|
+
{{ t('waitlist.planClear') }}
|
|
81
|
+
</button>
|
|
82
|
+
<p>{{ t('waitlist.planHint') }}</p>
|
|
83
|
+
</form>
|
|
42
84
|
<div data-admin="waitlist-actions">
|
|
43
85
|
<button
|
|
44
86
|
type="button"
|
|
@@ -116,6 +116,7 @@ const slotFlow: UseLoginFlowReturn = {
|
|
|
116
116
|
recover: byPerson(flow.recover),
|
|
117
117
|
redeemInviteCode: byPerson(flow.redeemInviteCode),
|
|
118
118
|
submitAge: byPerson(flow.submitAge),
|
|
119
|
+
verifyTwoFactor: byPerson(flow.verifyTwoFactor),
|
|
119
120
|
bind: loginBindings({
|
|
120
121
|
...flow,
|
|
121
122
|
signInWithPasskey,
|
|
@@ -208,6 +209,13 @@ provideAuthFormView({
|
|
|
208
209
|
>
|
|
209
210
|
<AuthFormAge :flow="slotFlow" />
|
|
210
211
|
</slot>
|
|
212
|
+
<slot
|
|
213
|
+
v-else-if="flow.step.value === 'two-factor'"
|
|
214
|
+
name="two-factor"
|
|
215
|
+
v-bind="slotFlow"
|
|
216
|
+
>
|
|
217
|
+
<AuthFormTwoFactor :flow="slotFlow" />
|
|
218
|
+
</slot>
|
|
211
219
|
<slot
|
|
212
220
|
v-else-if="flow.step.value === 'undeliverable'"
|
|
213
221
|
name="undeliverable"
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* AuthFormTwoFactor's default styles, on its data-* hooks. Theme through the
|
|
3
|
+
* --bk-* tokens (tokens.css) or the hooks themselves: every rule sits in
|
|
4
|
+
* `@layer nuxt-backend`, so any rule of the app's wins.
|
|
5
|
+
*/
|
|
6
|
+
@layer nuxt-backend {
|
|
7
|
+
[data-auth='two-factor-note'] {
|
|
8
|
+
margin: 0;
|
|
9
|
+
font-size: 0.85rem;
|
|
10
|
+
color: var(--auth-muted);
|
|
11
|
+
line-height: 1.5;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/* Six digits from the app: a short field, the digits in columns. */
|
|
15
|
+
[data-auth='input-two-factor-code'][inputmode='numeric'] {
|
|
16
|
+
max-width: 10rem;
|
|
17
|
+
font-variant-numeric: tabular-nums;
|
|
18
|
+
letter-spacing: 0.15em;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
[data-auth='label-trust-device'] {
|
|
22
|
+
display: flex;
|
|
23
|
+
gap: 0.5rem;
|
|
24
|
+
align-items: center;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* The way to a backup code and back: quieter than the code itself. */
|
|
28
|
+
[data-auth='two-factor-switch'] {
|
|
29
|
+
align-self: center;
|
|
30
|
+
border: 0;
|
|
31
|
+
background: none;
|
|
32
|
+
box-shadow: none;
|
|
33
|
+
translate: none;
|
|
34
|
+
font-weight: 500;
|
|
35
|
+
font-size: 0.85rem;
|
|
36
|
+
color: var(--auth-muted);
|
|
37
|
+
text-decoration: underline;
|
|
38
|
+
text-underline-offset: 0.2em;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { AuthFormTwoFactorProps } from '../../parts'
|
|
3
|
+
import { fieldState, useAuthFormView } from './auth-form'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* `<AuthForm>`'s second step after a sign-in code, for an account with an
|
|
7
|
+
* authenticator app: the app's six-digit code, or one of the backup codes,
|
|
8
|
+
* and whether this device skips the step for thirty days.
|
|
9
|
+
*/
|
|
10
|
+
defineOptions({ name: 'AuthFormTwoFactor' })
|
|
11
|
+
defineProps<AuthFormTwoFactorProps>()
|
|
12
|
+
const view = useAuthFormView('AuthFormTwoFactor')
|
|
13
|
+
const { t } = view.labels
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<form
|
|
18
|
+
data-auth="step-two-factor"
|
|
19
|
+
@submit.prevent="flow.verifyTwoFactor()"
|
|
20
|
+
>
|
|
21
|
+
<p data-auth="two-factor-note">
|
|
22
|
+
{{ flow.withBackupCode.value ? t('twoFactorBackupIntro') : t('twoFactorIntro') }}
|
|
23
|
+
</p>
|
|
24
|
+
<label data-auth="label-two-factor-code">
|
|
25
|
+
{{ flow.withBackupCode.value ? t('twoFactorBackupCode') : t('twoFactorCode') }}
|
|
26
|
+
<input
|
|
27
|
+
v-model="flow.twoFactorCode.value"
|
|
28
|
+
data-auth="input-two-factor-code"
|
|
29
|
+
type="text"
|
|
30
|
+
:inputmode="flow.withBackupCode.value ? 'text' : 'numeric'"
|
|
31
|
+
:autocomplete="flow.withBackupCode.value ? 'off' : 'one-time-code'"
|
|
32
|
+
:pattern="flow.withBackupCode.value ? undefined : '[0-9 ]*'"
|
|
33
|
+
:maxlength="flow.withBackupCode.value ? 32 : 7"
|
|
34
|
+
spellcheck="false"
|
|
35
|
+
required
|
|
36
|
+
v-bind="fieldState(flow, view, 'twoFactorCode')"
|
|
37
|
+
>
|
|
38
|
+
</label>
|
|
39
|
+
<label data-auth="label-trust-device">
|
|
40
|
+
<input
|
|
41
|
+
v-model="flow.trustDevice.value"
|
|
42
|
+
data-auth="input-trust-device"
|
|
43
|
+
type="checkbox"
|
|
44
|
+
>
|
|
45
|
+
{{ t('twoFactorTrustDevice') }}
|
|
46
|
+
</label>
|
|
47
|
+
<!-- The busy button's words, said: a polite status that is empty until the code is being checked. -->
|
|
48
|
+
<p
|
|
49
|
+
data-auth="two-factor-status"
|
|
50
|
+
role="status"
|
|
51
|
+
aria-live="polite"
|
|
52
|
+
>
|
|
53
|
+
{{ flow.isPending.value ? t('twoFactorChecking') : '' }}
|
|
54
|
+
</p>
|
|
55
|
+
<button
|
|
56
|
+
data-auth="submit"
|
|
57
|
+
v-bind="flow.bind.submit"
|
|
58
|
+
>
|
|
59
|
+
{{ flow.isPending.value ? t('twoFactorChecking') : t('twoFactorSubmit') }}
|
|
60
|
+
</button>
|
|
61
|
+
<button
|
|
62
|
+
data-auth="two-factor-switch"
|
|
63
|
+
type="button"
|
|
64
|
+
@click="flow.withBackupCode.value = !flow.withBackupCode.value"
|
|
65
|
+
>
|
|
66
|
+
{{ flow.withBackupCode.value ? t('twoFactorUseApp') : t('twoFactorUseBackup') }}
|
|
67
|
+
</button>
|
|
68
|
+
<button
|
|
69
|
+
data-auth="back"
|
|
70
|
+
v-bind="flow.bind.back"
|
|
71
|
+
>
|
|
72
|
+
{{ t('back') }}
|
|
73
|
+
</button>
|
|
74
|
+
</form>
|
|
75
|
+
</template>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
2
3
|
import { busyAttributes } from '../../a11y'
|
|
3
4
|
import type { AuthFormWaitlistedProps } from '../../parts'
|
|
4
5
|
import { useAuthFormView } from './auth-form'
|
|
@@ -6,13 +7,19 @@ import { useAuthFormView } from './auth-form'
|
|
|
6
7
|
/**
|
|
7
8
|
* `<AuthForm>`'s step for a new address while the app is in early access,
|
|
8
9
|
* with no ticket: the address is on the waitlist. It shows the place the
|
|
9
|
-
* code check answered (`flow.waitlist`)
|
|
10
|
-
* invite code step.
|
|
10
|
+
* code check answered (`flow.waitlist`) where the waitlist shows rank, and
|
|
11
|
+
* offers the invite code step.
|
|
11
12
|
*/
|
|
12
13
|
defineOptions({ name: 'AuthFormWaitlisted' })
|
|
13
|
-
defineProps<AuthFormWaitlistedProps>()
|
|
14
|
+
const props = defineProps<AuthFormWaitlistedProps>()
|
|
14
15
|
const view = useAuthFormView('AuthFormWaitlisted')
|
|
15
16
|
const { t } = view.labels
|
|
17
|
+
|
|
18
|
+
/** The note: the place where the waitlist shows rank, else that the address is on the list. */
|
|
19
|
+
const note = computed(() => {
|
|
20
|
+
const place = props.flow.waitlist.value
|
|
21
|
+
return place?.position ? t('waitlistedPlace', { position: place.position, total: place.total ?? place.position }) : t('waitlisted')
|
|
22
|
+
})
|
|
16
23
|
</script>
|
|
17
24
|
|
|
18
25
|
<template>
|
|
@@ -22,7 +29,7 @@ const { t } = view.labels
|
|
|
22
29
|
role="status"
|
|
23
30
|
aria-live="polite"
|
|
24
31
|
>
|
|
25
|
-
{{
|
|
32
|
+
{{ note }}
|
|
26
33
|
</p>
|
|
27
34
|
<p
|
|
28
35
|
v-if="flow.waitlist.value"
|
|
@@ -24,6 +24,22 @@
|
|
|
24
24
|
font-weight: 600;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
/* The person's own facts, where rank is private: one live region, so a new friend's credit is heard. */
|
|
28
|
+
[data-waitlist='facts'] {
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
gap: 0.75rem;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* Empty, it takes no room in the column: it stays in the tree to be heard. */
|
|
35
|
+
[data-waitlist='facts']:empty {
|
|
36
|
+
position: absolute;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
[data-waitlist='fact'] {
|
|
40
|
+
margin: 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
27
43
|
[data-waitlist='sign-up'] {
|
|
28
44
|
align-self: flex-start;
|
|
29
45
|
padding: 0.5rem 0.9rem;
|
|
@@ -6,8 +6,10 @@ import type { WaitlistPlaceProps } from '../../parts'
|
|
|
6
6
|
import { useWaitlistFormView } from './waitlist-form'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* A person's place on the waitlist: "You're #48 of 1,204", the
|
|
10
|
-
*
|
|
9
|
+
* A person's place on the waitlist: "You're #48 of 1,204", or, where the
|
|
10
|
+
* waitlist keeps rank private, the day they joined, how far their friends
|
|
11
|
+
* moved them and the next wave; the honest words about how people are
|
|
12
|
+
* admitted, what their link does for them
|
|
11
13
|
* (`WaitlistShare`), and Leave. It follows the list live. No names and no
|
|
12
14
|
* leaderboards are ever shown. `<WaitlistForm>`'s last step, and the body of
|
|
13
15
|
* the `/waitlist` page.
|
|
@@ -20,6 +22,37 @@ const { t, errorMessage, locale } = useLabels('waitlist', view.labels)
|
|
|
20
22
|
const loginPath = useBackendPagePath('login')
|
|
21
23
|
const place = computed(() => props.waitlist.place.value)
|
|
22
24
|
const number = (value: number) => value.toLocaleString(locale.value)
|
|
25
|
+
const day = (at: number) => new Date(at).toLocaleDateString(locale.value, { dateStyle: 'long' })
|
|
26
|
+
// A wave opens on the UTC day the administrator picked, wherever the person reads it.
|
|
27
|
+
const utcDay = (at: number) => new Date(at).toLocaleDateString(locale.value, { dateStyle: 'long', timeZone: 'UTC' })
|
|
28
|
+
const MINUTE_MS = 60 * 1000
|
|
29
|
+
const HOUR_MS = 60 * MINUTE_MS
|
|
30
|
+
const DAY_MS = 24 * HOUR_MS
|
|
31
|
+
|
|
32
|
+
/** The credit in the largest unit it fills: days, else hours, else minutes (a rule may give less than a day a friend). */
|
|
33
|
+
function creditLine(credit: number): string | null {
|
|
34
|
+
if (credit >= DAY_MS) return t('credit', { count: Math.floor(credit / DAY_MS) })
|
|
35
|
+
if (credit >= HOUR_MS) return t('creditHours', { count: Math.floor(credit / HOUR_MS) })
|
|
36
|
+
if (credit >= MINUTE_MS) return t('creditMinutes', { count: Math.floor(credit / MINUTE_MS) })
|
|
37
|
+
return null
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Where rank is private, the person's own facts instead of a place: the
|
|
42
|
+
* day they joined, how far friends moved them, and the planned wave.
|
|
43
|
+
*/
|
|
44
|
+
const facts = computed(() => {
|
|
45
|
+
const standing = place.value
|
|
46
|
+
if (standing?.status !== 'waiting' || standing.position || !standing.joinedAt) return []
|
|
47
|
+
const lines = [t('joinedOn', { date: day(standing.joinedAt) })]
|
|
48
|
+
const credit = creditLine(standing.credit ?? 0)
|
|
49
|
+
if (credit) lines.push(credit)
|
|
50
|
+
const wave = standing.wave
|
|
51
|
+
if (wave?.included) lines.push(t('waveIn'))
|
|
52
|
+
else if (wave?.friendsShort) lines.push(t('waveShort', { count: wave.friendsShort }))
|
|
53
|
+
if (wave?.opensAt) lines.push(t('waveOpens', { date: utcDay(wave.opensAt) }))
|
|
54
|
+
return lines
|
|
55
|
+
})
|
|
23
56
|
|
|
24
57
|
/** What the person reads first, by where they stand. */
|
|
25
58
|
const headline = computed(() => {
|
|
@@ -52,6 +85,20 @@ const headline = computed(() => {
|
|
|
52
85
|
>
|
|
53
86
|
{{ t('signUp') }}
|
|
54
87
|
</a>
|
|
88
|
+
<!-- Mounted, empty, before the facts arrive, so the first ones are heard too. -->
|
|
89
|
+
<div
|
|
90
|
+
data-waitlist="facts"
|
|
91
|
+
role="status"
|
|
92
|
+
aria-live="polite"
|
|
93
|
+
>
|
|
94
|
+
<p
|
|
95
|
+
v-for="line in facts"
|
|
96
|
+
:key="line"
|
|
97
|
+
data-waitlist="fact"
|
|
98
|
+
>
|
|
99
|
+
{{ line }}
|
|
100
|
+
</p>
|
|
101
|
+
</div>
|
|
55
102
|
<template v-if="place?.status === 'waiting'">
|
|
56
103
|
<p data-waitlist="disclosure">
|
|
57
104
|
{{ t('disclosure') }}
|
|
@@ -6,7 +6,8 @@ import { useWaitlistFormView } from './waitlist-form'
|
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* A waiting person's share link, inside `WaitlistPlace`: what it does for
|
|
9
|
-
* them (with the cap
|
|
9
|
+
* them (with the cap, or that there is none; nothing at all when sharing is
|
|
10
|
+
* off), the incentive disclosed in the words they share, a
|
|
10
11
|
* read-only field with the link, a button that copies the message and the
|
|
11
12
|
* link, and the friends who joined through it. No names, no leaderboards.
|
|
12
13
|
*/
|
|
@@ -34,14 +35,14 @@ async function copy() {
|
|
|
34
35
|
|
|
35
36
|
<template>
|
|
36
37
|
<section
|
|
37
|
-
v-if="link"
|
|
38
|
+
v-if="link && place?.cap !== 0"
|
|
38
39
|
data-waitlist="share"
|
|
39
40
|
>
|
|
40
41
|
<h3 data-waitlist="share-title">
|
|
41
42
|
{{ t('shareTitle') }}
|
|
42
43
|
</h3>
|
|
43
44
|
<p data-waitlist="share-intro">
|
|
44
|
-
{{ t('shareIntro', { cap: place?.cap ?? 0 }) }} {{ t('shareText') }}
|
|
45
|
+
{{ place?.cap === null ? t('shareIntroOpen') : t('shareIntro', { cap: place?.cap ?? 0 }) }} {{ t('shareText') }}
|
|
45
46
|
</p>
|
|
46
47
|
<label data-waitlist="share-label">
|
|
47
48
|
{{ t('shareLink') }}
|