nuxt-backend 0.2.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/dist/chunks/catalog.mjs +1 -1
- package/dist/chunks/doctor.mjs +71 -12
- package/dist/chunks/email-previews.mjs +1 -1
- package/dist/chunks/health.mjs +2 -2
- package/dist/chunks/index.mjs +3 -3
- package/dist/chunks/install.mjs +4 -4
- package/dist/chunks/run.mjs +1 -1
- package/dist/chunks/server.mjs +7 -5
- package/dist/cli.mjs +122 -23
- package/dist/convex/account-data.d.ts +0 -2
- package/dist/convex/account-data.d.ts.map +1 -1
- package/dist/convex/account-data.js +0 -4
- package/dist/convex/account-data.js.map +1 -1
- package/dist/convex/catalog.d.ts +22 -0
- package/dist/convex/catalog.d.ts.map +1 -1
- package/dist/convex/catalog.js.map +1 -1
- package/dist/convex/client/better-auth-options.d.ts.map +1 -1
- package/dist/convex/client/better-auth-options.js +11 -1
- package/dist/convex/client/better-auth-options.js.map +1 -1
- 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/index.d.ts +34 -2
- package/dist/convex/client/index.d.ts.map +1 -1
- package/dist/convex/components/backend/_generated/component.d.ts +6 -0
- package/dist/convex/components/backend/_generated/component.d.ts.map +1 -1
- package/dist/convex/components/backend/account.d.ts +6 -6
- package/dist/convex/components/backend/account.d.ts.map +1 -1
- package/dist/convex/components/backend/account.js +6 -2
- package/dist/convex/components/backend/account.js.map +1 -1
- package/dist/convex/components/backend/adapter.d.ts.map +1 -1
- package/dist/convex/components/backend/adapter.js +4 -1
- package/dist/convex/components/backend/adapter.js.map +1 -1
- package/dist/convex/components/backend/ai.d.ts +11 -3
- package/dist/convex/components/backend/ai.d.ts.map +1 -1
- package/dist/convex/components/backend/ai.js +18 -52
- package/dist/convex/components/backend/ai.js.map +1 -1
- package/dist/convex/components/backend/billing.d.ts.map +1 -1
- package/dist/convex/components/backend/billing.js +12 -32
- package/dist/convex/components/backend/billing.js.map +1 -1
- package/dist/convex/components/backend/consents.d.ts.map +1 -1
- package/dist/convex/components/backend/consents.js +2 -1
- package/dist/convex/components/backend/consents.js.map +1 -1
- package/dist/convex/components/backend/gifts.d.ts +1 -1
- package/dist/convex/components/backend/gifts.d.ts.map +1 -1
- package/dist/convex/components/backend/gifts.js +9 -4
- package/dist/convex/components/backend/gifts.js.map +1 -1
- package/dist/convex/components/backend/lifecycle.d.ts.map +1 -1
- package/dist/convex/components/backend/lifecycle.js +18 -14
- package/dist/convex/components/backend/lifecycle.js.map +1 -1
- package/dist/convex/components/backend/notifications.d.ts +13 -0
- package/dist/convex/components/backend/notifications.d.ts.map +1 -1
- package/dist/convex/components/backend/notifications.js +21 -0
- package/dist/convex/components/backend/notifications.js.map +1 -1
- package/dist/convex/components/backend/referrals.d.ts.map +1 -1
- package/dist/convex/components/backend/referrals.js +13 -16
- package/dist/convex/components/backend/referrals.js.map +1 -1
- package/dist/convex/components/backend/reports.js +7 -7
- package/dist/convex/components/backend/reports.js.map +1 -1
- package/dist/convex/components/backend/schema.d.ts +151 -35
- package/dist/convex/components/backend/schema.d.ts.map +1 -1
- package/dist/convex/components/backend/schema.js +127 -153
- package/dist/convex/components/backend/schema.js.map +1 -1
- package/dist/convex/components/backend/storage.d.ts.map +1 -1
- package/dist/convex/components/backend/storage.js +10 -10
- package/dist/convex/components/backend/storage.js.map +1 -1
- package/dist/convex/components/backend/subscriptions.d.ts +3 -3
- package/dist/convex/components/backend/subscriptions.d.ts.map +1 -1
- package/dist/convex/components/backend/subscriptions.js +6 -35
- package/dist/convex/components/backend/subscriptions.js.map +1 -1
- package/dist/convex/components/backend/waitlist.d.ts +1 -1
- package/dist/convex/components/backend/webhooks.d.ts +0 -1
- package/dist/convex/components/backend/webhooks.d.ts.map +1 -1
- package/dist/convex/components/backend/webhooks.js +1 -1
- package/dist/convex/components/backend/webhooks.js.map +1 -1
- package/dist/convex/consent-rules.d.ts +0 -2
- package/dist/convex/consent-rules.d.ts.map +1 -1
- package/dist/convex/consent-rules.js.map +1 -1
- package/dist/convex/constants.d.ts +0 -1
- package/dist/convex/constants.d.ts.map +1 -1
- package/dist/convex/constants.js +0 -1
- package/dist/convex/constants.js.map +1 -1
- package/dist/convex/email-templates.d.ts +0 -1
- package/dist/convex/email-templates.d.ts.map +1 -1
- package/dist/convex/email-templates.js +0 -1
- package/dist/convex/email-templates.js.map +1 -1
- package/dist/convex/integrations/admin.d.ts +2 -1
- package/dist/convex/integrations/admin.d.ts.map +1 -1
- package/dist/convex/integrations/admin.js.map +1 -1
- package/dist/convex/integrations/ai/job-errors.d.ts +7 -0
- package/dist/convex/integrations/ai/job-errors.d.ts.map +1 -1
- package/dist/convex/integrations/ai/job-errors.js +22 -0
- package/dist/convex/integrations/ai/job-errors.js.map +1 -1
- package/dist/convex/integrations/ai/metering.d.ts +12 -0
- package/dist/convex/integrations/ai/metering.d.ts.map +1 -1
- package/dist/convex/integrations/ai/metering.js +19 -10
- package/dist/convex/integrations/ai/metering.js.map +1 -1
- package/dist/convex/integrations/ai/models.d.ts.map +1 -1
- package/dist/convex/integrations/ai/models.js +3 -1
- package/dist/convex/integrations/ai/models.js.map +1 -1
- package/dist/convex/integrations/ai/moderation.d.ts +2 -0
- package/dist/convex/integrations/ai/moderation.d.ts.map +1 -1
- package/dist/convex/integrations/ai/moderation.js +29 -2
- package/dist/convex/integrations/ai/moderation.js.map +1 -1
- package/dist/convex/integrations/ai/stream.d.ts +1 -1
- package/dist/convex/integrations/ai/stream.d.ts.map +1 -1
- package/dist/convex/integrations/ai/stream.js +3 -11
- package/dist/convex/integrations/ai/stream.js.map +1 -1
- package/dist/convex/integrations/billing/context.d.ts +0 -1
- package/dist/convex/integrations/billing/context.d.ts.map +1 -1
- package/dist/convex/integrations/billing/context.js +1 -4
- package/dist/convex/integrations/billing/context.js.map +1 -1
- package/dist/convex/integrations/billing/credits.d.ts.map +1 -1
- package/dist/convex/integrations/billing/customers.d.ts.map +1 -1
- package/dist/convex/integrations/billing/customers.js +25 -5
- package/dist/convex/integrations/billing/customers.js.map +1 -1
- package/dist/convex/integrations/billing/features.d.ts.map +1 -1
- package/dist/convex/integrations/billing/free-plan.d.ts +1 -1
- package/dist/convex/integrations/billing/free-plan.d.ts.map +1 -1
- package/dist/convex/integrations/billing/free-plan.js +18 -4
- package/dist/convex/integrations/billing/free-plan.js.map +1 -1
- package/dist/convex/integrations/billing/functions.d.ts +5 -1
- package/dist/convex/integrations/billing/functions.d.ts.map +1 -1
- package/dist/convex/integrations/billing/functions.js +16 -5
- package/dist/convex/integrations/billing/functions.js.map +1 -1
- package/dist/convex/integrations/billing/gifts.d.ts.map +1 -1
- package/dist/convex/integrations/billing/gifts.js +2 -2
- package/dist/convex/integrations/billing/gifts.js.map +1 -1
- package/dist/convex/integrations/billing/history.d.ts.map +1 -1
- package/dist/convex/integrations/billing/history.js +3 -1
- package/dist/convex/integrations/billing/history.js.map +1 -1
- package/dist/convex/integrations/billing/lifecycle.d.ts +4 -1
- package/dist/convex/integrations/billing/lifecycle.d.ts.map +1 -1
- package/dist/convex/integrations/billing/lifecycle.js +33 -2
- package/dist/convex/integrations/billing/lifecycle.js.map +1 -1
- package/dist/convex/integrations/billing/passes.d.ts +0 -2
- package/dist/convex/integrations/billing/passes.d.ts.map +1 -1
- package/dist/convex/integrations/billing/passes.js +2 -3
- package/dist/convex/integrations/billing/passes.js.map +1 -1
- package/dist/convex/integrations/billing/pricing.d.ts +4 -1
- package/dist/convex/integrations/billing/pricing.d.ts.map +1 -1
- package/dist/convex/integrations/billing/pricing.js +11 -9
- package/dist/convex/integrations/billing/pricing.js.map +1 -1
- package/dist/convex/integrations/billing/purchase.d.ts.map +1 -1
- package/dist/convex/integrations/billing/purchase.js +1 -2
- package/dist/convex/integrations/billing/purchase.js.map +1 -1
- package/dist/convex/integrations/billing/quotas.d.ts.map +1 -1
- package/dist/convex/integrations/billing/subscriptions.d.ts.map +1 -1
- package/dist/convex/integrations/billing/types/lifecycle.d.ts +12 -0
- package/dist/convex/integrations/billing/types/lifecycle.d.ts.map +1 -1
- package/dist/convex/integrations/billing/types/options.d.ts +4 -1
- package/dist/convex/integrations/billing/types/options.d.ts.map +1 -1
- package/dist/convex/integrations/billing/types/records.d.ts +7 -1
- package/dist/convex/integrations/billing/types/records.d.ts.map +1 -1
- package/dist/convex/integrations/billing/types/surface.d.ts +5 -1
- package/dist/convex/integrations/billing/types/surface.d.ts.map +1 -1
- package/dist/convex/integrations/billing.d.ts +2 -2
- package/dist/convex/integrations/billing.d.ts.map +1 -1
- package/dist/convex/integrations/billing.js +1 -0
- package/dist/convex/integrations/billing.js.map +1 -1
- package/dist/convex/integrations/email-preferences.d.ts +1 -1
- package/dist/convex/integrations/email-preferences.d.ts.map +1 -1
- package/dist/convex/integrations/email-sync.d.ts.map +1 -1
- package/dist/convex/integrations/email-sync.js +43 -1
- package/dist/convex/integrations/email-sync.js.map +1 -1
- package/dist/convex/integrations/notifications.d.ts +24 -4
- package/dist/convex/integrations/notifications.d.ts.map +1 -1
- package/dist/convex/integrations/notifications.js +30 -14
- package/dist/convex/integrations/notifications.js.map +1 -1
- package/dist/convex/integrations/rate-limit.d.ts +6 -5
- package/dist/convex/integrations/rate-limit.d.ts.map +1 -1
- package/dist/convex/integrations/rate-limit.js +6 -5
- package/dist/convex/integrations/rate-limit.js.map +1 -1
- package/dist/convex/integrations/reports.d.ts +1 -1
- package/dist/convex/integrations/reports.d.ts.map +1 -1
- package/dist/convex/integrations/reports.js +0 -11
- package/dist/convex/integrations/reports.js.map +1 -1
- package/dist/convex/integrations/webhooks.d.ts +1 -3
- package/dist/convex/integrations/webhooks.d.ts.map +1 -1
- package/dist/convex/integrations/webhooks.js.map +1 -1
- package/dist/convex/label-groups/cancelFlow.d.ts +3 -0
- package/dist/convex/label-groups/cancelFlow.d.ts.map +1 -1
- package/dist/convex/label-groups/cancelFlow.js +5 -0
- package/dist/convex/label-groups/cancelFlow.js.map +1 -1
- package/dist/convex/label-groups/credits.d.ts +14 -1
- package/dist/convex/label-groups/credits.d.ts.map +1 -1
- package/dist/convex/label-groups/credits.js +17 -2
- package/dist/convex/label-groups/credits.js.map +1 -1
- package/dist/convex/label-groups/notifications.d.ts +19 -2
- package/dist/convex/label-groups/notifications.d.ts.map +1 -1
- package/dist/convex/label-groups/notifications.js +19 -15
- package/dist/convex/label-groups/notifications.js.map +1 -1
- package/dist/convex/label-groups/pricing.js +8 -8
- package/dist/convex/label-groups/pricing.js.map +1 -1
- package/dist/convex/label-groups/settings.d.ts.map +1 -1
- package/dist/convex/label-groups/settings.js +4 -3
- package/dist/convex/label-groups/settings.js.map +1 -1
- package/dist/convex/label-groups/usage.d.ts +1 -1
- package/dist/convex/label-groups/usage.d.ts.map +1 -1
- package/dist/convex/label-groups/usage.js +2 -2
- package/dist/convex/label-groups/usage.js.map +1 -1
- package/dist/convex/label-translations.d.ts.map +1 -1
- package/dist/convex/label-translations.js +52 -0
- package/dist/convex/label-translations.js.map +1 -1
- package/dist/convex/labels.d.ts +23 -0
- package/dist/convex/labels.d.ts.map +1 -1
- package/dist/convex/log.js +2 -0
- package/dist/convex/log.js.map +1 -1
- package/dist/convex/notifications.d.ts +77 -0
- package/dist/convex/notifications.d.ts.map +1 -1
- package/dist/convex/notifications.js +64 -13
- package/dist/convex/notifications.js.map +1 -1
- package/dist/convex/proof.d.ts +25 -0
- package/dist/convex/proof.d.ts.map +1 -1
- package/dist/convex/proof.js +39 -0
- package/dist/convex/proof.js.map +1 -1
- package/dist/convex/referral-rules.d.ts +0 -2
- package/dist/convex/referral-rules.d.ts.map +1 -1
- package/dist/convex/referral-rules.js +0 -2
- package/dist/convex/referral-rules.js.map +1 -1
- package/dist/convex/waitlist-rules.d.ts +1 -13
- package/dist/convex/waitlist-rules.d.ts.map +1 -1
- package/dist/convex/waitlist-rules.js +2 -14
- package/dist/convex/waitlist-rules.js.map +1 -1
- package/dist/devtools-client/index.html +1 -1
- package/dist/module.js +2 -2
- package/dist/module.json +1 -1
- package/dist/runtime/locales/de.json +47 -24
- package/dist/runtime/locales/en.json +47 -24
- package/dist/runtime/locales/es.json +47 -24
- package/dist/runtime/locales/fr.json +47 -24
- package/dist/runtime/locales/ru.json +47 -24
- package/dist/runtime/server/protection/gate.d.ts +4 -2
- package/dist/runtime/server/protection/gate.js +14 -4
- 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 +16 -11
- package/dist/runtime/vue/auth-client.js +3 -1
- package/dist/runtime/vue/components/admin/AdminUsers.d.vue.ts +1 -1
- package/dist/runtime/vue/components/admin/AdminUsers.vue.d.ts +1 -1
- package/dist/runtime/vue/components/billing/BillingCheckoutLink.d.vue.ts +1 -1
- package/dist/runtime/vue/components/billing/BillingCheckoutLink.vue.d.ts +1 -1
- package/dist/runtime/vue/components/billing/CancelFlow.css +1 -1
- package/dist/runtime/vue/components/billing/CancelFlow.d.vue.ts +3 -0
- package/dist/runtime/vue/components/billing/CancelFlow.vue +10 -3
- package/dist/runtime/vue/components/billing/CancelFlow.vue.d.ts +3 -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/CancelFlowQuestion.vue +2 -1
- package/dist/runtime/vue/components/billing/GiftSent.d.vue.ts +2 -2
- package/dist/runtime/vue/components/billing/GiftSent.vue.d.ts +2 -2
- package/dist/runtime/vue/components/billing/PricingPackCard.vue +6 -3
- package/dist/runtime/vue/components/billing/PricingPlanCard.vue +3 -1
- package/dist/runtime/vue/components/billing/PricingTable.d.vue.ts +2 -2
- package/dist/runtime/vue/components/billing/PricingTable.vue +3 -1
- package/dist/runtime/vue/components/billing/PricingTable.vue.d.ts +2 -2
- package/dist/runtime/vue/components/billing/UsageHistoryEvent.vue +3 -1
- package/dist/runtime/vue/components/billing/cancel-flow.d.ts +28 -7
- package/dist/runtime/vue/components/billing/cancel-flow.js +25 -2
- package/dist/runtime/vue/components/shell/NoticeLowCredits.vue +3 -1
- package/dist/runtime/vue/components/tokens.css +1 -1
- package/dist/runtime/vue/components/workspaces/WorkspaceCredits.vue +6 -3
- package/dist/runtime/vue/components/workspaces/WorkspaceSettings.d.vue.ts +2 -2
- package/dist/runtime/vue/components/workspaces/WorkspaceSettings.vue.d.ts +2 -2
- package/dist/runtime/vue/composables/use-auth.d.ts +13 -1
- package/dist/runtime/vue/composables/use-auth.js +4 -1
- package/dist/runtime/vue/composables/use-billing.d.ts +10 -2
- package/dist/runtime/vue/composables/use-credits.d.ts +3 -0
- package/dist/runtime/vue/composables/use-credits.js +1 -0
- package/dist/runtime/vue/composables/use-notifications.d.ts +5 -1
- package/dist/runtime/vue/composables/use-notifications.js +12 -4
- package/dist/runtime/vue/composables/use-webhook-log.d.ts +4 -2
- package/dist/runtime/vue/organization-client.d.ts +15 -0
- package/dist/runtime/vue/organization-client.js +65 -0
- package/dist/runtime/vue/parts.d.ts +2 -1
- package/dist/runtime/vue/plugins/checkout-return.d.ts +3 -2
- package/dist/runtime/vue/plugins/checkout-return.js +2 -4
- package/dist/runtime/vue/plugins/first-touch.js +2 -4
- package/dist/runtime/vue/utils/checkout-return.d.ts +9 -2
- package/dist/runtime/vue/utils/checkout-return.js +2 -1
- 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/meter-unit.d.ts +14 -0
- package/dist/runtime/vue/utils/meter-unit.js +18 -0
- package/dist/shared/{nuxt-backend.2YoiKo8j.mjs → nuxt-backend.2m535CLS.mjs} +6 -2
- package/dist/shared/{nuxt-backend.CPq101Wi.mjs → nuxt-backend.DXEf0rrv.mjs} +1 -1
- package/dist/shared/{nuxt-backend.-uB5CGw-.mjs → nuxt-backend.Dm1NkY7v.mjs} +1 -1
- package/dist/shared/{nuxt-backend.OQMX-0U7.mjs → nuxt-backend.KEzfHO2K.mjs} +6 -3
- package/dist/shared/{nuxt-backend.S5C2b-4I.mjs → nuxt-backend.ikObmtHs.mjs} +2 -2
- package/package.json +2 -2
- package/skills/nuxt-backend/references/api.md +13 -3
- package/skills/nuxt-backend/references/surface.json +12 -0
- package/skills/nuxt-backend-auth/SKILL.md +2 -1
- package/skills/nuxt-backend-billing/SKILL.md +7 -0
- package/skills/nuxt-backend-billing/references/api.md +12 -2
- package/skills/nuxt-backend-data/SKILL.md +4 -1
- package/skills/nuxt-backend-email/SKILL.md +4 -0
- package/skills/nuxt-backend-email/references/api.md +1 -1
- package/skills/nuxt-backend-ui/SKILL.md +6 -5
- package/src/convex/account-data.ts +0 -5
- package/src/convex/catalog.ts +23 -0
- package/src/convex/client/better-auth-options.ts +11 -1
- package/src/convex/client/client-address.ts +37 -0
- package/src/convex/components/backend/_generated/component.ts +12 -0
- package/src/convex/components/backend/account.ts +7 -2
- package/src/convex/components/backend/adapter.ts +4 -1
- package/src/convex/components/backend/ai.ts +20 -54
- package/src/convex/components/backend/billing.ts +14 -33
- package/src/convex/components/backend/consents.ts +2 -1
- package/src/convex/components/backend/gifts.ts +11 -5
- package/src/convex/components/backend/lifecycle.ts +17 -12
- package/src/convex/components/backend/notifications.ts +22 -0
- package/src/convex/components/backend/referrals.ts +14 -16
- package/src/convex/components/backend/reports.ts +7 -7
- package/src/convex/components/backend/schema.ts +143 -161
- package/src/convex/components/backend/storage.ts +11 -10
- package/src/convex/components/backend/subscriptions.ts +7 -35
- package/src/convex/components/backend/webhooks.ts +1 -10
- package/src/convex/consent-rules.ts +0 -3
- package/src/convex/constants.ts +0 -1
- package/src/convex/email-templates.ts +0 -1
- package/src/convex/integrations/admin.ts +2 -1
- package/src/convex/integrations/ai/job-errors.ts +21 -0
- package/src/convex/integrations/ai/metering.ts +24 -10
- package/src/convex/integrations/ai/models.ts +3 -1
- package/src/convex/integrations/ai/moderation.ts +31 -2
- package/src/convex/integrations/ai/stream.ts +3 -11
- package/src/convex/integrations/billing/context.ts +1 -9
- package/src/convex/integrations/billing/customers.ts +28 -5
- package/src/convex/integrations/billing/free-plan.ts +20 -5
- package/src/convex/integrations/billing/functions.ts +17 -5
- package/src/convex/integrations/billing/gifts.ts +2 -2
- package/src/convex/integrations/billing/history.ts +2 -1
- package/src/convex/integrations/billing/lifecycle.ts +30 -3
- package/src/convex/integrations/billing/passes.ts +2 -4
- package/src/convex/integrations/billing/pricing.ts +14 -10
- package/src/convex/integrations/billing/purchase.ts +1 -2
- package/src/convex/integrations/billing/types/lifecycle.ts +13 -0
- package/src/convex/integrations/billing/types/options.ts +4 -1
- package/src/convex/integrations/billing/types/records.ts +7 -1
- package/src/convex/integrations/billing/types/surface.ts +3 -1
- package/src/convex/integrations/billing.ts +3 -2
- package/src/convex/integrations/email-preferences.ts +1 -1
- package/src/convex/integrations/email-sync.ts +44 -1
- package/src/convex/integrations/notifications.ts +65 -16
- package/src/convex/integrations/rate-limit.ts +6 -5
- package/src/convex/integrations/reports.ts +1 -1
- package/src/convex/integrations/webhooks.ts +1 -4
- package/src/convex/label-groups/cancelFlow.ts +5 -0
- package/src/convex/label-groups/credits.ts +17 -2
- package/src/convex/label-groups/notifications.ts +19 -15
- package/src/convex/label-groups/pricing.ts +8 -8
- package/src/convex/label-groups/settings.ts +4 -3
- package/src/convex/label-groups/usage.ts +2 -2
- package/src/convex/label-translations.ts +52 -0
- package/src/convex/log.ts +2 -0
- package/src/convex/notifications.ts +99 -13
- package/src/convex/proof.ts +43 -0
- package/src/convex/referral-rules.ts +0 -2
- package/src/convex/waitlist-rules.ts +2 -22
- package/src/runtime/vue/components/billing/CancelFlow.css +16 -0
- package/src/runtime/vue/components/billing/CancelFlow.vue +16 -6
- package/src/runtime/vue/components/billing/CancelFlowConfirm.vue +35 -0
- package/src/runtime/vue/components/billing/CancelFlowQuestion.vue +8 -2
- package/src/runtime/vue/components/billing/PricingPackCard.vue +6 -3
- package/src/runtime/vue/components/billing/PricingPlanCard.vue +3 -1
- package/src/runtime/vue/components/billing/PricingTable.vue +3 -1
- package/src/runtime/vue/components/billing/UsageHistoryEvent.vue +3 -1
- package/src/runtime/vue/components/shell/NoticeLowCredits.vue +3 -1
- package/src/runtime/vue/components/tokens.css +19 -15
- package/src/runtime/vue/components/workspaces/WorkspaceCredits.vue +6 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { computed, inject, toValue } from "vue";
|
|
2
2
|
import { useBetterAuth } from "nuxt-convex-module/better-auth/client";
|
|
3
3
|
import { ConvexAuthStateKey, useMutation, usePaginatedQuery_experimental } from "nuxt-convex-module/client";
|
|
4
|
-
import { NOTIFICATION_KINDS, NOTIFICATION_PAGE_MAX, notificationLabelKey } from "../../../convex/notifications";
|
|
4
|
+
import { NOTIFICATION_KINDS, NOTIFICATION_PAGE_MAX, notificationLabelKey, notificationWordKeys } from "../../../convex/notifications";
|
|
5
5
|
import { useActionState } from "../utils/action-state.js";
|
|
6
6
|
import { failureOf } from "../utils/backend-error.js";
|
|
7
7
|
import { absentQuery, useLiveQuery } from "../utils/live-query.js";
|
|
@@ -46,20 +46,28 @@ export function useNotifications(options = {}) {
|
|
|
46
46
|
const kind = Object.hasOwn(NOTIFICATION_KINDS, entry.type) ? NOTIFICATION_KINDS[entry.type] : void 0;
|
|
47
47
|
return kind ? pages[kind.page].value : null;
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function part(entry, name, params) {
|
|
50
50
|
const key = notificationLabelKey(entry.type);
|
|
51
|
+
for (const label of notificationWordKeys(name, entry.entity ?? null)) {
|
|
52
|
+
const text = words(`${key}.${label}`, params);
|
|
53
|
+
if (text !== null) return text;
|
|
54
|
+
}
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
function worded(entry) {
|
|
51
58
|
const params = paramsOf(entry);
|
|
52
59
|
return {
|
|
53
60
|
id: entry.id,
|
|
54
61
|
type: entry.type,
|
|
55
|
-
title:
|
|
56
|
-
body:
|
|
62
|
+
title: part(entry, "title", params) ?? labels.t("fallbackTitle"),
|
|
63
|
+
body: part(entry, "body", params),
|
|
57
64
|
link: linkOf(entry),
|
|
58
65
|
at: entry.at,
|
|
59
66
|
read: entry.readAt !== null,
|
|
60
67
|
channels: entry.channels,
|
|
61
68
|
actor: entry.actor,
|
|
62
69
|
workspace: entry.workspace,
|
|
70
|
+
entity: entry.entity ?? null,
|
|
63
71
|
data: entry.data
|
|
64
72
|
};
|
|
65
73
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { FunctionReference } from 'convex/server';
|
|
2
2
|
import { type ComputedRef } from 'vue';
|
|
3
|
-
import type {
|
|
3
|
+
import type { WebhookService } from '../../../convex/integrations/webhook-guard.js';
|
|
4
|
+
import type { WebhookDeliveryRow, WebhookReplay } from '../../../convex/integrations/webhooks.js';
|
|
4
5
|
import type { BackendError } from '../utils/backend-error.js';
|
|
5
|
-
export type {
|
|
6
|
+
export type { WebhookService } from '../../../convex/integrations/webhook-guard.js';
|
|
7
|
+
export type { WebhookDeliveryRow, WebhookReplay } from '../../../convex/integrations/webhooks.js';
|
|
6
8
|
/** The functions `backend/webhooks.ts` re-exports. */
|
|
7
9
|
export interface WebhookLogApiRefs {
|
|
8
10
|
getWebhookDeliveries?: FunctionReference<'query', 'public', {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { organizationClient as betterAuthOrganizationClient, OrganizationClientOptions } from 'better-auth/client/plugins';
|
|
2
|
+
/** Better Auth's organization client plugin, as `organizationClient()` from `better-auth/client/plugins` returns it. */
|
|
3
|
+
export type OrganizationClientPlugin = ReturnType<typeof betterAuthOrganizationClient<OrganizationClientOptions>>;
|
|
4
|
+
/**
|
|
5
|
+
* Better Auth's organization client plugin without its error-code table,
|
|
6
|
+
* for the reason ./admin-client gives: the plugin is in every page's entry,
|
|
7
|
+
* and its `$ERROR_CODES` table (more than half of it) is type-level for a
|
|
8
|
+
* client plugin. The rest is Better Auth's: the workspace atoms
|
|
9
|
+
* (`activeOrganization`, `listOrganizations`, `activeMember`,
|
|
10
|
+
* `activeMemberRole`), the signals that refresh them and the session, and
|
|
11
|
+
* `checkRolePermission` against the default roles.
|
|
12
|
+
*
|
|
13
|
+
* test/unit/role-clients.test.ts holds it to Better Auth's own plugin.
|
|
14
|
+
*/
|
|
15
|
+
export declare function organizationClient(): OrganizationClientPlugin;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { useAuthQuery } from "better-auth/client";
|
|
2
|
+
import { adminAc, memberAc, ownerAc } from "better-auth/plugins/organization/access";
|
|
3
|
+
import { atom } from "nanostores";
|
|
4
|
+
const roles = { admin: adminAc, member: memberAc, owner: ownerAc };
|
|
5
|
+
export function organizationClient() {
|
|
6
|
+
const $listOrg = atom(false);
|
|
7
|
+
const $activeOrgSignal = atom(false);
|
|
8
|
+
const $activeMemberSignal = atom(false);
|
|
9
|
+
const $activeMemberRoleSignal = atom(false);
|
|
10
|
+
const plugin = {
|
|
11
|
+
id: "organization",
|
|
12
|
+
// Type-level only, as in Better Auth's plugin: the server plugin it pairs with.
|
|
13
|
+
$InferServerPlugin: {},
|
|
14
|
+
getActions: () => ({
|
|
15
|
+
// Type-level only, as in Better Auth's actions.
|
|
16
|
+
$Infer: {},
|
|
17
|
+
organization: {
|
|
18
|
+
checkRolePermission: (data) => {
|
|
19
|
+
if (!data.permissions) return false;
|
|
20
|
+
for (const role of data.role.split(",")) {
|
|
21
|
+
if (roles[role]?.authorize(data.permissions).success) return true;
|
|
22
|
+
}
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}),
|
|
27
|
+
getAtoms: ($fetch) => ({
|
|
28
|
+
$listOrg,
|
|
29
|
+
$activeOrgSignal,
|
|
30
|
+
$activeMemberSignal,
|
|
31
|
+
$activeMemberRoleSignal,
|
|
32
|
+
activeOrganization: useAuthQuery([$activeOrgSignal], "/organization/get-full-organization", $fetch, () => ({ method: "GET" })),
|
|
33
|
+
listOrganizations: useAuthQuery($listOrg, "/organization/list", $fetch, { method: "GET" }),
|
|
34
|
+
activeMember: useAuthQuery([$activeOrgSignal, $activeMemberSignal], "/organization/get-active-member", $fetch, { method: "GET" }),
|
|
35
|
+
activeMemberRole: useAuthQuery([$activeOrgSignal, $activeMemberRoleSignal], "/organization/get-active-member-role", $fetch, { method: "GET" })
|
|
36
|
+
}),
|
|
37
|
+
pathMethods: {
|
|
38
|
+
"/organization/get-full-organization": "GET",
|
|
39
|
+
"/organization/list-user-teams": "GET"
|
|
40
|
+
},
|
|
41
|
+
atomListeners: [
|
|
42
|
+
{
|
|
43
|
+
matcher: (path) => path === "/organization/create" || path === "/organization/delete" || path === "/organization/update",
|
|
44
|
+
signal: "$listOrg"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
matcher: (path) => path === "/sign-out" || path.startsWith("/organization"),
|
|
48
|
+
signal: "$activeOrgSignal"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
matcher: (path) => path.startsWith("/organization/set-active") || path === "/organization/create" || path === "/organization/delete" || path === "/organization/remove-member" || path === "/organization/leave" || path === "/organization/accept-invitation",
|
|
52
|
+
signal: "$sessionSignal"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
matcher: (path) => path.includes("/organization/update-member-role") || path.startsWith("/organization/set-active"),
|
|
56
|
+
signal: "$activeMemberSignal"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
matcher: (path) => path.includes("/organization/update-member-role") || path.startsWith("/organization/set-active"),
|
|
60
|
+
signal: "$activeMemberRoleSignal"
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
};
|
|
64
|
+
return plugin;
|
|
65
|
+
}
|
|
@@ -22,13 +22,14 @@ import type { ResolvedPack, ResolvedPlan } from './components/billing/pricing-ta
|
|
|
22
22
|
import type { AdminUserRow, AdminWorkspaceRow } from './components/admin/admin.js';
|
|
23
23
|
import type { InvitationView } from './components/workspaces/accept-invitation.js';
|
|
24
24
|
export type { ResolvedPack, ResolvedPlan } from './components/billing/pricing-table.js';
|
|
25
|
-
/** The parts of `<CancelFlow>`: `CancelFlowQuestion`, `CancelFlowOffer` and `CancelFlowEnd`. */
|
|
25
|
+
/** The parts of `<CancelFlow>`: `CancelFlowQuestion`, `CancelFlowOffer`, `CancelFlowConfirm` and `CancelFlowEnd`. */
|
|
26
26
|
export interface CancelFlowPartProps {
|
|
27
27
|
/** The cancel flow `<CancelFlow>` runs: `useCancelFlow()`. */
|
|
28
28
|
flow: UseCancelFlowReturn;
|
|
29
29
|
}
|
|
30
30
|
export type CancelFlowQuestionProps = CancelFlowPartProps;
|
|
31
31
|
export type CancelFlowOfferProps = CancelFlowPartProps;
|
|
32
|
+
export type CancelFlowConfirmProps = CancelFlowPartProps;
|
|
32
33
|
export type CancelFlowEndProps = CancelFlowPartProps;
|
|
33
34
|
/** The sign-in parts of `<AuthForm>`: `AuthFormHeader`, `AuthFormChoose`, `AuthFormPasskey`, `AuthFormEmail`, `AuthFormCode`, `AuthFormRecover`, `AuthFormWaitlisted`, `AuthFormInviteCode`, `AuthFormAge`, `AuthFormUndeliverable`, `AuthFormPasskeyOffer`, `AuthFormAgreement`, `AuthFormError`. */
|
|
34
35
|
export interface AuthFormPartProps {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Finishes a return from checkout. The server sends a plan or pack checkout,
|
|
3
3
|
* and a gift's claim, back with the checkout's id as `?checkout_return=`;
|
|
4
|
-
* on a page that has it, this takes the parameter off the address
|
|
5
|
-
*
|
|
4
|
+
* on a page that has it, this takes the parameter off the address, with the
|
|
5
|
+
* `customer_session_token` the provider adds beside it (a key to the
|
|
6
|
+
* customer's billing portal), and refreshes the entitlements once, while
|
|
6
7
|
* `useBilling().isFinishingCheckout` says so, which the billing section of
|
|
7
8
|
* `<WorkspaceSettings>` and `<PricingTable>` read out as "Finishing your
|
|
8
9
|
* purchase…". Always on. An app's own `checkout_id` is never touched.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { defineNuxtPlugin, useRouter } from "#imports";
|
|
2
|
+
import { onEveryPage } from "../utils/every-page.js";
|
|
2
3
|
import { CHECKOUT_RETURN_PARAM } from "../../../convex/constants.js";
|
|
3
4
|
export default defineNuxtPlugin({
|
|
4
5
|
name: "nuxt-backend:checkout-return",
|
|
@@ -15,9 +16,6 @@ export default defineNuxtPlugin({
|
|
|
15
16
|
if (import.meta.dev) console.error("[nuxt-backend] the checkout return could not finish:", cause);
|
|
16
17
|
});
|
|
17
18
|
};
|
|
18
|
-
nuxtApp
|
|
19
|
-
router.afterEach((_to, from) => {
|
|
20
|
-
if (from.matched.length > 0) check();
|
|
21
|
-
});
|
|
19
|
+
onEveryPage(nuxtApp, router, check);
|
|
22
20
|
}
|
|
23
21
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { defineNuxtPlugin, useRouter } from "#imports";
|
|
2
|
+
import { onEveryPage } from "../utils/every-page.js";
|
|
2
3
|
const tagged = (query) => Object.keys(query).some((name) => name.startsWith("utm_"));
|
|
3
4
|
export default defineNuxtPlugin({
|
|
4
5
|
name: "nuxt-backend:first-touch",
|
|
@@ -11,9 +12,6 @@ export default defineNuxtPlugin({
|
|
|
11
12
|
if (import.meta.dev) console.error("[nuxt-backend] the campaign could not be recorded:", cause);
|
|
12
13
|
});
|
|
13
14
|
};
|
|
14
|
-
nuxtApp
|
|
15
|
-
router.afterEach((_to, from) => {
|
|
16
|
-
if (from.matched.length > 0) check();
|
|
17
|
-
});
|
|
15
|
+
onEveryPage(nuxtApp, router, check);
|
|
18
16
|
}
|
|
19
17
|
});
|
|
@@ -6,17 +6,24 @@ import type { LocationQuery } from 'vue-router';
|
|
|
6
6
|
* it between requests.
|
|
7
7
|
*/
|
|
8
8
|
export declare const finishingCheckout: import("vue").ShallowRef<boolean, boolean>;
|
|
9
|
+
/**
|
|
10
|
+
* The token the billing provider appends to a checkout's success URL: a key
|
|
11
|
+
* to that customer's billing portal. Nothing in the package reads it, and a
|
|
12
|
+
* key has no place in an address that is bookmarked, shared and logged.
|
|
13
|
+
*/
|
|
14
|
+
export declare const CUSTOMER_SESSION_PARAM = "customer_session_token";
|
|
9
15
|
/** What finishing a return needs from the page. */
|
|
10
16
|
export interface CheckoutReturn {
|
|
11
17
|
/** The address's query. */
|
|
12
18
|
query: LocationQuery;
|
|
13
|
-
/** Replace the address's query with this one: the same address without the parameter. */
|
|
19
|
+
/** Replace the address's query with this one: the same address without the parameter and the provider's token. */
|
|
14
20
|
strip: (query: LocationQuery) => unknown;
|
|
15
21
|
/** Refresh the entitlements from the provider once. A failure is left to the webhooks. */
|
|
16
22
|
sync: () => Promise<unknown>;
|
|
17
23
|
}
|
|
18
24
|
/**
|
|
19
|
-
* Finish a return from checkout: take `checkout_return` off the address,
|
|
25
|
+
* Finish a return from checkout: take `checkout_return` off the address, with
|
|
26
|
+
* the provider's `customer_session_token` when it came along, then,
|
|
20
27
|
* once per checkout, refresh the entitlements while
|
|
21
28
|
* {@link finishingCheckout} is `true`. Answers whether a refresh ran and
|
|
22
29
|
* went through. A refresh that fails changes nothing the customer sees: the
|
|
@@ -4,12 +4,13 @@ import { ConvexAuthStateKey, useAction } from "nuxt-convex-module/client";
|
|
|
4
4
|
import { CHECKOUT_RETURN_PARAM } from "../../../convex/constants.js";
|
|
5
5
|
import { useBackendNamespace } from "./namespace.js";
|
|
6
6
|
export const finishingCheckout = shallowRef(false);
|
|
7
|
+
export const CUSTOMER_SESSION_PARAM = "customer_session_token";
|
|
7
8
|
const finished = /* @__PURE__ */ new Set();
|
|
8
9
|
const AUTH_WAIT_MS = 1e4;
|
|
9
10
|
export async function finishCheckoutReturn({ query, strip, sync }) {
|
|
10
11
|
const value = query[CHECKOUT_RETURN_PARAM];
|
|
11
12
|
if (value === void 0) return false;
|
|
12
|
-
const { [CHECKOUT_RETURN_PARAM]: _returned, ...rest } = query;
|
|
13
|
+
const { [CHECKOUT_RETURN_PARAM]: _returned, [CUSTOMER_SESSION_PARAM]: _token, ...rest } = query;
|
|
13
14
|
await strip(rest);
|
|
14
15
|
const id = (Array.isArray(value) ? value[0] : value) ?? "";
|
|
15
16
|
if (!id || finished.has(id)) return false;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { NuxtApp } from '#app';
|
|
2
|
+
import type { Router } from 'vue-router';
|
|
3
|
+
/**
|
|
4
|
+
* Run `check` on the page the app loaded on, then after each navigation
|
|
5
|
+
* inside the app: for a plugin that acts on a parameter of the address,
|
|
6
|
+
* which a page load or a link can bring. Only a navigation that landed: one
|
|
7
|
+
* a guard refused leaves the address as it was, and reading it again would
|
|
8
|
+
* act on the same parameter forever.
|
|
9
|
+
*/
|
|
10
|
+
export declare function onEveryPage(nuxtApp: Pick<NuxtApp, 'hook'>, router: Pick<Router, 'afterEach'>, check: () => void): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { MeterUnit } from '../../../convex/catalog.js';
|
|
2
|
+
/** What the packaged labels fill `{unit}` with: a meter's unit in the reader's words. */
|
|
3
|
+
export interface MeterUnitWords {
|
|
4
|
+
/**
|
|
5
|
+
* The unit's word for `count`, by the plural rules of the reader's
|
|
6
|
+
* language: the catalog's (`meters.<key>.unit`), else the `credits.unit`
|
|
7
|
+
* labels ("credits"). Without a count, the word for several, as "Buy
|
|
8
|
+
* {unit}" reads it. A plural category the unit does not name reads as
|
|
9
|
+
* `other`.
|
|
10
|
+
*/
|
|
11
|
+
word: (unit: MeterUnit | null | undefined, count?: number) => string;
|
|
12
|
+
/** The unit as a heading: the catalog's `other` with a capital, else `credits.unitTitle` ("Credits"). */
|
|
13
|
+
title: (unit: MeterUnit | null | undefined) => string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useLabels } from "../composables/use-labels.js";
|
|
2
|
+
import { inLocale } from "./intl.js";
|
|
3
|
+
const SEVERAL = 5;
|
|
4
|
+
export function useMeterUnit() {
|
|
5
|
+
const { lookup, locale } = useLabels("credits");
|
|
6
|
+
const category = (count) => inLocale(locale.value ?? "en", (tag) => new Intl.PluralRules(tag).select(count));
|
|
7
|
+
return {
|
|
8
|
+
word: (unit, count = SEVERAL) => {
|
|
9
|
+
const form = category(count);
|
|
10
|
+
if (unit) return unit[form] ?? unit.other;
|
|
11
|
+
return lookup(`credits.unit.${form}`) ?? lookup("credits.unit.other") ?? "";
|
|
12
|
+
},
|
|
13
|
+
title: (unit) => {
|
|
14
|
+
if (!unit) return lookup("credits.unitTitle") ?? "";
|
|
15
|
+
return inLocale(locale.value ?? "en", (tag) => unit.other.charAt(0).toLocaleUpperCase(tag)) + unit.other.slice(1);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync, writeFileSync, readFileSync } from 'node:fs';
|
|
2
2
|
import { resolve, join, delimiter } from 'node:path';
|
|
3
3
|
import { defineCommand } from 'citty';
|
|
4
|
-
import {
|
|
4
|
+
import { g as resolveFunctionsDir, q as scaffoldBackendFiles, A as configuredDeployment, E as isDevDeploymentId, bh as isEnvProvisioned, Y as devPushRefusal, bi as markEnvProvisioned, aO as finding, X as runEnvPush, p as spawnConvex } from './nuxt-backend.KEzfHO2K.mjs';
|
|
5
5
|
|
|
6
6
|
const COMMAND_CONTRACTS = /* @__PURE__ */ new Map();
|
|
7
7
|
function describeSideEffects(contract) {
|
|
@@ -16,6 +16,10 @@ function withContract(path, contract, command) {
|
|
|
16
16
|
meta: { ...meta, description: `${meta.description ?? ""} [${describeSideEffects(contract)}]`.trim() }
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
+
function finish(json, { exitCode, output }) {
|
|
20
|
+
if (json && output) console.log(JSON.stringify(output, null, 2));
|
|
21
|
+
if (exitCode !== 0) process.exitCode = exitCode;
|
|
22
|
+
}
|
|
19
23
|
function progress(json) {
|
|
20
24
|
return json ? (line) => console.error(line) : (line) => console.log(line);
|
|
21
25
|
}
|
|
@@ -164,4 +168,4 @@ const dev = withContract("dev", {
|
|
|
164
168
|
}
|
|
165
169
|
}));
|
|
166
170
|
|
|
167
|
-
export { adoptBackendDevScript as a, devScriptFinding as b, dev as d, progress as p, withContract as w };
|
|
171
|
+
export { adoptBackendDevScript as a, devScriptFinding as b, dev as d, finish as f, progress as p, withContract as w };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync, readFileSync, readdirSync } from 'node:fs';
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
|
-
import { aO as finding,
|
|
4
|
+
import { aO as finding, g as resolveFunctionsDir, bj as readSource, bk as parse, bl as keyOf, bm as writeSource, bn as REMOVED_ENV, bo as applyEdits, bp as walk, bq as BACKEND_FILE_TEMPLATES } from './nuxt-backend.KEzfHO2K.mjs';
|
|
5
5
|
|
|
6
6
|
const LAST_SCAFFOLD_MOUNT = "@convex-dev/workpool/convex.config";
|
|
7
7
|
const OPTIONAL_MOUNTS = [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useLogger, addPlugin, hasNuxtModule, addVitePlugin, addServerHandler, addNitroPlugin, extendRouteRules, extendPages, addTypeTemplate, addPluginTemplate, updateTemplates, addImports, addComponent, addServerImports, addRouteMiddleware, addTemplate, resolveModule, defineNuxtModule, createResolver } from '@nuxt/kit';
|
|
2
2
|
import { defu } from 'defu';
|
|
3
|
-
import {
|
|
3
|
+
import { g as resolveFunctionsDir, N as BACKEND_PAGE_DEFS, F as computeDeployment, Z as collectPreflightFindings, I as detectCapabilities, G as appMonitoringDsn, H as monitoringSdkInstalled, _ as OPTIONAL_DEPLOYMENT_ENV, $ as REQUIRED_DEPLOYMENT_ENV, a0 as deriveDeploymentUrls, a1 as provisionedEnvNames, a2 as appComponentIsStarter, r as readEnvFiles, a3 as resolveSiteUrl, W as formatPreflightSummary, a4 as needsSetup, a5 as AGENT_HINT, a6 as HEALTH_ROUTE, a7 as LOCAL_LOG_ROUTE, a8 as SOURCE_MAP_ENV, a9 as MONITORING_SDK, aa as pagesOptionProblems, ab as resolvedBackendPages, ac as DEFAULT_AUTH_ROUTE, R as REGISTERED_UI, ad as publishedBackendPages, ae as isPageOff, af as privatePagePaths, ag as collectExistingPagePaths, ah as adoptChildPages, ai as pageRouteRules, aj as cachingRulesOver, P as packageDir, x as appBrandOf, y as syncBrandFile, z as brandFileLocation, ak as PUSH_WORKER_URL, al as ownsManifest, am as MANIFEST_MODULES, an as installableGaps, ao as webAppManifest, ap as MANIFEST_ROUTE, u as syncPathsFile, v as backendPathsOf, w as pathsFileLocation, L as uiPath, aq as UI_SHARED_STYLES, ar as UI_ENTRIES, as as UI_INTERNALS, at as moduleDir, au as VISITOR_IP_ROUTE, av as resolvePagePath, aw as dependencyRange, ax as runsFromSource, U as packageVersion } from './nuxt-backend.KEzfHO2K.mjs';
|
|
4
4
|
import { backendAppConfigDefaults } from '../../dist/runtime/config.js';
|
|
5
5
|
import { existsSync, readFileSync, readdirSync, realpathSync } from 'node:fs';
|
|
6
6
|
import { join, resolve, extname, dirname } from 'node:path';
|
|
@@ -74,6 +74,8 @@ const BILLING_FINDINGS = {
|
|
|
74
74
|
"billing-webhook-events": { title: "Billing webhook events", fixable: true },
|
|
75
75
|
"billing-meter-usage": { title: "Billing meters" },
|
|
76
76
|
"billing-organization": { title: "Billing organization" },
|
|
77
|
+
// The customers the deployment maps entities onto, asked of the token's organization; `billing reset` clears them, never `doctor --fix`.
|
|
78
|
+
"billing-customer-mapping": { title: "Customer mappings", prod: "fail" },
|
|
77
79
|
"billing-multiple-subscriptions": { title: "Multiple subscriptions" },
|
|
78
80
|
"billing-proration": { title: "Plan change proration" },
|
|
79
81
|
"billing-benefit-grace": { title: "Benefit revocation" },
|
|
@@ -826,7 +828,7 @@ const TASK_SKILLS = [
|
|
|
826
828
|
entrypoints: ["nuxt-backend/billing"],
|
|
827
829
|
composables: ["useBilling", "useFeatures", "useCredits", "usePricing", "useOrders", "useUsage"],
|
|
828
830
|
components: ["PricingTable", "BillingCheckoutLink", "BillingPortalLink", "BillingHistory", "UsageHistory", "UpgradePrompt", "CancelFlow", "WithdrawalButton"],
|
|
829
|
-
commands: ["billing sync"],
|
|
831
|
+
commands: ["billing sync", "billing reset"],
|
|
830
832
|
findings: ["billing"],
|
|
831
833
|
functions: ["billing"]
|
|
832
834
|
},
|
|
@@ -2179,7 +2181,7 @@ const FEATURE_FILE_TEMPLATES = {
|
|
|
2179
2181
|
getPricing, getConfiguredProducts, getBillingAccess, getFeatures, getCredits,
|
|
2180
2182
|
getCurrentSubscription, listAllSubscriptions, syncEntitlements, syncProducts, startFreePlan,
|
|
2181
2183
|
generateCheckoutLink, generateCustomerPortalUrl,
|
|
2182
|
-
updateSubscription, cancelSubscription, acceptSaveOffer, uncancelSubscription,
|
|
2184
|
+
updateSubscription, cancelSubscription, getCancelFlow, acceptSaveOffer, uncancelSubscription,
|
|
2183
2185
|
cancelPendingChange, pauseSubscription, resumeSubscription,
|
|
2184
2186
|
getOrders, getInvoiceUrl, getUsageHistory, refundOrder, getWithdrawal, withdraw,
|
|
2185
2187
|
giftCheckout, getReceivedGifts, claimGift, getSentGifts, resendGift, changeGiftRecipient,
|
|
@@ -3432,6 +3434,7 @@ const UI_ENTRIES = [
|
|
|
3432
3434
|
component({ name: "CancelFlow", folder: "billing", capability: "billing" }),
|
|
3433
3435
|
part({ name: "CancelFlowQuestion", parent: "CancelFlow", folder: "billing", capability: "billing", unstyled: true }),
|
|
3434
3436
|
part({ name: "CancelFlowOffer", parent: "CancelFlow", folder: "billing", capability: "billing", unstyled: true }),
|
|
3437
|
+
part({ name: "CancelFlowConfirm", parent: "CancelFlow", folder: "billing", capability: "billing", unstyled: true }),
|
|
3435
3438
|
part({ name: "CancelFlowEnd", parent: "CancelFlow", folder: "billing", capability: "billing", unstyled: true }),
|
|
3436
3439
|
component({ name: "WithdrawalButton", folder: "billing", capability: "billing" }),
|
|
3437
3440
|
component({ name: "ReferralCard", folder: "billing", capability: "billing" }),
|
|
@@ -3556,4 +3559,4 @@ const UI_SHARED_STYLES = [
|
|
|
3556
3559
|
{ file: "admin/admin.css", capability: "auth" }
|
|
3557
3560
|
];
|
|
3558
3561
|
|
|
3559
|
-
export { REQUIRED_DEPLOYMENT_ENV as $, configuredDeployment as A, BACKEND_ENV_NAMES as B, CAPABILITY_STATES as C, DERIVED_DEPLOYMENT_ENV as D, isDevDeploymentId as E, computeDeployment as F, appMonitoringDsn as G, monitoringSdkInstalled as H, detectCapabilities as I, DEPLOYMENT_KIND_LABEL as J, CAPABILITY_NAMES as K, uiPath as L, MCP_SDK as M, BACKEND_PAGE_DEFS as N, installedVersion as O, packageDir as P, uiEntry as Q, REGISTERED_UI as R, ConvexCliError as S, agentsMdVersion as T, packageVersion as U, doctorReport as V, formatPreflightSummary as W, runEnvPush as X, devPushRefusal as Y, collectPreflightFindings as Z, OPTIONAL_DEPLOYMENT_ENV as _, deploymentEnvNames as a, applyProductionPosture as a$, deriveDeploymentUrls as a0, provisionedEnvNames as a1, appComponentIsStarter as a2, resolveSiteUrl as a3, needsSetup as a4, AGENT_HINT as a5, HEALTH_ROUTE as a6, LOCAL_LOG_ROUTE as a7, SOURCE_MAP_ENV as a8, MONITORING_SDK as a9, BACKEND_ENV as aA, capabilityOfEnv as aB, REMOVED_DEPLOYMENT_ENV as aC, CAPABILITIES as aD, mountPagesInAppComponent as aE, ensureDefaultLayout as aF, writeAgentFiles as aG, isDevDeployment as aH, RPC_NAMESPACE as aI, DEVTOOLS_UI_ROUTE as aJ, DEVTOOLS_UI_LOCAL_PORT as aK, envNames as aL, DEV_ONLY_DEPLOYMENT_ENV as aM, DEV_SITE_URL as aN, finding as aO, parseBackendEnvironment as aP, proofKeys as aQ, TEST_CHALLENGE_SITE_KEYS as aR, deploymentEnvId as aS, protectionTakes as aT, TEST_CHALLENGE_SECRET_KEYS as aU, PROTECTED_AUTH_ROUTES as aV, PROOF_HEADER as aW, signProof as aX, proofAudience as aY, deploymentSiteOrigin as aZ, isLocalDeploymentId as a_, pagesOptionProblems as aa, resolvedBackendPages as ab, DEFAULT_AUTH_ROUTE as ac, publishedBackendPages as ad, isPageOff as ae, privatePagePaths as af, collectExistingPagePaths as ag, adoptChildPages as ah, pageRouteRules as ai, cachingRulesOver as aj, PUSH_WORKER_URL as ak, ownsManifest as al, MANIFEST_MODULES as am, installableGaps as an, webAppManifest as ao, MANIFEST_ROUTE as ap, UI_SHARED_STYLES as aq, UI_ENTRIES as ar, UI_INTERNALS as as, moduleDir as at, VISITOR_IP_ROUTE as au, resolvePagePath as av, dependencyRange as aw, runsFromSource as ax, resolveConvexCli as ay, RECENT_SIGN_IN_SECONDS as az, deploymentBackendEnvironment as b, capabilityOfGroup as b0, agentFilesFinding as b1, pinnedRegion as b2, namedModels as b3, usesProvenance as b4, monitoringDsnFinding as b5, monitoringFindings as b6, usageAlertsFinding as b7, readUsageLimits as b8, billingWebhookSecretHint as b9, BACKEND_PATH_KEYS as ba, pathOption as bb, aiFeatures as bc, pathsFileFinding as bd, brandFileFinding as be, installableFinding as bf, mountsComponent as bg, isEnvProvisioned as bh, markEnvProvisioned as bi, readSource as bj, parse as bk, keyOf as bl, writeSource as bm, REMOVED_ENV as bn, applyEdits as bo, walk as bp, BACKEND_FILE_TEMPLATES as bq, billingEnvironment as c, deploymentFunctionSpec as d,
|
|
3562
|
+
export { REQUIRED_DEPLOYMENT_ENV as $, configuredDeployment as A, BACKEND_ENV_NAMES as B, CAPABILITY_STATES as C, DERIVED_DEPLOYMENT_ENV as D, isDevDeploymentId as E, computeDeployment as F, appMonitoringDsn as G, monitoringSdkInstalled as H, detectCapabilities as I, DEPLOYMENT_KIND_LABEL as J, CAPABILITY_NAMES as K, uiPath as L, MCP_SDK as M, BACKEND_PAGE_DEFS as N, installedVersion as O, packageDir as P, uiEntry as Q, REGISTERED_UI as R, ConvexCliError as S, agentsMdVersion as T, packageVersion as U, doctorReport as V, formatPreflightSummary as W, runEnvPush as X, devPushRefusal as Y, collectPreflightFindings as Z, OPTIONAL_DEPLOYMENT_ENV as _, deploymentEnvNames as a, applyProductionPosture as a$, deriveDeploymentUrls as a0, provisionedEnvNames as a1, appComponentIsStarter as a2, resolveSiteUrl as a3, needsSetup as a4, AGENT_HINT as a5, HEALTH_ROUTE as a6, LOCAL_LOG_ROUTE as a7, SOURCE_MAP_ENV as a8, MONITORING_SDK as a9, BACKEND_ENV as aA, capabilityOfEnv as aB, REMOVED_DEPLOYMENT_ENV as aC, CAPABILITIES as aD, mountPagesInAppComponent as aE, ensureDefaultLayout as aF, writeAgentFiles as aG, isDevDeployment as aH, RPC_NAMESPACE as aI, DEVTOOLS_UI_ROUTE as aJ, DEVTOOLS_UI_LOCAL_PORT as aK, envNames as aL, DEV_ONLY_DEPLOYMENT_ENV as aM, DEV_SITE_URL as aN, finding as aO, parseBackendEnvironment as aP, proofKeys as aQ, TEST_CHALLENGE_SITE_KEYS as aR, deploymentEnvId as aS, protectionTakes as aT, TEST_CHALLENGE_SECRET_KEYS as aU, PROTECTED_AUTH_ROUTES as aV, PROOF_HEADER as aW, signProof as aX, proofAudience as aY, deploymentSiteOrigin as aZ, isLocalDeploymentId as a_, pagesOptionProblems as aa, resolvedBackendPages as ab, DEFAULT_AUTH_ROUTE as ac, publishedBackendPages as ad, isPageOff as ae, privatePagePaths as af, collectExistingPagePaths as ag, adoptChildPages as ah, pageRouteRules as ai, cachingRulesOver as aj, PUSH_WORKER_URL as ak, ownsManifest as al, MANIFEST_MODULES as am, installableGaps as an, webAppManifest as ao, MANIFEST_ROUTE as ap, UI_SHARED_STYLES as aq, UI_ENTRIES as ar, UI_INTERNALS as as, moduleDir as at, VISITOR_IP_ROUTE as au, resolvePagePath as av, dependencyRange as aw, runsFromSource as ax, resolveConvexCli as ay, RECENT_SIGN_IN_SECONDS as az, deploymentBackendEnvironment as b, capabilityOfGroup as b0, agentFilesFinding as b1, pinnedRegion as b2, namedModels as b3, usesProvenance as b4, monitoringDsnFinding as b5, monitoringFindings as b6, usageAlertsFinding as b7, readUsageLimits as b8, billingWebhookSecretHint as b9, BACKEND_PATH_KEYS as ba, pathOption as bb, aiFeatures as bc, pathsFileFinding as bd, brandFileFinding as be, installableFinding as bf, mountsComponent as bg, isEnvProvisioned as bh, markEnvProvisioned as bi, readSource as bj, parse as bk, keyOf as bl, writeSource as bm, REMOVED_ENV as bn, applyEdits as bo, walk as bp, BACKEND_FILE_TEMPLATES as bq, billingEnvironment as c, deploymentFunctionSpec as d, deployKeyType as e, runConvex as f, resolveFunctionsDir as g, readTextIfPresent as h, isHttpUrl as i, deploymentFlags as j, executeEnvPush as k, generateAuthSecret as l, setDeploymentEnv as m, isLoopbackUrl as n, nonProductionDeployKey as o, spawnConvex as p, scaffoldBackendFiles as q, readEnvFiles as r, siteFromCloudUrl as s, pathsSourceOf as t, syncPathsFile as u, backendPathsOf as v, pathsFileLocation as w, appBrandOf as x, syncBrandFile as y, brandFileLocation as z };
|
|
@@ -2,8 +2,8 @@ import { spawnSync } from 'node:child_process';
|
|
|
2
2
|
import { existsSync, writeFileSync, readFileSync } from 'node:fs';
|
|
3
3
|
import { createRequire } from 'node:module';
|
|
4
4
|
import { join } from 'node:path';
|
|
5
|
-
import { aD as CAPABILITIES, aA as BACKEND_ENV, q as scaffoldBackendFiles, aE as mountPagesInAppComponent, aF as ensureDefaultLayout, aG as writeAgentFiles, O as installedVersion, M as MCP_SDK, P as packageDir } from './nuxt-backend.
|
|
6
|
-
import { a as adoptBackendDevScript } from './nuxt-backend.
|
|
5
|
+
import { aD as CAPABILITIES, aA as BACKEND_ENV, q as scaffoldBackendFiles, aE as mountPagesInAppComponent, aF as ensureDefaultLayout, aG as writeAgentFiles, O as installedVersion, M as MCP_SDK, P as packageDir } from './nuxt-backend.KEzfHO2K.mjs';
|
|
6
|
+
import { a as adoptBackendDevScript } from './nuxt-backend.2m535CLS.mjs';
|
|
7
7
|
|
|
8
8
|
const INTRO = `# Nothing here is required in development: the backend URL derives from the
|
|
9
9
|
# deployment the Convex CLI writes, and AUTH_SECRET, SITE_URL and
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "nuxt-backend",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.1",
|
|
5
5
|
"description": "The complete backend for a Nuxt app on Convex: passwordless sign-in with passkeys, workspaces, plans and credits, email, notifications and metered AI, with the pages that use them, in one module.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -248,7 +248,7 @@
|
|
|
248
248
|
"convex": "^1.49.0",
|
|
249
249
|
"convex-test": "^0.0.66",
|
|
250
250
|
"eslint": "^10.13.0",
|
|
251
|
-
"fallow": "3.
|
|
251
|
+
"fallow": "3.38.1",
|
|
252
252
|
"fast-check": "^4.10.2",
|
|
253
253
|
"h3": "^1.15.11",
|
|
254
254
|
"happy-dom": "^21.0.4",
|
|
@@ -209,7 +209,7 @@ Types: `BackendEnv`, `BackendEnvironment`.
|
|
|
209
209
|
| `setupReferrals()` | Set the referral program up in its own backend file (`backend/referrals.ts`). |
|
|
210
210
|
| `setupBilling()` | Configure billing for subscriptions, discounts, prepaid credits, and gift purchases — linked to your auth users and cached reactively inside the `backend` component (so consumers add nothing to their own schema). |
|
|
211
211
|
|
|
212
|
-
Types: `BillingRateLimiter`, `DiscountInput`, `ProrationBehavior`, `ClientProrationBehavior`, `CancellationReason`, `RefundReason`, `SubscriptionTarget`, `UpdateSubscriptionOptions`, `CancelSubscriptionOptions`, `PauseSubscriptionOptions`, `CurrentSubscriptions`, `OrdersOptions`, `BillingOrder`, `BillingPage`, `UsageHistoryOptions`, `UsageEvent`, `RefundOrderOptions`, `RefundRecord`, `DiscountListOptions`, `BillingDiscounts`, `ApplyDiscountOptions`, `CheckoutPrefill`, `CampaignAttribution`, `CheckoutTrial`, `CheckoutOptions`, `ServerCheckoutOptions`, `FeatureCheckOptions`, `BenefitKind`, `EntitlementBenefit`, `EntitlementMeter`, `CustomerEntitlements`, `CreditMeterConfig`, `BillingCatalogIds`, `CatalogPassIds`, `BillingCatalogDiscount`, `SpendCreditsEvent`, `SpendReservation`, `RefundCreditsEvent`, `CostReport`, `GiftRecord`, `GiftTask`, `PricedCredits`, `PricedTrial`, `PricedPlanPrice`, `PricedPlan`, `PricedPack`, `PricedOffer`, `PricedPromotion`, `Pricing`, `QuotaUsage`, `BillingWebhookEventHandlers`, `SaveOfferTerms`, `BillingComponents`, `BillingEmail`, `BillingEntity`, `BillingAccessRule`, `BillingEntityCtx`, `EntityProfile`, `SetupBillingConfig`, `AccountBillingErasure`, `AccountBillingErasureInput`, `AccountBillingExport`, `AccountBillingRecord`, `Billing`, `BillingAudit`, `BillingLifecycle`, `CancelOutcome`, `BillingConsole`, `SaveOffer`, `SaveOfferRule`, `WithdrawalPeriod`, `MeterUsage`, `RevenueCancellations`, `RevenueInterval`, `RevenueMetric`, `RevenueOptions`, `RevenuePeriod`, `RevenueReport`, `RevenueValues`, `BillingCatalog`, `CatalogCreditGrant`, `CatalogCurrencyPrices`, `CatalogDiscount`, `CatalogDiscountDuration`, `CatalogDiscountProducts`, `CatalogDiscountTerms`, `CatalogFeature`, `CatalogInterval`, `CatalogMeter`, `CatalogPack`, `CatalogPackPrices`, `CatalogPlan`, `CatalogPlanCreditGrant`, `CatalogPlanGift`, `CatalogPlanPrices`, `CatalogQuota`, `ClaimRefusal`, `DueReferral`, `ReferralCodeView`, `ReferralComponents`, `ReferralRefs`, `ReferralConsole`, `ReferralConsoleRow`, `ReferralConsoleRows`, `ReferralEntry`, `ReferralPreview`, `ReferralProgram`, `Referrals`, `ReferralsApi`, `ReferralsView`, `ReferredOffer`, `ReferrerOffer`, `SetupReferralsOptions`, `StoredTerms`, `ReferralCaps`, `ReferralRewards`, `ReferralState`, `ReferralTerms`, `ReferredReward`, `ReferrerReward`.
|
|
212
|
+
Types: `BillingRateLimiter`, `DiscountInput`, `ProrationBehavior`, `ClientProrationBehavior`, `CancellationReason`, `RefundReason`, `SubscriptionTarget`, `UpdateSubscriptionOptions`, `CancelSubscriptionOptions`, `PauseSubscriptionOptions`, `CurrentSubscriptions`, `OrdersOptions`, `BillingOrder`, `BillingPage`, `UsageHistoryOptions`, `UsageEvent`, `RefundOrderOptions`, `RefundRecord`, `DiscountListOptions`, `BillingDiscounts`, `ApplyDiscountOptions`, `CheckoutPrefill`, `CampaignAttribution`, `CheckoutTrial`, `CheckoutOptions`, `ServerCheckoutOptions`, `FeatureCheckOptions`, `BenefitKind`, `EntitlementBenefit`, `EntitlementMeter`, `CustomerEntitlements`, `CreditMeterConfig`, `BillingCatalogIds`, `CatalogPassIds`, `BillingCatalogDiscount`, `SpendCreditsEvent`, `SpendReservation`, `RefundCreditsEvent`, `CostReport`, `GiftRecord`, `GiftTask`, `PricedCredits`, `PricedTrial`, `PricedPlanPrice`, `PricedPlan`, `PricedPack`, `PricedOffer`, `PricedPromotion`, `Pricing`, `QuotaUsage`, `BillingWebhookEventHandlers`, `SaveOfferTerms`, `BillingComponents`, `BillingEmail`, `BillingEntity`, `BillingAccessRule`, `BillingEntityCtx`, `EntityProfile`, `SetupBillingConfig`, `AccountBillingErasure`, `AccountBillingErasureInput`, `AccountBillingExport`, `AccountBillingRecord`, `Billing`, `BillingAudit`, `BillingLifecycle`, `CancelFlowState`, `CancelOutcome`, `BillingConsole`, `SaveOffer`, `SaveOfferRule`, `WithdrawalPeriod`, `MeterUsage`, `RevenueCancellations`, `RevenueInterval`, `RevenueMetric`, `RevenueOptions`, `RevenuePeriod`, `RevenueReport`, `RevenueValues`, `BillingCatalog`, `CatalogCreditGrant`, `CatalogCurrencyPrices`, `CatalogDiscount`, `CatalogDiscountDuration`, `CatalogDiscountProducts`, `CatalogDiscountTerms`, `CatalogFeature`, `CatalogInterval`, `CatalogMeter`, `CatalogPack`, `CatalogPackPrices`, `CatalogPlan`, `CatalogPlanCreditGrant`, `CatalogPlanGift`, `CatalogPlanPrices`, `CatalogQuota`, `MeterUnit`, `ClaimRefusal`, `DueReferral`, `ReferralCodeView`, `ReferralComponents`, `ReferralRefs`, `ReferralConsole`, `ReferralConsoleRow`, `ReferralConsoleRows`, `ReferralEntry`, `ReferralPreview`, `ReferralProgram`, `Referrals`, `ReferralsApi`, `ReferralsView`, `ReferredOffer`, `ReferrerOffer`, `SetupReferralsOptions`, `StoredTerms`, `ReferralCaps`, `ReferralRewards`, `ReferralState`, `ReferralTerms`, `ReferredReward`, `ReferrerReward`.
|
|
213
213
|
|
|
214
214
|
### `nuxt-backend/email`
|
|
215
215
|
|
|
@@ -342,7 +342,7 @@ Types: `FileOwner`, `StoredFile`, `ResolvedShareLink`, `ShareLinkState`, `Minted
|
|
|
342
342
|
|---|---|
|
|
343
343
|
| `setupNotifications()` | The in-app inbox: what the backend recorded about a person, live, with the unread count and marking read, and the `notify` option that turns your own events into notifications. |
|
|
344
344
|
|
|
345
|
-
Types: `ChannelGate`, `ChannelHandler`, `Delivery`, `NotificationAudience`, `NotificationChannel`, `NotificationKind`, `NotificationDestination`, `NotificationPlan`, `NotifyEvent`, `NotifyKind`, `NotifyOptions`, `NotificationParty`, `NotificationEntry`, `NotificationsPage`, `UnreadCount`, `MarkedRead`, `NotificationKindChoice`, `PushConfig`, `ScheduledDelivery`, `NotificationsApi`, `Notifications`, `NotificationsWriteCtx`, `ForgottenNotifications`, `NotificationsEmail`, `SetupNotificationsOptions`, `NotificationsComponents`.
|
|
345
|
+
Types: `ChannelGate`, `ChannelHandler`, `Delivery`, `NotificationAudience`, `NotificationChannel`, `NotificationEntity`, `NotificationFeature`, `NotificationKind`, `NotificationDestination`, `NotificationPlan`, `NotificationType`, `NotifyEvent`, `NotifyKind`, `NotifyOptions`, `NotificationParty`, `NotificationEntry`, `NotificationsPage`, `UnreadCount`, `MarkedRead`, `NotificationKindChoice`, `PushConfig`, `ScheduledDelivery`, `NotificationsApi`, `Notifications`, `NotificationsWriteCtx`, `ForgottenNotifications`, `NotificationsEmail`, `SetupNotificationsOptions`, `NotificationsComponents`.
|
|
346
346
|
|
|
347
347
|
### `nuxt-backend/monitoring`
|
|
348
348
|
|
|
@@ -497,6 +497,15 @@ Push backend/billing.catalog.ts — meters, custom fields, feature/credit benefi
|
|
|
497
497
|
|
|
498
498
|
`--json`: { environment, dryRun, deployment, log: [{ action, kind, key, id?, note? }], generated, webhook: { url, action: "created" | "exists" | "would-create" | "skipped", secret: "stored" | "kept" | "not-stored" | "none", note? }, products: { status: "synced" | "failed" | "skipped", note? } }.
|
|
499
499
|
|
|
500
|
+
### `npx nuxt-backend billing reset`
|
|
501
|
+
|
|
502
|
+
Start the dev deployment's billing over in the organization BILLING_ACCESS_TOKEN names, after the token moved to another one (a new sandbox): sync the catalog, clear the billing provider component's customers and subscriptions and the entitlement cache, and put every billing entity back on the free plan. Dev deployments only.
|
|
503
|
+
|
|
504
|
+
- `--cwd`: Project directory
|
|
505
|
+
- `--json`: Print the outcome as one JSON document; progress goes to stderr
|
|
506
|
+
|
|
507
|
+
`--json`: { sync: <billing sync --json>, cleared: [{ component, table, status: "cleared" | "failed" | "skipped", note? }], freePlan: { status: "queued" | "skipped" | "failed", note? } }.
|
|
508
|
+
|
|
500
509
|
### `npx nuxt-backend email sync`
|
|
501
510
|
|
|
502
511
|
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.
|
|
@@ -655,6 +664,7 @@ The app's parts, each detected as `live`, `test`, `missing` or `failing`: `npx n
|
|
|
655
664
|
| `billing-webhook-events` | billing | Billing webhook events |
|
|
656
665
|
| `billing-meter-usage` | billing | Billing meters |
|
|
657
666
|
| `billing-organization` | billing | Billing organization |
|
|
667
|
+
| `billing-customer-mapping` | billing | Customer mappings |
|
|
658
668
|
| `billing-multiple-subscriptions` | billing | Multiple subscriptions |
|
|
659
669
|
| `billing-proration` | billing | Plan change proration |
|
|
660
670
|
| `billing-benefit-grace` | billing | Benefit revocation |
|
|
@@ -749,7 +759,7 @@ The composables call these functions by name; keep them exported from the scaffo
|
|
|
749
759
|
Names agents guess instead: `api.auth.getAuthUser`, not `api.auth.getCurrentUser`; `api.billing.getCurrentSubscription`, not `api.billing.getSubscription`; `api.billing.getCredits`, not `api.billing.getBalance`.
|
|
750
760
|
|
|
751
761
|
- `backend/auth.ts`: `getAuthUser`, `authConfig`, `updateProfile`, `listSessions`, `revokeSession`, `listSignInAlerts`
|
|
752
|
-
- `backend/billing.ts`: `generateCheckoutLink`, `generateCustomerPortalUrl`, `getConfiguredProducts`, `getPricing`, `listAllSubscriptions`, `giftCheckout`, `getCurrentSubscription`, `getFeatures`, `getBillingAccess`, `getCredits`, `syncEntitlements`, `syncProducts`, `startFreePlan`, `getReceivedGifts`, `claimGift`, `getSentGifts`, `resendGift`, `changeGiftRecipient`, `rescheduleGift`, `cancelGift`, `runGiftSweep`, `updateSubscription`, `cancelSubscription`, `acceptSaveOffer`, `getWithdrawal`, `withdraw`, `uncancelSubscription`, `cancelPendingChange`, `pauseSubscription`, `resumeSubscription`, `getOrders`, `getInvoiceUrl`, `getUsageHistory`, `refundOrder`
|
|
762
|
+
- `backend/billing.ts`: `generateCheckoutLink`, `generateCustomerPortalUrl`, `getConfiguredProducts`, `getPricing`, `listAllSubscriptions`, `giftCheckout`, `getCurrentSubscription`, `getFeatures`, `getBillingAccess`, `getCredits`, `syncEntitlements`, `syncProducts`, `startFreePlan`, `getReceivedGifts`, `claimGift`, `getSentGifts`, `resendGift`, `changeGiftRecipient`, `rescheduleGift`, `cancelGift`, `runGiftSweep`, `updateSubscription`, `cancelSubscription`, `getCancelFlow`, `acceptSaveOffer`, `getWithdrawal`, `withdraw`, `uncancelSubscription`, `cancelPendingChange`, `pauseSubscription`, `resumeSubscription`, `getOrders`, `getInvoiceUrl`, `getUsageHistory`, `refundOrder`
|
|
753
763
|
- `backend/email.ts`: `getEmailStatus`, `previewEmails`, `sendEmailPreview`, `getEmailPreferences`, `setEmailTopic`, `unsubscribeAllTopics`, `getEmailLink`, `unsubscribeByLink`, `confirmEmailTopic`, `recordTimeZone`, `syncEmail`, `getAnnouncements`, `dismissAnnouncement`, `getAnnouncementsConsole`, `publishAnnouncement`, `endAnnouncement`, `previewAnnouncement`, `sendAnnouncement`, `cancelAnnouncement`, `getSuppressions`, `liftSuppression`
|
|
754
764
|
- `backend/audit.ts`: `listActivity`, `listWorkspaceActivity`, `listAllActivity`, `getActivation`, `dismissActivation`
|
|
755
765
|
- `backend/notifications.ts`: `listNotifications`, `getUnreadCount`, `markNotificationsRead`, `getNotificationChannels`, `setNotificationChannel`, `getPushConfig`, `subscribePush`, `unsubscribePush`, `deliverNotification`
|
|
@@ -142,6 +142,7 @@
|
|
|
142
142
|
"BillingRateLimiter",
|
|
143
143
|
"BillingWebhookEventHandlers",
|
|
144
144
|
"CampaignAttribution",
|
|
145
|
+
"CancelFlowState",
|
|
145
146
|
"CancelOutcome",
|
|
146
147
|
"CancelSubscriptionOptions",
|
|
147
148
|
"CancellationReason",
|
|
@@ -180,6 +181,7 @@
|
|
|
180
181
|
"FeatureCheckOptions",
|
|
181
182
|
"GiftRecord",
|
|
182
183
|
"GiftTask",
|
|
184
|
+
"MeterUnit",
|
|
183
185
|
"MeterUsage",
|
|
184
186
|
"OrdersOptions",
|
|
185
187
|
"PauseSubscriptionOptions",
|
|
@@ -692,11 +694,14 @@
|
|
|
692
694
|
"NotificationAudience",
|
|
693
695
|
"NotificationChannel",
|
|
694
696
|
"NotificationDestination",
|
|
697
|
+
"NotificationEntity",
|
|
695
698
|
"NotificationEntry",
|
|
699
|
+
"NotificationFeature",
|
|
696
700
|
"NotificationKind",
|
|
697
701
|
"NotificationKindChoice",
|
|
698
702
|
"NotificationParty",
|
|
699
703
|
"NotificationPlan",
|
|
704
|
+
"NotificationType",
|
|
700
705
|
"Notifications",
|
|
701
706
|
"NotificationsApi",
|
|
702
707
|
"NotificationsComponents",
|
|
@@ -913,6 +918,7 @@
|
|
|
913
918
|
"AuthFormUndeliverable",
|
|
914
919
|
"AuthFormWaitlisted",
|
|
915
920
|
"BillingHistoryOrder",
|
|
921
|
+
"CancelFlowConfirm",
|
|
916
922
|
"CancelFlowEnd",
|
|
917
923
|
"CancelFlowOffer",
|
|
918
924
|
"CancelFlowQuestion",
|
|
@@ -1081,6 +1087,10 @@
|
|
|
1081
1087
|
"--adopt",
|
|
1082
1088
|
"--json"
|
|
1083
1089
|
],
|
|
1090
|
+
"billing reset": [
|
|
1091
|
+
"--cwd",
|
|
1092
|
+
"--json"
|
|
1093
|
+
],
|
|
1084
1094
|
"email sync": [
|
|
1085
1095
|
"--cwd",
|
|
1086
1096
|
"--prod",
|
|
@@ -1176,6 +1186,7 @@
|
|
|
1176
1186
|
"billing-webhook-events": "billing",
|
|
1177
1187
|
"billing-meter-usage": "billing",
|
|
1178
1188
|
"billing-organization": "billing",
|
|
1189
|
+
"billing-customer-mapping": "billing",
|
|
1179
1190
|
"billing-multiple-subscriptions": "billing",
|
|
1180
1191
|
"billing-proration": "billing",
|
|
1181
1192
|
"billing-benefit-grace": "billing",
|
|
@@ -1337,6 +1348,7 @@
|
|
|
1337
1348
|
"runGiftSweep",
|
|
1338
1349
|
"updateSubscription",
|
|
1339
1350
|
"cancelSubscription",
|
|
1351
|
+
"getCancelFlow",
|
|
1340
1352
|
"acceptSaveOffer",
|
|
1341
1353
|
"getWithdrawal",
|
|
1342
1354
|
"withdraw",
|
|
@@ -11,7 +11,8 @@ holds the rules every change follows; this one covers who the caller is and what
|
|
|
11
11
|
|
|
12
12
|
## Sign-in and pages
|
|
13
13
|
|
|
14
|
-
- `useAuth()` only reads the session (`user`, `role`, `hasRole()`, `isSignedIn`, `
|
|
14
|
+
- `useAuth()` only reads the session (`user`, `role`, `hasRole()`, `isSignedIn`, `isReady` for
|
|
15
|
+
signed-in reads, `impersonating`)
|
|
15
16
|
and signs out; `<AuthForm>` signs in with passkeys and email codes. `definePageMeta({ auth: true })`
|
|
16
17
|
protects a page: the one page guard, no named middleware.
|
|
17
18
|
- `definePageMeta({ auth: { role: 'admin' } })` opens a page only to a role (also `workspace: true`
|
|
@@ -55,6 +55,10 @@ credits and gifts.
|
|
|
55
55
|
and `billing sync`, and pay with the test card. Without a token billing reads `missing`.
|
|
56
56
|
`billing sync` writes the `sandbox` and `production` ids side by side. See
|
|
57
57
|
https://nuxt-backend.dev/docs/develop/sandboxes.
|
|
58
|
+
- Moving the token to another organization (a new sandbox) strands the deployment's billing data:
|
|
59
|
+
every entity is refused `unavailable` (reason `customer_unknown`), and doctor warns
|
|
60
|
+
`billing-customer-mapping`. On a dev deployment, run `npx nuxt-backend billing reset` (sync,
|
|
61
|
+
clear, free plan again); never clear the tables by hand.
|
|
58
62
|
|
|
59
63
|
## Reading state and gating
|
|
60
64
|
|
|
@@ -143,6 +147,9 @@ credits and gifts.
|
|
|
143
147
|
|
|
144
148
|
- Credits are prepaid: `useCredits()` reads the balance and opens a top-up checkout, and metered
|
|
145
149
|
AI spends them (the `nuxt-backend-ai` skill).
|
|
150
|
+
- A meter that counts something else names its unit in the catalog, `meters: { pages: { unit: {
|
|
151
|
+
one: 'page', other: 'pages' } } }`, and every packaged label says it instead of "credits": never
|
|
152
|
+
override the `credits`, `usage`, `settings` and `pricing` labels one by one for that.
|
|
146
153
|
- Gifts are credit packs by catalog key, or a plan as a pass: `useGifts().send('credits500', {
|
|
147
154
|
recipientEmail })` buys the pack's private gift product on the purchaser's own account (after an
|
|
148
155
|
earlier paid order, never for their own address, five a day to one address); `send('pro', {
|