nuxt-backend 0.2.1 → 0.3.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 +17 -6
- package/dist/capabilities/detect.js +16 -7
- package/dist/capabilities/gateway-route.js +24 -0
- package/dist/capabilities/registry.js +3 -2
- package/dist/capabilities/status.js +3 -1
- package/dist/chunks/catalog.mjs +1 -1
- package/dist/chunks/doctor.mjs +498 -67
- package/dist/chunks/email-previews.mjs +1 -1
- package/dist/chunks/health.mjs +2 -2
- package/dist/chunks/index.mjs +3 -3
- package/dist/chunks/install.mjs +4 -4
- package/dist/chunks/run.mjs +1 -1
- package/dist/chunks/server.mjs +8 -6
- package/dist/cli.mjs +394 -39
- package/dist/convex/access-tickets.d.ts +20 -1
- package/dist/convex/access-tickets.d.ts.map +1 -1
- package/dist/convex/access-tickets.js +28 -0
- package/dist/convex/access-tickets.js.map +1 -1
- package/dist/convex/account-data.d.ts +25 -3
- package/dist/convex/account-data.d.ts.map +1 -1
- package/dist/convex/account-data.js +26 -3
- package/dist/convex/account-data.js.map +1 -1
- package/dist/convex/app.d.ts +15 -2
- package/dist/convex/app.d.ts.map +1 -1
- package/dist/convex/app.js +16 -2
- package/dist/convex/app.js.map +1 -1
- package/dist/convex/billing-launch.d.ts +36 -0
- package/dist/convex/billing-launch.d.ts.map +1 -0
- package/dist/convex/billing-launch.js +18 -0
- package/dist/convex/billing-launch.js.map +1 -0
- package/dist/convex/catalog.d.ts +16 -2
- package/dist/convex/catalog.d.ts.map +1 -1
- package/dist/convex/catalog.js.map +1 -1
- package/dist/convex/client/code-binding.js +1 -1
- package/dist/convex/client/component.d.ts.map +1 -1
- package/dist/convex/client/guards.js +3 -3
- package/dist/convex/client/guards.js.map +1 -1
- package/dist/convex/client/index.d.ts +94 -40
- package/dist/convex/client/index.d.ts.map +1 -1
- package/dist/convex/client/index.js +4 -3
- package/dist/convex/client/index.js.map +1 -1
- package/dist/convex/client/plugins.d.ts +67 -30
- package/dist/convex/client/plugins.d.ts.map +1 -1
- package/dist/convex/client/plugins.js +43 -19
- package/dist/convex/client/plugins.js.map +1 -1
- 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 +454 -4
- package/dist/convex/components/backend/_generated/component.d.ts.map +1 -1
- package/dist/convex/components/backend/access.d.ts +47 -6
- package/dist/convex/components/backend/access.d.ts.map +1 -1
- package/dist/convex/components/backend/access.js +108 -16
- package/dist/convex/components/backend/access.js.map +1 -1
- package/dist/convex/components/backend/account.d.ts +6 -0
- package/dist/convex/components/backend/account.d.ts.map +1 -1
- package/dist/convex/components/backend/account.js +49 -2
- package/dist/convex/components/backend/account.js.map +1 -1
- package/dist/convex/components/backend/adapter.d.ts +1 -1
- package/dist/convex/components/backend/adapter.d.ts.map +1 -1
- package/dist/convex/components/backend/adapter.js +1 -1
- package/dist/convex/components/backend/adapter.js.map +1 -1
- package/dist/convex/components/backend/billing.d.ts +22 -1
- package/dist/convex/components/backend/billing.d.ts.map +1 -1
- package/dist/convex/components/backend/billing.js +77 -12
- package/dist/convex/components/backend/billing.js.map +1 -1
- package/dist/convex/components/backend/costs.d.ts +1 -1
- package/dist/convex/components/backend/crons.d.ts.map +1 -1
- package/dist/convex/components/backend/crons.js +3 -0
- package/dist/convex/components/backend/crons.js.map +1 -1
- package/dist/convex/components/backend/funnel.d.ts +2 -2
- package/dist/convex/components/backend/gifts.d.ts +2 -2
- package/dist/convex/components/backend/gifts.js +2 -2
- package/dist/convex/components/backend/jobs.d.ts +53 -10
- package/dist/convex/components/backend/jobs.d.ts.map +1 -1
- package/dist/convex/components/backend/jobs.js +58 -13
- package/dist/convex/components/backend/jobs.js.map +1 -1
- package/dist/convex/components/backend/maintenance.d.ts +2 -2
- package/dist/convex/components/backend/maintenance.d.ts.map +1 -1
- package/dist/convex/components/backend/maintenance.js +11 -1
- package/dist/convex/components/backend/maintenance.js.map +1 -1
- package/dist/convex/components/backend/moderation.d.ts +94 -0
- package/dist/convex/components/backend/moderation.d.ts.map +1 -0
- package/dist/convex/components/backend/moderation.js +53 -0
- package/dist/convex/components/backend/moderation.js.map +1 -0
- package/dist/convex/components/backend/schema.d.ts +397 -24
- package/dist/convex/components/backend/schema.d.ts.map +1 -1
- package/dist/convex/components/backend/schema.js +108 -4
- package/dist/convex/components/backend/schema.js.map +1 -1
- package/dist/convex/components/backend/storage.d.ts +19 -0
- package/dist/convex/components/backend/storage.d.ts.map +1 -1
- package/dist/convex/components/backend/storage.js +57 -0
- package/dist/convex/components/backend/storage.js.map +1 -1
- package/dist/convex/components/backend/subscriptions.d.ts +1 -1
- package/dist/convex/components/backend/subscriptions.js +1 -1
- package/dist/convex/components/backend/subscriptions.js.map +1 -1
- package/dist/convex/constants.d.ts +19 -4
- package/dist/convex/constants.d.ts.map +1 -1
- package/dist/convex/constants.js +19 -4
- package/dist/convex/constants.js.map +1 -1
- package/dist/convex/email-templates.d.ts +56 -6
- package/dist/convex/email-templates.d.ts.map +1 -1
- package/dist/convex/email-templates.js +69 -14
- package/dist/convex/email-templates.js.map +1 -1
- package/dist/convex/emails/notification.d.ts +9 -0
- package/dist/convex/emails/notification.d.ts.map +1 -0
- package/dist/convex/emails/notification.js +21 -0
- package/dist/convex/emails/notification.js.map +1 -0
- package/dist/convex/errors.d.ts +8 -3
- package/dist/convex/errors.d.ts.map +1 -1
- package/dist/convex/errors.js +55 -7
- package/dist/convex/errors.js.map +1 -1
- package/dist/convex/events.d.ts +4 -4
- package/dist/convex/events.js +4 -4
- package/dist/convex/events.js.map +1 -1
- package/dist/convex/files.d.ts +30 -4
- package/dist/convex/files.d.ts.map +1 -1
- package/dist/convex/files.js +44 -6
- package/dist/convex/files.js.map +1 -1
- package/dist/convex/integrations/account.d.ts +7 -0
- package/dist/convex/integrations/account.d.ts.map +1 -1
- package/dist/convex/integrations/account.js +2 -0
- package/dist/convex/integrations/account.js.map +1 -1
- package/dist/convex/integrations/ai/chat.js +9 -9
- package/dist/convex/integrations/ai/chat.js.map +1 -1
- package/dist/convex/integrations/ai/config.d.ts +157 -37
- package/dist/convex/integrations/ai/config.d.ts.map +1 -1
- package/dist/convex/integrations/ai/context.d.ts +3 -0
- package/dist/convex/integrations/ai/context.d.ts.map +1 -1
- package/dist/convex/integrations/ai/context.js +4 -3
- package/dist/convex/integrations/ai/context.js.map +1 -1
- package/dist/convex/integrations/ai/costs.d.ts.map +1 -1
- package/dist/convex/integrations/ai/costs.js +49 -2
- package/dist/convex/integrations/ai/costs.js.map +1 -1
- package/dist/convex/integrations/ai/embeddings.d.ts +6 -6
- package/dist/convex/integrations/ai/embeddings.d.ts.map +1 -1
- package/dist/convex/integrations/ai/embeddings.js +17 -30
- package/dist/convex/integrations/ai/embeddings.js.map +1 -1
- package/dist/convex/integrations/ai/images.d.ts +25 -0
- package/dist/convex/integrations/ai/images.d.ts.map +1 -0
- package/dist/convex/integrations/ai/images.js +104 -0
- package/dist/convex/integrations/ai/images.js.map +1 -0
- package/dist/convex/integrations/ai/job-errors.d.ts +12 -0
- package/dist/convex/integrations/ai/job-errors.d.ts.map +1 -1
- package/dist/convex/integrations/ai/job-errors.js +18 -2
- package/dist/convex/integrations/ai/job-errors.js.map +1 -1
- package/dist/convex/integrations/ai/jobs.d.ts +176 -10
- package/dist/convex/integrations/ai/jobs.d.ts.map +1 -1
- package/dist/convex/integrations/ai/jobs.js +336 -70
- package/dist/convex/integrations/ai/jobs.js.map +1 -1
- package/dist/convex/integrations/ai/knowledge.d.ts.map +1 -1
- package/dist/convex/integrations/ai/knowledge.js +10 -11
- package/dist/convex/integrations/ai/knowledge.js.map +1 -1
- package/dist/convex/integrations/ai/metering.d.ts +15 -5
- package/dist/convex/integrations/ai/metering.d.ts.map +1 -1
- package/dist/convex/integrations/ai/metering.js +73 -26
- package/dist/convex/integrations/ai/metering.js.map +1 -1
- package/dist/convex/integrations/ai/model-id.d.ts +14 -1
- package/dist/convex/integrations/ai/model-id.d.ts.map +1 -1
- package/dist/convex/integrations/ai/model-id.js +24 -2
- package/dist/convex/integrations/ai/model-id.js.map +1 -1
- package/dist/convex/integrations/ai/models.d.ts +103 -20
- package/dist/convex/integrations/ai/models.d.ts.map +1 -1
- package/dist/convex/integrations/ai/models.js +220 -45
- package/dist/convex/integrations/ai/models.js.map +1 -1
- package/dist/convex/integrations/ai/moderation-providers.d.ts +136 -0
- package/dist/convex/integrations/ai/moderation-providers.d.ts.map +1 -0
- package/dist/convex/integrations/ai/moderation-providers.js +277 -0
- package/dist/convex/integrations/ai/moderation-providers.js.map +1 -0
- package/dist/convex/integrations/ai/moderation-taxonomy.d.ts +54 -0
- package/dist/convex/integrations/ai/moderation-taxonomy.d.ts.map +1 -0
- package/dist/convex/integrations/ai/moderation-taxonomy.js +141 -0
- package/dist/convex/integrations/ai/moderation-taxonomy.js.map +1 -0
- package/dist/convex/integrations/ai/moderation.d.ts +218 -19
- package/dist/convex/integrations/ai/moderation.d.ts.map +1 -1
- package/dist/convex/integrations/ai/moderation.js +359 -37
- package/dist/convex/integrations/ai/moderation.js.map +1 -1
- package/dist/convex/integrations/ai/provenance.d.ts +6 -0
- package/dist/convex/integrations/ai/provenance.d.ts.map +1 -1
- package/dist/convex/integrations/ai/provenance.js +4 -1
- package/dist/convex/integrations/ai/provenance.js.map +1 -1
- package/dist/convex/integrations/ai/setup.js +5 -5
- package/dist/convex/integrations/ai/setup.js.map +1 -1
- package/dist/convex/integrations/ai/stream.d.ts +1 -1
- package/dist/convex/integrations/ai/stream.d.ts.map +1 -1
- package/dist/convex/integrations/ai/stream.js +4 -2
- package/dist/convex/integrations/ai/stream.js.map +1 -1
- package/dist/convex/integrations/ai.d.ts +15 -8
- package/dist/convex/integrations/ai.d.ts.map +1 -1
- package/dist/convex/integrations/ai.js +4 -1
- package/dist/convex/integrations/ai.js.map +1 -1
- package/dist/convex/integrations/billing/checkout.d.ts +1 -1
- package/dist/convex/integrations/billing/checkout.d.ts.map +1 -1
- package/dist/convex/integrations/billing/checkout.js +4 -4
- package/dist/convex/integrations/billing/checkout.js.map +1 -1
- 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 +20 -1
- package/dist/convex/integrations/billing/context.js.map +1 -1
- package/dist/convex/integrations/billing/credits.d.ts +6 -0
- package/dist/convex/integrations/billing/credits.d.ts.map +1 -1
- package/dist/convex/integrations/billing/credits.js +21 -6
- package/dist/convex/integrations/billing/credits.js.map +1 -1
- package/dist/convex/integrations/billing/features.d.ts.map +1 -1
- package/dist/convex/integrations/billing/free-plan.d.ts +41 -1
- package/dist/convex/integrations/billing/free-plan.d.ts.map +1 -1
- package/dist/convex/integrations/billing/free-plan.js +92 -29
- package/dist/convex/integrations/billing/free-plan.js.map +1 -1
- package/dist/convex/integrations/billing/functions.d.ts +7 -3
- package/dist/convex/integrations/billing/functions.d.ts.map +1 -1
- package/dist/convex/integrations/billing/functions.js +18 -8
- package/dist/convex/integrations/billing/functions.js.map +1 -1
- package/dist/convex/integrations/billing/gifts.d.ts +4 -0
- package/dist/convex/integrations/billing/gifts.d.ts.map +1 -1
- package/dist/convex/integrations/billing/gifts.js +37 -6
- package/dist/convex/integrations/billing/gifts.js.map +1 -1
- package/dist/convex/integrations/billing/history.d.ts.map +1 -1
- package/dist/convex/integrations/billing/lifecycle.d.ts +9 -3
- package/dist/convex/integrations/billing/lifecycle.d.ts.map +1 -1
- package/dist/convex/integrations/billing/lifecycle.js +15 -6
- package/dist/convex/integrations/billing/lifecycle.js.map +1 -1
- package/dist/convex/integrations/billing/passes.js +2 -2
- package/dist/convex/integrations/billing/pricing.d.ts +9 -2
- package/dist/convex/integrations/billing/pricing.d.ts.map +1 -1
- package/dist/convex/integrations/billing/pricing.js +38 -4
- package/dist/convex/integrations/billing/pricing.js.map +1 -1
- package/dist/convex/integrations/billing/quotas.d.ts.map +1 -1
- package/dist/convex/integrations/billing/rate-limit.d.ts +16 -0
- package/dist/convex/integrations/billing/rate-limit.d.ts.map +1 -0
- package/dist/convex/integrations/billing/rate-limit.js +45 -0
- package/dist/convex/integrations/billing/rate-limit.js.map +1 -0
- package/dist/convex/integrations/billing/referral-orders.d.ts +1 -1
- package/dist/convex/integrations/billing/referral-orders.js +1 -1
- package/dist/convex/integrations/billing/resync.d.ts +28 -0
- package/dist/convex/integrations/billing/resync.d.ts.map +1 -0
- package/dist/convex/integrations/billing/resync.js +139 -0
- package/dist/convex/integrations/billing/resync.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 +6 -2
- package/dist/convex/integrations/billing/subscriptions.js.map +1 -1
- package/dist/convex/integrations/billing/types/lifecycle.d.ts +1 -1
- package/dist/convex/integrations/billing/types/records.d.ts +68 -3
- package/dist/convex/integrations/billing/types/records.d.ts.map +1 -1
- package/dist/convex/integrations/billing/types/setup.d.ts +9 -4
- package/dist/convex/integrations/billing/types/setup.d.ts.map +1 -1
- package/dist/convex/integrations/billing/types/surface.d.ts +38 -5
- package/dist/convex/integrations/billing/types/surface.d.ts.map +1 -1
- package/dist/convex/integrations/billing/webhooks.js +2 -2
- package/dist/convex/integrations/billing/welcome.d.ts +16 -0
- package/dist/convex/integrations/billing/welcome.d.ts.map +1 -0
- package/dist/convex/integrations/billing/welcome.js +93 -0
- package/dist/convex/integrations/billing/welcome.js.map +1 -0
- package/dist/convex/integrations/billing.d.ts +3 -2
- package/dist/convex/integrations/billing.d.ts.map +1 -1
- package/dist/convex/integrations/billing.js +17 -5
- package/dist/convex/integrations/billing.js.map +1 -1
- package/dist/convex/integrations/email.d.ts +17 -3
- package/dist/convex/integrations/email.d.ts.map +1 -1
- package/dist/convex/integrations/email.js.map +1 -1
- package/dist/convex/integrations/functions.d.ts +2 -2
- package/dist/convex/integrations/functions.d.ts.map +1 -1
- package/dist/convex/integrations/functions.js +1 -1
- package/dist/convex/integrations/functions.js.map +1 -1
- package/dist/convex/integrations/launch.d.ts +108 -3
- package/dist/convex/integrations/launch.d.ts.map +1 -1
- package/dist/convex/integrations/launch.js +143 -22
- package/dist/convex/integrations/launch.js.map +1 -1
- package/dist/convex/integrations/notifications.d.ts +6 -2
- package/dist/convex/integrations/notifications.d.ts.map +1 -1
- package/dist/convex/integrations/notifications.js +13 -15
- package/dist/convex/integrations/notifications.js.map +1 -1
- package/dist/convex/integrations/rate-limit.d.ts +18 -0
- package/dist/convex/integrations/rate-limit.d.ts.map +1 -1
- package/dist/convex/integrations/rate-limit.js +18 -3
- package/dist/convex/integrations/rate-limit.js.map +1 -1
- package/dist/convex/integrations/reports.d.ts +4 -1
- package/dist/convex/integrations/reports.d.ts.map +1 -1
- package/dist/convex/integrations/reports.js +14 -3
- package/dist/convex/integrations/reports.js.map +1 -1
- package/dist/convex/integrations/retention.d.ts +42 -4
- package/dist/convex/integrations/retention.d.ts.map +1 -1
- package/dist/convex/integrations/retention.js +62 -4
- package/dist/convex/integrations/retention.js.map +1 -1
- package/dist/convex/integrations/storage.d.ts +71 -3
- package/dist/convex/integrations/storage.d.ts.map +1 -1
- package/dist/convex/integrations/storage.js +22 -4
- package/dist/convex/integrations/storage.js.map +1 -1
- package/dist/convex/label-format.d.ts +2 -2
- package/dist/convex/label-format.d.ts.map +1 -1
- package/dist/convex/label-format.js +2 -2
- package/dist/convex/label-format.js.map +1 -1
- package/dist/convex/label-groups/admin.d.ts +27 -0
- package/dist/convex/label-groups/admin.d.ts.map +1 -1
- package/dist/convex/label-groups/admin.js +28 -0
- package/dist/convex/label-groups/admin.js.map +1 -1
- package/dist/convex/label-groups/cancelFlow.d.ts +1 -1
- package/dist/convex/label-groups/cancelFlow.js +2 -2
- package/dist/convex/label-groups/cancelFlow.js.map +1 -1
- package/dist/convex/label-groups/email.d.ts.map +1 -1
- package/dist/convex/label-groups/email.js +2 -1
- 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 +6 -1
- package/dist/convex/label-groups/errors.js.map +1 -1
- package/dist/convex/label-groups/gift.d.ts +2 -0
- package/dist/convex/label-groups/gift.d.ts.map +1 -1
- package/dist/convex/label-groups/gift.js +5 -2
- package/dist/convex/label-groups/gift.js.map +1 -1
- package/dist/convex/label-groups/legal.d.ts +27 -1
- package/dist/convex/label-groups/legal.d.ts.map +1 -1
- package/dist/convex/label-groups/legal.js +31 -0
- package/dist/convex/label-groups/legal.js.map +1 -1
- package/dist/convex/label-groups/notifications.d.ts +3 -1
- package/dist/convex/label-groups/notifications.d.ts.map +1 -1
- package/dist/convex/label-groups/notifications.js +5 -3
- package/dist/convex/label-groups/notifications.js.map +1 -1
- package/dist/convex/label-groups/pastDue.d.ts +1 -1
- package/dist/convex/label-groups/pastDue.d.ts.map +1 -1
- package/dist/convex/label-groups/pastDue.js +1 -1
- package/dist/convex/label-groups/pastDue.js.map +1 -1
- package/dist/convex/label-groups/pricing.d.ts +2 -0
- package/dist/convex/label-groups/pricing.d.ts.map +1 -1
- package/dist/convex/label-groups/pricing.js +4 -0
- package/dist/convex/label-groups/pricing.js.map +1 -1
- package/dist/convex/label-groups/referral.d.ts +2 -2
- package/dist/convex/label-groups/referral.js +2 -2
- package/dist/convex/label-groups/report.d.ts +8 -1
- package/dist/convex/label-groups/report.d.ts.map +1 -1
- package/dist/convex/label-groups/report.js +10 -1
- package/dist/convex/label-groups/report.js.map +1 -1
- package/dist/convex/label-groups/upload.d.ts +1 -0
- package/dist/convex/label-groups/upload.d.ts.map +1 -1
- package/dist/convex/label-groups/upload.js +2 -0
- package/dist/convex/label-groups/upload.js.map +1 -1
- package/dist/convex/label-groups/withdrawal.d.ts +1 -1
- package/dist/convex/label-groups/withdrawal.js +1 -1
- package/dist/convex/label-translations.d.ts.map +1 -1
- package/dist/convex/label-translations.js +94 -34
- package/dist/convex/label-translations.js.map +1 -1
- package/dist/convex/labels.d.ts +100 -1
- package/dist/convex/labels.d.ts.map +1 -1
- package/dist/convex/legal.d.ts +12 -2
- package/dist/convex/legal.d.ts.map +1 -1
- package/dist/convex/legal.js +2 -2
- package/dist/convex/legal.js.map +1 -1
- package/dist/convex/log.js +12 -1
- package/dist/convex/log.js.map +1 -1
- package/dist/convex/monitoring.d.ts +6 -4
- package/dist/convex/monitoring.d.ts.map +1 -1
- package/dist/convex/monitoring.js +6 -4
- package/dist/convex/monitoring.js.map +1 -1
- package/dist/convex/report-rules.d.ts +2 -0
- package/dist/convex/report-rules.d.ts.map +1 -1
- package/dist/convex/report-rules.js +2 -0
- package/dist/convex/report-rules.js.map +1 -1
- package/dist/convex/sensitive-actions.d.ts.map +1 -1
- package/dist/convex/sensitive-actions.js +1 -0
- package/dist/convex/sensitive-actions.js.map +1 -1
- package/dist/convex/test-models.d.ts +7 -0
- package/dist/convex/test-models.d.ts.map +1 -1
- package/dist/convex/test-models.js +25 -2
- package/dist/convex/test-models.js.map +1 -1
- package/dist/convex/test-moderation.d.ts +24 -0
- package/dist/convex/test-moderation.d.ts.map +1 -0
- package/dist/convex/test-moderation.js +114 -0
- package/dist/convex/test-moderation.js.map +1 -0
- package/dist/devtools-client/_nuxt/CiCAOwUc.js +5 -0
- package/dist/devtools-client/index.html +1 -1
- package/dist/env-registry.js +37 -5
- package/dist/module.d.ts +51 -1
- package/dist/module.js +2 -2
- package/dist/module.json +1 -1
- package/dist/runtime/config.d.ts +95 -14
- package/dist/runtime/config.js +13 -1
- package/dist/runtime/locales/de.json +95 -19
- package/dist/runtime/locales/en.json +93 -17
- package/dist/runtime/locales/es.json +93 -17
- package/dist/runtime/locales/fr.json +93 -17
- package/dist/runtime/locales/ru.json +93 -17
- package/dist/runtime/monitoring/sdk/sentry.client.config.js +2 -1
- package/dist/runtime/monitoring/sdk/sentry.server.config.js +6 -1
- package/dist/runtime/server/content-wasm.d.ts +13 -0
- package/dist/runtime/server/content-wasm.js +9 -0
- package/dist/runtime/server/csp.d.ts +17 -0
- package/dist/runtime/server/csp.js +18 -0
- package/dist/runtime/server/monitoring/csp.d.ts +12 -0
- package/dist/runtime/server/monitoring/csp.js +19 -0
- package/dist/runtime/server/protection/csp.d.ts +1 -7
- package/dist/runtime/server/protection/csp.js +4 -17
- package/dist/runtime/test-utils/aliases.d.ts +6 -4
- package/dist/runtime/test-utils/aliases.js +3 -9
- package/dist/runtime/test-utils/base-modules.d.ts +9 -13
- package/dist/runtime/test-utils/install.js +4 -2
- package/dist/runtime/vue/a11y.js +1 -1
- package/dist/runtime/vue/auth-client.d.ts +8 -5
- package/dist/runtime/vue/components/account/AccountData.vue +2 -0
- package/dist/runtime/vue/components/account/AccountDeletion.css +1 -1
- package/dist/runtime/vue/components/account/ActivationChecklist.css +1 -1
- package/dist/runtime/vue/components/account/ActivationChecklist.vue +1 -0
- package/dist/runtime/vue/components/account/ConsentPrompt.css +1 -1
- package/dist/runtime/vue/components/account/ConsentPromptDialog.vue +1 -0
- package/dist/runtime/vue/components/account/ConsentPromptStorage.vue +1 -0
- package/dist/runtime/vue/components/account/EmailUnsubscribe.css +1 -1
- package/dist/runtime/vue/components/account/EmailUnsubscribe.vue +2 -2
- package/dist/runtime/vue/components/account/HowDidYouHear.css +1 -1
- package/dist/runtime/vue/components/account/HowDidYouHear.vue +1 -0
- package/dist/runtime/vue/components/account/KeepAccount.css +1 -1
- package/dist/runtime/vue/components/account/OnboardingFlow.css +1 -1
- package/dist/runtime/vue/components/account/OnboardingFlow.vue +1 -0
- package/dist/runtime/vue/components/account/ProfileIdentity.css +1 -1
- package/dist/runtime/vue/components/account/ProfilePreferencesSection.css +1 -1
- package/dist/runtime/vue/components/account/ProfilePreferencesSection.vue +3 -1
- package/dist/runtime/vue/components/account/ProfileSettings.css +1 -1
- package/dist/runtime/vue/components/account/ProfileSettings.vue +1 -0
- package/dist/runtime/vue/components/account/SecurityAlerts.css +1 -1
- package/dist/runtime/vue/components/account/SecurityAlerts.vue +2 -1
- package/dist/runtime/vue/components/account/SecurityPasskeys.css +1 -1
- package/dist/runtime/vue/components/account/SecuritySettings.css +1 -1
- package/dist/runtime/vue/components/account/SecuritySettings.vue +1 -0
- package/dist/runtime/vue/components/account/security-alerts.d.ts +7 -0
- package/dist/runtime/vue/components/account/security-alerts.js +6 -2
- package/dist/runtime/vue/components/admin/AdminAccess.css +1 -1
- package/dist/runtime/vue/components/admin/AdminAccess.vue +2 -0
- package/dist/runtime/vue/components/admin/AdminAccessMemberTickets.d.vue.ts +7 -0
- package/dist/runtime/vue/components/admin/AdminAccessMemberTickets.vue +42 -0
- package/dist/runtime/vue/components/admin/AdminAccessMemberTickets.vue.d.ts +7 -0
- package/dist/runtime/vue/components/admin/AdminAnnouncements.css +1 -1
- package/dist/runtime/vue/components/admin/AdminBilling.css +1 -1
- package/dist/runtime/vue/components/admin/AdminChart.css +1 -1
- package/dist/runtime/vue/components/admin/AdminConsole.css +1 -1
- package/dist/runtime/vue/components/admin/AdminExperiments.css +1 -1
- package/dist/runtime/vue/components/admin/AdminFlags.css +1 -1
- package/dist/runtime/vue/components/admin/AdminModeration.d.vue.ts +3 -0
- package/dist/runtime/vue/components/admin/AdminModeration.vue +135 -0
- package/dist/runtime/vue/components/admin/AdminModeration.vue.d.ts +3 -0
- package/dist/runtime/vue/components/admin/AdminQueue.css +1 -1
- package/dist/runtime/vue/components/admin/AdminReferrals.css +1 -1
- package/dist/runtime/vue/components/admin/AdminReports.css +1 -1
- package/dist/runtime/vue/components/admin/AdminRevenue.css +1 -1
- package/dist/runtime/vue/components/admin/AdminUsers.d.vue.ts +27 -0
- package/dist/runtime/vue/components/admin/AdminUsers.vue +1 -0
- package/dist/runtime/vue/components/admin/AdminUsers.vue.d.ts +27 -0
- package/dist/runtime/vue/components/admin/AdminWorkspaces.d.vue.ts +27 -0
- package/dist/runtime/vue/components/admin/AdminWorkspaces.vue +1 -0
- package/dist/runtime/vue/components/admin/AdminWorkspaces.vue.d.ts +27 -0
- package/dist/runtime/vue/components/admin/admin-moderation-tab.d.ts +1 -0
- package/dist/runtime/vue/components/admin/admin-moderation-tab.js +34 -0
- package/dist/runtime/vue/components/admin/admin-tabs.js +2 -0
- package/dist/runtime/vue/components/admin/admin.css +1 -1
- package/dist/runtime/vue/components/auth/AuthForm.css +1 -1
- package/dist/runtime/vue/components/auth/AuthForm.vue +3 -2
- package/dist/runtime/vue/components/auth/AuthFormChoose.css +1 -1
- package/dist/runtime/vue/components/auth/AuthFormPasskeyOffer.css +1 -1
- package/dist/runtime/vue/components/auth/InviteRedeem.css +1 -1
- package/dist/runtime/vue/components/auth/ReauthenticateCode.css +1 -1
- package/dist/runtime/vue/components/auth/ReauthenticateDialog.css +1 -1
- package/dist/runtime/vue/components/auth/ReauthenticateDialog.vue +3 -2
- package/dist/runtime/vue/components/auth/WaitlistForm.css +1 -1
- package/dist/runtime/vue/components/auth/WaitlistForm.vue +1 -0
- package/dist/runtime/vue/components/auth/WaitlistPlace.css +1 -1
- package/dist/runtime/vue/components/auth/WaitlistShare.css +1 -1
- package/dist/runtime/vue/components/billing/BillingCheckoutLink.vue +2 -0
- package/dist/runtime/vue/components/billing/BillingHistory.css +1 -1
- package/dist/runtime/vue/components/billing/BillingHistory.vue +1 -0
- package/dist/runtime/vue/components/billing/BillingPortalLink.vue +1 -0
- package/dist/runtime/vue/components/billing/CancelFlow.css +1 -1
- package/dist/runtime/vue/components/billing/CancelFlow.vue +1 -0
- package/dist/runtime/vue/components/billing/CancelFlowEnd.vue +3 -1
- package/dist/runtime/vue/components/billing/GiftList.css +1 -1
- package/dist/runtime/vue/components/billing/PricingPackCard.css +1 -1
- package/dist/runtime/vue/components/billing/PricingPlanCard.css +1 -1
- package/dist/runtime/vue/components/billing/PricingPlanCard.vue +8 -1
- package/dist/runtime/vue/components/billing/PricingTable.css +1 -1
- package/dist/runtime/vue/components/billing/PricingTable.d.vue.ts +2 -0
- package/dist/runtime/vue/components/billing/PricingTable.vue +22 -3
- package/dist/runtime/vue/components/billing/PricingTable.vue.d.ts +2 -0
- package/dist/runtime/vue/components/billing/ReferralCard.css +1 -1
- package/dist/runtime/vue/components/billing/ReferralCard.vue +1 -0
- package/dist/runtime/vue/components/billing/ReferralLanding.css +1 -1
- package/dist/runtime/vue/components/billing/UpgradePrompt.css +1 -1
- package/dist/runtime/vue/components/billing/UpgradePrompt.vue +1 -0
- package/dist/runtime/vue/components/billing/UsageHistory.css +1 -1
- package/dist/runtime/vue/components/billing/UsageHistory.vue +1 -0
- package/dist/runtime/vue/components/billing/WithdrawalButton.css +1 -1
- package/dist/runtime/vue/components/billing/WithdrawalButton.vue +1 -0
- package/dist/runtime/vue/components/billing/pricing-table.d.ts +6 -0
- package/dist/runtime/vue/components/billing/withdrawal-button.d.ts +1 -1
- package/dist/runtime/vue/components/shared.css +1 -1
- package/dist/runtime/vue/components/shell/AccessDenied.css +1 -1
- package/dist/runtime/vue/components/shell/AccessDenied.vue +1 -0
- package/dist/runtime/vue/components/shell/AccountMenu.vue +1 -0
- package/dist/runtime/vue/components/shell/AiLabel.css +1 -1
- package/dist/runtime/vue/components/shell/AiLabel.vue +4 -1
- package/dist/runtime/vue/components/shell/AppShell.css +1 -1
- package/dist/runtime/vue/components/shell/AppShell.vue +3 -0
- package/dist/runtime/vue/components/shell/BackendNotices.vue +1 -0
- package/dist/runtime/vue/components/shell/ConfirmDialog.css +1 -1
- package/dist/runtime/vue/components/shell/ConnectionStatus.css +1 -1
- package/dist/runtime/vue/components/shell/ConnectionStatus.vue +1 -0
- package/dist/runtime/vue/components/shell/ContactForm.css +1 -1
- package/dist/runtime/vue/components/shell/ContactForm.vue +1 -0
- package/dist/runtime/vue/components/shell/FrameMain.vue +2 -0
- package/dist/runtime/vue/components/shell/Gate.css +1 -1
- package/dist/runtime/vue/components/shell/Gate.vue +2 -0
- package/dist/runtime/vue/components/shell/GateQuota.vue +1 -0
- package/dist/runtime/vue/components/shell/LegalCompany.d.vue.ts +3 -0
- package/dist/runtime/vue/components/shell/LegalCompany.vue +23 -0
- package/dist/runtime/vue/components/shell/LegalCompany.vue.d.ts +3 -0
- package/dist/runtime/vue/components/shell/LegalContactPoints.d.vue.ts +10 -0
- package/dist/runtime/vue/components/shell/LegalContactPoints.vue +51 -0
- package/dist/runtime/vue/components/shell/LegalContactPoints.vue.d.ts +10 -0
- package/dist/runtime/vue/components/shell/LegalDetail.d.vue.ts +11 -0
- package/dist/runtime/vue/components/shell/LegalDetail.vue +30 -0
- package/dist/runtime/vue/components/shell/LegalDetail.vue.d.ts +11 -0
- package/dist/runtime/vue/components/shell/LegalDocument.css +1 -1
- package/dist/runtime/vue/components/shell/LegalDocument.vue +49 -13
- package/dist/runtime/vue/components/shell/LegalModeration.d.vue.ts +8 -0
- package/dist/runtime/vue/components/shell/LegalModeration.vue +72 -0
- package/dist/runtime/vue/components/shell/LegalModeration.vue.d.ts +8 -0
- package/dist/runtime/vue/components/shell/LegalProcessors.d.vue.ts +3 -2
- package/dist/runtime/vue/components/shell/LegalProcessors.vue +46 -15
- package/dist/runtime/vue/components/shell/LegalProcessors.vue.d.ts +3 -2
- package/dist/runtime/vue/components/shell/LegalStorage.d.vue.ts +3 -2
- package/dist/runtime/vue/components/shell/LegalStorage.vue +49 -16
- package/dist/runtime/vue/components/shell/LegalStorage.vue.d.ts +3 -2
- package/dist/runtime/vue/components/shell/LegalVersion.d.vue.ts +10 -0
- package/dist/runtime/vue/components/shell/LegalVersion.vue +24 -0
- package/dist/runtime/vue/components/shell/LegalVersion.vue.d.ts +10 -0
- package/dist/runtime/vue/components/shell/NoticeAnnouncement.css +1 -1
- package/dist/runtime/vue/components/shell/NoticeDeletion.css +1 -1
- package/dist/runtime/vue/components/shell/NoticeGift.css +1 -1
- package/dist/runtime/vue/components/shell/NoticeGift.vue +7 -4
- package/dist/runtime/vue/components/shell/NoticeImpersonation.css +1 -1
- package/dist/runtime/vue/components/shell/NoticeLowCredits.css +1 -1
- package/dist/runtime/vue/components/shell/NoticeMaintenance.css +1 -1
- package/dist/runtime/vue/components/shell/NoticePastDue.css +1 -1
- package/dist/runtime/vue/components/shell/NotificationInbox.css +1 -1
- package/dist/runtime/vue/components/shell/NotificationInbox.vue +1 -0
- package/dist/runtime/vue/components/shell/ReportNotice.css +1 -1
- package/dist/runtime/vue/components/shell/UploadField.css +1 -1
- package/dist/runtime/vue/components/shell/UploadField.d.vue.ts +2 -0
- package/dist/runtime/vue/components/shell/UploadField.vue +16 -3
- package/dist/runtime/vue/components/shell/UploadField.vue.d.ts +2 -0
- package/dist/runtime/vue/components/shell/WorkspaceSwitcher.css +1 -1
- package/dist/runtime/vue/components/shell/WorkspaceSwitcher.vue +1 -0
- package/dist/runtime/vue/components/shell/legal.d.ts +35 -4
- package/dist/runtime/vue/components/shell/legal.js +126 -13
- package/dist/runtime/vue/components/shell/upload-field.d.ts +3 -1
- package/dist/runtime/vue/components/tokens.css +1 -1
- package/dist/runtime/vue/components/workspaces/AcceptInvitation.vue +1 -0
- package/dist/runtime/vue/components/workspaces/AuditLog.css +1 -1
- package/dist/runtime/vue/components/workspaces/AuditLog.vue +1 -0
- package/dist/runtime/vue/components/workspaces/WorkspaceBilling.css +1 -1
- package/dist/runtime/vue/components/workspaces/WorkspaceCredits.css +1 -1
- package/dist/runtime/vue/components/workspaces/WorkspaceList.css +1 -1
- package/dist/runtime/vue/components/workspaces/WorkspaceSettings.d.vue.ts +2 -2
- package/dist/runtime/vue/components/workspaces/WorkspaceSettings.vue +1 -0
- package/dist/runtime/vue/components/workspaces/WorkspaceSettings.vue.d.ts +2 -2
- package/dist/runtime/vue/composables/use-access.d.ts +51 -6
- package/dist/runtime/vue/composables/use-access.js +36 -0
- package/dist/runtime/vue/composables/use-billing.d.ts +6 -5
- package/dist/runtime/vue/composables/use-email-link.d.ts +55 -4
- package/dist/runtime/vue/composables/use-email-link.js +9 -9
- package/dist/runtime/vue/composables/use-gift-list.js +3 -1
- package/dist/runtime/vue/composables/use-labels.js +13 -8
- package/dist/runtime/vue/composables/use-login-flow.js +1 -1
- package/dist/runtime/vue/composables/use-notifications.js +3 -0
- package/dist/runtime/vue/composables/use-passkeys.js +2 -2
- package/dist/runtime/vue/composables/use-pricing.d.ts +15 -0
- package/dist/runtime/vue/composables/use-pricing.js +4 -0
- package/dist/runtime/vue/composables/use-referral-invite.d.ts +33 -4
- package/dist/runtime/vue/composables/use-referral-invite.js +20 -9
- package/dist/runtime/vue/composables/use-report-form.d.ts +178 -0
- package/dist/runtime/vue/composables/use-report-form.js +278 -0
- package/dist/runtime/vue/composables/use-sign-in-alerts.d.ts +85 -0
- package/dist/runtime/vue/composables/use-sign-in-alerts.js +70 -0
- package/dist/runtime/vue/composables/use-upload-field.d.ts +32 -6
- package/dist/runtime/vue/composables/use-upload-field.js +75 -36
- package/dist/runtime/vue/composables/use-waitlist.d.ts +8 -1
- package/dist/runtime/vue/composables/use-waitlist.js +14 -1
- package/dist/runtime/vue/pages/gifts.vue +9 -0
- package/dist/runtime/vue/passkey-ceremony.d.ts +42 -0
- package/dist/runtime/vue/passkey-ceremony.js +37 -0
- package/dist/runtime/vue/passkey-client.d.ts +11 -49
- package/dist/runtime/vue/passkey-client.js +2 -34
- package/dist/runtime/vue/plugins/checkout-return.d.ts +5 -4
- package/dist/runtime/vue/plugins/checkout-return.js +1 -1
- package/dist/runtime/vue/plugins/passkey-ceremony.d.ts +3 -1
- package/dist/runtime/vue/plugins/passkey-ceremony.js +1 -1
- package/dist/runtime/vue/protection/state.d.ts +6 -0
- package/dist/runtime/vue/utils/auth-session.js +1 -1
- package/dist/runtime/vue/utils/billing-access.d.ts +1 -1
- package/dist/runtime/vue/utils/checkout-return.d.ts +5 -4
- package/dist/runtime/vue/utils/checkout-return.js +3 -3
- package/dist/runtime/vue/utils/login-bindings.js +1 -1
- package/dist/runtime/vue/utils/page-guard.js +6 -5
- package/dist/runtime/vue/utils/passkey-prompt.d.ts +12 -0
- package/dist/runtime/vue/utils/passkey-prompt.js +8 -0
- package/dist/runtime/vue/utils/renamed-component.js +1 -1
- package/dist/shared/{nuxt-backend.KEzfHO2K.mjs → nuxt-backend.Bq_mhlky.mjs} +578 -60
- package/dist/shared/{nuxt-backend.DXEf0rrv.mjs → nuxt-backend.D9qXcOOI.mjs} +1 -1
- package/dist/shared/{nuxt-backend.ikObmtHs.mjs → nuxt-backend.DmZI-QSO.mjs} +2 -2
- package/dist/shared/{nuxt-backend.Dm1NkY7v.mjs → nuxt-backend.G4JryO1q.mjs} +144 -32
- package/dist/shared/{nuxt-backend.2m535CLS.mjs → nuxt-backend.Lk2MQI2u.mjs} +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +13 -13
- package/skills/nuxt-backend/SKILL.md +3 -3
- package/skills/nuxt-backend/references/api.md +95 -25
- package/skills/nuxt-backend/references/renames.json +114 -2054
- package/skills/nuxt-backend/references/surface.json +112 -3
- package/skills/nuxt-backend-ai/SKILL.md +13 -6
- package/skills/nuxt-backend-ai/references/api.md +21 -3
- package/skills/nuxt-backend-auth/references/api.md +20 -3
- package/skills/nuxt-backend-billing/references/api.md +20 -5
- package/skills/nuxt-backend-data/SKILL.md +3 -3
- package/skills/nuxt-backend-data/references/api.md +4 -3
- package/skills/nuxt-backend-email/references/api.md +2 -1
- package/skills/nuxt-backend-growth/references/api.md +1 -0
- package/skills/nuxt-backend-ship/SKILL.md +14 -22
- package/skills/nuxt-backend-ship/references/api.md +25 -2
- package/skills/nuxt-backend-ship/references/operate.md +28 -0
- package/skills/nuxt-backend-ui/SKILL.md +6 -2
- package/skills/nuxt-backend-upgrade/SKILL.md +16 -11
- package/skills/nuxt-backend-upgrade/references/api.md +2 -2
- package/skills/nuxt-backend-upgrade/references/upgrade.md +37 -438
- package/src/convex/access-tickets.ts +30 -1
- package/src/convex/account-data.ts +26 -3
- package/src/convex/app.ts +16 -2
- package/src/convex/billing-launch.ts +42 -0
- package/src/convex/catalog.ts +16 -2
- package/src/convex/client/code-binding.ts +1 -1
- package/src/convex/client/guards.ts +3 -3
- package/src/convex/client/index.ts +4 -3
- package/src/convex/client/plugins.ts +43 -19
- package/src/convex/components/backend/_generated/api.ts +2 -0
- package/src/convex/components/backend/_generated/component.ts +1255 -242
- package/src/convex/components/backend/access.ts +109 -16
- package/src/convex/components/backend/account.ts +48 -2
- package/src/convex/components/backend/adapter.ts +4 -0
- package/src/convex/components/backend/billing.ts +75 -12
- package/src/convex/components/backend/crons.ts +4 -0
- package/src/convex/components/backend/gifts.ts +2 -2
- package/src/convex/components/backend/jobs.ts +58 -13
- package/src/convex/components/backend/maintenance.ts +14 -1
- package/src/convex/components/backend/moderation.ts +57 -0
- package/src/convex/components/backend/schema.ts +110 -4
- package/src/convex/components/backend/storage.ts +56 -0
- package/src/convex/components/backend/subscriptions.ts +1 -1
- package/src/convex/constants.ts +20 -4
- package/src/convex/email-templates.ts +124 -21
- package/src/convex/emails/notification.ts +22 -0
- package/src/convex/errors.ts +64 -8
- package/src/convex/events.ts +4 -4
- package/src/convex/files.ts +48 -6
- package/src/convex/integrations/account.ts +4 -0
- package/src/convex/integrations/ai/chat.ts +9 -9
- package/src/convex/integrations/ai/config.ts +147 -37
- package/src/convex/integrations/ai/context.ts +7 -4
- package/src/convex/integrations/ai/costs.ts +45 -2
- package/src/convex/integrations/ai/embeddings.ts +24 -39
- package/src/convex/integrations/ai/images.ts +141 -0
- package/src/convex/integrations/ai/job-errors.ts +19 -2
- package/src/convex/integrations/ai/jobs.ts +466 -72
- package/src/convex/integrations/ai/knowledge.ts +9 -10
- package/src/convex/integrations/ai/metering.ts +83 -28
- package/src/convex/integrations/ai/model-id.ts +24 -2
- package/src/convex/integrations/ai/models.ts +273 -58
- package/src/convex/integrations/ai/moderation-providers.ts +373 -0
- package/src/convex/integrations/ai/moderation-taxonomy.ts +174 -0
- package/src/convex/integrations/ai/moderation.ts +530 -47
- package/src/convex/integrations/ai/provenance.ts +10 -1
- package/src/convex/integrations/ai/setup.ts +5 -5
- package/src/convex/integrations/ai/stream.ts +4 -3
- package/src/convex/integrations/ai.ts +19 -6
- package/src/convex/integrations/billing/checkout.ts +4 -4
- package/src/convex/integrations/billing/context.ts +34 -2
- package/src/convex/integrations/billing/credits.ts +23 -6
- package/src/convex/integrations/billing/free-plan.ts +120 -24
- package/src/convex/integrations/billing/functions.ts +20 -8
- package/src/convex/integrations/billing/gifts.ts +34 -6
- package/src/convex/integrations/billing/lifecycle.ts +14 -6
- package/src/convex/integrations/billing/passes.ts +2 -2
- package/src/convex/integrations/billing/pricing.ts +43 -5
- package/src/convex/integrations/billing/rate-limit.ts +46 -0
- package/src/convex/integrations/billing/referral-orders.ts +1 -1
- package/src/convex/integrations/billing/resync.ts +187 -0
- package/src/convex/integrations/billing/rewards.ts +1 -1
- package/src/convex/integrations/billing/subscriptions.ts +4 -2
- package/src/convex/integrations/billing/types/lifecycle.ts +1 -1
- package/src/convex/integrations/billing/types/records.ts +67 -3
- package/src/convex/integrations/billing/types/setup.ts +6 -5
- package/src/convex/integrations/billing/types/surface.ts +38 -5
- package/src/convex/integrations/billing/webhooks.ts +2 -2
- package/src/convex/integrations/billing/welcome.ts +103 -0
- package/src/convex/integrations/billing.ts +20 -5
- package/src/convex/integrations/email.ts +17 -2
- package/src/convex/integrations/functions.ts +2 -2
- package/src/convex/integrations/launch.ts +247 -28
- package/src/convex/integrations/notifications.ts +16 -17
- package/src/convex/integrations/rate-limit.ts +18 -3
- package/src/convex/integrations/reports.ts +18 -5
- package/src/convex/integrations/retention.ts +73 -5
- package/src/convex/integrations/storage.ts +91 -6
- package/src/convex/label-format.ts +2 -2
- package/src/convex/label-groups/admin.ts +28 -0
- package/src/convex/label-groups/cancelFlow.ts +2 -2
- package/src/convex/label-groups/email.ts +2 -1
- package/src/convex/label-groups/errors.ts +6 -1
- package/src/convex/label-groups/gift.ts +5 -2
- package/src/convex/label-groups/legal.ts +31 -0
- package/src/convex/label-groups/notifications.ts +5 -3
- package/src/convex/label-groups/pastDue.ts +1 -1
- package/src/convex/label-groups/pricing.ts +4 -0
- package/src/convex/label-groups/referral.ts +2 -2
- package/src/convex/label-groups/report.ts +10 -1
- package/src/convex/label-groups/upload.ts +2 -0
- package/src/convex/label-groups/withdrawal.ts +1 -1
- package/src/convex/label-translations.ts +94 -34
- package/src/convex/labels.ts +25 -0
- package/src/convex/legal.ts +12 -2
- package/src/convex/log.ts +12 -1
- package/src/convex/monitoring.ts +6 -4
- package/src/convex/report-rules.ts +3 -0
- package/src/convex/sensitive-actions.ts +1 -0
- package/src/convex/test-models.ts +26 -2
- package/src/convex/test-moderation.ts +122 -0
- package/src/convex/test.ts +405 -8
- package/src/runtime/vue/components/account/AccountData.vue +2 -0
- package/src/runtime/vue/components/account/AccountDeletion.css +2 -1
- package/src/runtime/vue/components/account/ActivationChecklist.css +5 -2
- package/src/runtime/vue/components/account/ActivationChecklist.vue +1 -0
- package/src/runtime/vue/components/account/ConsentPrompt.css +8 -5
- package/src/runtime/vue/components/account/ConsentPromptDialog.vue +1 -0
- package/src/runtime/vue/components/account/ConsentPromptStorage.vue +1 -0
- package/src/runtime/vue/components/account/EmailUnsubscribe.css +6 -2
- package/src/runtime/vue/components/account/EmailUnsubscribe.vue +2 -2
- package/src/runtime/vue/components/account/HowDidYouHear.css +8 -3
- package/src/runtime/vue/components/account/HowDidYouHear.vue +1 -0
- package/src/runtime/vue/components/account/KeepAccount.css +3 -1
- package/src/runtime/vue/components/account/OnboardingFlow.css +6 -3
- package/src/runtime/vue/components/account/OnboardingFlow.vue +1 -0
- package/src/runtime/vue/components/account/ProfileIdentity.css +1 -1
- package/src/runtime/vue/components/account/ProfilePreferencesSection.css +3 -1
- package/src/runtime/vue/components/account/ProfilePreferencesSection.vue +4 -2
- package/src/runtime/vue/components/account/ProfileSettings.css +3 -1
- package/src/runtime/vue/components/account/ProfileSettings.vue +1 -0
- package/src/runtime/vue/components/account/SecurityAlerts.css +2 -1
- package/src/runtime/vue/components/account/SecurityAlerts.vue +2 -2
- package/src/runtime/vue/components/account/SecurityPasskeys.css +5 -3
- package/src/runtime/vue/components/account/SecuritySettings.css +2 -1
- package/src/runtime/vue/components/account/SecuritySettings.vue +1 -0
- package/src/runtime/vue/components/admin/AdminAccess.css +1 -1
- package/src/runtime/vue/components/admin/AdminAccess.vue +3 -1
- package/src/runtime/vue/components/admin/AdminAccessMemberTickets.vue +51 -0
- package/src/runtime/vue/components/admin/AdminAnnouncements.css +4 -2
- package/src/runtime/vue/components/admin/AdminBilling.css +1 -1
- package/src/runtime/vue/components/admin/AdminChart.css +2 -1
- package/src/runtime/vue/components/admin/AdminConsole.css +1 -0
- package/src/runtime/vue/components/admin/AdminExperiments.css +2 -1
- package/src/runtime/vue/components/admin/AdminFlags.css +4 -2
- package/src/runtime/vue/components/admin/AdminModeration.vue +148 -0
- package/src/runtime/vue/components/admin/AdminQueue.css +4 -2
- package/src/runtime/vue/components/admin/AdminReferrals.css +3 -1
- package/src/runtime/vue/components/admin/AdminReports.css +2 -1
- package/src/runtime/vue/components/admin/AdminRevenue.css +2 -1
- package/src/runtime/vue/components/admin/AdminUsers.vue +1 -0
- package/src/runtime/vue/components/admin/AdminWorkspaces.vue +1 -0
- package/src/runtime/vue/components/admin/admin.css +2 -1
- package/src/runtime/vue/components/auth/AuthForm.css +6 -3
- package/src/runtime/vue/components/auth/AuthForm.vue +4 -3
- package/src/runtime/vue/components/auth/AuthFormChoose.css +1 -0
- package/src/runtime/vue/components/auth/AuthFormPasskeyOffer.css +2 -1
- package/src/runtime/vue/components/auth/InviteRedeem.css +2 -0
- package/src/runtime/vue/components/auth/ReauthenticateCode.css +1 -1
- package/src/runtime/vue/components/auth/ReauthenticateDialog.css +6 -2
- package/src/runtime/vue/components/auth/ReauthenticateDialog.vue +3 -2
- package/src/runtime/vue/components/auth/WaitlistForm.css +3 -1
- package/src/runtime/vue/components/auth/WaitlistForm.vue +1 -0
- package/src/runtime/vue/components/auth/WaitlistPlace.css +3 -1
- package/src/runtime/vue/components/auth/WaitlistShare.css +6 -3
- package/src/runtime/vue/components/billing/BillingCheckoutLink.vue +2 -0
- package/src/runtime/vue/components/billing/BillingHistory.css +2 -1
- package/src/runtime/vue/components/billing/BillingHistory.vue +1 -0
- package/src/runtime/vue/components/billing/BillingPortalLink.vue +1 -0
- package/src/runtime/vue/components/billing/CancelFlow.css +8 -4
- package/src/runtime/vue/components/billing/CancelFlow.vue +2 -1
- package/src/runtime/vue/components/billing/CancelFlowEnd.vue +3 -1
- package/src/runtime/vue/components/billing/GiftList.css +5 -2
- package/src/runtime/vue/components/billing/PricingPackCard.css +2 -1
- package/src/runtime/vue/components/billing/PricingPlanCard.css +5 -3
- package/src/runtime/vue/components/billing/PricingPlanCard.vue +8 -1
- package/src/runtime/vue/components/billing/PricingTable.css +1 -1
- package/src/runtime/vue/components/billing/PricingTable.vue +23 -3
- package/src/runtime/vue/components/billing/ReferralCard.css +6 -3
- package/src/runtime/vue/components/billing/ReferralCard.vue +1 -0
- package/src/runtime/vue/components/billing/ReferralLanding.css +5 -2
- package/src/runtime/vue/components/billing/UpgradePrompt.css +6 -3
- package/src/runtime/vue/components/billing/UpgradePrompt.vue +1 -0
- package/src/runtime/vue/components/billing/UsageHistory.css +2 -1
- package/src/runtime/vue/components/billing/UsageHistory.vue +1 -0
- package/src/runtime/vue/components/billing/WithdrawalButton.css +6 -2
- package/src/runtime/vue/components/billing/WithdrawalButton.vue +2 -1
- package/src/runtime/vue/components/shared.css +24 -3
- package/src/runtime/vue/components/shell/AccessDenied.css +4 -1
- package/src/runtime/vue/components/shell/AccessDenied.vue +1 -0
- package/src/runtime/vue/components/shell/AccountMenu.vue +1 -0
- package/src/runtime/vue/components/shell/AiLabel.css +3 -2
- package/src/runtime/vue/components/shell/AiLabel.vue +4 -1
- package/src/runtime/vue/components/shell/AppShell.css +5 -3
- package/src/runtime/vue/components/shell/AppShell.vue +3 -0
- package/src/runtime/vue/components/shell/BackendNotices.vue +3 -2
- package/src/runtime/vue/components/shell/ConfirmDialog.css +5 -2
- package/src/runtime/vue/components/shell/ConnectionStatus.css +1 -1
- package/src/runtime/vue/components/shell/ConnectionStatus.vue +1 -0
- package/src/runtime/vue/components/shell/ContactForm.css +8 -1
- package/src/runtime/vue/components/shell/ContactForm.vue +1 -0
- package/src/runtime/vue/components/shell/FrameMain.vue +2 -0
- package/src/runtime/vue/components/shell/Gate.css +5 -2
- package/src/runtime/vue/components/shell/Gate.vue +2 -0
- package/src/runtime/vue/components/shell/GateQuota.vue +1 -0
- package/src/runtime/vue/components/shell/LegalCompany.vue +38 -0
- package/src/runtime/vue/components/shell/LegalContactPoints.vue +74 -0
- package/src/runtime/vue/components/shell/LegalDetail.vue +54 -0
- package/src/runtime/vue/components/shell/LegalDocument.css +21 -4
- package/src/runtime/vue/components/shell/LegalDocument.vue +54 -15
- package/src/runtime/vue/components/shell/LegalModeration.vue +94 -0
- package/src/runtime/vue/components/shell/LegalProcessors.vue +64 -22
- package/src/runtime/vue/components/shell/LegalStorage.vue +64 -23
- package/src/runtime/vue/components/shell/LegalVersion.vue +44 -0
- package/src/runtime/vue/components/shell/NoticeAnnouncement.css +2 -1
- package/src/runtime/vue/components/shell/NoticeDeletion.css +5 -2
- package/src/runtime/vue/components/shell/NoticeGift.css +2 -1
- package/src/runtime/vue/components/shell/NoticeGift.vue +8 -5
- package/src/runtime/vue/components/shell/NoticeImpersonation.css +2 -1
- package/src/runtime/vue/components/shell/NoticeLowCredits.css +6 -2
- package/src/runtime/vue/components/shell/NoticeMaintenance.css +2 -1
- package/src/runtime/vue/components/shell/NoticePastDue.css +6 -2
- package/src/runtime/vue/components/shell/NoticePastDue.vue +1 -1
- package/src/runtime/vue/components/shell/NotificationInbox.css +6 -4
- package/src/runtime/vue/components/shell/NotificationInbox.vue +1 -0
- package/src/runtime/vue/components/shell/ReportNotice.css +2 -1
- package/src/runtime/vue/components/shell/UploadField.css +4 -2
- package/src/runtime/vue/components/shell/UploadField.vue +21 -5
- package/src/runtime/vue/components/shell/WorkspaceSwitcher.css +4 -1
- package/src/runtime/vue/components/shell/WorkspaceSwitcher.vue +1 -0
- package/src/runtime/vue/components/tokens.css +21 -1
- package/src/runtime/vue/components/workspaces/AcceptInvitation.vue +1 -0
- package/src/runtime/vue/components/workspaces/AuditLog.css +2 -1
- package/src/runtime/vue/components/workspaces/AuditLog.vue +1 -0
- package/src/runtime/vue/components/workspaces/WorkspaceBilling.css +2 -1
- package/src/runtime/vue/components/workspaces/WorkspaceCredits.css +1 -0
- package/src/runtime/vue/components/workspaces/WorkspaceList.css +2 -1
- package/src/runtime/vue/components/workspaces/WorkspaceSettings.vue +1 -0
- package/src/runtime/vue/pages/gifts.vue +13 -2
- package/src/runtime/vue/pages/referral.vue +1 -2
- package/dist/devtools-client/_nuxt/CfQg3BRt.js +0 -5
package/src/convex/test.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="vite/client" />
|
|
2
2
|
import { convexTest, type TestConvex } from 'convex-test'
|
|
3
|
-
import { componentsGeneric, type FunctionReference, type GenericSchema, type SchemaDefinition } from 'convex/server'
|
|
3
|
+
import { actionGeneric, componentsGeneric, type FunctionReference, type GenericSchema, type SchemaDefinition } from 'convex/server'
|
|
4
|
+
import { v } from 'convex/values'
|
|
4
5
|
import actionCache from '@convex-dev/action-cache/test'
|
|
5
6
|
import aggregate from '@convex-dev/aggregate/test'
|
|
6
7
|
import batchWorker from '@convex-dev/batch-worker/test'
|
|
@@ -15,11 +16,27 @@ import workpool from '@convex-dev/workpool/test'
|
|
|
15
16
|
import { AUTH_TIME_CLAIM, IMPERSONATED_BY_CLAIM, SIGN_IN_METHOD_CLAIM, type SignInMethod } from './constants.js'
|
|
16
17
|
import schema from './components/backend/schema.js'
|
|
17
18
|
import { installTestModels } from './test-models.js'
|
|
19
|
+
import { installTestModerationProviders } from './test-moderation.js'
|
|
18
20
|
|
|
19
21
|
const modules = import.meta.glob('./components/backend/**/*.ts')
|
|
20
22
|
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
+
/** The module the test kit adds to the `backend` component: an upload into its storage, as an upload URL leaves one. */
|
|
24
|
+
const TEST_KIT_MODULE = './components/backend/testKit.ts'
|
|
25
|
+
|
|
26
|
+
/** The test kit's own functions inside the component. Never deployed: only `register` mounts them. */
|
|
27
|
+
const testKitModule = {
|
|
28
|
+
upload: actionGeneric({
|
|
29
|
+
args: { bytes: v.bytes(), type: v.optional(v.string()) },
|
|
30
|
+
handler: async (ctx, { bytes, type }) => ctx.storage.store(new Blob([bytes], type ? { type } : {})),
|
|
31
|
+
}),
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* A component's test helper, as `@convex-dev/<name>/test` exports it.
|
|
36
|
+
*
|
|
37
|
+
* @experimental
|
|
38
|
+
*/
|
|
39
|
+
export type ComponentTestKit = { register: (t: TestConvex<AnySchema>, name?: string) => unknown }
|
|
23
40
|
|
|
24
41
|
/**
|
|
25
42
|
* The Agent and RAG components' test helpers, when the app installs them:
|
|
@@ -68,7 +85,7 @@ export function register<Schema extends AnySchema>(
|
|
|
68
85
|
t: TestConvex<Schema>,
|
|
69
86
|
name: string = 'backend',
|
|
70
87
|
): void {
|
|
71
|
-
t.registerComponent(name, schema, modules)
|
|
88
|
+
t.registerComponent(name, schema, { ...modules, [TEST_KIT_MODULE]: () => Promise.resolve(testKitModule) })
|
|
72
89
|
// The provider's helper is not generic over the app schema (it never reads it).
|
|
73
90
|
resend.register(t as unknown as TestConvex<AnySchema>, `${name}/resend`)
|
|
74
91
|
migrations.register(t as unknown as TestConvex<AnySchema>, `${name}/migrations`)
|
|
@@ -91,6 +108,24 @@ export function register<Schema extends AnySchema>(
|
|
|
91
108
|
* them.
|
|
92
109
|
* Call it once per test, so no test sees another's rows.
|
|
93
110
|
*
|
|
111
|
+
* The environment a deployment holds is set once, when
|
|
112
|
+
* `defineBackendTestApp` runs, for each variable the test file has not set
|
|
113
|
+
* by then: `AUTH_SECRET` (signed file URLs, share links and invite codes
|
|
114
|
+
* are keyed with it), `SITE_URL` (`https://app.test`, the origin of a
|
|
115
|
+
* share link) and `CONVEX_SITE_URL` (`https://convex.test`, the origin of
|
|
116
|
+
* a signed file URL and the issuer `asUser` signs with). A test's
|
|
117
|
+
* `vi.stubEnv` changes them as it changes any variable:
|
|
118
|
+
* `vi.stubEnv('SITE_URL', undefined)` unsets it for the instances made
|
|
119
|
+
* after it, and `vi.unstubAllEnvs()` puts these values back.
|
|
120
|
+
*
|
|
121
|
+
* A component your app mounts a second time under a name of its own (a
|
|
122
|
+
* `workflow` mounted as `generation`, say) goes in `mounts`, with its
|
|
123
|
+
* test helper: `{ generation: workflow }`, `workflow` from
|
|
124
|
+
* `@convex-dev/workflow/test`.
|
|
125
|
+
*
|
|
126
|
+
* Each instance also has `upload` ({@link BackendTestApp}): a file sent
|
|
127
|
+
* into the `backend` component's storage, as an upload URL leaves it.
|
|
128
|
+
*
|
|
94
129
|
* The aggregate's own batch worker is left out, as `@convex-dev/aggregate/test`
|
|
95
130
|
* leaves it out: a test of async aggregate writes registers it from
|
|
96
131
|
* `@convex-dev/batch-worker/test` at `aggregate/batchWorker`.
|
|
@@ -114,10 +149,21 @@ export function register<Schema extends AnySchema>(
|
|
|
114
149
|
export function defineBackendTestApp<Schema extends AnySchema>(
|
|
115
150
|
appSchema: Schema,
|
|
116
151
|
appModules: Record<string, () => Promise<unknown>>,
|
|
117
|
-
|
|
152
|
+
options: BackendTestAppOptions = {},
|
|
153
|
+
): () => BackendTestApp<Schema> {
|
|
118
154
|
// Every `provider/model` id answers with the AI SDK's mock, with no key.
|
|
119
155
|
installTestModels()
|
|
156
|
+
// Every moderation provider answers with its fake, from the markers the content holds.
|
|
157
|
+
installTestModerationProviders()
|
|
158
|
+
// Once, here: a later `vi.stubEnv(name, undefined)` really unsets one.
|
|
159
|
+
setDeploymentEnv()
|
|
160
|
+
const mounts = Object.entries(options.mounts ?? {})
|
|
161
|
+
for (const [mount, kit] of mounts) {
|
|
162
|
+
if (typeof kit?.register !== 'function') throw new TypeError(`[nuxt-backend] defineBackendTestApp: mounts.${mount} is a component's test helper, the default export of its \`/test\` entry (\`import workflow from '@convex-dev/workflow/test'\`).`)
|
|
163
|
+
}
|
|
120
164
|
return () => {
|
|
165
|
+
// A fresh instance has stored nothing yet: what stubStorageFetch serves starts empty.
|
|
166
|
+
storedFiles.clear()
|
|
121
167
|
const t = convexTest(appSchema, appModules as Record<string, () => Promise<never>>) as unknown as TestConvex<Schema>
|
|
122
168
|
supportMutationStorage()
|
|
123
169
|
register(t)
|
|
@@ -133,10 +179,121 @@ export function defineBackendTestApp<Schema extends AnySchema>(
|
|
|
133
179
|
workflow.register(any)
|
|
134
180
|
workpool.register(any)
|
|
135
181
|
for (const kit of optionalKits) kit?.register(any)
|
|
136
|
-
|
|
182
|
+
for (const [mount, kit] of mounts) kit.register(any, mount)
|
|
183
|
+
return Object.assign(t, { upload: (file?: TestFile, fileOptions?: TestUploadOptions) => upload(t, file, fileOptions) })
|
|
137
184
|
}
|
|
138
185
|
}
|
|
139
186
|
|
|
187
|
+
/**
|
|
188
|
+
* The options of {@link defineBackendTestApp}.
|
|
189
|
+
*
|
|
190
|
+
* @experimental
|
|
191
|
+
*/
|
|
192
|
+
export interface BackendTestAppOptions {
|
|
193
|
+
/**
|
|
194
|
+
* Components your app mounts under a name of its own, beside the ones the
|
|
195
|
+
* scaffold mounts: the mount name from `convex.config.ts`, and the
|
|
196
|
+
* component's test helper (the default export of its `/test` entry).
|
|
197
|
+
*/
|
|
198
|
+
mounts?: Record<string, ComponentTestKit>
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* A file {@link upload} sends: bytes (a Node `Buffer` included), a `Blob`
|
|
203
|
+
* (its type kept), or text.
|
|
204
|
+
*
|
|
205
|
+
* @experimental
|
|
206
|
+
*/
|
|
207
|
+
export type TestFile = Uint8Array | ArrayBuffer | Blob | string
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* How {@link upload} sends a file.
|
|
211
|
+
*
|
|
212
|
+
* @experimental
|
|
213
|
+
*/
|
|
214
|
+
export interface TestUploadOptions {
|
|
215
|
+
/** The type the browser would send with it. Default: the `Blob`'s own, else none. The package's checks read the type from the bytes anyway. */
|
|
216
|
+
type?: string
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Your app under test, from {@link defineBackendTestApp}: the convex-test instance, and `upload`.
|
|
221
|
+
*
|
|
222
|
+
* @experimental
|
|
223
|
+
*/
|
|
224
|
+
export type BackendTestApp<Schema extends AnySchema = AnySchema> = TestConvex<Schema> & {
|
|
225
|
+
/**
|
|
226
|
+
* Send a file into the `backend` component's storage, claimed by nobody,
|
|
227
|
+
* as an upload URL leaves it, and return its storage id: what your
|
|
228
|
+
* function then claims (`storage.claim`) or discards. With no file, a
|
|
229
|
+
* valid 2 × 2 PNG ({@link TEST_PNG}).
|
|
230
|
+
*/
|
|
231
|
+
upload: (file?: TestFile, options?: TestUploadOptions) => Promise<string>
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/** The value of each deployment variable a test app reads, when the test file sets none. */
|
|
235
|
+
const DEPLOYMENT_ENV = {
|
|
236
|
+
// Long enough for every keyed hash and signature the package makes; a test value, never a deployment's.
|
|
237
|
+
AUTH_SECRET: 'nuxt-backend-test-secret-0123456789abcdef0123456789abcdef',
|
|
238
|
+
SITE_URL: 'https://app.test',
|
|
239
|
+
CONVEX_SITE_URL: 'https://convex.test',
|
|
240
|
+
// The moderation providers' keys: test values their fakes take, so a test of the policy needs none of its own.
|
|
241
|
+
CONTENT_SAFETY_ENDPOINT: 'https://content-safety.test',
|
|
242
|
+
CONTENT_SAFETY_KEY: 'test-content-safety-key',
|
|
243
|
+
SECOND_OPINION_KEY: 'test-second-opinion-key',
|
|
244
|
+
KNOWN_ABUSE_KEY: 'test:test-known-abuse-key',
|
|
245
|
+
} as const
|
|
246
|
+
|
|
247
|
+
/** Set each deployment variable the test file left unset, in `process.env` as the functions read it. */
|
|
248
|
+
function setDeploymentEnv(): void {
|
|
249
|
+
const env = (globalThis as { process?: { env?: Record<string, string | undefined> } }).process?.env
|
|
250
|
+
if (!env) return
|
|
251
|
+
for (const [key, value] of Object.entries(DEPLOYMENT_ENV)) env[key] ??= value
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* A valid 2 × 2 PNG: what the storage check sniffs, strips and serves.
|
|
256
|
+
*
|
|
257
|
+
* @experimental
|
|
258
|
+
*/
|
|
259
|
+
export const TEST_PNG: Uint8Array<ArrayBuffer> = Uint8Array.from(atob('iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAAE0lEQVR4nGN4Eq4nKy3GAMRAFgAZigNvRWdDygAAAABJRU5ErkJggg=='), char => char.charCodeAt(0))
|
|
260
|
+
|
|
261
|
+
/** The test kit's upload, by mount name, through the generic component refs. */
|
|
262
|
+
function uploadRef(name: string): FunctionReference<'action', 'internal', { bytes: ArrayBuffer, type?: string }, string> {
|
|
263
|
+
return (componentsGeneric() as unknown as Record<string, { testKit: { upload: FunctionReference<'action', 'internal', { bytes: ArrayBuffer, type?: string }, string> } }>)[name]!.testKit.upload
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Send a file into the `backend` component's storage, claimed by nobody,
|
|
268
|
+
* as the browser leaves it after posting to an upload URL, and return its
|
|
269
|
+
* storage id. With no file, a valid 2 × 2 PNG ({@link TEST_PNG}). An
|
|
270
|
+
* instance from {@link defineBackendTestApp} has it as `t.upload()`.
|
|
271
|
+
*
|
|
272
|
+
* @experimental
|
|
273
|
+
*
|
|
274
|
+
* @param t - A test instance the `backend` component is registered with.
|
|
275
|
+
* @param file - The bytes, a `Blob` or text.
|
|
276
|
+
* @param options - The type the browser would send.
|
|
277
|
+
* @param name - The name the `backend` component is mounted under.
|
|
278
|
+
*/
|
|
279
|
+
export async function upload<Schema extends AnySchema>(
|
|
280
|
+
t: TestConvex<Schema>,
|
|
281
|
+
file: TestFile = TEST_PNG,
|
|
282
|
+
options: TestUploadOptions = {},
|
|
283
|
+
name: string = 'backend',
|
|
284
|
+
): Promise<string> {
|
|
285
|
+
const type = options.type ?? (file instanceof Blob && file.type ? file.type : undefined)
|
|
286
|
+
const bytes = file instanceof Blob
|
|
287
|
+
? await file.arrayBuffer()
|
|
288
|
+
: typeof file === 'string'
|
|
289
|
+
? new TextEncoder().encode(file).buffer as ArrayBuffer
|
|
290
|
+
: file instanceof ArrayBuffer
|
|
291
|
+
? file
|
|
292
|
+
// A view's own bytes only: a small Node `Buffer` is a window on a shared 8 KB pool.
|
|
293
|
+
: file.buffer.slice(file.byteOffset, file.byteOffset + file.byteLength) as ArrayBuffer
|
|
294
|
+
return t.action(uploadRef(name), { bytes, ...(type ? { type } : {}) })
|
|
295
|
+
}
|
|
296
|
+
|
|
140
297
|
type Syscalls = {
|
|
141
298
|
syscall: unknown
|
|
142
299
|
asyncSyscall: (op: string, args: string) => Promise<string>
|
|
@@ -152,6 +309,25 @@ const toBase64 = (bytes: Uint8Array): string => {
|
|
|
152
309
|
|
|
153
310
|
let mutationStorage = false
|
|
154
311
|
|
|
312
|
+
/**
|
|
313
|
+
* Every file the latest test instance stored, by the SHA-256 (base64)
|
|
314
|
+
* convex-test names its URL after: what {@link stubStorageFetch} serves.
|
|
315
|
+
* Emptied each time {@link defineBackendTestApp} makes an instance.
|
|
316
|
+
*/
|
|
317
|
+
const storedFiles = new Map<string, Blob>()
|
|
318
|
+
|
|
319
|
+
/** A blob's SHA-256 as base64, the way convex-test keys a file's URL. */
|
|
320
|
+
async function blobSha(blob: Blob): Promise<string> {
|
|
321
|
+
return toBase64(new Uint8Array(await crypto.subtle.digest('SHA-256', await blob.arrayBuffer())))
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/** Store a blob through the runtime, and remember its bytes for the storage URL it gets. */
|
|
325
|
+
async function storeBlob(base: Syscalls, blob: Blob): Promise<unknown> {
|
|
326
|
+
const stored = await base.jsSyscall('storage/storeBlob', { blob })
|
|
327
|
+
storedFiles.set(await blobSha(blob), blob)
|
|
328
|
+
return stored
|
|
329
|
+
}
|
|
330
|
+
|
|
155
331
|
/**
|
|
156
332
|
* `ctx.storage.store` and `ctx.storage.get` in a mutation (Convex 1.48),
|
|
157
333
|
* which convex-test does not serve yet: answered with the same file store
|
|
@@ -169,7 +345,8 @@ function supportMutationStorage(): void {
|
|
|
169
345
|
return base.syscall
|
|
170
346
|
},
|
|
171
347
|
get jsSyscall() {
|
|
172
|
-
|
|
348
|
+
const inner = base.jsSyscall
|
|
349
|
+
return (op: string, args: Record<string, unknown>) => op === 'storage/storeBlob' ? storeBlob(base, args.blob as Blob) : inner(op, args)
|
|
173
350
|
},
|
|
174
351
|
get asyncSyscall() {
|
|
175
352
|
const inner = base.asyncSyscall
|
|
@@ -177,7 +354,7 @@ function supportMutationStorage(): void {
|
|
|
177
354
|
if (op === '1.0/storageStore') {
|
|
178
355
|
const { blob, contentType } = JSON.parse(json) as { blob: string, contentType?: string }
|
|
179
356
|
const bytes = Uint8Array.from(atob(blob), char => char.charCodeAt(0))
|
|
180
|
-
return JSON.stringify(await base
|
|
357
|
+
return JSON.stringify(await storeBlob(base, new Blob([bytes], contentType ? { type: contentType } : {})))
|
|
181
358
|
}
|
|
182
359
|
if (op === '1.0/storageGet') {
|
|
183
360
|
const { storageId } = JSON.parse(json) as { storageId: string }
|
|
@@ -191,6 +368,218 @@ function supportMutationStorage(): void {
|
|
|
191
368
|
}
|
|
192
369
|
}
|
|
193
370
|
|
|
371
|
+
/**
|
|
372
|
+
* Where convex-test's `ctx.storage.getUrl` points: a deployment that does not exist.
|
|
373
|
+
*
|
|
374
|
+
* @experimental
|
|
375
|
+
*/
|
|
376
|
+
export const TEST_STORAGE_URL = 'https://some-deployment.convex.cloud/api/storage/'
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* How {@link stubStorageFetch} answers.
|
|
380
|
+
*
|
|
381
|
+
* @experimental
|
|
382
|
+
*/
|
|
383
|
+
export interface StubStorageFetchOptions {
|
|
384
|
+
/**
|
|
385
|
+
* What answers a request that is not for a stored file. Default: none, so
|
|
386
|
+
* the call throws `No network under test` and the step that made it
|
|
387
|
+
* fails, as a test with no network should.
|
|
388
|
+
*/
|
|
389
|
+
network?: (request: Request) => Response | Promise<Response>
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* Answer `fetch` for the files your functions stored, with their bytes and
|
|
394
|
+
* type, as the deployment's storage would: a model handed a photo by URL,
|
|
395
|
+
* or a signed URL's route reading the file, gets the real file under test.
|
|
396
|
+
* Any other request throws, unless `network` answers it. Returns the
|
|
397
|
+
* function that puts the original `fetch` back: call it after the test.
|
|
398
|
+
*
|
|
399
|
+
* It serves the files stored by the latest instance of
|
|
400
|
+
* {@link defineBackendTestApp}, uploads ({@link upload}) included: making
|
|
401
|
+
* an instance forgets the files of the ones before. A storage URL of no
|
|
402
|
+
* stored file answers 404.
|
|
403
|
+
*
|
|
404
|
+
* @experimental
|
|
405
|
+
*
|
|
406
|
+
* @example
|
|
407
|
+
* ```ts
|
|
408
|
+
* let restoreFetch: () => void
|
|
409
|
+
* beforeEach(() => { restoreFetch = stubStorageFetch() })
|
|
410
|
+
* afterEach(() => restoreFetch())
|
|
411
|
+
* ```
|
|
412
|
+
*/
|
|
413
|
+
export function stubStorageFetch(options: StubStorageFetchOptions = {}): () => void {
|
|
414
|
+
const original = globalThis.fetch
|
|
415
|
+
globalThis.fetch = async (input: RequestInfo | URL, init?: RequestInit): Promise<Response> => {
|
|
416
|
+
const request = new Request(input, init)
|
|
417
|
+
if (request.url.startsWith(TEST_STORAGE_URL)) {
|
|
418
|
+
const file = storedFiles.get(decodeURIComponent(request.url.slice(TEST_STORAGE_URL.length)))
|
|
419
|
+
if (!file) return new Response('Not found', { status: 404 })
|
|
420
|
+
return new Response(file.slice(), { headers: { 'content-type': file.type || 'application/octet-stream', 'content-length': String(file.size) } })
|
|
421
|
+
}
|
|
422
|
+
if (options.network) return options.network(request)
|
|
423
|
+
throw new Error(`[nuxt-backend] No network under test: ${request.method} ${request.url}. Pass stubStorageFetch({ network }) to answer it.`)
|
|
424
|
+
}
|
|
425
|
+
return () => {
|
|
426
|
+
globalThis.fetch = original
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* The fake timers {@link drain} steps: Vitest's `vi` after `vi.useFakeTimers()`.
|
|
432
|
+
*
|
|
433
|
+
* @experimental
|
|
434
|
+
*/
|
|
435
|
+
export interface TestTimers {
|
|
436
|
+
getTimerCount: () => number
|
|
437
|
+
advanceTimersToNextTimer: () => unknown
|
|
438
|
+
isFakeTimers?: () => boolean
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Run every scheduled function to the end, one at a time: storage checks,
|
|
443
|
+
* the job queue and its steps, workflows, deliveries and retries. Between
|
|
444
|
+
* two, the clock moves to the next timer and no further, so a function
|
|
445
|
+
* that stores a file never runs while another commits. Needs fake timers:
|
|
446
|
+
* pass `vi` after `vi.useFakeTimers()`.
|
|
447
|
+
*
|
|
448
|
+
* @experimental
|
|
449
|
+
*
|
|
450
|
+
* @param t - A test instance, e.g. from {@link defineBackendTestApp}.
|
|
451
|
+
* @param timers - Vitest's `vi`, its fake timers on.
|
|
452
|
+
* @param options - How many timers it fires at most before it gives up. Default 5000.
|
|
453
|
+
* @param options.maxSteps - The timers fired at most.
|
|
454
|
+
* @throws Error when the scheduled functions keep scheduling past `maxSteps`.
|
|
455
|
+
*
|
|
456
|
+
* @example
|
|
457
|
+
* ```ts
|
|
458
|
+
* vi.useFakeTimers()
|
|
459
|
+
* await ada.action(api.photos.attach, { fileId: await t.upload() })
|
|
460
|
+
* await drain(t, vi)
|
|
461
|
+
* ```
|
|
462
|
+
*/
|
|
463
|
+
export async function drain<Schema extends AnySchema>(t: TestConvex<Schema>, timers: TestTimers, options: { maxSteps?: number } = {}): Promise<void> {
|
|
464
|
+
if (timers.isFakeTimers?.() === false) throw new TypeError('[nuxt-backend] drain: turn fake timers on first, with vi.useFakeTimers().')
|
|
465
|
+
const maxSteps = options.maxSteps ?? 5000
|
|
466
|
+
for (let step = 0; step < maxSteps; step++) {
|
|
467
|
+
await t.finishInProgressScheduledFunctions()
|
|
468
|
+
if (timers.getTimerCount() === 0) return
|
|
469
|
+
timers.advanceTimersToNextTimer()
|
|
470
|
+
}
|
|
471
|
+
throw new Error(`[nuxt-backend] drain: the scheduled functions still scheduled more after ${maxSteps} timers. A function that schedules itself forever never drains.`)
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* An entity's billing state, as a sync from the provider leaves it, for {@link seedBilling}.
|
|
476
|
+
*
|
|
477
|
+
* @experimental
|
|
478
|
+
*/
|
|
479
|
+
export interface TestBilling {
|
|
480
|
+
/** The provider's product ids the entity holds. Default none. */
|
|
481
|
+
products?: string[]
|
|
482
|
+
/** The feature keys its benefits grant, as `hasFeature` reads them. Default none. */
|
|
483
|
+
features?: string[]
|
|
484
|
+
/** The balance of each meter, by the provider's meter id. Default none. */
|
|
485
|
+
credits?: Record<string, number>
|
|
486
|
+
/**
|
|
487
|
+
* The provider's customer the entity is: an id, or `true` for its
|
|
488
|
+
* customer (a fresh one the first time, the same one after). Default
|
|
489
|
+
* none, as before a first checkout, so nothing reaches the provider. A
|
|
490
|
+
* customer is what a charge, a refund or the portal calls. An entity has
|
|
491
|
+
* one customer: a second, different id throws.
|
|
492
|
+
*/
|
|
493
|
+
customer?: string | true
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
/** The billing cache's functions in the component, through the generic component refs. */
|
|
497
|
+
type BillingRefs = {
|
|
498
|
+
billing: {
|
|
499
|
+
upsert: FunctionReference<'mutation', 'internal', Record<string, unknown>, null>
|
|
500
|
+
getByUser: FunctionReference<'query', 'internal', { userId: string }, { customerId: string | null, activeProductIds: string[], benefits: Array<Record<string, unknown>>, meters: Array<{ meterId: string, consumedUnits: number, creditedUnits: number, balance: number }> } | null>
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
/** The billing provider component's customer functions, as the app mounts it at `polar`. */
|
|
505
|
+
type ProviderRefs = {
|
|
506
|
+
lib: {
|
|
507
|
+
insertCustomer: FunctionReference<'mutation', 'internal', { id: string, userId: string }, string>
|
|
508
|
+
getCustomerByUserId: FunctionReference<'query', 'internal', { userId: string }, { id: string } | null>
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
/** The entity's customer at the provider: the one it has, a fresh one for `true`, or the id given. */
|
|
513
|
+
async function seedCustomer<Schema extends AnySchema>(t: TestConvex<Schema>, entityId: string, customer: string | true): Promise<string> {
|
|
514
|
+
const provider = (componentsGeneric() as unknown as { polar?: ProviderRefs }).polar
|
|
515
|
+
if (!provider) throw new TypeError('[nuxt-backend] seedBilling: a customer is kept by the billing provider\'s component, mounted at `polar`. Build the instance with defineBackendTestApp.')
|
|
516
|
+
const existing = await t.query(provider.lib.getCustomerByUserId, { userId: entityId })
|
|
517
|
+
if (existing && customer !== true && existing.id !== customer) throw new TypeError(`[nuxt-backend] seedBilling: ${entityId} is already the provider's customer ${existing.id}, not ${customer}. An entity has one customer.`)
|
|
518
|
+
if (existing) return existing.id
|
|
519
|
+
const customerId = customer === true ? `cus_test_${++created}` : customer
|
|
520
|
+
await t.mutation(provider.lib.insertCustomer, { id: customerId, userId: entityId })
|
|
521
|
+
return customerId
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* Give a billing entity the plans, features and credits a sync from the
|
|
526
|
+
* provider would leave it: the entitlement cache every gate, `hasFeature`,
|
|
527
|
+
* quota and credit spend reads. Replaces what the entity had. No provider is
|
|
528
|
+
* called.
|
|
529
|
+
*
|
|
530
|
+
* The entity is the one billing charges: the workspace by default
|
|
531
|
+
* (`ada.workspaceId`), the account with `billTo: 'user'` (`ada.userId`).
|
|
532
|
+
*
|
|
533
|
+
* @experimental
|
|
534
|
+
*
|
|
535
|
+
* @param t - A test instance, e.g. from {@link defineBackendTestApp}.
|
|
536
|
+
* @param entityId - The billing entity's id.
|
|
537
|
+
* @param billing - Its products, features, meter balances and customer.
|
|
538
|
+
* @param name - The name the `backend` component is mounted under.
|
|
539
|
+
*
|
|
540
|
+
* @example
|
|
541
|
+
* ```ts
|
|
542
|
+
* await seedBilling(t, ada.workspaceId!, { features: ['export'], credits: { [COINS]: 5 } })
|
|
543
|
+
* ```
|
|
544
|
+
*/
|
|
545
|
+
export async function seedBilling<Schema extends AnySchema>(t: TestConvex<Schema>, entityId: string, billing: TestBilling = {}, name: string = 'backend'): Promise<void> {
|
|
546
|
+
const refs = (componentsGeneric() as unknown as Record<string, BillingRefs>)[name]!
|
|
547
|
+
const customerId = billing.customer ? await seedCustomer(t, entityId, billing.customer) : undefined
|
|
548
|
+
await t.mutation(refs.billing.upsert, {
|
|
549
|
+
userId: entityId,
|
|
550
|
+
...(customerId ? { customerId } : {}),
|
|
551
|
+
activeProductIds: billing.products ?? [],
|
|
552
|
+
benefits: (billing.features ?? []).map(key => ({ id: `grant-${key}`, benefitId: `benefit-${key}`, type: 'custom', metadata: { key } })),
|
|
553
|
+
meters: Object.entries(billing.credits ?? {}).map(([meterId, balance]) => ({ meterId, consumedUnits: 0, creditedUnits: balance, balance })),
|
|
554
|
+
})
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
/**
|
|
558
|
+
* Set one meter's credit balance for a billing entity, as a sync from the
|
|
559
|
+
* provider leaves it, keeping its plans, features and other meters. No
|
|
560
|
+
* provider is called.
|
|
561
|
+
*
|
|
562
|
+
* @experimental
|
|
563
|
+
*
|
|
564
|
+
* @param t - A test instance, e.g. from {@link defineBackendTestApp}.
|
|
565
|
+
* @param entityId - The billing entity's id (see {@link seedBilling}).
|
|
566
|
+
* @param meterId - The provider's meter id, as your catalog's `meters` hold it.
|
|
567
|
+
* @param balance - The units left.
|
|
568
|
+
* @param name - The name the `backend` component is mounted under.
|
|
569
|
+
*/
|
|
570
|
+
export async function seedCredits<Schema extends AnySchema>(t: TestConvex<Schema>, entityId: string, meterId: string, balance: number, name: string = 'backend'): Promise<void> {
|
|
571
|
+
const refs = (componentsGeneric() as unknown as Record<string, BillingRefs>)[name]!
|
|
572
|
+
const cached = await t.query(refs.billing.getByUser, { userId: entityId })
|
|
573
|
+
const meters = (cached?.meters ?? []).filter(meter => meter.meterId !== meterId)
|
|
574
|
+
await t.mutation(refs.billing.upsert, {
|
|
575
|
+
userId: entityId,
|
|
576
|
+
...(cached?.customerId ? { customerId: cached.customerId } : {}),
|
|
577
|
+
activeProductIds: cached?.activeProductIds ?? [],
|
|
578
|
+
benefits: cached?.benefits ?? [],
|
|
579
|
+
meters: [...meters, { meterId, consumedUnits: 0, creditedUnits: balance, balance }],
|
|
580
|
+
})
|
|
581
|
+
}
|
|
582
|
+
|
|
194
583
|
/** Who {@link asUser} signs in as. Every field is optional. */
|
|
195
584
|
export interface TestUserOptions {
|
|
196
585
|
/** The address. Default: a fresh `user-<n>@example.com`. */
|
|
@@ -342,4 +731,12 @@ export async function asUser<Schema extends AnySchema>(
|
|
|
342
731
|
return Object.assign(signIn({ ...user, ...active, ...impersonation, sessionId, [AUTH_TIME_CLAIM]: signedInAt, ...method }), account, { sessionId })
|
|
343
732
|
}
|
|
344
733
|
|
|
734
|
+
/**
|
|
735
|
+
* The markers the moderation providers' fakes read: `TEST_UNSAFE('sexual')`
|
|
736
|
+
* in text or an image's bytes finds that category at full strength,
|
|
737
|
+
* `TEST_FAINT('violence')` faintly, and `TEST_KNOWN_ABUSE` matches the
|
|
738
|
+
* known-abuse list.
|
|
739
|
+
*/
|
|
740
|
+
export { TEST_FAINT, TEST_KNOWN_ABUSE, TEST_UNSAFE } from './test-moderation.js'
|
|
741
|
+
|
|
345
742
|
export default { register, schema, modules }
|
|
@@ -126,6 +126,7 @@ provideAccountDataView({ labels, context, id, typed, mismatched, link })
|
|
|
126
126
|
<template>
|
|
127
127
|
<div
|
|
128
128
|
v-if="auth.isImpersonating.value"
|
|
129
|
+
data-backend
|
|
129
130
|
data-account="root"
|
|
130
131
|
>
|
|
131
132
|
<p data-account="refused">
|
|
@@ -134,6 +135,7 @@ provideAccountDataView({ labels, context, id, typed, mismatched, link })
|
|
|
134
135
|
</div>
|
|
135
136
|
<div
|
|
136
137
|
v-else
|
|
138
|
+
data-backend
|
|
137
139
|
data-account="root"
|
|
138
140
|
:aria-busy="pending !== null || account.isLoading.value ? 'true' : undefined"
|
|
139
141
|
>
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
@layer nuxt-backend {
|
|
7
7
|
[data-account='section-delete'] {
|
|
8
8
|
padding: 0.9rem;
|
|
9
|
-
border:
|
|
9
|
+
border: var(--bk-border-width) solid color-mix(in srgb, var(--bk-error) 30%, transparent);
|
|
10
|
+
box-shadow: var(--bk-shadow);
|
|
10
11
|
border-radius: var(--bk-radius);
|
|
11
12
|
}
|
|
12
13
|
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
flex-direction: column;
|
|
10
10
|
gap: 0.6rem;
|
|
11
11
|
padding: 1rem;
|
|
12
|
-
border:
|
|
12
|
+
border: var(--bk-border-width) solid var(--bk-edge);
|
|
13
|
+
box-shadow: var(--bk-shadow);
|
|
13
14
|
border-radius: var(--bk-radius);
|
|
14
15
|
background: var(--bk-surface);
|
|
15
16
|
color: var(--bk-ink);
|
|
@@ -98,11 +99,13 @@
|
|
|
98
99
|
[data-activation='dismiss'] {
|
|
99
100
|
align-self: flex-start;
|
|
100
101
|
padding: 0.4rem 0.8rem;
|
|
101
|
-
border:
|
|
102
|
+
border: var(--bk-border-width) solid var(--bk-edge);
|
|
103
|
+
box-shadow: var(--bk-shadow-control);
|
|
102
104
|
border-radius: var(--bk-radius-control);
|
|
103
105
|
background: transparent;
|
|
104
106
|
color: inherit;
|
|
105
107
|
font: inherit;
|
|
108
|
+
font-family: var(--bk-font-control, var(--bk-font));
|
|
106
109
|
cursor: pointer;
|
|
107
110
|
}
|
|
108
111
|
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
margin: auto;
|
|
13
13
|
overflow: auto;
|
|
14
14
|
padding: 1.25rem;
|
|
15
|
-
border:
|
|
15
|
+
border: var(--bk-border-width) solid var(--bk-edge);
|
|
16
|
+
box-shadow: var(--bk-shadow-overlay);
|
|
16
17
|
border-radius: var(--bk-radius);
|
|
17
18
|
background: Canvas;
|
|
18
19
|
color: var(--bk-ink);
|
|
@@ -110,7 +111,7 @@
|
|
|
110
111
|
[data-consent='age-input'] {
|
|
111
112
|
max-width: 8rem;
|
|
112
113
|
padding: 0.5rem 0.65rem;
|
|
113
|
-
border:
|
|
114
|
+
border: var(--bk-border-width) solid var(--bk-edge);
|
|
114
115
|
border-radius: var(--bk-radius-control);
|
|
115
116
|
background: var(--bk-surface);
|
|
116
117
|
color: inherit;
|
|
@@ -143,11 +144,13 @@
|
|
|
143
144
|
[data-consent='decline'],
|
|
144
145
|
[data-consent='later'] {
|
|
145
146
|
padding: 0.5rem 0.9rem;
|
|
146
|
-
border:
|
|
147
|
+
border: var(--bk-border-width) solid var(--bk-edge);
|
|
148
|
+
box-shadow: var(--bk-shadow-control);
|
|
147
149
|
border-radius: var(--bk-radius-control);
|
|
148
150
|
background: var(--bk-surface);
|
|
149
151
|
color: inherit;
|
|
150
152
|
font: inherit;
|
|
153
|
+
font-family: var(--bk-font-control, var(--bk-font));
|
|
151
154
|
cursor: pointer;
|
|
152
155
|
}
|
|
153
156
|
|
|
@@ -172,10 +175,10 @@
|
|
|
172
175
|
max-width: 36rem;
|
|
173
176
|
margin-inline: auto;
|
|
174
177
|
padding: 1rem;
|
|
175
|
-
border:
|
|
178
|
+
border: var(--bk-border-width) solid var(--bk-edge);
|
|
176
179
|
border-radius: var(--bk-radius);
|
|
177
180
|
background: Canvas;
|
|
178
181
|
color: var(--bk-ink);
|
|
179
|
-
box-shadow:
|
|
182
|
+
box-shadow: var(--bk-shadow-overlay);
|
|
180
183
|
}
|
|
181
184
|
}
|
|
@@ -25,22 +25,26 @@
|
|
|
25
25
|
[data-unsubscribe='leave'],
|
|
26
26
|
[data-unsubscribe='confirm'] {
|
|
27
27
|
padding: 0.5rem 1rem;
|
|
28
|
-
border:
|
|
28
|
+
border: var(--bk-border-width) solid var(--bk-accent);
|
|
29
|
+
box-shadow: var(--bk-shadow-control);
|
|
29
30
|
border-radius: var(--bk-radius-control);
|
|
30
31
|
background: var(--bk-accent);
|
|
31
32
|
color: var(--bk-on-accent);
|
|
32
33
|
font: inherit;
|
|
34
|
+
font-family: var(--bk-font-control, var(--bk-font));
|
|
33
35
|
font-weight: 600;
|
|
34
36
|
cursor: pointer;
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
[data-unsubscribe='leave-all'] {
|
|
38
40
|
padding: 0.5rem 1rem;
|
|
39
|
-
border:
|
|
41
|
+
border: var(--bk-border-width) solid var(--bk-edge);
|
|
42
|
+
box-shadow: var(--bk-shadow-control);
|
|
40
43
|
border-radius: var(--bk-radius-control);
|
|
41
44
|
background: transparent;
|
|
42
45
|
color: inherit;
|
|
43
46
|
font: inherit;
|
|
47
|
+
font-family: var(--bk-font-control, var(--bk-font));
|
|
44
48
|
cursor: pointer;
|
|
45
49
|
}
|
|
46
50
|
|
|
@@ -16,7 +16,7 @@ const props = defineProps<{
|
|
|
16
16
|
labels?: LabelGroupOverrides<'preferences'>
|
|
17
17
|
}>()
|
|
18
18
|
|
|
19
|
-
const page = useEmailLink(() => props.link, () => props.labels)
|
|
19
|
+
const page = useEmailLink(() => props.link, { labels: () => props.labels })
|
|
20
20
|
const { state, link: named, topicName, error, announcement, leave, confirm } = page
|
|
21
21
|
const { t } = page.labels
|
|
22
22
|
|
|
@@ -107,7 +107,7 @@ const { remember } = useOutcomeFocus(root, note, () => ['done', 'done-all', 'con
|
|
|
107
107
|
role="alert"
|
|
108
108
|
data-unsubscribe="error"
|
|
109
109
|
>
|
|
110
|
-
{{ error }}
|
|
110
|
+
{{ page.labels.errorMessage(error) }}
|
|
111
111
|
</p>
|
|
112
112
|
<span
|
|
113
113
|
role="status"
|