nuxt-backend 0.1.0 → 0.2.1
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/LICENSE +1 -1
- package/README.md +261 -657
- package/dist/analyze/types.js +4 -0
- package/dist/capabilities/detect.js +217 -0
- package/dist/capabilities/health.js +29 -0
- package/dist/capabilities/registry.js +205 -0
- package/dist/capabilities/status.js +61 -0
- package/dist/capabilities/types.js +19 -0
- package/dist/chunks/catalog.mjs +39 -0
- package/dist/chunks/doctor.mjs +3024 -0
- package/dist/chunks/email-previews.mjs +77 -0
- package/dist/chunks/health.mjs +35 -0
- package/dist/chunks/index.mjs +234 -0
- package/dist/chunks/install.mjs +63 -0
- package/dist/chunks/report.mjs +150 -0
- package/dist/chunks/run.mjs +318 -0
- package/dist/chunks/server.mjs +1012 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +3649 -0
- package/dist/convex/access-tickets.d.ts +134 -0
- package/dist/convex/access-tickets.d.ts.map +1 -0
- package/dist/convex/access-tickets.js +104 -0
- package/dist/convex/access-tickets.js.map +1 -0
- package/dist/convex/account-data.d.ts +455 -0
- package/dist/convex/account-data.d.ts.map +1 -0
- package/dist/convex/account-data.js +454 -0
- package/dist/convex/account-data.js.map +1 -0
- package/dist/convex/activation-rules.d.ts +89 -0
- package/dist/convex/activation-rules.d.ts.map +1 -0
- package/dist/convex/activation-rules.js +85 -0
- package/dist/convex/activation-rules.js.map +1 -0
- package/dist/convex/announcements.d.ts +50 -0
- package/dist/convex/announcements.d.ts.map +1 -0
- package/dist/convex/announcements.js +26 -0
- package/dist/convex/announcements.js.map +1 -0
- package/dist/convex/app.d.ts +107 -0
- package/dist/convex/app.d.ts.map +1 -0
- package/dist/convex/app.js +130 -0
- package/dist/convex/app.js.map +1 -0
- package/dist/convex/auth-secrets.d.ts +70 -0
- package/dist/convex/auth-secrets.d.ts.map +1 -0
- package/dist/convex/auth-secrets.js +102 -0
- package/dist/convex/auth-secrets.js.map +1 -0
- package/dist/convex/auth.config.d.ts +25 -1
- package/dist/convex/auth.config.d.ts.map +1 -1
- package/dist/convex/auth.config.js +20 -2
- package/dist/convex/auth.config.js.map +1 -1
- package/dist/convex/bytes.d.ts +3 -0
- package/dist/convex/bytes.d.ts.map +1 -0
- package/dist/convex/bytes.js +11 -0
- package/dist/convex/bytes.js.map +1 -0
- package/dist/convex/c2pa/cbor.d.ts +12 -0
- package/dist/convex/c2pa/cbor.d.ts.map +1 -0
- package/dist/convex/c2pa/cbor.js +81 -0
- package/dist/convex/c2pa/cbor.js.map +1 -0
- package/dist/convex/c2pa/der.d.ts +23 -0
- package/dist/convex/c2pa/der.d.ts.map +1 -0
- package/dist/convex/c2pa/der.js +88 -0
- package/dist/convex/c2pa/der.js.map +1 -0
- package/dist/convex/c2pa/formats.d.ts +25 -0
- package/dist/convex/c2pa/formats.d.ts.map +1 -0
- package/dist/convex/c2pa/formats.js +276 -0
- package/dist/convex/c2pa/formats.js.map +1 -0
- package/dist/convex/c2pa/jumbf.d.ts +16 -0
- package/dist/convex/c2pa/jumbf.d.ts.map +1 -0
- package/dist/convex/c2pa/jumbf.js +41 -0
- package/dist/convex/c2pa/jumbf.js.map +1 -0
- package/dist/convex/c2pa/manifest.d.ts +39 -0
- package/dist/convex/c2pa/manifest.d.ts.map +1 -0
- package/dist/convex/c2pa/manifest.js +161 -0
- package/dist/convex/c2pa/manifest.js.map +1 -0
- package/dist/convex/catalog.d.ts +481 -0
- package/dist/convex/catalog.d.ts.map +1 -0
- package/dist/convex/catalog.js +341 -0
- package/dist/convex/catalog.js.map +1 -0
- package/dist/convex/client/age-gate.d.ts +38 -0
- package/dist/convex/client/age-gate.d.ts.map +1 -0
- package/dist/convex/client/age-gate.js +129 -0
- package/dist/convex/client/age-gate.js.map +1 -0
- package/dist/convex/client/audit.d.ts +36 -0
- package/dist/convex/client/audit.d.ts.map +1 -0
- package/dist/convex/client/audit.js +278 -0
- package/dist/convex/client/audit.js.map +1 -0
- package/dist/convex/client/auth-types.d.ts +342 -0
- package/dist/convex/client/auth-types.d.ts.map +1 -0
- package/dist/convex/client/auth-types.js +2 -0
- package/dist/convex/client/auth-types.js.map +1 -0
- package/dist/convex/client/better-auth-options.d.ts +21 -0
- package/dist/convex/client/better-auth-options.d.ts.map +1 -0
- package/dist/convex/client/better-auth-options.js +478 -0
- package/dist/convex/client/better-auth-options.js.map +1 -0
- package/dist/convex/client/client-address.d.ts +21 -0
- package/dist/convex/client/client-address.d.ts.map +1 -0
- package/dist/convex/client/client-address.js +37 -0
- package/dist/convex/client/client-address.js.map +1 -0
- package/dist/convex/client/code-binding.d.ts +23 -0
- package/dist/convex/client/code-binding.d.ts.map +1 -0
- package/dist/convex/client/code-binding.js +100 -0
- package/dist/convex/client/code-binding.js.map +1 -0
- package/dist/convex/client/codes.d.ts +26 -0
- package/dist/convex/client/codes.d.ts.map +1 -0
- package/dist/convex/client/codes.js +46 -0
- package/dist/convex/client/codes.js.map +1 -0
- package/dist/convex/client/component.d.ts +185 -0
- package/dist/convex/client/component.d.ts.map +1 -0
- package/dist/convex/client/component.js +139 -0
- package/dist/convex/client/component.js.map +1 -0
- package/dist/convex/client/devices.d.ts +2 -0
- package/dist/convex/client/devices.d.ts.map +1 -0
- package/dist/convex/client/devices.js +188 -0
- package/dist/convex/client/devices.js.map +1 -0
- package/dist/convex/client/email.d.ts +10 -0
- package/dist/convex/client/email.d.ts.map +1 -0
- package/dist/convex/client/email.js +78 -0
- package/dist/convex/client/email.js.map +1 -0
- package/dist/convex/client/entities.d.ts +22 -0
- package/dist/convex/client/entities.d.ts.map +1 -0
- package/dist/convex/client/entities.js +82 -0
- package/dist/convex/client/entities.js.map +1 -0
- package/dist/convex/client/guards.d.ts +121 -0
- package/dist/convex/client/guards.d.ts.map +1 -0
- package/dist/convex/client/guards.js +874 -0
- package/dist/convex/client/guards.js.map +1 -0
- package/dist/convex/client/guest-claim.d.ts +21 -0
- package/dist/convex/client/guest-claim.d.ts.map +1 -0
- package/dist/convex/client/guest-claim.js +45 -0
- package/dist/convex/client/guest-claim.js.map +1 -0
- package/dist/convex/client/hooks.d.ts +23 -0
- package/dist/convex/client/hooks.d.ts.map +1 -0
- package/dist/convex/client/hooks.js +69 -0
- package/dist/convex/client/hooks.js.map +1 -0
- package/dist/convex/client/identity.d.ts +3 -0
- package/dist/convex/client/identity.d.ts.map +1 -0
- package/dist/convex/client/identity.js +8 -0
- package/dist/convex/client/identity.js.map +1 -0
- package/dist/convex/client/index.d.ts +1847 -11538
- package/dist/convex/client/index.d.ts.map +1 -1
- package/dist/convex/client/index.js +226 -200
- package/dist/convex/client/index.js.map +1 -1
- package/dist/convex/client/launch-gate.d.ts +69 -0
- package/dist/convex/client/launch-gate.d.ts.map +1 -0
- package/dist/convex/client/launch-gate.js +212 -0
- package/dist/convex/client/launch-gate.js.map +1 -0
- package/dist/convex/client/notices.d.ts +11 -0
- package/dist/convex/client/notices.d.ts.map +1 -0
- package/dist/convex/client/notices.js +38 -0
- package/dist/convex/client/notices.js.map +1 -0
- package/dist/convex/client/passkey-only.d.ts +86 -0
- package/dist/convex/client/passkey-only.d.ts.map +1 -0
- package/dist/convex/client/passkey-only.js +339 -0
- package/dist/convex/client/passkey-only.js.map +1 -0
- package/dist/convex/client/plugins.d.ts +1686 -0
- package/dist/convex/client/plugins.d.ts.map +1 -0
- package/dist/convex/client/plugins.js +185 -0
- package/dist/convex/client/plugins.js.map +1 -0
- package/dist/convex/client/refusals.d.ts +16 -0
- package/dist/convex/client/refusals.d.ts.map +1 -0
- package/dist/convex/client/refusals.js +32 -0
- package/dist/convex/client/refusals.js.map +1 -0
- package/dist/convex/client/request-origin.d.ts +13 -0
- package/dist/convex/client/request-origin.d.ts.map +1 -0
- package/dist/convex/client/request-origin.js +99 -0
- package/dist/convex/client/request-origin.js.map +1 -0
- package/dist/convex/client/request-session.d.ts +33 -0
- package/dist/convex/client/request-session.d.ts.map +1 -0
- package/dist/convex/client/request-session.js +62 -0
- package/dist/convex/client/request-session.js.map +1 -0
- package/dist/convex/client/runtime.d.ts +93 -0
- package/dist/convex/client/runtime.d.ts.map +1 -0
- package/dist/convex/client/runtime.js +10 -0
- package/dist/convex/client/runtime.js.map +1 -0
- package/dist/convex/client/secret-rotation.d.ts +16 -0
- package/dist/convex/client/secret-rotation.d.ts.map +1 -0
- package/dist/convex/client/secret-rotation.js +113 -0
- package/dist/convex/client/secret-rotation.js.map +1 -0
- package/dist/convex/client/sessions.d.ts +28 -0
- package/dist/convex/client/sessions.d.ts.map +1 -0
- package/dist/convex/client/sessions.js +36 -0
- package/dist/convex/client/sessions.js.map +1 -0
- package/dist/convex/client/workspaces.d.ts +40 -0
- package/dist/convex/client/workspaces.d.ts.map +1 -0
- package/dist/convex/client/workspaces.js +110 -0
- package/dist/convex/client/workspaces.js.map +1 -0
- package/dist/convex/components/backend/_generated/api.d.ts +116 -0
- package/dist/convex/components/backend/_generated/api.d.ts.map +1 -0
- package/dist/convex/components/backend/_generated/api.js.map +1 -0
- package/dist/convex/components/backend/_generated/component.d.ts +3881 -0
- package/dist/convex/components/backend/_generated/component.d.ts.map +1 -0
- package/dist/convex/components/backend/_generated/component.js.map +1 -0
- package/dist/convex/components/backend/_generated/dataModel.d.ts.map +1 -0
- package/dist/convex/components/backend/_generated/dataModel.js.map +1 -0
- package/dist/convex/components/backend/_generated/server.d.ts +138 -0
- package/dist/convex/components/backend/_generated/server.d.ts.map +1 -0
- package/dist/convex/components/backend/_generated/server.js +80 -0
- package/dist/convex/components/backend/_generated/server.js.map +1 -0
- package/dist/convex/components/backend/access.d.ts +188 -0
- package/dist/convex/components/backend/access.d.ts.map +1 -0
- package/dist/convex/components/backend/access.js +428 -0
- package/dist/convex/components/backend/access.js.map +1 -0
- package/dist/convex/components/backend/account.d.ts +626 -0
- package/dist/convex/components/backend/account.d.ts.map +1 -0
- package/dist/convex/components/backend/account.js +1017 -0
- package/dist/convex/components/backend/account.js.map +1 -0
- package/dist/convex/components/backend/adapter.d.ts.map +1 -0
- package/dist/convex/components/backend/adapter.js +45 -0
- package/dist/convex/components/backend/adapter.js.map +1 -0
- package/dist/convex/components/backend/ai.d.ts +218 -0
- package/dist/convex/components/backend/ai.d.ts.map +1 -0
- package/dist/convex/components/backend/ai.js +348 -0
- package/dist/convex/components/backend/ai.js.map +1 -0
- package/dist/convex/components/backend/alerts.d.ts +87 -0
- package/dist/convex/components/backend/alerts.d.ts.map +1 -0
- package/dist/convex/components/backend/alerts.js +182 -0
- package/dist/convex/components/backend/alerts.js.map +1 -0
- package/dist/convex/components/backend/announcements.d.ts +155 -0
- package/dist/convex/components/backend/announcements.d.ts.map +1 -0
- package/dist/convex/components/backend/announcements.js +253 -0
- package/dist/convex/components/backend/announcements.js.map +1 -0
- package/dist/convex/components/backend/audit.d.ts +185 -0
- package/dist/convex/components/backend/audit.d.ts.map +1 -0
- package/dist/convex/components/backend/audit.js +315 -0
- package/dist/convex/components/backend/audit.js.map +1 -0
- package/dist/convex/components/backend/billing.d.ts +345 -0
- package/dist/convex/components/backend/billing.d.ts.map +1 -0
- package/dist/convex/components/backend/billing.js +720 -0
- package/dist/convex/components/backend/billing.js.map +1 -0
- package/dist/convex/components/backend/consents.d.ts +121 -0
- package/dist/convex/components/backend/consents.d.ts.map +1 -0
- package/dist/convex/components/backend/consents.js +149 -0
- package/dist/convex/components/backend/consents.js.map +1 -0
- package/dist/convex/components/backend/convex.config.d.ts +60 -0
- package/dist/convex/components/backend/convex.config.d.ts.map +1 -0
- package/dist/convex/components/backend/convex.config.js +73 -0
- package/dist/convex/components/backend/convex.config.js.map +1 -0
- package/dist/convex/components/backend/costs.d.ts +130 -0
- package/dist/convex/components/backend/costs.d.ts.map +1 -0
- package/dist/convex/components/backend/costs.js +260 -0
- package/dist/convex/components/backend/costs.js.map +1 -0
- package/dist/convex/components/backend/crons.d.ts +3 -0
- package/dist/convex/components/backend/crons.d.ts.map +1 -0
- package/dist/convex/components/backend/crons.js +22 -0
- package/dist/convex/components/backend/crons.js.map +1 -0
- package/dist/convex/components/backend/devices.d.ts +67 -0
- package/dist/convex/components/backend/devices.d.ts.map +1 -0
- package/dist/convex/components/backend/devices.js +184 -0
- package/dist/convex/components/backend/devices.js.map +1 -0
- package/dist/convex/components/backend/email.d.ts +304 -0
- package/dist/convex/components/backend/email.d.ts.map +1 -0
- package/dist/convex/components/backend/email.js +628 -0
- package/dist/convex/components/backend/email.js.map +1 -0
- package/dist/convex/components/backend/erasures.d.ts +41 -0
- package/dist/convex/components/backend/erasures.d.ts.map +1 -0
- package/dist/convex/components/backend/erasures.js +70 -0
- package/dist/convex/components/backend/erasures.js.map +1 -0
- package/dist/convex/components/backend/flags.d.ts +56 -0
- package/dist/convex/components/backend/flags.d.ts.map +1 -0
- package/dist/convex/components/backend/flags.js +81 -0
- package/dist/convex/components/backend/flags.js.map +1 -0
- package/dist/convex/components/backend/funnel.d.ts +452 -0
- package/dist/convex/components/backend/funnel.d.ts.map +1 -0
- package/dist/convex/components/backend/funnel.js +525 -0
- package/dist/convex/components/backend/funnel.js.map +1 -0
- package/dist/convex/components/backend/gifts.d.ts +438 -0
- package/dist/convex/components/backend/gifts.d.ts.map +1 -0
- package/dist/convex/components/backend/gifts.js +716 -0
- package/dist/convex/components/backend/gifts.js.map +1 -0
- package/dist/convex/components/backend/inbound.d.ts +121 -0
- package/dist/convex/components/backend/inbound.d.ts.map +1 -0
- package/dist/convex/components/backend/inbound.js +367 -0
- package/dist/convex/components/backend/inbound.js.map +1 -0
- package/dist/convex/components/backend/jobs.d.ts +785 -0
- package/dist/convex/components/backend/jobs.d.ts.map +1 -0
- package/dist/convex/components/backend/jobs.js +912 -0
- package/dist/convex/components/backend/jobs.js.map +1 -0
- package/dist/convex/components/backend/keys.d.ts +9 -0
- package/dist/convex/components/backend/keys.d.ts.map +1 -0
- package/dist/convex/components/backend/keys.js +49 -0
- package/dist/convex/components/backend/keys.js.map +1 -0
- package/dist/convex/components/backend/lifecycle.d.ts +123 -0
- package/dist/convex/components/backend/lifecycle.d.ts.map +1 -0
- package/dist/convex/components/backend/lifecycle.js +341 -0
- package/dist/convex/components/backend/lifecycle.js.map +1 -0
- package/dist/convex/components/backend/lifecycleActivity.d.ts +9 -0
- package/dist/convex/components/backend/lifecycleActivity.d.ts.map +1 -0
- package/dist/convex/components/backend/lifecycleActivity.js +31 -0
- package/dist/convex/components/backend/lifecycleActivity.js.map +1 -0
- package/dist/convex/components/backend/maintenance.d.ts +115 -0
- package/dist/convex/components/backend/maintenance.d.ts.map +1 -0
- package/dist/convex/components/backend/maintenance.js +428 -0
- package/dist/convex/components/backend/maintenance.js.map +1 -0
- package/dist/convex/components/backend/migrations.d.ts +47 -0
- package/dist/convex/components/backend/migrations.d.ts.map +1 -0
- package/dist/convex/components/backend/migrations.js +115 -0
- package/dist/convex/components/backend/migrations.js.map +1 -0
- package/dist/convex/components/backend/monitoring.d.ts +29 -0
- package/dist/convex/components/backend/monitoring.d.ts.map +1 -0
- package/dist/convex/components/backend/monitoring.js +56 -0
- package/dist/convex/components/backend/monitoring.js.map +1 -0
- package/dist/convex/components/backend/notifications.d.ts +270 -0
- package/dist/convex/components/backend/notifications.d.ts.map +1 -0
- package/dist/convex/components/backend/notifications.js +460 -0
- package/dist/convex/components/backend/notifications.js.map +1 -0
- package/dist/convex/components/backend/onboarding.d.ts +16 -0
- package/dist/convex/components/backend/onboarding.d.ts.map +1 -0
- package/dist/convex/components/backend/onboarding.js +51 -0
- package/dist/convex/components/backend/onboarding.js.map +1 -0
- package/dist/convex/components/backend/parties.d.ts +39 -0
- package/dist/convex/components/backend/parties.d.ts.map +1 -0
- package/dist/convex/components/backend/parties.js +66 -0
- package/dist/convex/components/backend/parties.js.map +1 -0
- package/dist/convex/components/backend/posture.d.ts +3 -0
- package/dist/convex/components/backend/posture.d.ts.map +1 -0
- package/dist/convex/components/backend/posture.js +33 -0
- package/dist/convex/components/backend/posture.js.map +1 -0
- package/dist/convex/components/backend/preferences.d.ts +343 -0
- package/dist/convex/components/backend/preferences.d.ts.map +1 -0
- package/dist/convex/components/backend/preferences.js +684 -0
- package/dist/convex/components/backend/preferences.js.map +1 -0
- package/dist/convex/components/backend/push.d.ts +56 -0
- package/dist/convex/components/backend/push.d.ts.map +1 -0
- package/dist/convex/components/backend/push.js +91 -0
- package/dist/convex/components/backend/push.js.map +1 -0
- package/dist/convex/components/backend/referrals.d.ts +277 -0
- package/dist/convex/components/backend/referrals.d.ts.map +1 -0
- package/dist/convex/components/backend/referrals.js +708 -0
- package/dist/convex/components/backend/referrals.js.map +1 -0
- package/dist/convex/components/backend/reports.d.ts +218 -0
- package/dist/convex/components/backend/reports.d.ts.map +1 -0
- package/dist/convex/components/backend/reports.js +598 -0
- package/dist/convex/components/backend/reports.js.map +1 -0
- package/dist/convex/components/backend/schema.d.ts +7078 -0
- package/dist/convex/components/backend/schema.d.ts.map +1 -0
- package/dist/convex/components/backend/schema.js +2091 -0
- package/dist/convex/components/backend/schema.js.map +1 -0
- package/dist/convex/components/backend/storage.d.ts +236 -0
- package/dist/convex/components/backend/storage.d.ts.map +1 -0
- package/dist/convex/components/backend/storage.js +679 -0
- package/dist/convex/components/backend/storage.js.map +1 -0
- package/dist/convex/components/backend/subscriptions.d.ts +185 -0
- package/dist/convex/components/backend/subscriptions.d.ts.map +1 -0
- package/dist/convex/components/backend/subscriptions.js +230 -0
- package/dist/convex/components/backend/subscriptions.js.map +1 -0
- package/dist/convex/components/backend/suppressions.d.ts +68 -0
- package/dist/convex/components/backend/suppressions.d.ts.map +1 -0
- package/dist/convex/components/backend/suppressions.js +107 -0
- package/dist/convex/components/backend/suppressions.js.map +1 -0
- package/dist/convex/components/backend/waitlist.d.ts +202 -0
- package/dist/convex/components/backend/waitlist.d.ts.map +1 -0
- package/dist/convex/components/backend/waitlist.js +693 -0
- package/dist/convex/components/backend/waitlist.js.map +1 -0
- package/dist/convex/components/backend/wake.d.ts +2 -0
- package/dist/convex/components/backend/wake.d.ts.map +1 -0
- package/dist/convex/components/backend/wake.js +14 -0
- package/dist/convex/components/backend/wake.js.map +1 -0
- package/dist/convex/components/backend/webhooks.d.ts +63 -0
- package/dist/convex/components/backend/webhooks.d.ts.map +1 -0
- package/dist/convex/components/backend/webhooks.js +265 -0
- package/dist/convex/components/backend/webhooks.js.map +1 -0
- package/dist/convex/consent-rules.d.ts +70 -0
- package/dist/convex/consent-rules.d.ts.map +1 -0
- package/dist/convex/consent-rules.js +108 -0
- package/dist/convex/consent-rules.js.map +1 -0
- package/dist/convex/constants.d.ts +176 -0
- package/dist/convex/constants.d.ts.map +1 -0
- package/dist/convex/constants.js +184 -0
- package/dist/convex/constants.js.map +1 -0
- package/dist/convex/delivery.d.ts +39 -0
- package/dist/convex/delivery.d.ts.map +1 -0
- package/dist/convex/delivery.js +71 -0
- package/dist/convex/delivery.js.map +1 -0
- package/dist/convex/email-blocks.d.ts +35 -0
- package/dist/convex/email-blocks.d.ts.map +1 -0
- package/dist/convex/email-blocks.js +79 -0
- package/dist/convex/email-blocks.js.map +1 -0
- package/dist/convex/email-helpers.d.ts +44 -0
- package/dist/convex/email-helpers.d.ts.map +1 -0
- package/dist/convex/email-helpers.js +87 -0
- package/dist/convex/email-helpers.js.map +1 -0
- package/dist/convex/email-html.d.ts +14 -0
- package/dist/convex/email-html.d.ts.map +1 -0
- package/dist/convex/email-html.js +18 -0
- package/dist/convex/email-html.js.map +1 -0
- package/dist/convex/email-posture.d.ts +78 -0
- package/dist/convex/email-posture.d.ts.map +1 -0
- package/dist/convex/email-posture.js +151 -0
- package/dist/convex/email-posture.js.map +1 -0
- package/dist/convex/email-preferences.d.ts +163 -0
- package/dist/convex/email-preferences.d.ts.map +1 -0
- package/dist/convex/email-preferences.js +230 -0
- package/dist/convex/email-preferences.js.map +1 -0
- package/dist/convex/email-scheme.d.ts +12 -0
- package/dist/convex/email-scheme.d.ts.map +1 -0
- package/dist/convex/email-scheme.js +17 -0
- package/dist/convex/email-scheme.js.map +1 -0
- package/dist/convex/email-templates.d.ts +533 -0
- package/dist/convex/email-templates.d.ts.map +1 -0
- package/dist/convex/email-templates.js +480 -0
- package/dist/convex/email-templates.js.map +1 -0
- package/dist/convex/email-theme.d.ts +63 -0
- package/dist/convex/email-theme.d.ts.map +1 -0
- package/dist/convex/email-theme.js +130 -0
- package/dist/convex/email-theme.js.map +1 -0
- package/dist/convex/email-validators.d.ts +37 -0
- package/dist/convex/email-validators.d.ts.map +1 -0
- package/dist/convex/email-validators.js +26 -0
- package/dist/convex/email-validators.js.map +1 -0
- package/dist/convex/emails/appeal-decided.d.ts +4 -0
- package/dist/convex/emails/appeal-decided.d.ts.map +1 -0
- package/dist/convex/emails/appeal-decided.js +15 -0
- package/dist/convex/emails/appeal-decided.js.map +1 -0
- package/dist/convex/emails/content-restricted.d.ts +9 -0
- package/dist/convex/emails/content-restricted.d.ts.map +1 -0
- package/dist/convex/emails/content-restricted.js +28 -0
- package/dist/convex/emails/content-restricted.js.map +1 -0
- package/dist/convex/emails/deletion-canceled.d.ts +4 -0
- package/dist/convex/emails/deletion-canceled.d.ts.map +1 -0
- package/dist/convex/emails/deletion-canceled.js +7 -0
- package/dist/convex/emails/deletion-canceled.js.map +1 -0
- package/dist/convex/emails/deletion-scheduled.d.ts +4 -0
- package/dist/convex/emails/deletion-scheduled.d.ts.map +1 -0
- package/dist/convex/emails/deletion-scheduled.js +17 -0
- package/dist/convex/emails/deletion-scheduled.js.map +1 -0
- package/dist/convex/emails/email-changed.d.ts +4 -0
- package/dist/convex/emails/email-changed.d.ts.map +1 -0
- package/dist/convex/emails/email-changed.js +12 -0
- package/dist/convex/emails/email-changed.js.map +1 -0
- package/dist/convex/emails/gift-pass-ending.d.ts +4 -0
- package/dist/convex/emails/gift-pass-ending.d.ts.map +1 -0
- package/dist/convex/emails/gift-pass-ending.js +17 -0
- package/dist/convex/emails/gift-pass-ending.js.map +1 -0
- package/dist/convex/emails/gift.d.ts +4 -0
- package/dist/convex/emails/gift.d.ts.map +1 -0
- package/dist/convex/emails/gift.js +17 -0
- package/dist/convex/emails/gift.js.map +1 -0
- package/dist/convex/emails/invite.d.ts +9 -0
- package/dist/convex/emails/invite.d.ts.map +1 -0
- package/dist/convex/emails/invite.js +26 -0
- package/dist/convex/emails/invite.js.map +1 -0
- package/dist/convex/emails/new-device.d.ts +8 -0
- package/dist/convex/emails/new-device.d.ts.map +1 -0
- package/dist/convex/emails/new-device.js +20 -0
- package/dist/convex/emails/new-device.js.map +1 -0
- package/dist/convex/emails/notice-decided.d.ts +4 -0
- package/dist/convex/emails/notice-decided.d.ts.map +1 -0
- package/dist/convex/emails/notice-decided.js +15 -0
- package/dist/convex/emails/notice-decided.js.map +1 -0
- package/dist/convex/emails/notice-received.d.ts +4 -0
- package/dist/convex/emails/notice-received.d.ts.map +1 -0
- package/dist/convex/emails/notice-received.js +14 -0
- package/dist/convex/emails/notice-received.js.map +1 -0
- package/dist/convex/emails/otp.d.ts +10 -0
- package/dist/convex/emails/otp.d.ts.map +1 -0
- package/dist/convex/emails/otp.js +47 -0
- package/dist/convex/emails/otp.js.map +1 -0
- package/dist/convex/emails/passkey-recovered.d.ts +8 -0
- package/dist/convex/emails/passkey-recovered.d.ts.map +1 -0
- package/dist/convex/emails/passkey-recovered.js +20 -0
- package/dist/convex/emails/passkey-recovered.js.map +1 -0
- package/dist/convex/emails/renewal-reminder.d.ts +4 -0
- package/dist/convex/emails/renewal-reminder.d.ts.map +1 -0
- package/dist/convex/emails/renewal-reminder.js +19 -0
- package/dist/convex/emails/renewal-reminder.js.map +1 -0
- package/dist/convex/emails/topic-confirmation.d.ts +4 -0
- package/dist/convex/emails/topic-confirmation.d.ts.map +1 -0
- package/dist/convex/emails/topic-confirmation.js +16 -0
- package/dist/convex/emails/topic-confirmation.js.map +1 -0
- package/dist/convex/emails/waitlist-admitted.d.ts +4 -0
- package/dist/convex/emails/waitlist-admitted.d.ts.map +1 -0
- package/dist/convex/emails/waitlist-admitted.js +15 -0
- package/dist/convex/emails/waitlist-admitted.js.map +1 -0
- package/dist/convex/emails/waitlist-confirmation.d.ts +4 -0
- package/dist/convex/emails/waitlist-confirmation.d.ts.map +1 -0
- package/dist/convex/emails/waitlist-confirmation.js +18 -0
- package/dist/convex/emails/waitlist-confirmation.js.map +1 -0
- package/dist/convex/emails/welcome.d.ts +4 -0
- package/dist/convex/emails/welcome.d.ts.map +1 -0
- package/dist/convex/emails/welcome.js +14 -0
- package/dist/convex/emails/welcome.js.map +1 -0
- package/dist/convex/emails/withdrawal-receipt.d.ts +4 -0
- package/dist/convex/emails/withdrawal-receipt.d.ts.map +1 -0
- package/dist/convex/emails/withdrawal-receipt.js +15 -0
- package/dist/convex/emails/withdrawal-receipt.js.map +1 -0
- package/dist/convex/environment.d.ts +43 -0
- package/dist/convex/environment.d.ts.map +1 -0
- package/dist/convex/environment.js +64 -0
- package/dist/convex/environment.js.map +1 -0
- package/dist/convex/errors.d.ts +297 -0
- package/dist/convex/errors.d.ts.map +1 -0
- package/dist/convex/errors.js +382 -0
- package/dist/convex/errors.js.map +1 -0
- package/dist/convex/events.d.ts +875 -0
- package/dist/convex/events.d.ts.map +1 -0
- package/dist/convex/events.js +717 -0
- package/dist/convex/events.js.map +1 -0
- package/dist/convex/files.d.ts +57 -0
- package/dist/convex/files.d.ts.map +1 -0
- package/dist/convex/files.js +415 -0
- package/dist/convex/files.js.map +1 -0
- package/dist/convex/flags.d.ts +171 -0
- package/dist/convex/flags.d.ts.map +1 -0
- package/dist/convex/flags.js +270 -0
- package/dist/convex/flags.js.map +1 -0
- package/dist/convex/funnel-rules.d.ts +151 -0
- package/dist/convex/funnel-rules.d.ts.map +1 -0
- package/dist/convex/funnel-rules.js +163 -0
- package/dist/convex/funnel-rules.js.map +1 -0
- package/dist/convex/inbound-rules.d.ts +128 -0
- package/dist/convex/inbound-rules.d.ts.map +1 -0
- package/dist/convex/inbound-rules.js +175 -0
- package/dist/convex/inbound-rules.js.map +1 -0
- package/dist/convex/integrations/access.d.ts +163 -0
- package/dist/convex/integrations/access.d.ts.map +1 -0
- package/dist/convex/integrations/access.js +199 -0
- package/dist/convex/integrations/access.js.map +1 -0
- package/dist/convex/integrations/account.d.ts +458 -0
- package/dist/convex/integrations/account.d.ts.map +1 -0
- package/dist/convex/integrations/account.js +587 -0
- package/dist/convex/integrations/account.js.map +1 -0
- package/dist/convex/integrations/admin.d.ts +273 -0
- package/dist/convex/integrations/admin.d.ts.map +1 -0
- package/dist/convex/integrations/admin.js +198 -0
- package/dist/convex/integrations/admin.js.map +1 -0
- package/dist/convex/integrations/ai/account-export.d.ts +11 -0
- package/dist/convex/integrations/ai/account-export.d.ts.map +1 -0
- package/dist/convex/integrations/ai/account-export.js +44 -0
- package/dist/convex/integrations/ai/account-export.js.map +1 -0
- package/dist/convex/integrations/ai/chat.d.ts +104 -0
- package/dist/convex/integrations/ai/chat.d.ts.map +1 -0
- package/dist/convex/integrations/ai/chat.js +385 -0
- package/dist/convex/integrations/ai/chat.js.map +1 -0
- package/dist/convex/integrations/ai/config.d.ts +746 -0
- package/dist/convex/integrations/ai/config.d.ts.map +1 -0
- package/dist/convex/integrations/ai/config.js +2 -0
- package/dist/convex/integrations/ai/config.js.map +1 -0
- package/dist/convex/integrations/ai/context.d.ts +40 -0
- package/dist/convex/integrations/ai/context.d.ts.map +1 -0
- package/dist/convex/integrations/ai/context.js +53 -0
- package/dist/convex/integrations/ai/context.js.map +1 -0
- package/dist/convex/integrations/ai/costs.d.ts +40 -0
- package/dist/convex/integrations/ai/costs.d.ts.map +1 -0
- package/dist/convex/integrations/ai/costs.js +72 -0
- package/dist/convex/integrations/ai/costs.js.map +1 -0
- package/dist/convex/integrations/ai/embeddings.d.ts +23 -0
- package/dist/convex/integrations/ai/embeddings.d.ts.map +1 -0
- package/dist/convex/integrations/ai/embeddings.js +75 -0
- package/dist/convex/integrations/ai/embeddings.js.map +1 -0
- package/dist/convex/integrations/ai/job-errors.d.ts +57 -0
- package/dist/convex/integrations/ai/job-errors.d.ts.map +1 -0
- package/dist/convex/integrations/ai/job-errors.js +122 -0
- package/dist/convex/integrations/ai/job-errors.js.map +1 -0
- package/dist/convex/integrations/ai/jobs.d.ts +286 -0
- package/dist/convex/integrations/ai/jobs.d.ts.map +1 -0
- package/dist/convex/integrations/ai/jobs.js +973 -0
- package/dist/convex/integrations/ai/jobs.js.map +1 -0
- package/dist/convex/integrations/ai/knowledge.d.ts +120 -0
- package/dist/convex/integrations/ai/knowledge.d.ts.map +1 -0
- package/dist/convex/integrations/ai/knowledge.js +336 -0
- package/dist/convex/integrations/ai/knowledge.js.map +1 -0
- package/dist/convex/integrations/ai/metering.d.ts +59 -0
- package/dist/convex/integrations/ai/metering.d.ts.map +1 -0
- package/dist/convex/integrations/ai/metering.js +370 -0
- package/dist/convex/integrations/ai/metering.js.map +1 -0
- package/dist/convex/integrations/ai/model-id.d.ts +8 -0
- package/dist/convex/integrations/ai/model-id.d.ts.map +1 -0
- package/dist/convex/integrations/ai/model-id.js +15 -0
- package/dist/convex/integrations/ai/model-id.js.map +1 -0
- package/dist/convex/integrations/ai/models.d.ts +162 -0
- package/dist/convex/integrations/ai/models.d.ts.map +1 -0
- package/dist/convex/integrations/ai/models.js +385 -0
- package/dist/convex/integrations/ai/models.js.map +1 -0
- package/dist/convex/integrations/ai/moderation.d.ts +59 -0
- package/dist/convex/integrations/ai/moderation.d.ts.map +1 -0
- package/dist/convex/integrations/ai/moderation.js +199 -0
- package/dist/convex/integrations/ai/moderation.js.map +1 -0
- package/dist/convex/integrations/ai/pricing.d.ts +88 -0
- package/dist/convex/integrations/ai/pricing.d.ts.map +1 -0
- package/dist/convex/integrations/ai/pricing.js +135 -0
- package/dist/convex/integrations/ai/pricing.js.map +1 -0
- package/dist/convex/integrations/ai/provenance.d.ts +87 -0
- package/dist/convex/integrations/ai/provenance.d.ts.map +1 -0
- package/dist/convex/integrations/ai/provenance.js +137 -0
- package/dist/convex/integrations/ai/provenance.js.map +1 -0
- package/dist/convex/integrations/ai/setup.d.ts +20 -0
- package/dist/convex/integrations/ai/setup.d.ts.map +1 -0
- package/dist/convex/integrations/ai/setup.js +53 -0
- package/dist/convex/integrations/ai/setup.js.map +1 -0
- package/dist/convex/integrations/ai/stream.d.ts +10 -0
- package/dist/convex/integrations/ai/stream.d.ts.map +1 -0
- package/dist/convex/integrations/ai/stream.js +151 -0
- package/dist/convex/integrations/ai/stream.js.map +1 -0
- package/dist/convex/integrations/ai.d.ts +37 -0
- package/dist/convex/integrations/ai.d.ts.map +1 -0
- package/dist/convex/integrations/ai.js +4 -0
- package/dist/convex/integrations/ai.js.map +1 -0
- package/dist/convex/integrations/announcements.d.ts +239 -0
- package/dist/convex/integrations/announcements.d.ts.map +1 -0
- package/dist/convex/integrations/announcements.js +313 -0
- package/dist/convex/integrations/announcements.js.map +1 -0
- package/dist/convex/integrations/audit.d.ts +272 -0
- package/dist/convex/integrations/audit.d.ts.map +1 -0
- package/dist/convex/integrations/audit.js +268 -0
- package/dist/convex/integrations/audit.js.map +1 -0
- package/dist/convex/integrations/authorization.d.ts +147 -0
- package/dist/convex/integrations/authorization.d.ts.map +1 -0
- package/dist/convex/integrations/authorization.js +210 -0
- package/dist/convex/integrations/authorization.js.map +1 -0
- package/dist/convex/integrations/billing/activity.d.ts +24 -0
- package/dist/convex/integrations/billing/activity.d.ts.map +1 -0
- package/dist/convex/integrations/billing/activity.js +40 -0
- package/dist/convex/integrations/billing/activity.js.map +1 -0
- package/dist/convex/integrations/billing/checkout.d.ts +78 -0
- package/dist/convex/integrations/billing/checkout.d.ts.map +1 -0
- package/dist/convex/integrations/billing/checkout.js +484 -0
- package/dist/convex/integrations/billing/checkout.js.map +1 -0
- package/dist/convex/integrations/billing/claim-discount.d.ts +17 -0
- package/dist/convex/integrations/billing/claim-discount.d.ts.map +1 -0
- package/dist/convex/integrations/billing/claim-discount.js +40 -0
- package/dist/convex/integrations/billing/claim-discount.js.map +1 -0
- package/dist/convex/integrations/billing/context.d.ts +156 -0
- package/dist/convex/integrations/billing/context.d.ts.map +1 -0
- package/dist/convex/integrations/billing/context.js +397 -0
- package/dist/convex/integrations/billing/context.js.map +1 -0
- package/dist/convex/integrations/billing/credits.d.ts +40 -0
- package/dist/convex/integrations/billing/credits.d.ts.map +1 -0
- package/dist/convex/integrations/billing/credits.js +215 -0
- package/dist/convex/integrations/billing/credits.js.map +1 -0
- package/dist/convex/integrations/billing/customers.d.ts +60 -0
- package/dist/convex/integrations/billing/customers.d.ts.map +1 -0
- package/dist/convex/integrations/billing/customers.js +322 -0
- package/dist/convex/integrations/billing/customers.js.map +1 -0
- package/dist/convex/integrations/billing/discounts.d.ts +26 -0
- package/dist/convex/integrations/billing/discounts.d.ts.map +1 -0
- package/dist/convex/integrations/billing/discounts.js +71 -0
- package/dist/convex/integrations/billing/discounts.js.map +1 -0
- package/dist/convex/integrations/billing/entitlements.d.ts +16 -0
- package/dist/convex/integrations/billing/entitlements.d.ts.map +1 -0
- package/dist/convex/integrations/billing/entitlements.js +180 -0
- package/dist/convex/integrations/billing/entitlements.js.map +1 -0
- package/dist/convex/integrations/billing/erasure.d.ts +10 -0
- package/dist/convex/integrations/billing/erasure.d.ts.map +1 -0
- package/dist/convex/integrations/billing/erasure.js +90 -0
- package/dist/convex/integrations/billing/erasure.js.map +1 -0
- package/dist/convex/integrations/billing/events.d.ts +80 -0
- package/dist/convex/integrations/billing/events.d.ts.map +1 -0
- package/dist/convex/integrations/billing/events.js +209 -0
- package/dist/convex/integrations/billing/events.js.map +1 -0
- package/dist/convex/integrations/billing/features.d.ts +32 -0
- package/dist/convex/integrations/billing/features.d.ts.map +1 -0
- package/dist/convex/integrations/billing/features.js +79 -0
- package/dist/convex/integrations/billing/features.js.map +1 -0
- package/dist/convex/integrations/billing/free-plan.d.ts +53 -0
- package/dist/convex/integrations/billing/free-plan.d.ts.map +1 -0
- package/dist/convex/integrations/billing/free-plan.js +233 -0
- package/dist/convex/integrations/billing/free-plan.js.map +1 -0
- package/dist/convex/integrations/billing/functions.d.ts +353 -0
- package/dist/convex/integrations/billing/functions.d.ts.map +1 -0
- package/dist/convex/integrations/billing/functions.js +445 -0
- package/dist/convex/integrations/billing/functions.js.map +1 -0
- package/dist/convex/integrations/billing/gift-access.d.ts +39 -0
- package/dist/convex/integrations/billing/gift-access.d.ts.map +1 -0
- package/dist/convex/integrations/billing/gift-access.js +39 -0
- package/dist/convex/integrations/billing/gift-access.js.map +1 -0
- package/dist/convex/integrations/billing/gift-manage.d.ts +66 -0
- package/dist/convex/integrations/billing/gift-manage.d.ts.map +1 -0
- package/dist/convex/integrations/billing/gift-manage.js +261 -0
- package/dist/convex/integrations/billing/gift-manage.js.map +1 -0
- package/dist/convex/integrations/billing/gift-rules.d.ts +19 -0
- package/dist/convex/integrations/billing/gift-rules.d.ts.map +1 -0
- package/dist/convex/integrations/billing/gift-rules.js +49 -0
- package/dist/convex/integrations/billing/gift-rules.js.map +1 -0
- package/dist/convex/integrations/billing/gifts.d.ts +123 -0
- package/dist/convex/integrations/billing/gifts.d.ts.map +1 -0
- package/dist/convex/integrations/billing/gifts.js +712 -0
- package/dist/convex/integrations/billing/gifts.js.map +1 -0
- package/dist/convex/integrations/billing/history.d.ts +22 -0
- package/dist/convex/integrations/billing/history.d.ts.map +1 -0
- package/dist/convex/integrations/billing/history.js +214 -0
- package/dist/convex/integrations/billing/history.js.map +1 -0
- package/dist/convex/integrations/billing/lifecycle.d.ts +105 -0
- package/dist/convex/integrations/billing/lifecycle.d.ts.map +1 -0
- package/dist/convex/integrations/billing/lifecycle.js +526 -0
- package/dist/convex/integrations/billing/lifecycle.js.map +1 -0
- package/dist/convex/integrations/billing/passes.d.ts +68 -0
- package/dist/convex/integrations/billing/passes.d.ts.map +1 -0
- package/dist/convex/integrations/billing/passes.js +407 -0
- package/dist/convex/integrations/billing/passes.js.map +1 -0
- package/dist/convex/integrations/billing/pricing.d.ts +54 -0
- package/dist/convex/integrations/billing/pricing.d.ts.map +1 -0
- package/dist/convex/integrations/billing/pricing.js +322 -0
- package/dist/convex/integrations/billing/pricing.js.map +1 -0
- package/dist/convex/integrations/billing/provider-client.d.ts +11 -0
- package/dist/convex/integrations/billing/provider-client.d.ts.map +1 -0
- package/dist/convex/integrations/billing/provider-client.js +9 -0
- package/dist/convex/integrations/billing/provider-client.js.map +1 -0
- package/dist/convex/integrations/billing/provider-events.d.ts +26 -0
- package/dist/convex/integrations/billing/provider-events.d.ts.map +1 -0
- package/dist/convex/integrations/billing/provider-events.js +194 -0
- package/dist/convex/integrations/billing/provider-events.js.map +1 -0
- package/dist/convex/integrations/billing/purchase.d.ts +63 -0
- package/dist/convex/integrations/billing/purchase.d.ts.map +1 -0
- package/dist/convex/integrations/billing/purchase.js +287 -0
- package/dist/convex/integrations/billing/purchase.js.map +1 -0
- package/dist/convex/integrations/billing/quotas.d.ts +47 -0
- package/dist/convex/integrations/billing/quotas.d.ts.map +1 -0
- package/dist/convex/integrations/billing/quotas.js +162 -0
- package/dist/convex/integrations/billing/quotas.js.map +1 -0
- package/dist/convex/integrations/billing/referral-orders.d.ts +26 -0
- package/dist/convex/integrations/billing/referral-orders.d.ts.map +1 -0
- package/dist/convex/integrations/billing/referral-orders.js +33 -0
- package/dist/convex/integrations/billing/referral-orders.js.map +1 -0
- package/dist/convex/integrations/billing/revenue.d.ts +12 -0
- package/dist/convex/integrations/billing/revenue.d.ts.map +1 -0
- package/dist/convex/integrations/billing/revenue.js +175 -0
- package/dist/convex/integrations/billing/revenue.js.map +1 -0
- package/dist/convex/integrations/billing/rewards.d.ts +78 -0
- package/dist/convex/integrations/billing/rewards.d.ts.map +1 -0
- package/dist/convex/integrations/billing/rewards.js +113 -0
- package/dist/convex/integrations/billing/rewards.js.map +1 -0
- package/dist/convex/integrations/billing/subscriptions.d.ts +79 -0
- package/dist/convex/integrations/billing/subscriptions.d.ts.map +1 -0
- package/dist/convex/integrations/billing/subscriptions.js +331 -0
- package/dist/convex/integrations/billing/subscriptions.js.map +1 -0
- package/dist/convex/integrations/billing/types/base.d.ts +78 -0
- package/dist/convex/integrations/billing/types/base.d.ts.map +1 -0
- package/dist/convex/integrations/billing/types/base.js +2 -0
- package/dist/convex/integrations/billing/types/base.js.map +1 -0
- package/dist/convex/integrations/billing/types/lifecycle.d.ts +159 -0
- package/dist/convex/integrations/billing/types/lifecycle.d.ts.map +1 -0
- package/dist/convex/integrations/billing/types/lifecycle.js +2 -0
- package/dist/convex/integrations/billing/types/lifecycle.js.map +1 -0
- package/dist/convex/integrations/billing/types/options.d.ts +372 -0
- package/dist/convex/integrations/billing/types/options.d.ts.map +1 -0
- package/dist/convex/integrations/billing/types/options.js +2 -0
- package/dist/convex/integrations/billing/types/options.js.map +1 -0
- package/dist/convex/integrations/billing/types/records.d.ts +523 -0
- package/dist/convex/integrations/billing/types/records.d.ts.map +1 -0
- package/dist/convex/integrations/billing/types/records.js +3 -0
- package/dist/convex/integrations/billing/types/records.js.map +1 -0
- package/dist/convex/integrations/billing/types/revenue.d.ts +94 -0
- package/dist/convex/integrations/billing/types/revenue.d.ts.map +1 -0
- package/dist/convex/integrations/billing/types/revenue.js +34 -0
- package/dist/convex/integrations/billing/types/revenue.js.map +1 -0
- package/dist/convex/integrations/billing/types/setup.d.ts +891 -0
- package/dist/convex/integrations/billing/types/setup.d.ts.map +1 -0
- package/dist/convex/integrations/billing/types/setup.js +2 -0
- package/dist/convex/integrations/billing/types/setup.js.map +1 -0
- package/dist/convex/integrations/billing/types/surface.d.ts +665 -0
- package/dist/convex/integrations/billing/types/surface.d.ts.map +1 -0
- package/dist/convex/integrations/billing/types/surface.js +2 -0
- package/dist/convex/integrations/billing/types/surface.js.map +1 -0
- package/dist/convex/integrations/billing/webhooks.d.ts +16 -0
- package/dist/convex/integrations/billing/webhooks.d.ts.map +1 -0
- package/dist/convex/integrations/billing/webhooks.js +317 -0
- package/dist/convex/integrations/billing/webhooks.js.map +1 -0
- package/dist/convex/integrations/billing.d.ts +48 -0
- package/dist/convex/integrations/billing.d.ts.map +1 -0
- package/dist/convex/integrations/billing.js +193 -0
- package/dist/convex/integrations/billing.js.map +1 -0
- package/dist/convex/integrations/email-lifecycle.d.ts +57 -0
- package/dist/convex/integrations/email-lifecycle.d.ts.map +1 -0
- package/dist/convex/integrations/email-lifecycle.js +180 -0
- package/dist/convex/integrations/email-lifecycle.js.map +1 -0
- package/dist/convex/integrations/email-preferences.d.ts +227 -0
- package/dist/convex/integrations/email-preferences.d.ts.map +1 -0
- package/dist/convex/integrations/email-preferences.js +287 -0
- package/dist/convex/integrations/email-preferences.js.map +1 -0
- package/dist/convex/integrations/email-suppressions.d.ts +63 -0
- package/dist/convex/integrations/email-suppressions.d.ts.map +1 -0
- package/dist/convex/integrations/email-suppressions.js +120 -0
- package/dist/convex/integrations/email-suppressions.js.map +1 -0
- package/dist/convex/integrations/email-sync.d.ts +131 -0
- package/dist/convex/integrations/email-sync.d.ts.map +1 -0
- package/dist/convex/integrations/email-sync.js +464 -0
- package/dist/convex/integrations/email-sync.js.map +1 -0
- package/dist/convex/integrations/email.d.ts +756 -0
- package/dist/convex/integrations/email.d.ts.map +1 -0
- package/dist/convex/integrations/email.js +463 -0
- package/dist/convex/integrations/email.js.map +1 -0
- package/dist/convex/integrations/flags.d.ts +200 -0
- package/dist/convex/integrations/flags.d.ts.map +1 -0
- package/dist/convex/integrations/flags.js +295 -0
- package/dist/convex/integrations/flags.js.map +1 -0
- package/dist/convex/integrations/functions.d.ts +298 -0
- package/dist/convex/integrations/functions.d.ts.map +1 -0
- package/dist/convex/integrations/functions.js +380 -0
- package/dist/convex/integrations/functions.js.map +1 -0
- package/dist/convex/integrations/health.d.ts +2 -0
- package/dist/convex/integrations/health.d.ts.map +1 -0
- package/dist/convex/integrations/health.js +145 -0
- package/dist/convex/integrations/health.js.map +1 -0
- package/dist/convex/integrations/http.d.ts +102 -0
- package/dist/convex/integrations/http.d.ts.map +1 -0
- package/dist/convex/integrations/http.js +108 -0
- package/dist/convex/integrations/http.js.map +1 -0
- package/dist/convex/integrations/inbound.d.ts +194 -0
- package/dist/convex/integrations/inbound.d.ts.map +1 -0
- package/dist/convex/integrations/inbound.js +502 -0
- package/dist/convex/integrations/inbound.js.map +1 -0
- package/dist/convex/integrations/launch.d.ts +240 -0
- package/dist/convex/integrations/launch.d.ts.map +1 -0
- package/dist/convex/integrations/launch.js +360 -0
- package/dist/convex/integrations/launch.js.map +1 -0
- package/dist/convex/integrations/monitoring.d.ts +135 -0
- package/dist/convex/integrations/monitoring.d.ts.map +1 -0
- package/dist/convex/integrations/monitoring.js +226 -0
- package/dist/convex/integrations/monitoring.js.map +1 -0
- package/dist/convex/integrations/notifications.d.ts +225 -0
- package/dist/convex/integrations/notifications.d.ts.map +1 -0
- package/dist/convex/integrations/notifications.js +306 -0
- package/dist/convex/integrations/notifications.js.map +1 -0
- package/dist/convex/integrations/rate-limit.d.ts +429 -0
- package/dist/convex/integrations/rate-limit.d.ts.map +1 -0
- package/dist/convex/integrations/rate-limit.js +295 -0
- package/dist/convex/integrations/rate-limit.js.map +1 -0
- package/dist/convex/integrations/referrals.d.ts +340 -0
- package/dist/convex/integrations/referrals.d.ts.map +1 -0
- package/dist/convex/integrations/referrals.js +304 -0
- package/dist/convex/integrations/referrals.js.map +1 -0
- package/dist/convex/integrations/reports.d.ts +231 -0
- package/dist/convex/integrations/reports.d.ts.map +1 -0
- package/dist/convex/integrations/reports.js +480 -0
- package/dist/convex/integrations/reports.js.map +1 -0
- package/dist/convex/integrations/retention.d.ts +88 -0
- package/dist/convex/integrations/retention.d.ts.map +1 -0
- package/dist/convex/integrations/retention.js +117 -0
- package/dist/convex/integrations/retention.js.map +1 -0
- package/dist/convex/integrations/search.d.ts +91 -0
- package/dist/convex/integrations/search.d.ts.map +1 -0
- package/dist/convex/integrations/search.js +117 -0
- package/dist/convex/integrations/search.js.map +1 -0
- package/dist/convex/integrations/storage.d.ts +207 -0
- package/dist/convex/integrations/storage.d.ts.map +1 -0
- package/dist/convex/integrations/storage.js +373 -0
- package/dist/convex/integrations/storage.js.map +1 -0
- package/dist/convex/integrations/waitlist.d.ts +213 -0
- package/dist/convex/integrations/waitlist.d.ts.map +1 -0
- package/dist/convex/integrations/waitlist.js +260 -0
- package/dist/convex/integrations/waitlist.js.map +1 -0
- package/dist/convex/integrations/webhook-guard.d.ts +179 -0
- package/dist/convex/integrations/webhook-guard.d.ts.map +1 -0
- package/dist/convex/integrations/webhook-guard.js +183 -0
- package/dist/convex/integrations/webhook-guard.js.map +1 -0
- package/dist/convex/integrations/webhooks.d.ts +68 -0
- package/dist/convex/integrations/webhooks.d.ts.map +1 -0
- package/dist/convex/integrations/webhooks.js +109 -0
- package/dist/convex/integrations/webhooks.js.map +1 -0
- package/dist/convex/integrations/workflows.d.ts +130 -0
- package/dist/convex/integrations/workflows.d.ts.map +1 -0
- package/dist/convex/integrations/workflows.js +142 -0
- package/dist/convex/integrations/workflows.js.map +1 -0
- package/dist/convex/jobs-policy.d.ts +191 -0
- package/dist/convex/jobs-policy.d.ts.map +1 -0
- package/dist/convex/jobs-policy.js +291 -0
- package/dist/convex/jobs-policy.js.map +1 -0
- package/dist/convex/label-format.d.ts +29 -0
- package/dist/convex/label-format.d.ts.map +1 -0
- package/dist/convex/label-format.js +60 -0
- package/dist/convex/label-format.js.map +1 -0
- package/dist/convex/label-groups/access.d.ts +19 -0
- package/dist/convex/label-groups/access.d.ts.map +1 -0
- package/dist/convex/label-groups/access.js +21 -0
- package/dist/convex/label-groups/access.js.map +1 -0
- package/dist/convex/label-groups/account.d.ts +27 -0
- package/dist/convex/label-groups/account.d.ts.map +1 -0
- package/dist/convex/label-groups/account.js +27 -0
- package/dist/convex/label-groups/account.js.map +1 -0
- package/dist/convex/label-groups/activation.d.ts +19 -0
- package/dist/convex/label-groups/activation.d.ts.map +1 -0
- package/dist/convex/label-groups/activation.js +22 -0
- package/dist/convex/label-groups/activation.js.map +1 -0
- package/dist/convex/label-groups/admin.d.ts +823 -0
- package/dist/convex/label-groups/admin.d.ts.map +1 -0
- package/dist/convex/label-groups/admin.js +858 -0
- package/dist/convex/label-groups/admin.js.map +1 -0
- package/dist/convex/label-groups/ai.d.ts +14 -0
- package/dist/convex/label-groups/ai.d.ts.map +1 -0
- package/dist/convex/label-groups/ai.js +15 -0
- package/dist/convex/label-groups/ai.js.map +1 -0
- package/dist/convex/label-groups/announcement.d.ts +12 -0
- package/dist/convex/label-groups/announcement.d.ts.map +1 -0
- package/dist/convex/label-groups/announcement.js +14 -0
- package/dist/convex/label-groups/announcement.js.map +1 -0
- package/dist/convex/label-groups/audit.d.ts +169 -0
- package/dist/convex/label-groups/audit.d.ts.map +1 -0
- package/dist/convex/label-groups/audit.js +172 -0
- package/dist/convex/label-groups/audit.js.map +1 -0
- package/dist/convex/label-groups/auth.d.ts +61 -0
- package/dist/convex/label-groups/auth.d.ts.map +1 -0
- package/dist/convex/label-groups/auth.js +76 -0
- package/dist/convex/label-groups/auth.js.map +1 -0
- package/dist/convex/label-groups/cancelFlow.d.ts +47 -0
- package/dist/convex/label-groups/cancelFlow.d.ts.map +1 -0
- package/dist/convex/label-groups/cancelFlow.js +52 -0
- package/dist/convex/label-groups/cancelFlow.js.map +1 -0
- package/dist/convex/label-groups/connection.d.ts +11 -0
- package/dist/convex/label-groups/connection.d.ts.map +1 -0
- package/dist/convex/label-groups/connection.js +13 -0
- package/dist/convex/label-groups/connection.js.map +1 -0
- package/dist/convex/label-groups/consent.d.ts +36 -0
- package/dist/convex/label-groups/consent.d.ts.map +1 -0
- package/dist/convex/label-groups/consent.js +42 -0
- package/dist/convex/label-groups/consent.js.map +1 -0
- package/dist/convex/label-groups/contact.d.ts +21 -0
- package/dist/convex/label-groups/contact.d.ts.map +1 -0
- package/dist/convex/label-groups/contact.js +24 -0
- package/dist/convex/label-groups/contact.js.map +1 -0
- package/dist/convex/label-groups/credits.d.ts +24 -0
- package/dist/convex/label-groups/credits.d.ts.map +1 -0
- package/dist/convex/label-groups/credits.js +27 -0
- package/dist/convex/label-groups/credits.js.map +1 -0
- package/dist/convex/label-groups/deletion.d.ts +18 -0
- package/dist/convex/label-groups/deletion.d.ts.map +1 -0
- package/dist/convex/label-groups/deletion.js +19 -0
- package/dist/convex/label-groups/deletion.js.map +1 -0
- package/dist/convex/label-groups/email.d.ts +237 -0
- package/dist/convex/label-groups/email.d.ts.map +1 -0
- package/dist/convex/label-groups/email.js +207 -0
- package/dist/convex/label-groups/email.js.map +1 -0
- package/dist/convex/label-groups/errors.d.ts +100 -0
- package/dist/convex/label-groups/errors.d.ts.map +1 -0
- package/dist/convex/label-groups/errors.js +117 -0
- package/dist/convex/label-groups/errors.js.map +1 -0
- package/dist/convex/label-groups/feedback.d.ts +17 -0
- package/dist/convex/label-groups/feedback.d.ts.map +1 -0
- package/dist/convex/label-groups/feedback.js +17 -0
- package/dist/convex/label-groups/feedback.js.map +1 -0
- package/dist/convex/label-groups/gift.d.ts +54 -0
- package/dist/convex/label-groups/gift.d.ts.map +1 -0
- package/dist/convex/label-groups/gift.js +59 -0
- package/dist/convex/label-groups/gift.js.map +1 -0
- package/dist/convex/label-groups/history.d.ts +23 -0
- package/dist/convex/label-groups/history.d.ts.map +1 -0
- package/dist/convex/label-groups/history.js +25 -0
- package/dist/convex/label-groups/history.js.map +1 -0
- package/dist/convex/label-groups/impersonation.d.ts +13 -0
- package/dist/convex/label-groups/impersonation.d.ts.map +1 -0
- package/dist/convex/label-groups/impersonation.js +14 -0
- package/dist/convex/label-groups/impersonation.js.map +1 -0
- package/dist/convex/label-groups/invitation.d.ts +23 -0
- package/dist/convex/label-groups/invitation.d.ts.map +1 -0
- package/dist/convex/label-groups/invitation.js +25 -0
- package/dist/convex/label-groups/invitation.js.map +1 -0
- package/dist/convex/label-groups/legal.d.ts +139 -0
- package/dist/convex/label-groups/legal.d.ts.map +1 -0
- package/dist/convex/label-groups/legal.js +144 -0
- package/dist/convex/label-groups/legal.js.map +1 -0
- package/dist/convex/label-groups/maintenance.d.ts +11 -0
- package/dist/convex/label-groups/maintenance.d.ts.map +1 -0
- package/dist/convex/label-groups/maintenance.js +12 -0
- package/dist/convex/label-groups/maintenance.js.map +1 -0
- package/dist/convex/label-groups/notifications.d.ts +186 -0
- package/dist/convex/label-groups/notifications.d.ts.map +1 -0
- package/dist/convex/label-groups/notifications.js +89 -0
- package/dist/convex/label-groups/notifications.js.map +1 -0
- package/dist/convex/label-groups/onboarding.d.ts +57 -0
- package/dist/convex/label-groups/onboarding.d.ts.map +1 -0
- package/dist/convex/label-groups/onboarding.js +59 -0
- package/dist/convex/label-groups/onboarding.js.map +1 -0
- package/dist/convex/label-groups/pastDue.d.ts +9 -0
- package/dist/convex/label-groups/pastDue.d.ts.map +1 -0
- package/dist/convex/label-groups/pastDue.js +10 -0
- package/dist/convex/label-groups/pastDue.js.map +1 -0
- package/dist/convex/label-groups/preferences.d.ts +46 -0
- package/dist/convex/label-groups/preferences.d.ts.map +1 -0
- package/dist/convex/label-groups/preferences.js +46 -0
- package/dist/convex/label-groups/preferences.js.map +1 -0
- package/dist/convex/label-groups/pricing.d.ts +73 -0
- package/dist/convex/label-groups/pricing.d.ts.map +1 -0
- package/dist/convex/label-groups/pricing.js +95 -0
- package/dist/convex/label-groups/pricing.js.map +1 -0
- package/dist/convex/label-groups/profile.d.ts +34 -0
- package/dist/convex/label-groups/profile.d.ts.map +1 -0
- package/dist/convex/label-groups/profile.js +39 -0
- package/dist/convex/label-groups/profile.js.map +1 -0
- package/dist/convex/label-groups/quota.d.ts +19 -0
- package/dist/convex/label-groups/quota.d.ts.map +1 -0
- package/dist/convex/label-groups/quota.js +25 -0
- package/dist/convex/label-groups/quota.js.map +1 -0
- package/dist/convex/label-groups/reauthenticate.d.ts +21 -0
- package/dist/convex/label-groups/reauthenticate.d.ts.map +1 -0
- package/dist/convex/label-groups/reauthenticate.js +22 -0
- package/dist/convex/label-groups/reauthenticate.js.map +1 -0
- package/dist/convex/label-groups/referral.d.ts +50 -0
- package/dist/convex/label-groups/referral.d.ts.map +1 -0
- package/dist/convex/label-groups/referral.js +53 -0
- package/dist/convex/label-groups/referral.js.map +1 -0
- package/dist/convex/label-groups/report.d.ts +56 -0
- package/dist/convex/label-groups/report.d.ts.map +1 -0
- package/dist/convex/label-groups/report.js +56 -0
- package/dist/convex/label-groups/report.js.map +1 -0
- package/dist/convex/label-groups/security.d.ts +54 -0
- package/dist/convex/label-groups/security.d.ts.map +1 -0
- package/dist/convex/label-groups/security.js +63 -0
- package/dist/convex/label-groups/security.js.map +1 -0
- package/dist/convex/label-groups/settings.d.ts +79 -0
- package/dist/convex/label-groups/settings.d.ts.map +1 -0
- package/dist/convex/label-groups/settings.js +90 -0
- package/dist/convex/label-groups/settings.js.map +1 -0
- package/dist/convex/label-groups/shell.d.ts +48 -0
- package/dist/convex/label-groups/shell.d.ts.map +1 -0
- package/dist/convex/label-groups/shell.js +54 -0
- package/dist/convex/label-groups/shell.js.map +1 -0
- package/dist/convex/label-groups/source.d.ts +28 -0
- package/dist/convex/label-groups/source.d.ts.map +1 -0
- package/dist/convex/label-groups/source.js +32 -0
- package/dist/convex/label-groups/source.js.map +1 -0
- package/dist/convex/label-groups/upgrade.d.ts +16 -0
- package/dist/convex/label-groups/upgrade.d.ts.map +1 -0
- package/dist/convex/label-groups/upgrade.js +20 -0
- package/dist/convex/label-groups/upgrade.js.map +1 -0
- package/dist/convex/label-groups/upload.d.ts +18 -0
- package/dist/convex/label-groups/upload.d.ts.map +1 -0
- package/dist/convex/label-groups/upload.js +19 -0
- package/dist/convex/label-groups/upload.js.map +1 -0
- package/dist/convex/label-groups/usage.d.ts +12 -0
- package/dist/convex/label-groups/usage.d.ts.map +1 -0
- package/dist/convex/label-groups/usage.js +12 -0
- package/dist/convex/label-groups/usage.js.map +1 -0
- package/dist/convex/label-groups/waitlist.d.ts +44 -0
- package/dist/convex/label-groups/waitlist.d.ts.map +1 -0
- package/dist/convex/label-groups/waitlist.js +45 -0
- package/dist/convex/label-groups/waitlist.js.map +1 -0
- package/dist/convex/label-groups/withdrawal.d.ts +18 -0
- package/dist/convex/label-groups/withdrawal.d.ts.map +1 -0
- package/dist/convex/label-groups/withdrawal.js +18 -0
- package/dist/convex/label-groups/withdrawal.js.map +1 -0
- package/dist/convex/label-translations.d.ts +4 -0
- package/dist/convex/label-translations.d.ts.map +1 -0
- package/dist/convex/label-translations.js +1834 -0
- package/dist/convex/label-translations.js.map +1 -0
- package/dist/convex/labels.d.ts +2543 -0
- package/dist/convex/labels.d.ts.map +1 -0
- package/dist/convex/labels.js +114 -0
- package/dist/convex/labels.js.map +1 -0
- package/dist/convex/legal.d.ts +309 -0
- package/dist/convex/legal.d.ts.map +1 -0
- package/dist/convex/legal.js +270 -0
- package/dist/convex/legal.js.map +1 -0
- package/dist/convex/lifecycle-flows.d.ts +75 -0
- package/dist/convex/lifecycle-flows.d.ts.map +1 -0
- package/dist/convex/lifecycle-flows.js +56 -0
- package/dist/convex/lifecycle-flows.js.map +1 -0
- package/dist/convex/local-origins.d.ts +3 -0
- package/dist/convex/local-origins.d.ts.map +1 -0
- package/dist/convex/local-origins.js +25 -0
- package/dist/convex/local-origins.js.map +1 -0
- package/dist/convex/locale.d.ts +26 -0
- package/dist/convex/locale.d.ts.map +1 -0
- package/dist/convex/locale.js +99 -0
- package/dist/convex/locale.js.map +1 -0
- package/dist/convex/log.d.ts +2 -0
- package/dist/convex/log.d.ts.map +1 -0
- package/dist/convex/log.js +149 -0
- package/dist/convex/log.js.map +1 -0
- package/dist/convex/loopback.d.ts +5 -0
- package/dist/convex/loopback.d.ts.map +1 -0
- package/dist/convex/loopback.js +20 -0
- package/dist/convex/loopback.js.map +1 -0
- package/dist/convex/monitoring.d.ts +226 -0
- package/dist/convex/monitoring.d.ts.map +1 -0
- package/dist/convex/monitoring.js +419 -0
- package/dist/convex/monitoring.js.map +1 -0
- package/dist/convex/notifications.d.ts +404 -0
- package/dist/convex/notifications.d.ts.map +1 -0
- package/dist/convex/notifications.js +231 -0
- package/dist/convex/notifications.js.map +1 -0
- package/dist/convex/package-migrations.d.ts +44 -0
- package/dist/convex/package-migrations.d.ts.map +1 -0
- package/dist/convex/package-migrations.js +32 -0
- package/dist/convex/package-migrations.js.map +1 -0
- package/dist/convex/paths.d.ts +35 -0
- package/dist/convex/paths.d.ts.map +1 -0
- package/dist/convex/paths.js +34 -0
- package/dist/convex/paths.js.map +1 -0
- package/dist/convex/pauses.d.ts +27 -0
- package/dist/convex/pauses.d.ts.map +1 -0
- package/dist/convex/pauses.js +36 -0
- package/dist/convex/pauses.js.map +1 -0
- package/dist/convex/proof.d.ts +177 -0
- package/dist/convex/proof.d.ts.map +1 -0
- package/dist/convex/proof.js +311 -0
- package/dist/convex/proof.js.map +1 -0
- package/dist/convex/referral-rules.d.ts +81 -0
- package/dist/convex/referral-rules.d.ts.map +1 -0
- package/dist/convex/referral-rules.js +108 -0
- package/dist/convex/referral-rules.js.map +1 -0
- package/dist/convex/report-rules.d.ts +9 -0
- package/dist/convex/report-rules.d.ts.map +1 -0
- package/dist/convex/report-rules.js +10 -0
- package/dist/convex/report-rules.js.map +1 -0
- package/dist/convex/sandbox-inbox.d.ts +56 -0
- package/dist/convex/sandbox-inbox.d.ts.map +1 -0
- package/dist/convex/sandbox-inbox.js +125 -0
- package/dist/convex/sandbox-inbox.js.map +1 -0
- package/dist/convex/sensitive-actions.d.ts +40 -0
- package/dist/convex/sensitive-actions.d.ts.map +1 -0
- package/dist/convex/sensitive-actions.js +220 -0
- package/dist/convex/sensitive-actions.js.map +1 -0
- package/dist/convex/test-models.d.ts +34 -0
- package/dist/convex/test-models.d.ts.map +1 -0
- package/dist/convex/test-models.js +121 -0
- package/dist/convex/test-models.js.map +1 -0
- package/dist/convex/tokens.d.ts +69 -0
- package/dist/convex/tokens.d.ts.map +1 -0
- package/dist/convex/tokens.js +101 -0
- package/dist/convex/tokens.js.map +1 -0
- package/dist/convex/urls.d.ts +9 -0
- package/dist/convex/urls.d.ts.map +1 -0
- package/dist/convex/urls.js +15 -0
- package/dist/convex/urls.js.map +1 -0
- package/dist/convex/visitor.d.ts +2 -0
- package/dist/convex/visitor.d.ts.map +1 -0
- package/dist/convex/visitor.js +51 -0
- package/dist/convex/visitor.js.map +1 -0
- package/dist/convex/waitlist-rules.d.ts +60 -0
- package/dist/convex/waitlist-rules.d.ts.map +1 -0
- package/dist/convex/waitlist-rules.js +107 -0
- package/dist/convex/waitlist-rules.js.map +1 -0
- package/dist/convex/web-push.d.ts +105 -0
- package/dist/convex/web-push.d.ts.map +1 -0
- package/dist/convex/web-push.js +192 -0
- package/dist/convex/web-push.js.map +1 -0
- package/dist/convex/webhook-signatures.d.ts +39 -0
- package/dist/convex/webhook-signatures.d.ts.map +1 -0
- package/dist/convex/webhook-signatures.js +140 -0
- package/dist/convex/webhook-signatures.js.map +1 -0
- package/dist/devtools/rpc-types.js +23 -0
- package/dist/devtools-client/_nuxt/CfQg3BRt.js +5 -0
- package/dist/devtools-client/_nuxt/entry.DsMplBp-.css +1 -0
- package/dist/devtools-client/icon.svg +11 -0
- package/dist/devtools-client/index.html +1 -0
- package/dist/env-registry.js +217 -0
- package/dist/eslint.d.mts +33 -0
- package/dist/eslint.mjs +39 -0
- package/dist/findings/types.js +1 -0
- package/dist/module.d.ts +128 -32
- package/dist/module.js +15 -275
- package/dist/module.json +6 -2
- package/dist/runtime/config.d.ts +172 -0
- package/dist/runtime/config.js +65 -0
- package/dist/runtime/devtools/bridge.d.ts +12 -0
- package/dist/runtime/devtools/bridge.js +70 -0
- package/dist/runtime/devtools/events.d.ts +11 -0
- package/dist/runtime/devtools/events.js +116 -0
- package/dist/runtime/devtools/on-demand.d.ts +11 -0
- package/dist/runtime/devtools/on-demand.js +101 -0
- package/dist/runtime/devtools/plugin.client.d.ts +8 -0
- package/dist/runtime/devtools/plugin.client.js +201 -0
- package/dist/runtime/devtools/types.d.ts +248 -0
- package/dist/runtime/devtools/types.js +0 -0
- package/dist/runtime/devtools/webhook-feed.d.ts +15 -0
- package/dist/runtime/devtools/webhook-feed.js +26 -0
- package/dist/runtime/image/provider.d.ts +25 -0
- package/dist/runtime/image/provider.js +9 -0
- package/dist/runtime/locales/de.json +2747 -0
- package/dist/runtime/locales/en.json +2747 -0
- package/dist/runtime/locales/es.json +2747 -0
- package/dist/runtime/locales/fr.json +2747 -0
- package/dist/runtime/locales/ru.json +2747 -0
- package/dist/runtime/monitoring/report.d.ts +35 -0
- package/dist/runtime/monitoring/report.js +23 -0
- package/dist/runtime/monitoring/sdk/capture.client.d.ts +11 -0
- package/dist/runtime/monitoring/sdk/capture.client.js +14 -0
- package/dist/runtime/monitoring/sdk/capture.server.d.ts +9 -0
- package/dist/runtime/monitoring/sdk/capture.server.js +9 -0
- package/dist/runtime/monitoring/sdk/feedback.d.ts +5 -0
- package/dist/runtime/monitoring/sdk/feedback.js +21 -0
- package/dist/runtime/monitoring/sdk/observe.client.d.ts +32 -0
- package/dist/runtime/monitoring/sdk/observe.client.js +42 -0
- package/dist/runtime/monitoring/sdk/preset.d.ts +74 -0
- package/dist/runtime/monitoring/sdk/preset.js +49 -0
- package/dist/runtime/monitoring/sdk/replay.d.ts +1 -0
- package/dist/runtime/monitoring/sdk/replay.js +1 -0
- package/dist/runtime/monitoring/sdk/sentry.client.config.d.ts +1 -0
- package/dist/runtime/monitoring/sdk/sentry.client.config.js +13 -0
- package/dist/runtime/monitoring/sdk/sentry.server.config.d.ts +1 -0
- package/dist/runtime/monitoring/sdk/sentry.server.config.js +12 -0
- package/dist/runtime/protection/botid-absent.d.ts +4 -0
- package/dist/runtime/protection/botid-absent.js +5 -0
- package/dist/runtime/server/backend-url.d.ts +17 -0
- package/dist/runtime/server/backend-url.js +9 -0
- package/dist/runtime/server/manifest.d.ts +2 -0
- package/dist/runtime/server/manifest.js +6 -0
- package/dist/runtime/server/monitoring/backend-calls.d.ts +9 -0
- package/dist/runtime/server/monitoring/backend-calls.js +17 -0
- package/dist/runtime/server/monitoring/capture.d.ts +15 -0
- package/dist/runtime/server/monitoring/capture.js +24 -0
- package/dist/runtime/server/monitoring/health.d.ts +15 -0
- package/dist/runtime/server/monitoring/health.js +48 -0
- package/dist/runtime/server/monitoring/local-log-route.d.ts +5 -0
- package/dist/runtime/server/monitoring/local-log-route.js +32 -0
- package/dist/runtime/server/monitoring/local-log.d.ts +19 -0
- package/dist/runtime/server/monitoring/local-log.js +38 -0
- package/dist/runtime/server/protection/csp.d.ts +17 -0
- package/dist/runtime/server/protection/csp.js +28 -0
- package/dist/runtime/server/protection/gate.d.ts +39 -0
- package/dist/runtime/server/protection/gate.js +104 -0
- package/dist/runtime/server/push-worker-source.d.ts +2 -0
- package/dist/runtime/server/push-worker-source.js +25 -0
- package/dist/runtime/server/push-worker.d.ts +2 -0
- package/dist/runtime/server/push-worker.js +9 -0
- package/dist/runtime/server/site-url.d.ts +5 -0
- package/dist/runtime/server/site-url.js +5 -0
- package/dist/runtime/server/tsconfig.json +6 -0
- package/dist/runtime/server/visitor-ip.d.ts +4 -0
- package/dist/runtime/server/visitor-ip.js +5 -0
- package/dist/runtime/test-utils/aliases.d.ts +39 -0
- package/dist/runtime/test-utils/aliases.js +26 -0
- package/dist/runtime/test-utils/auth-answers.d.ts +85 -0
- package/dist/runtime/test-utils/auth-answers.js +194 -0
- package/dist/runtime/test-utils/auth-client.d.ts +3 -0
- package/dist/runtime/test-utils/auth-client.js +69 -0
- package/dist/runtime/test-utils/base-modules.d.ts +17 -0
- package/dist/runtime/test-utils/client.d.ts +24 -0
- package/dist/runtime/test-utils/client.js +29 -0
- package/dist/runtime/test-utils/email.d.ts +29 -0
- package/dist/runtime/test-utils/email.js +7 -0
- package/dist/runtime/test-utils/index.d.ts +20 -0
- package/dist/runtime/test-utils/index.js +7 -0
- package/dist/runtime/test-utils/install.d.ts +58 -0
- package/dist/runtime/test-utils/install.js +114 -0
- package/dist/runtime/test-utils/mock.d.ts +245 -0
- package/dist/runtime/test-utils/mock.js +130 -0
- package/dist/runtime/vue/a11y.d.ts +74 -0
- package/dist/runtime/vue/a11y.js +94 -0
- package/dist/runtime/vue/admin-client.d.ts +18 -0
- package/dist/runtime/vue/admin-client.js +32 -0
- package/dist/runtime/vue/auth-client.d.ts +45 -0
- package/dist/runtime/vue/auth-client.js +9 -0
- package/dist/runtime/vue/components/account/AccountData.css +1 -0
- package/dist/runtime/vue/components/account/AccountData.d.vue.ts +55 -0
- package/dist/runtime/vue/components/account/AccountData.vue +150 -0
- package/dist/runtime/vue/components/account/AccountData.vue.d.ts +55 -0
- package/dist/runtime/vue/components/account/AccountDeletion.css +1 -0
- package/dist/runtime/vue/components/account/AccountDeletion.d.vue.ts +3 -0
- package/dist/runtime/vue/components/account/AccountDeletion.vue +95 -0
- package/dist/runtime/vue/components/account/AccountDeletion.vue.d.ts +3 -0
- package/dist/runtime/vue/components/account/AccountExport.css +1 -0
- package/dist/runtime/vue/components/account/AccountExport.d.vue.ts +3 -0
- package/dist/runtime/vue/components/account/AccountExport.vue +65 -0
- package/dist/runtime/vue/components/account/AccountExport.vue.d.ts +3 -0
- package/dist/runtime/vue/components/account/ActivationChecklist.css +1 -0
- package/dist/runtime/vue/components/account/ActivationChecklist.d.vue.ts +22 -0
- package/dist/runtime/vue/components/account/ActivationChecklist.vue +121 -0
- package/dist/runtime/vue/components/account/ActivationChecklist.vue.d.ts +22 -0
- package/dist/runtime/vue/components/account/ConsentPrompt.css +1 -0
- package/dist/runtime/vue/components/account/ConsentPrompt.d.vue.ts +53 -0
- package/dist/runtime/vue/components/account/ConsentPrompt.vue +106 -0
- package/dist/runtime/vue/components/account/ConsentPrompt.vue.d.ts +53 -0
- package/dist/runtime/vue/components/account/ConsentPromptAge.d.vue.ts +16 -0
- package/dist/runtime/vue/components/account/ConsentPromptAge.vue +26 -0
- package/dist/runtime/vue/components/account/ConsentPromptAge.vue.d.ts +16 -0
- package/dist/runtime/vue/components/account/ConsentPromptDialog.d.vue.ts +49 -0
- package/dist/runtime/vue/components/account/ConsentPromptDialog.vue +116 -0
- package/dist/runtime/vue/components/account/ConsentPromptDialog.vue.d.ts +49 -0
- package/dist/runtime/vue/components/account/ConsentPromptItem.d.vue.ts +28 -0
- package/dist/runtime/vue/components/account/ConsentPromptItem.vue +44 -0
- package/dist/runtime/vue/components/account/ConsentPromptItem.vue.d.ts +28 -0
- package/dist/runtime/vue/components/account/ConsentPromptStorage.d.vue.ts +15 -0
- package/dist/runtime/vue/components/account/ConsentPromptStorage.vue +67 -0
- package/dist/runtime/vue/components/account/ConsentPromptStorage.vue.d.ts +15 -0
- package/dist/runtime/vue/components/account/EmailUnsubscribe.css +1 -0
- package/dist/runtime/vue/components/account/EmailUnsubscribe.d.vue.ts +13 -0
- package/dist/runtime/vue/components/account/EmailUnsubscribe.vue +107 -0
- package/dist/runtime/vue/components/account/EmailUnsubscribe.vue.d.ts +13 -0
- package/dist/runtime/vue/components/account/HowDidYouHear.css +1 -0
- package/dist/runtime/vue/components/account/HowDidYouHear.d.vue.ts +24 -0
- package/dist/runtime/vue/components/account/HowDidYouHear.vue +149 -0
- package/dist/runtime/vue/components/account/HowDidYouHear.vue.d.ts +24 -0
- package/dist/runtime/vue/components/account/KeepAccount.css +1 -0
- package/dist/runtime/vue/components/account/KeepAccount.d.vue.ts +10 -0
- package/dist/runtime/vue/components/account/KeepAccount.vue +54 -0
- package/dist/runtime/vue/components/account/KeepAccount.vue.d.ts +10 -0
- package/dist/runtime/vue/components/account/OnboardingFlow.css +1 -0
- package/dist/runtime/vue/components/account/OnboardingFlow.d.vue.ts +77 -0
- package/dist/runtime/vue/components/account/OnboardingFlow.vue +138 -0
- package/dist/runtime/vue/components/account/OnboardingFlow.vue.d.ts +77 -0
- package/dist/runtime/vue/components/account/OnboardingPlan.d.vue.ts +3 -0
- package/dist/runtime/vue/components/account/OnboardingPlan.vue +36 -0
- package/dist/runtime/vue/components/account/OnboardingPlan.vue.d.ts +3 -0
- package/dist/runtime/vue/components/account/OnboardingProfile.d.vue.ts +3 -0
- package/dist/runtime/vue/components/account/OnboardingProfile.vue +111 -0
- package/dist/runtime/vue/components/account/OnboardingProfile.vue.d.ts +3 -0
- package/dist/runtime/vue/components/account/OnboardingStepActions.d.vue.ts +10 -0
- package/dist/runtime/vue/components/account/OnboardingStepActions.vue +38 -0
- package/dist/runtime/vue/components/account/OnboardingStepActions.vue.d.ts +10 -0
- package/dist/runtime/vue/components/account/OnboardingTeammates.d.vue.ts +3 -0
- package/dist/runtime/vue/components/account/OnboardingTeammates.vue +102 -0
- package/dist/runtime/vue/components/account/OnboardingTeammates.vue.d.ts +3 -0
- package/dist/runtime/vue/components/account/OnboardingWorkspace.d.vue.ts +3 -0
- package/dist/runtime/vue/components/account/OnboardingWorkspace.vue +154 -0
- package/dist/runtime/vue/components/account/OnboardingWorkspace.vue.d.ts +3 -0
- package/dist/runtime/vue/components/account/ProfileEmailSection.d.vue.ts +4 -0
- package/dist/runtime/vue/components/account/ProfileEmailSection.vue +97 -0
- package/dist/runtime/vue/components/account/ProfileEmailSection.vue.d.ts +4 -0
- package/dist/runtime/vue/components/account/ProfileIdentity.css +1 -0
- package/dist/runtime/vue/components/account/ProfileIdentity.d.vue.ts +3 -0
- package/dist/runtime/vue/components/account/ProfileIdentity.vue +50 -0
- package/dist/runtime/vue/components/account/ProfileIdentity.vue.d.ts +3 -0
- package/dist/runtime/vue/components/account/ProfileLanguageSection.d.vue.ts +3 -0
- package/dist/runtime/vue/components/account/ProfileLanguageSection.vue +43 -0
- package/dist/runtime/vue/components/account/ProfileLanguageSection.vue.d.ts +3 -0
- package/dist/runtime/vue/components/account/ProfileNameSection.d.vue.ts +3 -0
- package/dist/runtime/vue/components/account/ProfileNameSection.vue +35 -0
- package/dist/runtime/vue/components/account/ProfileNameSection.vue.d.ts +3 -0
- package/dist/runtime/vue/components/account/ProfilePreferencesSection.css +1 -0
- package/dist/runtime/vue/components/account/ProfilePreferencesSection.d.vue.ts +4 -0
- package/dist/runtime/vue/components/account/ProfilePreferencesSection.vue +155 -0
- package/dist/runtime/vue/components/account/ProfilePreferencesSection.vue.d.ts +4 -0
- package/dist/runtime/vue/components/account/ProfileSettings.css +1 -0
- package/dist/runtime/vue/components/account/ProfileSettings.d.vue.ts +61 -0
- package/dist/runtime/vue/components/account/ProfileSettings.vue +201 -0
- package/dist/runtime/vue/components/account/ProfileSettings.vue.d.ts +61 -0
- package/dist/runtime/vue/components/account/SecurityAlerts.css +1 -0
- package/dist/runtime/vue/components/account/SecurityAlerts.d.vue.ts +4 -0
- package/dist/runtime/vue/components/account/SecurityAlerts.vue +70 -0
- package/dist/runtime/vue/components/account/SecurityAlerts.vue.d.ts +4 -0
- package/dist/runtime/vue/components/account/SecurityPasskeys.css +1 -0
- package/dist/runtime/vue/components/account/SecurityPasskeys.d.vue.ts +4 -0
- package/dist/runtime/vue/components/account/SecurityPasskeys.vue +152 -0
- package/dist/runtime/vue/components/account/SecurityPasskeys.vue.d.ts +4 -0
- package/dist/runtime/vue/components/account/SecuritySessions.css +1 -0
- package/dist/runtime/vue/components/account/SecuritySessions.d.vue.ts +4 -0
- package/dist/runtime/vue/components/account/SecuritySessions.vue +84 -0
- package/dist/runtime/vue/components/account/SecuritySessions.vue.d.ts +4 -0
- package/dist/runtime/vue/components/account/SecuritySettings.css +1 -0
- package/dist/runtime/vue/components/account/SecuritySettings.d.vue.ts +87 -0
- package/dist/runtime/vue/components/account/SecuritySettings.vue +225 -0
- package/dist/runtime/vue/components/account/SecuritySettings.vue.d.ts +87 -0
- package/dist/runtime/vue/components/account/account-data.d.ts +49 -0
- package/dist/runtime/vue/components/account/account-data.js +10 -0
- package/dist/runtime/vue/components/account/activation-checklist.d.ts +10 -0
- package/dist/runtime/vue/components/account/activation-checklist.js +0 -0
- package/dist/runtime/vue/components/account/consent-prompt.d.ts +28 -0
- package/dist/runtime/vue/components/account/consent-prompt.js +0 -0
- package/dist/runtime/vue/components/account/how-did-you-hear.d.ts +10 -0
- package/dist/runtime/vue/components/account/how-did-you-hear.js +3 -0
- package/dist/runtime/vue/components/account/onboarding-flow.d.ts +30 -0
- package/dist/runtime/vue/components/account/onboarding-flow.js +0 -0
- package/dist/runtime/vue/components/account/profile-settings.d.ts +68 -0
- package/dist/runtime/vue/components/account/profile-settings.js +10 -0
- package/dist/runtime/vue/components/account/security-alerts.d.ts +13 -0
- package/dist/runtime/vue/components/account/security-alerts.js +20 -0
- package/dist/runtime/vue/components/account/security-settings.d.ts +69 -0
- package/dist/runtime/vue/components/account/security-settings.js +10 -0
- package/dist/runtime/vue/components/admin/AdminAccess.css +1 -0
- package/dist/runtime/vue/components/admin/AdminAccess.d.vue.ts +7 -0
- package/dist/runtime/vue/components/admin/AdminAccess.vue +46 -0
- package/dist/runtime/vue/components/admin/AdminAccess.vue.d.ts +7 -0
- package/dist/runtime/vue/components/admin/AdminAccessAdmissions.d.vue.ts +7 -0
- package/dist/runtime/vue/components/admin/AdminAccessAdmissions.vue +51 -0
- package/dist/runtime/vue/components/admin/AdminAccessAdmissions.vue.d.ts +7 -0
- package/dist/runtime/vue/components/admin/AdminAccessAdmit.d.vue.ts +6 -0
- package/dist/runtime/vue/components/admin/AdminAccessAdmit.vue +65 -0
- package/dist/runtime/vue/components/admin/AdminAccessAdmit.vue.d.ts +6 -0
- package/dist/runtime/vue/components/admin/AdminAccessCreate.d.vue.ts +6 -0
- package/dist/runtime/vue/components/admin/AdminAccessCreate.vue +78 -0
- package/dist/runtime/vue/components/admin/AdminAccessCreate.vue.d.ts +6 -0
- package/dist/runtime/vue/components/admin/AdminAccessInvites.d.vue.ts +7 -0
- package/dist/runtime/vue/components/admin/AdminAccessInvites.vue +47 -0
- package/dist/runtime/vue/components/admin/AdminAccessInvites.vue.d.ts +7 -0
- package/dist/runtime/vue/components/admin/AdminAccessPhase.d.vue.ts +7 -0
- package/dist/runtime/vue/components/admin/AdminAccessPhase.vue +43 -0
- package/dist/runtime/vue/components/admin/AdminAccessPhase.vue.d.ts +7 -0
- package/dist/runtime/vue/components/admin/AdminAccessRevoke.d.vue.ts +10 -0
- package/dist/runtime/vue/components/admin/AdminAccessRevoke.vue +18 -0
- package/dist/runtime/vue/components/admin/AdminAccessRevoke.vue.d.ts +10 -0
- package/dist/runtime/vue/components/admin/AdminAccessTable.d.vue.ts +18 -0
- package/dist/runtime/vue/components/admin/AdminAccessTable.vue +50 -0
- package/dist/runtime/vue/components/admin/AdminAccessTable.vue.d.ts +18 -0
- package/dist/runtime/vue/components/admin/AdminAnalytics.css +1 -0
- package/dist/runtime/vue/components/admin/AdminAnalytics.d.vue.ts +3 -0
- package/dist/runtime/vue/components/admin/AdminAnalytics.vue +34 -0
- package/dist/runtime/vue/components/admin/AdminAnalytics.vue.d.ts +3 -0
- package/dist/runtime/vue/components/admin/AdminAnnouncements.css +1 -0
- package/dist/runtime/vue/components/admin/AdminAnnouncements.d.vue.ts +7 -0
- package/dist/runtime/vue/components/admin/AdminAnnouncements.vue +79 -0
- package/dist/runtime/vue/components/admin/AdminAnnouncements.vue.d.ts +7 -0
- package/dist/runtime/vue/components/admin/AdminAnnouncementsCompose.d.vue.ts +6 -0
- package/dist/runtime/vue/components/admin/AdminAnnouncementsCompose.vue +132 -0
- package/dist/runtime/vue/components/admin/AdminAnnouncementsCompose.vue.d.ts +6 -0
- package/dist/runtime/vue/components/admin/AdminAnnouncementsItem.d.vue.ts +8 -0
- package/dist/runtime/vue/components/admin/AdminAnnouncementsItem.vue +81 -0
- package/dist/runtime/vue/components/admin/AdminAnnouncementsItem.vue.d.ts +8 -0
- package/dist/runtime/vue/components/admin/AdminBilling.css +1 -0
- package/dist/runtime/vue/components/admin/AdminBilling.d.vue.ts +3 -0
- package/dist/runtime/vue/components/admin/AdminBilling.vue +200 -0
- package/dist/runtime/vue/components/admin/AdminBilling.vue.d.ts +3 -0
- package/dist/runtime/vue/components/admin/AdminChart.css +1 -0
- package/dist/runtime/vue/components/admin/AdminChart.d.vue.ts +10 -0
- package/dist/runtime/vue/components/admin/AdminChart.vue +31 -0
- package/dist/runtime/vue/components/admin/AdminChart.vue.d.ts +10 -0
- package/dist/runtime/vue/components/admin/AdminConsole.css +1 -0
- package/dist/runtime/vue/components/admin/AdminConsole.d.vue.ts +38 -0
- package/dist/runtime/vue/components/admin/AdminConsole.vue +131 -0
- package/dist/runtime/vue/components/admin/AdminConsole.vue.d.ts +38 -0
- package/dist/runtime/vue/components/admin/AdminCosts.css +1 -0
- package/dist/runtime/vue/components/admin/AdminCosts.d.vue.ts +3 -0
- package/dist/runtime/vue/components/admin/AdminCosts.vue +120 -0
- package/dist/runtime/vue/components/admin/AdminCosts.vue.d.ts +3 -0
- package/dist/runtime/vue/components/admin/AdminDrawerFrame.d.vue.ts +24 -0
- package/dist/runtime/vue/components/admin/AdminDrawerFrame.vue +71 -0
- package/dist/runtime/vue/components/admin/AdminDrawerFrame.vue.d.ts +24 -0
- package/dist/runtime/vue/components/admin/AdminExperiments.css +1 -0
- package/dist/runtime/vue/components/admin/AdminExperiments.d.vue.ts +3 -0
- package/dist/runtime/vue/components/admin/AdminExperiments.vue +159 -0
- package/dist/runtime/vue/components/admin/AdminExperiments.vue.d.ts +3 -0
- package/dist/runtime/vue/components/admin/AdminFlags.css +1 -0
- package/dist/runtime/vue/components/admin/AdminFlags.d.vue.ts +9 -0
- package/dist/runtime/vue/components/admin/AdminFlags.vue +429 -0
- package/dist/runtime/vue/components/admin/AdminFlags.vue.d.ts +9 -0
- package/dist/runtime/vue/components/admin/AdminGrowth.css +1 -0
- package/dist/runtime/vue/components/admin/AdminGrowth.d.vue.ts +3 -0
- package/dist/runtime/vue/components/admin/AdminGrowth.vue +204 -0
- package/dist/runtime/vue/components/admin/AdminGrowth.vue.d.ts +3 -0
- package/dist/runtime/vue/components/admin/AdminInbox.css +1 -0
- package/dist/runtime/vue/components/admin/AdminInbox.d.vue.ts +3 -0
- package/dist/runtime/vue/components/admin/AdminInbox.vue +81 -0
- package/dist/runtime/vue/components/admin/AdminInbox.vue.d.ts +3 -0
- package/dist/runtime/vue/components/admin/AdminInboxMessage.d.vue.ts +8 -0
- package/dist/runtime/vue/components/admin/AdminInboxMessage.vue +107 -0
- package/dist/runtime/vue/components/admin/AdminInboxMessage.vue.d.ts +8 -0
- package/dist/runtime/vue/components/admin/AdminListFrame.d.vue.ts +29 -0
- package/dist/runtime/vue/components/admin/AdminListFrame.vue +77 -0
- package/dist/runtime/vue/components/admin/AdminListFrame.vue.d.ts +29 -0
- package/dist/runtime/vue/components/admin/AdminListTail.d.vue.ts +14 -0
- package/dist/runtime/vue/components/admin/AdminListTail.vue +38 -0
- package/dist/runtime/vue/components/admin/AdminListTail.vue.d.ts +14 -0
- package/dist/runtime/vue/components/admin/AdminQueue.css +1 -0
- package/dist/runtime/vue/components/admin/AdminQueue.d.vue.ts +3 -0
- package/dist/runtime/vue/components/admin/AdminQueue.vue +90 -0
- package/dist/runtime/vue/components/admin/AdminQueue.vue.d.ts +3 -0
- package/dist/runtime/vue/components/admin/AdminQueueControls.d.vue.ts +10 -0
- package/dist/runtime/vue/components/admin/AdminQueueControls.vue +56 -0
- package/dist/runtime/vue/components/admin/AdminQueueControls.vue.d.ts +10 -0
- package/dist/runtime/vue/components/admin/AdminQueueJob.d.vue.ts +10 -0
- package/dist/runtime/vue/components/admin/AdminQueueJob.vue +49 -0
- package/dist/runtime/vue/components/admin/AdminQueueJob.vue.d.ts +10 -0
- package/dist/runtime/vue/components/admin/AdminQueueJobs.d.vue.ts +8 -0
- package/dist/runtime/vue/components/admin/AdminQueueJobs.vue +82 -0
- package/dist/runtime/vue/components/admin/AdminQueueJobs.vue.d.ts +8 -0
- package/dist/runtime/vue/components/admin/AdminQueueModels.d.vue.ts +10 -0
- package/dist/runtime/vue/components/admin/AdminQueueModels.vue +84 -0
- package/dist/runtime/vue/components/admin/AdminQueueModels.vue.d.ts +10 -0
- package/dist/runtime/vue/components/admin/AdminQueueTier.d.vue.ts +10 -0
- package/dist/runtime/vue/components/admin/AdminQueueTier.vue +83 -0
- package/dist/runtime/vue/components/admin/AdminQueueTier.vue.d.ts +10 -0
- package/dist/runtime/vue/components/admin/AdminQueueTiers.d.vue.ts +10 -0
- package/dist/runtime/vue/components/admin/AdminQueueTiers.vue +40 -0
- package/dist/runtime/vue/components/admin/AdminQueueTiers.vue.d.ts +10 -0
- package/dist/runtime/vue/components/admin/AdminReferrals.css +1 -0
- package/dist/runtime/vue/components/admin/AdminReferrals.d.vue.ts +7 -0
- package/dist/runtime/vue/components/admin/AdminReferrals.vue +245 -0
- package/dist/runtime/vue/components/admin/AdminReferrals.vue.d.ts +7 -0
- package/dist/runtime/vue/components/admin/AdminReports.css +1 -0
- package/dist/runtime/vue/components/admin/AdminReports.d.vue.ts +7 -0
- package/dist/runtime/vue/components/admin/AdminReports.vue +122 -0
- package/dist/runtime/vue/components/admin/AdminReports.vue.d.ts +7 -0
- package/dist/runtime/vue/components/admin/AdminReportsAppeal.d.vue.ts +9 -0
- package/dist/runtime/vue/components/admin/AdminReportsAppeal.vue +55 -0
- package/dist/runtime/vue/components/admin/AdminReportsAppeal.vue.d.ts +9 -0
- package/dist/runtime/vue/components/admin/AdminReportsDecision.d.vue.ts +14 -0
- package/dist/runtime/vue/components/admin/AdminReportsDecision.vue +72 -0
- package/dist/runtime/vue/components/admin/AdminReportsDecision.vue.d.ts +14 -0
- package/dist/runtime/vue/components/admin/AdminReportsNotice.d.vue.ts +8 -0
- package/dist/runtime/vue/components/admin/AdminReportsNotice.vue +47 -0
- package/dist/runtime/vue/components/admin/AdminReportsNotice.vue.d.ts +8 -0
- package/dist/runtime/vue/components/admin/AdminReportsSubject.d.vue.ts +8 -0
- package/dist/runtime/vue/components/admin/AdminReportsSubject.vue +76 -0
- package/dist/runtime/vue/components/admin/AdminReportsSubject.vue.d.ts +8 -0
- package/dist/runtime/vue/components/admin/AdminRevenue.css +1 -0
- package/dist/runtime/vue/components/admin/AdminRevenue.d.vue.ts +3 -0
- package/dist/runtime/vue/components/admin/AdminRevenue.vue +197 -0
- package/dist/runtime/vue/components/admin/AdminRevenue.vue.d.ts +3 -0
- package/dist/runtime/vue/components/admin/AdminSuppressions.css +1 -0
- package/dist/runtime/vue/components/admin/AdminSuppressions.d.vue.ts +3 -0
- package/dist/runtime/vue/components/admin/AdminSuppressions.vue +98 -0
- package/dist/runtime/vue/components/admin/AdminSuppressions.vue.d.ts +3 -0
- package/dist/runtime/vue/components/admin/AdminSystem.d.vue.ts +3 -0
- package/dist/runtime/vue/components/admin/AdminSystem.vue +125 -0
- package/dist/runtime/vue/components/admin/AdminSystem.vue.d.ts +3 -0
- package/dist/runtime/vue/components/admin/AdminTabDialogs.d.vue.ts +8 -0
- package/dist/runtime/vue/components/admin/AdminTabDialogs.vue +18 -0
- package/dist/runtime/vue/components/admin/AdminTabDialogs.vue.d.ts +8 -0
- package/dist/runtime/vue/components/admin/AdminTabStatus.d.vue.ts +7 -0
- package/dist/runtime/vue/components/admin/AdminTabStatus.vue +26 -0
- package/dist/runtime/vue/components/admin/AdminTabStatus.vue.d.ts +7 -0
- package/dist/runtime/vue/components/admin/AdminUserDrawer.d.vue.ts +4 -0
- package/dist/runtime/vue/components/admin/AdminUserDrawer.vue +294 -0
- package/dist/runtime/vue/components/admin/AdminUserDrawer.vue.d.ts +4 -0
- package/dist/runtime/vue/components/admin/AdminUsers.d.vue.ts +863 -0
- package/dist/runtime/vue/components/admin/AdminUsers.vue +157 -0
- package/dist/runtime/vue/components/admin/AdminUsers.vue.d.ts +863 -0
- package/dist/runtime/vue/components/admin/AdminUsersTable.d.vue.ts +3 -0
- package/dist/runtime/vue/components/admin/AdminUsersTable.vue +108 -0
- package/dist/runtime/vue/components/admin/AdminUsersTable.vue.d.ts +3 -0
- package/dist/runtime/vue/components/admin/AdminWaitlist.css +1 -0
- package/dist/runtime/vue/components/admin/AdminWaitlist.d.vue.ts +7 -0
- package/dist/runtime/vue/components/admin/AdminWaitlist.vue +63 -0
- package/dist/runtime/vue/components/admin/AdminWaitlist.vue.d.ts +7 -0
- package/dist/runtime/vue/components/admin/AdminWaitlistActions.d.vue.ts +6 -0
- package/dist/runtime/vue/components/admin/AdminWaitlistActions.vue +58 -0
- package/dist/runtime/vue/components/admin/AdminWaitlistActions.vue.d.ts +6 -0
- package/dist/runtime/vue/components/admin/AdminWaitlistFilter.d.vue.ts +6 -0
- package/dist/runtime/vue/components/admin/AdminWaitlistFilter.vue +86 -0
- package/dist/runtime/vue/components/admin/AdminWaitlistFilter.vue.d.ts +6 -0
- package/dist/runtime/vue/components/admin/AdminWaitlistSummary.d.vue.ts +8 -0
- package/dist/runtime/vue/components/admin/AdminWaitlistSummary.vue +63 -0
- package/dist/runtime/vue/components/admin/AdminWaitlistSummary.vue.d.ts +8 -0
- package/dist/runtime/vue/components/admin/AdminWaitlistTable.d.vue.ts +6 -0
- package/dist/runtime/vue/components/admin/AdminWaitlistTable.vue +75 -0
- package/dist/runtime/vue/components/admin/AdminWaitlistTable.vue.d.ts +6 -0
- package/dist/runtime/vue/components/admin/AdminWebhooks.css +1 -0
- package/dist/runtime/vue/components/admin/AdminWebhooks.d.vue.ts +3 -0
- package/dist/runtime/vue/components/admin/AdminWebhooks.vue +141 -0
- package/dist/runtime/vue/components/admin/AdminWebhooks.vue.d.ts +3 -0
- package/dist/runtime/vue/components/admin/AdminWorkspaceDrawer.d.vue.ts +4 -0
- package/dist/runtime/vue/components/admin/AdminWorkspaceDrawer.vue +99 -0
- package/dist/runtime/vue/components/admin/AdminWorkspaceDrawer.vue.d.ts +4 -0
- package/dist/runtime/vue/components/admin/AdminWorkspaces.d.vue.ts +846 -0
- package/dist/runtime/vue/components/admin/AdminWorkspaces.vue +90 -0
- package/dist/runtime/vue/components/admin/AdminWorkspaces.vue.d.ts +846 -0
- package/dist/runtime/vue/components/admin/AdminWorkspacesTable.d.vue.ts +3 -0
- package/dist/runtime/vue/components/admin/AdminWorkspacesTable.vue +81 -0
- package/dist/runtime/vue/components/admin/AdminWorkspacesTable.vue.d.ts +3 -0
- package/dist/runtime/vue/components/admin/admin-access-tab.d.ts +2 -0
- package/dist/runtime/vue/components/admin/admin-access-tab.js +88 -0
- package/dist/runtime/vue/components/admin/admin-analytics-tab.d.ts +1 -0
- package/dist/runtime/vue/components/admin/admin-analytics-tab.js +19 -0
- package/dist/runtime/vue/components/admin/admin-announcements-tab.d.ts +2 -0
- package/dist/runtime/vue/components/admin/admin-announcements-tab.js +97 -0
- package/dist/runtime/vue/components/admin/admin-billing-tab.d.ts +1 -0
- package/dist/runtime/vue/components/admin/admin-billing-tab.js +43 -0
- package/dist/runtime/vue/components/admin/admin-costs-tab.d.ts +1 -0
- package/dist/runtime/vue/components/admin/admin-costs-tab.js +23 -0
- package/dist/runtime/vue/components/admin/admin-experiments-tab.d.ts +1 -0
- package/dist/runtime/vue/components/admin/admin-experiments-tab.js +60 -0
- package/dist/runtime/vue/components/admin/admin-growth-tab.d.ts +1 -0
- package/dist/runtime/vue/components/admin/admin-growth-tab.js +58 -0
- package/dist/runtime/vue/components/admin/admin-inbox-tab.d.ts +4 -0
- package/dist/runtime/vue/components/admin/admin-inbox-tab.js +44 -0
- package/dist/runtime/vue/components/admin/admin-reports-tab.d.ts +21 -0
- package/dist/runtime/vue/components/admin/admin-reports-tab.js +89 -0
- package/dist/runtime/vue/components/admin/admin-revenue-tab.d.ts +12 -0
- package/dist/runtime/vue/components/admin/admin-revenue-tab.js +81 -0
- package/dist/runtime/vue/components/admin/admin-suppressions-tab.d.ts +1 -0
- package/dist/runtime/vue/components/admin/admin-suppressions-tab.js +27 -0
- package/dist/runtime/vue/components/admin/admin-tabs.d.ts +86 -0
- package/dist/runtime/vue/components/admin/admin-tabs.js +69 -0
- package/dist/runtime/vue/components/admin/admin-views.d.ts +34 -0
- package/dist/runtime/vue/components/admin/admin-views.js +22 -0
- package/dist/runtime/vue/components/admin/admin-waitlist-tab.d.ts +2 -0
- package/dist/runtime/vue/components/admin/admin-waitlist-tab.js +93 -0
- package/dist/runtime/vue/components/admin/admin-webhooks-tab.d.ts +5 -0
- package/dist/runtime/vue/components/admin/admin-webhooks-tab.js +35 -0
- package/dist/runtime/vue/components/admin/admin.css +1 -0
- package/dist/runtime/vue/components/admin/admin.d.ts +132 -0
- package/dist/runtime/vue/components/admin/admin.js +96 -0
- package/dist/runtime/vue/components/auth/AuthForm.css +1 -0
- package/dist/runtime/vue/components/auth/AuthForm.d.vue.ts +90 -0
- package/dist/runtime/vue/components/auth/AuthForm.vue +192 -0
- package/dist/runtime/vue/components/auth/AuthForm.vue.d.ts +90 -0
- package/dist/runtime/vue/components/auth/AuthFormAge.css +1 -0
- package/dist/runtime/vue/components/auth/AuthFormAge.d.vue.ts +3 -0
- package/dist/runtime/vue/components/auth/AuthFormAge.vue +42 -0
- package/dist/runtime/vue/components/auth/AuthFormAge.vue.d.ts +3 -0
- package/dist/runtime/vue/components/auth/AuthFormAgreement.css +1 -0
- package/dist/runtime/vue/components/auth/AuthFormAgreement.d.vue.ts +3 -0
- package/dist/runtime/vue/components/auth/AuthFormAgreement.vue +31 -0
- package/dist/runtime/vue/components/auth/AuthFormAgreement.vue.d.ts +3 -0
- package/dist/runtime/vue/components/auth/AuthFormChoose.css +1 -0
- package/dist/runtime/vue/components/auth/AuthFormChoose.d.vue.ts +3 -0
- package/dist/runtime/vue/components/auth/AuthFormChoose.vue +44 -0
- package/dist/runtime/vue/components/auth/AuthFormChoose.vue.d.ts +3 -0
- package/dist/runtime/vue/components/auth/AuthFormCode.d.vue.ts +3 -0
- package/dist/runtime/vue/components/auth/AuthFormCode.vue +46 -0
- package/dist/runtime/vue/components/auth/AuthFormCode.vue.d.ts +3 -0
- package/dist/runtime/vue/components/auth/AuthFormEmail.d.vue.ts +3 -0
- package/dist/runtime/vue/components/auth/AuthFormEmail.vue +40 -0
- package/dist/runtime/vue/components/auth/AuthFormEmail.vue.d.ts +3 -0
- package/dist/runtime/vue/components/auth/AuthFormError.css +1 -0
- package/dist/runtime/vue/components/auth/AuthFormError.d.vue.ts +3 -0
- package/dist/runtime/vue/components/auth/AuthFormError.vue +18 -0
- package/dist/runtime/vue/components/auth/AuthFormError.vue.d.ts +3 -0
- package/dist/runtime/vue/components/auth/AuthFormHeader.css +1 -0
- package/dist/runtime/vue/components/auth/AuthFormHeader.d.vue.ts +3 -0
- package/dist/runtime/vue/components/auth/AuthFormHeader.vue +25 -0
- package/dist/runtime/vue/components/auth/AuthFormHeader.vue.d.ts +3 -0
- package/dist/runtime/vue/components/auth/AuthFormInviteCode.css +1 -0
- package/dist/runtime/vue/components/auth/AuthFormInviteCode.d.vue.ts +3 -0
- package/dist/runtime/vue/components/auth/AuthFormInviteCode.vue +48 -0
- package/dist/runtime/vue/components/auth/AuthFormInviteCode.vue.d.ts +3 -0
- package/dist/runtime/vue/components/auth/AuthFormPasskey.d.vue.ts +3 -0
- package/dist/runtime/vue/components/auth/AuthFormPasskey.vue +26 -0
- package/dist/runtime/vue/components/auth/AuthFormPasskey.vue.d.ts +3 -0
- package/dist/runtime/vue/components/auth/AuthFormPasskeyOffer.css +1 -0
- package/dist/runtime/vue/components/auth/AuthFormPasskeyOffer.d.vue.ts +3 -0
- package/dist/runtime/vue/components/auth/AuthFormPasskeyOffer.vue +46 -0
- package/dist/runtime/vue/components/auth/AuthFormPasskeyOffer.vue.d.ts +3 -0
- package/dist/runtime/vue/components/auth/AuthFormRecover.css +1 -0
- package/dist/runtime/vue/components/auth/AuthFormRecover.d.vue.ts +3 -0
- package/dist/runtime/vue/components/auth/AuthFormRecover.vue +52 -0
- package/dist/runtime/vue/components/auth/AuthFormRecover.vue.d.ts +3 -0
- package/dist/runtime/vue/components/auth/AuthFormUndeliverable.css +1 -0
- package/dist/runtime/vue/components/auth/AuthFormUndeliverable.d.vue.ts +3 -0
- package/dist/runtime/vue/components/auth/AuthFormUndeliverable.vue +29 -0
- package/dist/runtime/vue/components/auth/AuthFormUndeliverable.vue.d.ts +3 -0
- package/dist/runtime/vue/components/auth/AuthFormWaitlisted.css +1 -0
- package/dist/runtime/vue/components/auth/AuthFormWaitlisted.d.vue.ts +3 -0
- package/dist/runtime/vue/components/auth/AuthFormWaitlisted.vue +36 -0
- package/dist/runtime/vue/components/auth/AuthFormWaitlisted.vue.d.ts +3 -0
- package/dist/runtime/vue/components/auth/InviteRedeem.css +1 -0
- package/dist/runtime/vue/components/auth/InviteRedeem.d.vue.ts +3 -0
- package/dist/runtime/vue/components/auth/InviteRedeem.vue +47 -0
- package/dist/runtime/vue/components/auth/InviteRedeem.vue.d.ts +3 -0
- package/dist/runtime/vue/components/auth/ReauthenticateCode.css +1 -0
- package/dist/runtime/vue/components/auth/ReauthenticateCode.d.vue.ts +3 -0
- package/dist/runtime/vue/components/auth/ReauthenticateCode.vue +57 -0
- package/dist/runtime/vue/components/auth/ReauthenticateCode.vue.d.ts +3 -0
- package/dist/runtime/vue/components/auth/ReauthenticateDialog.css +1 -0
- package/dist/runtime/vue/components/auth/ReauthenticateDialog.d.vue.ts +43 -0
- package/dist/runtime/vue/components/auth/ReauthenticateDialog.vue +136 -0
- package/dist/runtime/vue/components/auth/ReauthenticateDialog.vue.d.ts +43 -0
- package/dist/runtime/vue/components/auth/ReauthenticatePasskey.css +1 -0
- package/dist/runtime/vue/components/auth/ReauthenticatePasskey.d.vue.ts +3 -0
- package/dist/runtime/vue/components/auth/ReauthenticatePasskey.vue +36 -0
- package/dist/runtime/vue/components/auth/ReauthenticatePasskey.vue.d.ts +3 -0
- package/dist/runtime/vue/components/auth/WaitlistCode.css +1 -0
- package/dist/runtime/vue/components/auth/WaitlistCode.d.vue.ts +3 -0
- package/dist/runtime/vue/components/auth/WaitlistCode.vue +55 -0
- package/dist/runtime/vue/components/auth/WaitlistCode.vue.d.ts +3 -0
- package/dist/runtime/vue/components/auth/WaitlistForm.css +1 -0
- package/dist/runtime/vue/components/auth/WaitlistForm.d.vue.ts +74 -0
- package/dist/runtime/vue/components/auth/WaitlistForm.vue +81 -0
- package/dist/runtime/vue/components/auth/WaitlistForm.vue.d.ts +74 -0
- package/dist/runtime/vue/components/auth/WaitlistJoin.css +1 -0
- package/dist/runtime/vue/components/auth/WaitlistJoin.d.vue.ts +3 -0
- package/dist/runtime/vue/components/auth/WaitlistJoin.vue +97 -0
- package/dist/runtime/vue/components/auth/WaitlistJoin.vue.d.ts +3 -0
- package/dist/runtime/vue/components/auth/WaitlistPlace.css +1 -0
- package/dist/runtime/vue/components/auth/WaitlistPlace.d.vue.ts +3 -0
- package/dist/runtime/vue/components/auth/WaitlistPlace.vue +68 -0
- package/dist/runtime/vue/components/auth/WaitlistPlace.vue.d.ts +3 -0
- package/dist/runtime/vue/components/auth/WaitlistShare.css +1 -0
- package/dist/runtime/vue/components/auth/WaitlistShare.d.vue.ts +3 -0
- package/dist/runtime/vue/components/auth/WaitlistShare.vue +65 -0
- package/dist/runtime/vue/components/auth/WaitlistShare.vue.d.ts +3 -0
- package/dist/runtime/vue/components/auth/WaitlistStatus.css +1 -0
- package/dist/runtime/vue/components/auth/WaitlistStatus.d.vue.ts +3 -0
- package/dist/runtime/vue/components/auth/WaitlistStatus.vue +58 -0
- package/dist/runtime/vue/components/auth/WaitlistStatus.vue.d.ts +3 -0
- package/dist/runtime/vue/components/auth/auth-form.d.ts +52 -0
- package/dist/runtime/vue/components/auth/auth-form.js +31 -0
- package/dist/runtime/vue/components/auth/reauthenticate.d.ts +31 -0
- package/dist/runtime/vue/components/auth/reauthenticate.js +10 -0
- package/dist/runtime/vue/components/auth/waitlist-form.d.ts +10 -0
- package/dist/runtime/vue/components/auth/waitlist-form.js +9 -0
- package/dist/runtime/vue/components/billing/BillingCheckoutLink.d.vue.ts +50 -0
- package/dist/runtime/vue/components/billing/BillingCheckoutLink.vue +63 -0
- package/dist/runtime/vue/components/billing/BillingCheckoutLink.vue.d.ts +50 -0
- package/dist/runtime/vue/components/billing/BillingHistory.css +1 -0
- package/dist/runtime/vue/components/billing/BillingHistory.d.vue.ts +51 -0
- package/dist/runtime/vue/components/billing/BillingHistory.vue +98 -0
- package/dist/runtime/vue/components/billing/BillingHistory.vue.d.ts +51 -0
- package/dist/runtime/vue/components/billing/BillingHistoryOrder.css +1 -0
- package/dist/runtime/vue/components/billing/BillingHistoryOrder.d.vue.ts +4 -0
- package/dist/runtime/vue/components/billing/BillingHistoryOrder.vue +49 -0
- package/dist/runtime/vue/components/billing/BillingHistoryOrder.vue.d.ts +4 -0
- package/dist/runtime/vue/components/billing/BillingPortalLink.d.vue.ts +31 -0
- package/dist/runtime/vue/components/billing/BillingPortalLink.vue +39 -0
- package/dist/runtime/vue/components/billing/BillingPortalLink.vue.d.ts +31 -0
- package/dist/runtime/vue/components/billing/CancelConfirmGroup.d.vue.ts +7 -0
- package/dist/runtime/vue/components/billing/CancelConfirmGroup.vue +47 -0
- package/dist/runtime/vue/components/billing/CancelConfirmGroup.vue.d.ts +7 -0
- package/dist/runtime/vue/components/billing/CancelFlow.css +1 -0
- package/dist/runtime/vue/components/billing/CancelFlow.d.vue.ts +69 -0
- package/dist/runtime/vue/components/billing/CancelFlow.vue +104 -0
- package/dist/runtime/vue/components/billing/CancelFlow.vue.d.ts +69 -0
- package/dist/runtime/vue/components/billing/CancelFlowConfirm.d.vue.ts +3 -0
- package/dist/runtime/vue/components/billing/CancelFlowConfirm.vue +34 -0
- package/dist/runtime/vue/components/billing/CancelFlowConfirm.vue.d.ts +3 -0
- package/dist/runtime/vue/components/billing/CancelFlowEnd.d.vue.ts +3 -0
- package/dist/runtime/vue/components/billing/CancelFlowEnd.vue +42 -0
- package/dist/runtime/vue/components/billing/CancelFlowEnd.vue.d.ts +3 -0
- package/dist/runtime/vue/components/billing/CancelFlowOffer.d.vue.ts +3 -0
- package/dist/runtime/vue/components/billing/CancelFlowOffer.vue +29 -0
- package/dist/runtime/vue/components/billing/CancelFlowOffer.vue.d.ts +3 -0
- package/dist/runtime/vue/components/billing/CancelFlowQuestion.d.vue.ts +3 -0
- package/dist/runtime/vue/components/billing/CancelFlowQuestion.vue +52 -0
- package/dist/runtime/vue/components/billing/CancelFlowQuestion.vue.d.ts +3 -0
- package/dist/runtime/vue/components/billing/GiftList.css +1 -0
- package/dist/runtime/vue/components/billing/GiftList.d.vue.ts +8 -0
- package/dist/runtime/vue/components/billing/GiftList.vue +118 -0
- package/dist/runtime/vue/components/billing/GiftList.vue.d.ts +8 -0
- package/dist/runtime/vue/components/billing/GiftReceived.d.vue.ts +28 -0
- package/dist/runtime/vue/components/billing/GiftReceived.vue +62 -0
- package/dist/runtime/vue/components/billing/GiftReceived.vue.d.ts +28 -0
- package/dist/runtime/vue/components/billing/GiftSent.d.vue.ts +27 -0
- package/dist/runtime/vue/components/billing/GiftSent.vue +121 -0
- package/dist/runtime/vue/components/billing/GiftSent.vue.d.ts +27 -0
- package/dist/runtime/vue/components/billing/PricingCancelConfirm.d.vue.ts +3 -0
- package/dist/runtime/vue/components/billing/PricingCancelConfirm.vue +13 -0
- package/dist/runtime/vue/components/billing/PricingCancelConfirm.vue.d.ts +3 -0
- package/dist/runtime/vue/components/billing/PricingCurrencySelect.d.vue.ts +3 -0
- package/dist/runtime/vue/components/billing/PricingCurrencySelect.vue +45 -0
- package/dist/runtime/vue/components/billing/PricingCurrencySelect.vue.d.ts +3 -0
- package/dist/runtime/vue/components/billing/PricingEmailOptOut.css +1 -0
- package/dist/runtime/vue/components/billing/PricingEmailOptOut.d.vue.ts +10 -0
- package/dist/runtime/vue/components/billing/PricingEmailOptOut.vue +23 -0
- package/dist/runtime/vue/components/billing/PricingEmailOptOut.vue.d.ts +10 -0
- package/dist/runtime/vue/components/billing/PricingPackCard.css +1 -0
- package/dist/runtime/vue/components/billing/PricingPackCard.d.vue.ts +4 -0
- package/dist/runtime/vue/components/billing/PricingPackCard.vue +78 -0
- package/dist/runtime/vue/components/billing/PricingPackCard.vue.d.ts +4 -0
- package/dist/runtime/vue/components/billing/PricingPeriodSwitch.d.vue.ts +3 -0
- package/dist/runtime/vue/components/billing/PricingPeriodSwitch.vue +46 -0
- package/dist/runtime/vue/components/billing/PricingPeriodSwitch.vue.d.ts +3 -0
- package/dist/runtime/vue/components/billing/PricingPlanCard.css +1 -0
- package/dist/runtime/vue/components/billing/PricingPlanCard.d.vue.ts +4 -0
- package/dist/runtime/vue/components/billing/PricingPlanCard.vue +136 -0
- package/dist/runtime/vue/components/billing/PricingPlanCard.vue.d.ts +4 -0
- package/dist/runtime/vue/components/billing/PricingPromotion.d.vue.ts +7 -0
- package/dist/runtime/vue/components/billing/PricingPromotion.vue +20 -0
- package/dist/runtime/vue/components/billing/PricingPromotion.vue.d.ts +7 -0
- package/dist/runtime/vue/components/billing/PricingTable.css +1 -0
- package/dist/runtime/vue/components/billing/PricingTable.d.vue.ts +145 -0
- package/dist/runtime/vue/components/billing/PricingTable.vue +543 -0
- package/dist/runtime/vue/components/billing/PricingTable.vue.d.ts +145 -0
- package/dist/runtime/vue/components/billing/ReferralCard.css +1 -0
- package/dist/runtime/vue/components/billing/ReferralCard.d.vue.ts +67 -0
- package/dist/runtime/vue/components/billing/ReferralCard.vue +178 -0
- package/dist/runtime/vue/components/billing/ReferralCard.vue.d.ts +67 -0
- package/dist/runtime/vue/components/billing/ReferralLanding.css +1 -0
- package/dist/runtime/vue/components/billing/ReferralLanding.d.vue.ts +3 -0
- package/dist/runtime/vue/components/billing/ReferralLanding.vue +100 -0
- package/dist/runtime/vue/components/billing/ReferralLanding.vue.d.ts +3 -0
- package/dist/runtime/vue/components/billing/UpgradePrompt.css +1 -0
- package/dist/runtime/vue/components/billing/UpgradePrompt.d.vue.ts +45 -0
- package/dist/runtime/vue/components/billing/UpgradePrompt.vue +96 -0
- package/dist/runtime/vue/components/billing/UpgradePrompt.vue.d.ts +45 -0
- package/dist/runtime/vue/components/billing/UsageHistory.css +1 -0
- package/dist/runtime/vue/components/billing/UsageHistory.d.vue.ts +34 -0
- package/dist/runtime/vue/components/billing/UsageHistory.vue +76 -0
- package/dist/runtime/vue/components/billing/UsageHistory.vue.d.ts +34 -0
- package/dist/runtime/vue/components/billing/UsageHistoryEvent.css +1 -0
- package/dist/runtime/vue/components/billing/UsageHistoryEvent.d.vue.ts +4 -0
- package/dist/runtime/vue/components/billing/UsageHistoryEvent.vue +24 -0
- package/dist/runtime/vue/components/billing/UsageHistoryEvent.vue.d.ts +4 -0
- package/dist/runtime/vue/components/billing/WithdrawalButton.css +1 -0
- package/dist/runtime/vue/components/billing/WithdrawalButton.d.vue.ts +33 -0
- package/dist/runtime/vue/components/billing/WithdrawalButton.vue +93 -0
- package/dist/runtime/vue/components/billing/WithdrawalButton.vue.d.ts +33 -0
- package/dist/runtime/vue/components/billing/billing-history.d.ts +43 -0
- package/dist/runtime/vue/components/billing/billing-history.js +10 -0
- package/dist/runtime/vue/components/billing/billing-links.d.ts +9 -0
- package/dist/runtime/vue/components/billing/billing-links.js +17 -0
- package/dist/runtime/vue/components/billing/cancel-flow.d.ts +102 -0
- package/dist/runtime/vue/components/billing/cancel-flow.js +120 -0
- package/dist/runtime/vue/components/billing/pricing-table.d.ts +195 -0
- package/dist/runtime/vue/components/billing/pricing-table.js +10 -0
- package/dist/runtime/vue/components/billing/upgrade-prompt.d.ts +38 -0
- package/dist/runtime/vue/components/billing/upgrade-prompt.js +30 -0
- package/dist/runtime/vue/components/billing/usage-history.d.ts +28 -0
- package/dist/runtime/vue/components/billing/usage-history.js +8 -0
- package/dist/runtime/vue/components/billing/withdrawal-button.d.ts +44 -0
- package/dist/runtime/vue/components/billing/withdrawal-button.js +71 -0
- package/dist/runtime/vue/components/renamed-billing-links.d.ts +1 -0
- package/dist/runtime/vue/components/renamed-billing-links.js +4 -0
- package/dist/runtime/vue/components/renamed-storage-image.d.ts +1 -0
- package/dist/runtime/vue/components/renamed-storage-image.js +3 -0
- package/dist/runtime/vue/components/shared.css +1 -0
- package/dist/runtime/vue/components/shell/AccessDenied.css +1 -0
- package/dist/runtime/vue/components/shell/AccessDenied.d.vue.ts +54 -0
- package/dist/runtime/vue/components/shell/AccessDenied.vue +158 -0
- package/dist/runtime/vue/components/shell/AccessDenied.vue.d.ts +54 -0
- package/dist/runtime/vue/components/shell/AccessDeniedPage.d.vue.ts +10 -0
- package/dist/runtime/vue/components/shell/AccessDeniedPage.vue +16 -0
- package/dist/runtime/vue/components/shell/AccessDeniedPage.vue.d.ts +10 -0
- package/dist/runtime/vue/components/shell/AccountMenu.css +1 -0
- package/dist/runtime/vue/components/shell/AccountMenu.d.vue.ts +3 -0
- package/dist/runtime/vue/components/shell/AccountMenu.vue +85 -0
- package/dist/runtime/vue/components/shell/AccountMenu.vue.d.ts +3 -0
- package/dist/runtime/vue/components/shell/AiLabel.css +1 -0
- package/dist/runtime/vue/components/shell/AiLabel.d.vue.ts +31 -0
- package/dist/runtime/vue/components/shell/AiLabel.vue +39 -0
- package/dist/runtime/vue/components/shell/AiLabel.vue.d.ts +31 -0
- package/dist/runtime/vue/components/shell/AppShell.css +1 -0
- package/dist/runtime/vue/components/shell/AppShell.d.vue.ts +61 -0
- package/dist/runtime/vue/components/shell/AppShell.vue +90 -0
- package/dist/runtime/vue/components/shell/AppShell.vue.d.ts +61 -0
- package/dist/runtime/vue/components/shell/BackendNotices.d.vue.ts +17 -0
- package/dist/runtime/vue/components/shell/BackendNotices.vue +34 -0
- package/dist/runtime/vue/components/shell/BackendNotices.vue.d.ts +17 -0
- package/dist/runtime/vue/components/shell/ConfirmDialog.css +1 -0
- package/dist/runtime/vue/components/shell/ConfirmDialog.d.vue.ts +11 -0
- package/dist/runtime/vue/components/shell/ConfirmDialog.vue +55 -0
- package/dist/runtime/vue/components/shell/ConfirmDialog.vue.d.ts +11 -0
- package/dist/runtime/vue/components/shell/ConnectionStatus.css +1 -0
- package/dist/runtime/vue/components/shell/ConnectionStatus.d.vue.ts +25 -0
- package/dist/runtime/vue/components/shell/ConnectionStatus.vue +66 -0
- package/dist/runtime/vue/components/shell/ConnectionStatus.vue.d.ts +25 -0
- package/dist/runtime/vue/components/shell/ContactForm.css +1 -0
- package/dist/runtime/vue/components/shell/ContactForm.d.vue.ts +23 -0
- package/dist/runtime/vue/components/shell/ContactForm.vue +108 -0
- package/dist/runtime/vue/components/shell/ContactForm.vue.d.ts +23 -0
- package/dist/runtime/vue/components/shell/ErrorPage.d.vue.ts +8 -0
- package/dist/runtime/vue/components/shell/ErrorPage.vue +21 -0
- package/dist/runtime/vue/components/shell/ErrorPage.vue.d.ts +8 -0
- package/dist/runtime/vue/components/shell/FrameConnectionStatus.d.vue.ts +3 -0
- package/dist/runtime/vue/components/shell/FrameConnectionStatus.vue +10 -0
- package/dist/runtime/vue/components/shell/FrameConnectionStatus.vue.d.ts +3 -0
- package/dist/runtime/vue/components/shell/FrameMain.d.vue.ts +22 -0
- package/dist/runtime/vue/components/shell/FrameMain.vue +51 -0
- package/dist/runtime/vue/components/shell/FrameMain.vue.d.ts +22 -0
- package/dist/runtime/vue/components/shell/Gate.css +1 -0
- package/dist/runtime/vue/components/shell/Gate.d.vue.ts +49 -0
- package/dist/runtime/vue/components/shell/Gate.vue +148 -0
- package/dist/runtime/vue/components/shell/Gate.vue.d.ts +49 -0
- package/dist/runtime/vue/components/shell/GateQuota.d.vue.ts +34 -0
- package/dist/runtime/vue/components/shell/GateQuota.vue +74 -0
- package/dist/runtime/vue/components/shell/GateQuota.vue.d.ts +34 -0
- package/dist/runtime/vue/components/shell/LegalDataMap.d.vue.ts +7 -0
- package/dist/runtime/vue/components/shell/LegalDataMap.vue +34 -0
- package/dist/runtime/vue/components/shell/LegalDataMap.vue.d.ts +7 -0
- package/dist/runtime/vue/components/shell/LegalDocument.css +1 -0
- package/dist/runtime/vue/components/shell/LegalDocument.d.vue.ts +7 -0
- package/dist/runtime/vue/components/shell/LegalDocument.vue +248 -0
- package/dist/runtime/vue/components/shell/LegalDocument.vue.d.ts +7 -0
- package/dist/runtime/vue/components/shell/LegalProcessors.d.vue.ts +7 -0
- package/dist/runtime/vue/components/shell/LegalProcessors.vue +49 -0
- package/dist/runtime/vue/components/shell/LegalProcessors.vue.d.ts +7 -0
- package/dist/runtime/vue/components/shell/LegalStorage.d.vue.ts +7 -0
- package/dist/runtime/vue/components/shell/LegalStorage.vue +47 -0
- package/dist/runtime/vue/components/shell/LegalStorage.vue.d.ts +7 -0
- package/dist/runtime/vue/components/shell/ListPager.d.vue.ts +8 -0
- package/dist/runtime/vue/components/shell/ListPager.vue +38 -0
- package/dist/runtime/vue/components/shell/ListPager.vue.d.ts +8 -0
- package/dist/runtime/vue/components/shell/NoticeAnnouncement.css +1 -0
- package/dist/runtime/vue/components/shell/NoticeAnnouncement.d.vue.ts +8 -0
- package/dist/runtime/vue/components/shell/NoticeAnnouncement.vue +108 -0
- package/dist/runtime/vue/components/shell/NoticeAnnouncement.vue.d.ts +8 -0
- package/dist/runtime/vue/components/shell/NoticeDeletion.css +1 -0
- package/dist/runtime/vue/components/shell/NoticeDeletion.d.vue.ts +7 -0
- package/dist/runtime/vue/components/shell/NoticeDeletion.vue +68 -0
- package/dist/runtime/vue/components/shell/NoticeDeletion.vue.d.ts +7 -0
- package/dist/runtime/vue/components/shell/NoticeGift.css +1 -0
- package/dist/runtime/vue/components/shell/NoticeGift.d.vue.ts +14 -0
- package/dist/runtime/vue/components/shell/NoticeGift.vue +138 -0
- package/dist/runtime/vue/components/shell/NoticeGift.vue.d.ts +14 -0
- package/dist/runtime/vue/components/shell/NoticeImpersonation.css +1 -0
- package/dist/runtime/vue/components/shell/NoticeImpersonation.d.vue.ts +14 -0
- package/dist/runtime/vue/components/shell/NoticeImpersonation.vue +90 -0
- package/dist/runtime/vue/components/shell/NoticeImpersonation.vue.d.ts +14 -0
- package/dist/runtime/vue/components/shell/NoticeLowCredits.css +1 -0
- package/dist/runtime/vue/components/shell/NoticeLowCredits.d.vue.ts +50 -0
- package/dist/runtime/vue/components/shell/NoticeLowCredits.vue +170 -0
- package/dist/runtime/vue/components/shell/NoticeLowCredits.vue.d.ts +50 -0
- package/dist/runtime/vue/components/shell/NoticeMaintenance.css +1 -0
- package/dist/runtime/vue/components/shell/NoticeMaintenance.d.vue.ts +7 -0
- package/dist/runtime/vue/components/shell/NoticeMaintenance.vue +35 -0
- package/dist/runtime/vue/components/shell/NoticeMaintenance.vue.d.ts +7 -0
- package/dist/runtime/vue/components/shell/NoticePastDue.css +1 -0
- package/dist/runtime/vue/components/shell/NoticePastDue.d.vue.ts +7 -0
- package/dist/runtime/vue/components/shell/NoticePastDue.vue +64 -0
- package/dist/runtime/vue/components/shell/NoticePastDue.vue.d.ts +7 -0
- package/dist/runtime/vue/components/shell/NotificationInbox.css +1 -0
- package/dist/runtime/vue/components/shell/NotificationInbox.d.vue.ts +18 -0
- package/dist/runtime/vue/components/shell/NotificationInbox.vue +78 -0
- package/dist/runtime/vue/components/shell/NotificationInbox.vue.d.ts +18 -0
- package/dist/runtime/vue/components/shell/NotificationInboxBell.d.vue.ts +3 -0
- package/dist/runtime/vue/components/shell/NotificationInboxBell.vue +37 -0
- package/dist/runtime/vue/components/shell/NotificationInboxBell.vue.d.ts +3 -0
- package/dist/runtime/vue/components/shell/NotificationInboxItem.d.vue.ts +4 -0
- package/dist/runtime/vue/components/shell/NotificationInboxItem.vue +48 -0
- package/dist/runtime/vue/components/shell/NotificationInboxItem.vue.d.ts +4 -0
- package/dist/runtime/vue/components/shell/PageFrame.d.vue.ts +35 -0
- package/dist/runtime/vue/components/shell/PageFrame.vue +79 -0
- package/dist/runtime/vue/components/shell/PageFrame.vue.d.ts +35 -0
- package/dist/runtime/vue/components/shell/PagedList.d.vue.ts +46 -0
- package/dist/runtime/vue/components/shell/PagedList.vue +98 -0
- package/dist/runtime/vue/components/shell/PagedList.vue.d.ts +46 -0
- package/dist/runtime/vue/components/shell/ReportAppeal.d.vue.ts +7 -0
- package/dist/runtime/vue/components/shell/ReportAppeal.vue +90 -0
- package/dist/runtime/vue/components/shell/ReportAppeal.vue.d.ts +7 -0
- package/dist/runtime/vue/components/shell/ReportNotice.css +1 -0
- package/dist/runtime/vue/components/shell/ReportNotice.d.vue.ts +3 -0
- package/dist/runtime/vue/components/shell/ReportNotice.vue +158 -0
- package/dist/runtime/vue/components/shell/ReportNotice.vue.d.ts +3 -0
- package/dist/runtime/vue/components/shell/UploadField.css +1 -0
- package/dist/runtime/vue/components/shell/UploadField.d.vue.ts +29 -0
- package/dist/runtime/vue/components/shell/UploadField.vue +74 -0
- package/dist/runtime/vue/components/shell/UploadField.vue.d.ts +29 -0
- package/dist/runtime/vue/components/shell/WorkspaceSwitcher.css +1 -0
- package/dist/runtime/vue/components/shell/WorkspaceSwitcher.d.vue.ts +3 -0
- package/dist/runtime/vue/components/shell/WorkspaceSwitcher.vue +126 -0
- package/dist/runtime/vue/components/shell/WorkspaceSwitcher.vue.d.ts +3 -0
- package/dist/runtime/vue/components/shell/access-denied.d.ts +27 -0
- package/dist/runtime/vue/components/shell/access-denied.js +1 -0
- package/dist/runtime/vue/components/shell/ai-label.d.ts +5 -0
- package/dist/runtime/vue/components/shell/ai-label.js +0 -0
- package/dist/runtime/vue/components/shell/app-shell.d.ts +11 -0
- package/dist/runtime/vue/components/shell/app-shell.js +1 -0
- package/dist/runtime/vue/components/shell/connection-status.d.ts +24 -0
- package/dist/runtime/vue/components/shell/connection-status.js +31 -0
- package/dist/runtime/vue/components/shell/contact-form.d.ts +15 -0
- package/dist/runtime/vue/components/shell/contact-form.js +0 -0
- package/dist/runtime/vue/components/shell/gate.d.ts +76 -0
- package/dist/runtime/vue/components/shell/gate.js +0 -0
- package/dist/runtime/vue/components/shell/legal.d.ts +24 -0
- package/dist/runtime/vue/components/shell/legal.js +69 -0
- package/dist/runtime/vue/components/shell/notices.d.ts +99 -0
- package/dist/runtime/vue/components/shell/notices.js +6 -0
- package/dist/runtime/vue/components/shell/notification-inbox.d.ts +11 -0
- package/dist/runtime/vue/components/shell/notification-inbox.js +0 -0
- package/dist/runtime/vue/components/shell/report-form.d.ts +1 -0
- package/dist/runtime/vue/components/shell/report-form.js +117 -0
- package/dist/runtime/vue/components/shell/upload-field.d.ts +16 -0
- package/dist/runtime/vue/components/shell/upload-field.js +0 -0
- package/dist/runtime/vue/components/tokens.css +1 -0
- package/dist/runtime/vue/components/workspaces/AcceptInvitation.css +1 -0
- package/dist/runtime/vue/components/workspaces/AcceptInvitation.d.vue.ts +52 -0
- package/dist/runtime/vue/components/workspaces/AcceptInvitation.vue +156 -0
- package/dist/runtime/vue/components/workspaces/AcceptInvitation.vue.d.ts +52 -0
- package/dist/runtime/vue/components/workspaces/AcceptInvitationActions.css +1 -0
- package/dist/runtime/vue/components/workspaces/AcceptInvitationActions.d.vue.ts +4 -0
- package/dist/runtime/vue/components/workspaces/AcceptInvitationActions.vue +30 -0
- package/dist/runtime/vue/components/workspaces/AcceptInvitationActions.vue.d.ts +4 -0
- package/dist/runtime/vue/components/workspaces/AuditLog.css +1 -0
- package/dist/runtime/vue/components/workspaces/AuditLog.d.vue.ts +185 -0
- package/dist/runtime/vue/components/workspaces/AuditLog.vue +77 -0
- package/dist/runtime/vue/components/workspaces/AuditLog.vue.d.ts +185 -0
- package/dist/runtime/vue/components/workspaces/AuditLogEvent.css +1 -0
- package/dist/runtime/vue/components/workspaces/AuditLogEvent.d.vue.ts +4 -0
- package/dist/runtime/vue/components/workspaces/AuditLogEvent.vue +30 -0
- package/dist/runtime/vue/components/workspaces/AuditLogEvent.vue.d.ts +4 -0
- package/dist/runtime/vue/components/workspaces/WorkspaceBilling.css +1 -0
- package/dist/runtime/vue/components/workspaces/WorkspaceBilling.d.vue.ts +4 -0
- package/dist/runtime/vue/components/workspaces/WorkspaceBilling.vue +236 -0
- package/dist/runtime/vue/components/workspaces/WorkspaceBilling.vue.d.ts +4 -0
- package/dist/runtime/vue/components/workspaces/WorkspaceCredits.css +1 -0
- package/dist/runtime/vue/components/workspaces/WorkspaceCredits.d.vue.ts +4 -0
- package/dist/runtime/vue/components/workspaces/WorkspaceCredits.vue +56 -0
- package/dist/runtime/vue/components/workspaces/WorkspaceCredits.vue.d.ts +4 -0
- package/dist/runtime/vue/components/workspaces/WorkspaceList.css +1 -0
- package/dist/runtime/vue/components/workspaces/WorkspaceList.d.vue.ts +4 -0
- package/dist/runtime/vue/components/workspaces/WorkspaceList.vue +92 -0
- package/dist/runtime/vue/components/workspaces/WorkspaceList.vue.d.ts +4 -0
- package/dist/runtime/vue/components/workspaces/WorkspaceSettings.css +1 -0
- package/dist/runtime/vue/components/workspaces/WorkspaceSettings.d.vue.ts +117 -0
- package/dist/runtime/vue/components/workspaces/WorkspaceSettings.vue +216 -0
- package/dist/runtime/vue/components/workspaces/WorkspaceSettings.vue.d.ts +117 -0
- package/dist/runtime/vue/components/workspaces/accept-invitation.d.ts +21 -0
- package/dist/runtime/vue/components/workspaces/accept-invitation.js +10 -0
- package/dist/runtime/vue/components/workspaces/audit-log.d.ts +29 -0
- package/dist/runtime/vue/components/workspaces/audit-log.js +33 -0
- package/dist/runtime/vue/components/workspaces/workspace-billing.d.ts +77 -0
- package/dist/runtime/vue/components/workspaces/workspace-billing.js +74 -0
- package/dist/runtime/vue/components/workspaces/workspace-settings.d.ts +81 -0
- package/dist/runtime/vue/components/workspaces/workspace-settings.js +10 -0
- package/dist/runtime/vue/composables/base-aliases.d.ts +8 -0
- package/dist/runtime/vue/composables/base-aliases.js +2 -0
- package/dist/runtime/vue/composables/billing-format.d.ts +14 -0
- package/dist/runtime/vue/composables/billing-format.js +40 -0
- package/dist/runtime/vue/composables/billing-provider.d.ts +38 -0
- package/dist/runtime/vue/composables/billing-provider.js +160 -0
- package/dist/runtime/vue/composables/use-access.d.ts +154 -0
- package/dist/runtime/vue/composables/use-access.js +100 -0
- package/dist/runtime/vue/composables/use-account.d.ts +120 -0
- package/dist/runtime/vue/composables/use-account.js +60 -0
- package/dist/runtime/vue/composables/use-activation.d.ts +89 -0
- package/dist/runtime/vue/composables/use-activation.js +74 -0
- package/dist/runtime/vue/composables/use-admin.d.ts +149 -0
- package/dist/runtime/vue/composables/use-admin.js +97 -0
- package/dist/runtime/vue/composables/use-ai-costs.d.ts +42 -0
- package/dist/runtime/vue/composables/use-ai-costs.js +38 -0
- package/dist/runtime/vue/composables/use-ai-label.d.ts +62 -0
- package/dist/runtime/vue/composables/use-ai-label.js +47 -0
- package/dist/runtime/vue/composables/use-ai-stream.d.ts +71 -0
- package/dist/runtime/vue/composables/use-ai-stream.js +126 -0
- package/dist/runtime/vue/composables/use-announcements.d.ts +110 -0
- package/dist/runtime/vue/composables/use-announcements.js +78 -0
- package/dist/runtime/vue/composables/use-app-shell.d.ts +131 -0
- package/dist/runtime/vue/composables/use-app-shell.js +206 -0
- package/dist/runtime/vue/composables/use-audit-log.d.ts +90 -0
- package/dist/runtime/vue/composables/use-audit-log.js +44 -0
- package/dist/runtime/vue/composables/use-auth.d.ts +71 -0
- package/dist/runtime/vue/composables/use-auth.js +18 -0
- package/dist/runtime/vue/composables/use-backend-config.d.ts +8 -0
- package/dist/runtime/vue/composables/use-backend-config.js +17 -0
- package/dist/runtime/vue/composables/use-backend-page-path.d.ts +18 -0
- package/dist/runtime/vue/composables/use-backend-page-path.js +33 -0
- package/dist/runtime/vue/composables/use-billing.d.ts +795 -0
- package/dist/runtime/vue/composables/use-billing.js +144 -0
- package/dist/runtime/vue/composables/use-campaign.d.ts +40 -0
- package/dist/runtime/vue/composables/use-campaign.js +31 -0
- package/dist/runtime/vue/composables/use-chat.d.ts +72 -0
- package/dist/runtime/vue/composables/use-chat.js +69 -0
- package/dist/runtime/vue/composables/use-consents.d.ts +144 -0
- package/dist/runtime/vue/composables/use-consents.js +109 -0
- package/dist/runtime/vue/composables/use-contact-form.d.ts +104 -0
- package/dist/runtime/vue/composables/use-contact-form.js +141 -0
- package/dist/runtime/vue/composables/use-credits.d.ts +95 -0
- package/dist/runtime/vue/composables/use-credits.js +68 -0
- package/dist/runtime/vue/composables/use-deletion-notice.d.ts +45 -0
- package/dist/runtime/vue/composables/use-deletion-notice.js +38 -0
- package/dist/runtime/vue/composables/use-email-change.d.ts +57 -0
- package/dist/runtime/vue/composables/use-email-change.js +71 -0
- package/dist/runtime/vue/composables/use-email-link.d.ts +26 -0
- package/dist/runtime/vue/composables/use-email-link.js +62 -0
- package/dist/runtime/vue/composables/use-email-preferences.d.ts +90 -0
- package/dist/runtime/vue/composables/use-email-preferences.js +40 -0
- package/dist/runtime/vue/composables/use-email-status.d.ts +59 -0
- package/dist/runtime/vue/composables/use-email-status.js +20 -0
- package/dist/runtime/vue/composables/use-experiment.d.ts +75 -0
- package/dist/runtime/vue/composables/use-experiment.js +60 -0
- package/dist/runtime/vue/composables/use-features.d.ts +74 -0
- package/dist/runtime/vue/composables/use-features.js +31 -0
- package/dist/runtime/vue/composables/use-flags.d.ts +98 -0
- package/dist/runtime/vue/composables/use-flags.js +50 -0
- package/dist/runtime/vue/composables/use-funnel.d.ts +32 -0
- package/dist/runtime/vue/composables/use-funnel.js +20 -0
- package/dist/runtime/vue/composables/use-gift-list.d.ts +60 -0
- package/dist/runtime/vue/composables/use-gift-list.js +104 -0
- package/dist/runtime/vue/composables/use-gifts.d.ts +90 -0
- package/dist/runtime/vue/composables/use-gifts.js +68 -0
- package/dist/runtime/vue/composables/use-how-did-you-hear.d.ts +46 -0
- package/dist/runtime/vue/composables/use-how-did-you-hear.js +51 -0
- package/dist/runtime/vue/composables/use-human-check.d.ts +57 -0
- package/dist/runtime/vue/composables/use-human-check.js +14 -0
- package/dist/runtime/vue/composables/use-inbox-admin.d.ts +43 -0
- package/dist/runtime/vue/composables/use-inbox-admin.js +31 -0
- package/dist/runtime/vue/composables/use-job-queue.d.ts +108 -0
- package/dist/runtime/vue/composables/use-job-queue.js +47 -0
- package/dist/runtime/vue/composables/use-job.d.ts +68 -0
- package/dist/runtime/vue/composables/use-job.js +30 -0
- package/dist/runtime/vue/composables/use-keep-account.d.ts +20 -0
- package/dist/runtime/vue/composables/use-keep-account.js +38 -0
- package/dist/runtime/vue/composables/use-labels.d.ts +67 -0
- package/dist/runtime/vue/composables/use-labels.js +114 -0
- package/dist/runtime/vue/composables/use-login-flow.d.ts +167 -0
- package/dist/runtime/vue/composables/use-login-flow.js +284 -0
- package/dist/runtime/vue/composables/use-notification-inbox.d.ts +81 -0
- package/dist/runtime/vue/composables/use-notification-inbox.js +96 -0
- package/dist/runtime/vue/composables/use-notifications.d.ts +111 -0
- package/dist/runtime/vue/composables/use-notifications.js +108 -0
- package/dist/runtime/vue/composables/use-onboarding.d.ts +87 -0
- package/dist/runtime/vue/composables/use-onboarding.js +86 -0
- package/dist/runtime/vue/composables/use-orders.d.ts +83 -0
- package/dist/runtime/vue/composables/use-orders.js +44 -0
- package/dist/runtime/vue/composables/use-passkeys.d.ts +76 -0
- package/dist/runtime/vue/composables/use-passkeys.js +66 -0
- package/dist/runtime/vue/composables/use-pricing.d.ts +136 -0
- package/dist/runtime/vue/composables/use-pricing.js +135 -0
- package/dist/runtime/vue/composables/use-push-subscription.d.ts +67 -0
- package/dist/runtime/vue/composables/use-push-subscription.js +85 -0
- package/dist/runtime/vue/composables/use-reauthentication.d.ts +105 -0
- package/dist/runtime/vue/composables/use-reauthentication.js +168 -0
- package/dist/runtime/vue/composables/use-referral-admin.d.ts +30 -0
- package/dist/runtime/vue/composables/use-referral-admin.js +30 -0
- package/dist/runtime/vue/composables/use-referral-invite.d.ts +29 -0
- package/dist/runtime/vue/composables/use-referral-invite.js +61 -0
- package/dist/runtime/vue/composables/use-referrals.d.ts +87 -0
- package/dist/runtime/vue/composables/use-referrals.js +109 -0
- package/dist/runtime/vue/composables/use-return-path.d.ts +21 -0
- package/dist/runtime/vue/composables/use-return-path.js +8 -0
- package/dist/runtime/vue/composables/use-revenue.d.ts +45 -0
- package/dist/runtime/vue/composables/use-revenue.js +42 -0
- package/dist/runtime/vue/composables/use-sandbox-inbox.d.ts +64 -0
- package/dist/runtime/vue/composables/use-sandbox-inbox.js +55 -0
- package/dist/runtime/vue/composables/use-search.d.ts +39 -0
- package/dist/runtime/vue/composables/use-search.js +30 -0
- package/dist/runtime/vue/composables/use-sessions.d.ts +79 -0
- package/dist/runtime/vue/composables/use-sessions.js +55 -0
- package/dist/runtime/vue/composables/use-share-link.d.ts +59 -0
- package/dist/runtime/vue/composables/use-share-link.js +51 -0
- package/dist/runtime/vue/composables/use-suppressions-admin.d.ts +38 -0
- package/dist/runtime/vue/composables/use-suppressions-admin.js +32 -0
- package/dist/runtime/vue/composables/use-upload-field.d.ts +85 -0
- package/dist/runtime/vue/composables/use-upload-field.js +129 -0
- package/dist/runtime/vue/composables/use-usage.d.ts +68 -0
- package/dist/runtime/vue/composables/use-usage.js +44 -0
- package/dist/runtime/vue/composables/use-waitlist-admin.d.ts +56 -0
- package/dist/runtime/vue/composables/use-waitlist-admin.js +43 -0
- package/dist/runtime/vue/composables/use-waitlist-step.d.ts +1 -0
- package/dist/runtime/vue/composables/use-waitlist-step.js +11 -0
- package/dist/runtime/vue/composables/use-waitlist.d.ts +184 -0
- package/dist/runtime/vue/composables/use-waitlist.js +178 -0
- package/dist/runtime/vue/composables/use-webhook-log.d.ts +34 -0
- package/dist/runtime/vue/composables/use-webhook-log.js +30 -0
- package/dist/runtime/vue/composables/use-workflow.d.ts +37 -0
- package/dist/runtime/vue/composables/use-workflow.js +10 -0
- package/dist/runtime/vue/composables/use-workspace.d.ts +149 -0
- package/dist/runtime/vue/composables/use-workspace.js +126 -0
- package/dist/runtime/vue/middleware/page-access.d.ts +13 -0
- package/dist/runtime/vue/middleware/page-access.js +18 -0
- package/dist/runtime/vue/organization-client.d.ts +15 -0
- package/dist/runtime/vue/organization-client.js +65 -0
- package/dist/runtime/vue/pages/accept-invitation.d.vue.ts +3 -0
- package/dist/runtime/vue/pages/accept-invitation.vue +16 -0
- package/dist/runtime/vue/pages/accept-invitation.vue.d.ts +3 -0
- package/dist/runtime/vue/pages/accessibility.d.vue.ts +3 -0
- package/dist/runtime/vue/pages/accessibility.vue +17 -0
- package/dist/runtime/vue/pages/accessibility.vue.d.ts +3 -0
- package/dist/runtime/vue/pages/admin.d.vue.ts +3 -0
- package/dist/runtime/vue/pages/admin.vue +45 -0
- package/dist/runtime/vue/pages/admin.vue.d.ts +3 -0
- package/dist/runtime/vue/pages/gifts.d.vue.ts +3 -0
- package/dist/runtime/vue/pages/gifts.vue +17 -0
- package/dist/runtime/vue/pages/gifts.vue.d.ts +3 -0
- package/dist/runtime/vue/pages/invite.d.vue.ts +3 -0
- package/dist/runtime/vue/pages/invite.vue +18 -0
- package/dist/runtime/vue/pages/invite.vue.d.ts +3 -0
- package/dist/runtime/vue/pages/keep-account.d.vue.ts +3 -0
- package/dist/runtime/vue/pages/keep-account.vue +22 -0
- package/dist/runtime/vue/pages/keep-account.vue.d.ts +3 -0
- package/dist/runtime/vue/pages/login.d.vue.ts +3 -0
- package/dist/runtime/vue/pages/login.vue +44 -0
- package/dist/runtime/vue/pages/login.vue.d.ts +3 -0
- package/dist/runtime/vue/pages/pricing.d.vue.ts +3 -0
- package/dist/runtime/vue/pages/pricing.vue +39 -0
- package/dist/runtime/vue/pages/pricing.vue.d.ts +3 -0
- package/dist/runtime/vue/pages/privacy.d.vue.ts +3 -0
- package/dist/runtime/vue/pages/privacy.vue +17 -0
- package/dist/runtime/vue/pages/privacy.vue.d.ts +3 -0
- package/dist/runtime/vue/pages/profile.d.vue.ts +3 -0
- package/dist/runtime/vue/pages/profile.vue +16 -0
- package/dist/runtime/vue/pages/profile.vue.d.ts +3 -0
- package/dist/runtime/vue/pages/referral.d.vue.ts +3 -0
- package/dist/runtime/vue/pages/referral.vue +18 -0
- package/dist/runtime/vue/pages/referral.vue.d.ts +3 -0
- package/dist/runtime/vue/pages/report.d.vue.ts +3 -0
- package/dist/runtime/vue/pages/report.vue +29 -0
- package/dist/runtime/vue/pages/report.vue.d.ts +3 -0
- package/dist/runtime/vue/pages/security.d.vue.ts +3 -0
- package/dist/runtime/vue/pages/security.vue +22 -0
- package/dist/runtime/vue/pages/security.vue.d.ts +3 -0
- package/dist/runtime/vue/pages/settings.d.vue.ts +3 -0
- package/dist/runtime/vue/pages/settings.vue +26 -0
- package/dist/runtime/vue/pages/settings.vue.d.ts +3 -0
- package/dist/runtime/vue/pages/subprocessors.d.vue.ts +3 -0
- package/dist/runtime/vue/pages/subprocessors.vue +17 -0
- package/dist/runtime/vue/pages/subprocessors.vue.d.ts +3 -0
- package/dist/runtime/vue/pages/terms.d.vue.ts +3 -0
- package/dist/runtime/vue/pages/terms.vue +17 -0
- package/dist/runtime/vue/pages/terms.vue.d.ts +3 -0
- package/dist/runtime/vue/pages/unsubscribe.d.vue.ts +3 -0
- package/dist/runtime/vue/pages/unsubscribe.vue +28 -0
- package/dist/runtime/vue/pages/unsubscribe.vue.d.ts +3 -0
- package/dist/runtime/vue/pages/waitlist.d.vue.ts +3 -0
- package/dist/runtime/vue/pages/waitlist.vue +18 -0
- package/dist/runtime/vue/pages/waitlist.vue.d.ts +3 -0
- package/dist/runtime/vue/pages/welcome.d.vue.ts +3 -0
- package/dist/runtime/vue/pages/welcome.vue +20 -0
- package/dist/runtime/vue/pages/welcome.vue.d.ts +3 -0
- package/dist/runtime/vue/parts.d.ts +204 -0
- package/dist/runtime/vue/parts.js +0 -0
- package/dist/runtime/vue/passkey-client.d.ts +65 -0
- package/dist/runtime/vue/passkey-client.js +119 -0
- package/dist/runtime/vue/plugins/checkout-return.d.ts +15 -0
- package/dist/runtime/vue/plugins/checkout-return.js +21 -0
- package/dist/runtime/vue/plugins/email-presence.d.ts +12 -0
- package/dist/runtime/vue/plugins/email-presence.js +14 -0
- package/dist/runtime/vue/plugins/first-touch.d.ts +9 -0
- package/dist/runtime/vue/plugins/first-touch.js +17 -0
- package/dist/runtime/vue/plugins/locale-sync.d.ts +10 -0
- package/dist/runtime/vue/plugins/locale-sync.js +20 -0
- package/dist/runtime/vue/plugins/monitoring-log.client.d.ts +10 -0
- package/dist/runtime/vue/plugins/monitoring-log.client.js +26 -0
- package/dist/runtime/vue/plugins/noindex.d.ts +13 -0
- package/dist/runtime/vue/plugins/noindex.js +11 -0
- package/dist/runtime/vue/plugins/onboarding-redirect.d.ts +14 -0
- package/dist/runtime/vue/plugins/onboarding-redirect.js +23 -0
- package/dist/runtime/vue/plugins/passkey-ceremony.d.ts +9 -0
- package/dist/runtime/vue/plugins/passkey-ceremony.js +8 -0
- package/dist/runtime/vue/plugins/protection.client.d.ts +9 -0
- package/dist/runtime/vue/plugins/protection.client.js +22 -0
- package/dist/runtime/vue/plugins/session-ended.d.ts +14 -0
- package/dist/runtime/vue/plugins/session-ended.js +22 -0
- package/dist/runtime/vue/plugins/trusted-types.client.d.ts +8 -0
- package/dist/runtime/vue/plugins/trusted-types.client.js +9 -0
- package/dist/runtime/vue/protection/challenge.d.ts +9 -0
- package/dist/runtime/vue/protection/challenge.js +93 -0
- package/dist/runtime/vue/protection/state.d.ts +172 -0
- package/dist/runtime/vue/protection/state.js +74 -0
- package/dist/runtime/vue/trusted-types.d.ts +27 -0
- package/dist/runtime/vue/trusted-types.js +46 -0
- package/dist/runtime/vue/utils/access-rules.d.ts +45 -0
- package/dist/runtime/vue/utils/access-rules.js +2 -0
- package/dist/runtime/vue/utils/action-state.d.ts +65 -0
- package/dist/runtime/vue/utils/action-state.js +46 -0
- package/dist/runtime/vue/utils/active-locale.d.ts +30 -0
- package/dist/runtime/vue/utils/active-locale.js +28 -0
- package/dist/runtime/vue/utils/admin-changes.d.ts +1 -0
- package/dist/runtime/vue/utils/admin-changes.js +41 -0
- package/dist/runtime/vue/utils/auth-read.d.ts +15 -0
- package/dist/runtime/vue/utils/auth-read.js +8 -0
- package/dist/runtime/vue/utils/auth-result.d.ts +8 -0
- package/dist/runtime/vue/utils/auth-result.js +7 -0
- package/dist/runtime/vue/utils/auth-session.d.ts +48 -0
- package/dist/runtime/vue/utils/auth-session.js +122 -0
- package/dist/runtime/vue/utils/auth-steps.d.ts +30 -0
- package/dist/runtime/vue/utils/auth-steps.js +44 -0
- package/dist/runtime/vue/utils/backend-error.d.ts +22 -0
- package/dist/runtime/vue/utils/backend-error.js +38 -0
- package/dist/runtime/vue/utils/billing-access.d.ts +33 -0
- package/dist/runtime/vue/utils/billing-access.js +20 -0
- package/dist/runtime/vue/utils/cancel-confirm.d.ts +38 -0
- package/dist/runtime/vue/utils/cancel-confirm.js +20 -0
- package/dist/runtime/vue/utils/challenge-caption.d.ts +2 -0
- package/dist/runtime/vue/utils/challenge-caption.js +2 -0
- package/dist/runtime/vue/utils/checkout-return.d.ts +40 -0
- package/dist/runtime/vue/utils/checkout-return.js +40 -0
- package/dist/runtime/vue/utils/confirmation.d.ts +19 -0
- package/dist/runtime/vue/utils/confirmation.js +23 -0
- package/dist/runtime/vue/utils/currency.d.ts +4 -0
- package/dist/runtime/vue/utils/currency.js +60 -0
- package/dist/runtime/vue/utils/cursor-pages.d.ts +37 -0
- package/dist/runtime/vue/utils/cursor-pages.js +42 -0
- package/dist/runtime/vue/utils/email-presence.d.ts +1 -0
- package/dist/runtime/vue/utils/email-presence.js +31 -0
- package/dist/runtime/vue/utils/every-page.d.ts +10 -0
- package/dist/runtime/vue/utils/every-page.js +6 -0
- package/dist/runtime/vue/utils/first-touch.d.ts +1 -0
- package/dist/runtime/vue/utils/first-touch.js +22 -0
- package/dist/runtime/vue/utils/focus-return.d.ts +41 -0
- package/dist/runtime/vue/utils/focus-return.js +60 -0
- package/dist/runtime/vue/utils/frame-notices.d.ts +8 -0
- package/dist/runtime/vue/utils/frame-notices.js +10 -0
- package/dist/runtime/vue/utils/hydrated.d.ts +12 -0
- package/dist/runtime/vue/utils/hydrated.js +11 -0
- package/dist/runtime/vue/utils/intl.d.ts +6 -0
- package/dist/runtime/vue/utils/intl.js +9 -0
- package/dist/runtime/vue/utils/kept-invite.d.ts +12 -0
- package/dist/runtime/vue/utils/kept-invite.js +37 -0
- package/dist/runtime/vue/utils/label-fallback.d.ts +3 -0
- package/dist/runtime/vue/utils/label-fallback.js +2 -0
- package/dist/runtime/vue/utils/label-registry.d.ts +1 -0
- package/dist/runtime/vue/utils/label-registry.js +15 -0
- package/dist/runtime/vue/utils/last-sign-in.d.ts +23 -0
- package/dist/runtime/vue/utils/last-sign-in.js +45 -0
- package/dist/runtime/vue/utils/live-query.d.ts +36 -0
- package/dist/runtime/vue/utils/live-query.js +37 -0
- package/dist/runtime/vue/utils/local-sign-out.d.ts +19 -0
- package/dist/runtime/vue/utils/local-sign-out.js +18 -0
- package/dist/runtime/vue/utils/login-bindings.d.ts +52 -0
- package/dist/runtime/vue/utils/login-bindings.js +78 -0
- package/dist/runtime/vue/utils/meter-unit.d.ts +14 -0
- package/dist/runtime/vue/utils/meter-unit.js +18 -0
- package/dist/runtime/vue/utils/namespace.d.ts +9 -0
- package/dist/runtime/vue/utils/namespace.js +22 -0
- package/dist/runtime/vue/utils/onboarding-redirect.d.ts +25 -0
- package/dist/runtime/vue/utils/onboarding-redirect.js +49 -0
- package/dist/runtime/vue/utils/open-url.d.ts +13 -0
- package/dist/runtime/vue/utils/open-url.js +12 -0
- package/dist/runtime/vue/utils/page-access.d.ts +64 -0
- package/dist/runtime/vue/utils/page-access.js +56 -0
- package/dist/runtime/vue/utils/page-guard.d.ts +30 -0
- package/dist/runtime/vue/utils/page-guard.js +84 -0
- package/dist/runtime/vue/utils/page-rules.d.ts +34 -0
- package/dist/runtime/vue/utils/page-rules.js +35 -0
- package/dist/runtime/vue/utils/page-turns.d.ts +36 -0
- package/dist/runtime/vue/utils/page-turns.js +24 -0
- package/dist/runtime/vue/utils/passkey-signals.d.ts +32 -0
- package/dist/runtime/vue/utils/passkey-signals.js +58 -0
- package/dist/runtime/vue/utils/pricing-bindings.d.ts +51 -0
- package/dist/runtime/vue/utils/pricing-bindings.js +39 -0
- package/dist/runtime/vue/utils/pricing-seo.d.ts +1 -0
- package/dist/runtime/vue/utils/pricing-seo.js +26 -0
- package/dist/runtime/vue/utils/push-device.d.ts +55 -0
- package/dist/runtime/vue/utils/push-device.js +77 -0
- package/dist/runtime/vue/utils/reader.d.ts +1 -0
- package/dist/runtime/vue/utils/reader.js +9 -0
- package/dist/runtime/vue/utils/renamed-component.d.ts +1 -0
- package/dist/runtime/vue/utils/renamed-component.js +17 -0
- package/dist/runtime/vue/utils/roles.d.ts +4 -0
- package/dist/runtime/vue/utils/roles.js +11 -0
- package/dist/runtime/vue/utils/sandbox-code.d.ts +11 -0
- package/dist/runtime/vue/utils/sandbox-code.js +16 -0
- package/dist/runtime/vue/utils/session-end.d.ts +49 -0
- package/dist/runtime/vue/utils/session-end.js +41 -0
- package/dist/runtime/vue/utils/settings-message.d.ts +21 -0
- package/dist/runtime/vue/utils/settings-message.js +6 -0
- package/dist/runtime/vue/utils/shown-first.d.ts +1 -0
- package/dist/runtime/vue/utils/shown-first.js +23 -0
- package/dist/runtime/vue/utils/slug.d.ts +1 -0
- package/dist/runtime/vue/utils/slug.js +7 -0
- package/dist/runtime/vue/utils/storage-choice.d.ts +23 -0
- package/dist/runtime/vue/utils/storage-choice.js +43 -0
- package/dist/runtime/vue/utils/upgrade-offer.d.ts +25 -0
- package/dist/runtime/vue/utils/upgrade-offer.js +18 -0
- package/dist/runtime/vue/utils/vnodes.d.ts +1 -0
- package/dist/runtime/vue/utils/vnodes.js +15 -0
- package/dist/shared/nuxt-backend.2m535CLS.mjs +171 -0
- package/dist/shared/nuxt-backend.C62dpRH3.mjs +27 -0
- package/dist/shared/nuxt-backend.DXEf0rrv.mjs +571 -0
- package/dist/shared/nuxt-backend.Dm1NkY7v.mjs +1154 -0
- package/dist/shared/nuxt-backend.KEzfHO2K.mjs +3562 -0
- package/dist/shared/nuxt-backend.ikObmtHs.mjs +143 -0
- package/dist/types.d.ts +8 -2
- package/package.json +375 -90
- package/skills/nuxt-backend/SKILL.md +142 -0
- package/skills/nuxt-backend/references/api.md +769 -0
- package/skills/nuxt-backend/references/install.md +188 -0
- package/skills/nuxt-backend/references/renames.json +2129 -0
- package/skills/nuxt-backend/references/surface.json +1436 -0
- package/skills/nuxt-backend-ai/SKILL.md +79 -0
- package/skills/nuxt-backend-ai/references/api.md +56 -0
- package/skills/nuxt-backend-auth/SKILL.md +169 -0
- package/skills/nuxt-backend-auth/references/api.md +159 -0
- package/skills/nuxt-backend-billing/SKILL.md +181 -0
- package/skills/nuxt-backend-billing/references/api.md +114 -0
- package/skills/nuxt-backend-data/SKILL.md +91 -0
- package/skills/nuxt-backend-data/references/api.md +79 -0
- package/skills/nuxt-backend-email/SKILL.md +115 -0
- package/skills/nuxt-backend-email/references/api.md +127 -0
- package/skills/nuxt-backend-growth/SKILL.md +47 -0
- package/skills/nuxt-backend-growth/references/api.md +38 -0
- package/skills/nuxt-backend-ship/SKILL.md +187 -0
- package/skills/nuxt-backend-ship/references/api.md +215 -0
- package/skills/nuxt-backend-ui/SKILL.md +84 -0
- package/skills/nuxt-backend-ui/references/api.md +39 -0
- package/skills/nuxt-backend-upgrade/SKILL.md +73 -0
- package/skills/nuxt-backend-upgrade/references/api.md +23 -0
- package/skills/nuxt-backend-upgrade/references/upgrade.md +512 -0
- package/src/convex/access-tickets.ts +188 -0
- package/src/convex/account-data.ts +496 -0
- package/src/convex/activation-rules.ts +149 -0
- package/src/convex/announcements.ts +31 -0
- package/src/convex/app.ts +138 -0
- package/src/convex/auth-secrets.ts +124 -0
- package/src/convex/auth.config.ts +30 -3
- package/src/convex/bytes.ts +10 -0
- package/src/convex/c2pa/cbor.ts +88 -0
- package/src/convex/c2pa/der.ts +108 -0
- package/src/convex/c2pa/formats.ts +309 -0
- package/src/convex/c2pa/jumbf.ts +46 -0
- package/src/convex/c2pa/manifest.ts +195 -0
- package/src/convex/catalog.ts +771 -0
- package/src/convex/client/age-gate.ts +129 -0
- package/src/convex/client/audit.ts +332 -0
- package/src/convex/client/auth-types.ts +387 -0
- package/src/convex/client/better-auth-options.ts +498 -0
- package/src/convex/client/client-address.ts +37 -0
- package/src/convex/client/code-binding.ts +107 -0
- package/src/convex/client/codes.ts +48 -0
- package/src/convex/client/component.ts +181 -0
- package/src/convex/client/devices.ts +205 -0
- package/src/convex/client/email.ts +80 -0
- package/src/convex/client/entities.ts +117 -0
- package/src/convex/client/guards.ts +956 -0
- package/src/convex/client/guest-claim.ts +63 -0
- package/src/convex/client/hooks.ts +79 -0
- package/src/convex/client/identity.ts +8 -0
- package/src/convex/client/index.ts +268 -276
- package/src/convex/client/launch-gate.ts +223 -0
- package/src/convex/client/notices.ts +39 -0
- package/src/convex/client/passkey-only.ts +398 -0
- package/src/convex/client/plugins.ts +211 -0
- package/src/convex/client/refusals.ts +39 -0
- package/src/convex/client/request-origin.ts +109 -0
- package/src/convex/client/request-session.ts +73 -0
- package/src/convex/client/runtime.ts +95 -0
- package/src/convex/client/secret-rotation.ts +113 -0
- package/src/convex/client/sessions.ts +55 -0
- package/src/convex/client/workspaces.ts +150 -0
- package/src/convex/components/backend/_generated/api.ts +132 -0
- package/src/convex/components/backend/_generated/component.ts +5839 -0
- package/src/convex/components/backend/_generated/server.ts +175 -0
- package/src/convex/components/backend/access.ts +441 -0
- package/src/convex/components/backend/account.ts +1069 -0
- package/src/convex/components/backend/adapter.ts +64 -0
- package/src/convex/components/backend/ai.ts +378 -0
- package/src/convex/components/backend/alerts.ts +208 -0
- package/src/convex/components/backend/announcements.ts +275 -0
- package/src/convex/components/backend/audit.ts +341 -0
- package/src/convex/components/backend/billing.ts +756 -0
- package/src/convex/components/backend/consents.ts +168 -0
- package/src/convex/components/backend/convex.config.ts +75 -0
- package/src/convex/components/backend/costs.ts +286 -0
- package/src/convex/components/backend/crons.ts +26 -0
- package/src/convex/components/backend/devices.ts +198 -0
- package/src/convex/components/backend/email.ts +660 -0
- package/src/convex/components/backend/erasures.ts +72 -0
- package/src/convex/components/backend/flags.ts +85 -0
- package/src/convex/components/backend/funnel.ts +596 -0
- package/src/convex/components/backend/gifts.ts +734 -0
- package/src/convex/components/backend/inbound.ts +391 -0
- package/src/convex/components/backend/jobs.ts +944 -0
- package/src/convex/components/backend/keys.ts +50 -0
- package/src/convex/components/backend/lifecycle.ts +355 -0
- package/src/convex/components/backend/lifecycleActivity.ts +29 -0
- package/src/convex/components/backend/maintenance.ts +495 -0
- package/src/convex/components/backend/migrations.ts +120 -0
- package/src/convex/components/backend/monitoring.ts +63 -0
- package/src/convex/components/backend/notifications.ts +532 -0
- package/src/convex/components/backend/onboarding.ts +54 -0
- package/src/convex/components/backend/parties.ts +75 -0
- package/src/convex/components/backend/posture.ts +37 -0
- package/src/convex/components/backend/preferences.ts +690 -0
- package/src/convex/components/backend/push.ts +95 -0
- package/src/convex/components/backend/referrals.ts +761 -0
- package/src/convex/components/backend/reports.ts +609 -0
- package/src/convex/components/backend/schema.ts +2165 -0
- package/src/convex/components/backend/storage.ts +700 -0
- package/src/convex/components/backend/subscriptions.ts +240 -0
- package/src/convex/components/backend/suppressions.ts +115 -0
- package/src/convex/components/backend/waitlist.ts +727 -0
- package/src/convex/components/backend/wake.ts +13 -0
- package/src/convex/components/backend/webhooks.ts +287 -0
- package/src/convex/consent-rules.ts +156 -0
- package/src/convex/constants.ts +191 -0
- package/src/convex/delivery.ts +81 -0
- package/src/convex/email-blocks.ts +119 -0
- package/src/convex/email-helpers.ts +91 -0
- package/src/convex/email-html.ts +20 -0
- package/src/convex/email-posture.ts +233 -0
- package/src/convex/email-preferences.ts +310 -0
- package/src/convex/email-scheme.ts +18 -0
- package/src/convex/email-templates.ts +1020 -0
- package/src/convex/email-theme.ts +201 -0
- package/src/convex/email-validators.ts +27 -0
- package/src/convex/emails/appeal-decided.ts +16 -0
- package/src/convex/emails/content-restricted.ts +29 -0
- package/src/convex/emails/deletion-canceled.ts +8 -0
- package/src/convex/emails/deletion-scheduled.ts +18 -0
- package/src/convex/emails/email-changed.ts +13 -0
- package/src/convex/emails/gift-pass-ending.ts +18 -0
- package/src/convex/emails/gift.ts +18 -0
- package/src/convex/emails/invite.ts +28 -0
- package/src/convex/emails/new-device.ts +21 -0
- package/src/convex/emails/notice-decided.ts +16 -0
- package/src/convex/emails/notice-received.ts +15 -0
- package/src/convex/emails/otp.ts +48 -0
- package/src/convex/emails/passkey-recovered.ts +21 -0
- package/src/convex/emails/renewal-reminder.ts +20 -0
- package/src/convex/emails/topic-confirmation.ts +17 -0
- package/src/convex/emails/waitlist-admitted.ts +16 -0
- package/src/convex/emails/waitlist-confirmation.ts +19 -0
- package/src/convex/emails/welcome.ts +15 -0
- package/src/convex/emails/withdrawal-receipt.ts +16 -0
- package/src/convex/environment.ts +75 -0
- package/src/convex/errors.ts +418 -0
- package/src/convex/events.ts +840 -0
- package/src/convex/files.ts +420 -0
- package/src/convex/flags.ts +344 -0
- package/src/convex/funnel-rules.ts +273 -0
- package/src/convex/inbound-rules.ts +212 -0
- package/src/convex/integrations/access.ts +278 -0
- package/src/convex/integrations/account.ts +1044 -0
- package/src/convex/integrations/admin.ts +510 -0
- package/src/convex/integrations/ai/account-export.ts +53 -0
- package/src/convex/integrations/ai/chat.ts +530 -0
- package/src/convex/integrations/ai/config.ts +747 -0
- package/src/convex/integrations/ai/context.ts +93 -0
- package/src/convex/integrations/ai/costs.ts +80 -0
- package/src/convex/integrations/ai/embeddings.ts +109 -0
- package/src/convex/integrations/ai/job-errors.ts +152 -0
- package/src/convex/integrations/ai/jobs.ts +1268 -0
- package/src/convex/integrations/ai/knowledge.ts +489 -0
- package/src/convex/integrations/ai/metering.ts +408 -0
- package/src/convex/integrations/ai/model-id.ts +16 -0
- package/src/convex/integrations/ai/models.ts +467 -0
- package/src/convex/integrations/ai/moderation.ts +253 -0
- package/src/convex/integrations/ai/pricing.ts +170 -0
- package/src/convex/integrations/ai/provenance.ts +213 -0
- package/src/convex/integrations/ai/setup.ts +58 -0
- package/src/convex/integrations/ai/stream.ts +170 -0
- package/src/convex/integrations/ai.ts +84 -0
- package/src/convex/integrations/announcements.ts +442 -0
- package/src/convex/integrations/audit.ts +523 -0
- package/src/convex/integrations/authorization.ts +366 -0
- package/src/convex/integrations/billing/activity.ts +70 -0
- package/src/convex/integrations/billing/checkout.ts +501 -0
- package/src/convex/integrations/billing/claim-discount.ts +45 -0
- package/src/convex/integrations/billing/context.ts +484 -0
- package/src/convex/integrations/billing/credits.ts +237 -0
- package/src/convex/integrations/billing/customers.ts +369 -0
- package/src/convex/integrations/billing/discounts.ts +96 -0
- package/src/convex/integrations/billing/entitlements.ts +218 -0
- package/src/convex/integrations/billing/erasure.ts +99 -0
- package/src/convex/integrations/billing/events.ts +225 -0
- package/src/convex/integrations/billing/features.ts +91 -0
- package/src/convex/integrations/billing/free-plan.ts +257 -0
- package/src/convex/integrations/billing/functions.ts +506 -0
- package/src/convex/integrations/billing/gift-access.ts +44 -0
- package/src/convex/integrations/billing/gift-manage.ts +281 -0
- package/src/convex/integrations/billing/gift-rules.ts +49 -0
- package/src/convex/integrations/billing/gifts.ts +741 -0
- package/src/convex/integrations/billing/history.ts +233 -0
- package/src/convex/integrations/billing/lifecycle.ts +537 -0
- package/src/convex/integrations/billing/passes.ts +428 -0
- package/src/convex/integrations/billing/pricing.ts +387 -0
- package/src/convex/integrations/billing/provider-client.ts +15 -0
- package/src/convex/integrations/billing/provider-events.ts +220 -0
- package/src/convex/integrations/billing/purchase.ts +346 -0
- package/src/convex/integrations/billing/quotas.ts +205 -0
- package/src/convex/integrations/billing/referral-orders.ts +45 -0
- package/src/convex/integrations/billing/revenue.ts +194 -0
- package/src/convex/integrations/billing/rewards.ts +171 -0
- package/src/convex/integrations/billing/subscriptions.ts +421 -0
- package/src/convex/integrations/billing/types/base.ts +99 -0
- package/src/convex/integrations/billing/types/lifecycle.ts +152 -0
- package/src/convex/integrations/billing/types/options.ts +389 -0
- package/src/convex/integrations/billing/types/records.ts +549 -0
- package/src/convex/integrations/billing/types/revenue.ts +123 -0
- package/src/convex/integrations/billing/types/setup.ts +576 -0
- package/src/convex/integrations/billing/types/surface.ts +626 -0
- package/src/convex/integrations/billing/webhooks.ts +330 -0
- package/src/convex/integrations/billing.ts +263 -0
- package/src/convex/integrations/email-lifecycle.ts +265 -0
- package/src/convex/integrations/email-preferences.ts +417 -0
- package/src/convex/integrations/email-suppressions.ts +176 -0
- package/src/convex/integrations/email-sync.ts +560 -0
- package/src/convex/integrations/email.ts +1224 -0
- package/src/convex/integrations/flags.ts +492 -0
- package/src/convex/integrations/functions.ts +485 -0
- package/src/convex/integrations/health.ts +180 -0
- package/src/convex/integrations/http.ts +198 -0
- package/src/convex/integrations/inbound.ts +712 -0
- package/src/convex/integrations/launch.ts +614 -0
- package/src/convex/integrations/monitoring.ts +259 -0
- package/src/convex/integrations/notifications.ts +590 -0
- package/src/convex/integrations/rate-limit.ts +319 -0
- package/src/convex/integrations/referrals.ts +504 -0
- package/src/convex/integrations/reports.ts +719 -0
- package/src/convex/integrations/retention.ts +196 -0
- package/src/convex/integrations/search.ts +188 -0
- package/src/convex/integrations/storage.ts +595 -0
- package/src/convex/integrations/waitlist.ts +429 -0
- package/src/convex/integrations/webhook-guard.ts +348 -0
- package/src/convex/integrations/webhooks.ts +173 -0
- package/src/convex/integrations/workflows.ts +218 -0
- package/src/convex/jobs-policy.ts +390 -0
- package/src/convex/label-format.ts +73 -0
- package/src/convex/label-groups/access.ts +23 -0
- package/src/convex/label-groups/account.ts +29 -0
- package/src/convex/label-groups/activation.ts +24 -0
- package/src/convex/label-groups/admin.ts +860 -0
- package/src/convex/label-groups/ai.ts +17 -0
- package/src/convex/label-groups/announcement.ts +16 -0
- package/src/convex/label-groups/audit.ts +174 -0
- package/src/convex/label-groups/auth.ts +78 -0
- package/src/convex/label-groups/cancelFlow.ts +54 -0
- package/src/convex/label-groups/connection.ts +15 -0
- package/src/convex/label-groups/consent.ts +44 -0
- package/src/convex/label-groups/contact.ts +26 -0
- package/src/convex/label-groups/credits.ts +29 -0
- package/src/convex/label-groups/deletion.ts +21 -0
- package/src/convex/label-groups/email.ts +209 -0
- package/src/convex/label-groups/errors.ts +119 -0
- package/src/convex/label-groups/feedback.ts +19 -0
- package/src/convex/label-groups/gift.ts +62 -0
- package/src/convex/label-groups/history.ts +27 -0
- package/src/convex/label-groups/impersonation.ts +16 -0
- package/src/convex/label-groups/invitation.ts +27 -0
- package/src/convex/label-groups/legal.ts +147 -0
- package/src/convex/label-groups/maintenance.ts +14 -0
- package/src/convex/label-groups/notifications.ts +91 -0
- package/src/convex/label-groups/onboarding.ts +61 -0
- package/src/convex/label-groups/pastDue.ts +12 -0
- package/src/convex/label-groups/preferences.ts +48 -0
- package/src/convex/label-groups/pricing.ts +97 -0
- package/src/convex/label-groups/profile.ts +41 -0
- package/src/convex/label-groups/quota.ts +27 -0
- package/src/convex/label-groups/reauthenticate.ts +24 -0
- package/src/convex/label-groups/referral.ts +55 -0
- package/src/convex/label-groups/report.ts +58 -0
- package/src/convex/label-groups/security.ts +65 -0
- package/src/convex/label-groups/settings.ts +92 -0
- package/src/convex/label-groups/shell.ts +56 -0
- package/src/convex/label-groups/source.ts +34 -0
- package/src/convex/label-groups/upgrade.ts +22 -0
- package/src/convex/label-groups/upload.ts +21 -0
- package/src/convex/label-groups/usage.ts +14 -0
- package/src/convex/label-groups/waitlist.ts +47 -0
- package/src/convex/label-groups/withdrawal.ts +20 -0
- package/src/convex/label-translations.ts +1836 -0
- package/src/convex/labels.ts +134 -0
- package/src/convex/legal.ts +351 -0
- package/src/convex/lifecycle-flows.ts +91 -0
- package/src/convex/local-origins.ts +25 -0
- package/src/convex/locale.ts +96 -0
- package/src/convex/log.ts +150 -0
- package/src/convex/loopback.ts +20 -0
- package/src/convex/monitoring.ts +550 -0
- package/src/convex/notifications.ts +377 -0
- package/src/convex/package-migrations.ts +49 -0
- package/src/convex/paths.ts +78 -0
- package/src/convex/pauses.ts +56 -0
- package/src/convex/proof.ts +366 -0
- package/src/convex/referral-rules.ts +145 -0
- package/src/convex/report-rules.ts +15 -0
- package/src/convex/sandbox-inbox.ts +176 -0
- package/src/convex/sensitive-actions.ts +276 -0
- package/src/convex/test-models.ts +129 -0
- package/src/convex/test.ts +325 -14
- package/src/convex/tokens.ts +106 -0
- package/src/convex/urls.ts +15 -0
- package/src/convex/visitor.ts +54 -0
- package/src/convex/waitlist-rules.ts +131 -0
- package/src/convex/web-push.ts +243 -0
- package/src/convex/webhook-signatures.ts +167 -0
- package/src/runtime/vue/components/account/AccountData.css +46 -0
- package/src/runtime/vue/components/account/AccountData.vue +185 -0
- package/src/runtime/vue/components/account/AccountDeletion.css +45 -0
- package/src/runtime/vue/components/account/AccountDeletion.vue +102 -0
- package/src/runtime/vue/components/account/AccountExport.css +38 -0
- package/src/runtime/vue/components/account/AccountExport.vue +66 -0
- package/src/runtime/vue/components/account/ActivationChecklist.css +131 -0
- package/src/runtime/vue/components/account/ActivationChecklist.vue +150 -0
- package/src/runtime/vue/components/account/ConsentPrompt.css +181 -0
- package/src/runtime/vue/components/account/ConsentPrompt.vue +149 -0
- package/src/runtime/vue/components/account/ConsentPromptAge.vue +40 -0
- package/src/runtime/vue/components/account/ConsentPromptDialog.vue +151 -0
- package/src/runtime/vue/components/account/ConsentPromptItem.vue +60 -0
- package/src/runtime/vue/components/account/ConsentPromptStorage.vue +82 -0
- package/src/runtime/vue/components/account/EmailUnsubscribe.css +70 -0
- package/src/runtime/vue/components/account/EmailUnsubscribe.vue +118 -0
- package/src/runtime/vue/components/account/HowDidYouHear.css +115 -0
- package/src/runtime/vue/components/account/HowDidYouHear.vue +183 -0
- package/src/runtime/vue/components/account/KeepAccount.css +43 -0
- package/src/runtime/vue/components/account/KeepAccount.vue +63 -0
- package/src/runtime/vue/components/account/OnboardingFlow.css +200 -0
- package/src/runtime/vue/components/account/OnboardingFlow.vue +172 -0
- package/src/runtime/vue/components/account/OnboardingPlan.vue +42 -0
- package/src/runtime/vue/components/account/OnboardingProfile.vue +119 -0
- package/src/runtime/vue/components/account/OnboardingStepActions.vue +45 -0
- package/src/runtime/vue/components/account/OnboardingTeammates.vue +107 -0
- package/src/runtime/vue/components/account/OnboardingWorkspace.vue +174 -0
- package/src/runtime/vue/components/account/ProfileEmailSection.vue +104 -0
- package/src/runtime/vue/components/account/ProfileIdentity.css +57 -0
- package/src/runtime/vue/components/account/ProfileIdentity.vue +51 -0
- package/src/runtime/vue/components/account/ProfileLanguageSection.vue +44 -0
- package/src/runtime/vue/components/account/ProfileNameSection.vue +36 -0
- package/src/runtime/vue/components/account/ProfilePreferencesSection.css +127 -0
- package/src/runtime/vue/components/account/ProfilePreferencesSection.vue +168 -0
- package/src/runtime/vue/components/account/ProfileSettings.css +64 -0
- package/src/runtime/vue/components/account/ProfileSettings.vue +255 -0
- package/src/runtime/vue/components/account/SecurityAlerts.css +47 -0
- package/src/runtime/vue/components/account/SecurityAlerts.vue +79 -0
- package/src/runtime/vue/components/account/SecurityPasskeys.css +79 -0
- package/src/runtime/vue/components/account/SecurityPasskeys.vue +160 -0
- package/src/runtime/vue/components/account/SecuritySessions.css +21 -0
- package/src/runtime/vue/components/account/SecuritySessions.vue +88 -0
- package/src/runtime/vue/components/account/SecuritySettings.css +80 -0
- package/src/runtime/vue/components/account/SecuritySettings.vue +283 -0
- package/src/runtime/vue/components/admin/AdminAccess.css +77 -0
- package/src/runtime/vue/components/admin/AdminAccess.vue +62 -0
- package/src/runtime/vue/components/admin/AdminAccessAdmissions.vue +59 -0
- package/src/runtime/vue/components/admin/AdminAccessAdmit.vue +73 -0
- package/src/runtime/vue/components/admin/AdminAccessCreate.vue +86 -0
- package/src/runtime/vue/components/admin/AdminAccessInvites.vue +56 -0
- package/src/runtime/vue/components/admin/AdminAccessPhase.vue +51 -0
- package/src/runtime/vue/components/admin/AdminAccessRevoke.vue +25 -0
- package/src/runtime/vue/components/admin/AdminAccessTable.vue +65 -0
- package/src/runtime/vue/components/admin/AdminAnalytics.css +24 -0
- package/src/runtime/vue/components/admin/AdminAnalytics.vue +45 -0
- package/src/runtime/vue/components/admin/AdminAnnouncements.css +94 -0
- package/src/runtime/vue/components/admin/AdminAnnouncements.vue +97 -0
- package/src/runtime/vue/components/admin/AdminAnnouncementsCompose.vue +140 -0
- package/src/runtime/vue/components/admin/AdminAnnouncementsItem.vue +89 -0
- package/src/runtime/vue/components/admin/AdminBilling.css +74 -0
- package/src/runtime/vue/components/admin/AdminBilling.vue +214 -0
- package/src/runtime/vue/components/admin/AdminChart.css +57 -0
- package/src/runtime/vue/components/admin/AdminChart.vue +45 -0
- package/src/runtime/vue/components/admin/AdminConsole.css +30 -0
- package/src/runtime/vue/components/admin/AdminConsole.vue +179 -0
- package/src/runtime/vue/components/admin/AdminCosts.css +64 -0
- package/src/runtime/vue/components/admin/AdminCosts.vue +133 -0
- package/src/runtime/vue/components/admin/AdminDrawerFrame.vue +83 -0
- package/src/runtime/vue/components/admin/AdminExperiments.css +99 -0
- package/src/runtime/vue/components/admin/AdminExperiments.vue +174 -0
- package/src/runtime/vue/components/admin/AdminFlags.css +77 -0
- package/src/runtime/vue/components/admin/AdminFlags.vue +486 -0
- package/src/runtime/vue/components/admin/AdminGrowth.css +98 -0
- package/src/runtime/vue/components/admin/AdminGrowth.vue +218 -0
- package/src/runtime/vue/components/admin/AdminInbox.css +98 -0
- package/src/runtime/vue/components/admin/AdminInbox.vue +96 -0
- package/src/runtime/vue/components/admin/AdminInboxMessage.vue +116 -0
- package/src/runtime/vue/components/admin/AdminListFrame.vue +88 -0
- package/src/runtime/vue/components/admin/AdminListTail.vue +50 -0
- package/src/runtime/vue/components/admin/AdminQueue.css +91 -0
- package/src/runtime/vue/components/admin/AdminQueue.vue +108 -0
- package/src/runtime/vue/components/admin/AdminQueueControls.vue +64 -0
- package/src/runtime/vue/components/admin/AdminQueueJob.vue +62 -0
- package/src/runtime/vue/components/admin/AdminQueueJobs.vue +90 -0
- package/src/runtime/vue/components/admin/AdminQueueModels.vue +96 -0
- package/src/runtime/vue/components/admin/AdminQueueTier.vue +97 -0
- package/src/runtime/vue/components/admin/AdminQueueTiers.vue +47 -0
- package/src/runtime/vue/components/admin/AdminReferrals.css +76 -0
- package/src/runtime/vue/components/admin/AdminReferrals.vue +262 -0
- package/src/runtime/vue/components/admin/AdminReports.css +88 -0
- package/src/runtime/vue/components/admin/AdminReports.vue +141 -0
- package/src/runtime/vue/components/admin/AdminReportsAppeal.vue +64 -0
- package/src/runtime/vue/components/admin/AdminReportsDecision.vue +83 -0
- package/src/runtime/vue/components/admin/AdminReportsNotice.vue +57 -0
- package/src/runtime/vue/components/admin/AdminReportsSubject.vue +86 -0
- package/src/runtime/vue/components/admin/AdminRevenue.css +92 -0
- package/src/runtime/vue/components/admin/AdminRevenue.vue +212 -0
- package/src/runtime/vue/components/admin/AdminSuppressions.css +44 -0
- package/src/runtime/vue/components/admin/AdminSuppressions.vue +111 -0
- package/src/runtime/vue/components/admin/AdminSystem.vue +150 -0
- package/src/runtime/vue/components/admin/AdminTabDialogs.vue +30 -0
- package/src/runtime/vue/components/admin/AdminTabStatus.vue +38 -0
- package/src/runtime/vue/components/admin/AdminUserDrawer.vue +309 -0
- package/src/runtime/vue/components/admin/AdminUsers.vue +200 -0
- package/src/runtime/vue/components/admin/AdminUsersTable.vue +109 -0
- package/src/runtime/vue/components/admin/AdminWaitlist.css +71 -0
- package/src/runtime/vue/components/admin/AdminWaitlist.vue +80 -0
- package/src/runtime/vue/components/admin/AdminWaitlistActions.vue +68 -0
- package/src/runtime/vue/components/admin/AdminWaitlistFilter.vue +94 -0
- package/src/runtime/vue/components/admin/AdminWaitlistSummary.vue +72 -0
- package/src/runtime/vue/components/admin/AdminWaitlistTable.vue +84 -0
- package/src/runtime/vue/components/admin/AdminWebhooks.css +68 -0
- package/src/runtime/vue/components/admin/AdminWebhooks.vue +155 -0
- package/src/runtime/vue/components/admin/AdminWorkspaceDrawer.vue +106 -0
- package/src/runtime/vue/components/admin/AdminWorkspaces.vue +121 -0
- package/src/runtime/vue/components/admin/AdminWorkspacesTable.vue +82 -0
- package/src/runtime/vue/components/admin/admin.css +281 -0
- package/src/runtime/vue/components/auth/AuthForm.css +142 -0
- package/src/runtime/vue/components/auth/AuthForm.vue +239 -0
- package/src/runtime/vue/components/auth/AuthFormAge.css +12 -0
- package/src/runtime/vue/components/auth/AuthFormAge.vue +46 -0
- package/src/runtime/vue/components/auth/AuthFormAgreement.css +17 -0
- package/src/runtime/vue/components/auth/AuthFormAgreement.vue +43 -0
- package/src/runtime/vue/components/auth/AuthFormChoose.css +36 -0
- package/src/runtime/vue/components/auth/AuthFormChoose.vue +50 -0
- package/src/runtime/vue/components/auth/AuthFormCode.vue +47 -0
- package/src/runtime/vue/components/auth/AuthFormEmail.vue +41 -0
- package/src/runtime/vue/components/auth/AuthFormError.css +15 -0
- package/src/runtime/vue/components/auth/AuthFormError.vue +19 -0
- package/src/runtime/vue/components/auth/AuthFormHeader.css +18 -0
- package/src/runtime/vue/components/auth/AuthFormHeader.vue +28 -0
- package/src/runtime/vue/components/auth/AuthFormInviteCode.css +17 -0
- package/src/runtime/vue/components/auth/AuthFormInviteCode.vue +49 -0
- package/src/runtime/vue/components/auth/AuthFormPasskey.vue +27 -0
- package/src/runtime/vue/components/auth/AuthFormPasskeyOffer.css +29 -0
- package/src/runtime/vue/components/auth/AuthFormPasskeyOffer.vue +52 -0
- package/src/runtime/vue/components/auth/AuthFormRecover.css +19 -0
- package/src/runtime/vue/components/auth/AuthFormRecover.vue +57 -0
- package/src/runtime/vue/components/auth/AuthFormUndeliverable.css +21 -0
- package/src/runtime/vue/components/auth/AuthFormUndeliverable.vue +35 -0
- package/src/runtime/vue/components/auth/AuthFormWaitlisted.css +25 -0
- package/src/runtime/vue/components/auth/AuthFormWaitlisted.vue +42 -0
- package/src/runtime/vue/components/auth/InviteRedeem.css +34 -0
- package/src/runtime/vue/components/auth/InviteRedeem.vue +63 -0
- package/src/runtime/vue/components/auth/ReauthenticateCode.css +21 -0
- package/src/runtime/vue/components/auth/ReauthenticateCode.vue +59 -0
- package/src/runtime/vue/components/auth/ReauthenticateDialog.css +95 -0
- package/src/runtime/vue/components/auth/ReauthenticateDialog.vue +180 -0
- package/src/runtime/vue/components/auth/ReauthenticatePasskey.css +24 -0
- package/src/runtime/vue/components/auth/ReauthenticatePasskey.vue +37 -0
- package/src/runtime/vue/components/auth/WaitlistCode.css +24 -0
- package/src/runtime/vue/components/auth/WaitlistCode.vue +57 -0
- package/src/runtime/vue/components/auth/WaitlistForm.css +80 -0
- package/src/runtime/vue/components/auth/WaitlistForm.vue +119 -0
- package/src/runtime/vue/components/auth/WaitlistJoin.css +46 -0
- package/src/runtime/vue/components/auth/WaitlistJoin.vue +99 -0
- package/src/runtime/vue/components/auth/WaitlistPlace.css +53 -0
- package/src/runtime/vue/components/auth/WaitlistPlace.vue +78 -0
- package/src/runtime/vue/components/auth/WaitlistShare.css +68 -0
- package/src/runtime/vue/components/auth/WaitlistShare.vue +76 -0
- package/src/runtime/vue/components/auth/WaitlistStatus.css +19 -0
- package/src/runtime/vue/components/auth/WaitlistStatus.vue +75 -0
- package/src/runtime/vue/components/billing/BillingCheckoutLink.vue +103 -0
- package/src/runtime/vue/components/billing/BillingHistory.css +71 -0
- package/src/runtime/vue/components/billing/BillingHistory.vue +131 -0
- package/src/runtime/vue/components/billing/BillingHistoryOrder.css +63 -0
- package/src/runtime/vue/components/billing/BillingHistoryOrder.vue +52 -0
- package/src/runtime/vue/components/billing/BillingPortalLink.vue +65 -0
- package/src/runtime/vue/components/billing/CancelConfirmGroup.vue +55 -0
- package/src/runtime/vue/components/billing/CancelFlow.css +110 -0
- package/src/runtime/vue/components/billing/CancelFlow.vue +133 -0
- package/src/runtime/vue/components/billing/CancelFlowConfirm.vue +35 -0
- package/src/runtime/vue/components/billing/CancelFlowEnd.vue +43 -0
- package/src/runtime/vue/components/billing/CancelFlowOffer.vue +30 -0
- package/src/runtime/vue/components/billing/CancelFlowQuestion.vue +58 -0
- package/src/runtime/vue/components/billing/GiftList.css +101 -0
- package/src/runtime/vue/components/billing/GiftList.vue +125 -0
- package/src/runtime/vue/components/billing/GiftReceived.vue +71 -0
- package/src/runtime/vue/components/billing/GiftSent.vue +138 -0
- package/src/runtime/vue/components/billing/PricingCancelConfirm.vue +14 -0
- package/src/runtime/vue/components/billing/PricingCurrencySelect.vue +53 -0
- package/src/runtime/vue/components/billing/PricingEmailOptOut.css +34 -0
- package/src/runtime/vue/components/billing/PricingEmailOptOut.vue +32 -0
- package/src/runtime/vue/components/billing/PricingPackCard.css +25 -0
- package/src/runtime/vue/components/billing/PricingPackCard.vue +78 -0
- package/src/runtime/vue/components/billing/PricingPeriodSwitch.vue +52 -0
- package/src/runtime/vue/components/billing/PricingPlanCard.css +106 -0
- package/src/runtime/vue/components/billing/PricingPlanCard.vue +142 -0
- package/src/runtime/vue/components/billing/PricingPromotion.vue +24 -0
- package/src/runtime/vue/components/billing/PricingTable.css +94 -0
- package/src/runtime/vue/components/billing/PricingTable.vue +712 -0
- package/src/runtime/vue/components/billing/ReferralCard.css +100 -0
- package/src/runtime/vue/components/billing/ReferralCard.vue +203 -0
- package/src/runtime/vue/components/billing/ReferralLanding.css +52 -0
- package/src/runtime/vue/components/billing/ReferralLanding.vue +112 -0
- package/src/runtime/vue/components/billing/UpgradePrompt.css +55 -0
- package/src/runtime/vue/components/billing/UpgradePrompt.vue +144 -0
- package/src/runtime/vue/components/billing/UsageHistory.css +61 -0
- package/src/runtime/vue/components/billing/UsageHistory.vue +98 -0
- package/src/runtime/vue/components/billing/UsageHistoryEvent.css +39 -0
- package/src/runtime/vue/components/billing/UsageHistoryEvent.vue +25 -0
- package/src/runtime/vue/components/billing/WithdrawalButton.css +59 -0
- package/src/runtime/vue/components/billing/WithdrawalButton.vue +111 -0
- package/src/runtime/vue/components/shared.css +131 -0
- package/src/runtime/vue/components/shell/AccessDenied.css +77 -0
- package/src/runtime/vue/components/shell/AccessDenied.vue +207 -0
- package/src/runtime/vue/components/shell/AccessDeniedPage.vue +25 -0
- package/src/runtime/vue/components/shell/AccountMenu.css +87 -0
- package/src/runtime/vue/components/shell/AccountMenu.vue +92 -0
- package/src/runtime/vue/components/shell/AiLabel.css +68 -0
- package/src/runtime/vue/components/shell/AiLabel.vue +65 -0
- package/src/runtime/vue/components/shell/AppShell.css +188 -0
- package/src/runtime/vue/components/shell/AppShell.vue +122 -0
- package/src/runtime/vue/components/shell/BackendNotices.vue +67 -0
- package/src/runtime/vue/components/shell/ConfirmDialog.css +67 -0
- package/src/runtime/vue/components/shell/ConfirmDialog.vue +76 -0
- package/src/runtime/vue/components/shell/ConnectionStatus.css +36 -0
- package/src/runtime/vue/components/shell/ConnectionStatus.vue +102 -0
- package/src/runtime/vue/components/shell/ContactForm.css +94 -0
- package/src/runtime/vue/components/shell/ContactForm.vue +133 -0
- package/src/runtime/vue/components/shell/ErrorPage.vue +33 -0
- package/src/runtime/vue/components/shell/FrameConnectionStatus.vue +18 -0
- package/src/runtime/vue/components/shell/FrameMain.vue +54 -0
- package/src/runtime/vue/components/shell/Gate.css +51 -0
- package/src/runtime/vue/components/shell/Gate.vue +207 -0
- package/src/runtime/vue/components/shell/GateQuota.vue +87 -0
- package/src/runtime/vue/components/shell/LegalDataMap.vue +46 -0
- package/src/runtime/vue/components/shell/LegalDocument.css +126 -0
- package/src/runtime/vue/components/shell/LegalDocument.vue +266 -0
- package/src/runtime/vue/components/shell/LegalProcessors.vue +61 -0
- package/src/runtime/vue/components/shell/LegalStorage.vue +60 -0
- package/src/runtime/vue/components/shell/ListPager.vue +46 -0
- package/src/runtime/vue/components/shell/NoticeAnnouncement.css +54 -0
- package/src/runtime/vue/components/shell/NoticeAnnouncement.vue +128 -0
- package/src/runtime/vue/components/shell/NoticeDeletion.css +57 -0
- package/src/runtime/vue/components/shell/NoticeDeletion.vue +83 -0
- package/src/runtime/vue/components/shell/NoticeGift.css +51 -0
- package/src/runtime/vue/components/shell/NoticeGift.vue +172 -0
- package/src/runtime/vue/components/shell/NoticeImpersonation.css +44 -0
- package/src/runtime/vue/components/shell/NoticeImpersonation.vue +107 -0
- package/src/runtime/vue/components/shell/NoticeLowCredits.css +62 -0
- package/src/runtime/vue/components/shell/NoticeLowCredits.vue +221 -0
- package/src/runtime/vue/components/shell/NoticeMaintenance.css +30 -0
- package/src/runtime/vue/components/shell/NoticeMaintenance.vue +42 -0
- package/src/runtime/vue/components/shell/NoticePastDue.css +46 -0
- package/src/runtime/vue/components/shell/NoticePastDue.vue +76 -0
- package/src/runtime/vue/components/shell/NotificationInbox.css +220 -0
- package/src/runtime/vue/components/shell/NotificationInbox.vue +104 -0
- package/src/runtime/vue/components/shell/NotificationInboxBell.vue +38 -0
- package/src/runtime/vue/components/shell/NotificationInboxItem.vue +51 -0
- package/src/runtime/vue/components/shell/PageFrame.vue +121 -0
- package/src/runtime/vue/components/shell/PagedList.vue +114 -0
- package/src/runtime/vue/components/shell/ReportAppeal.vue +103 -0
- package/src/runtime/vue/components/shell/ReportNotice.css +58 -0
- package/src/runtime/vue/components/shell/ReportNotice.vue +170 -0
- package/src/runtime/vue/components/shell/UploadField.css +79 -0
- package/src/runtime/vue/components/shell/UploadField.vue +99 -0
- package/src/runtime/vue/components/shell/WorkspaceSwitcher.css +128 -0
- package/src/runtime/vue/components/shell/WorkspaceSwitcher.vue +136 -0
- package/src/runtime/vue/components/tokens.css +100 -0
- package/src/runtime/vue/components/workspaces/AcceptInvitation.css +35 -0
- package/src/runtime/vue/components/workspaces/AcceptInvitation.vue +199 -0
- package/src/runtime/vue/components/workspaces/AcceptInvitationActions.css +21 -0
- package/src/runtime/vue/components/workspaces/AcceptInvitationActions.vue +31 -0
- package/src/runtime/vue/components/workspaces/AuditLog.css +61 -0
- package/src/runtime/vue/components/workspaces/AuditLog.vue +103 -0
- package/src/runtime/vue/components/workspaces/AuditLogEvent.css +53 -0
- package/src/runtime/vue/components/workspaces/AuditLogEvent.vue +31 -0
- package/src/runtime/vue/components/workspaces/WorkspaceBilling.css +112 -0
- package/src/runtime/vue/components/workspaces/WorkspaceBilling.vue +267 -0
- package/src/runtime/vue/components/workspaces/WorkspaceCredits.css +30 -0
- package/src/runtime/vue/components/workspaces/WorkspaceCredits.vue +60 -0
- package/src/runtime/vue/components/workspaces/WorkspaceList.css +77 -0
- package/src/runtime/vue/components/workspaces/WorkspaceList.vue +95 -0
- package/src/runtime/vue/components/workspaces/WorkspaceSettings.css +58 -0
- package/src/runtime/vue/components/workspaces/WorkspaceSettings.vue +268 -0
- package/src/runtime/vue/pages/accept-invitation.vue +24 -0
- package/src/runtime/vue/pages/accessibility.vue +26 -0
- package/src/runtime/vue/pages/admin.vue +63 -0
- package/src/runtime/vue/pages/gifts.vue +27 -0
- package/src/runtime/vue/pages/invite.vue +26 -0
- package/src/runtime/vue/pages/keep-account.vue +31 -0
- package/src/runtime/vue/pages/login.vue +65 -0
- package/src/runtime/vue/pages/pricing.vue +54 -0
- package/src/runtime/vue/pages/privacy.vue +27 -0
- package/src/runtime/vue/pages/profile.vue +22 -0
- package/src/runtime/vue/pages/referral.vue +28 -0
- package/src/runtime/vue/pages/report.vue +44 -0
- package/src/runtime/vue/pages/security.vue +32 -0
- package/src/runtime/vue/pages/settings.vue +38 -0
- package/src/runtime/vue/pages/subprocessors.vue +26 -0
- package/src/runtime/vue/pages/terms.vue +27 -0
- package/src/runtime/vue/pages/unsubscribe.vue +38 -0
- package/src/runtime/vue/pages/waitlist.vue +28 -0
- package/src/runtime/vue/pages/welcome.vue +31 -0
- package/dist/convex/component/_generated/api.d.ts +0 -36
- package/dist/convex/component/_generated/api.d.ts.map +0 -1
- package/dist/convex/component/_generated/api.js.map +0 -1
- package/dist/convex/component/_generated/component.d.ts +0 -549
- package/dist/convex/component/_generated/component.d.ts.map +0 -1
- package/dist/convex/component/_generated/component.js.map +0 -1
- package/dist/convex/component/_generated/dataModel.d.ts.map +0 -1
- package/dist/convex/component/_generated/dataModel.js.map +0 -1
- package/dist/convex/component/_generated/server.d.ts +0 -121
- package/dist/convex/component/_generated/server.d.ts.map +0 -1
- package/dist/convex/component/_generated/server.js +0 -78
- package/dist/convex/component/_generated/server.js.map +0 -1
- package/dist/convex/component/adapter.d.ts.map +0 -1
- package/dist/convex/component/adapter.js +0 -23
- package/dist/convex/component/adapter.js.map +0 -1
- package/dist/convex/component/constants.d.ts +0 -3
- package/dist/convex/component/constants.d.ts.map +0 -1
- package/dist/convex/component/constants.js +0 -3
- package/dist/convex/component/constants.js.map +0 -1
- package/dist/convex/component/convex.config.d.ts +0 -14
- package/dist/convex/component/convex.config.d.ts.map +0 -1
- package/dist/convex/component/convex.config.js +0 -15
- package/dist/convex/component/convex.config.js.map +0 -1
- package/dist/convex/component/schema.d.ts +0 -278
- package/dist/convex/component/schema.d.ts.map +0 -1
- package/dist/convex/component/schema.js +0 -91
- package/dist/convex/component/schema.js.map +0 -1
- package/dist/runtime/nuxt/auth/middleware.d.ts +0 -12
- package/dist/runtime/nuxt/auth/middleware.js +0 -31
- package/dist/runtime/nuxt/auth/proxy.d.ts +0 -6
- package/dist/runtime/nuxt/auth/proxy.js +0 -11
- package/dist/runtime/nuxt/auth/server.d.ts +0 -86
- package/dist/runtime/nuxt/auth/server.js +0 -110
- package/dist/runtime/nuxt/config.d.ts +0 -7
- package/dist/runtime/nuxt/config.js +0 -12
- package/dist/runtime/nuxt/index.d.ts +0 -102
- package/dist/runtime/nuxt/index.js +0 -77
- package/dist/runtime/vue/auth/client.d.ts +0 -14
- package/dist/runtime/vue/auth/client.js +0 -7
- package/dist/runtime/vue/auth/cross-domain.d.ts +0 -8
- package/dist/runtime/vue/auth/cross-domain.js +0 -34
- package/dist/runtime/vue/auth/helpers.d.ts +0 -52
- package/dist/runtime/vue/auth/helpers.js +0 -35
- package/dist/runtime/vue/auth/hydration.d.ts +0 -14
- package/dist/runtime/vue/auth/hydration.js +0 -23
- package/dist/runtime/vue/auth/index.d.ts +0 -79
- package/dist/runtime/vue/auth/index.js +0 -81
- package/dist/runtime/vue/auth/plugin.client.d.ts +0 -6
- package/dist/runtime/vue/auth/plugin.client.js +0 -30
- package/dist/runtime/vue/auth/plugin.server.d.ts +0 -17
- package/dist/runtime/vue/auth/plugin.server.js +0 -29
- package/dist/runtime/vue/auth/use-auth.d.ts +0 -84
- package/dist/runtime/vue/auth/use-auth.js +0 -77
- package/dist/runtime/vue/client.d.ts +0 -245
- package/dist/runtime/vue/client.js +0 -341
- package/dist/runtime/vue/composables/use-action.d.ts +0 -45
- package/dist/runtime/vue/composables/use-action.js +0 -10
- package/dist/runtime/vue/composables/use-connection-state.d.ts +0 -25
- package/dist/runtime/vue/composables/use-connection-state.js +0 -13
- package/dist/runtime/vue/composables/use-mutation.d.ts +0 -60
- package/dist/runtime/vue/composables/use-mutation.js +0 -36
- package/dist/runtime/vue/composables/use-paginated-query.d.ts +0 -101
- package/dist/runtime/vue/composables/use-paginated-query.js +0 -508
- package/dist/runtime/vue/composables/use-queries.d.ts +0 -45
- package/dist/runtime/vue/composables/use-queries.js +0 -32
- package/dist/runtime/vue/composables/use-query.d.ts +0 -82
- package/dist/runtime/vue/composables/use-query.js +0 -63
- package/dist/runtime/vue/composables/use-subscription.d.ts +0 -14
- package/dist/runtime/vue/composables/use-subscription.js +0 -15
- package/dist/runtime/vue/hydration.d.ts +0 -42
- package/dist/runtime/vue/hydration.js +0 -18
- package/dist/runtime/vue/index.d.ts +0 -29
- package/dist/runtime/vue/index.js +0 -38
- package/dist/runtime/vue/queries-observer.d.ts +0 -38
- package/dist/runtime/vue/queries-observer.js +0 -127
- package/src/convex/component/_generated/api.ts +0 -52
- package/src/convex/component/_generated/component.ts +0 -1338
- package/src/convex/component/_generated/server.ts +0 -156
- package/src/convex/component/adapter.ts +0 -42
- package/src/convex/component/constants.ts +0 -2
- package/src/convex/component/convex.config.ts +0 -16
- package/src/convex/component/schema.ts +0 -93
- /package/dist/convex/{component → components/backend}/_generated/api.js +0 -0
- /package/dist/convex/{component → components/backend}/_generated/component.js +0 -0
- /package/dist/convex/{component → components/backend}/_generated/dataModel.d.ts +0 -0
- /package/dist/convex/{component → components/backend}/_generated/dataModel.js +0 -0
- /package/dist/convex/{component → components/backend}/adapter.d.ts +0 -0
- /package/src/convex/{component → components/backend}/_generated/dataModel.ts +0 -0
|
@@ -0,0 +1,3024 @@
|
|
|
1
|
+
import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs';
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { resolve, join, dirname, relative, sep } from 'node:path';
|
|
4
|
+
import { k as executeEnvPush, f as runConvex, aL as envNames, $ as REQUIRED_DEPLOYMENT_ENV, aM as DEV_ONLY_DEPLOYMENT_ENV, l as generateAuthSecret, aN as DEV_SITE_URL, j as deploymentFlags, aO as finding, e as deployKeyType, r as readEnvFiles, g as resolveFunctionsDir, aP as parseBackendEnvironment, c as billingEnvironment, P as packageDir, aQ as proofKeys, aR as TEST_CHALLENGE_SITE_KEYS, aS as deploymentEnvId, aT as protectionTakes, ac as DEFAULT_AUTH_ROUTE, aU as TEST_CHALLENGE_SECRET_KEYS, aV as PROTECTED_AUTH_ROUTES, aW as PROOF_HEADER, aX as signProof, aY as proofAudience, b as deploymentBackendEnvironment, aZ as deploymentSiteOrigin, n as isLoopbackUrl, a6 as HEALTH_ROUTE, a3 as resolveSiteUrl, a0 as deriveDeploymentUrls, a as deploymentEnvNames, a_ as isLocalDeploymentId, A as configuredDeployment, Z as collectPreflightFindings, F as computeDeployment, a$ as applyProductionPosture, b0 as capabilityOfGroup, b1 as agentFilesFinding, O as installedVersion, _ as OPTIONAL_DEPLOYMENT_ENV, aA as BACKEND_ENV, b2 as pinnedRegion, b3 as namedModels, b4 as usesProvenance, b5 as monitoringDsnFinding, b6 as monitoringFindings, b7 as usageAlertsFinding, b8 as readUsageLimits, b9 as billingWebhookSecretHint, v as backendPathsOf, ba as BACKEND_PATH_KEYS, bb as pathOption, t as pathsSourceOf, bc as aiFeatures, bd as pathsFileFinding, be as brandFileFinding, x as appBrandOf, aC as REMOVED_DEPLOYMENT_ENV, bf as installableFinding, d as deploymentFunctionSpec, bg as mountsComponent } from '../shared/nuxt-backend.KEzfHO2K.mjs';
|
|
5
|
+
import { defineCommand } from 'citty';
|
|
6
|
+
import { w as withContract, f as finish, p as progress, b as devScriptFinding } from '../shared/nuxt-backend.2m535CLS.mjs';
|
|
7
|
+
import { pathToFileURL } from 'node:url';
|
|
8
|
+
import { Polar } from '@polar-sh/sdk';
|
|
9
|
+
import { benefitsList } from '@polar-sh/sdk/funcs/benefitsList.js';
|
|
10
|
+
import { membersListMembers } from '@polar-sh/sdk/funcs/membersListMembers.js';
|
|
11
|
+
import { organizationsListOrganizations } from '@polar-sh/sdk/funcs/organizationsListOrganizations.js';
|
|
12
|
+
import { productsList } from '@polar-sh/sdk/funcs/productsList.js';
|
|
13
|
+
import { discountsCreate } from '@polar-sh/sdk/funcs/discountsCreate.js';
|
|
14
|
+
import { discountsList } from '@polar-sh/sdk/funcs/discountsList.js';
|
|
15
|
+
import { discountsUpdate } from '@polar-sh/sdk/funcs/discountsUpdate.js';
|
|
16
|
+
import { ServerList } from '@polar-sh/sdk/lib/config.js';
|
|
17
|
+
import { benefitsCreate } from '@polar-sh/sdk/funcs/benefitsCreate.js';
|
|
18
|
+
import { benefitsUpdate } from '@polar-sh/sdk/funcs/benefitsUpdate.js';
|
|
19
|
+
import { productsUpdateBenefits } from '@polar-sh/sdk/funcs/productsUpdateBenefits.js';
|
|
20
|
+
import { productsUpdate } from '@polar-sh/sdk/funcs/productsUpdate.js';
|
|
21
|
+
import { organizationsUpdate } from '@polar-sh/sdk/funcs/organizationsUpdate.js';
|
|
22
|
+
import { webhooksListWebhookEndpoints } from '@polar-sh/sdk/funcs/webhooksListWebhookEndpoints.js';
|
|
23
|
+
import { webhooksUpdateWebhookEndpoint } from '@polar-sh/sdk/funcs/webhooksUpdateWebhookEndpoint.js';
|
|
24
|
+
import { customersGet } from '@polar-sh/sdk/funcs/customersGet.js';
|
|
25
|
+
import '@convex-dev/polar';
|
|
26
|
+
import { metricsLimits } from '@polar-sh/sdk/funcs/metricsLimits.js';
|
|
27
|
+
import { r as readLastRun, i as installChangedSince, a as formatSize } from './report.mjs';
|
|
28
|
+
import { c as convexConfigFinding } from '../shared/nuxt-backend.DXEf0rrv.mjs';
|
|
29
|
+
|
|
30
|
+
const ENV_DEFAULT_TYPES = ["preview", "dev"];
|
|
31
|
+
const ENV_DEFAULT_NAMES = [...REQUIRED_DEPLOYMENT_ENV, "BACKEND_ENVIRONMENT"];
|
|
32
|
+
function defaultNamesOf(type) {
|
|
33
|
+
return type === "dev" ? [...ENV_DEFAULT_NAMES, ...Object.keys(DEV_ONLY_DEPLOYMENT_ENV)] : ENV_DEFAULT_NAMES;
|
|
34
|
+
}
|
|
35
|
+
function defaultValue(name, type, siteUrl) {
|
|
36
|
+
if (name === "AUTH_SECRET") return generateAuthSecret();
|
|
37
|
+
if (name === "SITE_URL") return siteUrl ?? (type === "dev" ? DEV_SITE_URL : void 0);
|
|
38
|
+
if (name in DEV_ONLY_DEPLOYMENT_ENV) return DEV_ONLY_DEPLOYMENT_ENV[name];
|
|
39
|
+
return type === "dev" ? "development" : "preview";
|
|
40
|
+
}
|
|
41
|
+
function planEnvDefaults({ type, defaultNames, siteUrl, force }) {
|
|
42
|
+
const present = new Set(defaultNames);
|
|
43
|
+
return defaultNamesOf(type).map((name) => {
|
|
44
|
+
const replace = force?.has(name) || name === "SITE_URL" && siteUrl !== void 0;
|
|
45
|
+
if (present.has(name) && !replace) return { name, action: "skip", detail: "already a project default (--force to replace)" };
|
|
46
|
+
const value = defaultValue(name, type, siteUrl);
|
|
47
|
+
if (value === void 0) {
|
|
48
|
+
return { name, action: "missing", detail: "required \u2014 pass the origin new previews start with: --site-url <url>" };
|
|
49
|
+
}
|
|
50
|
+
const detail = name === "AUTH_SECRET" ? `generated (${type} default)` : name === "SITE_URL" ? siteUrl === void 0 ? "dev default" : "from --site-url" : `${type} default`;
|
|
51
|
+
return { name, action: present.has(name) ? "update" : "provision", value, detail };
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
async function projectEnvDefaultNames(rootDir, type) {
|
|
55
|
+
try {
|
|
56
|
+
const { stdout } = await runConvex(rootDir, ["env", "default", "list", "--names-only", "--type", type]);
|
|
57
|
+
return envNames(stdout);
|
|
58
|
+
} catch {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
async function setProjectEnvDefault(rootDir, type, name, value) {
|
|
63
|
+
await runConvex(rootDir, ["env", "default", "set", "--type", type, name], { input: value });
|
|
64
|
+
}
|
|
65
|
+
async function runEnvDefaults(rootDir, options) {
|
|
66
|
+
const defaultNames = await projectEnvDefaultNames(rootDir, options.type);
|
|
67
|
+
if (defaultNames === null) return null;
|
|
68
|
+
const actions = planEnvDefaults({ type: options.type, defaultNames, ...options.siteUrl ? { siteUrl: options.siteUrl } : {}, ...options.force ? { force: options.force } : {} });
|
|
69
|
+
const missingRequired = actions.filter((action) => action.action === "missing").map((action) => action.name);
|
|
70
|
+
const results = missingRequired.length > 0 ? actions.map((action) => ({ action, outcome: "skipped" })) : await executeEnvPush(rootDir, actions, {
|
|
71
|
+
dryRun: options.dryRun,
|
|
72
|
+
setEnv: options.setEnv ?? ((dir, name, value) => setProjectEnvDefault(dir, options.type, name, value))
|
|
73
|
+
});
|
|
74
|
+
return { deployment: `defaults:${options.type}`, dev: false, deployedNames: defaultNames, results, missingRequired };
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const SCAN_LIMIT = 8e3;
|
|
78
|
+
const HAS_ADMIN_QUERY = [
|
|
79
|
+
"let read = 0",
|
|
80
|
+
'for await (const user of ctx.db.query("user")) {',
|
|
81
|
+
' if (typeof user.role === "string" && user.role.split(",").some(role => role.trim() === "admin")) return true',
|
|
82
|
+
` if (++read >= ${SCAN_LIMIT}) return null`,
|
|
83
|
+
"}",
|
|
84
|
+
"return false"
|
|
85
|
+
].join("\n");
|
|
86
|
+
async function deploymentHasAdmin(rootDir, { prod }) {
|
|
87
|
+
try {
|
|
88
|
+
const { stdout } = await runConvex(rootDir, ["run", ...deploymentFlags({ prod }), "--component", "backend", "--inline-query", HAS_ADMIN_QUERY]);
|
|
89
|
+
const answer = stdout.trim();
|
|
90
|
+
return answer === "true" ? true : answer === "false" ? false : null;
|
|
91
|
+
} catch {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function setRoleCommand(email, prod) {
|
|
96
|
+
return `npx convex run${prod ? " --prod" : ""} functions:setUserRole '${JSON.stringify({ email, role: "admin" })}'`;
|
|
97
|
+
}
|
|
98
|
+
function adminBootstrapFindings(hasAdmin, { prod }) {
|
|
99
|
+
if (hasAdmin === null) return [];
|
|
100
|
+
if (hasAdmin) return [finding("admin-bootstrap", "pass", "An account holds the admin role: the admin console (/admin) has its administrator.")];
|
|
101
|
+
return [finding(
|
|
102
|
+
"admin-bootstrap",
|
|
103
|
+
"warn",
|
|
104
|
+
"No account holds the admin role yet: nobody can open the admin console (/admin), ban an account or act as one.",
|
|
105
|
+
`Sign in once, then run \`npx nuxt-backend doctor --fix${prod ? " --prod" : ""}\` and enter your address, or \`${setRoleCommand("you@example.com", prod)}\`.`
|
|
106
|
+
)];
|
|
107
|
+
}
|
|
108
|
+
function addressOf(answer) {
|
|
109
|
+
const email = answer.trim().toLowerCase();
|
|
110
|
+
return /^[^\s@]+@[^\s@]+$/.test(email) ? email : null;
|
|
111
|
+
}
|
|
112
|
+
const FIRST_ADMIN_ADMISSION_MS = 24 * 60 * 60 * 1e3;
|
|
113
|
+
async function admitAddress(rootDir, email, prod) {
|
|
114
|
+
try {
|
|
115
|
+
const args = { emails: [email], source: "invitation", label: "first-administrator", expiresAt: Date.now() + FIRST_ADMIN_ADMISSION_MS };
|
|
116
|
+
await runConvex(rootDir, ["run", ...deploymentFlags({ prod }), "--component", "backend", "access:admit", JSON.stringify(args)]);
|
|
117
|
+
return true;
|
|
118
|
+
} catch {
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
async function bootstrapAdmin(rootDir, { prod, ask, print }) {
|
|
123
|
+
if (await deploymentHasAdmin(rootDir, { prod }) !== false) return null;
|
|
124
|
+
const answer = await ask("[nuxt-backend] doctor --fix: no account holds the admin role. Make which account the first administrator? Its email (empty to skip): ");
|
|
125
|
+
if (!answer.trim()) {
|
|
126
|
+
print("[nuxt-backend] doctor --fix: no first administrator made.");
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
const email = addressOf(answer);
|
|
130
|
+
if (!email) {
|
|
131
|
+
print(`[nuxt-backend] doctor --fix: "${answer.trim()}" is not an email address; no first administrator made.`);
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
try {
|
|
135
|
+
await runConvex(rootDir, ["run", ...deploymentFlags({ prod }), "functions:setUserRole", JSON.stringify({ email, role: "admin" })]);
|
|
136
|
+
} catch (error) {
|
|
137
|
+
const why = error instanceof Error ? error.message : String(error);
|
|
138
|
+
if (/No user with email/.test(why)) {
|
|
139
|
+
const admitted = await admitAddress(rootDir, email, prod);
|
|
140
|
+
print(`[nuxt-backend] doctor --fix: ${email} has no account yet${admitted ? ", and may now sign up while the app is closed" : ""}. Sign in with it once, then run doctor --fix again to make it the first administrator.`);
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
print(`[nuxt-backend] doctor --fix: ${email} was not made an administrator (${why.split("\n")[0]}).`);
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
print(`[nuxt-backend] doctor --fix: ${email} is the first administrator.`);
|
|
147
|
+
return email;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function namesNoFunction(error) {
|
|
151
|
+
if (typeof error?.missingFunction === "boolean") return error.missingFunction;
|
|
152
|
+
return /could not find|not found|no such function/i.test(error instanceof Error ? error.message : String(error));
|
|
153
|
+
}
|
|
154
|
+
const EMAIL_SYNC_TIMEOUT_MS = 5 * 6e4;
|
|
155
|
+
async function runEmailSync(rootDir, { prod = false, dryRun = false, webhook, enableWebhook, rotateWebhookSecret } = {}, run = runConvex) {
|
|
156
|
+
let stdout;
|
|
157
|
+
try {
|
|
158
|
+
({ stdout } = await run(rootDir, ["run", ...deploymentFlags({ prod }), "email:syncEmail", JSON.stringify({ dryRun, ...webhook ? { webhook } : {}, ...enableWebhook ? { enableWebhook } : {}, ...rotateWebhookSecret ? { rotateWebhookSecret } : {} })], { timeout: EMAIL_SYNC_TIMEOUT_MS }));
|
|
159
|
+
} catch (error) {
|
|
160
|
+
if (namesNoFunction(error)) return null;
|
|
161
|
+
throw error;
|
|
162
|
+
}
|
|
163
|
+
return JSON.parse(stdout);
|
|
164
|
+
}
|
|
165
|
+
async function runInboundSync(rootDir, { prod = false } = {}, run = runConvex) {
|
|
166
|
+
let stdout;
|
|
167
|
+
try {
|
|
168
|
+
({ stdout } = await run(rootDir, ["run", ...deploymentFlags({ prod }), "email:syncInbound", "{}"]));
|
|
169
|
+
} catch (error) {
|
|
170
|
+
if (namesNoFunction(error)) return null;
|
|
171
|
+
throw error;
|
|
172
|
+
}
|
|
173
|
+
return JSON.parse(stdout);
|
|
174
|
+
}
|
|
175
|
+
function inboundSyncLines(report) {
|
|
176
|
+
if (!report.support) return [" \xB7 inbox none: setupEmail({ inbound: { support } }) names no support address"];
|
|
177
|
+
const lines = [` ${(report.inbox ?? "missing").padEnd(13)} inbox ${report.support}`];
|
|
178
|
+
if (report.domain) lines.push(` \xB7 domain ${report.domain.name}: ${report.domain.status}, receiving ${report.domain.receiving ? "on" : "off"}`);
|
|
179
|
+
const { webhook } = report;
|
|
180
|
+
lines.push(` ${(webhook.state === "ok" ? "exists" : webhook.state).padEnd(13)} webhook inbound events${webhook.added.length ? ` \u2014 added ${webhook.added.join(", ")}` : ""}`);
|
|
181
|
+
for (const todo of report.todo) lines.push(` todo inbound ${todo}`);
|
|
182
|
+
return lines;
|
|
183
|
+
}
|
|
184
|
+
async function syncInbound(rootDir, report, prod, print) {
|
|
185
|
+
if (report.key !== "full") return { inbound: null, failed: false };
|
|
186
|
+
if (report.dryRun) {
|
|
187
|
+
print(" skipped inbound a dry run leaves the support inbox and its webhook events unchecked");
|
|
188
|
+
return { inbound: null, failed: false };
|
|
189
|
+
}
|
|
190
|
+
try {
|
|
191
|
+
const inbound = await runInboundSync(rootDir, { prod });
|
|
192
|
+
if (!inbound) print(" skipped inbound the deployment has no email:syncInbound: re-export it from backend/email.ts to sync the support inbox");
|
|
193
|
+
else for (const line of inboundSyncLines(inbound)) print(line);
|
|
194
|
+
return { inbound, failed: false };
|
|
195
|
+
} catch (error) {
|
|
196
|
+
print(`[nuxt-backend] email sync: the support inbox's sync failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
197
|
+
return { inbound: null, failed: true };
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
function emailSyncRefusal(rootDir, prod) {
|
|
201
|
+
const keyType = deployKeyType({ ...readEnvFiles(rootDir), ...process.env });
|
|
202
|
+
if (prod && (keyType === "dev" || keyType === "preview")) return `--prod writes production, and CONVEX_DEPLOY_KEY is a ${keyType} deploy key.`;
|
|
203
|
+
if (!prod && (keyType === "prod" || keyType === "project")) return `CONVEX_DEPLOY_KEY is a ${keyType === "prod" ? "production" : "project"} deploy key: pass --prod to write production, or unset it.`;
|
|
204
|
+
return null;
|
|
205
|
+
}
|
|
206
|
+
function emailSyncLines(report) {
|
|
207
|
+
if (report.key === "missing") return ["EMAIL_API_KEY is not set on the deployment: nothing to sync. Add it to .env.local and run `npx nuxt-backend env push`."];
|
|
208
|
+
if (report.key === "restricted") return ["EMAIL_API_KEY may only send: topics, segments and webhooks need a full-access key. Create one at the email provider and run `npx nuxt-backend env push --force`."];
|
|
209
|
+
const lines = report.log.map((entry) => ` ${entry.action.padEnd(13)} ${entry.kind.padEnd(9)} ${entry.key}${entry.note ? ` \u2014 ${entry.note}` : ""}`);
|
|
210
|
+
if (report.topics === 0) lines.push(" \xB7 topic none declared on setupEmail({ topics })");
|
|
211
|
+
lines.push(...webhookLines(report.webhook));
|
|
212
|
+
for (const sender of report.senders) {
|
|
213
|
+
lines.push(` \xB7 sender ${sender.variable} ${sender.domain}: region ${sender.region ?? "unknown"}, DMARC ${sender.dmarc ? `p=${sender.dmarc}` : "missing"}`);
|
|
214
|
+
}
|
|
215
|
+
if (report.region.expected && report.region.actual && report.region.expected !== report.region.actual) {
|
|
216
|
+
lines.push(` drift region EMAIL_REGION is ${report.region.expected}, and the sending domain sends from ${report.region.actual}: set EMAIL_REGION=${report.region.actual}.`);
|
|
217
|
+
}
|
|
218
|
+
return lines;
|
|
219
|
+
}
|
|
220
|
+
function webhookLines(hook) {
|
|
221
|
+
if (!hook.url) return [" skipped webhook (--webhook off, or no site to point it at)"];
|
|
222
|
+
const lacks = hook.missingEvents.length ? ` \u2014 lacks ${hook.missingEvents.join(", ")}` : "";
|
|
223
|
+
const off = hook.enabled === false ? " \u2014 turned off at the provider" : "";
|
|
224
|
+
const lines = [` ${hook.action.padEnd(13)} webhook ${hook.url}${lacks}${off}`];
|
|
225
|
+
if (hook.changed === "enabled" || hook.changed === "would-enable") lines.push(` ${hook.changed.padEnd(13)} webhook delivering again`);
|
|
226
|
+
return lines;
|
|
227
|
+
}
|
|
228
|
+
function webhookFindings(hook) {
|
|
229
|
+
if (!hook.url) return [];
|
|
230
|
+
return [
|
|
231
|
+
...hook.enabled === void 0 ? [] : [emailWebhookEnabledFinding(hook.enabled)],
|
|
232
|
+
hook.action === "exists" ? finding("email-webhook-events", "pass", "The email webhook sends every event the package reads.") : finding("email-webhook-events", "warn", hook.action === "would-create" ? `No webhook at the email provider points at ${hook.url}.` : `The email webhook does not send ${hook.missingEvents.join(", ")}.`, "Run `npx nuxt-backend email sync` (or `doctor --fix`).")
|
|
233
|
+
];
|
|
234
|
+
}
|
|
235
|
+
function emailSyncFindings(report, { prod }) {
|
|
236
|
+
const flows = flowFindings(report);
|
|
237
|
+
if (report.key === "missing") return flows;
|
|
238
|
+
if (report.key === "restricted") {
|
|
239
|
+
return [finding("email-key-permission", "warn", "EMAIL_API_KEY may only send: topics, contacts and broadcasts need a full-access key.", "Create a full-access key at the email provider, put it in .env.local and run `npx nuxt-backend env push --force`."), ...flows];
|
|
240
|
+
}
|
|
241
|
+
const findings = [finding("email-key-permission", "pass", "EMAIL_API_KEY has full access."), ...flows];
|
|
242
|
+
const lacking = report.log.filter((entry) => entry.kind === "topic" && entry.action !== "exists");
|
|
243
|
+
if (report.topics > 0) {
|
|
244
|
+
findings.push(lacking.length === 0 ? finding("email-topics", "pass", `Every declared topic exists at the email provider (${report.topics}).`) : finding("email-topics", "warn", `The email provider lacks or differs on ${lacking.map((entry) => entry.key).join(", ")}.`, "Run `npx nuxt-backend email sync` (or `doctor --fix`)."));
|
|
245
|
+
}
|
|
246
|
+
findings.push(...webhookFindings(report.webhook));
|
|
247
|
+
findings.push(...regionFindings(report));
|
|
248
|
+
if (prod && report.topics > 0 && !report.postalAddress) {
|
|
249
|
+
findings.push(finding("email-postal-address", "fail", "Topics are declared and the brand has no postal address: marketing email must carry one.", "Set `brand.address` in app config (`appConfig.backend.brand`) or on setupEmail."));
|
|
250
|
+
}
|
|
251
|
+
if (prod && report.topics > 0 && !report.senders.some((sender) => sender.variable === "EMAIL_MARKETING_FROM")) {
|
|
252
|
+
findings.push(finding("email-marketing-from", "warn", "Topics are declared and EMAIL_MARKETING_FROM is not set: marketing mail goes from EMAIL_FROM, so a complaint about it can hold up sign-in codes.", "Set EMAIL_MARKETING_FROM to an address on a subdomain of its own, then run `npx nuxt-backend env push --prod`."));
|
|
253
|
+
}
|
|
254
|
+
return findings;
|
|
255
|
+
}
|
|
256
|
+
function emailWebhookEnabledFinding(enabled) {
|
|
257
|
+
return enabled ? finding("email-webhook-enabled", "pass", "The email provider delivers to the webhook.") : finding(
|
|
258
|
+
"email-webhook-enabled",
|
|
259
|
+
"warn",
|
|
260
|
+
"The email provider turned the webhook off after its deliveries kept failing: bounces, complaints and topic changes reach the deployment no more.",
|
|
261
|
+
"Run `npx nuxt-backend doctor --fix`: once the route answers its probe, it turns the webhook back on (after you confirm), and you can replay what was held back."
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
function regionFindings(report) {
|
|
265
|
+
const { expected, actual } = report.region;
|
|
266
|
+
if (!actual) return [];
|
|
267
|
+
if (!expected) return [finding("email-region", "pass", `The sending domain sends from ${actual}; EMAIL_REGION is not set, so nothing records it.`)];
|
|
268
|
+
return [expected === actual ? finding("email-region", "pass", `EMAIL_REGION is ${actual}, the sending domain's region.`) : finding("email-region", "warn", `EMAIL_REGION is ${expected}, but the email provider sends the sending domain's mail from ${actual}: the privacy pages and the data map name the wrong region.`, `Set EMAIL_REGION=${actual} in .env.local and run \`npx nuxt-backend env push\` (\`--prod\` for production).`)];
|
|
269
|
+
}
|
|
270
|
+
function flowFindings(report) {
|
|
271
|
+
const declared = report.flows?.declared ?? [];
|
|
272
|
+
if (declared.length === 0) return [];
|
|
273
|
+
const missing = /* @__PURE__ */ new Set([...report.flows?.unsynced ?? [], ...report.log.filter((entry) => (entry.kind === "template" || entry.kind === "automation") && entry.action !== "exists").map((entry) => entry.key)]);
|
|
274
|
+
return [missing.size === 0 ? finding("email-flows", "pass", `Every lifecycle flow runs, with its template and automation at the email provider (${declared.length}).`) : finding("email-flows", "warn", `${[...missing].join(", ")} ${missing.size === 1 ? "is" : "are"} not synced: ${missing.size === 1 ? "it starts" : "they start"} nothing until \`email sync\` runs.`, "Run `npx nuxt-backend email sync` (or `doctor --fix`).")];
|
|
275
|
+
}
|
|
276
|
+
async function storeSecret(rootDir, secret, prod, print) {
|
|
277
|
+
const [outcome] = await executeEnvPush(rootDir, [{ name: "EMAIL_WEBHOOK_SECRET", action: "update", detail: "the webhook email sync created", value: secret }], { prod });
|
|
278
|
+
if (outcome?.outcome === "set") {
|
|
279
|
+
print("[nuxt-backend] Stored the webhook's signing secret on the deployment as EMAIL_WEBHOOK_SECRET.");
|
|
280
|
+
return "stored";
|
|
281
|
+
}
|
|
282
|
+
print(`[nuxt-backend] The webhook's signing secret could not be stored (${outcome?.error ?? "unknown error"}). Copy it from the email provider and run \`npx convex env set ${prod ? "--prod " : ""}EMAIL_WEBHOOK_SECRET\`.`);
|
|
283
|
+
return "not-stored";
|
|
284
|
+
}
|
|
285
|
+
async function runEmailSyncCommand(rootDir, options, print) {
|
|
286
|
+
const prod = options.prod === true;
|
|
287
|
+
const refusal = emailSyncRefusal(rootDir, prod);
|
|
288
|
+
if (refusal) {
|
|
289
|
+
print(`[nuxt-backend] email sync refused: ${refusal}`);
|
|
290
|
+
return { exitCode: 1, output: null };
|
|
291
|
+
}
|
|
292
|
+
let report;
|
|
293
|
+
try {
|
|
294
|
+
report = await runEmailSync(rootDir, options);
|
|
295
|
+
} catch (error) {
|
|
296
|
+
print(`[nuxt-backend] email sync failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
297
|
+
return { exitCode: 1, output: null };
|
|
298
|
+
}
|
|
299
|
+
if (!report) {
|
|
300
|
+
print("[nuxt-backend] The deployment has no email:syncEmail. Re-export it from backend/email.ts (`export const { syncEmail } = email.api`), then push the backend.");
|
|
301
|
+
return { exitCode: 1, output: null };
|
|
302
|
+
}
|
|
303
|
+
for (const line of emailSyncLines(report)) print(line);
|
|
304
|
+
const secret = report.webhook.secret ? await storeSecret(rootDir, report.webhook.secret, prod, print) : "none";
|
|
305
|
+
const { inbound, failed } = await syncInbound(rootDir, report, prod, print);
|
|
306
|
+
const { webhook } = report;
|
|
307
|
+
return {
|
|
308
|
+
exitCode: report.key === "full" && secret !== "not-stored" && !failed ? 0 : 1,
|
|
309
|
+
output: { deployment: prod ? "production" : "dev", dryRun: report.dryRun, log: report.log, webhook: { url: webhook.url, action: webhook.action, secret }, senders: report.senders, region: report.region, inbound }
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
const emailSync = withContract("email sync", {
|
|
313
|
+
sideEffects: ["writes provider accounts", "writes the dev deployment", "writes production"],
|
|
314
|
+
json: '`{ deployment, dryRun, log: [{ action, kind, key, id?, note? }], webhook: { url, action, secret: "stored" | "not-stored" | "none" }, senders, region, inbound: { support, inbox, domain, webhook, todo } | null }`, the secret never in it',
|
|
315
|
+
exitCodes: {
|
|
316
|
+
0: "synced, or a dry run",
|
|
317
|
+
1: "refused or failed: no `EMAIL_API_KEY`, a key restricted to sending, a deploy key for the other kind of deployment, no `email:syncEmail` on the deployment, a provider error, a webhook secret that could not be stored, or a support inbox sync that failed"
|
|
318
|
+
}
|
|
319
|
+
}, defineCommand({
|
|
320
|
+
meta: { name: "sync", description: "Create the email topics, the accounts' segment and the contact properties backend/email.ts declares at the email provider, point the deployment's webhook at every event the package reads (storing a new webhook's secret), read each sender's region and DMARC, and sync the support inbox" },
|
|
321
|
+
args: {
|
|
322
|
+
"cwd": { type: "string", description: "Project directory", default: "." },
|
|
323
|
+
"prod": { type: "boolean", description: "Sync production's email account and write the production deployment", default: false },
|
|
324
|
+
"dry-run": { type: "boolean", description: "Print each step it would take, and change nothing", default: false },
|
|
325
|
+
"webhook": { type: "string", description: 'Point the webhook at this URL (default: <site>/email/events of the deployment written; "off" to leave it alone)' },
|
|
326
|
+
"json": { type: "boolean", description: "Print the outcome as one JSON document; progress goes to stderr", default: false }
|
|
327
|
+
},
|
|
328
|
+
async run({ args }) {
|
|
329
|
+
finish(args.json, await runEmailSyncCommand(resolve(process.cwd(), args.cwd), {
|
|
330
|
+
prod: args.prod,
|
|
331
|
+
dryRun: args["dry-run"],
|
|
332
|
+
...args.webhook ? { webhook: args.webhook } : {}
|
|
333
|
+
}, progress(args.json)));
|
|
334
|
+
}
|
|
335
|
+
}));
|
|
336
|
+
const email = defineCommand({
|
|
337
|
+
meta: { name: "email", description: "Email helpers" },
|
|
338
|
+
subCommands: { sync: emailSync }
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
const REQUIRED_FUNCTION_EXPORTS = {
|
|
342
|
+
auth: ["getAuthUser", "authConfig", "updateProfile", "listSessions", "revokeSession", "listSignInAlerts"],
|
|
343
|
+
billing: [
|
|
344
|
+
"generateCheckoutLink",
|
|
345
|
+
"generateCustomerPortalUrl",
|
|
346
|
+
"getConfiguredProducts",
|
|
347
|
+
"getPricing",
|
|
348
|
+
"listAllSubscriptions",
|
|
349
|
+
"giftCheckout",
|
|
350
|
+
"getCurrentSubscription",
|
|
351
|
+
"getFeatures",
|
|
352
|
+
"getBillingAccess",
|
|
353
|
+
"getCredits",
|
|
354
|
+
"syncEntitlements",
|
|
355
|
+
"syncProducts",
|
|
356
|
+
"startFreePlan",
|
|
357
|
+
"getReceivedGifts",
|
|
358
|
+
"claimGift",
|
|
359
|
+
"getSentGifts",
|
|
360
|
+
"resendGift",
|
|
361
|
+
"changeGiftRecipient",
|
|
362
|
+
"rescheduleGift",
|
|
363
|
+
"cancelGift",
|
|
364
|
+
"runGiftSweep",
|
|
365
|
+
"updateSubscription",
|
|
366
|
+
"cancelSubscription",
|
|
367
|
+
"getCancelFlow",
|
|
368
|
+
"acceptSaveOffer",
|
|
369
|
+
"getWithdrawal",
|
|
370
|
+
"withdraw",
|
|
371
|
+
"uncancelSubscription",
|
|
372
|
+
"cancelPendingChange",
|
|
373
|
+
"pauseSubscription",
|
|
374
|
+
"resumeSubscription",
|
|
375
|
+
"getOrders",
|
|
376
|
+
"getInvoiceUrl",
|
|
377
|
+
"getUsageHistory",
|
|
378
|
+
"refundOrder"
|
|
379
|
+
],
|
|
380
|
+
email: ["getEmailStatus", "previewEmails", "sendEmailPreview", "getEmailPreferences", "setEmailTopic", "unsubscribeAllTopics", "getEmailLink", "unsubscribeByLink", "confirmEmailTopic", "recordTimeZone", "syncEmail", "getAnnouncements", "dismissAnnouncement", "getAnnouncementsConsole", "publishAnnouncement", "endAnnouncement", "previewAnnouncement", "sendAnnouncement", "cancelAnnouncement", "getSuppressions", "liftSuppression"],
|
|
381
|
+
audit: ["listActivity", "listWorkspaceActivity", "listAllActivity", "getActivation", "dismissActivation"],
|
|
382
|
+
notifications: ["listNotifications", "getUnreadCount", "markNotificationsRead", "getNotificationChannels", "setNotificationChannel", "getPushConfig", "subscribePush", "unsubscribePush", "deliverNotification"],
|
|
383
|
+
account: ["exportAccountData", "getAccountExport", "eraseAccountData", "getConsents", "getConsentTerms", "grantConsent", "withdrawConsent", "chooseStorage", "getAccountDeletion", "cancelAccountDeletion", "getOnboarding", "completeOnboarding"],
|
|
384
|
+
admin: ["listUsers", "getUser", "listWorkspaces", "getWorkspace"],
|
|
385
|
+
flags: ["getFlags", "listFlags", "setFlag", "exposeExperiment"],
|
|
386
|
+
webhooks: ["getWebhookDeliveries", "replayWebhookDelivery"]
|
|
387
|
+
};
|
|
388
|
+
function missingContractFunctions(identifiers) {
|
|
389
|
+
const missing = [];
|
|
390
|
+
for (const [module, names] of Object.entries(REQUIRED_FUNCTION_EXPORTS)) {
|
|
391
|
+
for (const name of names) {
|
|
392
|
+
if (!identifiers.has(`${module}:${name}`)) missing.push(`${module}:${name}`);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
return missing;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
const TRIAL_PASS_MAX_DAYS = 92;
|
|
399
|
+
function trialPassDays(trial) {
|
|
400
|
+
if (!trial?.pass) return void 0;
|
|
401
|
+
if (trial.interval === void 0) return trial.count ?? 14;
|
|
402
|
+
const count = trial.count ?? 1;
|
|
403
|
+
return trial.interval === "day" ? count : trial.interval === "week" ? count * 7 : count * 30;
|
|
404
|
+
}
|
|
405
|
+
function providerTrialOf(trial) {
|
|
406
|
+
return trial && !trial.pass ? trial : void 0;
|
|
407
|
+
}
|
|
408
|
+
const CATALOG_INTERVALS = ["month", "year"];
|
|
409
|
+
const PASS_LENGTHS = [1, 3, 12];
|
|
410
|
+
const QUOTA_METADATA_PREFIX = "quota_";
|
|
411
|
+
const QUOTA_KEY = /^[a-z][\w-]{0,33}$/i;
|
|
412
|
+
const PERSON_WORD = /^(?:members?|memberships?|seats?|users?|teammates?|collaborators?|guests?|people|persons?)$/;
|
|
413
|
+
const COUNT_WORDS = /* @__PURE__ */ new Set([
|
|
414
|
+
"count",
|
|
415
|
+
"counts",
|
|
416
|
+
"limit",
|
|
417
|
+
"limits",
|
|
418
|
+
"max",
|
|
419
|
+
"maximum",
|
|
420
|
+
"min",
|
|
421
|
+
"minimum",
|
|
422
|
+
"total",
|
|
423
|
+
"cap",
|
|
424
|
+
"quota",
|
|
425
|
+
"num",
|
|
426
|
+
"number",
|
|
427
|
+
"allowed",
|
|
428
|
+
"included",
|
|
429
|
+
"available",
|
|
430
|
+
"extra",
|
|
431
|
+
"additional",
|
|
432
|
+
"active",
|
|
433
|
+
"slot",
|
|
434
|
+
"slots",
|
|
435
|
+
"per",
|
|
436
|
+
"each",
|
|
437
|
+
"in",
|
|
438
|
+
"of",
|
|
439
|
+
"workspace",
|
|
440
|
+
"workspaces",
|
|
441
|
+
"org",
|
|
442
|
+
"orgs",
|
|
443
|
+
"organization",
|
|
444
|
+
"organizations",
|
|
445
|
+
"team",
|
|
446
|
+
"teams",
|
|
447
|
+
"account",
|
|
448
|
+
"accounts",
|
|
449
|
+
"plan"
|
|
450
|
+
]);
|
|
451
|
+
function isSeatLikeQuota(key) {
|
|
452
|
+
const words = key.replace(/([a-z\d])([A-Z])/g, "$1_$2").toLowerCase().split(/[^a-z\d]+/).filter(Boolean);
|
|
453
|
+
let last = words.length - 1;
|
|
454
|
+
while (last >= 0 && COUNT_WORDS.has(words[last])) last--;
|
|
455
|
+
return last >= 0 && PERSON_WORD.test(words[last]);
|
|
456
|
+
}
|
|
457
|
+
function planQuotasKey(plan) {
|
|
458
|
+
return `${plan}-quotas`;
|
|
459
|
+
}
|
|
460
|
+
const DISCOUNT_CODE = /^[a-z0-9]{3,64}$/i;
|
|
461
|
+
function discountMonths(duration) {
|
|
462
|
+
return typeof duration === "object" && duration !== null ? duration.months : void 0;
|
|
463
|
+
}
|
|
464
|
+
function discountProductKeys(discount, catalog) {
|
|
465
|
+
const { plans = [], packs = [], interval } = discount.products ?? {};
|
|
466
|
+
const prices = plans.flatMap((key) => {
|
|
467
|
+
const plan = catalog.plans?.[key];
|
|
468
|
+
if (!plan) return [];
|
|
469
|
+
return pricedIntervals(plan).filter((at) => !interval || at === interval).map((at) => planProductKey(key, at));
|
|
470
|
+
});
|
|
471
|
+
return [...prices, ...packs];
|
|
472
|
+
}
|
|
473
|
+
function planProductKey(plan, interval) {
|
|
474
|
+
return interval === "month" ? plan : `${plan}:${interval}`;
|
|
475
|
+
}
|
|
476
|
+
function isIntervalPrices(prices) {
|
|
477
|
+
return prices !== void 0 && CATALOG_INTERVALS.some((interval) => interval in prices);
|
|
478
|
+
}
|
|
479
|
+
function planPricesByCurrency(plan, currency) {
|
|
480
|
+
if (!plan.prices) return [];
|
|
481
|
+
if (isIntervalPrices(plan.prices)) return [[currency, plan.prices]];
|
|
482
|
+
return Object.entries(plan.prices).map(([code, prices]) => [code.toLowerCase(), prices ?? {}]);
|
|
483
|
+
}
|
|
484
|
+
function packPricesByCurrency(pack, currency) {
|
|
485
|
+
if (typeof pack.price === "number") return [[currency, pack.price]];
|
|
486
|
+
return Object.entries(pack.price ?? {}).map(([code, price]) => [code.toLowerCase(), price]);
|
|
487
|
+
}
|
|
488
|
+
function pricedIntervals(plan) {
|
|
489
|
+
const priced = planPricesByCurrency(plan, void 0).map(([, prices]) => prices);
|
|
490
|
+
return CATALOG_INTERVALS.filter((interval) => priced.some((prices) => typeof prices[interval] === "number"));
|
|
491
|
+
}
|
|
492
|
+
function isFreePlan(plan) {
|
|
493
|
+
const amounts = planPricesByCurrency(plan, void 0).flatMap(([, prices]) => CATALOG_INTERVALS.flatMap((interval) => typeof prices[interval] === "number" ? [prices[interval]] : []));
|
|
494
|
+
return amounts.length > 0 && amounts.every((amount) => amount === 0);
|
|
495
|
+
}
|
|
496
|
+
function freePlanOf(catalog) {
|
|
497
|
+
return Object.entries(catalog.plans ?? {}).find(([, plan]) => !plan.retired && isFreePlan(plan));
|
|
498
|
+
}
|
|
499
|
+
function planCreditUnits(grant, interval) {
|
|
500
|
+
if (typeof grant.units === "number") return interval === "year" ? grant.units * 12 : grant.units;
|
|
501
|
+
return grant.units[interval] ?? (interval === "year" && grant.units.month !== void 0 ? grant.units.month * 12 : void 0);
|
|
502
|
+
}
|
|
503
|
+
const BILLING_WEBHOOK_PROVISION_EVENTS = [
|
|
504
|
+
"checkout.created",
|
|
505
|
+
"checkout.updated",
|
|
506
|
+
"checkout.expired",
|
|
507
|
+
"customer.created",
|
|
508
|
+
"customer.updated",
|
|
509
|
+
"customer.deleted",
|
|
510
|
+
"customer.state_changed",
|
|
511
|
+
"customer_seat.assigned",
|
|
512
|
+
"customer_seat.claimed",
|
|
513
|
+
"customer_seat.revoked",
|
|
514
|
+
"member.created",
|
|
515
|
+
"member.updated",
|
|
516
|
+
"member.deleted",
|
|
517
|
+
"order.created",
|
|
518
|
+
"order.updated",
|
|
519
|
+
"order.paid",
|
|
520
|
+
"order.refunded",
|
|
521
|
+
"subscription.created",
|
|
522
|
+
"subscription.updated",
|
|
523
|
+
"subscription.active",
|
|
524
|
+
"subscription.canceled",
|
|
525
|
+
"subscription.uncanceled",
|
|
526
|
+
"subscription.revoked",
|
|
527
|
+
"subscription.past_due",
|
|
528
|
+
"refund.created",
|
|
529
|
+
"refund.updated",
|
|
530
|
+
"product.created",
|
|
531
|
+
"product.updated",
|
|
532
|
+
"benefit.created",
|
|
533
|
+
"benefit.updated",
|
|
534
|
+
"benefit_grant.created",
|
|
535
|
+
"benefit_grant.cycled",
|
|
536
|
+
"benefit_grant.updated",
|
|
537
|
+
"benefit_grant.revoked",
|
|
538
|
+
"organization.updated"
|
|
539
|
+
];
|
|
540
|
+
|
|
541
|
+
function providerClientOptions({ accessToken, environment }) {
|
|
542
|
+
return { accessToken: accessToken ?? "", server: environment };
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
const DISCOUNT_LIMIT_API_VERSION = "2026-10";
|
|
546
|
+
function discountUrl({ environment }, id) {
|
|
547
|
+
return `${ServerList[environment]}/v1/discounts/${encodeURIComponent(id)}`;
|
|
548
|
+
}
|
|
549
|
+
async function request(target, id, init) {
|
|
550
|
+
const response = await fetch(discountUrl(target, id), {
|
|
551
|
+
method: init.method,
|
|
552
|
+
headers: {
|
|
553
|
+
"authorization": `Bearer ${target.accessToken}`,
|
|
554
|
+
"accept": "application/json",
|
|
555
|
+
"polar-version": DISCOUNT_LIMIT_API_VERSION,
|
|
556
|
+
...init.body === void 0 ? {} : { "content-type": "application/json" }
|
|
557
|
+
},
|
|
558
|
+
...init.body === void 0 ? {} : { body: JSON.stringify(init.body) }
|
|
559
|
+
});
|
|
560
|
+
if (!response.ok) throw new Error(`the provider answered ${response.status}`);
|
|
561
|
+
return await response.json();
|
|
562
|
+
}
|
|
563
|
+
function limitOf(discount) {
|
|
564
|
+
const value = discount.max_redemptions_per_customer;
|
|
565
|
+
return typeof value === "number" && Number.isSafeInteger(value) ? value : null;
|
|
566
|
+
}
|
|
567
|
+
async function readPerCustomerLimit(target, id) {
|
|
568
|
+
return limitOf(await request(target, id, { method: "GET" }));
|
|
569
|
+
}
|
|
570
|
+
async function writePerCustomerLimit(target, id, limit) {
|
|
571
|
+
return limitOf(await request(target, id, { method: "PATCH", body: { max_redemptions_per_customer: limit } }));
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
const MANAGED_BY = "nuxt-backend";
|
|
575
|
+
function isManaged(metadata, key) {
|
|
576
|
+
return metadata?.managedBy === MANAGED_BY && metadata?.key === key;
|
|
577
|
+
}
|
|
578
|
+
function asError(value, message) {
|
|
579
|
+
if (value instanceof Error) return value;
|
|
580
|
+
if (value === void 0) return new Error(message);
|
|
581
|
+
const detail = typeof value === "string" ? value : JSON.stringify(value);
|
|
582
|
+
return new Error(`${message}: ${detail}`, { cause: value });
|
|
583
|
+
}
|
|
584
|
+
async function listAllPages(fetchPage) {
|
|
585
|
+
const items = [];
|
|
586
|
+
for (let page = 1; ; page++) {
|
|
587
|
+
const result = await fetchPage(page);
|
|
588
|
+
if (!result.ok || !result.value) throw asError(result.error, "[nuxt-backend] billing sync: list request failed");
|
|
589
|
+
items.push(...result.value.result.items);
|
|
590
|
+
if (page >= result.value.result.pagination.maxPage) break;
|
|
591
|
+
}
|
|
592
|
+
return items;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
const refuse = (key, message) => {
|
|
596
|
+
throw new Error(`[nuxt-backend] billing sync: discount '${key}' ${message}`);
|
|
597
|
+
};
|
|
598
|
+
function dateOf(key, field, value) {
|
|
599
|
+
if (value === void 0) return null;
|
|
600
|
+
const date = value instanceof Date ? value : new Date(value);
|
|
601
|
+
if (Number.isNaN(date.getTime())) refuse(key, `has a \`${field}\` that is no date: ${String(value)}.`);
|
|
602
|
+
return date;
|
|
603
|
+
}
|
|
604
|
+
const isWhole = (value, min = 1) => typeof value === "number" && Number.isSafeInteger(value) && value >= min;
|
|
605
|
+
function requireScope(key, discount, catalog) {
|
|
606
|
+
const { plans = [], packs = [], interval } = discount.products ?? {};
|
|
607
|
+
if (plans.length + packs.length === 0) refuse(key, "applies to nothing: list the `plans` or `packs` it is for in `products` \u2014 a discount never applies to every product.");
|
|
608
|
+
const free = freePlanOf(catalog)?.[0];
|
|
609
|
+
for (const plan of plans) {
|
|
610
|
+
const declared = catalog.plans?.[plan];
|
|
611
|
+
if (!declared) refuse(key, `names plan '${plan}', which the catalog does not declare.`);
|
|
612
|
+
if (declared.retired) refuse(key, `names plan '${plan}', which is retired: it sells to nobody new.`);
|
|
613
|
+
if (plan === free) refuse(key, `names the free plan '${plan}': nobody pays for it, and nobody checks it out.`);
|
|
614
|
+
if (interval && !pricedIntervals(declared).includes(interval)) refuse(key, `is for plan '${plan}' at '${interval}', which the plan has no price at.`);
|
|
615
|
+
}
|
|
616
|
+
for (const pack of packs) {
|
|
617
|
+
if (!catalog.packs?.[pack]) refuse(key, `names pack '${pack}', which the catalog does not declare.`);
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
function requireAmount(key, discount) {
|
|
621
|
+
const { percentOff, amountOff } = discount;
|
|
622
|
+
if (percentOff === void 0 === (amountOff === void 0)) refuse(key, "needs one of `percentOff` and `amountOff`.");
|
|
623
|
+
const twoDecimals = (value) => Math.abs(value * 100 - Math.round(value * 100)) < 1e-9;
|
|
624
|
+
if (percentOff !== void 0 && !(typeof percentOff === "number" && percentOff > 0 && percentOff <= 100 && twoDecimals(percentOff))) {
|
|
625
|
+
refuse(key, "needs a `percentOff` above 0 and at most 100, with at most two decimals.");
|
|
626
|
+
}
|
|
627
|
+
if (amountOff === void 0) return;
|
|
628
|
+
const amounts = typeof amountOff === "number" ? [amountOff] : Object.values(amountOff ?? {});
|
|
629
|
+
if (amounts.length === 0 || !amounts.every((amount) => isWhole(amount))) refuse(key, "needs an `amountOff` in whole cents above 0, in every currency it names.");
|
|
630
|
+
}
|
|
631
|
+
function requireDuration(key, discount, catalog) {
|
|
632
|
+
const { duration } = discount;
|
|
633
|
+
const months = discountMonths(duration);
|
|
634
|
+
if (duration !== "once" && duration !== "forever" && !isWhole(months)) refuse(key, "needs a `duration` of 'once', 'forever' or { months } (a whole number of months).");
|
|
635
|
+
if (months !== void 0 && months > 999) refuse(key, "lasts more than 999 months.");
|
|
636
|
+
const yearly = discountProductKeys(discount, catalog).some((product) => product.endsWith(":year"));
|
|
637
|
+
if (months !== void 0 && yearly && months % 12 !== 0) {
|
|
638
|
+
refuse(key, `lasts ${months} months and applies to a yearly price, whose first payment covers a whole year: set \`products.interval: 'month'\`, or a number of months that is whole years.`);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
function refuseInvalidDiscounts(catalog) {
|
|
642
|
+
const codes = /* @__PURE__ */ new Map();
|
|
643
|
+
for (const [key, discount] of Object.entries(catalog.discounts ?? {})) {
|
|
644
|
+
if (discount.retired) continue;
|
|
645
|
+
if (typeof discount.name !== "string" || discount.name.trim() === "") refuse(key, "needs a `name`: the customer sees it at checkout.");
|
|
646
|
+
requireAmount(key, discount);
|
|
647
|
+
requireDuration(key, discount, catalog);
|
|
648
|
+
requireScope(key, discount, catalog);
|
|
649
|
+
requireCode(key, discount, codes);
|
|
650
|
+
requireLimits(key, discount);
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
function requireCode(key, discount, codes) {
|
|
654
|
+
if (discount.code === void 0) return;
|
|
655
|
+
if (!DISCOUNT_CODE.test(discount.code)) refuse(key, "has a `code` that is not 3 to 64 letters and digits.");
|
|
656
|
+
const taken = codes.get(discount.code.toLowerCase());
|
|
657
|
+
if (taken) refuse(key, `has the code of discount '${taken}': a code names one discount.`);
|
|
658
|
+
codes.set(discount.code.toLowerCase(), key);
|
|
659
|
+
if (discount.percentOff === 100 && discount.duration === "forever") {
|
|
660
|
+
refuse(key, "is 100% off forever with a code: anyone who finds the code gets the plan for nothing, for good. Remove the code and apply it from the server.");
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
function requireLimits(key, discount) {
|
|
664
|
+
for (const field of ["maxRedemptions", "perCustomer"]) {
|
|
665
|
+
if (discount[field] !== void 0 && !isWhole(discount[field])) refuse(key, `needs \`${field}\` as a whole number above 0.`);
|
|
666
|
+
}
|
|
667
|
+
const startsAt = dateOf(key, "startsAt", discount.startsAt);
|
|
668
|
+
const endsAt = dateOf(key, "endsAt", discount.endsAt);
|
|
669
|
+
if (startsAt && endsAt && endsAt <= startsAt) refuse(key, "ends before it starts.");
|
|
670
|
+
}
|
|
671
|
+
function productCurrencies(catalog, discount, currency) {
|
|
672
|
+
const { plans = [], packs = [] } = discount.products ?? {};
|
|
673
|
+
return /* @__PURE__ */ new Set([
|
|
674
|
+
...plans.flatMap((plan) => planPricesByCurrency(catalog.plans[plan], currency).map(([code]) => code)),
|
|
675
|
+
...packs.flatMap((pack) => packPricesByCurrency(catalog.packs[pack], currency).map(([code]) => code))
|
|
676
|
+
]);
|
|
677
|
+
}
|
|
678
|
+
function fixedAmounts(key, catalog, discount, currency) {
|
|
679
|
+
const amountOff = discount.amountOff;
|
|
680
|
+
const priced = productCurrencies(catalog, discount, currency);
|
|
681
|
+
if (typeof amountOff === "number") {
|
|
682
|
+
if (!currency) refuse(key, "has an `amountOff` without a currency, and the organization's default currency could not be read: set `currency` in the catalog, or name it (`amountOff: { usd: 500 }`).");
|
|
683
|
+
const others = [...priced].filter((code) => code !== currency);
|
|
684
|
+
if (others.length > 0) refuse(key, `has one \`amountOff\` while its products are priced in ${others.join(", ")} too: name an amount for each currency.`);
|
|
685
|
+
return { [currency]: amountOff };
|
|
686
|
+
}
|
|
687
|
+
const amounts = Object.fromEntries(Object.entries(amountOff).map(([code, amount]) => [code.toLowerCase(), amount]));
|
|
688
|
+
const codes = [...priced].map((code) => code ?? currency);
|
|
689
|
+
if (codes.includes(void 0)) refuse(key, "is a fixed amount off products priced in the organization's default currency, which could not be read: set `currency` in the catalog.");
|
|
690
|
+
const missing = codes.filter((code) => !(code in amounts));
|
|
691
|
+
if (missing.length > 0) refuse(key, `has no \`amountOff\` in ${missing.join(", ")}, which its products are priced in: the provider would not take it off there.`);
|
|
692
|
+
return amounts;
|
|
693
|
+
}
|
|
694
|
+
function refuseUnpricedDiscounts(catalog, currency) {
|
|
695
|
+
for (const [key, discount] of Object.entries(catalog.discounts ?? {})) {
|
|
696
|
+
if (!discount.retired && discount.amountOff !== void 0) fixedAmounts(key, catalog, discount, currency);
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
function wantedOf(key, discount, catalog, currency, ids) {
|
|
700
|
+
const months = discountMonths(discount.duration);
|
|
701
|
+
const percentOff = discount.percentOff;
|
|
702
|
+
return {
|
|
703
|
+
name: discount.name,
|
|
704
|
+
code: discount.code ?? null,
|
|
705
|
+
...percentOff === void 0 ? { type: "fixed", amounts: fixedAmounts(key, catalog, discount, currency) } : { type: "percentage", basisPoints: Math.round(percentOff * 100) },
|
|
706
|
+
duration: months === void 0 ? discount.duration : "repeating",
|
|
707
|
+
...months === void 0 ? {} : { months },
|
|
708
|
+
startsAt: dateOf(key, "startsAt", discount.startsAt),
|
|
709
|
+
endsAt: dateOf(key, "endsAt", discount.endsAt),
|
|
710
|
+
maxRedemptions: discount.maxRedemptions ?? null,
|
|
711
|
+
perCustomer: discount.perCustomer ?? null,
|
|
712
|
+
productIds: discountProductKeys(discount, catalog).flatMap((product) => ids.products[product] ?? [])
|
|
713
|
+
};
|
|
714
|
+
}
|
|
715
|
+
function createPayload(key, wanted) {
|
|
716
|
+
const base = {
|
|
717
|
+
name: wanted.name,
|
|
718
|
+
code: wanted.code,
|
|
719
|
+
startsAt: wanted.startsAt,
|
|
720
|
+
endsAt: wanted.endsAt,
|
|
721
|
+
maxRedemptions: wanted.maxRedemptions,
|
|
722
|
+
products: wanted.productIds,
|
|
723
|
+
duration: wanted.duration,
|
|
724
|
+
...wanted.months === void 0 ? {} : { durationInMonths: wanted.months },
|
|
725
|
+
metadata: { managedBy: MANAGED_BY, key }
|
|
726
|
+
};
|
|
727
|
+
return wanted.type === "percentage" ? { ...base, type: "percentage", basisPoints: wanted.basisPoints } : { ...base, type: "fixed", amounts: wanted.amounts };
|
|
728
|
+
}
|
|
729
|
+
const time = (date) => date ? new Date(date).getTime() : null;
|
|
730
|
+
const sameAmounts = (a, b) => JSON.stringify(Object.entries(a ?? {}).sort()) === JSON.stringify(Object.entries(b ?? {}).sort());
|
|
731
|
+
const sortedIds = (ids) => [...ids].sort().join();
|
|
732
|
+
function mutableChanges(live, wanted) {
|
|
733
|
+
const fields = [
|
|
734
|
+
["name", live.name !== wanted.name, wanted.name],
|
|
735
|
+
["code", live.code !== wanted.code, wanted.code],
|
|
736
|
+
["startsAt", time(live.startsAt) !== time(wanted.startsAt), wanted.startsAt],
|
|
737
|
+
["endsAt", time(live.endsAt) !== time(wanted.endsAt), wanted.endsAt],
|
|
738
|
+
["maxRedemptions", live.maxRedemptions !== wanted.maxRedemptions, wanted.maxRedemptions],
|
|
739
|
+
["products", sortedIds(live.products.map((product) => product.id)) !== sortedIds(wanted.productIds), wanted.productIds]
|
|
740
|
+
];
|
|
741
|
+
return fields.filter(([, changed]) => changed).map(([field, , value]) => ({ field, value, label: field }));
|
|
742
|
+
}
|
|
743
|
+
function termChanges(live, wanted) {
|
|
744
|
+
const changes = [];
|
|
745
|
+
if (wanted.type === "percentage" && live.basisPoints !== wanted.basisPoints) {
|
|
746
|
+
changes.push({ field: "basisPoints", value: wanted.basisPoints, label: "percentOff", says: `${(live.basisPoints ?? 0) / 100}% off, catalog says ${wanted.basisPoints / 100}%` });
|
|
747
|
+
}
|
|
748
|
+
if (wanted.type === "fixed" && !sameAmounts(live.amounts, wanted.amounts)) {
|
|
749
|
+
changes.push({ field: "amounts", value: wanted.amounts, label: "amountOff", says: `takes off ${JSON.stringify(live.amounts ?? {})}, catalog says ${JSON.stringify(wanted.amounts)}` });
|
|
750
|
+
}
|
|
751
|
+
if (wanted.months !== void 0 && live.durationInMonths !== wanted.months) {
|
|
752
|
+
changes.push({ field: "durationInMonths", value: wanted.months, label: "months", says: `lasts ${live.durationInMonths ?? "?"} months, catalog says ${wanted.months}` });
|
|
753
|
+
}
|
|
754
|
+
return changes;
|
|
755
|
+
}
|
|
756
|
+
function compare(live, wanted) {
|
|
757
|
+
const fixed = [
|
|
758
|
+
live.type === wanted.type ? null : `a ${live.type} discount, catalog says ${wanted.type}`,
|
|
759
|
+
live.duration === wanted.duration ? null : `lasts ${live.duration}, catalog says ${wanted.duration}`
|
|
760
|
+
].filter((entry) => entry !== null);
|
|
761
|
+
const terms = fixed.length > 0 ? [] : termChanges(live, wanted);
|
|
762
|
+
const redeemed = live.redemptionsCount > 0;
|
|
763
|
+
const changes = [...mutableChanges(live, wanted), ...redeemed ? [] : terms];
|
|
764
|
+
return {
|
|
765
|
+
patch: Object.fromEntries(changes.map((change) => [change.field, change.value])),
|
|
766
|
+
fields: changes.map((change) => change.label),
|
|
767
|
+
drift: [...fixed, ...redeemed ? terms.map((change) => change.says) : []]
|
|
768
|
+
};
|
|
769
|
+
}
|
|
770
|
+
function discountTerms(live) {
|
|
771
|
+
const iso = (date) => date ? new Date(date).toISOString() : void 0;
|
|
772
|
+
const startsAt = iso(live.startsAt);
|
|
773
|
+
const endsAt = iso(live.endsAt);
|
|
774
|
+
return {
|
|
775
|
+
id: live.id,
|
|
776
|
+
name: live.name,
|
|
777
|
+
...live.code ? { code: live.code } : {},
|
|
778
|
+
...live.type === "percentage" ? { percentOff: (live.basisPoints ?? 0) / 100 } : { amountOff: live.amounts ?? {} },
|
|
779
|
+
duration: live.duration,
|
|
780
|
+
...live.duration === "repeating" && live.durationInMonths !== void 0 ? { months: live.durationInMonths } : {},
|
|
781
|
+
...startsAt ? { startsAt } : {},
|
|
782
|
+
...endsAt ? { endsAt } : {},
|
|
783
|
+
productIds: live.products.map((product) => product.id)
|
|
784
|
+
};
|
|
785
|
+
}
|
|
786
|
+
const isRetiredTag = (metadata) => metadata.retired === true;
|
|
787
|
+
function openEnded(discount) {
|
|
788
|
+
return [
|
|
789
|
+
discount.maxRedemptions === void 0 ? "maxRedemptions" : null,
|
|
790
|
+
discount.endsAt === void 0 ? "endsAt" : null,
|
|
791
|
+
discount.perCustomer === void 0 ? "perCustomer" : null
|
|
792
|
+
].filter((field) => field !== null);
|
|
793
|
+
}
|
|
794
|
+
async function syncDiscounts(catalog, context) {
|
|
795
|
+
const { client, ids } = context;
|
|
796
|
+
const now = Date.now();
|
|
797
|
+
const listed = await listAllPages((page) => discountsList(client, { limit: 100, page }));
|
|
798
|
+
const managed = listed.filter((discount) => discount.metadata?.managedBy === MANAGED_BY);
|
|
799
|
+
const live = (key) => managed.filter((discount) => discount.metadata.key === key && !isRetiredTag(discount.metadata));
|
|
800
|
+
const recorded = {};
|
|
801
|
+
const entries = Object.entries(catalog.discounts ?? {}).sort(([, a], [, b]) => Number(Boolean(b.retired)) - Number(Boolean(a.retired)));
|
|
802
|
+
for (const [key, discount] of entries) {
|
|
803
|
+
if (discount.retired) await retireDiscount(key, live(key), context, now);
|
|
804
|
+
else if (context.adopt[key]) adoptDiscount(key, listed, recorded, context);
|
|
805
|
+
else await syncDiscount(key, discount, live(key), catalog, recorded, context, now);
|
|
806
|
+
}
|
|
807
|
+
if (Object.keys(recorded).length > 0) ids.discounts = recorded;
|
|
808
|
+
reportLeftKeys(catalog, managed, context.log);
|
|
809
|
+
}
|
|
810
|
+
function adoptDiscount(key, listed, recorded, { adopt, log }) {
|
|
811
|
+
const adopted = listed.find((item) => item.id === adopt[key]);
|
|
812
|
+
if (adopted) recorded[key] = discountTerms(adopted);
|
|
813
|
+
log.push(adopted ? { action: "adopted", kind: "discount", key, id: adopt[key], note: "left as it is" } : { action: "warn", kind: "discount", key, id: adopt[key], note: "no discount at the provider has this id: nothing was recorded for the key" });
|
|
814
|
+
}
|
|
815
|
+
async function syncDiscount(key, discount, found, catalog, recorded, context, now) {
|
|
816
|
+
const { ids, currency, log } = context;
|
|
817
|
+
const wanted = wantedOf(key, discount, catalog, currency, ids);
|
|
818
|
+
if (found.length > 1) log.push({ action: "warn", kind: "discount", key, note: `${found.length} discounts at the provider carry this key: the newest is kept in line, the others are left as they are` });
|
|
819
|
+
const existing = found.sort((a, b) => time(b.createdAt) - time(a.createdAt))[0];
|
|
820
|
+
const unsynced = discountProductKeys(discount, catalog).filter((product) => !ids.products[product]);
|
|
821
|
+
if (unsynced.length > 0) {
|
|
822
|
+
if (!context.dryRun) refuse(key, `applies to ${unsynced.join(", ")}, which the sync has no product id for: it never pushes a discount for fewer products, or for every one.`);
|
|
823
|
+
log.push({ action: existing ? "would-update" : "would-create", kind: "discount", key, ...existing ? { id: existing.id } : {}, note: `once ${unsynced.join(", ")} exist` });
|
|
824
|
+
return;
|
|
825
|
+
}
|
|
826
|
+
const open = discount.code ? openEnded(discount) : [];
|
|
827
|
+
if (open.length > 0) log.push({ action: "warn", kind: "discount", key, note: `a public code with no ${open.join(", ")}: coupon sites list codes, and anyone who finds it may redeem it without that limit` });
|
|
828
|
+
const synced = existing ? await updateDiscount(key, existing, wanted, context, now) : await createDiscount(key, wanted, context);
|
|
829
|
+
if (!synced) return;
|
|
830
|
+
recorded[key] = discountTerms(synced);
|
|
831
|
+
await alignPerCustomer(key, synced.id, wanted.perCustomer, context);
|
|
832
|
+
}
|
|
833
|
+
function reportLeftKeys(catalog, managed, log) {
|
|
834
|
+
const known = new Set(Object.keys(catalog.discounts ?? {}));
|
|
835
|
+
for (const discount of managed) {
|
|
836
|
+
const key = typeof discount.metadata.key === "string" ? discount.metadata.key : "";
|
|
837
|
+
if (key && !known.has(key) && !isRetiredTag(discount.metadata)) {
|
|
838
|
+
log.push({ action: "drift", kind: "discount", key, id: discount.id, note: "managed remotely but no longer in the catalog: it stays redeemable until it is retired (`retired: true`) or ended at the provider" });
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
async function createDiscount(key, wanted, { client, dryRun, log }) {
|
|
843
|
+
if (dryRun) {
|
|
844
|
+
log.push({ action: "would-create", kind: "discount", key });
|
|
845
|
+
return void 0;
|
|
846
|
+
}
|
|
847
|
+
const created = await discountsCreate(client, createPayload(key, wanted));
|
|
848
|
+
if (!created.ok) throw created.error;
|
|
849
|
+
log.push({ action: "created", kind: "discount", key, id: created.value.id });
|
|
850
|
+
return created.value;
|
|
851
|
+
}
|
|
852
|
+
async function updateDiscount(key, existing, wanted, { client, dryRun, log }, now) {
|
|
853
|
+
const { patch, fields, drift } = compare(existing, wanted);
|
|
854
|
+
const started = (time(existing.startsAt) ?? time(existing.createdAt)) <= now;
|
|
855
|
+
const liveEnd = time(existing.endsAt);
|
|
856
|
+
const wantedEnd = time(wanted.endsAt);
|
|
857
|
+
if (wanted.code && started && liveEnd !== null && (wantedEnd === null || wantedEnd > liveEnd)) {
|
|
858
|
+
log.push({ action: "warn", kind: "discount", key, note: `its end moves from ${new Date(liveEnd).toISOString()} to ${wantedEnd === null ? "never" : new Date(wantedEnd).toISOString()} after it started: a deadline that moves is not a real one \u2014 announce the later end as a new promotion` });
|
|
859
|
+
}
|
|
860
|
+
if (drift.length > 0) {
|
|
861
|
+
log.push({ action: "drift", kind: "discount", key, id: existing.id, note: `${drift.join("; ")} \u2014 the provider keeps these once a discount is redeemed (its type and duration always): retire the key and declare the new terms under another` });
|
|
862
|
+
}
|
|
863
|
+
if (fields.length === 0) {
|
|
864
|
+
if (drift.length === 0) log.push({ action: "exists", kind: "discount", key, id: existing.id });
|
|
865
|
+
return existing;
|
|
866
|
+
}
|
|
867
|
+
if (dryRun) {
|
|
868
|
+
log.push({ action: "would-update", kind: "discount", key, id: existing.id, note: fields.join(", ") });
|
|
869
|
+
return existing;
|
|
870
|
+
}
|
|
871
|
+
const updated = await discountsUpdate(client, { id: existing.id, discountUpdate: patch });
|
|
872
|
+
if (!updated.ok) throw updated.error;
|
|
873
|
+
log.push({ action: "updated", kind: "discount", key, id: existing.id, note: fields.join(", ") });
|
|
874
|
+
return updated.value;
|
|
875
|
+
}
|
|
876
|
+
async function retireDiscount(key, found, { client, dryRun, log }, now) {
|
|
877
|
+
if (found.length === 0) {
|
|
878
|
+
log.push({ action: "exists", kind: "discount", key, note: "retired" });
|
|
879
|
+
return;
|
|
880
|
+
}
|
|
881
|
+
for (const discount of found) {
|
|
882
|
+
if (dryRun) {
|
|
883
|
+
log.push({ action: "would-archive", kind: "discount", key, id: discount.id, note: "would end now and free its code" });
|
|
884
|
+
continue;
|
|
885
|
+
}
|
|
886
|
+
const ended = time(discount.endsAt);
|
|
887
|
+
const updated = await discountsUpdate(client, {
|
|
888
|
+
id: discount.id,
|
|
889
|
+
discountUpdate: {
|
|
890
|
+
...ended === null || ended > now ? { endsAt: new Date(now) } : {},
|
|
891
|
+
code: null,
|
|
892
|
+
metadata: { ...discount.metadata, managedBy: MANAGED_BY, key, retired: true }
|
|
893
|
+
}
|
|
894
|
+
});
|
|
895
|
+
if (!updated.ok) throw updated.error;
|
|
896
|
+
log.push({ action: "archived", kind: "discount", key, id: discount.id, note: "ended, its code freed; whoever redeemed it keeps it for its duration" });
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
async function alignPerCustomer(key, id, wanted, { limitTarget, dryRun, log }) {
|
|
900
|
+
try {
|
|
901
|
+
const current = await readPerCustomerLimit(limitTarget, id);
|
|
902
|
+
if (current === wanted) return;
|
|
903
|
+
if (dryRun) {
|
|
904
|
+
log.push({ action: "would-update", kind: "discount", key, id, note: `per-customer limit ${current ?? "none"} \u2192 ${wanted ?? "none"}` });
|
|
905
|
+
return;
|
|
906
|
+
}
|
|
907
|
+
await writePerCustomerLimit(limitTarget, id, wanted);
|
|
908
|
+
log.push({ action: "updated", kind: "discount", key, id, note: wanted === null ? "per-customer limit lifted" : `at most ${wanted} per customer` });
|
|
909
|
+
} catch (error) {
|
|
910
|
+
log.push({ action: "warn", kind: "discount", key, id, note: `the per-customer limit could not be read or set (${error instanceof Error ? error.message : String(error)}): set it in the provider's dashboard` });
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
function scopedForeverDiscounts(catalog) {
|
|
914
|
+
const sold = Object.entries(catalog.plans ?? {}).filter(([key, plan]) => !plan.retired && key !== freePlanOf(catalog)?.[0]).map(([key]) => key);
|
|
915
|
+
return Object.entries(catalog.discounts ?? {}).filter(([, discount]) => !discount.retired && discount.duration === "forever").filter(([, discount]) => {
|
|
916
|
+
const plans = discount.products?.plans ?? [];
|
|
917
|
+
return plans.length > 0 && (sold.some((plan) => !plans.includes(plan)) || discount.products?.interval !== void 0);
|
|
918
|
+
}).map(([key]) => key);
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
async function loadGenerated(rootDir) {
|
|
922
|
+
const functionsDir = resolveFunctionsDir(rootDir);
|
|
923
|
+
const path = join(rootDir, functionsDir, "billing.generated.ts");
|
|
924
|
+
if (!existsSync(path)) return {};
|
|
925
|
+
try {
|
|
926
|
+
const module = await import(`${pathToFileURL(path).href}?t=${Date.now()}`);
|
|
927
|
+
return module.catalog ?? {};
|
|
928
|
+
} catch (error) {
|
|
929
|
+
throw new Error(`${join(functionsDir, "billing.generated.ts")} does not load (${error instanceof Error ? error.message.split("\n")[0] : String(error)}), and writing it again would drop the ids of the environment this run does not sync. Fix the file \u2014 resolve a merge conflict in it \u2014 or delete it to start over.`, { cause: error });
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
function renderValue(value, indent) {
|
|
933
|
+
if (typeof value === "string") return `'${value.replace(/\\/g, "\\\\").replace(/'/g, "\\'")}'`;
|
|
934
|
+
if (value === null || typeof value !== "object") return String(value);
|
|
935
|
+
if (Array.isArray(value)) return `[${value.map((item) => renderValue(item, indent)).join(", ")}]`;
|
|
936
|
+
const inner = indent + " ";
|
|
937
|
+
const entries = Object.entries(value);
|
|
938
|
+
if (entries.length === 0) return "{}";
|
|
939
|
+
const quoted = entries.some(([key]) => !/^[a-z_$][\w$]*$/i.test(key));
|
|
940
|
+
const body = entries.map(([key, item]) => `${inner}${quoted ? `'${key}'` : key}: ${renderValue(item, inner)},`).join("\n");
|
|
941
|
+
return `{
|
|
942
|
+
${body}
|
|
943
|
+
${indent}}`;
|
|
944
|
+
}
|
|
945
|
+
function renderGenerated(map) {
|
|
946
|
+
return `/* Generated by \`npx nuxt-backend billing sync\` \u2014 do not edit. */
|
|
947
|
+
import type { BillingCatalogIds } from 'nuxt-backend/billing'
|
|
948
|
+
|
|
949
|
+
export const catalog: Partial<Record<'sandbox' | 'production', BillingCatalogIds>> = ${renderValue(map, "")}
|
|
950
|
+
`;
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
function legacyPlanLine(plan) {
|
|
954
|
+
if (plan.prices !== void 0 || plan.interval === void 0 && plan.price === void 0) return void 0;
|
|
955
|
+
const interval = plan.interval === "year" ? "year" : "month";
|
|
956
|
+
const price = typeof plan.price === "number" ? plan.price : 0;
|
|
957
|
+
const units = plan.credits?.units;
|
|
958
|
+
const credits = interval === "year" && typeof units === "number" ? `, and \`credits: { \u2026, units: { year: ${units} } }\` (a number of units is a month's allowance now)` : "";
|
|
959
|
+
return `\`prices: { ${interval}: ${price} }\`${credits}`;
|
|
960
|
+
}
|
|
961
|
+
function refuseUnpricedPlans(catalog) {
|
|
962
|
+
for (const [key, plan] of Object.entries(catalog.plans ?? {})) {
|
|
963
|
+
const line = legacyPlanLine(plan);
|
|
964
|
+
if (line) {
|
|
965
|
+
throw new Error(`[nuxt-backend] billing sync: plans.${key} has \`interval\` and \`price\`, which became \`prices: { month, year }\` \u2014 write ${line} (the Upgrade page has the rest).`);
|
|
966
|
+
}
|
|
967
|
+
if (pricedIntervals(plan).length === 0) {
|
|
968
|
+
throw new Error(`[nuxt-backend] billing sync: plans.${key} has no price \u2014 give it \`prices: { month }\`, \`prices: { year }\` or both.`);
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
const CURRENCY_CODE = /^[a-z]{3}$/;
|
|
973
|
+
function isAmount(value) {
|
|
974
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
|
|
975
|
+
}
|
|
976
|
+
function refuseCurrencies(where, codes, currency) {
|
|
977
|
+
const named = codes.filter((code) => code !== void 0);
|
|
978
|
+
const bad = named.filter((code) => !CURRENCY_CODE.test(code));
|
|
979
|
+
if (bad.length > 0) throw new Error(`[nuxt-backend] billing sync: ${where} prices ${bad.join(", ")}, which ${bad.length === 1 ? "is" : "are"} no ISO 4217 currency code \u2014 write each as three letters, \`usd\`, \`eur\`.`);
|
|
980
|
+
if (named.length > 0 && currency && !named.includes(currency)) {
|
|
981
|
+
throw new Error(`[nuxt-backend] billing sync: ${where} has no price in ${currency}, the catalog's currency \u2014 the provider needs one in it on every product.`);
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
function planPricesProblem(key, plan, currency) {
|
|
985
|
+
const byCurrency = planPricesByCurrency(plan, currency);
|
|
986
|
+
refuseCurrencies(`plans.${key}`, byCurrency.map(([code]) => code), currency);
|
|
987
|
+
const amounts = byCurrency.flatMap(([, prices]) => CATALOG_INTERVALS.flatMap((interval) => interval in prices ? [prices[interval]] : []));
|
|
988
|
+
if (!amounts.every(isAmount)) return `plans.${key} has a price that is no whole number of cents (or is below 0)`;
|
|
989
|
+
const intervals = new Set(byCurrency.map(([, prices]) => CATALOG_INTERVALS.filter((interval) => typeof prices[interval] === "number").join("+")));
|
|
990
|
+
if (intervals.size > 1) return `plans.${key} prices other intervals in each currency \u2014 price the same ones in all of them`;
|
|
991
|
+
if (amounts.includes(0) && !isFreePlan(plan)) return `plans.${key} is priced 0 somewhere and above 0 elsewhere \u2014 a free plan is free in every currency, and a paid one paid`;
|
|
992
|
+
if (byCurrency.length > 1 && (plan.usage?.length ?? 0) > 0) return `plans.${key} has \`usage\` prices, which are billed in one currency \u2014 price the plan in the catalog's currency alone, or drop \`usage\``;
|
|
993
|
+
if (!isFreePlan(plan)) return void 0;
|
|
994
|
+
if (pricedIntervals(plan).includes("year") || byCurrency.length > 1) return `plans.${key} is the free plan, which is priced once, by the month \u2014 write \`prices: { month: 0 }\` (it reads as free in every currency)`;
|
|
995
|
+
if (plan.trial) return `plans.${key} is the free plan, which has no trial to offer \u2014 drop its \`trial\``;
|
|
996
|
+
if ((plan.usage?.length ?? 0) > 0) return `plans.${key} is the free plan, which the provider can't bill \`usage\` on \u2014 drop it, or price the plan`;
|
|
997
|
+
return void 0;
|
|
998
|
+
}
|
|
999
|
+
function refuseInvalidPrices(catalog) {
|
|
1000
|
+
const currency = catalog.currency?.toLowerCase();
|
|
1001
|
+
for (const [key, plan] of Object.entries(catalog.plans ?? {})) {
|
|
1002
|
+
const problem = planPricesProblem(key, plan, currency);
|
|
1003
|
+
if (problem) throw new Error(`[nuxt-backend] billing sync: ${problem}.`);
|
|
1004
|
+
}
|
|
1005
|
+
for (const [key, pack] of Object.entries(catalog.packs ?? {})) {
|
|
1006
|
+
const byCurrency = packPricesByCurrency(pack, currency);
|
|
1007
|
+
refuseCurrencies(`packs.${key}`, byCurrency.map(([code]) => code), currency);
|
|
1008
|
+
if (byCurrency.length === 0 || !byCurrency.every(([, amount]) => isAmount(amount))) {
|
|
1009
|
+
throw new Error(`[nuxt-backend] billing sync: packs.${key} has a price that is no whole number of cents (or is below 0).`);
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
const free = Object.entries(catalog.plans ?? {}).filter(([, plan]) => !plan.retired && isFreePlan(plan)).map(([key]) => key);
|
|
1013
|
+
if (free.length > 1) {
|
|
1014
|
+
throw new Error(`[nuxt-backend] billing sync: ${free.join(", ")} are all free plans \u2014 a catalog has at most one, which every new billing entity starts on. Price the others, or retire them.`);
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
function refuseMissingDefaultCurrency(catalog, currency) {
|
|
1018
|
+
if (!currency || catalog.currency) return;
|
|
1019
|
+
for (const [key, plan] of Object.entries(catalog.plans ?? {})) refuseCurrencies(`plans.${key}`, planPricesByCurrency(plan, currency).map(([code]) => code), currency);
|
|
1020
|
+
for (const [key, pack] of Object.entries(catalog.packs ?? {})) refuseCurrencies(`packs.${key}`, packPricesByCurrency(pack, currency).map(([code]) => code), currency);
|
|
1021
|
+
}
|
|
1022
|
+
function findPlanProduct(products, key, interval) {
|
|
1023
|
+
const tagged = (product) => product.metadata;
|
|
1024
|
+
return products.find((product) => tagged(product)?.managedBy === MANAGED_BY && tagged(product)?.key === key && tagged(product)?.interval === interval) ?? products.find((product) => tagged(product)?.managedBy === MANAGED_BY && tagged(product)?.key === key && tagged(product)?.interval === void 0 && product.recurringInterval === interval);
|
|
1025
|
+
}
|
|
1026
|
+
function isUntaggedPlanProduct(product) {
|
|
1027
|
+
return product !== void 0 && product.metadata?.interval === void 0;
|
|
1028
|
+
}
|
|
1029
|
+
function showTrial(trial) {
|
|
1030
|
+
return trial?.interval ? `${trial.count ?? 1} ${trial.interval}` : "none";
|
|
1031
|
+
}
|
|
1032
|
+
async function pushPlanTrial(client, product, productKey, trial, { dryRun, log }) {
|
|
1033
|
+
const wanted = trial ? { interval: trial.interval, count: trial.count ?? 1 } : void 0;
|
|
1034
|
+
const live = product.trialInterval ? { interval: product.trialInterval, count: product.trialIntervalCount ?? 1 } : void 0;
|
|
1035
|
+
if (live?.interval === wanted?.interval && (live === void 0 || live.count === wanted?.count)) return;
|
|
1036
|
+
const note = `trial ${showTrial(live)}, catalog says ${showTrial(wanted)}`;
|
|
1037
|
+
if (dryRun) {
|
|
1038
|
+
log.push({ action: "would-update", kind: "product", key: productKey, id: product.id, note });
|
|
1039
|
+
return;
|
|
1040
|
+
}
|
|
1041
|
+
const updated = await productsUpdate(client, {
|
|
1042
|
+
id: product.id,
|
|
1043
|
+
productUpdate: { trialInterval: wanted?.interval ?? null, trialIntervalCount: wanted?.count ?? null }
|
|
1044
|
+
});
|
|
1045
|
+
if (!updated.ok) throw updated.error;
|
|
1046
|
+
log.push({ action: "updated", kind: "product", key: productKey, id: product.id, note });
|
|
1047
|
+
}
|
|
1048
|
+
async function retirePlan(client, products, key, priced, { dryRun, log, ids, adopt }) {
|
|
1049
|
+
for (const interval of CATALOG_INTERVALS) {
|
|
1050
|
+
const productKey = planProductKey(key, interval);
|
|
1051
|
+
const adopted = adopt[productKey];
|
|
1052
|
+
if (adopted) {
|
|
1053
|
+
recordPlanProduct(ids, key, interval, adopted);
|
|
1054
|
+
log.push({ action: "adopted", kind: "product", key: productKey, id: adopted, note: "retired: an adopted product is left as-is \u2014 archive it in the provider dashboard if it still sells" });
|
|
1055
|
+
continue;
|
|
1056
|
+
}
|
|
1057
|
+
const product = findPlanProduct(products, key, interval);
|
|
1058
|
+
if (product) {
|
|
1059
|
+
recordPlanProduct(ids, key, interval, product.id);
|
|
1060
|
+
await archivePlanProduct(client, product, productKey, { dryRun, log });
|
|
1061
|
+
} else if (priced.includes(interval)) {
|
|
1062
|
+
log.push({ action: "warn", kind: "product", key: productKey, note: "retired before it was ever synced \u2014 nothing to archive, nothing created" });
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
if (Object.keys(ids.plans?.[key] ?? {}).length > 0) ids.retired = [...ids.retired ?? [], key];
|
|
1066
|
+
}
|
|
1067
|
+
async function archivePlanProduct(client, product, productKey, { dryRun, log }) {
|
|
1068
|
+
if (product.isArchived) {
|
|
1069
|
+
log.push({ action: "exists", kind: "product", key: productKey, id: product.id, note: "retired (archived)" });
|
|
1070
|
+
return;
|
|
1071
|
+
}
|
|
1072
|
+
const note = "retired: archived, so it is sold to nobody new; subscribers keep it";
|
|
1073
|
+
if (dryRun) {
|
|
1074
|
+
log.push({ action: "would-archive", kind: "product", key: productKey, id: product.id, note });
|
|
1075
|
+
return;
|
|
1076
|
+
}
|
|
1077
|
+
const updated = await productsUpdate(client, { id: product.id, productUpdate: { isArchived: true } });
|
|
1078
|
+
if (!updated.ok) throw updated.error;
|
|
1079
|
+
log.push({ action: "archived", kind: "product", key: productKey, id: product.id, note });
|
|
1080
|
+
}
|
|
1081
|
+
function recordPlanProduct(ids, key, interval, id) {
|
|
1082
|
+
ids.products[planProductKey(key, interval)] = id;
|
|
1083
|
+
ids.plans = { ...ids.plans, [key]: { ...ids.plans?.[key], [interval]: id } };
|
|
1084
|
+
}
|
|
1085
|
+
function unpricedPlanProducts(catalog, products) {
|
|
1086
|
+
return Object.entries(catalog.plans ?? {}).flatMap(([key, plan]) => {
|
|
1087
|
+
if (plan.retired) return [];
|
|
1088
|
+
const priced = new Set(pricedIntervals(plan));
|
|
1089
|
+
return CATALOG_INTERVALS.filter((interval) => !priced.has(interval)).flatMap((interval) => {
|
|
1090
|
+
const product = findPlanProduct(products, key, interval);
|
|
1091
|
+
return product && !product.isArchived ? [{ action: "drift", kind: "product", key: planProductKey(key, interval), id: product.id, note: `the catalog no longer prices ${key} by the ${interval}, but this product still sells \u2014 retire the plan, or archive it in the provider dashboard` }] : [];
|
|
1092
|
+
});
|
|
1093
|
+
});
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
const DESCRIPTION_LIMIT = 42;
|
|
1097
|
+
const METADATA_KEY_LIMIT = 50;
|
|
1098
|
+
const QUOTAS_PER_PLAN = METADATA_KEY_LIMIT - 2;
|
|
1099
|
+
function refuseQuotaKey(key) {
|
|
1100
|
+
if (isSeatLikeQuota(key)) {
|
|
1101
|
+
throw new Error(`[nuxt-backend] billing sync: quotas.${key} counts people, and a plan here is never priced per seat \u2014 count what people make (projects, sites, boards) instead.`);
|
|
1102
|
+
}
|
|
1103
|
+
if (!QUOTA_KEY.test(key)) {
|
|
1104
|
+
throw new Error(`[nuxt-backend] billing sync: quotas.${key} is not a quota key \u2014 a letter, then letters, digits, _ or -, at most 34 in all.`);
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
function refusePlanQuota(plan, key, limit, declared) {
|
|
1108
|
+
if (!declared.includes(key)) {
|
|
1109
|
+
throw new Error(`[nuxt-backend] billing sync: plans.${plan}.quotas.${key} is not declared \u2014 add \`quotas: { ${key}: { description: '\u2026' } }\` to the catalog.`);
|
|
1110
|
+
}
|
|
1111
|
+
if (limit !== "unlimited" && !(Number.isSafeInteger(limit) && limit >= 0)) {
|
|
1112
|
+
throw new Error(`[nuxt-backend] billing sync: plans.${plan}.quotas.${key} is ${JSON.stringify(limit)} \u2014 a whole number of at least 0, or 'unlimited'.`);
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
function refuseInvalidQuotas(catalog) {
|
|
1116
|
+
const declared = Object.keys(catalog.quotas ?? {});
|
|
1117
|
+
declared.forEach(refuseQuotaKey);
|
|
1118
|
+
for (const [plan, { quotas }] of Object.entries(catalog.plans ?? {})) {
|
|
1119
|
+
const entries = Object.entries(quotas ?? {});
|
|
1120
|
+
if (entries.length > QUOTAS_PER_PLAN) {
|
|
1121
|
+
throw new Error(`[nuxt-backend] billing sync: plans.${plan} sets ${entries.length} quotas, and its <plan>-quotas benefit holds at most ${QUOTAS_PER_PLAN} (the provider keeps ${METADATA_KEY_LIMIT} metadata keys).`);
|
|
1122
|
+
}
|
|
1123
|
+
for (const [key, limit] of entries) refusePlanQuota(plan, key, limit, declared);
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
function hasQuotas(plan) {
|
|
1127
|
+
return Object.keys(plan.quotas ?? {}).length > 0;
|
|
1128
|
+
}
|
|
1129
|
+
function planQuotasKeys(catalog) {
|
|
1130
|
+
return Object.entries(catalog.plans ?? {}).filter(([, plan]) => hasQuotas(plan)).map(([key]) => planQuotasKey(key));
|
|
1131
|
+
}
|
|
1132
|
+
function droppedQuotasKeys(catalog) {
|
|
1133
|
+
return Object.entries(catalog.plans ?? {}).filter(([, plan]) => !hasQuotas(plan)).map(([key]) => planQuotasKey(key));
|
|
1134
|
+
}
|
|
1135
|
+
function recordQuotaKeys(ids, catalog) {
|
|
1136
|
+
const quotas = Object.entries(catalog.quotas ?? {});
|
|
1137
|
+
if (quotas.length > 0) ids.quotas = Object.fromEntries(quotas.map(([key, { description }]) => [key, description]));
|
|
1138
|
+
}
|
|
1139
|
+
function quotaEntries(plan) {
|
|
1140
|
+
return Object.fromEntries(Object.entries(plan.quotas ?? {}).map(([key, limit]) => [`${QUOTA_METADATA_PREFIX}${key}`, limit]));
|
|
1141
|
+
}
|
|
1142
|
+
function splitEntries(metadata) {
|
|
1143
|
+
const entries = Object.entries(metadata ?? {});
|
|
1144
|
+
return {
|
|
1145
|
+
quotas: Object.fromEntries(entries.filter(([name]) => name.startsWith(QUOTA_METADATA_PREFIX))),
|
|
1146
|
+
rest: Object.fromEntries(entries.filter(([name]) => !name.startsWith(QUOTA_METADATA_PREFIX)))
|
|
1147
|
+
};
|
|
1148
|
+
}
|
|
1149
|
+
function describeQuotaChange(live, wanted) {
|
|
1150
|
+
const names = [.../* @__PURE__ */ new Set([...Object.keys(live), ...Object.keys(wanted)])].sort();
|
|
1151
|
+
const show = (value) => value === void 0 ? "none" : String(value);
|
|
1152
|
+
const changed = names.filter((name) => live[name] !== wanted[name]).map((name) => `${name.slice(QUOTA_METADATA_PREFIX.length)} ${show(live[name])} \u2192 ${show(wanted[name])}`);
|
|
1153
|
+
return changed.length > 0 ? changed.join(", ") : void 0;
|
|
1154
|
+
}
|
|
1155
|
+
async function pushPlanQuotas(client, existing, key, wanted, { dryRun, log }) {
|
|
1156
|
+
const { quotas, rest } = splitEntries(existing.metadata);
|
|
1157
|
+
const change = describeQuotaChange(quotas, wanted);
|
|
1158
|
+
if (!change || dryRun) {
|
|
1159
|
+
log.push(change ? { action: "would-update", kind: "benefit", key, id: existing.id, note: change } : { action: "exists", kind: "benefit", key, id: existing.id });
|
|
1160
|
+
return existing.id;
|
|
1161
|
+
}
|
|
1162
|
+
const metadata = { ...rest, ...wanted };
|
|
1163
|
+
const updated = await benefitsUpdate(client, { id: existing.id, requestBody: existing.type === "custom" ? { type: "custom", metadata } : { type: "feature_flag", metadata } });
|
|
1164
|
+
if (!updated.ok) throw updated.error;
|
|
1165
|
+
log.push({ action: "updated", kind: "benefit", key, id: existing.id, note: `${change}: every subscriber's limit follows` });
|
|
1166
|
+
return existing.id;
|
|
1167
|
+
}
|
|
1168
|
+
async function createPlanQuotas(client, key, plan, wanted, { dryRun, log }) {
|
|
1169
|
+
if (dryRun) {
|
|
1170
|
+
log.push({ action: "would-create", kind: "benefit", key });
|
|
1171
|
+
return null;
|
|
1172
|
+
}
|
|
1173
|
+
const description = `${plan.name} limits`.slice(0, DESCRIPTION_LIMIT);
|
|
1174
|
+
const metadata = { managedBy: MANAGED_BY, key, ...wanted };
|
|
1175
|
+
const native = await benefitsCreate(client, { type: "feature_flag", description, properties: {}, metadata });
|
|
1176
|
+
const created = native.ok ? native : await benefitsCreate(client, { type: "custom", description, properties: { note: null }, metadata });
|
|
1177
|
+
if (!created.ok) throw native.ok ? created.error : native.error;
|
|
1178
|
+
if (!native.ok) log.push({ action: "warn", kind: "benefit", key, note: "the provider rejected the native feature-flag benefit \u2014 created a custom benefit instead" });
|
|
1179
|
+
log.push({ action: "created", kind: "benefit", key, id: created.value.id });
|
|
1180
|
+
return created.value.id;
|
|
1181
|
+
}
|
|
1182
|
+
async function ensurePlanQuotas(client, benefits, planKey, plan, options) {
|
|
1183
|
+
const key = planQuotasKey(planKey);
|
|
1184
|
+
const existing = benefits.find((benefit) => isManaged(benefit.metadata, key));
|
|
1185
|
+
if (!hasQuotas(plan)) {
|
|
1186
|
+
if (existing && Object.keys(splitEntries(existing.metadata).quotas).length > 0) await pushPlanQuotas(client, existing, key, {}, options);
|
|
1187
|
+
return void 0;
|
|
1188
|
+
}
|
|
1189
|
+
const wanted = quotaEntries(plan);
|
|
1190
|
+
return existing ? pushPlanQuotas(client, existing, key, wanted, options) : createPlanQuotas(client, key, plan, wanted, options);
|
|
1191
|
+
}
|
|
1192
|
+
function planQuotasBenefits(planKey, productKey, quotasId, { adopt, log }) {
|
|
1193
|
+
if (quotasId === void 0) return [];
|
|
1194
|
+
const adopted = adopt[productKey];
|
|
1195
|
+
if (adopted) log.push({ action: "warn", kind: "product", key: productKey, id: adopted, note: `adopted: its benefits are left as they are, so attach ${planQuotasKey(planKey)} in the provider dashboard for its quotas to count` });
|
|
1196
|
+
return [quotasId];
|
|
1197
|
+
}
|
|
1198
|
+
function benefitIdsOf(product) {
|
|
1199
|
+
return (product.benefits ?? []).flatMap((benefit) => typeof benefit.id === "string" ? [benefit.id] : []);
|
|
1200
|
+
}
|
|
1201
|
+
async function attachPlanQuotas(client, product, productKey, quotasId, { dryRun, log }) {
|
|
1202
|
+
const carried = benefitIdsOf(product);
|
|
1203
|
+
if (quotasId === void 0 || quotasId !== null && carried.includes(quotasId)) return;
|
|
1204
|
+
const note = "attached its plan's quotas, which the provider grants its current subscribers too: check one in DevTools (Billing \u2192 Quotas)";
|
|
1205
|
+
if (dryRun || quotasId === null) {
|
|
1206
|
+
log.push({ action: "would-update", kind: "product", key: productKey, id: product.id, note });
|
|
1207
|
+
return;
|
|
1208
|
+
}
|
|
1209
|
+
const updated = await productsUpdateBenefits(client, { id: product.id, productBenefitsUpdate: { benefits: [...carried, quotasId] } });
|
|
1210
|
+
if (!updated.ok) throw updated.error;
|
|
1211
|
+
log.push({ action: "updated", kind: "product", key: productKey, id: product.id, note });
|
|
1212
|
+
}
|
|
1213
|
+
async function attachRetiredPlanQuotas(client, products, planKey, quotasId, options) {
|
|
1214
|
+
for (const interval of CATALOG_INTERVALS) {
|
|
1215
|
+
const productKey = planProductKey(planKey, interval);
|
|
1216
|
+
const product = options.adopt[productKey] ? void 0 : findPlanProduct(products, planKey, interval);
|
|
1217
|
+
if (product) await attachPlanQuotas(client, product, productKey, quotasId, options);
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
function passPurchaseKey(plan, months) {
|
|
1222
|
+
return `${plan}-gift-${months}`;
|
|
1223
|
+
}
|
|
1224
|
+
function passProductKey(plan) {
|
|
1225
|
+
return `${plan}-pass`;
|
|
1226
|
+
}
|
|
1227
|
+
function giftablePlans(catalog) {
|
|
1228
|
+
return Object.entries(catalog.plans ?? {}).flatMap(([key, plan]) => {
|
|
1229
|
+
if (plan.retired) return [];
|
|
1230
|
+
const lengths = plan.gift ? [...new Set(plan.gift.months)].sort((a, b) => a - b) : [];
|
|
1231
|
+
return lengths.length > 0 || plan.trial?.pass ? [[key, plan, lengths]] : [];
|
|
1232
|
+
});
|
|
1233
|
+
}
|
|
1234
|
+
function derivedPassKeys(catalog) {
|
|
1235
|
+
return giftablePlans(catalog).flatMap(([key, , lengths]) => [passProductKey(key), ...lengths.map((months) => passPurchaseKey(key, months))]);
|
|
1236
|
+
}
|
|
1237
|
+
function trialPassProblem(key, plan, freeKey) {
|
|
1238
|
+
const days = trialPassDays(plan.trial);
|
|
1239
|
+
if (days === void 0) return void 0;
|
|
1240
|
+
const where = `plans.${key}.trial`;
|
|
1241
|
+
if (!Number.isInteger(days) || days < 1 || days > TRIAL_PASS_MAX_DAYS) return `${where} runs a reverse trial of 1 to ${TRIAL_PASS_MAX_DAYS} days \u2014 write \`trial: { interval: 'day', count: 14, pass: true }\`.`;
|
|
1242
|
+
if (key === freeKey) return `plans.${key} is the free plan, which a reverse trial returns to \u2014 drop ${where}.`;
|
|
1243
|
+
return freeKey ? void 0 : `${where} needs a free plan for the reverse trial to return to \u2014 add a plan priced \`{ month: 0 }\`.`;
|
|
1244
|
+
}
|
|
1245
|
+
function refuseInvalidGifts(catalog, keys) {
|
|
1246
|
+
const free = freePlanOf(catalog);
|
|
1247
|
+
for (const [key, plan] of Object.entries(catalog.plans ?? {})) {
|
|
1248
|
+
const problem = (plan.gift ? giftProblem(key, plan, plan.gift, free?.[0]) : void 0) ?? trialPassProblem(key, plan, free?.[0]);
|
|
1249
|
+
if (problem) throw new Error(`[nuxt-backend] billing sync: ${problem}`);
|
|
1250
|
+
}
|
|
1251
|
+
const reverse = Object.entries(catalog.plans ?? {}).filter(([, plan]) => plan.trial?.pass && !plan.retired).map(([key]) => key);
|
|
1252
|
+
if (reverse.length > 1) throw new Error(`[nuxt-backend] billing sync: ${reverse.join(", ")} all run a reverse trial \u2014 a new workspace starts on one plan's pass, so keep \`pass: true\` on one.`);
|
|
1253
|
+
const taken = derivedPassKeys(catalog).filter((key) => keys.has(key));
|
|
1254
|
+
if (taken.length > 0) {
|
|
1255
|
+
throw new Error(`[nuxt-backend] billing sync: ${taken.join(", ")} ${taken.length === 1 ? "is" : "are"} the key of a plan's gift product \u2014 rename the catalog entry.`);
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
function giftProblem(key, plan, gift, freeKey) {
|
|
1259
|
+
const where = `plans.${key}.gift`;
|
|
1260
|
+
const lengths = gift.months;
|
|
1261
|
+
if (!Array.isArray(lengths) || lengths.length === 0 || !lengths.every((months) => PASS_LENGTHS.includes(months))) {
|
|
1262
|
+
return `${where} lists the lengths the plan can be gifted for, any of ${PASS_LENGTHS.join(", ")} months \u2014 write \`gift: { months: [1, 3, 12] }\`.`;
|
|
1263
|
+
}
|
|
1264
|
+
if (plan.retired) return `plans.${key} is retired, and a retired plan is not sold as a gift \u2014 drop ${where}.`;
|
|
1265
|
+
if (key === freeKey) return `plans.${key} is the free plan, which a pass returns to \u2014 it is not itself a gift. Drop ${where}.`;
|
|
1266
|
+
if (!freeKey) return `${where} needs a free plan for a pass to return to \u2014 add a plan priced \`{ month: 0 }\`.`;
|
|
1267
|
+
const unpriced = planPricesByCurrency(plan, void 0).some(([, prices]) => typeof prices.month !== "number" && (lengths.some((months) => months !== 12) || typeof prices.year !== "number"));
|
|
1268
|
+
return unpriced ? `${where} sells months at the plan's monthly price (12 months at its yearly one), and the plan has none in some currency.` : void 0;
|
|
1269
|
+
}
|
|
1270
|
+
function passPurchaseAmounts(plan, months, currency) {
|
|
1271
|
+
return planPricesByCurrency(plan, currency).map(([code, prices]) => [code, months === 12 && typeof prices.year === "number" ? prices.year : prices.month * months]);
|
|
1272
|
+
}
|
|
1273
|
+
async function planBenefits(key, plan, { creditBenefitFor, planCreditKey, benefitIdByKey }) {
|
|
1274
|
+
const units = plan.credits ? planCreditUnits(plan.credits, "month") : void 0;
|
|
1275
|
+
const credits = plan.credits && units !== void 0 ? [await creditBenefitFor(planCreditKey(key, "month"), { ...plan.credits, units }, false)] : [];
|
|
1276
|
+
return [...credits, ...(plan.features ?? []).flatMap((featureKey) => benefitIdByKey.get(featureKey) ?? [])];
|
|
1277
|
+
}
|
|
1278
|
+
async function syncPassProducts(catalog, context) {
|
|
1279
|
+
const { client, ids, managedProducts, ensureProduct, price, currency, quotasByPlan, adopt, dryRun, log } = context;
|
|
1280
|
+
for (const [key, plan, lengths] of giftablePlans(catalog)) {
|
|
1281
|
+
const trialDays = trialPassDays(plan.trial);
|
|
1282
|
+
const entry = { pass: "", months: {}, ...trialDays === void 0 ? {} : { trialDays } };
|
|
1283
|
+
const quotasId = quotasByPlan.get(key);
|
|
1284
|
+
const passKey = passProductKey(key);
|
|
1285
|
+
const benefits = [...await planBenefits(key, plan, context), ...planQuotasBenefits(key, passKey, quotasId, { adopt, log })];
|
|
1286
|
+
const foundPass = await ensureProduct(passKey, benefits, () => ({
|
|
1287
|
+
name: `${plan.name} (pass)`,
|
|
1288
|
+
description: plan.description,
|
|
1289
|
+
recurringInterval: "month",
|
|
1290
|
+
// Free is a fixed price of nothing, as the free plan's is.
|
|
1291
|
+
prices: price([[currency, 0]], plan),
|
|
1292
|
+
visibility: "private",
|
|
1293
|
+
metadata: { managedBy: MANAGED_BY, key: passKey, passOf: key }
|
|
1294
|
+
}), managedProducts.find((item) => isManaged(item.metadata, passKey)), (id) => {
|
|
1295
|
+
entry.pass = id;
|
|
1296
|
+
});
|
|
1297
|
+
if (foundPass) await attachPlanQuotas(client, foundPass, passKey, quotasId, { dryRun, log });
|
|
1298
|
+
for (const months of lengths) {
|
|
1299
|
+
const purchaseKey = passPurchaseKey(key, months);
|
|
1300
|
+
await ensureProduct(purchaseKey, [], () => ({
|
|
1301
|
+
name: `${plan.name} (${months} ${months === 1 ? "month" : "months"}, gift)`,
|
|
1302
|
+
description: plan.description,
|
|
1303
|
+
recurringInterval: null,
|
|
1304
|
+
prices: price(passPurchaseAmounts(plan, months, currency), plan),
|
|
1305
|
+
visibility: "private",
|
|
1306
|
+
metadata: { managedBy: MANAGED_BY, key: purchaseKey, giftOf: key, giftMonths: months }
|
|
1307
|
+
}), managedProducts.find((item) => isManaged(item.metadata, purchaseKey)), (id) => {
|
|
1308
|
+
entry.months[String(months)] = id;
|
|
1309
|
+
});
|
|
1310
|
+
}
|
|
1311
|
+
if (entry.pass || Object.keys(entry.months).length > 0) (ids.passes ??= {})[key] = entry;
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
async function loadCatalog(rootDir) {
|
|
1316
|
+
const functionsDir = resolveFunctionsDir(rootDir);
|
|
1317
|
+
const path = join(rootDir, functionsDir, "billing.catalog.ts");
|
|
1318
|
+
if (!existsSync(path)) return null;
|
|
1319
|
+
const module = await import(pathToFileURL(path).href);
|
|
1320
|
+
return { catalog: module.default ?? {}, path };
|
|
1321
|
+
}
|
|
1322
|
+
const RELIED_ON_CUSTOMER_EMAILS = [
|
|
1323
|
+
"orderConfirmation",
|
|
1324
|
+
"subscriptionConfirmation",
|
|
1325
|
+
"subscriptionCycled",
|
|
1326
|
+
"subscriptionPastDue",
|
|
1327
|
+
"subscriptionCancellation",
|
|
1328
|
+
"subscriptionRevoked",
|
|
1329
|
+
"subscriptionRenewalReminder",
|
|
1330
|
+
"subscriptionTrialConversionReminder"
|
|
1331
|
+
];
|
|
1332
|
+
function customerEmailsOff(settings) {
|
|
1333
|
+
return RELIED_ON_CUSTOMER_EMAILS.filter((name) => settings?.[name] === false);
|
|
1334
|
+
}
|
|
1335
|
+
async function readManagedProducts(polar) {
|
|
1336
|
+
const productByKey = {};
|
|
1337
|
+
for (const product of await listAllPages((page) => productsList(polar, { metadata: { managedBy: MANAGED_BY }, limit: 100, page }))) {
|
|
1338
|
+
const { metadata, prices, visibility, benefits } = product;
|
|
1339
|
+
if (typeof metadata?.key !== "string") continue;
|
|
1340
|
+
const fixed = (prices ?? []).filter((price) => price.amountType === "fixed" && !price.isArchived && typeof price.priceAmount === "number");
|
|
1341
|
+
productByKey[metadata.interval === "year" ? planProductKey(metadata.key, "year") : metadata.key] = {
|
|
1342
|
+
visibility: typeof visibility === "string" ? visibility : "",
|
|
1343
|
+
...fixed.length > 0 ? { prices: Object.fromEntries(fixed.map((price) => [price.priceCurrency ?? "", price.priceAmount])) } : {},
|
|
1344
|
+
benefits: benefits?.length ?? 0
|
|
1345
|
+
};
|
|
1346
|
+
}
|
|
1347
|
+
return productByKey;
|
|
1348
|
+
}
|
|
1349
|
+
async function readBillingOrganizationState(options, client) {
|
|
1350
|
+
try {
|
|
1351
|
+
const polar = client ?? new Polar(providerClientOptions(options));
|
|
1352
|
+
const organizations = await organizationsListOrganizations(polar, { limit: 1 });
|
|
1353
|
+
const organization = organizations.ok ? organizations.value?.result.items[0] : void 0;
|
|
1354
|
+
if (!organization) return null;
|
|
1355
|
+
const benefitTypeByKey = {};
|
|
1356
|
+
for (const benefit of await listAllPages((page) => benefitsList(polar, { limit: 100, page }))) {
|
|
1357
|
+
const metadata = benefit.metadata;
|
|
1358
|
+
if (metadata?.managedBy !== MANAGED_BY || typeof metadata.key !== "string") continue;
|
|
1359
|
+
benefitTypeByKey[metadata.key] = benefit.type ?? "";
|
|
1360
|
+
}
|
|
1361
|
+
const { subscriptionSettings: subscription, customerPortalSettings: portal } = organization;
|
|
1362
|
+
const productByKey = await readManagedProducts(polar);
|
|
1363
|
+
const members = await membersListMembers(polar, { limit: 1 });
|
|
1364
|
+
return {
|
|
1365
|
+
slug: organization.slug,
|
|
1366
|
+
allowMultipleSubscriptions: subscription.allowMultipleSubscriptions,
|
|
1367
|
+
prorationBehavior: String(subscription.prorationBehavior),
|
|
1368
|
+
benefitRevocationGracePeriod: subscription.benefitRevocationGracePeriod,
|
|
1369
|
+
preventTrialAbuse: subscription.preventTrialAbuse,
|
|
1370
|
+
customerEmailsOff: customerEmailsOff(organization.customerEmailSettings),
|
|
1371
|
+
portal: { updatePlan: portal.subscription.updatePlan, pause: portal.subscription.pause ?? false },
|
|
1372
|
+
benefitTypeByKey,
|
|
1373
|
+
memberModel: organization.featureSettings?.memberModelEnabled === true,
|
|
1374
|
+
membersReadable: members.ok,
|
|
1375
|
+
productByKey
|
|
1376
|
+
};
|
|
1377
|
+
} catch {
|
|
1378
|
+
return null;
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
function teamCustomersFinding(state) {
|
|
1382
|
+
if (!state.memberModel) {
|
|
1383
|
+
return finding(
|
|
1384
|
+
"billing-team-customers",
|
|
1385
|
+
"warn",
|
|
1386
|
+
"The provider organization does not have customer members on, so a workspace can't bill as a team customer with its owner as a member, and the billing portal can't open as the member who asked.",
|
|
1387
|
+
"Turn on customer members (the member model) for the organization in the provider's settings, or ask the provider to."
|
|
1388
|
+
);
|
|
1389
|
+
}
|
|
1390
|
+
if (!state.membersReadable) {
|
|
1391
|
+
return finding(
|
|
1392
|
+
"billing-team-customers",
|
|
1393
|
+
"warn",
|
|
1394
|
+
"BILLING_ACCESS_TOKEN can't read customer members \u2014 workspace checkouts and the billing portal will be refused at the provider.",
|
|
1395
|
+
"Issue a new organization access token with the members:write and customer_sessions:write scopes (besides the ones it has), put it in .env.local, and run `npx nuxt-backend env push`."
|
|
1396
|
+
);
|
|
1397
|
+
}
|
|
1398
|
+
return finding("billing-team-customers", "pass", "Workspaces bill as team customers; the token reads customer members (it also needs members:write and customer_sessions:write, which a read can't check).");
|
|
1399
|
+
}
|
|
1400
|
+
function customerEmailsFinding(state) {
|
|
1401
|
+
if (state.customerEmailsOff.length === 0) return finding("billing-customer-emails", "pass", "The provider's customer emails for a confirmed order, a renewal, a failed payment and a cancelled or ended subscription, and its renewal and trial reminders, are on.");
|
|
1402
|
+
return finding(
|
|
1403
|
+
"billing-customer-emails",
|
|
1404
|
+
"warn",
|
|
1405
|
+
`The provider's ${state.customerEmailsOff.map((name) => name.replace(/[A-Z]/g, (letter) => ` ${letter.toLowerCase()}`)).join(", ")} customer email${state.customerEmailsOff.length === 1 ? " is" : "s are"} off. Billing events reach people in the app only, so a renewal charge, a failed payment or an ended subscription would reach no inbox at all while the person is away, and a renewal or a trial's end would come without a reminder.`,
|
|
1406
|
+
"Turn the provider's customer emails back on in its dashboard (Settings, Customer notifications); the app never sends a copy of them."
|
|
1407
|
+
);
|
|
1408
|
+
}
|
|
1409
|
+
function stackedSubscriptionsMessage(catalog, offered) {
|
|
1410
|
+
const free = freePlanOf(catalog);
|
|
1411
|
+
return free ? `The organization lets a customer hold several subscriptions at once beside the free plan (${free[0]}) \u2014 every billing entity holds it, so a checkout outside the package, which does not upgrade it in place, leaves the customer on two plans, and useBilling() reports only the first.` : `The organization lets a customer hold several subscriptions at once while the catalog offers ${offered} plan prices \u2014 someone can end up on two of them, and useBilling() reports only the first.`;
|
|
1412
|
+
}
|
|
1413
|
+
function stackedSubscriptionsFix(catalog) {
|
|
1414
|
+
return freePlanOf(catalog) ? "Turn multiple subscriptions off in the provider dashboard (or set `multipleSubscriptions` in setupBilling on purpose)." : "Turn multiple subscriptions off in the provider dashboard, or keep a single plan in billing.catalog.ts.";
|
|
1415
|
+
}
|
|
1416
|
+
function showPrices(prices) {
|
|
1417
|
+
return Object.entries(prices).map(([currency, amount]) => [amount, currency].filter((part) => part !== "").join(" ")).join(", ");
|
|
1418
|
+
}
|
|
1419
|
+
function samePrices(a, b) {
|
|
1420
|
+
const entries = (prices) => Object.entries(prices).map(([currency, amount]) => `${currency}:${amount}`).sort().join("|");
|
|
1421
|
+
return entries(a) === entries(b);
|
|
1422
|
+
}
|
|
1423
|
+
function giftTwinProblem(key, state) {
|
|
1424
|
+
const twin = state.productByKey[`${key}-gift`];
|
|
1425
|
+
if (!twin) return `${key} has no gift product`;
|
|
1426
|
+
if (twin.visibility !== "private") return `${key}'s gift product is not private`;
|
|
1427
|
+
if ((twin.benefits ?? 0) > 0) return `${key}'s gift product carries benefits, which its purchaser would receive`;
|
|
1428
|
+
const pack = state.productByKey[key];
|
|
1429
|
+
if (!pack?.prices || !twin.prices) return `${key}'s gift price can't be checked: the pack or its gift product has no live fixed price`;
|
|
1430
|
+
if (!samePrices(twin.prices, pack.prices)) return `${key}'s gift product is priced ${showPrices(twin.prices)}, the pack ${showPrices(pack.prices)}`;
|
|
1431
|
+
return void 0;
|
|
1432
|
+
}
|
|
1433
|
+
function giftTwinsFinding(packKeys, state) {
|
|
1434
|
+
const problems = packKeys.flatMap((key) => giftTwinProblem(key, state) ?? []);
|
|
1435
|
+
return problems.length === 0 ? finding("billing-gift-twins", "pass", "Every pack has a private gift product at its price, with no benefits.") : finding(
|
|
1436
|
+
"billing-gift-twins",
|
|
1437
|
+
"warn",
|
|
1438
|
+
`${problems.join("; ")} \u2014 gifts of ${problems.length === 1 ? "that pack" : "those packs"} may be refused, sold at the wrong price, or grant their purchaser credits.`,
|
|
1439
|
+
"Run `npx nuxt-backend billing sync`: it creates a missing gift product, moves one to its pack's prices in every currency, and detaches its benefits. Make a public one private in the provider dashboard."
|
|
1440
|
+
);
|
|
1441
|
+
}
|
|
1442
|
+
function passProblem(key, months, state) {
|
|
1443
|
+
const pass = state.productByKey[passProductKey(key)];
|
|
1444
|
+
if (!pass) return `${key} has no pass product`;
|
|
1445
|
+
if (pass.visibility !== "private") return `${key}'s pass product is not private`;
|
|
1446
|
+
if (!pass.prices || !Object.values(pass.prices).every((amount) => amount === 0)) return `${key}'s pass product is not free, so claiming it would charge a card`;
|
|
1447
|
+
if ((pass.benefits ?? 0) === 0) return `${key}'s pass product carries no benefits, so a workspace on it would hold nothing`;
|
|
1448
|
+
for (const length of months) {
|
|
1449
|
+
const purchase = state.productByKey[passPurchaseKey(key, length)];
|
|
1450
|
+
if (!purchase) return `${key} has no ${length}-month gift product`;
|
|
1451
|
+
if (purchase.visibility !== "private") return `${key}'s ${length}-month gift product is not private`;
|
|
1452
|
+
if ((purchase.benefits ?? 0) > 0) return `${key}'s ${length}-month gift product carries benefits, which its purchaser would receive`;
|
|
1453
|
+
}
|
|
1454
|
+
return void 0;
|
|
1455
|
+
}
|
|
1456
|
+
function passProductsFinding(plans, state) {
|
|
1457
|
+
const problems = plans.flatMap(([key, months]) => passProblem(key, months, state) ?? []);
|
|
1458
|
+
return problems.length === 0 ? finding("billing-pass-products", "pass", "Every plan offered as a gift has a free pass product with its benefits, and a private purchase product per length.") : finding(
|
|
1459
|
+
"billing-pass-products",
|
|
1460
|
+
"warn",
|
|
1461
|
+
`${problems.join("; ")} \u2014 gifts of ${problems.length === 1 ? "that plan" : "those plans"} may be refused, charge the recipient, or grant nothing.`,
|
|
1462
|
+
"Run `npx nuxt-backend billing sync`: it creates the missing products. Make a public one private in the provider dashboard."
|
|
1463
|
+
);
|
|
1464
|
+
}
|
|
1465
|
+
function passFindings(catalog, state) {
|
|
1466
|
+
const giftable = giftablePlans(catalog).map(([key, , months]) => [key, months]);
|
|
1467
|
+
return giftable.length > 0 ? [passProductsFinding(giftable, state)] : [];
|
|
1468
|
+
}
|
|
1469
|
+
function resolvePackage(require, name) {
|
|
1470
|
+
for (const request of [`${name}/package.json`, name]) {
|
|
1471
|
+
try {
|
|
1472
|
+
let dir = dirname(require.resolve(request));
|
|
1473
|
+
while (dir !== dirname(dir)) {
|
|
1474
|
+
const manifest = join(dir, "package.json");
|
|
1475
|
+
const parsed = existsSync(manifest) ? JSON.parse(readFileSync(manifest, "utf8")) : null;
|
|
1476
|
+
if (parsed?.name === name && parsed.version) return { dir, version: parsed.version };
|
|
1477
|
+
dir = dirname(dir);
|
|
1478
|
+
}
|
|
1479
|
+
} catch {
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
return null;
|
|
1483
|
+
}
|
|
1484
|
+
function providerSdkFindings(rootDir) {
|
|
1485
|
+
const requireFrom = (dir) => createRequire(join(dir, "package.json"));
|
|
1486
|
+
const app = requireFrom(rootDir);
|
|
1487
|
+
const backend = resolvePackage(app, "nuxt-backend");
|
|
1488
|
+
const component = resolvePackage(app, "@convex-dev/polar") ?? (backend ? resolvePackage(requireFrom(backend.dir), "@convex-dev/polar") : null);
|
|
1489
|
+
const sdk = resolvePackage(component ? requireFrom(component.dir) : app, "@polar-sh/sdk") ?? (component ? resolvePackage(app, "@polar-sh/sdk") : null);
|
|
1490
|
+
if (!sdk) return [];
|
|
1491
|
+
const { version } = sdk;
|
|
1492
|
+
return [Number.parseInt(version, 10) >= 1 ? finding("billing-provider-sdk", "warn", `The billing component (@convex-dev/polar 0.9) resolves @polar-sh/sdk ${version}, but it is built on the 0.x SDK, which 1.0 rewrote: checkout, the portal and webhook parsing break on it.`, 'Pin "@polar-sh/sdk": "^0.49.0" in package.json and reinstall, until nuxt-backend supports the 1.x SDK.') : finding("billing-provider-sdk", "pass", `The billing component resolves @polar-sh/sdk ${version}, the line it is built on.`)];
|
|
1493
|
+
}
|
|
1494
|
+
function collectBillingFindings(catalog, state, { tokenPresent }) {
|
|
1495
|
+
if (!catalog) return [];
|
|
1496
|
+
const findings = [];
|
|
1497
|
+
const plans = Object.entries(catalog.plans ?? {});
|
|
1498
|
+
const sold = plans.filter(([, plan]) => !plan.retired);
|
|
1499
|
+
const offered = sold.reduce((count, [, plan]) => count + pricedIntervals(plan).length, 0);
|
|
1500
|
+
const packs = Object.entries(catalog.packs ?? {});
|
|
1501
|
+
const meters = Object.keys(catalog.meters ?? {});
|
|
1502
|
+
const features = Object.keys(catalog.features ?? {});
|
|
1503
|
+
const grantsCredits = [...plans, ...packs].some(([, product]) => product.credits);
|
|
1504
|
+
if (meters.length > 0) {
|
|
1505
|
+
const referenced = /* @__PURE__ */ new Set([
|
|
1506
|
+
...[...plans, ...packs].flatMap(([, product]) => product.credits ? [product.credits.meter] : []),
|
|
1507
|
+
...plans.flatMap(([, plan]) => (plan.usage ?? []).map((price) => price.meter))
|
|
1508
|
+
]);
|
|
1509
|
+
const orphans = meters.filter((meter) => !referenced.has(meter));
|
|
1510
|
+
findings.push(orphans.length === 0 ? finding("billing-meter-usage", "pass", `Every catalog meter is funded by a credit grant or billed by a usage price (${meters.join(", ")}).`) : finding(
|
|
1511
|
+
"billing-meter-usage",
|
|
1512
|
+
"warn",
|
|
1513
|
+
`No plan or pack grants credits on ${orphans.join(", ")}, and no plan prices usage against ${orphans.length === 1 ? "it" : "them"} \u2014 spends draw on a balance nothing funds and nothing invoices.`,
|
|
1514
|
+
"Give a plan or pack `credits: { meter: \u2026 }`, add a `usage` price for it, or drop the meter from billing.catalog.ts."
|
|
1515
|
+
));
|
|
1516
|
+
}
|
|
1517
|
+
findings.push(...promotionLimitsFinding(catalog));
|
|
1518
|
+
if (!state) {
|
|
1519
|
+
if (tokenPresent) {
|
|
1520
|
+
findings.push(finding(
|
|
1521
|
+
"billing-organization",
|
|
1522
|
+
"warn",
|
|
1523
|
+
"BILLING_ACCESS_TOKEN is set here but the provider would not answer with it (expired, revoked, or issued for the other environment) \u2014 the catalog cross-checks were skipped.",
|
|
1524
|
+
"Issue a fresh organization access token for the billing environment BACKEND_ENVIRONMENT names (the provider sandbox unless it is production), put it in .env.local, and run `npx nuxt-backend env push`."
|
|
1525
|
+
));
|
|
1526
|
+
}
|
|
1527
|
+
return findings;
|
|
1528
|
+
}
|
|
1529
|
+
findings.push(state.allowMultipleSubscriptions && offered > 1 ? finding(
|
|
1530
|
+
"billing-multiple-subscriptions",
|
|
1531
|
+
"warn",
|
|
1532
|
+
stackedSubscriptionsMessage(catalog, offered),
|
|
1533
|
+
stackedSubscriptionsFix(catalog)
|
|
1534
|
+
) : finding("billing-multiple-subscriptions", "pass", state.allowMultipleSubscriptions ? "Multiple subscriptions are allowed, and the catalog offers at most one plan." : "A customer holds one subscription at a time."));
|
|
1535
|
+
findings.push(offered > 1 && state.prorationBehavior === "next_period" ? finding(
|
|
1536
|
+
"billing-proration",
|
|
1537
|
+
"warn",
|
|
1538
|
+
`Plan changes are settled as '${state.prorationBehavior}' \u2014 an upgrade grants the new plan's credits and features immediately but is not charged until the next cycle.`,
|
|
1539
|
+
"Set the organization's proration behaviour to `invoice` or `prorate` if an upgrade should be charged when it happens."
|
|
1540
|
+
) : finding("billing-proration", "pass", `Plan changes are settled as '${state.prorationBehavior}'.`));
|
|
1541
|
+
findings.push(state.benefitRevocationGracePeriod > 0 && (features.length > 0 || grantsCredits) ? finding(
|
|
1542
|
+
"billing-benefit-grace",
|
|
1543
|
+
"warn",
|
|
1544
|
+
`Benefits stay granted for a grace period (${state.benefitRevocationGracePeriod}) after a subscription ends \u2014 useFeatures().has() keeps returning true and granted credits stay spendable for that long.`,
|
|
1545
|
+
"Set the benefit revocation grace period to 0 in the provider dashboard if access must stop the moment a subscription ends."
|
|
1546
|
+
) : finding("billing-benefit-grace", "pass", state.benefitRevocationGracePeriod > 0 ? `A benefit revocation grace period (${state.benefitRevocationGracePeriod}) is set, and the catalog grants no benefits.` : "Benefits are revoked as soon as a subscription ends."));
|
|
1547
|
+
const trialPlans = sold.filter(([, plan]) => plan.trial && !plan.trial.pass);
|
|
1548
|
+
findings.push(trialPlans.length > 0 && !state.preventTrialAbuse ? finding(
|
|
1549
|
+
"billing-trial-abuse",
|
|
1550
|
+
"warn",
|
|
1551
|
+
`${trialPlans.map(([key]) => key).join(", ")} offer${trialPlans.length === 1 ? "s" : ""} a trial but the organization does not prevent trial abuse \u2014 the same customer can start the trial again and again.`,
|
|
1552
|
+
"Turn on trial abuse prevention in the provider dashboard."
|
|
1553
|
+
) : finding("billing-trial-abuse", "pass", trialPlans.length === 0 ? "No plan declares a trial." : "Trials are limited to one per customer."));
|
|
1554
|
+
const pause = `pause: ${state.portal.pause ? "on" : "off"}`;
|
|
1555
|
+
findings.push(offered > 1 && !state.portal.updatePlan ? finding(
|
|
1556
|
+
"billing-portal",
|
|
1557
|
+
"warn",
|
|
1558
|
+
`The customer portal cannot change plan while the catalog offers ${offered} plan prices \u2014 upgrades, downgrades and a switch to yearly have to go through a fresh checkout (${pause}).`,
|
|
1559
|
+
"Enable plan updates in the provider's customer portal settings, or drive upgrades through your own checkout."
|
|
1560
|
+
) : finding("billing-portal", "pass", state.portal.updatePlan ? `The customer portal offers plan changes (${pause}).` : `The customer portal does not offer plan changes, and the catalog offers at most one plan (${pause}).`));
|
|
1561
|
+
findings.push(customerEmailsFinding(state));
|
|
1562
|
+
findings.push(...promotionPortalFinding(catalog, state));
|
|
1563
|
+
findings.push(teamCustomersFinding(state));
|
|
1564
|
+
if (packs.length > 0) findings.push(giftTwinsFinding(packs.map(([key]) => key), state));
|
|
1565
|
+
findings.push(...passFindings(catalog, state));
|
|
1566
|
+
if (features.length > 0) {
|
|
1567
|
+
const legacy = features.filter((key) => state.benefitTypeByKey[key] === "custom");
|
|
1568
|
+
findings.push(legacy.length === 0 ? finding("billing-feature-benefits", "pass", "Feature benefits use the provider's native feature-flag type.") : finding(
|
|
1569
|
+
"billing-feature-benefits",
|
|
1570
|
+
"warn",
|
|
1571
|
+
`Feature benefit${legacy.length === 1 ? "" : "s"} ${legacy.join(", ")} still ${legacy.length === 1 ? "is" : "are"} the generic custom type \u2014 the customer portal lists ${legacy.length === 1 ? "it" : "them"} as a note rather than a feature.`,
|
|
1572
|
+
"Delete them in the provider dashboard (or drop their managed tag) and re-run `npx nuxt-backend billing sync` to recreate them as feature flags \u2014 gating matches on the metadata key either way, so useFeatures() keeps working meanwhile."
|
|
1573
|
+
));
|
|
1574
|
+
}
|
|
1575
|
+
return findings;
|
|
1576
|
+
}
|
|
1577
|
+
function runningPromotions(catalog) {
|
|
1578
|
+
return Object.entries(catalog.discounts ?? {}).filter(([, discount]) => !discount.retired);
|
|
1579
|
+
}
|
|
1580
|
+
function promotionLimitsFinding(catalog) {
|
|
1581
|
+
const promotions = runningPromotions(catalog);
|
|
1582
|
+
if (promotions.length === 0) return [];
|
|
1583
|
+
const open = promotions.flatMap(([key, discount]) => {
|
|
1584
|
+
if (!discount.code) return [];
|
|
1585
|
+
const missing = [discount.perCustomer === void 0 && "perCustomer", discount.maxRedemptions === void 0 && "maxRedemptions", discount.endsAt === void 0 && "endsAt"].filter(Boolean);
|
|
1586
|
+
return missing.length > 0 ? [`${key} (no ${missing.join(", ")})`] : [];
|
|
1587
|
+
});
|
|
1588
|
+
return [open.length === 0 ? finding("billing-promotion-limits", "pass", "Every public promotion has a per-customer limit, a total cap and an end date.") : finding(
|
|
1589
|
+
"billing-promotion-limits",
|
|
1590
|
+
"warn",
|
|
1591
|
+
`Public promotion${open.length === 1 ? "" : "s"} ${open.join("; ")} can run without that limit: anyone who finds the code redeems it.`,
|
|
1592
|
+
"Give each discount with a `code` a `perCustomer` limit, a `maxRedemptions` cap and an `endsAt` in billing.catalog.ts, then run `npx nuxt-backend billing sync`."
|
|
1593
|
+
)];
|
|
1594
|
+
}
|
|
1595
|
+
function promotionPortalFinding(catalog, state) {
|
|
1596
|
+
if (runningPromotions(catalog).length === 0) return [];
|
|
1597
|
+
const scoped = scopedForeverDiscounts(catalog);
|
|
1598
|
+
if (scoped.length === 0 || !state.portal.updatePlan) {
|
|
1599
|
+
return [finding("billing-promotion-portal", "pass", scoped.length === 0 ? "No forever promotion is limited to some plans." : "The customer portal does not change plans, so a forever promotion stays on the plans it is for.")];
|
|
1600
|
+
}
|
|
1601
|
+
return [finding(
|
|
1602
|
+
"billing-promotion-portal",
|
|
1603
|
+
"warn",
|
|
1604
|
+
`${scoped.join(", ")} ${scoped.length === 1 ? "takes" : "take"} money off forever on some plans only, while the customer portal changes plans: the provider keeps a subscription's discount across any plan change, so a customer moves it onto a plan it was never for.`,
|
|
1605
|
+
"Turn off plan changes in the provider's customer portal settings and change plans through your own checkout, or make the discount once or { months }."
|
|
1606
|
+
)];
|
|
1607
|
+
}
|
|
1608
|
+
function missingProductionIds(catalog, ids) {
|
|
1609
|
+
const products = ids?.products ?? {};
|
|
1610
|
+
const plans = Object.entries(catalog.plans ?? {}).filter(([, plan]) => !plan.retired).flatMap(([key, plan]) => pricedIntervals(plan).filter((interval) => !ids?.plans?.[key]?.[interval] && !products[planProductKey(key, interval)]).map((interval) => planProductKey(key, interval)));
|
|
1611
|
+
const packs = Object.keys(catalog.packs ?? {}).filter((key) => !products[key]);
|
|
1612
|
+
const meters = Object.keys(catalog.meters ?? {}).filter((key) => !ids?.meters?.[key]).map((key) => `meter ${key}`);
|
|
1613
|
+
const discounts = Object.entries(catalog.discounts ?? {}).filter(([key, discount]) => !discount.retired && !ids?.discounts?.[key]).map(([key]) => `discount ${key}`);
|
|
1614
|
+
return [...plans, ...packs, ...meters, ...discounts];
|
|
1615
|
+
}
|
|
1616
|
+
async function productionCatalogFindings(rootDir, environment) {
|
|
1617
|
+
let catalog;
|
|
1618
|
+
let ids;
|
|
1619
|
+
try {
|
|
1620
|
+
catalog = (await loadCatalog(rootDir))?.catalog;
|
|
1621
|
+
if (!catalog) return [];
|
|
1622
|
+
ids = (await loadGenerated(rootDir)).production;
|
|
1623
|
+
} catch {
|
|
1624
|
+
return [];
|
|
1625
|
+
}
|
|
1626
|
+
const missing = missingProductionIds(catalog, ids);
|
|
1627
|
+
if (missing.length === 0) return [finding("billing-catalog-production", "pass", "Every plan price, pack, meter and promotion of the catalog has its production id.")];
|
|
1628
|
+
const gap = `The catalog has no production id for ${missing.join(", ")}`;
|
|
1629
|
+
const hint = "Run npx nuxt-backend billing sync --env production, and commit the billing.generated.ts it writes.";
|
|
1630
|
+
return [environment === "production" ? finding("billing-catalog-production", "fail", `${gap}: production refuses their checkout.`, hint) : finding("billing-catalog-production", "warn", `${gap}: once production bills in the production environment, their checkout is refused.`, hint)];
|
|
1631
|
+
}
|
|
1632
|
+
|
|
1633
|
+
function isProviderNotFound(error) {
|
|
1634
|
+
const fields = typeof error === "object" && error !== null ? error : {};
|
|
1635
|
+
return fields.statusCode === 404 || fields.error === "ResourceNotFound";
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1638
|
+
const PROVIDER_COMPONENT = "polar";
|
|
1639
|
+
const SAMPLE_SIZE = 10;
|
|
1640
|
+
const MAPPED_CUSTOMERS_QUERY = `return (await ctx.db.query("customers").take(${SAMPLE_SIZE})).map(customer => customer.id)`;
|
|
1641
|
+
async function readMappedCustomers(rootDir, { prod }) {
|
|
1642
|
+
try {
|
|
1643
|
+
const { stdout } = await runConvex(rootDir, ["run", ...deploymentFlags({ prod }), "--component", PROVIDER_COMPONENT, "--inline-query", MAPPED_CUSTOMERS_QUERY]);
|
|
1644
|
+
const ids = JSON.parse(stdout);
|
|
1645
|
+
return Array.isArray(ids) && ids.every((id) => typeof id === "string") ? ids : null;
|
|
1646
|
+
} catch {
|
|
1647
|
+
return null;
|
|
1648
|
+
}
|
|
1649
|
+
}
|
|
1650
|
+
async function checkMappedCustomers(client, ids) {
|
|
1651
|
+
try {
|
|
1652
|
+
const answers = await Promise.all(ids.map(async (id) => {
|
|
1653
|
+
const found = await customersGet(client, { id });
|
|
1654
|
+
if (found.ok) return "known";
|
|
1655
|
+
return isProviderNotFound(found.error) ? "unknown" : "unread";
|
|
1656
|
+
}));
|
|
1657
|
+
if (answers.includes("unread")) return null;
|
|
1658
|
+
return { sampled: ids.length, unknown: answers.filter((answer) => answer === "unknown").length };
|
|
1659
|
+
} catch {
|
|
1660
|
+
return null;
|
|
1661
|
+
}
|
|
1662
|
+
}
|
|
1663
|
+
function customerMappingFindings(read, { prod }) {
|
|
1664
|
+
if (!read) return [];
|
|
1665
|
+
if (read.sampled === 0) return [finding("billing-customer-mapping", "pass", "No billing entity is mapped onto a provider customer yet.")];
|
|
1666
|
+
if (read.unknown === 0) return [finding("billing-customer-mapping", "pass", `The provider knows the ${read.sampled === 1 ? "customer" : `${read.sampled} customers`} the deployment maps billing entities onto (a sample).`)];
|
|
1667
|
+
const message = read.unknown === read.sampled ? `The provider knows none of the ${read.sampled === 1 ? "customer" : `${read.sampled} customers`} the deployment maps billing entities onto: the deployment's billing data belongs to another organization than the one BILLING_ACCESS_TOKEN names (a new sandbox, say).` : `The provider does not know ${read.unknown} of the ${read.sampled} customers the deployment maps billing entities onto (a sample): billing data from another organization than the one BILLING_ACCESS_TOKEN names, or customers deleted at the provider.`;
|
|
1668
|
+
return [finding(
|
|
1669
|
+
"billing-customer-mapping",
|
|
1670
|
+
"warn",
|
|
1671
|
+
`${message} Checkout, the portal and the free plan are refused for ${read.unknown === 1 ? "that entity" : "those entities"} (unavailable, reason customer_unknown).`,
|
|
1672
|
+
prod ? "Point production's BILLING_ACCESS_TOKEN back at the organization its billing data came from (`npx convex env set --prod BILLING_ACCESS_TOKEN` asks for it). `billing reset` clears a dev deployment only." : "Run `npx nuxt-backend billing reset`: it syncs the catalog to the organization, clears the deployment's billing data and puts every billing entity back on the free plan. Or point BILLING_ACCESS_TOKEN back at the organization the data came from."
|
|
1673
|
+
)];
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1676
|
+
const CUSTOMER_EMAILS = [
|
|
1677
|
+
"orderConfirmation",
|
|
1678
|
+
"subscriptionConfirmation",
|
|
1679
|
+
"subscriptionCycled",
|
|
1680
|
+
"subscriptionPastDue",
|
|
1681
|
+
"subscriptionCancellation",
|
|
1682
|
+
"subscriptionRevoked",
|
|
1683
|
+
"subscriptionRenewalReminder"
|
|
1684
|
+
];
|
|
1685
|
+
const TRIAL_REMINDER = "subscriptionTrialConversionReminder";
|
|
1686
|
+
function trialPlans(catalog) {
|
|
1687
|
+
return Object.entries(catalog.plans ?? {}).filter(([, plan]) => !plan.retired && plan.trial && !plan.trial.pass).map(([key]) => key);
|
|
1688
|
+
}
|
|
1689
|
+
function words(name) {
|
|
1690
|
+
return name.replace(/[A-Z]/g, (letter) => ` ${letter.toLowerCase()}`);
|
|
1691
|
+
}
|
|
1692
|
+
function planSettingChanges(catalog, organization) {
|
|
1693
|
+
const changes = [];
|
|
1694
|
+
const trials = trialPlans(catalog).length > 0;
|
|
1695
|
+
if (trials && !organization.subscriptionSettings.preventTrialAbuse) {
|
|
1696
|
+
changes.push({ key: "trial-abuse", finding: "billing-trial-abuse", description: "Turn on trial abuse prevention, so one customer cannot start the same trial again." });
|
|
1697
|
+
}
|
|
1698
|
+
if (trials && organization.customerEmailSettings[TRIAL_REMINDER] === false) {
|
|
1699
|
+
changes.push({ key: "trial-reminders", finding: "billing-customer-emails", description: "Turn on the trial reminder, so a customer hears before a trial turns into a charge." });
|
|
1700
|
+
}
|
|
1701
|
+
const off = CUSTOMER_EMAILS.filter((name) => organization.customerEmailSettings[name] === false);
|
|
1702
|
+
if (off.length > 0) {
|
|
1703
|
+
changes.push({ key: "customer-emails", finding: "billing-customer-emails", description: `Turn the provider's ${off.map(words).join(", ")} customer email${off.length === 1 ? "" : "s"} back on.` });
|
|
1704
|
+
}
|
|
1705
|
+
return changes;
|
|
1706
|
+
}
|
|
1707
|
+
function planEndpointChanges(endpoint, { routeHealthy }) {
|
|
1708
|
+
const changes = [];
|
|
1709
|
+
if (!endpoint.enabled && routeHealthy) {
|
|
1710
|
+
changes.push({ key: "webhook-enabled", finding: "billing-webhook-enabled", description: `Turn the webhook endpoint ${endpoint.url} back on: its route answers the probe now.` });
|
|
1711
|
+
}
|
|
1712
|
+
const missing = missingEvents(endpoint);
|
|
1713
|
+
if (missing.length > 0) {
|
|
1714
|
+
changes.push({ key: "webhook-events", finding: "billing-webhook-events", description: `Subscribe the webhook endpoint to ${missing.join(", ")}.` });
|
|
1715
|
+
}
|
|
1716
|
+
return changes;
|
|
1717
|
+
}
|
|
1718
|
+
function missingEvents(endpoint) {
|
|
1719
|
+
const events = new Set(endpoint.events);
|
|
1720
|
+
return BILLING_WEBHOOK_PROVISION_EVENTS.filter((event) => !events.has(event));
|
|
1721
|
+
}
|
|
1722
|
+
function billingEndpointFindings(endpoint, url) {
|
|
1723
|
+
if (!endpoint) return [];
|
|
1724
|
+
const missing = missingEvents(endpoint);
|
|
1725
|
+
return [
|
|
1726
|
+
endpoint.enabled ? finding("billing-webhook-enabled", "pass", `The billing provider delivers to ${url}.`) : finding(
|
|
1727
|
+
"billing-webhook-enabled",
|
|
1728
|
+
"warn",
|
|
1729
|
+
`The billing provider turned the webhook endpoint ${url} off after its deliveries kept failing: subscriptions, orders and refunds reach the deployment no more.`,
|
|
1730
|
+
"Run `npx nuxt-backend doctor --fix`: once the route answers its probe, it turns the endpoint back on (after you confirm), and you can replay what was held back."
|
|
1731
|
+
),
|
|
1732
|
+
missing.length === 0 ? finding("billing-webhook-events", "pass", "The billing webhook endpoint is subscribed to every event the package handles.") : finding(
|
|
1733
|
+
"billing-webhook-events",
|
|
1734
|
+
"warn",
|
|
1735
|
+
`The billing webhook endpoint is not subscribed to ${missing.join(", ")}: the deployment never hears of ${missing.length === 1 ? "it" : "them"}.`,
|
|
1736
|
+
"Run `npx nuxt-backend doctor --fix`: it subscribes the endpoint to them, after you confirm."
|
|
1737
|
+
)
|
|
1738
|
+
];
|
|
1739
|
+
}
|
|
1740
|
+
function providerClient(accessToken, environment) {
|
|
1741
|
+
return new Polar(providerClientOptions({ accessToken, environment }));
|
|
1742
|
+
}
|
|
1743
|
+
async function readProviderOrganization(client) {
|
|
1744
|
+
try {
|
|
1745
|
+
const listed = await organizationsListOrganizations(client, { limit: 1 });
|
|
1746
|
+
const organization = listed.ok ? listed.value?.result.items[0] : void 0;
|
|
1747
|
+
if (!organization) return null;
|
|
1748
|
+
return {
|
|
1749
|
+
id: organization.id,
|
|
1750
|
+
subscriptionSettings: { ...organization.subscriptionSettings },
|
|
1751
|
+
customerEmailSettings: { ...organization.customerEmailSettings }
|
|
1752
|
+
};
|
|
1753
|
+
} catch {
|
|
1754
|
+
return null;
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
async function readProviderEndpoint(client, url) {
|
|
1758
|
+
try {
|
|
1759
|
+
const endpoints = await listAllPages((page) => webhooksListWebhookEndpoints(client, { limit: 100, page }));
|
|
1760
|
+
const endpoint = endpoints.find((entry) => entry.url.replace(/\/+$/, "") === url.replace(/\/+$/, ""));
|
|
1761
|
+
if (!endpoint) return null;
|
|
1762
|
+
return { id: endpoint.id, url: endpoint.url, enabled: endpoint.enabled !== false, events: [...endpoint.events ?? []] };
|
|
1763
|
+
} catch {
|
|
1764
|
+
return null;
|
|
1765
|
+
}
|
|
1766
|
+
}
|
|
1767
|
+
async function applyProviderChanges(client, { organization, endpoint }, changes) {
|
|
1768
|
+
const keys = new Set(changes.map((change) => change.key));
|
|
1769
|
+
const settings = organization ? organizationUpdate(organization, keys) : null;
|
|
1770
|
+
if (organization && settings) {
|
|
1771
|
+
const updated = await organizationsUpdate(client, { id: organization.id, organizationUpdate: settings });
|
|
1772
|
+
if (!updated.ok) throw updated.error;
|
|
1773
|
+
}
|
|
1774
|
+
const hook = endpoint ? endpointUpdate(endpoint, keys) : null;
|
|
1775
|
+
if (endpoint && hook) {
|
|
1776
|
+
const updated = await webhooksUpdateWebhookEndpoint(client, { id: endpoint.id, webhookEndpointUpdate: hook });
|
|
1777
|
+
if (!updated.ok) throw updated.error;
|
|
1778
|
+
}
|
|
1779
|
+
}
|
|
1780
|
+
function organizationUpdate(organization, keys) {
|
|
1781
|
+
const update = {};
|
|
1782
|
+
if (keys.has("trial-abuse")) update.subscriptionSettings = { ...organization.subscriptionSettings, preventTrialAbuse: true };
|
|
1783
|
+
const emails = [...keys.has("trial-reminders") ? [TRIAL_REMINDER] : [], ...keys.has("customer-emails") ? CUSTOMER_EMAILS : []];
|
|
1784
|
+
if (emails.length > 0) update.customerEmailSettings = { ...organization.customerEmailSettings, ...Object.fromEntries(emails.map((name) => [name, true])) };
|
|
1785
|
+
return Object.keys(update).length > 0 ? update : null;
|
|
1786
|
+
}
|
|
1787
|
+
function endpointUpdate(endpoint, keys) {
|
|
1788
|
+
const update = {};
|
|
1789
|
+
if (keys.has("webhook-enabled")) update.enabled = true;
|
|
1790
|
+
if (keys.has("webhook-events")) update.events = [.../* @__PURE__ */ new Set([...endpoint.events, ...BILLING_WEBHOOK_PROVISION_EVENTS])];
|
|
1791
|
+
return Object.keys(update).length > 0 ? update : null;
|
|
1792
|
+
}
|
|
1793
|
+
function billingProviderTarget(env, prod) {
|
|
1794
|
+
const source = prod ? process.env : env;
|
|
1795
|
+
const accessToken = source.BILLING_ACCESS_TOKEN;
|
|
1796
|
+
if (!accessToken) return null;
|
|
1797
|
+
const kind = parseBackendEnvironment(source.BACKEND_ENVIRONMENT) ?? (prod ? "production" : void 0);
|
|
1798
|
+
return { accessToken, environment: billingEnvironment(kind) };
|
|
1799
|
+
}
|
|
1800
|
+
|
|
1801
|
+
async function metricsAccessFindings(options, client) {
|
|
1802
|
+
if (!options.accessToken) return [];
|
|
1803
|
+
const polar = new Polar(providerClientOptions({ accessToken: options.accessToken, environment: options.environment }));
|
|
1804
|
+
const read = await metricsLimits(polar).catch((error) => ({ ok: false, error }));
|
|
1805
|
+
if (read.ok) return [finding("analytics-metrics", "pass", "BILLING_ACCESS_TOKEN reads the provider's metrics (metrics:read): the admin console's Revenue view can open.")];
|
|
1806
|
+
const status = read.error?.statusCode;
|
|
1807
|
+
if (status === 401 || status === 403) {
|
|
1808
|
+
return [finding(
|
|
1809
|
+
"analytics-metrics",
|
|
1810
|
+
"warn",
|
|
1811
|
+
"BILLING_ACCESS_TOKEN lacks the metrics:read scope: the admin console's Revenue view is refused as unavailable.",
|
|
1812
|
+
"Issue a new organization access token with the metrics:read scope (besides the ones it has), put it in .env.local, and run `npx nuxt-backend env push`."
|
|
1813
|
+
)];
|
|
1814
|
+
}
|
|
1815
|
+
return [finding(
|
|
1816
|
+
"analytics-metrics",
|
|
1817
|
+
"warn",
|
|
1818
|
+
"The billing provider did not answer a metrics read with BILLING_ACCESS_TOKEN (unreachable, or the token is expired or for the other environment): the Revenue view would be refused as unavailable.",
|
|
1819
|
+
"Check the token is current and issued for the billing environment BACKEND_ENVIRONMENT names (the provider sandbox unless it is production), then run `npx nuxt-backend doctor --only analytics` again."
|
|
1820
|
+
)];
|
|
1821
|
+
}
|
|
1822
|
+
|
|
1823
|
+
const ACTIVATION = /\bactivation:\s*['"`](app(?:\.[a-z][a-z0-9_]*)+)['"`]/;
|
|
1824
|
+
const codeOf = (path) => readFileSync(path, "utf8").replace(/\/\*[\s\S]*?\*\//g, "").replace(/^\s*\/\/.*$/gm, "");
|
|
1825
|
+
function backendSources(dir) {
|
|
1826
|
+
const files = [];
|
|
1827
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
1828
|
+
if (entry.name === "_generated" || entry.name === "node_modules") continue;
|
|
1829
|
+
const path = join(dir, entry.name);
|
|
1830
|
+
if (entry.isDirectory()) files.push(...backendSources(path));
|
|
1831
|
+
else if (/\.ts$/.test(entry.name) && !/\.(?:test|spec)\.ts$/.test(entry.name)) files.push(path);
|
|
1832
|
+
}
|
|
1833
|
+
return files;
|
|
1834
|
+
}
|
|
1835
|
+
function activationFindings(rootDir) {
|
|
1836
|
+
const dir = join(rootDir, resolveFunctionsDir(rootDir));
|
|
1837
|
+
const auditFile = join(dir, "audit.ts");
|
|
1838
|
+
if (!existsSync(auditFile)) return [];
|
|
1839
|
+
const kind = ACTIVATION.exec(codeOf(auditFile))?.[1];
|
|
1840
|
+
if (!kind) return [];
|
|
1841
|
+
const literals = ["'", '"', "`"].map((quote) => `${quote}${kind}${quote}`);
|
|
1842
|
+
const recorded = backendSources(dir).some((path) => path !== auditFile && literals.some((literal) => codeOf(path).includes(literal)));
|
|
1843
|
+
if (recorded) return [finding("analytics-activation", "pass", `${kind}, the funnel's activation, is recorded by a backend file.`)];
|
|
1844
|
+
return [finding(
|
|
1845
|
+
"analytics-activation",
|
|
1846
|
+
"warn",
|
|
1847
|
+
`setupAudit({ activation }) names ${kind}, which no backend file records: the growth funnel's activation step stays at zero.`,
|
|
1848
|
+
`Record it where a person first gets value: \`await audit.recordBackendEvent(ctx, { type: '${kind}' })\`, or name the kind you do record.`
|
|
1849
|
+
)];
|
|
1850
|
+
}
|
|
1851
|
+
|
|
1852
|
+
function bundleDuplicatesFindings(rootDir) {
|
|
1853
|
+
const run = readLastRun(rootDir);
|
|
1854
|
+
const convex = run?.bundles.find((bundle) => bundle.id === "convex");
|
|
1855
|
+
if (!run || !convex || installChangedSince(rootDir, run.ranAt)) return [];
|
|
1856
|
+
const date = run.ranAt.slice(0, 10);
|
|
1857
|
+
const duplicates = convex.insights.filter((insight) => insight.kind === "duplicate-package");
|
|
1858
|
+
if (duplicates.length === 0) return [finding("bundle-duplicates", "pass", `The last analyze run (${date}) found no package bundled more than once in the Convex bundle.`)];
|
|
1859
|
+
const saved = duplicates.reduce((sum, insight) => sum + insight.savedBytes, 0);
|
|
1860
|
+
const names = duplicates.map((insight) => insight.subject ?? insight.title);
|
|
1861
|
+
return [finding(
|
|
1862
|
+
"bundle-duplicates",
|
|
1863
|
+
"warn",
|
|
1864
|
+
`The Convex bundle holds ${names.length === 1 ? "a package" : `${names.length} packages`} more than once (${names.join(", ")}), about ${formatSize(saved)} of code, as the last analyze run (${date}) measured it.`,
|
|
1865
|
+
"Dedupe the install (pnpm dedupe, npm dedupe), or align the version your code asks for with the one a dependency uses; npx nuxt-backend analyze --only convex names each copy and what imports it, and checks again."
|
|
1866
|
+
)];
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1869
|
+
function packageNames(manifestPath = join(packageDir, "skills/nuxt-backend/references/surface.json")) {
|
|
1870
|
+
try {
|
|
1871
|
+
const { autoImports = {} } = JSON.parse(readFileSync(manifestPath, "utf8"));
|
|
1872
|
+
return {
|
|
1873
|
+
components: /* @__PURE__ */ new Set([...autoImports.components ?? [], ...autoImports.parts ?? [], ...autoImports.baseModule?.components ?? []]),
|
|
1874
|
+
composables: /* @__PURE__ */ new Set([...autoImports.composables ?? [], ...autoImports.baseModule?.composables ?? []])
|
|
1875
|
+
};
|
|
1876
|
+
} catch {
|
|
1877
|
+
return { components: /* @__PURE__ */ new Set(), composables: /* @__PURE__ */ new Set() };
|
|
1878
|
+
}
|
|
1879
|
+
}
|
|
1880
|
+
function filesUnder(dir, extensions, depth = Number.POSITIVE_INFINITY) {
|
|
1881
|
+
if (!existsSync(dir)) return [];
|
|
1882
|
+
const walk = (current, level) => readdirSync(current).flatMap((entry) => {
|
|
1883
|
+
const path = join(current, entry);
|
|
1884
|
+
if (statSync(path).isDirectory()) return level < depth ? walk(path, level + 1) : [];
|
|
1885
|
+
return extensions.test(entry) ? [relative(dir, path)] : [];
|
|
1886
|
+
});
|
|
1887
|
+
return walk(dir, 0);
|
|
1888
|
+
}
|
|
1889
|
+
const pascal = (segment) => segment.split(/[-_.]/).filter(Boolean).map((part) => part[0].toUpperCase() + part.slice(1)).join("");
|
|
1890
|
+
function componentName(file) {
|
|
1891
|
+
const segments = file.replace(/\\/g, "/").replace(/\.vue$/, "").replace(/\.(?:client|server)$/, "").split("/");
|
|
1892
|
+
if (segments.at(-1) === "index" && segments.length > 1) segments.pop();
|
|
1893
|
+
const parts = segments.map(pascal);
|
|
1894
|
+
return parts.reduce((name, part) => part.startsWith(name) ? part : `${name}${part}`, "");
|
|
1895
|
+
}
|
|
1896
|
+
function exportedNames(path) {
|
|
1897
|
+
const code = readFileSync(path, "utf8");
|
|
1898
|
+
const named = [...code.matchAll(/export\s+(?:async\s+)?(?:function\b\s*(?:\*\s*)?|const\s+|let\s+)([A-Za-z_$][\w$]*)/g)].map((match) => match[1]);
|
|
1899
|
+
const listed = [...code.matchAll(/export\s*\{([^}]*)\}/g)].flatMap((match) => match[1].split(",").map((item) => item.trim().split(/\s+as\s+/).pop()).filter(Boolean));
|
|
1900
|
+
return [...named, ...listed].filter((name) => name !== "default");
|
|
1901
|
+
}
|
|
1902
|
+
function appNames(rootDir) {
|
|
1903
|
+
const components = /* @__PURE__ */ new Map();
|
|
1904
|
+
const composables = /* @__PURE__ */ new Map();
|
|
1905
|
+
const add = (names, name, file) => {
|
|
1906
|
+
if (!names.has(name)) names.set(name, relative(rootDir, file).split(sep).join("/"));
|
|
1907
|
+
};
|
|
1908
|
+
for (const base of ["app", "."]) {
|
|
1909
|
+
const componentsDir = join(rootDir, base, "components");
|
|
1910
|
+
for (const file of filesUnder(componentsDir, /\.vue$/)) add(components, componentName(file), join(componentsDir, file));
|
|
1911
|
+
for (const file of composableFiles(join(rootDir, base))) {
|
|
1912
|
+
for (const name of exportedNames(file)) add(composables, name, file);
|
|
1913
|
+
}
|
|
1914
|
+
}
|
|
1915
|
+
return { components, composables };
|
|
1916
|
+
}
|
|
1917
|
+
function composableFiles(srcDir) {
|
|
1918
|
+
return ["composables", "utils"].flatMap((folder) => {
|
|
1919
|
+
const dir = join(srcDir, folder);
|
|
1920
|
+
return filesUnder(dir, /\.(?:ts|js|mjs|mts)$/, 1).map((file) => file.replace(/\\/g, "/")).filter((file) => !file.includes("/") || /\/index\.\w+$/.test(file)).map((file) => join(dir, file));
|
|
1921
|
+
});
|
|
1922
|
+
}
|
|
1923
|
+
function nameCollisionFinding(rootDir, ours = packageNames()) {
|
|
1924
|
+
const app = appNames(rootDir);
|
|
1925
|
+
const shared = [
|
|
1926
|
+
...[...app.components].filter(([name]) => ours.components.has(name)).map(([name, file]) => `<${name}> (${file})`),
|
|
1927
|
+
...[...app.composables].filter(([name]) => ours.composables.has(name)).map(([name, file]) => `${name} (${file})`)
|
|
1928
|
+
];
|
|
1929
|
+
if (shared.length === 0) return finding("name-collisions", "pass", "No app component or composable shares a name with one of the package's.");
|
|
1930
|
+
return finding(
|
|
1931
|
+
"name-collisions",
|
|
1932
|
+
"pass",
|
|
1933
|
+
`The app's ${shared.join(", ")} share${shared.length === 1 ? "s" : ""} a name with one of the package's.`,
|
|
1934
|
+
"Nothing to do when you meant it: a same-named component is how a part is swapped. Rename yours otherwise."
|
|
1935
|
+
);
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1938
|
+
function children(node) {
|
|
1939
|
+
return Object.values(node).flatMap((value) => Array.isArray(value) ? value : [value]).filter((child) => typeof child === "object" && child !== null && typeof child.type === "string");
|
|
1940
|
+
}
|
|
1941
|
+
function keyOf(property) {
|
|
1942
|
+
const key = property.key;
|
|
1943
|
+
if (!key || property.computed) return void 0;
|
|
1944
|
+
return key.type === "Identifier" ? String(key.name) : key.type === "StringLiteral" ? String(key.value) : void 0;
|
|
1945
|
+
}
|
|
1946
|
+
function propertyOf(object, name) {
|
|
1947
|
+
return object.properties?.find((property) => property.type === "ObjectProperty" && keyOf(property) === name);
|
|
1948
|
+
}
|
|
1949
|
+
function* setupAccountCalls(node) {
|
|
1950
|
+
const callee = node.callee;
|
|
1951
|
+
if (node.type === "CallExpression" && callee?.type === "Identifier" && callee.name === "setupAccount") yield node;
|
|
1952
|
+
for (const child of children(node)) yield* setupAccountCalls(child);
|
|
1953
|
+
}
|
|
1954
|
+
function consentsOf(call) {
|
|
1955
|
+
const options = call.arguments?.[1];
|
|
1956
|
+
const consents = options?.type === "ObjectExpression" ? propertyOf(options, "consents")?.value : void 0;
|
|
1957
|
+
return consents?.type === "ObjectExpression" ? consents : void 0;
|
|
1958
|
+
}
|
|
1959
|
+
function isRequired(declaration) {
|
|
1960
|
+
const flag = propertyOf(declaration, "required")?.value;
|
|
1961
|
+
return flag?.type === "BooleanLiteral" && flag.value === true;
|
|
1962
|
+
}
|
|
1963
|
+
function lacksUrl(declaration) {
|
|
1964
|
+
const url = propertyOf(declaration, "url")?.value;
|
|
1965
|
+
return !url || url.type === "StringLiteral" && !String(url.value).trim();
|
|
1966
|
+
}
|
|
1967
|
+
function requiredConsentUrls(program) {
|
|
1968
|
+
for (const call of setupAccountCalls(program)) {
|
|
1969
|
+
const consents = consentsOf(call);
|
|
1970
|
+
if (!consents) continue;
|
|
1971
|
+
const declared = consents.properties.map((property) => ({ kind: property.type === "ObjectProperty" ? keyOf(property) : void 0, declaration: property.value })).filter((entry) => entry.kind !== void 0 && entry.declaration?.type === "ObjectExpression" && isRequired(entry.declaration));
|
|
1972
|
+
return { required: declared.map((entry) => entry.kind), withoutUrl: declared.filter((entry) => lacksUrl(entry.declaration)).map((entry) => entry.kind) };
|
|
1973
|
+
}
|
|
1974
|
+
return null;
|
|
1975
|
+
}
|
|
1976
|
+
async function consentFindings(rootDir, { prod }) {
|
|
1977
|
+
const file = join(rootDir, "backend", "account.ts");
|
|
1978
|
+
if (!prod || !existsSync(file)) return [];
|
|
1979
|
+
let read;
|
|
1980
|
+
try {
|
|
1981
|
+
const magicast = await import('magicast');
|
|
1982
|
+
read = requiredConsentUrls(magicast.parseModule(readFileSync(file, "utf8")).$ast);
|
|
1983
|
+
} catch {
|
|
1984
|
+
return [];
|
|
1985
|
+
}
|
|
1986
|
+
if (!read || read.required.length === 0) return [];
|
|
1987
|
+
if (read.withoutUrl.length === 0) return [finding("consent-urls", "pass", `Every required consent (${read.required.join(", ")}) links its document.`)];
|
|
1988
|
+
return [finding(
|
|
1989
|
+
"consent-urls",
|
|
1990
|
+
"warn",
|
|
1991
|
+
`The required consent${read.withoutUrl.length === 1 ? "" : "s"} ${read.withoutUrl.join(", ")} ${read.withoutUrl.length === 1 ? "has" : "have"} no \`url\`, so the agreement line on the sign-up form and the prompt that asks again point nowhere.`,
|
|
1992
|
+
"Add the page of the document as the kind's `url` in `setupAccount({ consents })` (backend/account.ts), such as `/terms`."
|
|
1993
|
+
)];
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1996
|
+
async function probeProof(siteUrl, secret, basePath = DEFAULT_AUTH_ROUTE) {
|
|
1997
|
+
const path = `${basePath.replace(/\/+$/, "")}${PROTECTED_AUTH_ROUTES[0]}`;
|
|
1998
|
+
try {
|
|
1999
|
+
const response = await fetch(`${siteUrl.replace(/\/+$/, "")}${path}`, {
|
|
2000
|
+
method: "POST",
|
|
2001
|
+
headers: { "content-type": "application/json", [PROOF_HEADER]: await signProof(secret, { method: "POST", path, audience: proofAudience(siteUrl) }) },
|
|
2002
|
+
body: "{}",
|
|
2003
|
+
signal: AbortSignal.timeout(5e3)
|
|
2004
|
+
});
|
|
2005
|
+
if (response.status === 404) return "unreachable";
|
|
2006
|
+
const body = await response.json().catch(() => null);
|
|
2007
|
+
return response.status === 403 && body?.reason === "bot_check" ? "refused" : "accepted";
|
|
2008
|
+
} catch {
|
|
2009
|
+
return "unreachable";
|
|
2010
|
+
}
|
|
2011
|
+
}
|
|
2012
|
+
const pushHint = (name, prod) => prod ? `Set production's own value on the deployment: \`npx convex env set --prod ${name}\` (it asks for the value).` : `Add ${name} to .env.local and run \`npx nuxt-backend env push\`.`;
|
|
2013
|
+
const PROD_SECRET_HINT = "Generate production's own with `openssl rand -base64 32`, then set it on the deployment (`npx convex env set --prod PROTECTION_PROOF_SECRET`, which asks for it) and in the app host's production env (`vercel env add PROTECTION_PROOF_SECRET production`).";
|
|
2014
|
+
const onDeployment = (input, name) => input.deployed?.includes(name) === true;
|
|
2015
|
+
function presenceFindings(input) {
|
|
2016
|
+
if (!input.deployed) return [];
|
|
2017
|
+
return ["PROTECTION_PROOF_SECRET", "PROTECTION_CHALLENGE_SECRET_KEY"].map((name) => {
|
|
2018
|
+
const id = deploymentEnvId(name);
|
|
2019
|
+
if (onDeployment(input, name)) return finding(id, "pass", `${name} is set on the deployment.`);
|
|
2020
|
+
if (!input.prod && input.env[name]) return finding(id, "warn", `${name} is set here but not on the deployment, which checks none of what it signs or answers.`, pushHint(name, false));
|
|
2021
|
+
return finding(id, "pass", `${name} is not set: the deployment takes no ${name === "PROTECTION_PROOF_SECRET" ? "proof" : "challenge answer"}.`);
|
|
2022
|
+
});
|
|
2023
|
+
}
|
|
2024
|
+
function liveFinding(input) {
|
|
2025
|
+
const proof = onDeployment(input, "PROTECTION_PROOF_SECRET");
|
|
2026
|
+
const challenge = onDeployment(input, "PROTECTION_CHALLENGE_SECRET_KEY");
|
|
2027
|
+
if (input.prod && !input.deployed) return finding("bot-protection", "warn", "Production's env names could not be read, so whether a bot check is live is unknown.", "Check access to the production deployment, then run `npx nuxt-backend doctor --prod` again.");
|
|
2028
|
+
const takes = protectionTakes(proof, challenge);
|
|
2029
|
+
if (input.prod && proof && !challenge && !input.vercel) {
|
|
2030
|
+
return finding("bot-protection", "warn", "Production takes proofs only, which the app's server signs after BotID passes, and nothing here says the app runs on Vercel: off Vercel no proof is signed, and every sign-in code request is refused.", "On Vercel, link the project here (`vercel link`) and run doctor again. Elsewhere, set the challenge keys (NUXT_PUBLIC_BACKEND_CHALLENGE_SITE_KEY for the app, PROTECTION_CHALLENGE_SECRET_KEY on the deployment), or remove PROTECTION_PROOF_SECRET from the deployment.");
|
|
2031
|
+
}
|
|
2032
|
+
if (takes) return finding("bot-protection", "pass", `The sign-in code requests take ${takes}.`);
|
|
2033
|
+
if (input.prod) {
|
|
2034
|
+
return finding("bot-protection", "warn", "No bot protection is live on production: a script can request sign-in codes and create accounts as fast as the rate limits allow.", "On Vercel: set production's own PROTECTION_PROOF_SECRET in the app's env and on the deployment. Elsewhere: set NUXT_PUBLIC_BACKEND_CHALLENGE_SITE_KEY for the app and PROTECTION_CHALLENGE_SECRET_KEY on the deployment.");
|
|
2035
|
+
}
|
|
2036
|
+
return finding("bot-protection", "pass", input.local ? "Test mode: on this machine the bot check answers human, as BotID does in development." : "No bot check on this development deployment; production needs one (doctor --prod says so).");
|
|
2037
|
+
}
|
|
2038
|
+
function oneSidedProofFinding(input, here) {
|
|
2039
|
+
if (here) {
|
|
2040
|
+
if (!input.deployed) return [];
|
|
2041
|
+
return [finding("protection-proof", "warn", "The app's server signs proofs the deployment ignores: it has no PROTECTION_PROOF_SECRET, so anyone who calls its own URL skips the bot check.", pushHint("PROTECTION_PROOF_SECRET", input.prod))];
|
|
2042
|
+
}
|
|
2043
|
+
if (input.prod) {
|
|
2044
|
+
return [finding("protection-proof", "warn", "Production takes proofs, and the app's server env is not visible here: doctor cannot check that the two hold the same PROTECTION_PROOF_SECRET.", "Run `npx nuxt-backend doctor --prod` with production's PROTECTION_PROOF_SECRET in the env (`vercel env pull`), or compare the two by hand.")];
|
|
2045
|
+
}
|
|
2046
|
+
const challenge = onDeployment(input, "PROTECTION_CHALLENGE_SECRET_KEY");
|
|
2047
|
+
return [finding(
|
|
2048
|
+
"protection-proof",
|
|
2049
|
+
challenge ? "warn" : "fail",
|
|
2050
|
+
`The deployment takes proofs, and the dev server has no PROTECTION_PROOF_SECRET to sign them: every sign-in code request${challenge ? " without a challenge answer" : ""} is refused.`,
|
|
2051
|
+
"Set the same PROTECTION_PROOF_SECRET in .env.local, or remove it from the deployment."
|
|
2052
|
+
)];
|
|
2053
|
+
}
|
|
2054
|
+
function sharesDevSecret(input, here) {
|
|
2055
|
+
const dev = input.prod ? input.devEnv?.PROTECTION_PROOF_SECRET : void 0;
|
|
2056
|
+
if (!dev) return false;
|
|
2057
|
+
const devKeys = new Set(proofKeys(dev));
|
|
2058
|
+
return proofKeys(here).some((key) => devKeys.has(key));
|
|
2059
|
+
}
|
|
2060
|
+
async function probedProofFinding(input, secret) {
|
|
2061
|
+
if (!input.siteUrl) return [];
|
|
2062
|
+
const probe = await probeProof(input.siteUrl, secret);
|
|
2063
|
+
if (probe === "accepted") {
|
|
2064
|
+
return [sharesDevSecret(input, secret) ? finding("protection-proof", "warn", "Production holds the same PROTECTION_PROOF_SECRET as .env.local: a proof names its deployment, but a leaked .env.local now leaks production's secret.", PROD_SECRET_HINT) : finding("protection-proof", "pass", "The deployment takes the proofs signed with the PROTECTION_PROOF_SECRET here.")];
|
|
2065
|
+
}
|
|
2066
|
+
if (probe === "refused") {
|
|
2067
|
+
return [finding("protection-proof", "fail", `The deployment refuses the proofs signed with the PROTECTION_PROOF_SECRET here: the two secrets differ, or the deployment's own CONVEX_SITE_URL is not ${input.siteUrl}, the site the app forwards to and a proof names. Every sign-in code request is refused.`, input.prod ? PROD_SECRET_HINT : "Set one value on both sides: in .env.local and with `npx nuxt-backend env push --force PROTECTION_PROOF_SECRET`. With a custom domain, make it the deployment's own site URL in the Convex dashboard.")];
|
|
2068
|
+
}
|
|
2069
|
+
return [finding("protection-proof", "warn", "The deployment's auth routes did not answer the proof probe (offline, not running, or a custom auth base path).", "Run `npx convex dev` (or deploy), then re-run doctor.")];
|
|
2070
|
+
}
|
|
2071
|
+
async function proofFinding(input) {
|
|
2072
|
+
const here = input.env.PROTECTION_PROOF_SECRET;
|
|
2073
|
+
const there = onDeployment(input, "PROTECTION_PROOF_SECRET");
|
|
2074
|
+
if (!here && !there) return [];
|
|
2075
|
+
if (here && proofKeys(here).some((key) => key.length < 32)) {
|
|
2076
|
+
return [finding("protection-proof", "warn", "PROTECTION_PROOF_SECRET is shorter than 32 characters.", "Generate one with `openssl rand -base64 32`, and set it on both sides.")];
|
|
2077
|
+
}
|
|
2078
|
+
return here && there ? probedProofFinding(input, here) : oneSidedProofFinding(input, here);
|
|
2079
|
+
}
|
|
2080
|
+
function onTestKeys(input) {
|
|
2081
|
+
return TEST_CHALLENGE_SITE_KEYS.includes(input.env.NUXT_PUBLIC_BACKEND_CHALLENGE_SITE_KEY ?? "") || TEST_CHALLENGE_SECRET_KEYS.includes(input.env.PROTECTION_CHALLENGE_SECRET_KEY ?? "");
|
|
2082
|
+
}
|
|
2083
|
+
function oneKeyFinding(input, siteKey) {
|
|
2084
|
+
if (siteKey) {
|
|
2085
|
+
if (!input.deployed) return [];
|
|
2086
|
+
return [finding("protection-challenge-keys", "warn", "The app shows a challenge, and the deployment verifies none of its answers: PROTECTION_CHALLENGE_SECRET_KEY is not set there.", pushHint("PROTECTION_CHALLENGE_SECRET_KEY", input.prod))];
|
|
2087
|
+
}
|
|
2088
|
+
if (input.prod) {
|
|
2089
|
+
return [finding("protection-challenge-keys", "warn", "Production verifies challenge answers, and the app's env is not visible here: doctor cannot check that it shows a widget, or that its keys are not the provider's test keys.", "Run `npx nuxt-backend doctor --prod` with NUXT_PUBLIC_BACKEND_CHALLENGE_SITE_KEY in the env (`vercel env pull`), or check the app host's env by hand.")];
|
|
2090
|
+
}
|
|
2091
|
+
const proof = onDeployment(input, "PROTECTION_PROOF_SECRET");
|
|
2092
|
+
return [finding(
|
|
2093
|
+
"protection-challenge-keys",
|
|
2094
|
+
proof ? "warn" : "fail",
|
|
2095
|
+
`The deployment asks for a challenge answer, and the app shows no challenge (NUXT_PUBLIC_BACKEND_CHALLENGE_SITE_KEY is not set): every sign-in code request${proof ? " without a proof" : ""} is refused.`,
|
|
2096
|
+
"Set NUXT_PUBLIC_BACKEND_CHALLENGE_SITE_KEY to the widget's site key, or remove PROTECTION_CHALLENGE_SECRET_KEY from the deployment."
|
|
2097
|
+
)];
|
|
2098
|
+
}
|
|
2099
|
+
function challengeFinding(input) {
|
|
2100
|
+
const siteKey = input.env.NUXT_PUBLIC_BACKEND_CHALLENGE_SITE_KEY;
|
|
2101
|
+
const there = onDeployment(input, "PROTECTION_CHALLENGE_SECRET_KEY");
|
|
2102
|
+
if (!siteKey && !there) return [];
|
|
2103
|
+
if (input.prod && onTestKeys(input)) {
|
|
2104
|
+
return [finding("protection-challenge-keys", "fail", "Production runs the challenge on the provider's test keys, which answer the same for everyone.", "Create a widget in the provider's dashboard and set its site key and secret key.")];
|
|
2105
|
+
}
|
|
2106
|
+
if (!siteKey || !there) return oneKeyFinding(input, siteKey);
|
|
2107
|
+
return [finding("protection-challenge-keys", "pass", TEST_CHALLENGE_SITE_KEYS.includes(siteKey) ? "The challenge runs on the provider's test site key: test mode." : "The app shows a challenge, and the deployment verifies its answers.")];
|
|
2108
|
+
}
|
|
2109
|
+
function waitlistFinding(input) {
|
|
2110
|
+
if (!input.waitlist || !input.prod) return [];
|
|
2111
|
+
if (!input.deployed) return [finding("waitlist-bot-check", "warn", "The app has a waitlist, and production's env names could not be read, so whether its join is checked for bots is unknown.", "Check access to the production deployment, then run `npx nuxt-backend doctor --prod' again.")];
|
|
2112
|
+
if (onDeployment(input, "PROTECTION_PROOF_SECRET") || onDeployment(input, "PROTECTION_CHALLENGE_SECRET_KEY")) {
|
|
2113
|
+
return [finding("waitlist-bot-check", "pass", "The waitlist's join is checked for bots: the deployment verifies a proof or a challenge answer.")];
|
|
2114
|
+
}
|
|
2115
|
+
return [finding("waitlist-bot-check", "warn", "The app has a waitlist and nothing checks who joins: a script can fill it with addresses as fast as the rate limits allow, and each address costs a sign-in code.", "On Vercel: set production's own PROTECTION_PROOF_SECRET in the app's env and on the deployment. Elsewhere: set NUXT_PUBLIC_BACKEND_CHALLENGE_SITE_KEY for the app and PROTECTION_CHALLENGE_SECRET_KEY on the deployment.")];
|
|
2116
|
+
}
|
|
2117
|
+
function contactFinding(input) {
|
|
2118
|
+
if (!input.contact || !input.prod) return [];
|
|
2119
|
+
if (!input.deployed) return [finding("contact-bot-check", "warn", "The app has a contact form, and production's env names could not be read, so whether it is open is unknown.", "Check access to the production deployment, then run `npx nuxt-backend doctor --prod' again.")];
|
|
2120
|
+
if (onDeployment(input, "PROTECTION_PROOF_SECRET") || onDeployment(input, "PROTECTION_CHALLENGE_SECRET_KEY")) {
|
|
2121
|
+
return [finding("contact-bot-check", "pass", "The contact form is checked for bots: the deployment verifies a proof or a challenge answer.")];
|
|
2122
|
+
}
|
|
2123
|
+
return [finding("contact-bot-check", "warn", "The app has a contact form and production checks no one, so the form is refused: a message never reaches the team.", "On Vercel: set production's own PROTECTION_PROOF_SECRET in the app's env and on the deployment. Elsewhere: set NUXT_PUBLIC_BACKEND_CHALLENGE_SITE_KEY for the app and PROTECTION_CHALLENGE_SECRET_KEY on the deployment.")];
|
|
2124
|
+
}
|
|
2125
|
+
async function protectionFindings(input) {
|
|
2126
|
+
return [
|
|
2127
|
+
liveFinding(input),
|
|
2128
|
+
...await proofFinding(input),
|
|
2129
|
+
...challengeFinding(input),
|
|
2130
|
+
...waitlistFinding(input),
|
|
2131
|
+
...contactFinding(input),
|
|
2132
|
+
...presenceFindings(input)
|
|
2133
|
+
];
|
|
2134
|
+
}
|
|
2135
|
+
|
|
2136
|
+
function isReadout(value) {
|
|
2137
|
+
return typeof value === "object" && value !== null && ["full", "sending", "refused", "unreachable"].includes(value.access);
|
|
2138
|
+
}
|
|
2139
|
+
function isEmailPosture(value) {
|
|
2140
|
+
if (typeof value !== "object" || value === null) return false;
|
|
2141
|
+
const { sender, provider } = value;
|
|
2142
|
+
const senderOk = sender === "unset" || sender === "malformed" || typeof sender === "object" && sender !== null && typeof sender.domain === "string";
|
|
2143
|
+
return senderOk && (provider === null || isReadout(provider));
|
|
2144
|
+
}
|
|
2145
|
+
const EMAIL_POSTURE_TIMEOUT_MS = 6e4;
|
|
2146
|
+
async function readEmailPosture(rootDir) {
|
|
2147
|
+
try {
|
|
2148
|
+
const { stdout } = await runConvex(rootDir, ["run", "--prod", "--component", "backend", "posture:email"], { timeout: EMAIL_POSTURE_TIMEOUT_MS });
|
|
2149
|
+
const parsed = JSON.parse(stdout);
|
|
2150
|
+
return isEmailPosture(parsed) ? parsed : "unread";
|
|
2151
|
+
} catch {
|
|
2152
|
+
return "unread";
|
|
2153
|
+
}
|
|
2154
|
+
}
|
|
2155
|
+
async function readListed(names, name, wanted, read) {
|
|
2156
|
+
if (!wanted || !names.includes(name)) return "unset";
|
|
2157
|
+
return await read() ?? "unread";
|
|
2158
|
+
}
|
|
2159
|
+
async function readProductionPosture(rootDir, names, wants) {
|
|
2160
|
+
const target = { prod: true };
|
|
2161
|
+
const probes = ["auth", "site", "monitoring"].some(wants);
|
|
2162
|
+
const [environment, siteOrigin, email] = await Promise.all([
|
|
2163
|
+
readListed(names, "BACKEND_ENVIRONMENT", ["deployment", "email", "billing"].some(wants), () => deploymentBackendEnvironment(rootDir, target)),
|
|
2164
|
+
readListed(names, "SITE_URL", probes, () => deploymentSiteOrigin(rootDir, target)),
|
|
2165
|
+
wants("email") ? readEmailPosture(rootDir) : "unset"
|
|
2166
|
+
]);
|
|
2167
|
+
return { environment, siteOrigin, email };
|
|
2168
|
+
}
|
|
2169
|
+
function environmentFinding(posture) {
|
|
2170
|
+
const environment = posture.environment;
|
|
2171
|
+
switch (environment) {
|
|
2172
|
+
case "production":
|
|
2173
|
+
return finding("deployment-backend-environment", "pass", "BACKEND_ENVIRONMENT is production: mail reaches real inboxes and billing bills live.");
|
|
2174
|
+
case "sandbox":
|
|
2175
|
+
return finding("deployment-backend-environment", "warn", "BACKEND_ENVIRONMENT is sandbox on production, on purpose: it runs in production mode on the providers' test modes, so mail reaches only the email provider's test addresses and checkout takes test cards, and nobody pays.", "For a live product: verify the sending domain, run npx nuxt-backend billing sync --env production, then npx convex env set --prod BACKEND_ENVIRONMENT production");
|
|
2176
|
+
case "development":
|
|
2177
|
+
case "preview":
|
|
2178
|
+
return finding("deployment-backend-environment", "fail", `BACKEND_ENVIRONMENT is ${environment} on production: every provider stays in its test mode${environment === "development" ? ", local origins are trusted and sign-in codes are logged" : ""}.`, "Set it: npx convex env set --prod BACKEND_ENVIRONMENT production (npx nuxt-backend env push --prod --force BACKEND_ENVIRONMENT derives it).");
|
|
2179
|
+
case "unread":
|
|
2180
|
+
return finding("deployment-backend-environment", "warn", "BACKEND_ENVIRONMENT is set on production, and its value could not be read as development, preview, sandbox or production: the backend keeps every provider in its test mode on any other value.", "Check it: npx convex env get --prod BACKEND_ENVIRONMENT");
|
|
2181
|
+
default:
|
|
2182
|
+
return finding("deployment-backend-environment", "fail", "BACKEND_ENVIRONMENT is not set on production, so every provider stays in its test mode: mail reaches only the email provider's test addresses, checkout takes test cards, and nobody else can get a sign-in code.", "Run npx nuxt-backend env push --prod: it derives production. A deliberate demo or staging app sets it to sandbox instead, which doctor reports as a warning.");
|
|
2183
|
+
}
|
|
2184
|
+
}
|
|
2185
|
+
function senderFinding(set, posture) {
|
|
2186
|
+
if (set) {
|
|
2187
|
+
const sender = typeof posture.email === "object" ? posture.email.sender : null;
|
|
2188
|
+
return finding("deployment-email-from", "pass", typeof sender === "object" && sender ? `EMAIL_FROM is set on production: mail comes from ${sender.domain}.` : "EMAIL_FROM is set on production.");
|
|
2189
|
+
}
|
|
2190
|
+
if (posture.environment === "sandbox") {
|
|
2191
|
+
return finding("deployment-email-from", "warn", "EMAIL_FROM is not set on production: in this deliberate sandbox, mail comes from the email provider's onboarding address.", 'Before going live: npx convex env set --prod EMAIL_FROM "Acme <hello@acme.com>", an address on your verified domain.');
|
|
2192
|
+
}
|
|
2193
|
+
return finding("deployment-email-from", "fail", "EMAIL_FROM is not set on production: mail comes from the email provider's onboarding address, which delivers only to its test addresses and the account owner, so sign-in codes, invitations and gifts to anyone else are refused.", 'Set a sender on your verified domain: npx convex env set --prod EMAIL_FROM "Acme <hello@acme.com>"');
|
|
2194
|
+
}
|
|
2195
|
+
function productionEnvFinding(name, deployed, posture) {
|
|
2196
|
+
if (name === "BACKEND_ENVIRONMENT") return environmentFinding(posture);
|
|
2197
|
+
if (name === "EMAIL_FROM") return senderFinding(deployed.includes(name), posture);
|
|
2198
|
+
return null;
|
|
2199
|
+
}
|
|
2200
|
+
const INBOX_ENVIRONMENTS = /* @__PURE__ */ new Set(["development", "preview", "sandbox"]);
|
|
2201
|
+
function devInboxFinding({ prod, posture, set = true }) {
|
|
2202
|
+
const environment = posture?.environment;
|
|
2203
|
+
if (!set) {
|
|
2204
|
+
return finding(
|
|
2205
|
+
"deployment-email-dev-inbox",
|
|
2206
|
+
"warn",
|
|
2207
|
+
"The backend re-exports getSandboxInbox and production's BACKEND_ENVIRONMENT is sandbox, but EMAIL_DEV_INBOX is not set: the dev inbox answers nothing, so a visitor of the demo reads no sign-in code.",
|
|
2208
|
+
`Set it on purpose: npx convex env set${prod ? " --prod" : ""} EMAIL_DEV_INBOX 1`
|
|
2209
|
+
);
|
|
2210
|
+
}
|
|
2211
|
+
if (environment === "production" || prod && !INBOX_ENVIRONMENTS.has(environment)) {
|
|
2212
|
+
return finding(
|
|
2213
|
+
"deployment-email-dev-inbox",
|
|
2214
|
+
"warn",
|
|
2215
|
+
`EMAIL_DEV_INBOX is set on ${environment === "production" ? "a deployment whose BACKEND_ENVIRONMENT is production" : "production"}: the dev inbox answers nothing there, and the variable says it would.`,
|
|
2216
|
+
`Remove it: npx convex env remove${prod ? " --prod" : ""} EMAIL_DEV_INBOX`
|
|
2217
|
+
);
|
|
2218
|
+
}
|
|
2219
|
+
return finding("deployment-email-dev-inbox", "pass", `EMAIL_DEV_INBOX is set${typeof environment === "string" && INBOX_ENVIRONMENTS.has(environment) ? ` on a ${environment} deployment` : ""}: pages read the dev inbox of test addresses through getSandboxInbox.`);
|
|
2220
|
+
}
|
|
2221
|
+
function siteOriginFinding(posture) {
|
|
2222
|
+
const site = posture.siteOrigin;
|
|
2223
|
+
if (site === "unset") return [];
|
|
2224
|
+
if (site === "unread") return [finding("site-url-origin", "warn", "SITE_URL is set on production, and its value could not be read, so the live site was not probed.", "Check it: npx convex env get --prod SITE_URL")];
|
|
2225
|
+
const hint = "Set the app's public origin: npx convex env set --prod SITE_URL https://app.example.com";
|
|
2226
|
+
if (site === "malformed") return [finding("site-url-origin", "fail", "SITE_URL on production is not an http(s) URL: auth trusts no browser origin, and every emailed link is broken.", hint)];
|
|
2227
|
+
if (isLoopbackUrl(site.origin)) {
|
|
2228
|
+
return [finding("site-url-origin", "fail", `SITE_URL on production is ${site.origin}, an origin on this machine (a dev default): emailed links and the one trusted browser origin point there.`, hint)];
|
|
2229
|
+
}
|
|
2230
|
+
if (!site.origin.startsWith("https:")) {
|
|
2231
|
+
return [finding("site-url-origin", "fail", `SITE_URL on production is ${site.origin}, not HTTPS: browsers keep passkeys and secure cookies from a plain HTTP origin.`, hint)];
|
|
2232
|
+
}
|
|
2233
|
+
return [finding("site-url-origin", "pass", `SITE_URL on production is ${site.origin}: the live probes check that site.`)];
|
|
2234
|
+
}
|
|
2235
|
+
function probedOrigin(posture) {
|
|
2236
|
+
const site = posture.siteOrigin;
|
|
2237
|
+
return typeof site === "object" && site.origin.startsWith("https:") && !isLoopbackUrl(site.origin) ? site.origin : null;
|
|
2238
|
+
}
|
|
2239
|
+
const SITE_URL_HINT = "Set production's public origin: npx convex env set --prod SITE_URL https://app.example.com (npx nuxt-backend doctor --prod --only auth says more).";
|
|
2240
|
+
function unprobedReason(posture) {
|
|
2241
|
+
if (!posture) return { why: "Production's env names could not be read", fixHint: "Check that npx convex env list --prod runs here (CONVEX_DEPLOY_KEY), then run npx nuxt-backend doctor --prod again." };
|
|
2242
|
+
const site = posture.siteOrigin;
|
|
2243
|
+
if (site === "unset") return { why: "SITE_URL is not set on production", fixHint: SITE_URL_HINT };
|
|
2244
|
+
if (site === "unread") return { why: "SITE_URL is set on production, and its value could not be read", fixHint: "Check it: npx convex env get --prod SITE_URL" };
|
|
2245
|
+
if (site === "malformed") return { why: "SITE_URL on production is not an http(s) URL", fixHint: SITE_URL_HINT };
|
|
2246
|
+
if (isLoopbackUrl(site.origin)) return { why: `SITE_URL on production is ${site.origin}, an origin on this machine`, fixHint: SITE_URL_HINT };
|
|
2247
|
+
if (!site.origin.startsWith("https:")) return { why: `SITE_URL on production is ${site.origin}, not HTTPS`, fixHint: SITE_URL_HINT };
|
|
2248
|
+
return null;
|
|
2249
|
+
}
|
|
2250
|
+
function accessFinding(domain, readout) {
|
|
2251
|
+
const reason = readout.reason ? ` (${readout.reason})` : "";
|
|
2252
|
+
if (readout.access === "sending") {
|
|
2253
|
+
return finding("email-sender-domain", "warn", `Production's EMAIL_API_KEY may only send, so doctor cannot read whether ${domain} is verified, nor the last week's bounces and the quota.`, "Check the domain in the email provider's dashboard, or give production a full-access key.");
|
|
2254
|
+
}
|
|
2255
|
+
if (readout.access === "refused") {
|
|
2256
|
+
return finding("email-sender-domain", "fail", `The email provider refused production's EMAIL_API_KEY${reason}: it was deleted, deactivated or suspended, and nothing is sent with it.`, "Create a key in the email provider's dashboard and set it: npx convex env set --prod EMAIL_API_KEY (it asks for the value).");
|
|
2257
|
+
}
|
|
2258
|
+
return finding("email-sender-domain", "warn", `The email provider did not answer production's read${reason}, so whether ${domain} is verified is unknown.`, "Run npx nuxt-backend doctor --prod again later.");
|
|
2259
|
+
}
|
|
2260
|
+
function domainFinding(domain, found) {
|
|
2261
|
+
if (found === void 0) return finding("email-sender-domain", "warn", `${domain} was not found among the first domains the email provider listed, so whether it is verified is unknown.`, "Check it in the email provider's dashboard.");
|
|
2262
|
+
const fix = `Verify ${domain} in the email provider's dashboard (publish the DNS records it lists), or set EMAIL_FROM to an address on a verified domain.`;
|
|
2263
|
+
if (found === "absent") return finding("email-sender-domain", "fail", `${domain} is not a domain of the email provider account production's key belongs to: every send from it is refused.`, fix);
|
|
2264
|
+
if (!found.sending) return finding("email-sender-domain", "fail", `Sending from ${domain} is turned off at the email provider: every send from it is refused.`, `Turn sending on for ${domain} in the email provider's dashboard.`);
|
|
2265
|
+
if (found.status === "verified") return finding("email-sender-domain", "pass", `${domain} is verified with the email provider.`);
|
|
2266
|
+
if (found.status === "partially_verified" || found.status === "temporary_failure") {
|
|
2267
|
+
return finding("email-sender-domain", "warn", `${domain} is ${found.status.replace(/_/g, " ")} at the email provider: mail goes out, but a DNS record it checks is missing.`, `Fix the record the dashboard flags for ${domain}.`);
|
|
2268
|
+
}
|
|
2269
|
+
return finding("email-sender-domain", "fail", `${domain} is ${found.status.replace(/_/g, " ")} at the email provider, not verified: it refuses mail from it.`, fix);
|
|
2270
|
+
}
|
|
2271
|
+
const EMAIL_LIMITS = { bounce: 0.04, complaint: 8e-4 };
|
|
2272
|
+
const RATE_VOLUME = 100;
|
|
2273
|
+
const percent = (rate) => `${Number((rate * 100).toFixed(rate < 0.01 ? 3 : 2))}%`;
|
|
2274
|
+
function reputationFinding(readout) {
|
|
2275
|
+
const week = readout.week;
|
|
2276
|
+
if (!week) return [];
|
|
2277
|
+
if (week.sent === 0) return [finding("email-reputation", "pass", "Nothing was sent in the last 7 days.")];
|
|
2278
|
+
const bounce = week.bounced / week.sent;
|
|
2279
|
+
const complaint = week.delivered > 0 ? week.complained / week.delivered : 0;
|
|
2280
|
+
const summary = `Last 7 days: ${week.sent} sent, a bounce rate of ${percent(bounce)} (the provider's limit is ${percent(EMAIL_LIMITS.bounce)}) and a complaint rate of ${percent(complaint)} (limit ${percent(EMAIL_LIMITS.complaint)})`;
|
|
2281
|
+
const over = bounce >= EMAIL_LIMITS.bounce || complaint >= EMAIL_LIMITS.complaint;
|
|
2282
|
+
const near = bounce >= EMAIL_LIMITS.bounce / 2 || complaint >= EMAIL_LIMITS.complaint / 2;
|
|
2283
|
+
if (!near) return [finding("email-reputation", "pass", `${summary}.`)];
|
|
2284
|
+
const hint = "Find the cause in the email provider's dashboard: addresses that no longer exist, or sign-ups by bots (turn on bot protection), then send less until the rates fall.";
|
|
2285
|
+
if (over && week.sent >= RATE_VOLUME) return [finding("email-reputation", "fail", `${summary}: above the limit, the provider may pause the account's sending, sign-in codes included.`, hint)];
|
|
2286
|
+
return [finding("email-reputation", "warn", `${summary}${over ? ": above the limit, on few sends" : ": close to the limit"}.`, hint)];
|
|
2287
|
+
}
|
|
2288
|
+
function quotaFinding(readout) {
|
|
2289
|
+
const quota = readout.quota;
|
|
2290
|
+
if (!quota) return [];
|
|
2291
|
+
const month = quota.monthly !== void 0 ? `, ${quota.monthly} this month` : "";
|
|
2292
|
+
if (quota.daily !== void 0) {
|
|
2293
|
+
return [finding("email-quota", "warn", `The email provider account has a daily sending quota (the free plan's): ${quota.daily} used today${month}. Once it is reached, every send stops until midnight UTC, sign-in codes included.`, "Move the account to a paid plan before launch: its quota is monthly only.")];
|
|
2294
|
+
}
|
|
2295
|
+
return [finding("email-quota", "pass", `The email provider account has no daily quota${quota.monthly !== void 0 ? `: ${quota.monthly} sent this month` : ""}.`)];
|
|
2296
|
+
}
|
|
2297
|
+
function emailPostureFindings(posture) {
|
|
2298
|
+
const email = posture.email;
|
|
2299
|
+
if (email === "unset") return [];
|
|
2300
|
+
if (email === "unread") {
|
|
2301
|
+
return [finding("email-sender-domain", "warn", "Production did not report its email posture: it runs a release without posture:email, or the Convex CLI could not run it here (no access to production, or it timed out).", "Deploy the current version if production runs an older one (npx convex deploy), then run npx nuxt-backend doctor --prod again.")];
|
|
2302
|
+
}
|
|
2303
|
+
if (email.sender === "unset" || !email.provider) return [];
|
|
2304
|
+
if (email.sender === "malformed") {
|
|
2305
|
+
return [finding("email-sender-domain", "fail", "EMAIL_FROM on production holds no address: the email provider refuses every send.", 'Set it to a sender such as "Acme <hello@acme.com>": npx convex env set --prod EMAIL_FROM')];
|
|
2306
|
+
}
|
|
2307
|
+
const { domain } = email.sender;
|
|
2308
|
+
const readout = email.provider;
|
|
2309
|
+
if (readout.access !== "full") return [accessFinding(domain, readout)];
|
|
2310
|
+
return [domainFinding(domain, readout.domain), ...reputationFinding(readout), ...quotaFinding(readout)];
|
|
2311
|
+
}
|
|
2312
|
+
|
|
2313
|
+
const PROBE_TIMEOUT_MS = 8e3;
|
|
2314
|
+
const HSTS_MIN_AGE = 86400;
|
|
2315
|
+
async function probe(url, init = {}, fetcher = fetch) {
|
|
2316
|
+
try {
|
|
2317
|
+
return await fetcher(url, { redirect: "manual", ...init, signal: AbortSignal.timeout(PROBE_TIMEOUT_MS) });
|
|
2318
|
+
} catch {
|
|
2319
|
+
return null;
|
|
2320
|
+
}
|
|
2321
|
+
}
|
|
2322
|
+
async function textOf(response) {
|
|
2323
|
+
return response.text().catch(() => "");
|
|
2324
|
+
}
|
|
2325
|
+
async function jsonOf(response) {
|
|
2326
|
+
const body = await response.json().catch(() => null);
|
|
2327
|
+
return typeof body === "object" && body !== null && !Array.isArray(body) ? body : null;
|
|
2328
|
+
}
|
|
2329
|
+
function hstsMaxAge(header) {
|
|
2330
|
+
const match = header ? /max-age\s*=\s*"?(\d+)"?/i.exec(header) : null;
|
|
2331
|
+
return match ? Number(match[1]) : null;
|
|
2332
|
+
}
|
|
2333
|
+
function httpsFinding(origin, root) {
|
|
2334
|
+
const landed = root.url ? new URL(root.url).origin : origin;
|
|
2335
|
+
if (landed.startsWith("http:")) {
|
|
2336
|
+
return finding("site-https", "fail", `${landed === origin ? `${origin} is served` : `${origin} redirects to ${landed}`} over plain HTTP: sessions and sign-in codes cross the network in the clear.`, `Serve the app over HTTPS at ${origin}, and drop any redirect to plain HTTP (the app host's or a proxy's).`);
|
|
2337
|
+
}
|
|
2338
|
+
if (landed !== origin) return finding("site-https", "warn", `${origin} redirects to ${landed}: the browser lands on an origin auth does not trust, and passkeys and sessions belong to the other.`, `Set SITE_URL to the origin that serves the app (${landed}), or serve it at ${origin}.`);
|
|
2339
|
+
if (root.status >= 500) return finding("site-https", "warn", `${origin} answered ${root.status}.`, "Check the app host's logs.");
|
|
2340
|
+
const age = hstsMaxAge(root.headers.get("strict-transport-security"));
|
|
2341
|
+
if (age === null) return finding("site-https", "warn", `${origin} answers over HTTPS without HSTS (Strict-Transport-Security): a browser may still try plain HTTP first.`, "Keep the security headers on (nuxt-security, which the module registers): `security: false`, or a headers option of your own, turned them off.");
|
|
2342
|
+
if (age < HSTS_MIN_AGE) return finding("site-https", "warn", `${origin} sends HSTS with a max-age of ${age} seconds: browsers forget it within a day.`, "Give Strict-Transport-Security a max-age of months: the security headers' default is 180 days.");
|
|
2343
|
+
return finding("site-https", "pass", `${origin} answers over HTTPS with HSTS (max-age ${age} seconds).`);
|
|
2344
|
+
}
|
|
2345
|
+
function parseCsp(header) {
|
|
2346
|
+
const directives = /* @__PURE__ */ new Map();
|
|
2347
|
+
for (const part of header.split(";")) {
|
|
2348
|
+
const [name, ...sources] = part.trim().split(/\s+/);
|
|
2349
|
+
if (name && !directives.has(name.toLowerCase())) directives.set(name.toLowerCase(), sources);
|
|
2350
|
+
}
|
|
2351
|
+
return directives;
|
|
2352
|
+
}
|
|
2353
|
+
const UPGRADES = { "http:": ["http:", "https:"], "ws:": ["ws:", "wss:"] };
|
|
2354
|
+
function sourceAllows(source, target, self) {
|
|
2355
|
+
const lower = source.toLowerCase();
|
|
2356
|
+
if (lower === "*") return ["http:", "https:", "ws:", "wss:"].includes(target.protocol);
|
|
2357
|
+
if (lower === "'self'") return target.host === self.host;
|
|
2358
|
+
if (/^[a-z][a-z0-9+.-]*:$/.test(lower)) return (UPGRADES[lower] ?? [lower]).includes(target.protocol);
|
|
2359
|
+
const match = /^(?:([a-z][a-z0-9+.-]*):\/\/)?(\*\.)?([^/:]+)(?::(\d+|\*))?/.exec(lower);
|
|
2360
|
+
if (!match) return false;
|
|
2361
|
+
const [, scheme, wildcard, host, port] = match;
|
|
2362
|
+
if (scheme && !(UPGRADES[`${scheme}:`] ?? [`${scheme}:`]).includes(target.protocol)) return false;
|
|
2363
|
+
const hostMatches = wildcard ? target.hostname.endsWith(`.${host}`) : target.hostname === host;
|
|
2364
|
+
return hostMatches && (!port || port === "*" || port === target.port);
|
|
2365
|
+
}
|
|
2366
|
+
function parseCspList(header) {
|
|
2367
|
+
return header.split(",").map(parseCsp).filter((policy) => policy.size > 0);
|
|
2368
|
+
}
|
|
2369
|
+
function cspAllows(policy, target, self) {
|
|
2370
|
+
const sources = policy.get("connect-src") ?? policy.get("default-src");
|
|
2371
|
+
if (!sources) return true;
|
|
2372
|
+
const url = new URL(target);
|
|
2373
|
+
return sources.some((source) => sourceAllows(source, url, new URL(self)));
|
|
2374
|
+
}
|
|
2375
|
+
function policiesAllow(policies, target, self, { twins = false } = {}) {
|
|
2376
|
+
const fetched = twins ? target.replace(/^ws(s?):/, "http$1:") : target;
|
|
2377
|
+
return policies.every((policy) => cspAllows(policy, target, self) || cspAllows(policy, fetched, self));
|
|
2378
|
+
}
|
|
2379
|
+
function socketOf(url) {
|
|
2380
|
+
const parsed = new URL(url);
|
|
2381
|
+
return `${parsed.protocol === "https:" ? "wss:" : "ws:"}//${parsed.host}`;
|
|
2382
|
+
}
|
|
2383
|
+
const CSP_FIX = "The module adds the deployment the page talks to (its runtime config) to connect-src of the security headers' /** rule, so the gap comes from elsewhere: a policy the app host or a proxy adds (browsers enforce each one), a route rule more specific than /** that sets its own connect-src, or the module's policy turned off (contentSecurityPolicy: false) with one set elsewhere. Add the deployment's https:// and wss:// origins there.";
|
|
2384
|
+
function cspFinding(origin, root, backend) {
|
|
2385
|
+
const header = root.headers.get("content-security-policy");
|
|
2386
|
+
if (!header) return finding("site-csp", "warn", `${origin} sends no content security policy: the security headers' policy is off.`, "Keep nuxt-security on, with the Convex-aware policy the module adds (`security: false`, or `contentSecurityPolicy: false`, turns it off), or set one at the app host.");
|
|
2387
|
+
if (!backend) return finding("site-csp", "pass", `${origin} sends a content security policy (the backend it must let through is unknown here).`);
|
|
2388
|
+
const policies = parseCspList(header);
|
|
2389
|
+
const targets = [new URL(backend).origin, socketOf(backend)];
|
|
2390
|
+
const blocked = targets.filter((target) => !policiesAllow(policies, target, origin, { twins: true }));
|
|
2391
|
+
if (blocked.length > 0) {
|
|
2392
|
+
return finding("site-csp", "fail", `${origin}'s content security policy does not let the browser reach ${blocked.join(" and ")} (connect-src): its queries and realtime updates are blocked.`, CSP_FIX);
|
|
2393
|
+
}
|
|
2394
|
+
const socket = targets[1];
|
|
2395
|
+
if (!policiesAllow(policies, socket, origin)) {
|
|
2396
|
+
return finding("site-csp", "warn", `${origin}'s content security policy lets ${socket} through only by its https origin: current browsers connect, some older engines block the realtime updates.`, `Name ${socket} in connect-src too, as the module's own policy does. ${CSP_FIX}`);
|
|
2397
|
+
}
|
|
2398
|
+
return finding("site-csp", "pass", `${origin}'s content security policy lets the browser reach ${new URL(backend).origin} and its WebSocket.`);
|
|
2399
|
+
}
|
|
2400
|
+
function deploymentOrigins(html) {
|
|
2401
|
+
const unescaped = html.replace(/\\u002F/gi, "/").replace(/\\\//g, "/");
|
|
2402
|
+
return [...new Set([...unescaped.matchAll(/https:\/\/[a-z0-9-]+(?:\.[a-z0-9-]+)*\.convex\.cloud/gi)].map(([origin]) => origin.toLowerCase()))];
|
|
2403
|
+
}
|
|
2404
|
+
function backendFinding(origin, html, backend) {
|
|
2405
|
+
const expected = new URL(backend).origin;
|
|
2406
|
+
const named = deploymentOrigins(html);
|
|
2407
|
+
if (named.includes(expected) || html.includes(expected)) return finding("site-backend-url", "pass", `${origin} talks to production's deployment, ${expected}.`);
|
|
2408
|
+
if (named.length > 0) {
|
|
2409
|
+
return finding("site-backend-url", "fail", `${origin} talks to ${named.join(", ")}, not production's deployment ${expected}: it was built (or its NUXT_PUBLIC_BACKEND_URL set) against another deployment.`, `Build the app against production: set NUXT_PUBLIC_BACKEND_URL in the app host's production env to ${expected}, or build with npx convex deploy --cmd 'npm run build' --cmd-url-env-var-name NUXT_PUBLIC_BACKEND_URL; then redeploy the app.`);
|
|
2410
|
+
}
|
|
2411
|
+
return finding("site-backend-url", "warn", `${origin}'s page names no deployment URL doctor can read, so whether it talks to production's ${expected} is unknown (a custom domain for the deployment?).`, "Open the site and check the deployment its requests go to.");
|
|
2412
|
+
}
|
|
2413
|
+
async function rootFindings(input, root) {
|
|
2414
|
+
const html = input.wants("site") && input.backendUrl ? await textOf(root) : "";
|
|
2415
|
+
return input.wants("site") ? [
|
|
2416
|
+
httpsFinding(input.origin, root),
|
|
2417
|
+
cspFinding(input.origin, root, input.backendUrl ? backendOf(html, input.backendUrl) : null),
|
|
2418
|
+
...input.backendUrl ? [backendFinding(input.origin, html, input.backendUrl)] : []
|
|
2419
|
+
] : [];
|
|
2420
|
+
}
|
|
2421
|
+
function backendOf(html, production) {
|
|
2422
|
+
const expected = new URL(production).origin;
|
|
2423
|
+
const named = deploymentOrigins(html);
|
|
2424
|
+
if (named.includes(expected) || html.includes(expected)) return production;
|
|
2425
|
+
return named[0] ?? null;
|
|
2426
|
+
}
|
|
2427
|
+
const CACHE_HEADERS = [["x-vercel-cache", /^(?:hit|stale|prerender)$/i], ["cf-cache-status", /^hit$/i], ["x-nitro-prerender", /./], ["age", /^[1-9]/]];
|
|
2428
|
+
async function gatedPageFinding(input, fetcher) {
|
|
2429
|
+
const url = `${input.origin}${input.gatedPath}`;
|
|
2430
|
+
const response = await probe(url, { headers: { accept: "text/html" } }, fetcher);
|
|
2431
|
+
if (!response) return finding("site-gated-page", "warn", `${url} did not answer.`, "Check the app host's logs.");
|
|
2432
|
+
const location = response.headers.get("location");
|
|
2433
|
+
if (response.status >= 300 && response.status < 400 && location) {
|
|
2434
|
+
let to;
|
|
2435
|
+
try {
|
|
2436
|
+
to = new URL(location, input.origin);
|
|
2437
|
+
} catch {
|
|
2438
|
+
return finding("site-gated-page", "warn", `${input.gatedPath} redirects an anonymous visitor to a location no browser can read (${location}).`, "Check the app host's and any proxy's redirects for that path.");
|
|
2439
|
+
}
|
|
2440
|
+
return to.origin === input.origin && to.pathname === input.loginPath ? finding("site-gated-page", "pass", `${input.gatedPath} sends an anonymous visitor to sign in (${input.loginPath}).`) : finding("site-gated-page", "warn", `${input.gatedPath} sends an anonymous visitor to ${to.href}, not the sign-in page ${input.loginPath}.`, "Check the `auth` route middleware and `backend.pages.login` in nuxt.config.");
|
|
2441
|
+
}
|
|
2442
|
+
if (response.status === 200) {
|
|
2443
|
+
const cached = CACHE_HEADERS.find(([name, pattern]) => pattern.test(response.headers.get(name) ?? ""));
|
|
2444
|
+
return cached ? finding("site-gated-page", "fail", `${input.gatedPath} answered an anonymous visitor 200 from a cache (${cached[0]}: ${response.headers.get(cached[0])}): a private page rendered once is served to everyone.`, "Drop the swr, isr, cache or prerender route rule that reaches it; the module keeps private pages out of caches at their exact paths only.") : finding("site-gated-page", "warn", `${input.gatedPath} answered an anonymous visitor 200, not a redirect to sign in: it renders only in the browser, or it is not behind the gate.`, "Keep server rendering on for private pages, so the gate redirects before any of the page is sent.");
|
|
2445
|
+
}
|
|
2446
|
+
return finding("site-gated-page", "warn", `${input.gatedPath} answered ${response.status}${response.status === 404 ? ": no page is mounted there" : ""}.`, "Check `backend.pages` in nuxt.config, and the app host's logs.");
|
|
2447
|
+
}
|
|
2448
|
+
async function authProxyFinding(input, fetcher) {
|
|
2449
|
+
const url = `${input.origin}${input.authRoute}/ok`;
|
|
2450
|
+
const response = await probe(url, { headers: { accept: "application/json" } }, fetcher);
|
|
2451
|
+
if (!response) return finding("site-auth-proxy", "warn", `${url} did not answer.`, "Check the app host's logs.");
|
|
2452
|
+
if (response.status === 200 && (await jsonOf(response))?.ok === true) {
|
|
2453
|
+
return finding("site-auth-proxy", "pass", `${input.authRoute} reaches the deployment: ${url} answers ok.`);
|
|
2454
|
+
}
|
|
2455
|
+
if (response.status >= 500) {
|
|
2456
|
+
return finding("site-auth-proxy", "fail", `${url} answered ${response.status}: the sign-in proxy cannot reach the deployment, so no one can sign in. A build that did not know the backend URL leaves the proxy without the deployment's HTTP routes origin.`, "Set NUXT_PUBLIC_CONVEX_SITE_URL on the app's host to the deployment's https://<name>.convex.site URL (a custom domain in front of the HTTP routes goes there too), then redeploy; or set NUXT_PUBLIC_BACKEND_URL where the build runs, so the build derives it.");
|
|
2457
|
+
}
|
|
2458
|
+
return finding("site-auth-proxy", "warn", `${url} answered ${response.status}${response.status === 404 ? ": no auth proxy is mounted there" : ""}.`, "Check `backend.authRoute` in nuxt.config, and the app host's rewrites for that path.");
|
|
2459
|
+
}
|
|
2460
|
+
async function docsFinding(input, fetcher) {
|
|
2461
|
+
const url = `${input.origin}/llms.txt`;
|
|
2462
|
+
const response = await probe(url, { headers: { accept: "text/plain, text/markdown" } }, fetcher);
|
|
2463
|
+
const type = response?.headers.get("content-type") ?? "";
|
|
2464
|
+
const served = response?.status === 200 && !type.includes("html") && (await textOf(response)).trimStart().startsWith("#");
|
|
2465
|
+
if (served) return [finding("agent-docs", "pass", `${url} serves the docs for agents.`)];
|
|
2466
|
+
if (!input.llms) return [];
|
|
2467
|
+
return [finding("agent-docs", "warn", `The app declares docs for agents (llms), and ${url} answered ${response?.status ?? "nothing"}${response?.status === 200 ? " with no text document" : ""}.`, "Check the llms options in nuxt.config, and that the build ran its module.")];
|
|
2468
|
+
}
|
|
2469
|
+
const STATES = /* @__PURE__ */ new Set(["live", "test", "missing", "failing"]);
|
|
2470
|
+
async function healthFinding(input, fetcher) {
|
|
2471
|
+
const url = `${input.origin}${HEALTH_ROUTE}`;
|
|
2472
|
+
const response = await probe(url, { headers: { accept: "application/json" } }, fetcher);
|
|
2473
|
+
if (!response) return finding("monitoring-health", "warn", `${url} did not answer.`, "Check the app host's logs.");
|
|
2474
|
+
if (response.status === 404) return finding("monitoring-health", "warn", `${url} is not served (404): an uptime check has nothing to ask.`, "Check that the app was built with this package.");
|
|
2475
|
+
const body = response.status === 200 || response.status === 503 ? await jsonOf(response) : null;
|
|
2476
|
+
const capabilities = body?.capabilities;
|
|
2477
|
+
const shaped = body && ["ok", "degraded", "failing"].includes(body.status) && typeof capabilities === "object" && capabilities !== null && Object.values(capabilities).every((state) => STATES.has(state));
|
|
2478
|
+
if (!shaped) return finding("monitoring-health", "warn", `${url} answered ${response.status} without the health's shape ({ status, capabilities }).`, "A route of your own shadows it, or a proxy rewrote the answer.");
|
|
2479
|
+
if ("detail" in body) return finding("monitoring-health", "fail", `${url} shows the capabilities' detail to an anonymous caller: their env names and findings.`, "Production names itself development (BACKEND_ENVIRONMENT), which shows the detail to everyone: name it production with npx nuxt-backend env push --prod --force BACKEND_ENVIRONMENT (env push leaves a value already set unless forced).");
|
|
2480
|
+
const failing = Object.entries(capabilities).filter(([, state]) => state === "failing").map(([name]) => name);
|
|
2481
|
+
if (body.status === "failing") return finding("monitoring-health", "warn", `${url} answers its public shape, and reports the app failing (${failing.join(", ") || "the backend unreachable"}).`, "npx nuxt-backend status --prod says why.");
|
|
2482
|
+
return finding("monitoring-health", "pass", `${url} answers its public shape: ${body.status}, ${Object.keys(capabilities).length} capabilities, no detail.`);
|
|
2483
|
+
}
|
|
2484
|
+
const PROBE_IDS = [["site", "site-https"], ["auth", "site-gated-page"], ["monitoring", "monitoring-health"]];
|
|
2485
|
+
function unprobedSiteFindings(why, fixHint, wants) {
|
|
2486
|
+
const first = PROBE_IDS.find(([group]) => wants(group));
|
|
2487
|
+
return first ? [finding(first[1], "warn", `${why}, so the live site was not probed.`, fixHint)] : [];
|
|
2488
|
+
}
|
|
2489
|
+
async function siteProbeFindings(input, fetcher = fetch) {
|
|
2490
|
+
if (!PROBE_IDS.some(([group]) => input.wants(group))) return [];
|
|
2491
|
+
const root = await probe(`${input.origin}/`, { redirect: "follow", headers: { accept: "text/html" } }, fetcher);
|
|
2492
|
+
if (!root) return unprobedSiteFindings(`${input.origin} is unreachable`, "Check that the app is deployed at the origin production's SITE_URL names, then run npx nuxt-backend doctor --prod again.", input.wants);
|
|
2493
|
+
const results = await Promise.all([
|
|
2494
|
+
rootFindings(input, root),
|
|
2495
|
+
input.wants("auth") ? gatedPageFinding(input, fetcher) : [],
|
|
2496
|
+
input.wants("auth") ? authProxyFinding(input, fetcher) : [],
|
|
2497
|
+
input.wants("site") ? docsFinding(input, fetcher) : [],
|
|
2498
|
+
input.wants("monitoring") ? healthFinding(input, fetcher) : []
|
|
2499
|
+
]);
|
|
2500
|
+
return results.flat();
|
|
2501
|
+
}
|
|
2502
|
+
|
|
2503
|
+
async function readDeployment(rootDir, options) {
|
|
2504
|
+
const [spec, authConfig] = await Promise.all([
|
|
2505
|
+
options.reachable && options.spec ? deploymentFunctionSpec(rootDir, { prod: options.prod }) : null,
|
|
2506
|
+
options.reachable && options.authConfig ? deployedAuthConfig(rootDir, options.prod) : null
|
|
2507
|
+
]);
|
|
2508
|
+
const probeSiteUrl = options.prod ? resolveSiteUrl({ env: process.env, derived: null, ...spec?.url ? { url: spec.url } : {} }) : options.localSiteUrl;
|
|
2509
|
+
return { identifiers: spec?.identifiers ?? null, authConfig, probeSiteUrl, deploymentUrl: spec?.url ?? null };
|
|
2510
|
+
}
|
|
2511
|
+
function appConfigLoader(rootDir) {
|
|
2512
|
+
let loading;
|
|
2513
|
+
return () => loading ??= (async () => {
|
|
2514
|
+
try {
|
|
2515
|
+
const { loadNuxtConfig } = await import('@nuxt/kit');
|
|
2516
|
+
return await loadNuxtConfig({ cwd: rootDir });
|
|
2517
|
+
} catch {
|
|
2518
|
+
return null;
|
|
2519
|
+
}
|
|
2520
|
+
})();
|
|
2521
|
+
}
|
|
2522
|
+
async function loadedBackendOptions(appConfig) {
|
|
2523
|
+
const config = await appConfig();
|
|
2524
|
+
return config ? pathsSourceOf(config) : null;
|
|
2525
|
+
}
|
|
2526
|
+
async function generatedFileFindings(rootDir, appConfig) {
|
|
2527
|
+
return [codegenFinding(rootDir), ...pathsFileFinding(rootDir, await loadedBackendOptions(appConfig)), ...brandFileFinding(rootDir, await appBrandOf(await appConfig()))];
|
|
2528
|
+
}
|
|
2529
|
+
async function installableFindings(rootDir, appConfig, { wanted, pushKeys }) {
|
|
2530
|
+
const config = wanted ? await appConfig() : null;
|
|
2531
|
+
if (!config) return [];
|
|
2532
|
+
const modules = (config.modules ?? []).flatMap((entry) => {
|
|
2533
|
+
const name = Array.isArray(entry) ? entry[0] : entry;
|
|
2534
|
+
return typeof name === "string" ? [name] : [];
|
|
2535
|
+
});
|
|
2536
|
+
const publicDir = join(rootDir, config.dir?.public ?? "public");
|
|
2537
|
+
return installableFinding(publicDir, await appBrandOf(config), { modules, pushKeys });
|
|
2538
|
+
}
|
|
2539
|
+
function servesAgentDocs(config) {
|
|
2540
|
+
return config?.llms !== void 0 || (config?.modules ?? []).some((entry) => (Array.isArray(entry) ? entry[0] : entry) === "nuxt-llms");
|
|
2541
|
+
}
|
|
2542
|
+
async function deployedAuthConfig(rootDir, prod) {
|
|
2543
|
+
try {
|
|
2544
|
+
const { stdout } = await runConvex(rootDir, ["run", ...deploymentFlags({ prod }), "auth:authConfig"]);
|
|
2545
|
+
const parsed = JSON.parse(stdout);
|
|
2546
|
+
const config = {};
|
|
2547
|
+
for (const key of BACKEND_PATH_KEYS) {
|
|
2548
|
+
const value = parsed.paths?.[key];
|
|
2549
|
+
if (typeof value === "string") config[key] = value;
|
|
2550
|
+
}
|
|
2551
|
+
return Object.keys(config).length > 0 ? config : null;
|
|
2552
|
+
} catch {
|
|
2553
|
+
return null;
|
|
2554
|
+
}
|
|
2555
|
+
}
|
|
2556
|
+
function functionContractFindings(identifiers) {
|
|
2557
|
+
const missing = missingContractFunctions(identifiers);
|
|
2558
|
+
return [missing.length === 0 ? finding("function-contract", "pass", "All functions the composables bind to are deployed.") : finding(
|
|
2559
|
+
"function-contract",
|
|
2560
|
+
"fail",
|
|
2561
|
+
`Deployed functions missing: ${missing.join(", ")} \u2014 the matching composables (useBilling/useCredits/useGifts/useFeatures/useEmailStatus/useAuth) degrade to undefineds.`,
|
|
2562
|
+
"A backend/ file was renamed or its exports trimmed. Restore with `npx nuxt-backend init`, then let `npx convex dev` push."
|
|
2563
|
+
)];
|
|
2564
|
+
}
|
|
2565
|
+
const BROKEN_BY = {
|
|
2566
|
+
authRoute: "the auth proxy forwards to routes the deployment does not serve, so nobody signs in",
|
|
2567
|
+
acceptInvitation: "invitees land on a 404",
|
|
2568
|
+
keepAccount: 'the "keep my account" link of a scheduled deletion lands on a 404',
|
|
2569
|
+
security: "a recovered passkey-only account's notice links to a 404",
|
|
2570
|
+
waitlist: "a waitlist confirmation's status link lands on a 404",
|
|
2571
|
+
login: `an admitted person's "You're in" email links to a 404`,
|
|
2572
|
+
unsubscribe: "a topic email's unsubscribe and confirmation links land on a 404",
|
|
2573
|
+
report: "a statement of reasons' appeal link lands on a 404",
|
|
2574
|
+
settings: "the billing emails' manage links land on a 404",
|
|
2575
|
+
privacy: "an access invitation email's privacy link lands on a 404"
|
|
2576
|
+
};
|
|
2577
|
+
async function pagePathFindings(appConfig, deployed) {
|
|
2578
|
+
const source = await loadedBackendOptions(appConfig);
|
|
2579
|
+
if (!source) return [];
|
|
2580
|
+
const wanted = backendPathsOf(source);
|
|
2581
|
+
const keys = BACKEND_PATH_KEYS.filter((key) => deployed[key] !== void 0);
|
|
2582
|
+
if (keys.length === 0) return [];
|
|
2583
|
+
const apart = keys.filter((key) => deployed[key] !== wanted[key]);
|
|
2584
|
+
if (apart.length === 0) return [finding("page-paths", "pass", "The deployment serves on and links to the paths nuxt.config declares.")];
|
|
2585
|
+
return [finding(
|
|
2586
|
+
"page-paths",
|
|
2587
|
+
"fail",
|
|
2588
|
+
`The deployment's paths differ from nuxt.config's: ${apart.map((key) => `${key} is ${deployed[key]} there and ${wanted[key]} in ${pathOption(key)}, so ${BROKEN_BY[key]}`).join("; ")}.`,
|
|
2589
|
+
"Pass the `paths` of paths.generated.ts to defineBackendAuthConfig (auth.config.ts), setupAuth (auth.ts) and setupAccount (account.ts), then let `npx convex dev` push or deploy."
|
|
2590
|
+
)];
|
|
2591
|
+
}
|
|
2592
|
+
async function billingCatalogFindings(rootDir, env) {
|
|
2593
|
+
let catalog;
|
|
2594
|
+
try {
|
|
2595
|
+
catalog = (await loadCatalog(rootDir))?.catalog ?? null;
|
|
2596
|
+
} catch {
|
|
2597
|
+
return [];
|
|
2598
|
+
}
|
|
2599
|
+
if (!catalog) return [];
|
|
2600
|
+
const accessToken = env.BILLING_ACCESS_TOKEN;
|
|
2601
|
+
const environment = billingEnvironment(parseBackendEnvironment(env.BACKEND_ENVIRONMENT));
|
|
2602
|
+
const state = accessToken ? await readBillingOrganizationState({ accessToken, environment }) : null;
|
|
2603
|
+
return collectBillingFindings(catalog, state, { tokenPresent: Boolean(accessToken) });
|
|
2604
|
+
}
|
|
2605
|
+
async function probeWebhookRoute(url) {
|
|
2606
|
+
try {
|
|
2607
|
+
const response = await fetch(
|
|
2608
|
+
// codeql[js/file-access-to-http] The URL is the project's own deployment origin from its env file; the body is empty. Reviewed 2026-10-18.
|
|
2609
|
+
url,
|
|
2610
|
+
{ method: "POST", body: "", signal: AbortSignal.timeout(5e3) }
|
|
2611
|
+
);
|
|
2612
|
+
const status = response.status;
|
|
2613
|
+
if (status === 404) return { state: "missing", status };
|
|
2614
|
+
if (status === 503) return { state: "fail-closed", status };
|
|
2615
|
+
if (status >= 400 && status < 500) return { state: "mounted", status };
|
|
2616
|
+
return { state: "unexpected", status };
|
|
2617
|
+
} catch {
|
|
2618
|
+
return { state: "unreachable" };
|
|
2619
|
+
}
|
|
2620
|
+
}
|
|
2621
|
+
async function webhookRouteFindings(siteUrl, { ai, wants, prod }) {
|
|
2622
|
+
const routes = [
|
|
2623
|
+
{ id: "billing-webhook-route", path: "/billing/events", group: "billing", secret: "BILLING_WEBHOOK_SECRET" },
|
|
2624
|
+
{ id: "email-webhook-route", path: "/email/events", group: "email", secret: "EMAIL_WEBHOOK_SECRET" },
|
|
2625
|
+
// The stream route only matters once setupAi is deployed; a project
|
|
2626
|
+
// without an `ai` module has nothing to mount. It has no secret.
|
|
2627
|
+
...ai ? [{ id: "ai-stream-route", path: "/ai/stream", group: "ai", secret: null }] : []
|
|
2628
|
+
];
|
|
2629
|
+
return Promise.all(routes.filter((route) => wants(route.group)).map(async (route) => {
|
|
2630
|
+
const url = `${siteUrl.replace(/\/+$/, "")}${route.path}`;
|
|
2631
|
+
const { state, status } = await probeWebhookRoute(url);
|
|
2632
|
+
if (state === "missing") {
|
|
2633
|
+
return finding(route.id, "fail", `${route.path} is not mounted on the deployment.`, `Pass \`${route.group}\` to registerBackendRoutes in http.ts and deploy.`);
|
|
2634
|
+
}
|
|
2635
|
+
if (state === "fail-closed" && route.secret) {
|
|
2636
|
+
return finding(
|
|
2637
|
+
route.id,
|
|
2638
|
+
"warn",
|
|
2639
|
+
`${route.path} is mounted but fail-closed \u2014 its webhook secret is not set, so every delivery is rejected (503).`,
|
|
2640
|
+
route.secret === "BILLING_WEBHOOK_SECRET" ? billingWebhookSecretHint(prod) : `Add ${route.secret} to .env.local and run \`npx nuxt-backend env push${prod ? " --prod" : ""}\`.`
|
|
2641
|
+
);
|
|
2642
|
+
}
|
|
2643
|
+
if (state === "mounted") {
|
|
2644
|
+
return finding(route.id, "pass", `${route.path} is mounted (the unsigned probe was rejected, as expected).`);
|
|
2645
|
+
}
|
|
2646
|
+
if (state === "unreachable") {
|
|
2647
|
+
return finding(route.id, "warn", `${url} is unreachable (offline, or the deployment is not running).`, "Run `npx convex dev` (or deploy), then re-run doctor.");
|
|
2648
|
+
}
|
|
2649
|
+
return finding(route.id, "warn", `${route.path} answered with unexpected status ${status}.`, "Check the deployment logs.");
|
|
2650
|
+
}));
|
|
2651
|
+
}
|
|
2652
|
+
async function billingEndpointCheck(env, { prod, siteUrl }) {
|
|
2653
|
+
const target = billingProviderTarget(env, prod);
|
|
2654
|
+
if (!target) return [];
|
|
2655
|
+
const url = `${siteUrl.replace(/\/+$/, "")}/billing/events`;
|
|
2656
|
+
return billingEndpointFindings(await readProviderEndpoint(providerClient(target.accessToken, target.environment), url), url);
|
|
2657
|
+
}
|
|
2658
|
+
async function customerMappingCheck(rootDir, env, { prod }) {
|
|
2659
|
+
const target = billingProviderTarget(env, prod);
|
|
2660
|
+
if (!target) return [];
|
|
2661
|
+
const ids = await readMappedCustomers(rootDir, { prod });
|
|
2662
|
+
if (!ids) return [];
|
|
2663
|
+
return customerMappingFindings(await checkMappedCustomers(providerClient(target.accessToken, target.environment), ids), { prod });
|
|
2664
|
+
}
|
|
2665
|
+
async function billingProviderFindings(rootDir, env, { prod, reachable, siteUrl }) {
|
|
2666
|
+
const [endpoint, mappings] = await Promise.all([
|
|
2667
|
+
siteUrl ? billingEndpointCheck(env, { prod, siteUrl }) : [],
|
|
2668
|
+
reachable ? customerMappingCheck(rootDir, env, { prod }) : []
|
|
2669
|
+
]);
|
|
2670
|
+
return [...endpoint, ...mappings];
|
|
2671
|
+
}
|
|
2672
|
+
async function emailSetupFindings(rootDir, { prod, reachable, identifiers }) {
|
|
2673
|
+
if (!reachable || !identifiers?.has("email:syncEmail")) return [];
|
|
2674
|
+
try {
|
|
2675
|
+
const report = await runEmailSync(rootDir, { prod, dryRun: true });
|
|
2676
|
+
return report ? emailSyncFindings(report, { prod }) : [];
|
|
2677
|
+
} catch {
|
|
2678
|
+
return [];
|
|
2679
|
+
}
|
|
2680
|
+
}
|
|
2681
|
+
function codegenFinding(rootDir) {
|
|
2682
|
+
const functionsDir = resolveFunctionsDir(rootDir);
|
|
2683
|
+
const hasGenerated = existsSync(join(rootDir, functionsDir, "_generated"));
|
|
2684
|
+
return hasGenerated ? finding("convex-codegen", "pass", `${functionsDir}/_generated present.`) : finding("convex-codegen", "warn", `${functionsDir}/_generated missing \u2014 Convex features no-op until codegen runs.`, "Run: npx convex dev");
|
|
2685
|
+
}
|
|
2686
|
+
function requiredDeploymentEnvFinding(name, isSet, prod) {
|
|
2687
|
+
if (isSet) return finding(deploymentEnvId(name), "pass", `${name} is set on the deployment.`);
|
|
2688
|
+
const flag = prod ? " --prod" : "";
|
|
2689
|
+
const byHand = name === "AUTH_SECRET" ? `openssl rand -base64 32 | npx convex env set${flag} AUTH_SECRET` : `npx convex env set${flag} ${name} ...`;
|
|
2690
|
+
return finding(
|
|
2691
|
+
deploymentEnvId(name),
|
|
2692
|
+
"fail",
|
|
2693
|
+
`${name} is not set on the Convex deployment (required \u2014 a deploy fails without it).`,
|
|
2694
|
+
prod ? `Add it to .env.local and run \`npx nuxt-backend env push --prod\`, or: ${byHand}` : `Run \`npx nuxt-backend env push\` (dev fills it in), or: ${byHand}`
|
|
2695
|
+
);
|
|
2696
|
+
}
|
|
2697
|
+
function optionalDeploymentEnvFinding(name, degradation, isSet, { prod }) {
|
|
2698
|
+
const id = deploymentEnvId(name);
|
|
2699
|
+
const flag = prod ? " --prod" : "";
|
|
2700
|
+
if (isSet) return finding(id, "pass", `${name} is set on the deployment.`);
|
|
2701
|
+
const fixHint = name === "BILLING_WEBHOOK_SECRET" ? billingWebhookSecretHint(prod) : name === "BACKEND_ENVIRONMENT" ? `Run \`npx nuxt-backend env push${flag}\`: it derives ${name} from the deployment's kind.` : `Add ${name} to .env.local and run \`npx nuxt-backend env push${flag}\`.`;
|
|
2702
|
+
return finding(id, "warn", `${name} is not set (optional): ${degradation}.`, fixHint);
|
|
2703
|
+
}
|
|
2704
|
+
function removedEnvFinding(deployed, { prod }) {
|
|
2705
|
+
const left = REMOVED_DEPLOYMENT_ENV.filter((name) => deployed.includes(name));
|
|
2706
|
+
if (left.length === 0) return finding("deployment-removed-env", "pass", "No variable `0.2.0` removed is still set on the deployment.");
|
|
2707
|
+
return finding(
|
|
2708
|
+
"deployment-removed-env",
|
|
2709
|
+
"warn",
|
|
2710
|
+
`${left.join(", ")} ${left.length === 1 ? "is" : "are"} still set on the deployment, and nothing reads ${left.length === 1 ? "it" : "them"} any more: BACKEND_ENVIRONMENT decides the modes they once set.`,
|
|
2711
|
+
left.map((name) => `npx convex env remove${prod ? " --prod" : ""} ${name}`).join("; ")
|
|
2712
|
+
);
|
|
2713
|
+
}
|
|
2714
|
+
function listed(names) {
|
|
2715
|
+
return names.length < 2 ? names.join("") : `${names.slice(0, -1).join(", ")} and ${names.at(-1)}`;
|
|
2716
|
+
}
|
|
2717
|
+
const CONVEX_GATEWAY_PROVIDER = "@convex-dev/ai-sdk-provider";
|
|
2718
|
+
const SPENDING_LIMIT = "Cap its spend with `npx convex deployment usage-limits set` (the `aiGatewayCostDollars` limit).";
|
|
2719
|
+
function convexGatewayProviderInstalled(rootDir) {
|
|
2720
|
+
try {
|
|
2721
|
+
createRequire(join(rootDir, "package.json")).resolve(`${CONVEX_GATEWAY_PROVIDER}/package.json`);
|
|
2722
|
+
return true;
|
|
2723
|
+
} catch {
|
|
2724
|
+
return false;
|
|
2725
|
+
}
|
|
2726
|
+
}
|
|
2727
|
+
function cloudRouteFinding(id, models, { keyed, provider, flag }) {
|
|
2728
|
+
if (provider) {
|
|
2729
|
+
const fallback = keyed ? "where the plan has none (a free plan), they go through the Vercel AI Gateway with AI_GATEWAY_API_KEY" : "a free plan refuses it (AiGatewayDisabled), and with no AI_GATEWAY_API_KEY to fall back on, those calls are refused";
|
|
2730
|
+
return finding(id, "pass", `${listed(models)} go through the Convex AI Gateway, which bills the team; ${fallback}. ${SPENDING_LIMIT}`);
|
|
2731
|
+
}
|
|
2732
|
+
if (keyed) {
|
|
2733
|
+
return finding(id, "pass", `AI_GATEWAY_API_KEY is set on the deployment: ${listed(models)} go through the Vercel AI Gateway. Install ${CONVEX_GATEWAY_PROVIDER} to go through the Convex AI Gateway first.`);
|
|
2734
|
+
}
|
|
2735
|
+
return finding(
|
|
2736
|
+
id,
|
|
2737
|
+
"warn",
|
|
2738
|
+
`The backend names ${listed(models)}, but no model route is ready on the deployment: ${CONVEX_GATEWAY_PROVIDER} is not installed and AI_GATEWAY_API_KEY is not set, so those model calls are refused.`,
|
|
2739
|
+
`Install ${CONVEX_GATEWAY_PROVIDER} (\`pnpm add ${CONVEX_GATEWAY_PROVIDER}\`) to use the Convex AI Gateway on a paid plan, or add AI_GATEWAY_API_KEY to .env.local and run \`npx nuxt-backend env push${flag}\`.`
|
|
2740
|
+
);
|
|
2741
|
+
}
|
|
2742
|
+
function gatewayKeyFinding(deployed, { models, local, cloud, provider, prod, region }) {
|
|
2743
|
+
const id = deploymentEnvId("AI_GATEWAY_API_KEY");
|
|
2744
|
+
const flag = prod ? " --prod" : "";
|
|
2745
|
+
const keyed = deployed.includes("AI_GATEWAY_API_KEY");
|
|
2746
|
+
if (models.length === 0) {
|
|
2747
|
+
return finding(id, "pass", keyed ? "AI_GATEWAY_API_KEY is set on the deployment." : "AI_GATEWAY_API_KEY is not set, and no backend file names a provider/model id that needs a model route.");
|
|
2748
|
+
}
|
|
2749
|
+
if (region) {
|
|
2750
|
+
if (keyed) return finding(id, "pass", `AI_GATEWAY_API_KEY is set on the deployment: ${listed(models)} go through the Vercel AI Gateway, pinned to the '${region}' inference region.`);
|
|
2751
|
+
return finding(id, "warn", `The backend pins its model calls to the '${region}' inference region, which only the Vercel AI Gateway serves, but AI_GATEWAY_API_KEY is not set on the deployment: ${listed(models)} are refused.`, `Add AI_GATEWAY_API_KEY to .env.local and run \`npx nuxt-backend env push${flag}\`.`);
|
|
2752
|
+
}
|
|
2753
|
+
if (cloud) return cloudRouteFinding(id, models, { keyed, provider, flag });
|
|
2754
|
+
if (keyed) return finding(id, "pass", `AI_GATEWAY_API_KEY is set on the deployment: ${listed(models)} go through the Vercel AI Gateway.`);
|
|
2755
|
+
return finding(
|
|
2756
|
+
id,
|
|
2757
|
+
"warn",
|
|
2758
|
+
`The backend names ${listed(models)}, but AI_GATEWAY_API_KEY is not set on the deployment${local && provider ? ", so those model calls go to the Convex AI Gateway only when the deployment is linked to a team that has it, and are refused otherwise" : ": those model calls are refused"}.`,
|
|
2759
|
+
`Add AI_GATEWAY_API_KEY to .env.local and run \`npx nuxt-backend env push${flag}\`.`
|
|
2760
|
+
);
|
|
2761
|
+
}
|
|
2762
|
+
function provenanceKeyFinding(name, deployed, { on, prod }) {
|
|
2763
|
+
const id = deploymentEnvId(name);
|
|
2764
|
+
if (!on) return finding(id, "pass", `${name} is not needed: no backend file turns provenance on.`);
|
|
2765
|
+
if (deployed.includes(name)) return finding(id, "pass", `${name} is set on the deployment: generated images carry signed content credentials.`);
|
|
2766
|
+
const flag = prod ? " --prod" : "";
|
|
2767
|
+
return finding(
|
|
2768
|
+
id,
|
|
2769
|
+
"warn",
|
|
2770
|
+
`The backend turns provenance on, but ${name} is not set on the deployment: generated images are stored with the IPTC source type only, no signed C2PA manifest (ai.provenance_unsigned).`,
|
|
2771
|
+
`Run \`npx nuxt-backend env push${flag}\`: it generates a signing key and its certificate when .env.local has none, keeps them there and sets them on the deployment.`
|
|
2772
|
+
);
|
|
2773
|
+
}
|
|
2774
|
+
function aiComponentsFinding(rootDir) {
|
|
2775
|
+
const { chat, knowledge } = aiFeatures(rootDir);
|
|
2776
|
+
const missing = [
|
|
2777
|
+
...chat && !mountsComponent(rootDir, "@convex-dev/agent") ? [{ call: "ai.chat", pkg: "@convex-dev/agent", name: "agent" }] : [],
|
|
2778
|
+
...knowledge && !mountsComponent(rootDir, "@convex-dev/rag") ? [{ call: "ai.knowledge", pkg: "@convex-dev/rag", name: "rag" }] : []
|
|
2779
|
+
];
|
|
2780
|
+
if (missing.length === 0) {
|
|
2781
|
+
return finding("ai-components", "pass", chat || knowledge ? "The components the chats and knowledge stores run on are mounted." : "No backend file declares a chat or a knowledge store.");
|
|
2782
|
+
}
|
|
2783
|
+
return finding(
|
|
2784
|
+
"ai-components",
|
|
2785
|
+
"warn",
|
|
2786
|
+
`The backend declares ${listed(missing.map((entry) => entry.call))}, but convex.config.ts does not mount ${listed(missing.map((entry) => entry.pkg))}: every call is refused.`,
|
|
2787
|
+
missing.map((entry) => `\`pnpm add ${entry.pkg}\`, then \`import ${entry.name} from '${entry.pkg}/convex.config'\` and \`app.use(${entry.name})\` in convex.config.ts`).join("; ")
|
|
2788
|
+
);
|
|
2789
|
+
}
|
|
2790
|
+
function guestJobsFinding(rootDir, deployed, { prod }) {
|
|
2791
|
+
if (!aiFeatures(rootDir).guestJobs) return [];
|
|
2792
|
+
if (deployed.includes("PROTECTION_PROOF_SECRET")) return [finding("protection-guest-jobs", "pass", "Guest jobs are on, and PROTECTION_PROOF_SECRET signs the visitor cookie and proof they need.")];
|
|
2793
|
+
return [finding(
|
|
2794
|
+
"protection-guest-jobs",
|
|
2795
|
+
"warn",
|
|
2796
|
+
"A job queue lets signed-out visitors start jobs (`guest`), but PROTECTION_PROOF_SECRET is not set on the deployment: no proof names a visitor, so every guest job is refused.",
|
|
2797
|
+
`Add PROTECTION_PROOF_SECRET to .env.local and run \`npx nuxt-backend env push${prod ? " --prod" : ""}\`; the Nuxt server needs the same value.`
|
|
2798
|
+
)];
|
|
2799
|
+
}
|
|
2800
|
+
function declaredFeatureFindings(rootDir, { wants, deployed, prod }) {
|
|
2801
|
+
return [
|
|
2802
|
+
...wants("ai") ? [aiComponentsFinding(rootDir)] : [],
|
|
2803
|
+
...wants("protection") && deployed ? guestJobsFinding(rootDir, deployed, { prod }) : []
|
|
2804
|
+
];
|
|
2805
|
+
}
|
|
2806
|
+
function deploymentRoute(kind, prod) {
|
|
2807
|
+
if (prod) return { local: false, cloud: kind !== "self-hosted" };
|
|
2808
|
+
return { local: ["local", "anonymous"].includes(kind), cloud: ["cloud-dev", "preview", "production"].includes(kind) };
|
|
2809
|
+
}
|
|
2810
|
+
function deploymentEnvFindings(rootDir, deployed, { prod, local, cloud, posture }) {
|
|
2811
|
+
const sandboxInbox = prod && posture?.environment === "sandbox" && reExportsName(rootDir, "getSandboxInbox");
|
|
2812
|
+
if (!deployed) {
|
|
2813
|
+
return [finding("deployment-env", "warn", "Could not read the deployment env (no deployment configured, or `npx convex env list` failed).", "Run `npx convex dev` once to provision, then re-run doctor.")];
|
|
2814
|
+
}
|
|
2815
|
+
return [
|
|
2816
|
+
...REQUIRED_DEPLOYMENT_ENV.map((name) => requiredDeploymentEnvFinding(name, deployed.includes(name), prod)),
|
|
2817
|
+
// Bot protection reports its own names, either of which protects (protectionFindings).
|
|
2818
|
+
// A name with no finding of its own (the marketing sender, the region) reports nothing yet.
|
|
2819
|
+
// The dev inbox's opt-in reports only once it is set: unset is every app's state, and nothing to say.
|
|
2820
|
+
...Object.entries(OPTIONAL_DEPLOYMENT_ENV).filter(([name]) => !name.startsWith("PROTECTION_") && BACKEND_ENV[name].findings.length > 0 && (name !== "EMAIL_DEV_INBOX" || deployed.includes(name) || sandboxInbox)).map(([name, degradation]) => {
|
|
2821
|
+
if (name === "AI_GATEWAY_API_KEY") return gatewayKeyFinding(deployed, { models: namedModels(rootDir), local, cloud, provider: convexGatewayProviderInstalled(rootDir), prod, region: pinnedRegion(rootDir) });
|
|
2822
|
+
if (name === "PROVENANCE_PRIVATE_KEY" || name === "PROVENANCE_CERTIFICATE") return provenanceKeyFinding(name, deployed, { on: usesProvenance(rootDir), prod });
|
|
2823
|
+
if (name === "MONITORING_DSN") return monitoringDsnFinding(deployed.includes(name), { prod });
|
|
2824
|
+
if (name === "EMAIL_DEV_INBOX") return devInboxFinding({ prod, posture, set: deployed.includes(name) });
|
|
2825
|
+
const valued = posture ? productionEnvFinding(name, deployed, posture) : null;
|
|
2826
|
+
if (valued) return valued;
|
|
2827
|
+
return optionalDeploymentEnvFinding(name, degradation, deployed.includes(name), { prod });
|
|
2828
|
+
}),
|
|
2829
|
+
removedEnvFinding(deployed, { prod })
|
|
2830
|
+
];
|
|
2831
|
+
}
|
|
2832
|
+
async function envDefaultsFindings(rootDir) {
|
|
2833
|
+
const names = await projectEnvDefaultNames(rootDir, "preview");
|
|
2834
|
+
if (!names) return [];
|
|
2835
|
+
const missing = REQUIRED_DEPLOYMENT_ENV.filter((name) => !names.includes(name));
|
|
2836
|
+
return [missing.length === 0 ? finding("env-defaults", "pass", "New preview deployments start with AUTH_SECRET and SITE_URL (project env defaults).") : finding(
|
|
2837
|
+
"env-defaults",
|
|
2838
|
+
"warn",
|
|
2839
|
+
`New preview deployments start without ${missing.join(" and ")}: unless the build sets them (\`nuxt-backend env push --preview\` in \`convex deploy --cmd\`), their first push fails.`,
|
|
2840
|
+
"Run: npx nuxt-backend env push --defaults preview --site-url <the origin new previews start with>"
|
|
2841
|
+
)];
|
|
2842
|
+
}
|
|
2843
|
+
function reExportsName(rootDir, name) {
|
|
2844
|
+
const file = join(rootDir, "backend", "email.ts");
|
|
2845
|
+
try {
|
|
2846
|
+
return existsSync(file) && readFileSync(file, "utf8").includes(name);
|
|
2847
|
+
} catch {
|
|
2848
|
+
return false;
|
|
2849
|
+
}
|
|
2850
|
+
}
|
|
2851
|
+
function protectionInput(rootDir, { prod, deployed, env, local, siteUrl }) {
|
|
2852
|
+
return {
|
|
2853
|
+
env: prod ? process.env : env,
|
|
2854
|
+
...prod ? { devEnv: readEnvFiles(rootDir) } : {},
|
|
2855
|
+
deployed,
|
|
2856
|
+
prod,
|
|
2857
|
+
local,
|
|
2858
|
+
vercel: process.env.VERCEL === "1" || existsSync(join(rootDir, ".vercel", "project.json")),
|
|
2859
|
+
waitlist: existsSync(join(rootDir, "backend", "waitlist.ts")),
|
|
2860
|
+
contact: reExportsName(rootDir, "submitContactMessage"),
|
|
2861
|
+
...siteUrl ? { siteUrl } : {}
|
|
2862
|
+
};
|
|
2863
|
+
}
|
|
2864
|
+
async function liveSiteFindings(posture, { appConfig, deploymentUrl, wants }) {
|
|
2865
|
+
const read = await posture;
|
|
2866
|
+
const origin = read ? probedOrigin(read) : null;
|
|
2867
|
+
if (!origin) {
|
|
2868
|
+
const explained = read ? wants("auth") : wants("deployment");
|
|
2869
|
+
const reason = explained ? null : unprobedReason(read);
|
|
2870
|
+
return reason ? unprobedSiteFindings(reason.why, reason.fixHint, wants) : [];
|
|
2871
|
+
}
|
|
2872
|
+
const config = await appConfig();
|
|
2873
|
+
const paths = backendPathsOf(config ? pathsSourceOf(config) : void 0);
|
|
2874
|
+
return siteProbeFindings({
|
|
2875
|
+
origin,
|
|
2876
|
+
backendUrl: deploymentUrl,
|
|
2877
|
+
gatedPath: paths.settings,
|
|
2878
|
+
loginPath: paths.login,
|
|
2879
|
+
authRoute: paths.authRoute,
|
|
2880
|
+
llms: servesAgentDocs(config),
|
|
2881
|
+
wants
|
|
2882
|
+
});
|
|
2883
|
+
}
|
|
2884
|
+
async function deployedSurfaceFindings(rootDir, { prod, deployed, env, local, siteUrl, wants, posture, appConfig }) {
|
|
2885
|
+
const reachable = deployed !== null;
|
|
2886
|
+
const probes = wants("billing") || wants("email") || wants("ai");
|
|
2887
|
+
const { identifiers, authConfig, probeSiteUrl, deploymentUrl } = await readSurface(rootDir, { prod, reachable, siteUrl, wants, probes });
|
|
2888
|
+
const [routes, pages, protection, site, admins, email, billing] = await Promise.all([
|
|
2889
|
+
probes && probeSiteUrl ? webhookRouteFindings(probeSiteUrl, { ai: identifiers ? [...identifiers].some((id) => id.startsWith("ai:")) : true, wants, prod }) : [],
|
|
2890
|
+
authConfig ? pagePathFindings(appConfig, authConfig) : [],
|
|
2891
|
+
wants("protection") ? protectionFindings(protectionInput(rootDir, { prod, deployed, env, local, siteUrl: probeSiteUrl })) : [],
|
|
2892
|
+
prod ? liveSiteFindings(posture, { appConfig, deploymentUrl, wants }) : [],
|
|
2893
|
+
// The first administrator, read off the deployment's auth tables.
|
|
2894
|
+
reachable && wants("auth") ? deploymentHasAdmin(rootDir, { prod }).then((hasAdmin) => adminBootstrapFindings(hasAdmin, { prod })) : [],
|
|
2895
|
+
// The topics, the webhook's events and the key's reach, as the deployment's own email sync reads them (a dry run).
|
|
2896
|
+
emailSetupFindings(rootDir, { prod, reachable: reachable && wants("email"), identifiers }),
|
|
2897
|
+
wants("billing") ? billingProviderFindings(rootDir, env, { prod, reachable, siteUrl: probeSiteUrl }) : []
|
|
2898
|
+
]);
|
|
2899
|
+
return [
|
|
2900
|
+
...routes,
|
|
2901
|
+
...billing,
|
|
2902
|
+
...protection,
|
|
2903
|
+
// The composable function contract.
|
|
2904
|
+
...identifiers && wants("scaffold") ? functionContractFindings(identifiers) : [],
|
|
2905
|
+
...pages,
|
|
2906
|
+
...admins,
|
|
2907
|
+
...email,
|
|
2908
|
+
...site
|
|
2909
|
+
];
|
|
2910
|
+
}
|
|
2911
|
+
function readSurface(rootDir, { prod, reachable, siteUrl, wants, probes }) {
|
|
2912
|
+
return readDeployment(rootDir, {
|
|
2913
|
+
prod,
|
|
2914
|
+
reachable,
|
|
2915
|
+
localSiteUrl: siteUrl,
|
|
2916
|
+
// The function spec names the deployed functions (the contract, and
|
|
2917
|
+
// whether `ai` is deployed) and, under --prod, the site to probe and
|
|
2918
|
+
// the deployment the live site must talk to.
|
|
2919
|
+
spec: wants("scaffold") || probes || prod && (wants("protection") || wants("site")),
|
|
2920
|
+
// The auth config reports the paths the deployment uses; read only when
|
|
2921
|
+
// auth, whose check it feeds, is wanted.
|
|
2922
|
+
authConfig: wants("auth")
|
|
2923
|
+
});
|
|
2924
|
+
}
|
|
2925
|
+
function productionBillsIn({ environment }) {
|
|
2926
|
+
return environment === "unset" || environment === "unread" ? environment : billingEnvironment(environment);
|
|
2927
|
+
}
|
|
2928
|
+
async function productionPostureFindings(rootDir, posture, wants) {
|
|
2929
|
+
if (!posture) return [];
|
|
2930
|
+
return [
|
|
2931
|
+
...wants("auth") ? siteOriginFinding(posture) : [],
|
|
2932
|
+
...wants("email") ? emailPostureFindings(posture) : [],
|
|
2933
|
+
...wants("billing") ? await productionCatalogFindings(rootDir, productionBillsIn(posture)) : [],
|
|
2934
|
+
...wants("ai") ? aiSpendLimitFinding(rootDir, posture) : []
|
|
2935
|
+
];
|
|
2936
|
+
}
|
|
2937
|
+
function aiSpendLimitFinding(rootDir, posture) {
|
|
2938
|
+
if (posture.environment !== "sandbox") return [];
|
|
2939
|
+
const { setupAi, spendLimit } = aiFeatures(rootDir);
|
|
2940
|
+
if (!setupAi) return [];
|
|
2941
|
+
if (spendLimit) return [finding("ai-spend-limit", "pass", "Production is a sandbox, and setupAi sets a daily spendLimit: AI pauses itself once a day costs that much.")];
|
|
2942
|
+
return [finding(
|
|
2943
|
+
"ai-spend-limit",
|
|
2944
|
+
"warn",
|
|
2945
|
+
"Production is a sandbox (BACKEND_ENVIRONMENT=sandbox), and setupAi sets no spendLimit: every metered call, stream, job and chat reply is refused (not_ready, reason no_budget).",
|
|
2946
|
+
"Pass `spendLimit: { usdPerDay }` to setupAi in backend/ai.ts: once a UTC day costs that much, pause_ai turns on until the day ends."
|
|
2947
|
+
)];
|
|
2948
|
+
}
|
|
2949
|
+
async function scaffoldFindings(rootDir, appConfig) {
|
|
2950
|
+
return [
|
|
2951
|
+
...await generatedFileFindings(rootDir, appConfig),
|
|
2952
|
+
...devScriptFinding(rootDir),
|
|
2953
|
+
await convexConfigFinding(rootDir),
|
|
2954
|
+
agentFilesFinding(rootDir, installedVersion(rootDir)),
|
|
2955
|
+
nameCollisionFinding(rootDir),
|
|
2956
|
+
...bundleDuplicatesFindings(rootDir)
|
|
2957
|
+
];
|
|
2958
|
+
}
|
|
2959
|
+
async function localFeatureFindings(rootDir, { env, wants, deployed, prod, appConfig }) {
|
|
2960
|
+
return [
|
|
2961
|
+
...wants("billing") ? providerSdkFindings(rootDir) : [],
|
|
2962
|
+
...wants("monitoring") ? monitoringFindings(rootDir, { env, deployed, prod }) : [],
|
|
2963
|
+
...declaredFeatureFindings(rootDir, { wants, deployed, prod }),
|
|
2964
|
+
// Production's own usage warnings: Convex emails the team; the deployment cannot read its usage itself.
|
|
2965
|
+
...wants("monitoring") && prod ? [usageAlertsFinding(await readUsageLimits(rootDir), { convexGateway: convexGatewayProviderInstalled(rootDir) })] : [],
|
|
2966
|
+
...wants("auth") ? await consentFindings(rootDir, { prod }) : [],
|
|
2967
|
+
// The installable app iPhone and iPad take web push from: the brand and the two icons.
|
|
2968
|
+
...await installableFindings(rootDir, appConfig, { wanted: wants("notifications"), pushKeys: Boolean(env.PUSH_PUBLIC_KEY) || (deployed ?? []).includes("PUSH_PUBLIC_KEY") })
|
|
2969
|
+
];
|
|
2970
|
+
}
|
|
2971
|
+
async function runDoctorChecks(rootDir, { prod, only, deployedNames, posture: given }) {
|
|
2972
|
+
const wantsCapability = (capability) => !only || only.length === 0 || only.includes(capability);
|
|
2973
|
+
const wants = (group) => wantsCapability(capabilityOfGroup(group));
|
|
2974
|
+
const env = { ...readEnvFiles(rootDir), ...process.env };
|
|
2975
|
+
const appConfig = appConfigLoader(rootDir);
|
|
2976
|
+
const siteUrl = resolveSiteUrl({ env, derived: deriveDeploymentUrls(rootDir, env) });
|
|
2977
|
+
const [{ deployed, surface, posture }, catalog, metrics] = await Promise.all([
|
|
2978
|
+
(async () => {
|
|
2979
|
+
const names = deployedNames !== void 0 ? deployedNames : await deploymentEnvNames(rootDir, { prod });
|
|
2980
|
+
const posture2 = given ?? (prod && names ? readProductionPosture(rootDir, names, wants) : Promise.resolve(null));
|
|
2981
|
+
const [surface2, defaults, read] = await Promise.all([
|
|
2982
|
+
deployedSurfaceFindings(rootDir, { prod, deployed: names, env, local: !prod && isLocalDeploymentId(configuredDeployment(rootDir)), siteUrl, wants, posture: posture2, appConfig }),
|
|
2983
|
+
names !== null && !prod && wants("deployment") ? envDefaultsFindings(rootDir) : [],
|
|
2984
|
+
posture2
|
|
2985
|
+
]);
|
|
2986
|
+
return { deployed: names, surface: [...surface2, ...defaults, ...await productionPostureFindings(rootDir, read, wants)], posture: read };
|
|
2987
|
+
})(),
|
|
2988
|
+
// Billing catalog cross-checks: what backend/billing.catalog.ts declares
|
|
2989
|
+
// against the organization's own subscription + portal settings. Every
|
|
2990
|
+
// half degrades on its own — no catalog file, no findings; no readable
|
|
2991
|
+
// provider, only the catalog-only checks (see collectBillingFindings).
|
|
2992
|
+
// Local files and the provider only, so they run beside the deployment
|
|
2993
|
+
// reads.
|
|
2994
|
+
wants("billing") ? billingCatalogFindings(rootDir, env) : [],
|
|
2995
|
+
// The funnel's activation kind, recorded by a backend file; then the
|
|
2996
|
+
// Revenue view's metrics read, with the token visible here (analytics).
|
|
2997
|
+
wants("analytics") ? Promise.resolve(activationFindings(rootDir)) : [],
|
|
2998
|
+
wants("analytics") ? metricsAccessFindings({ accessToken: env.BILLING_ACCESS_TOKEN, environment: billingEnvironment(parseBackendEnvironment(env.BACKEND_ENVIRONMENT)) }) : []
|
|
2999
|
+
]);
|
|
3000
|
+
const findings = [
|
|
3001
|
+
...collectPreflightFindings({
|
|
3002
|
+
env,
|
|
3003
|
+
siteUrlConfigured: Boolean(siteUrl),
|
|
3004
|
+
...deployed ? { deployedNames: new Set(deployed) } : {}
|
|
3005
|
+
}),
|
|
3006
|
+
...wants("scaffold") ? await scaffoldFindings(rootDir, appConfig) : [],
|
|
3007
|
+
// Under --prod the deployment is production's, whatever .env.local names.
|
|
3008
|
+
...deploymentEnvFindings(rootDir, deployed, { prod, ...deploymentRoute(computeDeployment(rootDir, env).kind, prod), posture }),
|
|
3009
|
+
...await localFeatureFindings(rootDir, { env, wants, deployed, prod, appConfig }),
|
|
3010
|
+
...surface,
|
|
3011
|
+
...catalog,
|
|
3012
|
+
...metrics
|
|
3013
|
+
].filter((reported) => wantsCapability(reported.capability));
|
|
3014
|
+
return prod ? applyProductionPosture(findings, posture ? /* @__PURE__ */ new Set(["deployment-backend-environment"]) : void 0) : findings;
|
|
3015
|
+
}
|
|
3016
|
+
|
|
3017
|
+
const doctor = {
|
|
3018
|
+
__proto__: null,
|
|
3019
|
+
billingCatalogFindings: billingCatalogFindings,
|
|
3020
|
+
probeWebhookRoute: probeWebhookRoute,
|
|
3021
|
+
runDoctorChecks: runDoctorChecks
|
|
3022
|
+
};
|
|
3023
|
+
|
|
3024
|
+
export { email as $, findPlanProduct as A, isUntaggedPlanProduct as B, planCreditUnits as C, planQuotasBenefits as D, providerTrialOf as E, pushPlanTrial as F, attachPlanQuotas as G, isFreePlan as H, BILLING_WEBHOOK_PROVISION_EVENTS as I, planProductKey as J, recordPlanProduct as K, loadGenerated as L, MANAGED_BY as M, renderGenerated as N, probeWebhookRoute as O, PROVIDER_COMPONENT as P, runEmailSync as Q, planSettingChanges as R, planEndpointChanges as S, applyProviderChanges as T, billingProviderTarget as U, providerClient as V, readProviderOrganization as W, readProviderEndpoint as X, emailSyncRefusal as Y, runDoctorChecks as Z, readProductionPosture as _, refuseInvalidPrices as a, runEnvDefaults as a0, bootstrapAdmin as a1, runEmailSyncCommand as a2, ENV_DEFAULT_TYPES as a3, REQUIRED_FUNCTION_EXPORTS as a4, doctor as a5, refuseInvalidGifts as b, refuseInvalidQuotas as c, refuseInvalidDiscounts as d, listAllPages as e, freePlanOf as f, refuseMissingDefaultCurrency as g, refuseUnpricedDiscounts as h, isManaged as i, ensurePlanQuotas as j, retirePlan as k, loadCatalog as l, attachRetiredPlanQuotas as m, recordQuotaKeys as n, packPricesByCurrency as o, pricedIntervals as p, syncDiscounts as q, refuseUnpricedPlans as r, syncPassProducts as s, planQuotasKeys as t, derivedPassKeys as u, droppedQuotasKeys as v, unpricedPlanProducts as w, providerClientOptions as x, planQuotasKey as y, planPricesByCurrency as z };
|