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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { readFileSync, existsSync, writeFileSync, lstatSync, readdirSync, mkdirSync, cpSync, unlinkSync, rmSync, symlinkSync, realpathSync, openSync, fstatSync, closeSync, writeSync, fchmodSync, renameSync } from 'node:fs';
|
|
1
|
+
import { readFileSync, existsSync, writeFileSync, lstatSync, readdirSync, mkdirSync, cpSync, unlinkSync, rmSync, symlinkSync, realpathSync, openSync, fstatSync, closeSync, writeSync, fchmodSync, renameSync, statSync } from 'node:fs';
|
|
2
2
|
import { join, dirname, basename, resolve, relative } from 'node:path';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
import { generateKeyPairSync, randomBytes, sign, createHash } from 'node:crypto';
|
|
@@ -35,6 +35,16 @@ const AI_FINDINGS = {
|
|
|
35
35
|
"ai-components": { title: "Chat and knowledge components", prod: "fail" },
|
|
36
36
|
// A sandbox (a public demo) makes no model call without a daily spend limit.
|
|
37
37
|
"ai-spend-limit": { title: "AI spend limit on a sandbox", prod: "fail" },
|
|
38
|
+
// --prod only, off a sandbox: setupAi's daily spendLimit, and the cap of each gateway the order sends calls through, which doctor does not read.
|
|
39
|
+
"ai-gateway-budget": { title: "AI gateway budget" },
|
|
40
|
+
// The default classifier through the Vercel AI Gateway reads text only: a check with images is refused.
|
|
41
|
+
"ai-moderation-images": { title: "Image checks and the safety classifier" },
|
|
42
|
+
// A named moderation provider without its keys, image checks with no known-abuse match, an Azure region outside the EU.
|
|
43
|
+
"ai-moderation-providers": { title: "Moderation providers", prod: "fail" },
|
|
44
|
+
"deployment-content-safety-endpoint": { title: "Deployment CONTENT_SAFETY_ENDPOINT", prod: "fail" },
|
|
45
|
+
"deployment-content-safety-key": { title: "Deployment CONTENT_SAFETY_KEY", prod: "fail" },
|
|
46
|
+
"deployment-second-opinion-key": { title: "Deployment SECOND_OPINION_KEY", prod: "fail" },
|
|
47
|
+
"deployment-known-abuse-key": { title: "Deployment KNOWN_ABUSE_KEY", prod: "fail" },
|
|
38
48
|
"deployment-ai-gateway-api-key": { title: "Deployment AI_GATEWAY_API_KEY", prod: "fail", fixable: true },
|
|
39
49
|
"deployment-provenance-private-key": { title: "Deployment PROVENANCE_PRIVATE_KEY", prod: "fail", fixable: true },
|
|
40
50
|
"deployment-provenance-certificate": { title: "Deployment PROVENANCE_CERTIFICATE", prod: "fail", fixable: true }
|
|
@@ -84,6 +94,12 @@ const BILLING_FINDINGS = {
|
|
|
84
94
|
"billing-portal": { title: "Customer portal" },
|
|
85
95
|
"billing-customer-emails": { title: "Customer emails", fixable: true },
|
|
86
96
|
"billing-team-customers": { title: "Team customers" },
|
|
97
|
+
// The provider's own checkout links that sell a catalog product: deleted in its dashboard, never by `doctor --fix`.
|
|
98
|
+
"billing-checkout-links": { title: "Provider checkout links" },
|
|
99
|
+
// The catalog's prices against the organization's default currency, which the provider wants on every product.
|
|
100
|
+
"billing-currency": { title: "Billing currency" },
|
|
101
|
+
// A plan product the sync found carries the credits and features the catalog gives its plan; `billing sync` attaches what is missing.
|
|
102
|
+
"billing-plan-benefits": { title: "Plan benefits" },
|
|
87
103
|
"billing-gift-twins": { title: "Gift products" },
|
|
88
104
|
"billing-pass-products": { title: "Plan pass products" },
|
|
89
105
|
"billing-feature-benefits": { title: "Feature benefits" },
|
|
@@ -91,7 +107,9 @@ const BILLING_FINDINGS = {
|
|
|
91
107
|
"billing-promotion-portal": { title: "Promotions and plan changes" },
|
|
92
108
|
"billing-provider-sdk": { title: "Billing provider SDK" },
|
|
93
109
|
// --prod only: the catalog against the production ids billing sync wrote.
|
|
94
|
-
"billing-catalog-production": { title: "Production catalog" }
|
|
110
|
+
"billing-catalog-production": { title: "Production catalog" },
|
|
111
|
+
// --prod only: whether billing sells on production yet (a token and a production catalog); before it does, the findings that only say so warn.
|
|
112
|
+
"billing-launch": { title: "Billing launch" }
|
|
95
113
|
};
|
|
96
114
|
|
|
97
115
|
const DEPLOYMENT_FINDINGS = {
|
|
@@ -135,6 +153,8 @@ const MONITORING_FINDINGS = {
|
|
|
135
153
|
"monitoring-backend-exceptions": { title: "Backend exception reporting" },
|
|
136
154
|
// --prod only: probed on the live site.
|
|
137
155
|
"monitoring-health": { title: "Health endpoint" },
|
|
156
|
+
// --prod only: not checked (doctor reads no monitoring account), once the health endpoint answers; says where to set one up.
|
|
157
|
+
"monitoring-uptime": { title: "Uptime monitor" },
|
|
138
158
|
// --prod only: production's usage limits, read with the Convex CLI.
|
|
139
159
|
"monitoring-usage-alerts": { title: "Usage alerts" }
|
|
140
160
|
};
|
|
@@ -165,6 +185,8 @@ const SCAFFOLD_FINDINGS = {
|
|
|
165
185
|
"paths-file": { title: "Paths file", fixable: true },
|
|
166
186
|
// The brand file the module writes from app.config, against app.config.
|
|
167
187
|
"brand-file": { title: "Brand file", fixable: true },
|
|
188
|
+
// The labels file the module writes from app.config, against app.config.
|
|
189
|
+
"labels-file": { title: "Labels file", fixable: true },
|
|
168
190
|
"dev-script": { title: "Dev script", fixable: true },
|
|
169
191
|
"convex-config": { title: "Mounts and routes", fixable: true },
|
|
170
192
|
"function-contract": { title: "Function contract", fixable: true },
|
|
@@ -258,6 +280,15 @@ const DEPLOYMENT_KIND_LABEL = {
|
|
|
258
280
|
"none": "no deployment configured"
|
|
259
281
|
};
|
|
260
282
|
|
|
283
|
+
const GATEWAY_KEY_FIX = {
|
|
284
|
+
dev: "Add AI_GATEWAY_API_KEY to .env.local and run `npx nuxt-backend env push`.",
|
|
285
|
+
prod: "Set production's own AI_GATEWAY_API_KEY on the deployment: `npx convex env set --prod AI_GATEWAY_API_KEY` (env push never sends .env.local's development key to production)."
|
|
286
|
+
};
|
|
287
|
+
const GATEWAY_ORDER_UNREAD = "Doctor cannot read the gateway order";
|
|
288
|
+
function gatewayKeyIsTheFix(finding) {
|
|
289
|
+
return finding.fixHint.startsWith(GATEWAY_KEY_FIX.dev) || finding.fixHint.startsWith(GATEWAY_KEY_FIX.prod);
|
|
290
|
+
}
|
|
291
|
+
|
|
261
292
|
function isSet(context, name) {
|
|
262
293
|
if (context.deployed) return context.deployed.has(name);
|
|
263
294
|
if (context.prod) return false;
|
|
@@ -304,12 +335,16 @@ function emailMode(context) {
|
|
|
304
335
|
return { state: "test", reason: environment ? `BACKEND_ENVIRONMENT is ${environment}: only the provider's test addresses receive mail` : "test mode: only the provider's test addresses receive mail" };
|
|
305
336
|
}
|
|
306
337
|
function modelMode(context) {
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
if (
|
|
310
|
-
|
|
338
|
+
const route = context.findings.find((finding) => finding.id === "deployment-ai-gateway-api-key");
|
|
339
|
+
if (route?.status !== "warn" && route?.status !== "fail") return null;
|
|
340
|
+
if (route.message.startsWith(GATEWAY_ORDER_UNREAD)) return null;
|
|
341
|
+
const why = gatewayKeyIsTheFix(route) && !isSet(context, "AI_GATEWAY_API_KEY") ? unsetReason(context, ["AI_GATEWAY_API_KEY"]) : "no gateway in setupAi({ gateway }) or a route of setupAi({ routes }) can serve this deployment";
|
|
342
|
+
return { state: "missing", reason: `its models are refused: ${why}` };
|
|
311
343
|
}
|
|
312
344
|
function billingMode(context) {
|
|
345
|
+
if (context.findings.some((finding) => finding.id === "billing-launch" && finding.status === "warn")) {
|
|
346
|
+
return { state: "missing", reason: 'not launched on production yet: nothing can be bought until it holds BILLING_ACCESS_TOKEN and a production catalog, and its pricing reads "Plans open soon"' };
|
|
347
|
+
}
|
|
313
348
|
if (!isSet(context, "BILLING_ACCESS_TOKEN")) return { state: "missing", reason: unsetReason(context, ["BILLING_ACCESS_TOKEN"]) };
|
|
314
349
|
const environment = environmentOf(context);
|
|
315
350
|
if (environment === null) return { state: "test", reason: "BACKEND_ENVIRONMENT is set on the deployment and its value was not read: taken as the sandbox" };
|
|
@@ -446,12 +481,13 @@ const CAPABILITIES = {
|
|
|
446
481
|
purpose: "Metered model calls and streams: each call reserves prepaid credits, runs the model by its provider/model id, then settles at the cost it reports.",
|
|
447
482
|
providers: [
|
|
448
483
|
{ name: "AI SDK", gives: "model calls and streams, by provider/model id" },
|
|
449
|
-
{ name: "
|
|
484
|
+
{ name: "Convex AI Gateway", gives: "every provider's models on a paid Convex plan, billed to the team with no key, and the cost of each call" },
|
|
485
|
+
{ name: "Vercel AI Gateway", gives: "one key for every provider's models, and the cost of each call; setupAi({ gateway }) picks between the two" },
|
|
450
486
|
{ name: "Convex persistent text streaming", gives: "streams that persist server-side and resume after a reload" },
|
|
451
487
|
{ name: "Polar", gives: "the credit meters each call spends" }
|
|
452
488
|
],
|
|
453
489
|
development: "the models themselves, through the Convex AI Gateway or a Vercel AI Gateway key, and credits from the billing sandbox",
|
|
454
|
-
env: ["AI_GATEWAY_API_KEY", "PROVENANCE_PRIVATE_KEY", "PROVENANCE_CERTIFICATE"],
|
|
490
|
+
env: ["AI_GATEWAY_API_KEY", "PROVENANCE_PRIVATE_KEY", "PROVENANCE_CERTIFICATE", "CONTENT_SAFETY_ENDPOINT", "CONTENT_SAFETY_KEY", "SECOND_OPINION_KEY", "KNOWN_ABUSE_KEY"],
|
|
455
491
|
findings: ["ai"],
|
|
456
492
|
docs: "/docs/build/ai",
|
|
457
493
|
devtools: "billing",
|
|
@@ -618,7 +654,7 @@ const BACKEND_ENV = {
|
|
|
618
654
|
},
|
|
619
655
|
BILLING_ACCESS_TOKEN: {
|
|
620
656
|
side: "deployment",
|
|
621
|
-
without:
|
|
657
|
+
without: 'billing reads answer empty; on production billing is not launched (the pricing reads "Plans open soon" and every sale is refused as not_launched), elsewhere a checkout is refused as not_configured',
|
|
622
658
|
values: "an organization access token of the billing provider: a sandbox token outside production, a live one on it",
|
|
623
659
|
dotenv: true,
|
|
624
660
|
findings: ["billing-access", "deployment-billing-access-token", "billing-organization"]
|
|
@@ -633,12 +669,44 @@ const BACKEND_ENV = {
|
|
|
633
669
|
},
|
|
634
670
|
AI_GATEWAY_API_KEY: {
|
|
635
671
|
side: "deployment",
|
|
636
|
-
without: "a provider/model id the backend names goes through the Convex AI Gateway alone, on Convex Cloud with a paid plan and @convex-dev/ai-sdk-provider installed; anywhere else (a free plan, a self-hosted deployment) it is refused when called",
|
|
637
|
-
values: "a Vercel AI Gateway API key:
|
|
672
|
+
without: "a provider/model id the backend names goes through the Convex AI Gateway alone, on Convex Cloud with a paid plan and @convex-dev/ai-sdk-provider installed; anywhere else (a free plan, a self-hosted deployment) it is refused when called. Under setupAi({ gateway: 'vercel' }) it is refused everywhere",
|
|
673
|
+
values: "a Vercel AI Gateway API key: read when setupAi({ gateway }) names 'vercel', as the default order does, after the Convex AI Gateway. Convex runs actions on its own servers, never on Vercel, so the gateway's keyless sign-in never reaches them",
|
|
638
674
|
dotenv: true,
|
|
639
675
|
whenFlagged: true,
|
|
640
676
|
findings: ["deployment-ai-gateway-api-key"]
|
|
641
677
|
},
|
|
678
|
+
CONTENT_SAFETY_ENDPOINT: {
|
|
679
|
+
side: "deployment",
|
|
680
|
+
dotenv: true,
|
|
681
|
+
whenFlagged: true,
|
|
682
|
+
without: "azureContentSafety() refuses every check it is asked for (`unavailable`, reason `not_configured`), so content it would check is refused as unchecked",
|
|
683
|
+
values: "your Azure AI Content Safety resource's endpoint, such as `https://<name>.cognitiveservices.azure.com`: the resource runs in the region you created it in, which `azureContentSafety({ region })` names",
|
|
684
|
+
findings: ["deployment-content-safety-endpoint"]
|
|
685
|
+
},
|
|
686
|
+
CONTENT_SAFETY_KEY: {
|
|
687
|
+
side: "deployment",
|
|
688
|
+
dotenv: true,
|
|
689
|
+
whenFlagged: true,
|
|
690
|
+
without: "as without CONTENT_SAFETY_ENDPOINT: the two call the resource together",
|
|
691
|
+
values: "a key of your Azure AI Content Safety resource (**Keys and Endpoint** in the Azure portal)",
|
|
692
|
+
findings: ["deployment-content-safety-key"]
|
|
693
|
+
},
|
|
694
|
+
SECOND_OPINION_KEY: {
|
|
695
|
+
side: "deployment",
|
|
696
|
+
dotenv: true,
|
|
697
|
+
whenFlagged: true,
|
|
698
|
+
without: "openaiModeration() refuses every check it is asked for, so a score in the gray band is refused as unchecked",
|
|
699
|
+
values: "an OpenAI API key, for its free moderation endpoint (`omni-moderation-latest`), asked only when a score sits just under its threshold",
|
|
700
|
+
findings: ["deployment-second-opinion-key"]
|
|
701
|
+
},
|
|
702
|
+
KNOWN_ABUSE_KEY: {
|
|
703
|
+
side: "deployment",
|
|
704
|
+
dotenv: true,
|
|
705
|
+
whenFlagged: true,
|
|
706
|
+
without: "arachnidShield() refuses every check, so every image the app moderates is refused as unchecked",
|
|
707
|
+
values: "your Project Arachnid Shield credentials, as `username:password`: the account the Canadian Centre for Child Protection gives a vetted organization",
|
|
708
|
+
findings: ["deployment-known-abuse-key"]
|
|
709
|
+
},
|
|
642
710
|
PROVENANCE_PRIVATE_KEY: {
|
|
643
711
|
side: "deployment",
|
|
644
712
|
whenFlagged: true,
|
|
@@ -749,7 +817,7 @@ function counts(name, context) {
|
|
|
749
817
|
const entry = BACKEND_ENV[name];
|
|
750
818
|
if (entry.devOnly) return false;
|
|
751
819
|
if (entry.whenFlagged) {
|
|
752
|
-
return context.findings.some((finding) => entry.findings.includes(finding.id) && (finding.status === "warn" || finding.status === "fail"));
|
|
820
|
+
return context.findings.some((finding) => entry.findings.includes(finding.id) && (finding.status === "warn" || finding.status === "fail") && (name !== "AI_GATEWAY_API_KEY" || gatewayKeyIsTheFix(finding)));
|
|
753
821
|
}
|
|
754
822
|
return entry.side !== "app" && (context.prod === true || !CAPABILITY_SWITCHES.includes(name));
|
|
755
823
|
}
|
|
@@ -815,9 +883,10 @@ const TASK_SKILLS = [
|
|
|
815
883
|
covers: "sign-in, sessions, passkeys, roles, user-scoped functions, workspaces and invitations, invite codes and the waitlist, the admin console with impersonation, the activity trail, consents, and account export and deletion",
|
|
816
884
|
docs: ["/docs/build/auth", "/docs/build/growth/launch"],
|
|
817
885
|
entrypoints: ["nuxt-backend/auth", "nuxt-backend/auth.config", "nuxt-backend/access", "nuxt-backend/audit", "nuxt-backend/account", "nuxt-backend/admin"],
|
|
818
|
-
composables: ["useAuth", "useLoginFlow", "useReturnPath", "useEmailChange", "useWorkspace", "usePasskeys", "useSessions", "useHumanCheck", "useReauthentication", "useAccessPhase", "useInvite", "useAccessAdmin", "useWaitlist", "useWaitlistAdmin", "useAuditLog", "useAccount", "useConsents", "useAdmin"],
|
|
886
|
+
composables: ["useAuth", "useLoginFlow", "useReturnPath", "useEmailChange", "useWorkspace", "usePasskeys", "useSessions", "useSignInAlerts", "useHumanCheck", "useReauthentication", "useAccessPhase", "useInvite", "useMemberTicket", "useAccessAdmin", "useWaitlist", "useWaitlistAdmin", "useAuditLog", "useAccount", "useConsents", "useAdmin"],
|
|
819
887
|
components: ["AuthForm", "WaitlistForm", "ConsentPrompt", "AccessDenied", "AcceptInvitation", "WorkspaceSettings", "ProfileSettings", "SecuritySettings", "ReauthenticateDialog", "AuditLog", "AccountData", "AdminUsers", "AdminWorkspaces"],
|
|
820
888
|
server: ["backendAuth"],
|
|
889
|
+
commands: ["access admit"],
|
|
821
890
|
findings: ["auth", "protection"],
|
|
822
891
|
functions: ["auth", "audit", "account", "admin"]
|
|
823
892
|
},
|
|
@@ -828,7 +897,7 @@ const TASK_SKILLS = [
|
|
|
828
897
|
entrypoints: ["nuxt-backend/billing"],
|
|
829
898
|
composables: ["useBilling", "useFeatures", "useCredits", "usePricing", "useOrders", "useUsage"],
|
|
830
899
|
components: ["PricingTable", "BillingCheckoutLink", "BillingPortalLink", "BillingHistory", "UsageHistory", "UpgradePrompt", "CancelFlow", "WithdrawalButton"],
|
|
831
|
-
commands: ["billing sync", "billing reset"],
|
|
900
|
+
commands: ["billing sync", "billing reset", "billing resync"],
|
|
832
901
|
findings: ["billing"],
|
|
833
902
|
functions: ["billing"]
|
|
834
903
|
},
|
|
@@ -836,7 +905,7 @@ const TASK_SKILLS = [
|
|
|
836
905
|
name: "nuxt-backend-growth",
|
|
837
906
|
covers: "launch phases, offers, referrals, gifts, lifecycle email and the funnel",
|
|
838
907
|
docs: ["/docs/build/growth"],
|
|
839
|
-
composables: ["useCampaign", "useGifts", "useOnboarding", "useActivation", "useExperiment", "useReferrals", "useReferralAdmin"],
|
|
908
|
+
composables: ["useCampaign", "useGifts", "useOnboarding", "useActivation", "useExperiment", "useReferrals", "useReferralInvite", "useReferralAdmin"],
|
|
840
909
|
components: ["OnboardingFlow", "ActivationChecklist", "HowDidYouHear", "ReferralCard"],
|
|
841
910
|
findings: ["analytics"]
|
|
842
911
|
},
|
|
@@ -845,7 +914,7 @@ const TASK_SKILLS = [
|
|
|
845
914
|
covers: "transactional email, templates, delivery tracking, the dev inbox and notifications",
|
|
846
915
|
docs: ["/docs/build/email", "/docs/develop/dev-inbox"],
|
|
847
916
|
entrypoints: ["nuxt-backend/email", "nuxt-backend/notifications"],
|
|
848
|
-
composables: ["useEmailStatus", "useSandboxInbox", "useNotifications", "useNotificationInbox", "useEmailPreferences", "usePushSubscription", "useAnnouncements", "useAnnouncementsAdmin", "useContactForm", "useInboxAdmin"],
|
|
917
|
+
composables: ["useEmailStatus", "useSandboxInbox", "useNotifications", "useNotificationInbox", "useEmailPreferences", "useEmailLink", "usePushSubscription", "useAnnouncements", "useAnnouncementsAdmin", "useContactForm", "useInboxAdmin"],
|
|
849
918
|
components: ["NotificationInbox", "ContactForm"],
|
|
850
919
|
commands: ["inbox", "email sync"],
|
|
851
920
|
findings: ["email", "notifications"],
|
|
@@ -881,7 +950,8 @@ const TASK_SKILLS = [
|
|
|
881
950
|
covers: "provider setup, tests, deploying, production checks, monitoring, flags and kill switches, webhooks and rate limits",
|
|
882
951
|
docs: ["/docs/services", "/docs/develop/testing", "/docs/ship"],
|
|
883
952
|
entrypoints: ["nuxt-backend/http", "nuxt-backend/rate-limit", "nuxt-backend/monitoring", "nuxt-backend/flags", "nuxt-backend/test", "nuxt-backend/test-utils", "nuxt-backend/eslint"],
|
|
884
|
-
composables: ["useFlag", "useFlagAdmin"],
|
|
953
|
+
composables: ["useFlag", "useFlagAdmin", "useReportForm"],
|
|
954
|
+
components: ["LegalProcessors", "LegalStorage", "LegalDetail", "LegalVersion", "LegalContactPoints", "LegalModeration"],
|
|
885
955
|
commands: ["doctor", "status", "env push", "env rotate", "deploy", "analyze", "mcp"],
|
|
886
956
|
findings: ["monitoring", "site"],
|
|
887
957
|
functions: ["flags", "webhooks"]
|
|
@@ -1281,6 +1351,13 @@ class ConvexCliError extends Error {
|
|
|
1281
1351
|
* whole stderr: the lines the message quotes are its list of the ones it has.
|
|
1282
1352
|
*/
|
|
1283
1353
|
missingFunction;
|
|
1354
|
+
/**
|
|
1355
|
+
* `convex run --component` named a component path the deployment does not
|
|
1356
|
+
* mount: the paths it does mount, read off the whole stderr, where the CLI
|
|
1357
|
+
* lists them (`[]` for a deployment that mounts none). `null` for any
|
|
1358
|
+
* other failure.
|
|
1359
|
+
*/
|
|
1360
|
+
components;
|
|
1284
1361
|
constructor(message, details) {
|
|
1285
1362
|
super(message);
|
|
1286
1363
|
this.name = "ConvexCliError";
|
|
@@ -1289,8 +1366,15 @@ class ConvexCliError extends Error {
|
|
|
1289
1366
|
this.timedOut = details.timedOut;
|
|
1290
1367
|
this.stderrTail = details.stderrTail;
|
|
1291
1368
|
this.missingFunction = details.missingFunction === true;
|
|
1369
|
+
this.components = details.components ?? null;
|
|
1292
1370
|
}
|
|
1293
1371
|
}
|
|
1372
|
+
function listedComponents(stderr) {
|
|
1373
|
+
const text = stripVTControlCharacters(stderr);
|
|
1374
|
+
if (!/Component path ".*" was not found/.test(text)) return null;
|
|
1375
|
+
const [, listing = ""] = text.split(/Available components:/);
|
|
1376
|
+
return listing.split(/\r?\n/).map((line) => /^\s*•\s*(\S+)\s*$/.exec(line)?.[1]).filter((path) => Boolean(path));
|
|
1377
|
+
}
|
|
1294
1378
|
const ENV_SUBCOMMANDS = /* @__PURE__ */ new Set(["set", "list", "get", "remove"]);
|
|
1295
1379
|
function commandName(args) {
|
|
1296
1380
|
const [first, second, third] = args;
|
|
@@ -1357,7 +1441,7 @@ function runConvex(rootDir, args, options = {}) {
|
|
|
1357
1441
|
}, timeout);
|
|
1358
1442
|
const fail = (how, code, signal) => {
|
|
1359
1443
|
const tail = stderrTail(stderr, options.input);
|
|
1360
|
-
reject(new ConvexCliError(tail ? `${command} ${how}: ${tail}` : `${command} ${how}`, { code, signal, timedOut, stderrTail: tail, missingFunction: /Could not find function for /.test(stderr) }));
|
|
1444
|
+
reject(new ConvexCliError(tail ? `${command} ${how}: ${tail}` : `${command} ${how}`, { code, signal, timedOut, stderrTail: tail, missingFunction: /Could not find function for /.test(stderr), components: listedComponents(stderr) }));
|
|
1361
1445
|
};
|
|
1362
1446
|
child.on("error", (error) => {
|
|
1363
1447
|
clearTimeout(timer);
|
|
@@ -1532,7 +1616,7 @@ function walk(node, visit, parent) {
|
|
|
1532
1616
|
if (key !== "loc" && key !== "comments" && !key.endsWith("Comments")) walk(value, visit, isNode ? candidate : parent);
|
|
1533
1617
|
}
|
|
1534
1618
|
}
|
|
1535
|
-
function keyOf(property) {
|
|
1619
|
+
function keyOf$1(property) {
|
|
1536
1620
|
const key = property.key;
|
|
1537
1621
|
if (!key) return void 0;
|
|
1538
1622
|
return key.type === "Identifier" ? key.name : key.type === "StringLiteral" ? key.value : void 0;
|
|
@@ -1550,14 +1634,23 @@ const INTEGRATION_DSN_ENV = "NEXT_PUBLIC_SENTRY_DSN";
|
|
|
1550
1634
|
function appMonitoringDsn(env) {
|
|
1551
1635
|
return env.MONITORING_DSN?.trim() || env[INTEGRATION_DSN_ENV]?.trim() || void 0;
|
|
1552
1636
|
}
|
|
1553
|
-
function
|
|
1637
|
+
function monitoringSdkVersion(rootDir) {
|
|
1554
1638
|
try {
|
|
1555
|
-
createRequire(join(rootDir, "package.json"))
|
|
1556
|
-
return
|
|
1639
|
+
const manifest = createRequire(join(rootDir, "package.json"))(`${MONITORING_SDK}/package.json`);
|
|
1640
|
+
return typeof manifest.version === "string" ? manifest.version : "0.0.0";
|
|
1557
1641
|
} catch {
|
|
1558
|
-
return
|
|
1642
|
+
return null;
|
|
1559
1643
|
}
|
|
1560
1644
|
}
|
|
1645
|
+
function monitoringSdkInstalled(rootDir) {
|
|
1646
|
+
return monitoringSdkVersion(rootDir) !== null;
|
|
1647
|
+
}
|
|
1648
|
+
const TUNNEL_SDK_VERSION = "11.10.0";
|
|
1649
|
+
function sdkServesTunnel(version) {
|
|
1650
|
+
const [major, minor] = (version ?? "").split(".").map((part) => Number.parseInt(part, 10));
|
|
1651
|
+
if (!Number.isFinite(major) || !Number.isFinite(minor)) return false;
|
|
1652
|
+
return major > 11 || major === 11 && minor >= 10;
|
|
1653
|
+
}
|
|
1561
1654
|
function deploysToVercel(rootDir, env) {
|
|
1562
1655
|
return Boolean(env.VERCEL) || existsSync(join(rootDir, ".vercel", "project.json"));
|
|
1563
1656
|
}
|
|
@@ -1571,7 +1664,16 @@ function monitoringDsnFinding(isSet, { prod }) {
|
|
|
1571
1664
|
"Add the DSN to .env.local and run `npx nuxt-backend env push --prod`."
|
|
1572
1665
|
);
|
|
1573
1666
|
}
|
|
1574
|
-
function appFinding(rootDir, env, { dsn,
|
|
1667
|
+
function appFinding(rootDir, env, { dsn, version, prod }) {
|
|
1668
|
+
const sdk = version !== null;
|
|
1669
|
+
if (dsn && sdk && !sdkServesTunnel(version)) {
|
|
1670
|
+
return finding(
|
|
1671
|
+
"monitoring-app",
|
|
1672
|
+
"warn",
|
|
1673
|
+
`${MONITORING_SDK} ${version} is older than ${TUNNEL_SDK_VERSION}: the browser reports straight to the ingest, which ad blockers drop, instead of through the managed tunnel on the app's own origin.`,
|
|
1674
|
+
`Upgrade it: npm install ${MONITORING_SDK}@^${TUNNEL_SDK_VERSION}. The module turns the tunnel on at the next build.`
|
|
1675
|
+
);
|
|
1676
|
+
}
|
|
1575
1677
|
if (dsn) {
|
|
1576
1678
|
return sdk ? finding("monitoring-app", "pass", `The browser and the Nuxt server report errors through ${MONITORING_SDK}.`) : finding("monitoring-app", "warn", `A DSN is set for the app, but ${MONITORING_SDK} is not installed: the browser and the Nuxt server report nothing.`, `Install it: npm install ${MONITORING_SDK}. The module wires it once it is there.`);
|
|
1577
1679
|
}
|
|
@@ -1588,8 +1690,9 @@ function appFinding(rootDir, env, { dsn, sdk, prod }) {
|
|
|
1588
1690
|
}
|
|
1589
1691
|
function monitoringFindings(rootDir, { env, deployed, prod }) {
|
|
1590
1692
|
const dsn = appMonitoringDsn(env);
|
|
1591
|
-
const
|
|
1592
|
-
const
|
|
1693
|
+
const version = monitoringSdkVersion(rootDir);
|
|
1694
|
+
const sdk = version !== null;
|
|
1695
|
+
const findings = [appFinding(rootDir, env, { dsn, version, prod })];
|
|
1593
1696
|
if (dsn && sdk && deploysToVercel(rootDir, env)) {
|
|
1594
1697
|
const unset = SOURCE_MAP_ENV.filter((name) => !env[name]);
|
|
1595
1698
|
findings.push(unset.length === 0 ? finding("monitoring-source-maps", "pass", "A Vercel build uploads its source maps: SENTRY_AUTH_TOKEN, SENTRY_ORG and SENTRY_PROJECT are set.") : finding(
|
|
@@ -1633,7 +1736,16 @@ function usageAlertsFinding(limits, { convexGateway }) {
|
|
|
1633
1736
|
return finding("monitoring-usage-alerts", "pass", `Production warns the team by email once usage passes its limits: ${[...warned].sort().join(", ")}.`);
|
|
1634
1737
|
}
|
|
1635
1738
|
|
|
1636
|
-
|
|
1739
|
+
function routeKeyFor(id, routes) {
|
|
1740
|
+
if (Object.hasOwn(routes, id)) return id;
|
|
1741
|
+
let best;
|
|
1742
|
+
for (const key of Object.keys(routes)) {
|
|
1743
|
+
if (key.endsWith("*") && id.startsWith(key.slice(0, -1)) && (best === void 0 || key.length > best.length)) best = key;
|
|
1744
|
+
}
|
|
1745
|
+
return best;
|
|
1746
|
+
}
|
|
1747
|
+
const DEFAULT_MODERATION_MODEL = "meta-llama/llama-guard-4-12b";
|
|
1748
|
+
const NAMED_MODEL = /\b(?:model|image)\s*(?::|\()\s*(['"`])([a-z0-9][a-z0-9-]*\/[^\s'"`]+)\1/gi;
|
|
1637
1749
|
|
|
1638
1750
|
const DEFAULT_AUTH_ROUTE = "/api/auth";
|
|
1639
1751
|
const RECENT_SIGN_IN_SECONDS = 600;
|
|
@@ -1659,6 +1771,7 @@ const DEFAULT_ADMIN_PATH = "/admin";
|
|
|
1659
1771
|
const HEALTH_ROUTE = "/api/backend/health";
|
|
1660
1772
|
const VISITOR_IP_ROUTE = "/api/backend/visitor-ip";
|
|
1661
1773
|
const LOCAL_LOG_ROUTE = "/api/backend/_monitoring";
|
|
1774
|
+
const RESYNC_ENTITLEMENTS_FUNCTION = "billing:resyncEntitlements";
|
|
1662
1775
|
|
|
1663
1776
|
const DEFAULT_BACKEND_PATHS = Object.freeze({
|
|
1664
1777
|
authRoute: DEFAULT_AUTH_ROUTE,
|
|
@@ -1759,6 +1872,141 @@ async function appBrandOf(config) {
|
|
|
1759
1872
|
}
|
|
1760
1873
|
}
|
|
1761
1874
|
|
|
1875
|
+
const LABELS_FILE = "labels.generated.ts";
|
|
1876
|
+
function keyOf(key) {
|
|
1877
|
+
return /^[A-Z_$][\w$]*$/i.test(key) ? key : quoted$1(key);
|
|
1878
|
+
}
|
|
1879
|
+
function treeLines(tree, indent) {
|
|
1880
|
+
return Object.entries(tree).flatMap(([key, value]) => typeof value === "string" ? [`${indent}${keyOf(key)}: ${quoted$1(value)},`] : [`${indent}${keyOf(key)}: {`, ...treeLines(value, `${indent} `), `${indent}},`]);
|
|
1881
|
+
}
|
|
1882
|
+
function renderLabelsFile(labels) {
|
|
1883
|
+
const lines = treeLines(labels, " ");
|
|
1884
|
+
return [
|
|
1885
|
+
"/* Generated by nuxt-backend from app.config (`backend.labels`) \u2014 do not edit. */",
|
|
1886
|
+
"// The Nuxt module rewrites this file whenever app.config changes a label, and the",
|
|
1887
|
+
"// backend reads it: email.ts passes `labels` on, so emails and notifications say what the pages say. Commit it.",
|
|
1888
|
+
lines.length === 0 ? "export const labels = {}" : "export const labels = {",
|
|
1889
|
+
...lines.length === 0 ? [] : [...lines, "}"],
|
|
1890
|
+
""
|
|
1891
|
+
].join("\n");
|
|
1892
|
+
}
|
|
1893
|
+
const IMPORT_DEPTH = 3;
|
|
1894
|
+
const MODULE_FILES = ["", ".ts", ".mts", ".js", ".mjs", "/index.ts", "/index.js"];
|
|
1895
|
+
function unwrapped(node) {
|
|
1896
|
+
let current = node;
|
|
1897
|
+
while (current && ["TSAsExpression", "TSSatisfiesExpression", "TSNonNullExpression", "ParenthesizedExpression", "TSTypeAssertion"].includes(current.type)) current = current.expression;
|
|
1898
|
+
return current;
|
|
1899
|
+
}
|
|
1900
|
+
function constOf(scope, name) {
|
|
1901
|
+
for (const statement of scope.body) {
|
|
1902
|
+
const declaration = statement.type === "ExportNamedDeclaration" ? statement.declaration : statement;
|
|
1903
|
+
if (declaration?.type !== "VariableDeclaration" || declaration.kind !== "const") continue;
|
|
1904
|
+
const found = declaration.declarations.find((entry) => entry.id.type === "Identifier" && entry.id.name === name);
|
|
1905
|
+
if (found) return found.init;
|
|
1906
|
+
}
|
|
1907
|
+
return void 0;
|
|
1908
|
+
}
|
|
1909
|
+
function importedScope(magicast, scope, specifier) {
|
|
1910
|
+
if (!specifier.startsWith(".") || scope.depth >= IMPORT_DEPTH) return void 0;
|
|
1911
|
+
const base = resolve(dirname(scope.file), specifier);
|
|
1912
|
+
const file = MODULE_FILES.map((extension) => `${base}${extension}`).find((candidate) => /\.[mc]?[jt]s$/.test(candidate) && statSync(candidate, { throwIfNoEntry: false })?.isFile());
|
|
1913
|
+
if (!file) return void 0;
|
|
1914
|
+
const program = parse(magicast, readFileSync(file, "utf-8"));
|
|
1915
|
+
if (typeof program === "string") return void 0;
|
|
1916
|
+
return { file, body: programBody(program), depth: scope.depth + 1 };
|
|
1917
|
+
}
|
|
1918
|
+
function importOf(scope, name) {
|
|
1919
|
+
for (const statement of scope.body) {
|
|
1920
|
+
if (statement.type !== "ImportDeclaration" || statement.importKind === "type") continue;
|
|
1921
|
+
const specifier = statement.specifiers.find((entry) => entry.local.name === name);
|
|
1922
|
+
if (specifier) return { source: statement.source.value, specifier };
|
|
1923
|
+
}
|
|
1924
|
+
return void 0;
|
|
1925
|
+
}
|
|
1926
|
+
function importedValue(magicast, scope, { source, specifier }) {
|
|
1927
|
+
const target = importedScope(magicast, scope, source);
|
|
1928
|
+
if (!target) return void 0;
|
|
1929
|
+
let node;
|
|
1930
|
+
if (specifier.type === "ImportDefaultSpecifier") node = target.body.find((entry) => entry.type === "ExportDefaultDeclaration")?.declaration;
|
|
1931
|
+
else if (specifier.type === "ImportSpecifier") {
|
|
1932
|
+
const imported = specifier.imported;
|
|
1933
|
+
node = constOf(target, imported.type === "Identifier" ? imported.name : imported.value);
|
|
1934
|
+
}
|
|
1935
|
+
return node ? { node, scope: target } : void 0;
|
|
1936
|
+
}
|
|
1937
|
+
function binding(magicast, scope, name) {
|
|
1938
|
+
const own = constOf(scope, name);
|
|
1939
|
+
if (own) return { node: own, scope };
|
|
1940
|
+
const imported = importOf(scope, name);
|
|
1941
|
+
return imported ? importedValue(magicast, scope, imported) : void 0;
|
|
1942
|
+
}
|
|
1943
|
+
const UNSAFE_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
1944
|
+
function keyName(entry) {
|
|
1945
|
+
if (entry.computed) return void 0;
|
|
1946
|
+
const key = entry.key;
|
|
1947
|
+
const name = key.type === "Identifier" ? key.name : key.type === "StringLiteral" ? key.value : void 0;
|
|
1948
|
+
return name === void 0 || UNSAFE_KEYS.has(name) ? void 0 : name;
|
|
1949
|
+
}
|
|
1950
|
+
function entryLabels(magicast, entry, scope, seen) {
|
|
1951
|
+
if (entry.type === "SpreadElement") {
|
|
1952
|
+
const spread = labelValue(magicast, entry.argument, scope, seen);
|
|
1953
|
+
return spread && typeof spread === "object" ? spread : {};
|
|
1954
|
+
}
|
|
1955
|
+
const key = entry.type === "ObjectProperty" ? keyName(entry) : void 0;
|
|
1956
|
+
if (key === void 0) return {};
|
|
1957
|
+
const read = labelValue(magicast, entry.value, scope, seen);
|
|
1958
|
+
return read !== void 0 && (typeof read === "string" || Object.keys(read).length > 0) ? { [key]: read } : {};
|
|
1959
|
+
}
|
|
1960
|
+
function labelValue(magicast, node, scope, seen) {
|
|
1961
|
+
const value = unwrapped(node);
|
|
1962
|
+
if (!value || seen.has(value)) return void 0;
|
|
1963
|
+
const text = literal(value);
|
|
1964
|
+
if (text !== void 0) return text;
|
|
1965
|
+
const inner = /* @__PURE__ */ new Set([...seen, value]);
|
|
1966
|
+
if (value.type === "Identifier") {
|
|
1967
|
+
const bound = binding(magicast, scope, value.name);
|
|
1968
|
+
return bound ? labelValue(magicast, bound.node, bound.scope, inner) : void 0;
|
|
1969
|
+
}
|
|
1970
|
+
if (value.type !== "ObjectExpression") return void 0;
|
|
1971
|
+
return Object.assign({}, ...value.properties.map((entry) => entryLabels(magicast, entry, scope, inner)));
|
|
1972
|
+
}
|
|
1973
|
+
function programBody(program) {
|
|
1974
|
+
return (program.program ?? program).body;
|
|
1975
|
+
}
|
|
1976
|
+
function labelsOfAppConfig(magicast, text, file) {
|
|
1977
|
+
const program = parse(magicast, text);
|
|
1978
|
+
if (typeof program === "string") return {};
|
|
1979
|
+
const scope = { file, body: programBody(program), depth: 0 };
|
|
1980
|
+
const backend = unwrapped(property(exportedObject(program.program ?? program), "backend"));
|
|
1981
|
+
const read = labelValue(magicast, property(backend, "labels"), scope, /* @__PURE__ */ new Set());
|
|
1982
|
+
return read && typeof read === "object" ? read : {};
|
|
1983
|
+
}
|
|
1984
|
+
function mergeUnder(into, layer) {
|
|
1985
|
+
for (const [key, value] of Object.entries(layer)) {
|
|
1986
|
+
if (UNSAFE_KEYS.has(key)) continue;
|
|
1987
|
+
const own = Object.hasOwn(into, key) ? into[key] : void 0;
|
|
1988
|
+
if (own === void 0) into[key] = typeof value === "string" ? value : structuredClone(value);
|
|
1989
|
+
else if (typeof own === "object" && typeof value === "object") mergeUnder(own, value);
|
|
1990
|
+
}
|
|
1991
|
+
}
|
|
1992
|
+
async function readAppLabels(srcDirs) {
|
|
1993
|
+
const magicast = await import('magicast');
|
|
1994
|
+
const labels = {};
|
|
1995
|
+
for (const dir of srcDirs) {
|
|
1996
|
+
const file = APP_CONFIG_FILES.map((name) => join(dir, name)).find(existsSync);
|
|
1997
|
+
if (file) mergeUnder(labels, labelsOfAppConfig(magicast, readFileSync(file, "utf-8"), file));
|
|
1998
|
+
}
|
|
1999
|
+
return labels;
|
|
2000
|
+
}
|
|
2001
|
+
async function appLabelsOf(config) {
|
|
2002
|
+
if (!config) return null;
|
|
2003
|
+
try {
|
|
2004
|
+
return await readAppLabels(brandSourceDirs(config));
|
|
2005
|
+
} catch {
|
|
2006
|
+
return null;
|
|
2007
|
+
}
|
|
2008
|
+
}
|
|
2009
|
+
|
|
1762
2010
|
function definePage(def) {
|
|
1763
2011
|
return def;
|
|
1764
2012
|
}
|
|
@@ -2102,11 +2350,14 @@ const FEATURE_FILE_TEMPLATES = {
|
|
|
2102
2350
|
// spendLimit is the most a UTC day of model calls may cost the whole app:
|
|
2103
2351
|
// past it, the pause_ai switch turns on until the day ends. Raise it as
|
|
2104
2352
|
// your app grows; a sandbox deployment, a public demo, refuses AI without one.
|
|
2353
|
+
// Model ids go through the Convex AI Gateway on a paid plan, else the Vercel
|
|
2354
|
+
// AI Gateway with AI_GATEWAY_API_KEY: \`gateway: 'convex'\` or \`'vercel'\`
|
|
2355
|
+
// picks one (https://nuxt-backend.dev/docs/services/ai-gateway#choose-a-gateway).
|
|
2105
2356
|
export const ai = setupAi(components, { billing, rateLimiter, spendLimit: { usdPerDay: 10 } })
|
|
2106
2357
|
|
|
2107
|
-
// What each person's AI calls cost
|
|
2108
|
-
// and
|
|
2109
|
-
export const { getCosts } = ai.api
|
|
2358
|
+
// What each person's AI calls cost, and what the safety classifier flagged:
|
|
2359
|
+
// the admin console's Costs and Moderation tabs read them, for administrators only.
|
|
2360
|
+
export const { getCosts, listModerationFlags } = ai.api
|
|
2110
2361
|
|
|
2111
2362
|
// A metered action — swap the echo for your model call. Costs 1 credit
|
|
2112
2363
|
// from the 'credits' meter per call (see billing.catalog.ts).
|
|
@@ -2174,12 +2425,13 @@ const FEATURE_FILE_TEMPLATES = {
|
|
|
2174
2425
|
// lifecycle (each resolves the caller's own billing entity), the order and
|
|
2175
2426
|
// usage history read live from the provider, the admin-only refund and
|
|
2176
2427
|
// revenue metrics (the admin console's Revenue view), the free plan every new
|
|
2177
|
-
// workspace starts on (internal; run by the workpool),
|
|
2428
|
+
// workspace starts on (internal; run by the workpool), the entitlement resync
|
|
2429
|
+
// (internal; \`nuxt-backend billing resync\` runs it), and the gift sweep
|
|
2178
2430
|
// (internal; woken by the component's cron, and scheduled for a gift dated
|
|
2179
2431
|
// for later).
|
|
2180
2432
|
export const {
|
|
2181
2433
|
getPricing, getConfiguredProducts, getBillingAccess, getFeatures, getCredits,
|
|
2182
|
-
getCurrentSubscription, listAllSubscriptions, syncEntitlements, syncProducts, startFreePlan,
|
|
2434
|
+
getCurrentSubscription, listAllSubscriptions, syncEntitlements, syncProducts, startFreePlan, resyncEntitlements,
|
|
2183
2435
|
generateCheckoutLink, generateCustomerPortalUrl,
|
|
2184
2436
|
updateSubscription, cancelSubscription, getCancelFlow, acceptSaveOffer, uncancelSubscription,
|
|
2185
2437
|
cancelPendingChange, pauseSubscription, resumeSubscription,
|
|
@@ -2222,6 +2474,7 @@ const FEATURE_FILE_TEMPLATES = {
|
|
|
2222
2474
|
import { components } from './_generated/api'
|
|
2223
2475
|
import { internalAction } from './_generated/server'
|
|
2224
2476
|
import { brand } from './brand.generated'
|
|
2477
|
+
import { labels } from './labels.generated'
|
|
2225
2478
|
import { paths } from './paths.generated'
|
|
2226
2479
|
|
|
2227
2480
|
// Transactional + marketing email over the backend component's email module.
|
|
@@ -2235,7 +2488,9 @@ const FEATURE_FILE_TEMPLATES = {
|
|
|
2235
2488
|
// \`paths\` (paths.generated.ts) is where an email's unsubscribe link opens, and
|
|
2236
2489
|
// \`brand\` (brand.generated.ts) the name, logo and postal address app.config
|
|
2237
2490
|
// declares (\`backend.brand\`): the emails name the app as its pages do.
|
|
2238
|
-
|
|
2491
|
+
// \`labels\` (labels.generated.ts) are the labels app.config sets
|
|
2492
|
+
// (\`backend.labels\`): emails, notification emails and push say what the pages say.
|
|
2493
|
+
export const email = setupEmail(components, { paths, brand, labels })
|
|
2239
2494
|
|
|
2240
2495
|
// The read behind useEmailStatus, and the DevTools Email tab's previews
|
|
2241
2496
|
// (internal: only the Convex CLI reaches them, on a dev deployment).
|
|
@@ -2341,7 +2596,8 @@ const FEATURE_FILE_TEMPLATES = {
|
|
|
2341
2596
|
// they allowed (PUSH_PUBLIC_KEY and PUSH_PRIVATE_KEY, which env push
|
|
2342
2597
|
// generates). An event of your own joins through notify: record it under
|
|
2343
2598
|
// \`app.\` with audit.recordBackendEvent, say what it becomes here, and give
|
|
2344
|
-
// its words as labels (
|
|
2599
|
+
// its words as labels (app.config's \`backend.labels.notifications\`, which reach
|
|
2600
|
+
// the email and the push through labels.generated.ts):
|
|
2345
2601
|
// notify: { 'app.project_archived': { channels: ['app', 'email', 'push'], link: event => \`/projects/\${event.targetId}\` } }
|
|
2346
2602
|
export const notifications = setupNotifications(components, { email, paths })
|
|
2347
2603
|
|
|
@@ -2560,7 +2816,9 @@ const BACKEND_FILE_TEMPLATES = {
|
|
|
2560
2816
|
// The paths nuxt.config declares, at their defaults until the module writes the app's own.
|
|
2561
2817
|
[PATHS_FILE]: renderPathsFile(DEFAULT_BACKEND_PATHS),
|
|
2562
2818
|
// The brand app.config declares, empty until the module writes the app's own.
|
|
2563
|
-
[BRAND_FILE]: renderBrandFile({})
|
|
2819
|
+
[BRAND_FILE]: renderBrandFile({}),
|
|
2820
|
+
// The labels app.config sets, empty until the module writes the app's own.
|
|
2821
|
+
[LABELS_FILE]: renderLabelsFile({})
|
|
2564
2822
|
};
|
|
2565
2823
|
const DEFAULT_LAYOUT_TEMPLATE = dedent(_a || (_a = __template(['\n <script setup lang="ts">\n // The frame of the app: the header with your brand, the workspace switcher,\n // the notification bell and the account menu, then the app-wide notices and\n // your page. Put your links in the `nav` slot, and your buttons before the\n // account menu in `actions`. `<AppShell :switcher="false">` hides the\n // switcher for an app whose people never share a workspace.\n const { brand } = useBackendConfig()\n <\/script>\n\n <template>\n <AppShell>\n <template #brand>\n <NuxtLink to="/">\n {{ brand.name || \'Your app\' }}\n </NuxtLink>\n </template>\n <slot />\n </AppShell>\n </template>\n '], ['\n <script setup lang="ts">\n // The frame of the app: the header with your brand, the workspace switcher,\n // the notification bell and the account menu, then the app-wide notices and\n // your page. Put your links in the \\`nav\\` slot, and your buttons before the\n // account menu in \\`actions\\`. \\`<AppShell :switcher="false">\\` hides the\n // switcher for an app whose people never share a workspace.\n const { brand } = useBackendConfig()\n <\/script>\n\n <template>\n <AppShell>\n <template #brand>\n <NuxtLink to="/">\n {{ brand.name || \'Your app\' }}\n </NuxtLink>\n </template>\n <slot />\n </AppShell>\n </template>\n ']))) + "\n";
|
|
2566
2824
|
|
|
@@ -2691,6 +2949,164 @@ function pinnedRegion(rootDir) {
|
|
|
2691
2949
|
}
|
|
2692
2950
|
return void 0;
|
|
2693
2951
|
}
|
|
2952
|
+
const GATEWAY_LIST = /^\s*(?:(['"`])(?:convex|vercel)\1\s*(?:,\s*)?)+$/;
|
|
2953
|
+
const GATEWAY_NAME = /['"`](convex|vercel)['"`]/g;
|
|
2954
|
+
const GATEWAY_LITERAL = /^(['"`])(convex|vercel)\1$/;
|
|
2955
|
+
function blanked(code) {
|
|
2956
|
+
const spaces = (token) => token.replace(/[^\n]/g, " ");
|
|
2957
|
+
const plain = code.replace(STRINGS_AND_COMMENTS, (token) => token.startsWith("/") ? spaces(token) : token);
|
|
2958
|
+
const bare = code.replace(STRINGS_AND_COMMENTS, (token) => token.startsWith("/") ? spaces(token) : token[0] + spaces(token.slice(1, -1)) + token.at(-1));
|
|
2959
|
+
return { plain, bare };
|
|
2960
|
+
}
|
|
2961
|
+
const OPEN = "([{";
|
|
2962
|
+
const CLOSE = ")]}";
|
|
2963
|
+
function closing(bare, at) {
|
|
2964
|
+
let depth = 0;
|
|
2965
|
+
for (let index = at; index < bare.length; index++) {
|
|
2966
|
+
if (OPEN.includes(bare[index])) depth++;
|
|
2967
|
+
else if (CLOSE.includes(bare[index]) && --depth === 0) return index;
|
|
2968
|
+
}
|
|
2969
|
+
return -1;
|
|
2970
|
+
}
|
|
2971
|
+
function topLevelParts(bare, from, to) {
|
|
2972
|
+
const parts = [];
|
|
2973
|
+
let depth = 0;
|
|
2974
|
+
let start = from + 1;
|
|
2975
|
+
for (let index = from + 1; index < to; index++) {
|
|
2976
|
+
const char = bare[index];
|
|
2977
|
+
if (OPEN.includes(char)) depth++;
|
|
2978
|
+
else if (CLOSE.includes(char)) depth--;
|
|
2979
|
+
else if (char === "," && depth === 0) {
|
|
2980
|
+
parts.push([start, index]);
|
|
2981
|
+
start = index + 1;
|
|
2982
|
+
}
|
|
2983
|
+
}
|
|
2984
|
+
if (bare.slice(start, to).trim()) parts.push([start, to]);
|
|
2985
|
+
return parts;
|
|
2986
|
+
}
|
|
2987
|
+
const OPTION_KEY = {
|
|
2988
|
+
gateway: /^(['"`]?)gateway\1\s*(:|$)/,
|
|
2989
|
+
routes: /^(['"`]?)routes\1\s*(:|$)/
|
|
2990
|
+
};
|
|
2991
|
+
function optionOfCall(plain, bare, open, name) {
|
|
2992
|
+
const close = closing(bare, open);
|
|
2993
|
+
if (close < 0) return "unread";
|
|
2994
|
+
const options = topLevelParts(bare, open, close)[1];
|
|
2995
|
+
if (!options) return void 0;
|
|
2996
|
+
const start = options[0] + (bare.slice(options[0], options[1]).length - bare.slice(options[0], options[1]).trimStart().length);
|
|
2997
|
+
if (bare[start] !== "{") return "unread";
|
|
2998
|
+
const end = closing(bare, start);
|
|
2999
|
+
let value;
|
|
3000
|
+
for (const [from, to] of topLevelParts(bare, start, end)) {
|
|
3001
|
+
if (bare.slice(from, to).trim().startsWith("...")) return "unread";
|
|
3002
|
+
const text = plain.slice(from, to).trim();
|
|
3003
|
+
const key = OPTION_KEY[name].exec(text);
|
|
3004
|
+
if (!key) continue;
|
|
3005
|
+
if (!key[2]) return "unread";
|
|
3006
|
+
value = text.slice(key[0].length).trim();
|
|
3007
|
+
}
|
|
3008
|
+
return value;
|
|
3009
|
+
}
|
|
3010
|
+
function orderOfCall(plain, bare, open) {
|
|
3011
|
+
const value = optionOfCall(plain, bare, open, "gateway");
|
|
3012
|
+
if (value === void 0 || value === "unread") return value;
|
|
3013
|
+
const single = GATEWAY_LITERAL.exec(value);
|
|
3014
|
+
if (single) return [single[2]];
|
|
3015
|
+
if (value.startsWith("[") && value.endsWith("]") && GATEWAY_LIST.test(value.slice(1, -1))) return [...new Set([...value.matchAll(GATEWAY_NAME)].map(([, name]) => name))];
|
|
3016
|
+
return "unread";
|
|
3017
|
+
}
|
|
3018
|
+
function chosenGateways(rootDir) {
|
|
3019
|
+
const orders = [];
|
|
3020
|
+
for (const code of backendSources(rootDir)) {
|
|
3021
|
+
const { plain, bare } = blanked(code);
|
|
3022
|
+
for (const call of bare.matchAll(/\bsetupAi\s*\(/g)) orders.push(orderOfCall(plain, bare, call.index + call[0].length - 1));
|
|
3023
|
+
}
|
|
3024
|
+
if (orders.includes("unread")) return "unread";
|
|
3025
|
+
const named = new Set(orders.map((order) => order?.join(",") ?? "convex,vercel"));
|
|
3026
|
+
if (named.size > 1) return "unread";
|
|
3027
|
+
return orders.find((order) => order !== void 0);
|
|
3028
|
+
}
|
|
3029
|
+
function valueEnd(bare, from) {
|
|
3030
|
+
let depth = 0;
|
|
3031
|
+
for (let index = from; index < bare.length; index++) {
|
|
3032
|
+
const char = bare[index];
|
|
3033
|
+
if (OPEN.includes(char)) depth++;
|
|
3034
|
+
else if (CLOSE.includes(char) && depth-- === 0) return index;
|
|
3035
|
+
else if (char === "," && depth === 0) return index;
|
|
3036
|
+
}
|
|
3037
|
+
return bare.length;
|
|
3038
|
+
}
|
|
3039
|
+
function checksImages(rootDir) {
|
|
3040
|
+
return backendSources(rootDir).some((code) => {
|
|
3041
|
+
const { bare } = blanked(code);
|
|
3042
|
+
for (const match of bare.matchAll(/\b(?:moderate|requireSafe)\s*([(:])/g)) {
|
|
3043
|
+
const at = match.index + match[0].length - 1;
|
|
3044
|
+
const end = match[1] === "(" ? closing(bare, at) : valueEnd(bare, at + 1);
|
|
3045
|
+
if (/\bimages\b/.test(bare.slice(at, end < 0 ? bare.length : end))) return true;
|
|
3046
|
+
}
|
|
3047
|
+
return false;
|
|
3048
|
+
});
|
|
3049
|
+
}
|
|
3050
|
+
function namesModerationModel(rootDir) {
|
|
3051
|
+
return backendSources(rootDir).some((code) => {
|
|
3052
|
+
const { bare } = blanked(code);
|
|
3053
|
+
for (const match of bare.matchAll(/\bmoderation\s*:\s*\{/g)) {
|
|
3054
|
+
const open = match.index + match[0].length - 1;
|
|
3055
|
+
if (/\bmodel\b/.test(bare.slice(open, closing(bare, open)))) return true;
|
|
3056
|
+
}
|
|
3057
|
+
return false;
|
|
3058
|
+
});
|
|
3059
|
+
}
|
|
3060
|
+
const ROUTE_ENTRY = /\s*(['"`])([^'"`/]+\/[^'"`]+)\1\s*:\s*(?:(['"`])(convex|vercel)\3|\[([^\]]*)\])\s*(?:,|$)/y;
|
|
3061
|
+
function routeEntries(body) {
|
|
3062
|
+
const routes = {};
|
|
3063
|
+
ROUTE_ENTRY.lastIndex = 0;
|
|
3064
|
+
while (ROUTE_ENTRY.lastIndex < body.length && body.slice(ROUTE_ENTRY.lastIndex).trim() !== "") {
|
|
3065
|
+
const at = ROUTE_ENTRY.lastIndex;
|
|
3066
|
+
const match = ROUTE_ENTRY.exec(body);
|
|
3067
|
+
if (!match || match.index !== at || match[5] !== void 0 && !GATEWAY_LIST.test(match[5])) return void 0;
|
|
3068
|
+
const names = match[4] ? [match[4]] : [...match[5].matchAll(GATEWAY_NAME)].map(([, name]) => name);
|
|
3069
|
+
routes[match[2]] = [...new Set(names)];
|
|
3070
|
+
}
|
|
3071
|
+
return Object.keys(routes).length === 0 ? void 0 : routes;
|
|
3072
|
+
}
|
|
3073
|
+
function routesOfCall(plain, bare, open) {
|
|
3074
|
+
const value = optionOfCall(plain, bare, open, "routes");
|
|
3075
|
+
if (value === void 0 || value === "unread") return value;
|
|
3076
|
+
if (!value.startsWith("{") || !value.endsWith("}")) return "unread";
|
|
3077
|
+
const body = value.slice(1, -1);
|
|
3078
|
+
if (body.trim() === "") return void 0;
|
|
3079
|
+
return routeEntries(body) ?? "unread";
|
|
3080
|
+
}
|
|
3081
|
+
function chosenRoutes(rootDir) {
|
|
3082
|
+
const found = [];
|
|
3083
|
+
for (const code of backendSources(rootDir)) {
|
|
3084
|
+
const { plain, bare } = blanked(code);
|
|
3085
|
+
for (const call of bare.matchAll(/\bsetupAi\s*\(/g)) found.push(routesOfCall(plain, bare, call.index + call[0].length - 1));
|
|
3086
|
+
}
|
|
3087
|
+
if (found.includes("unread")) return "unread";
|
|
3088
|
+
const named = found.filter((routes) => routes !== void 0);
|
|
3089
|
+
if (new Set(named.map((routes) => JSON.stringify(routes))).size > 1) return "unread";
|
|
3090
|
+
return named[0];
|
|
3091
|
+
}
|
|
3092
|
+
const MODERATION_FACTORIES = [
|
|
3093
|
+
[/\bazureContentSafety\s*\(/, { id: "azure-content-safety", env: ["CONTENT_SAFETY_ENDPOINT", "CONTENT_SAFETY_KEY"] }],
|
|
3094
|
+
[/\bopenaiModeration\s*\(/, { id: "openai-moderation", env: ["SECOND_OPINION_KEY"] }],
|
|
3095
|
+
[/\barachnidShield\s*\(/, { id: "arachnid-shield", env: ["KNOWN_ABUSE_KEY"] }]
|
|
3096
|
+
];
|
|
3097
|
+
const AZURE_REGION = /\bazureContentSafety\s*\(\s*\{[^}]*\bregion\s*:\s*(['"`])([\w-]+)\1/;
|
|
3098
|
+
function moderationProviders(rootDir) {
|
|
3099
|
+
const named = /* @__PURE__ */ new Map();
|
|
3100
|
+
for (const code of backendSources(rootDir)) {
|
|
3101
|
+
const { plain, bare } = blanked(code);
|
|
3102
|
+
for (const [call, provider] of MODERATION_FACTORIES) {
|
|
3103
|
+
if (!call.test(bare)) continue;
|
|
3104
|
+
const region = provider.id === "azure-content-safety" ? AZURE_REGION.exec(plain)?.[2] : void 0;
|
|
3105
|
+
named.set(provider.id, { ...provider, ...region ? { region } : {} });
|
|
3106
|
+
}
|
|
3107
|
+
}
|
|
3108
|
+
return [...named.values()];
|
|
3109
|
+
}
|
|
2694
3110
|
const PROVENANCE_ON = /\bprovenance\s*:(?!\s*(?:false|undefined)\b)|\.storeImage\s*\(/;
|
|
2695
3111
|
function usesProvenance(rootDir) {
|
|
2696
3112
|
return backendSources(rootDir).some((code) => PROVENANCE_ON.test(code.replace(STRINGS_AND_COMMENTS, (token) => token.startsWith("/") ? "" : token)));
|
|
@@ -2895,6 +3311,7 @@ function notForProduction(name, value) {
|
|
|
2895
3311
|
if (url?.protocol === "https:" && !isLoopbackUrl(url.href)) return null;
|
|
2896
3312
|
return `required \u2014 .env.local's SITE_URL (${value}) is no public https origin: pass production's with --site-url, or set it in the dashboard`;
|
|
2897
3313
|
}
|
|
3314
|
+
if (name === "AI_GATEWAY_API_KEY") return "production's own key, never .env.local's development one: create a key with a budget of its own and set it with `npx convex env set --prod AI_GATEWAY_API_KEY`";
|
|
2898
3315
|
if (name === "PROTECTION_PROOF_SECRET") return "production's own, never .env.local's: generate one (openssl rand -base64 32) and set it on the deployment and in the host's env";
|
|
2899
3316
|
if (name === "PROTECTION_CHALLENGE_SECRET_KEY" && TEST_CHALLENGE_SECRET_KEYS.includes(value.trim())) return ".env.local holds the challenge provider's test secret key, which passes every answer: set production's own key on the deployment";
|
|
2900
3317
|
return null;
|
|
@@ -3308,59 +3725,154 @@ function pathsFileFinding(rootDir, source) {
|
|
|
3308
3725
|
return [finding("paths-file", "warn", problems.join(" "), fixes.join(" "))];
|
|
3309
3726
|
}
|
|
3310
3727
|
|
|
3311
|
-
function
|
|
3728
|
+
function generatedFileLocation(rootDir, file) {
|
|
3312
3729
|
const functionsDir = resolveFunctionsDir(rootDir);
|
|
3313
|
-
return { name: `${functionsDir}/${
|
|
3730
|
+
return { name: `${functionsDir}/${file}`, path: join(rootDir, functionsDir, file) };
|
|
3314
3731
|
}
|
|
3315
|
-
function
|
|
3316
|
-
const { path } =
|
|
3732
|
+
function syncGeneratedFile(rootDir, file, text) {
|
|
3733
|
+
const { path } = generatedFileLocation(rootDir, file);
|
|
3317
3734
|
if (!existsSync(join(path, ".."))) return "no-functions-dir";
|
|
3318
|
-
const text = renderBrandFile(brand);
|
|
3319
3735
|
if (readTextIfPresent(path) === text) return "unchanged";
|
|
3320
3736
|
writeFileSync(path, text);
|
|
3321
3737
|
return "written";
|
|
3322
3738
|
}
|
|
3739
|
+
function generatedFileState(rootDir, file, text) {
|
|
3740
|
+
const { path } = generatedFileLocation(rootDir, file);
|
|
3741
|
+
if (!existsSync(join(path, ".."))) return null;
|
|
3742
|
+
const found = readTextIfPresent(path);
|
|
3743
|
+
return found === void 0 ? "missing" : found === text ? "current" : "stale";
|
|
3744
|
+
}
|
|
3745
|
+
function generatedFileFinding(rootDir, check) {
|
|
3746
|
+
const state = generatedFileState(rootDir, check.file, check.text);
|
|
3747
|
+
if (state === null) return [];
|
|
3748
|
+
const { name } = generatedFileLocation(rootDir, check.file);
|
|
3749
|
+
if (state === "current") return [finding(check.id, "pass", `${name} carries ${check.holds}.`)];
|
|
3750
|
+
const problem = state === "stale" ? `${name} is out of date with ${check.source}` : `${name} is missing`;
|
|
3751
|
+
return [finding(check.id, "warn", `${problem}: ${check.consequence}.`, "Run: npx nuxt-backend doctor --fix (or any `nuxt prepare`, `dev` or `build`), and deploy the functions.")];
|
|
3752
|
+
}
|
|
3753
|
+
|
|
3754
|
+
function brandFileLocation(rootDir) {
|
|
3755
|
+
return generatedFileLocation(rootDir, BRAND_FILE);
|
|
3756
|
+
}
|
|
3757
|
+
function syncBrandFile(rootDir, brand) {
|
|
3758
|
+
return syncGeneratedFile(rootDir, BRAND_FILE, renderBrandFile(brand));
|
|
3759
|
+
}
|
|
3323
3760
|
function brandFileFinding(rootDir, brand) {
|
|
3324
3761
|
if (!brand) return [];
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
return
|
|
3762
|
+
return generatedFileFinding(rootDir, { id: "brand-file", file: BRAND_FILE, text: renderBrandFile(brand), holds: "the brand app.config declares", source: `app.config's \`backend.brand\``, consequence: "the emails name the app otherwise than its pages" });
|
|
3763
|
+
}
|
|
3764
|
+
|
|
3765
|
+
function labelsFileLocation(rootDir) {
|
|
3766
|
+
return generatedFileLocation(rootDir, LABELS_FILE);
|
|
3767
|
+
}
|
|
3768
|
+
function syncLabelsFile(rootDir, labels) {
|
|
3769
|
+
return syncGeneratedFile(rootDir, LABELS_FILE, renderLabelsFile(labels));
|
|
3770
|
+
}
|
|
3771
|
+
function labelsFileFinding(rootDir, labels) {
|
|
3772
|
+
if (!labels) return [];
|
|
3773
|
+
return generatedFileFinding(rootDir, { id: "labels-file", file: LABELS_FILE, text: renderLabelsFile(labels), holds: "the labels app.config sets", source: `app.config's \`backend.labels\``, consequence: "emails and notifications say otherwise than the pages" });
|
|
3330
3774
|
}
|
|
3331
3775
|
|
|
3332
3776
|
const MANIFEST_ROUTE = "/manifest.webmanifest";
|
|
3333
|
-
const
|
|
3777
|
+
const INSTALL_SIZES = [192, 512];
|
|
3778
|
+
const ICON_SETS = [
|
|
3779
|
+
{ 192: "/icon-192.png", 512: "/icon-512.png" },
|
|
3780
|
+
{ 192: "/web-app-manifest-192x192.png", 512: "/web-app-manifest-512x512.png" }
|
|
3781
|
+
];
|
|
3782
|
+
const MASKABLE_ICONS = { 192: "/icon-maskable-192.png", 512: "/icon-maskable-512.png" };
|
|
3783
|
+
const APPLE_TOUCH_ICON = "/apple-touch-icon.png";
|
|
3334
3784
|
const OWN_MANIFESTS = ["manifest.webmanifest", "manifest.json", "site.webmanifest"];
|
|
3335
3785
|
const MANIFEST_MODULES = ["@vite-pwa/nuxt", "@kevinmarrec/nuxt-pwa", "nuxt-pwa-module"];
|
|
3336
|
-
|
|
3786
|
+
const fileOf = (publicDir, path) => join(publicDir, ...path.replace(/^\/+/, "").split("/"));
|
|
3787
|
+
const present = (publicDir, icons) => INSTALL_SIZES.every((size) => existsSync(fileOf(publicDir, icons[size])));
|
|
3788
|
+
function installIcons(publicDir, options = {}) {
|
|
3789
|
+
return options.icons ?? ICON_SETS.find((set) => present(publicDir, set)) ?? ICON_SETS[0];
|
|
3790
|
+
}
|
|
3791
|
+
function maskableIcons(publicDir, options = {}) {
|
|
3792
|
+
if (options.maskable === true) return installIcons(publicDir, options);
|
|
3793
|
+
if (options.maskable) return present(publicDir, options.maskable) ? options.maskable : null;
|
|
3794
|
+
if (options.maskable === false) return null;
|
|
3795
|
+
return present(publicDir, MASKABLE_ICONS) ? MASKABLE_ICONS : null;
|
|
3796
|
+
}
|
|
3797
|
+
function installableGaps(publicDir, brand, options = {}) {
|
|
3798
|
+
const icons = installIcons(publicDir, options);
|
|
3337
3799
|
return [
|
|
3338
|
-
...
|
|
3800
|
+
...INSTALL_SIZES.filter((size) => !existsSync(fileOf(publicDir, icons[size]))).map((size) => `public${icons[size]} (${size} \xD7 ${size} px)`),
|
|
3339
3801
|
...brand?.name ? [] : ["app.config's `backend.brand.name`"]
|
|
3340
3802
|
];
|
|
3341
3803
|
}
|
|
3342
|
-
function ownsManifest(publicDir, modules) {
|
|
3343
|
-
|
|
3804
|
+
function ownsManifest(publicDir, modules, links = []) {
|
|
3805
|
+
const linked = links.some((link) => typeof link === "object" && link !== null && String(link.rel).split(/\s+/).includes("manifest"));
|
|
3806
|
+
return linked || OWN_MANIFESTS.some((file) => existsSync(join(publicDir, file))) || modules.some((name) => MANIFEST_MODULES.includes(name));
|
|
3344
3807
|
}
|
|
3345
|
-
|
|
3808
|
+
const lightColor = (color) => typeof color === "string" ? color : color?.light;
|
|
3809
|
+
function webAppManifest(name, { icons = ICON_SETS[0], maskable = null, ...options } = {}) {
|
|
3810
|
+
const theme = lightColor(options.themeColor);
|
|
3811
|
+
const background = options.backgroundColor ?? theme;
|
|
3812
|
+
const entries = (pair, purpose) => INSTALL_SIZES.map((size) => ({ src: pair[size], sizes: `${size}x${size}`, type: "image/png", purpose }));
|
|
3346
3813
|
return {
|
|
3347
3814
|
name,
|
|
3348
3815
|
short_name: name,
|
|
3816
|
+
...options.description ? { description: options.description } : {},
|
|
3349
3817
|
start_url: "/",
|
|
3350
3818
|
scope: "/",
|
|
3351
3819
|
display: "standalone",
|
|
3352
|
-
|
|
3820
|
+
...theme ? { theme_color: theme } : {},
|
|
3821
|
+
...background ? { background_color: background } : {},
|
|
3822
|
+
icons: [...entries(icons, "any"), ...maskable ? entries(maskable, "maskable") : []]
|
|
3353
3823
|
};
|
|
3354
3824
|
}
|
|
3355
|
-
function
|
|
3356
|
-
if (
|
|
3357
|
-
|
|
3825
|
+
function themeColorMeta(color) {
|
|
3826
|
+
if (!color) return [];
|
|
3827
|
+
if (typeof color === "string") return [{ name: "theme-color", content: color }];
|
|
3828
|
+
return [
|
|
3829
|
+
{ name: "theme-color", content: color.light, media: "(prefers-color-scheme: light)" },
|
|
3830
|
+
{ name: "theme-color", content: color.dark, media: "(prefers-color-scheme: dark)" }
|
|
3831
|
+
];
|
|
3832
|
+
}
|
|
3833
|
+
function installableFinding(publicDir, brand, { modules, pushKeys, options, links }) {
|
|
3834
|
+
if (options === false || ownsManifest(publicDir, modules, links)) return [];
|
|
3835
|
+
const gaps = installableGaps(publicDir, brand, options);
|
|
3358
3836
|
if (gaps.length === 0) return [finding("installable", "pass", `The app is installable: the module serves ${MANIFEST_ROUTE} for ${brand.name}, with both icons.`)];
|
|
3359
|
-
const
|
|
3837
|
+
const icons = installIcons(publicDir, options);
|
|
3838
|
+
const reaching = INSTALL_SIZES.some((size) => existsSync(fileOf(publicDir, icons[size])));
|
|
3360
3839
|
const message = `The module adds no web app manifest: ${gaps.join(" and ")} ${gaps.length === 1 ? "is" : "are"} missing.${pushKeys ? " iPhone and iPad take web push only once the app is on the Home Screen." : ""}`;
|
|
3361
|
-
const fix =
|
|
3840
|
+
const fix = `Add two square PNG icons with a solid background to public/ (${INSTALL_SIZES.map((size) => icons[size].slice(1)).join(" and ")}), and set backend.brand.name in app.config.`;
|
|
3362
3841
|
return [finding("installable", reaching ? "warn" : "pass", reaching ? message : `Not installable yet (optional): ${gaps.join(" and ")} ${gaps.length === 1 ? "is" : "are"} missing.`, reaching ? fix : "")];
|
|
3363
3842
|
}
|
|
3843
|
+
const COLOR = /^(?:#[\da-f]{3,4}|#[\da-f]{6}|#[\da-f]{8}|[a-z]+|(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch|color)\([^()]*\))$/i;
|
|
3844
|
+
function isPublicPath(value) {
|
|
3845
|
+
return typeof value === "string" && /^\/(?![/\\])/.test(value) && !/^[a-z][\w+.-]*:/i.test(value) && !value.split(/[/\\]/).includes("..");
|
|
3846
|
+
}
|
|
3847
|
+
function pairProblems(key, pair) {
|
|
3848
|
+
if (!pair || typeof pair !== "object" || Array.isArray(pair)) return [`\`installable.${key}\` takes \`{ 192: '/icon-192.png', 512: '/icon-512.png' }\`.`];
|
|
3849
|
+
return INSTALL_SIZES.flatMap((size) => {
|
|
3850
|
+
const path = pair[size];
|
|
3851
|
+
if (path === void 0) return [`\`installable.${key}\` has no ${size} px icon: give both sizes.`];
|
|
3852
|
+
return isPublicPath(path) ? [] : [`\`installable.${key}[${size}]\` is ${JSON.stringify(path)}: give a path of a file in \`public/\`, with one leading \`/\`, never another origin.`];
|
|
3853
|
+
});
|
|
3854
|
+
}
|
|
3855
|
+
function installableProblems(value) {
|
|
3856
|
+
if (value === void 0 || value === false) return [];
|
|
3857
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return ["`installable` takes an object of options, or `false` for no manifest."];
|
|
3858
|
+
const options = value;
|
|
3859
|
+
const color = (key, color2) => typeof color2 === "string" && COLOR.test(color2.trim()) ? [] : [`\`installable.${key}\` is ${JSON.stringify(color2)}: give a CSS colour, such as '#ffb900'.`];
|
|
3860
|
+
const theme = options.themeColor;
|
|
3861
|
+
return [
|
|
3862
|
+
...theme === void 0 ? [] : typeof theme === "object" && theme !== null ? [...color("themeColor.light", theme.light), ...color("themeColor.dark", theme.dark)] : color("themeColor", theme),
|
|
3863
|
+
...options.backgroundColor === void 0 ? [] : color("backgroundColor", options.backgroundColor),
|
|
3864
|
+
...options.description === void 0 || typeof options.description === "string" ? [] : ["`installable.description` takes a string."],
|
|
3865
|
+
...options.icons === void 0 ? [] : pairProblems("icons", options.icons),
|
|
3866
|
+
...options.maskable === void 0 || typeof options.maskable === "boolean" ? [] : pairProblems("maskable", options.maskable)
|
|
3867
|
+
];
|
|
3868
|
+
}
|
|
3869
|
+
function namedIconWarnings(publicDir, options = {}) {
|
|
3870
|
+
const missing = (key, pair, outcome) => `\`installable.${key}\` names ${pair[192]} and ${pair[512]}, and public/ does not hold both: ${outcome}`;
|
|
3871
|
+
return [
|
|
3872
|
+
...options.icons && !present(publicDir, options.icons) ? [missing("icons", options.icons, "the module serves no manifest.")] : [],
|
|
3873
|
+
...typeof options.maskable === "object" && !present(publicDir, options.maskable) ? [missing("maskable", options.maskable, "the manifest lists no maskable icon.")] : []
|
|
3874
|
+
];
|
|
3875
|
+
}
|
|
3364
3876
|
|
|
3365
3877
|
const component = (entry) => ({ ...entry, kind: "component" });
|
|
3366
3878
|
const part = (entry) => ({ ...entry, kind: "part" });
|
|
@@ -3472,6 +3984,13 @@ const UI_ENTRIES = [
|
|
|
3472
3984
|
part({ name: "AccountMenu", parent: "AppShell", folder: "shell", capability: "auth" }),
|
|
3473
3985
|
part({ name: "WorkspaceSwitcher", parent: "AppShell", folder: "shell", capability: "auth" }),
|
|
3474
3986
|
component({ name: "AiLabel", folder: "shell", capability: "auth" }),
|
|
3987
|
+
// The legal pages' public parts, for a Content page of the app's: the tables read src/convex/legal.ts, styled by LegalDocument.css.
|
|
3988
|
+
component({ name: "LegalProcessors", folder: "shell", capability: "auth", unstyled: true, global: true }),
|
|
3989
|
+
component({ name: "LegalStorage", folder: "shell", capability: "auth", unstyled: true, global: true }),
|
|
3990
|
+
component({ name: "LegalDetail", folder: "shell", capability: "auth", unstyled: true, global: true }),
|
|
3991
|
+
component({ name: "LegalVersion", folder: "shell", capability: "auth", unstyled: true, global: true }),
|
|
3992
|
+
component({ name: "LegalContactPoints", folder: "shell", capability: "auth", unstyled: true, global: true }),
|
|
3993
|
+
component({ name: "LegalModeration", folder: "shell", capability: "auth", unstyled: true, global: true }),
|
|
3475
3994
|
internal("ErrorPage", "shell", "auth", { unstyled: true }),
|
|
3476
3995
|
internal("PageFrame", "shell", "auth")
|
|
3477
3996
|
];
|
|
@@ -3514,8 +4033,7 @@ const UI_INTERNALS = [
|
|
|
3514
4033
|
internal("ReportAppeal", "shell", "auth"),
|
|
3515
4034
|
internal("LegalDocument", "shell", "auth"),
|
|
3516
4035
|
internal("LegalDataMap", "shell", "auth", { unstyled: true }),
|
|
3517
|
-
internal("
|
|
3518
|
-
internal("LegalStorage", "shell", "auth", { unstyled: true }),
|
|
4036
|
+
internal("LegalCompany", "shell", "auth", { unstyled: true }),
|
|
3519
4037
|
internal("ReferralLanding", "billing", "billing"),
|
|
3520
4038
|
internal("ConsentPromptDialog", "account", "auth"),
|
|
3521
4039
|
internal("ConsentPromptItem", "account", "auth"),
|
|
@@ -3559,4 +4077,4 @@ const UI_SHARED_STYLES = [
|
|
|
3559
4077
|
{ file: "admin/admin.css", capability: "auth" }
|
|
3560
4078
|
];
|
|
3561
4079
|
|
|
3562
|
-
export {
|
|
4080
|
+
export { runEnvPush as $, brandFileLocation as A, BACKEND_ENV_NAMES as B, CAPABILITY_STATES as C, DERIVED_DEPLOYMENT_ENV as D, appLabelsOf as E, syncLabelsFile as F, labelsFileLocation as G, configuredDeployment as H, isDevDeploymentId as I, computeDeployment as J, appMonitoringDsn as K, monitoringSdkInstalled as L, MCP_SDK as M, detectCapabilities as N, DEPLOYMENT_KIND_LABEL as O, CAPABILITY_NAMES as P, REGISTERED_UI as Q, RESYNC_ENTITLEMENTS_FUNCTION as R, uiPath as S, BACKEND_PAGE_DEFS as T, installedVersion as U, packageDir as V, uiEntry as W, agentsMdVersion as X, packageVersion as Y, doctorReport as Z, formatPreflightSummary as _, deploymentEnvNames as a, finding as a$, devPushRefusal as a0, collectPreflightFindings as a1, OPTIONAL_DEPLOYMENT_ENV as a2, REQUIRED_DEPLOYMENT_ENV as a3, deriveDeploymentUrls as a4, provisionedEnvNames as a5, appComponentIsStarter as a6, resolveSiteUrl as a7, needsSetup as a8, AGENT_HINT as a9, MANIFEST_ROUTE as aA, APPLE_TOUCH_ICON as aB, themeColorMeta as aC, UI_SHARED_STYLES as aD, UI_ENTRIES as aE, UI_INTERNALS as aF, moduleDir as aG, VISITOR_IP_ROUTE as aH, resolvePagePath as aI, dependencyRange as aJ, runsFromSource as aK, resolveConvexCli as aL, RECENT_SIGN_IN_SECONDS as aM, BACKEND_ENV as aN, capabilityOfEnv as aO, REMOVED_DEPLOYMENT_ENV as aP, CAPABILITIES as aQ, mountPagesInAppComponent as aR, ensureDefaultLayout as aS, writeAgentFiles as aT, isDevDeployment as aU, RPC_NAMESPACE as aV, DEVTOOLS_UI_ROUTE as aW, DEVTOOLS_UI_LOCAL_PORT as aX, envNames as aY, DEV_ONLY_DEPLOYMENT_ENV as aZ, DEV_SITE_URL as a_, HEALTH_ROUTE as aa, LOCAL_LOG_ROUTE as ab, monitoringSdkVersion as ac, MONITORING_SDK as ad, TUNNEL_SDK_VERSION as ae, SOURCE_MAP_ENV as af, sdkServesTunnel as ag, installableProblems as ah, pagesOptionProblems as ai, resolvedBackendPages as aj, DEFAULT_AUTH_ROUTE as ak, publishedBackendPages as al, isPageOff as am, privatePagePaths as an, collectExistingPagePaths as ao, adoptChildPages as ap, pageRouteRules as aq, cachingRulesOver as ar, PUSH_WORKER_URL as as, ownsManifest as at, MANIFEST_MODULES as au, namedIconWarnings as av, installableGaps as aw, installIcons as ax, webAppManifest as ay, maskableIcons as az, deploymentBackendEnvironment as b, parseBackendEnvironment as b0, proofKeys as b1, TEST_CHALLENGE_SITE_KEYS as b2, deploymentEnvId as b3, protectionTakes as b4, TEST_CHALLENGE_SECRET_KEYS as b5, PROTECTED_AUTH_ROUTES as b6, PROOF_HEADER as b7, signProof as b8, proofAudience as b9, installableFinding as bA, gatewayKeyIsTheFix as bB, DEFAULT_MODERATION_MODEL as bC, mountsComponent as bD, GATEWAY_KEY_FIX as bE, isEnvProvisioned as bF, markEnvProvisioned as bG, readSource as bH, parse as bI, keyOf$1 as bJ, writeSource as bK, REMOVED_ENV as bL, applyEdits as bM, walk as bN, BACKEND_FILE_TEMPLATES as bO, deploymentSiteOrigin as ba, isLocalDeploymentId as bb, capabilityOfGroup as bc, agentFilesFinding as bd, chosenRoutes as be, chosenGateways as bf, pinnedRegion as bg, namedModels as bh, usesProvenance as bi, moderationProviders as bj, monitoringDsnFinding as bk, monitoringFindings as bl, usageAlertsFinding as bm, readUsageLimits as bn, applyProductionPosture as bo, billingWebhookSecretHint as bp, BACKEND_PATH_KEYS as bq, pathOption as br, aiFeatures as bs, pathsFileFinding as bt, brandFileFinding as bu, labelsFileFinding as bv, checksImages as bw, namesModerationModel as bx, GATEWAY_ORDER_UNREAD as by, routeKeyFor as bz, billingEnvironment as c, deploymentFunctionSpec as d, deployKeyType as e, runConvex as f, deploymentFlags as g, ConvexCliError as h, isHttpUrl as i, resolveFunctionsDir as j, readTextIfPresent as k, executeEnvPush as l, generateAuthSecret as m, nonProductionDeployKey as n, setDeploymentEnv as o, isLoopbackUrl as p, spawnConvex as q, readEnvFiles as r, siteFromCloudUrl as s, scaffoldBackendFiles as t, pathsSourceOf as u, syncPathsFile as v, backendPathsOf as w, pathsFileLocation as x, appBrandOf as y, syncBrandFile as z };
|