nuxt-backend 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -1
- package/dist/chunks/catalog.mjs +1 -1
- package/dist/chunks/doctor.mjs +102 -8
- 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 +6 -6
- package/dist/cli.mjs +285 -140
- package/dist/convex/catalog.d.ts +8 -0
- package/dist/convex/catalog.d.ts.map +1 -1
- package/dist/convex/catalog.js +16 -0
- package/dist/convex/catalog.js.map +1 -1
- package/dist/convex/components/backend/_generated/component.d.ts +21 -1
- package/dist/convex/components/backend/_generated/component.d.ts.map +1 -1
- package/dist/convex/components/backend/billing.d.ts +7 -0
- package/dist/convex/components/backend/billing.d.ts.map +1 -1
- package/dist/convex/components/backend/billing.js +20 -5
- package/dist/convex/components/backend/billing.js.map +1 -1
- package/dist/convex/components/backend/jobs.d.ts +69 -1
- package/dist/convex/components/backend/jobs.d.ts.map +1 -1
- package/dist/convex/components/backend/jobs.js +103 -5
- package/dist/convex/components/backend/jobs.js.map +1 -1
- package/dist/convex/components/backend/schema.d.ts +46 -18
- package/dist/convex/components/backend/schema.d.ts.map +1 -1
- package/dist/convex/components/backend/schema.js +11 -0
- package/dist/convex/components/backend/schema.js.map +1 -1
- package/dist/convex/components/backend/subscriptions.d.ts +3 -3
- package/dist/convex/delivery.d.ts +17 -0
- package/dist/convex/delivery.d.ts.map +1 -1
- package/dist/convex/delivery.js +26 -1
- package/dist/convex/delivery.js.map +1 -1
- package/dist/convex/emails/renewal-reminder.d.ts.map +1 -1
- package/dist/convex/emails/renewal-reminder.js +17 -1
- package/dist/convex/emails/renewal-reminder.js.map +1 -1
- package/dist/convex/errors.d.ts +7 -5
- package/dist/convex/errors.d.ts.map +1 -1
- package/dist/convex/errors.js +24 -9
- package/dist/convex/errors.js.map +1 -1
- package/dist/convex/events.d.ts +10 -0
- package/dist/convex/events.d.ts.map +1 -1
- package/dist/convex/events.js +7 -0
- package/dist/convex/events.js.map +1 -1
- package/dist/convex/integrations/ai/images.d.ts.map +1 -1
- package/dist/convex/integrations/ai/images.js +20 -7
- package/dist/convex/integrations/ai/images.js.map +1 -1
- package/dist/convex/integrations/ai/job-errors.d.ts +32 -4
- package/dist/convex/integrations/ai/job-errors.d.ts.map +1 -1
- package/dist/convex/integrations/ai/job-errors.js +55 -8
- package/dist/convex/integrations/ai/job-errors.js.map +1 -1
- package/dist/convex/integrations/ai/jobs.d.ts +128 -7
- package/dist/convex/integrations/ai/jobs.d.ts.map +1 -1
- package/dist/convex/integrations/ai/jobs.js +395 -63
- package/dist/convex/integrations/ai/jobs.js.map +1 -1
- package/dist/convex/integrations/ai/models.d.ts +1 -1
- package/dist/convex/integrations/ai/models.d.ts.map +1 -1
- package/dist/convex/integrations/ai/moderation.d.ts +9 -3
- package/dist/convex/integrations/ai/moderation.d.ts.map +1 -1
- package/dist/convex/integrations/ai/moderation.js +4 -2
- package/dist/convex/integrations/ai/moderation.js.map +1 -1
- package/dist/convex/integrations/ai.d.ts +2 -2
- package/dist/convex/integrations/ai.d.ts.map +1 -1
- package/dist/convex/integrations/ai.js +1 -1
- package/dist/convex/integrations/ai.js.map +1 -1
- package/dist/convex/integrations/billing/context.d.ts.map +1 -1
- package/dist/convex/integrations/billing/context.js +5 -2
- package/dist/convex/integrations/billing/context.js.map +1 -1
- package/dist/convex/integrations/billing/credits.d.ts +1 -0
- package/dist/convex/integrations/billing/credits.d.ts.map +1 -1
- package/dist/convex/integrations/billing/credits.js +4 -1
- package/dist/convex/integrations/billing/credits.js.map +1 -1
- package/dist/convex/integrations/billing/features.d.ts.map +1 -1
- package/dist/convex/integrations/billing/gifts.d.ts.map +1 -1
- package/dist/convex/integrations/billing/history.d.ts.map +1 -1
- package/dist/convex/integrations/billing/passes.d.ts +2 -2
- package/dist/convex/integrations/billing/passes.d.ts.map +1 -1
- package/dist/convex/integrations/billing/passes.js +3 -11
- package/dist/convex/integrations/billing/passes.js.map +1 -1
- package/dist/convex/integrations/billing/provider-failure.d.ts +17 -0
- package/dist/convex/integrations/billing/provider-failure.d.ts.map +1 -0
- package/dist/convex/integrations/billing/provider-failure.js +52 -0
- package/dist/convex/integrations/billing/provider-failure.js.map +1 -0
- 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/setup.d.ts +1 -0
- package/dist/convex/integrations/billing/types/setup.d.ts.map +1 -1
- package/dist/convex/integrations/billing/types/surface.d.ts +9 -1
- package/dist/convex/integrations/billing/types/surface.d.ts.map +1 -1
- package/dist/convex/integrations/email-sync.d.ts +24 -2
- package/dist/convex/integrations/email-sync.d.ts.map +1 -1
- package/dist/convex/integrations/email-sync.js +54 -23
- package/dist/convex/integrations/email-sync.js.map +1 -1
- package/dist/convex/integrations/inbound.d.ts +16 -7
- package/dist/convex/integrations/inbound.d.ts.map +1 -1
- package/dist/convex/integrations/inbound.js +21 -10
- package/dist/convex/integrations/inbound.js.map +1 -1
- package/dist/convex/integrations/launch.d.ts +17 -1
- package/dist/convex/integrations/launch.d.ts.map +1 -1
- package/dist/convex/integrations/launch.js +32 -3
- package/dist/convex/integrations/launch.js.map +1 -1
- package/dist/convex/integrations/referrals.d.ts +20 -0
- package/dist/convex/integrations/referrals.d.ts.map +1 -1
- package/dist/convex/integrations/referrals.js +14 -9
- package/dist/convex/integrations/referrals.js.map +1 -1
- package/dist/convex/integrations/storage.d.ts +67 -0
- package/dist/convex/integrations/storage.d.ts.map +1 -1
- package/dist/convex/integrations/storage.js +42 -1
- package/dist/convex/integrations/storage.js.map +1 -1
- package/dist/convex/label-groups/admin.d.ts +3 -0
- package/dist/convex/label-groups/admin.d.ts.map +1 -1
- package/dist/convex/label-groups/admin.js +3 -0
- package/dist/convex/label-groups/admin.js.map +1 -1
- package/dist/convex/label-groups/audit.d.ts +1 -0
- package/dist/convex/label-groups/audit.d.ts.map +1 -1
- package/dist/convex/label-groups/audit.js +1 -0
- package/dist/convex/label-groups/audit.js.map +1 -1
- package/dist/convex/label-groups/auth.d.ts +7 -0
- package/dist/convex/label-groups/auth.d.ts.map +1 -1
- package/dist/convex/label-groups/auth.js +7 -0
- package/dist/convex/label-groups/auth.js.map +1 -1
- package/dist/convex/label-groups/errors.d.ts +9 -0
- package/dist/convex/label-groups/errors.d.ts.map +1 -1
- package/dist/convex/label-groups/errors.js +12 -0
- package/dist/convex/label-groups/errors.js.map +1 -1
- package/dist/convex/label-groups/gift.d.ts +24 -0
- package/dist/convex/label-groups/gift.d.ts.map +1 -1
- package/dist/convex/label-groups/gift.js +27 -0
- package/dist/convex/label-groups/gift.js.map +1 -1
- package/dist/convex/label-groups/legal.d.ts +1 -1
- package/dist/convex/label-groups/pricing.d.ts +15 -0
- package/dist/convex/label-groups/pricing.d.ts.map +1 -1
- package/dist/convex/label-groups/pricing.js +20 -0
- package/dist/convex/label-groups/pricing.js.map +1 -1
- package/dist/convex/label-groups/referral.d.ts +4 -0
- package/dist/convex/label-groups/referral.d.ts.map +1 -1
- package/dist/convex/label-groups/referral.js +4 -0
- package/dist/convex/label-groups/referral.js.map +1 -1
- package/dist/convex/label-groups/settings.d.ts +34 -0
- package/dist/convex/label-groups/settings.d.ts.map +1 -1
- package/dist/convex/label-groups/settings.js +39 -0
- package/dist/convex/label-groups/settings.js.map +1 -1
- package/dist/convex/label-groups/waitlist.d.ts +5 -0
- package/dist/convex/label-groups/waitlist.d.ts.map +1 -1
- package/dist/convex/label-groups/waitlist.js +7 -2
- package/dist/convex/label-groups/waitlist.js.map +1 -1
- package/dist/convex/labels.d.ts +103 -1
- package/dist/convex/labels.d.ts.map +1 -1
- package/dist/convex/legal.d.ts +18 -1
- package/dist/convex/legal.d.ts.map +1 -1
- package/dist/convex/legal.js +17 -2
- package/dist/convex/legal.js.map +1 -1
- package/dist/convex/log.js +8 -0
- package/dist/convex/log.js.map +1 -1
- package/dist/convex/money.d.ts +10 -0
- package/dist/convex/money.d.ts.map +1 -0
- package/dist/convex/money.js +37 -0
- package/dist/convex/money.js.map +1 -0
- package/dist/convex/report-rules.d.ts +6 -0
- package/dist/convex/report-rules.d.ts.map +1 -1
- package/dist/convex/report-rules.js +15 -0
- package/dist/convex/report-rules.js.map +1 -1
- package/dist/convex/test-billing.d.ts +83 -0
- package/dist/convex/test-billing.d.ts.map +1 -0
- package/dist/convex/test-billing.js +131 -0
- package/dist/convex/test-billing.js.map +1 -0
- package/dist/convex/test-models.d.ts +14 -2
- package/dist/convex/test-models.d.ts.map +1 -1
- package/dist/convex/test-models.js +61 -4
- package/dist/convex/test-models.js.map +1 -1
- package/dist/devtools-client/index.html +1 -1
- package/dist/eslint.d.mts +2 -1
- package/dist/eslint.mjs +2 -1
- package/dist/module.d.ts +45 -2
- package/dist/module.js +2 -2
- package/dist/module.json +1 -1
- package/dist/runtime/chunk-recovery.d.ts +13 -0
- package/dist/runtime/chunk-recovery.js +1 -0
- package/dist/runtime/locales/de.json +113 -7
- package/dist/runtime/locales/en.json +114 -8
- package/dist/runtime/locales/es.json +113 -7
- package/dist/runtime/locales/fr.json +113 -7
- package/dist/runtime/locales/ru.json +113 -7
- package/dist/runtime/server/chunk-recovery.d.ts +49 -0
- package/dist/runtime/server/chunk-recovery.js +44 -0
- package/dist/runtime/server/csp.d.ts +7 -2
- package/dist/runtime/server/csp.js +2 -2
- package/dist/runtime/server/photo-decoder-csp.d.ts +17 -0
- package/dist/runtime/server/photo-decoder-csp.js +9 -0
- package/dist/runtime/vue/components/account/AccountDeletion.css +1 -1
- package/dist/runtime/vue/components/account/ActivationChecklist.css +1 -1
- package/dist/runtime/vue/components/account/ConsentPrompt.css +1 -1
- package/dist/runtime/vue/components/account/EmailUnsubscribe.css +1 -1
- package/dist/runtime/vue/components/account/HowDidYouHear.css +1 -1
- package/dist/runtime/vue/components/account/KeepAccount.css +1 -1
- package/dist/runtime/vue/components/account/OnboardingFlow.css +1 -1
- package/dist/runtime/vue/components/account/ProfileIdentity.css +1 -1
- package/dist/runtime/vue/components/account/ProfilePreferencesSection.css +1 -1
- package/dist/runtime/vue/components/account/ProfileSettings.css +1 -1
- package/dist/runtime/vue/components/account/SecurityAlerts.css +1 -1
- package/dist/runtime/vue/components/account/SecurityPasskeys.css +1 -1
- package/dist/runtime/vue/components/account/SecuritySessions.css +1 -1
- package/dist/runtime/vue/components/account/SecuritySettings.css +1 -1
- package/dist/runtime/vue/components/admin/AdminAccess.css +1 -1
- package/dist/runtime/vue/components/admin/AdminAnnouncements.css +1 -1
- package/dist/runtime/vue/components/admin/AdminBilling.css +1 -1
- package/dist/runtime/vue/components/admin/AdminChart.css +1 -1
- package/dist/runtime/vue/components/admin/AdminConsole.css +1 -1
- package/dist/runtime/vue/components/admin/AdminExperiments.css +1 -1
- package/dist/runtime/vue/components/admin/AdminFlags.css +1 -1
- package/dist/runtime/vue/components/admin/AdminQueue.css +1 -1
- package/dist/runtime/vue/components/admin/AdminQueueJob.vue +5 -2
- package/dist/runtime/vue/components/admin/AdminReferrals.css +1 -1
- package/dist/runtime/vue/components/admin/AdminReports.css +1 -1
- package/dist/runtime/vue/components/admin/AdminRevenue.css +1 -1
- package/dist/runtime/vue/components/admin/AdminUsers.d.vue.ts +3 -0
- package/dist/runtime/vue/components/admin/AdminUsers.vue.d.ts +3 -0
- package/dist/runtime/vue/components/admin/AdminWorkspaces.d.vue.ts +3 -0
- package/dist/runtime/vue/components/admin/AdminWorkspaces.vue.d.ts +3 -0
- package/dist/runtime/vue/components/admin/admin-access-tab.js +2 -1
- package/dist/runtime/vue/components/admin/admin-revenue-tab.js +4 -1
- package/dist/runtime/vue/components/admin/admin.css +1 -1
- package/dist/runtime/vue/components/auth/AuthForm.css +1 -1
- package/dist/runtime/vue/components/auth/AuthForm.d.vue.ts +7 -0
- package/dist/runtime/vue/components/auth/AuthForm.vue +1 -2
- package/dist/runtime/vue/components/auth/AuthForm.vue.d.ts +7 -0
- package/dist/runtime/vue/components/auth/AuthFormChoose.css +1 -1
- package/dist/runtime/vue/components/auth/AuthFormHeader.css +1 -1
- package/dist/runtime/vue/components/auth/AuthFormPasskeyOffer.css +1 -1
- package/dist/runtime/vue/components/auth/InviteRedeem.css +1 -1
- package/dist/runtime/vue/components/auth/InviteRedeem.vue +95 -8
- package/dist/runtime/vue/components/auth/ReauthenticateCode.css +1 -1
- package/dist/runtime/vue/components/auth/ReauthenticateDialog.css +1 -1
- package/dist/runtime/vue/components/auth/ReauthenticatePasskey.css +1 -1
- package/dist/runtime/vue/components/auth/WaitlistForm.css +1 -1
- package/dist/runtime/vue/components/auth/WaitlistForm.d.vue.ts +5 -0
- package/dist/runtime/vue/components/auth/WaitlistForm.vue +3 -5
- package/dist/runtime/vue/components/auth/WaitlistForm.vue.d.ts +5 -0
- package/dist/runtime/vue/components/auth/WaitlistPlace.css +1 -1
- package/dist/runtime/vue/components/auth/WaitlistShare.css +1 -1
- package/dist/runtime/vue/components/auth/WaitlistShare.vue +1 -7
- package/dist/runtime/vue/components/auth/WaitlistStatus.css +1 -1
- package/dist/runtime/vue/components/auth/WaitlistStatus.vue +120 -23
- package/dist/runtime/vue/components/auth/auth-form.d.ts +1 -1
- package/dist/runtime/vue/components/auth/waitlist-form.js +1 -1
- package/dist/runtime/vue/components/billing/BillingHistory.css +1 -1
- package/dist/runtime/vue/components/billing/BillingHistoryOrder.css +1 -1
- package/dist/runtime/vue/components/billing/CancelConfirmGroup.vue +2 -7
- package/dist/runtime/vue/components/billing/CancelFlow.css +1 -1
- package/dist/runtime/vue/components/billing/GiftForm.css +1 -0
- package/dist/runtime/vue/components/billing/GiftForm.d.vue.ts +105 -0
- package/dist/runtime/vue/components/billing/GiftForm.vue +228 -0
- package/dist/runtime/vue/components/billing/GiftForm.vue.d.ts +105 -0
- package/dist/runtime/vue/components/billing/GiftList.css +1 -1
- package/dist/runtime/vue/components/billing/GiftList.d.vue.ts +87 -2
- package/dist/runtime/vue/components/billing/GiftList.vue +7 -4
- package/dist/runtime/vue/components/billing/GiftList.vue.d.ts +87 -2
- package/dist/runtime/vue/components/billing/GiftReceived.vue +11 -3
- package/dist/runtime/vue/components/billing/PlanChangeConfirmGroup.d.vue.ts +7 -0
- package/dist/runtime/vue/components/billing/PlanChangeConfirmGroup.vue +50 -0
- package/dist/runtime/vue/components/billing/PlanChangeConfirmGroup.vue.d.ts +7 -0
- package/dist/runtime/vue/components/billing/PricingChangeConfirm.d.vue.ts +4 -0
- package/dist/runtime/vue/components/billing/PricingChangeConfirm.vue +17 -0
- package/dist/runtime/vue/components/billing/PricingChangeConfirm.vue.d.ts +4 -0
- package/dist/runtime/vue/components/billing/PricingPackCard.css +1 -1
- package/dist/runtime/vue/components/billing/PricingPlanCard.css +1 -1
- package/dist/runtime/vue/components/billing/PricingPlanCard.vue +15 -0
- package/dist/runtime/vue/components/billing/PricingTable.css +1 -1
- package/dist/runtime/vue/components/billing/PricingTable.d.vue.ts +24 -2
- package/dist/runtime/vue/components/billing/PricingTable.vue +84 -17
- package/dist/runtime/vue/components/billing/PricingTable.vue.d.ts +24 -2
- package/dist/runtime/vue/components/billing/ReferralCard.css +1 -1
- package/dist/runtime/vue/components/billing/ReferralCard.d.vue.ts +4 -0
- package/dist/runtime/vue/components/billing/ReferralCard.vue.d.ts +4 -0
- package/dist/runtime/vue/components/billing/ReferralLanding.css +1 -1
- package/dist/runtime/vue/components/billing/ReferralLanding.vue +44 -2
- package/dist/runtime/vue/components/billing/UpgradePrompt.css +1 -1
- package/dist/runtime/vue/components/billing/UsageHistory.css +1 -1
- package/dist/runtime/vue/components/billing/WithdrawalButton.css +1 -1
- package/dist/runtime/vue/components/billing/cancel-flow.js +2 -1
- package/dist/runtime/vue/components/billing/pricing-table.d.ts +10 -0
- package/dist/runtime/vue/components/billing/withdrawal-button.d.ts +3 -2
- package/dist/runtime/vue/components/billing/withdrawal-button.js +13 -33
- package/dist/runtime/vue/components/shared.css +1 -1
- package/dist/runtime/vue/components/shell/AccessDenied.css +1 -1
- package/dist/runtime/vue/components/shell/AiLabel.css +1 -1
- package/dist/runtime/vue/components/shell/AppShell.css +1 -1
- package/dist/runtime/vue/components/shell/ConfirmDialog.css +1 -1
- package/dist/runtime/vue/components/shell/ConnectionStatus.css +1 -1
- package/dist/runtime/vue/components/shell/ContactForm.css +1 -1
- package/dist/runtime/vue/components/shell/Gate.css +1 -1
- package/dist/runtime/vue/components/shell/LegalDocument.css +1 -1
- package/dist/runtime/vue/components/shell/NoticeAnnouncement.css +1 -1
- package/dist/runtime/vue/components/shell/NoticeDeletion.css +1 -1
- package/dist/runtime/vue/components/shell/NoticeGift.css +1 -1
- package/dist/runtime/vue/components/shell/NoticeImpersonation.css +1 -1
- package/dist/runtime/vue/components/shell/NoticeLowCredits.css +1 -1
- package/dist/runtime/vue/components/shell/NoticeMaintenance.css +1 -1
- package/dist/runtime/vue/components/shell/NoticePastDue.css +1 -1
- package/dist/runtime/vue/components/shell/NotificationInbox.css +1 -1
- package/dist/runtime/vue/components/shell/ReportAppeal.vue +16 -13
- package/dist/runtime/vue/components/shell/ReportNotice.css +1 -1
- package/dist/runtime/vue/components/shell/UploadField.css +1 -1
- package/dist/runtime/vue/components/shell/WorkspaceSwitcher.css +1 -1
- package/dist/runtime/vue/components/shell/report-form.js +1 -44
- package/dist/runtime/vue/components/tokens.css +1 -1
- package/dist/runtime/vue/components/workspaces/AuditLog.css +1 -1
- package/dist/runtime/vue/components/workspaces/AuditLog.d.vue.ts +1 -0
- package/dist/runtime/vue/components/workspaces/AuditLog.vue.d.ts +1 -0
- package/dist/runtime/vue/components/workspaces/WorkspaceBilling.css +1 -1
- package/dist/runtime/vue/components/workspaces/WorkspaceBilling.vue +29 -50
- package/dist/runtime/vue/components/workspaces/WorkspaceBillingPause.d.vue.ts +3 -0
- package/dist/runtime/vue/components/workspaces/WorkspaceBillingPause.vue +69 -0
- package/dist/runtime/vue/components/workspaces/WorkspaceBillingPause.vue.d.ts +3 -0
- package/dist/runtime/vue/components/workspaces/WorkspaceBillingSwitch.d.vue.ts +3 -0
- package/dist/runtime/vue/components/workspaces/WorkspaceBillingSwitch.vue +54 -0
- package/dist/runtime/vue/components/workspaces/WorkspaceBillingSwitch.vue.d.ts +3 -0
- package/dist/runtime/vue/components/workspaces/WorkspaceCredits.css +1 -1
- package/dist/runtime/vue/components/workspaces/WorkspaceList.css +1 -1
- package/dist/runtime/vue/components/workspaces/WorkspaceSettings.d.vue.ts +38 -0
- package/dist/runtime/vue/components/workspaces/WorkspaceSettings.vue +32 -1
- package/dist/runtime/vue/components/workspaces/WorkspaceSettings.vue.d.ts +38 -0
- package/dist/runtime/vue/components/workspaces/workspace-billing.d.ts +39 -2
- package/dist/runtime/vue/components/workspaces/workspace-billing.js +94 -2
- package/dist/runtime/vue/components/workspaces/workspace-settings.d.ts +4 -0
- package/dist/runtime/vue/composables/billing-format.d.ts +9 -4
- package/dist/runtime/vue/composables/billing-format.js +17 -9
- package/dist/runtime/vue/composables/billing-provider.js +3 -2
- package/dist/runtime/vue/composables/prepare-photo.d.ts +75 -0
- package/dist/runtime/vue/composables/prepare-photo.js +223 -0
- package/dist/runtime/vue/composables/use-access.d.ts +23 -2
- package/dist/runtime/vue/composables/use-access.js +22 -3
- package/dist/runtime/vue/composables/use-billing.d.ts +76 -5
- package/dist/runtime/vue/composables/use-billing.js +48 -0
- package/dist/runtime/vue/composables/use-gift-form.d.ts +123 -0
- package/dist/runtime/vue/composables/use-gift-form.js +169 -0
- package/dist/runtime/vue/composables/use-gift-list.d.ts +44 -4
- package/dist/runtime/vue/composables/use-gift-list.js +11 -5
- package/dist/runtime/vue/composables/use-install-prompt.d.ts +71 -0
- package/dist/runtime/vue/composables/use-install-prompt.js +53 -0
- package/dist/runtime/vue/composables/use-labels.js +17 -23
- package/dist/runtime/vue/composables/use-login-flow.d.ts +9 -0
- package/dist/runtime/vue/composables/use-login-flow.js +7 -0
- package/dist/runtime/vue/composables/use-orders.d.ts +1 -1
- package/dist/runtime/vue/composables/use-pricing.d.ts +54 -5
- package/dist/runtime/vue/composables/use-pricing.js +37 -10
- package/dist/runtime/vue/composables/use-push-subscription.js +1 -7
- package/dist/runtime/vue/composables/use-referral-invite.d.ts +17 -2
- package/dist/runtime/vue/composables/use-referral-invite.js +10 -1
- package/dist/runtime/vue/composables/use-referrals.js +2 -1
- package/dist/runtime/vue/composables/use-report-appeal.d.ts +86 -0
- package/dist/runtime/vue/composables/use-report-appeal.js +61 -0
- package/dist/runtime/vue/composables/use-return-path.d.ts +5 -4
- package/dist/runtime/vue/composables/use-return-path.js +16 -2
- package/dist/runtime/vue/composables/use-waitlist.d.ts +13 -1
- package/dist/runtime/vue/composables/use-waitlist.js +15 -4
- package/dist/runtime/vue/composables/use-withdrawal.d.ts +63 -0
- package/dist/runtime/vue/composables/use-withdrawal.js +38 -0
- package/dist/runtime/vue/middleware/page-access.js +2 -2
- package/dist/runtime/vue/pages/gifts.vue +2 -0
- package/dist/runtime/vue/pages/login.vue +5 -7
- package/dist/runtime/vue/pages/report.vue +2 -3
- package/dist/runtime/vue/parts.d.ts +5 -0
- package/dist/runtime/vue/plugins/chunk-recovery.client.d.ts +10 -0
- package/dist/runtime/vue/plugins/chunk-recovery.client.js +10 -0
- package/dist/runtime/vue/plugins/install-banner.client.d.ts +7 -0
- package/dist/runtime/vue/plugins/install-banner.client.js +5 -0
- package/dist/runtime/vue/plugins/install-prompt.client.d.ts +7 -0
- package/dist/runtime/vue/plugins/install-prompt.client.js +6 -0
- package/dist/runtime/vue/plugins/session-ended.js +2 -3
- package/dist/runtime/vue/utils/active-locale.js +8 -0
- package/dist/runtime/vue/utils/confirm-group.d.ts +18 -0
- package/dist/runtime/vue/utils/confirm-group.js +17 -0
- package/dist/runtime/vue/utils/display-mode.d.ts +8 -0
- package/dist/runtime/vue/utils/display-mode.js +11 -0
- package/dist/runtime/vue/utils/heic-absent.d.ts +2 -0
- package/dist/runtime/vue/utils/heic-absent.js +3 -0
- package/dist/runtime/vue/utils/intl.d.ts +12 -4
- package/dist/runtime/vue/utils/intl.js +13 -2
- package/dist/runtime/vue/utils/kept-invite.js +6 -29
- package/dist/runtime/vue/utils/page-origin.d.ts +15 -0
- package/dist/runtime/vue/utils/page-origin.js +8 -0
- package/dist/runtime/vue/utils/page-rules.d.ts +9 -0
- package/dist/runtime/vue/utils/page-rules.js +3 -0
- package/dist/runtime/vue/utils/plan-change-confirm.d.ts +76 -0
- package/dist/runtime/vue/utils/plan-change-confirm.js +39 -0
- package/dist/runtime/vue/utils/pricing-bindings.d.ts +7 -1
- package/dist/runtime/vue/utils/pricing-bindings.js +21 -0
- package/dist/runtime/vue/utils/pricing-seo.js +4 -2
- package/dist/runtime/vue/utils/tab-keep.d.ts +17 -0
- package/dist/runtime/vue/utils/tab-keep.js +46 -0
- package/dist/shared/{nuxt-backend.Bq_mhlky.mjs → nuxt-backend.9IVxzzft.mjs} +55 -10
- package/dist/shared/{nuxt-backend.DmZI-QSO.mjs → nuxt-backend.BCjeoX0x.mjs} +2 -26
- package/dist/shared/{nuxt-backend.D9qXcOOI.mjs → nuxt-backend.Baxb382E.mjs} +1 -1
- package/dist/shared/{nuxt-backend.Lk2MQI2u.mjs → nuxt-backend.BjQoqNIu.mjs} +26 -2
- package/dist/shared/{nuxt-backend.G4JryO1q.mjs → nuxt-backend.CbR37s_c.mjs} +255 -49
- package/package.json +6 -1
- package/skills/nuxt-backend/references/api.md +26 -10
- package/skills/nuxt-backend/references/renames.json +104 -0
- package/skills/nuxt-backend/references/surface.json +30 -2
- package/skills/nuxt-backend-ai/references/api.md +2 -1
- package/skills/nuxt-backend-auth/references/api.md +1 -1
- package/skills/nuxt-backend-billing/references/api.md +2 -0
- package/skills/nuxt-backend-data/references/api.md +4 -1
- package/skills/nuxt-backend-email/SKILL.md +5 -2
- package/skills/nuxt-backend-email/references/api.md +1 -0
- package/skills/nuxt-backend-growth/references/api.md +4 -0
- package/skills/nuxt-backend-ship/SKILL.md +1 -1
- package/skills/nuxt-backend-ship/references/api.md +9 -5
- package/skills/nuxt-backend-ui/SKILL.md +10 -5
- package/skills/nuxt-backend-upgrade/SKILL.md +4 -3
- package/skills/nuxt-backend-upgrade/references/upgrade.md +43 -0
- package/src/convex/catalog.ts +17 -0
- package/src/convex/components/backend/_generated/component.ts +30 -2
- package/src/convex/components/backend/billing.ts +19 -5
- package/src/convex/components/backend/jobs.ts +102 -5
- package/src/convex/components/backend/schema.ts +11 -0
- package/src/convex/delivery.ts +26 -1
- package/src/convex/emails/renewal-reminder.ts +19 -1
- package/src/convex/errors.ts +23 -9
- package/src/convex/events.ts +7 -0
- package/src/convex/integrations/ai/images.ts +22 -8
- package/src/convex/integrations/ai/job-errors.ts +64 -9
- package/src/convex/integrations/ai/jobs.ts +509 -64
- package/src/convex/integrations/ai/models.ts +1 -1
- package/src/convex/integrations/ai/moderation.ts +10 -5
- package/src/convex/integrations/ai.ts +6 -1
- package/src/convex/integrations/billing/context.ts +6 -3
- package/src/convex/integrations/billing/credits.ts +4 -1
- package/src/convex/integrations/billing/passes.ts +3 -11
- package/src/convex/integrations/billing/provider-failure.ts +56 -0
- package/src/convex/integrations/billing/types/setup.ts +1 -1
- package/src/convex/integrations/billing/types/surface.ts +9 -2
- package/src/convex/integrations/email-sync.ts +74 -26
- package/src/convex/integrations/inbound.ts +32 -16
- package/src/convex/integrations/launch.ts +52 -5
- package/src/convex/integrations/referrals.ts +25 -7
- package/src/convex/integrations/storage.ts +107 -1
- package/src/convex/label-groups/admin.ts +3 -0
- package/src/convex/label-groups/audit.ts +1 -0
- package/src/convex/label-groups/auth.ts +7 -0
- package/src/convex/label-groups/errors.ts +12 -0
- package/src/convex/label-groups/gift.ts +27 -0
- package/src/convex/label-groups/pricing.ts +20 -0
- package/src/convex/label-groups/referral.ts +4 -0
- package/src/convex/label-groups/settings.ts +39 -0
- package/src/convex/label-groups/waitlist.ts +7 -2
- package/src/convex/legal.ts +23 -2
- package/src/convex/log.ts +8 -0
- package/src/convex/money.ts +40 -0
- package/src/convex/report-rules.ts +16 -0
- package/src/convex/test-billing.ts +189 -0
- package/src/convex/test-models.ts +59 -4
- package/src/convex/test.ts +95 -8
- package/src/runtime/vue/components/account/AccountDeletion.css +1 -1
- package/src/runtime/vue/components/account/ActivationChecklist.css +5 -3
- package/src/runtime/vue/components/account/ConsentPrompt.css +7 -5
- package/src/runtime/vue/components/account/EmailUnsubscribe.css +8 -4
- package/src/runtime/vue/components/account/HowDidYouHear.css +9 -5
- package/src/runtime/vue/components/account/KeepAccount.css +4 -2
- package/src/runtime/vue/components/account/OnboardingFlow.css +6 -4
- package/src/runtime/vue/components/account/ProfileIdentity.css +1 -1
- package/src/runtime/vue/components/account/ProfilePreferencesSection.css +4 -2
- package/src/runtime/vue/components/account/ProfileSettings.css +4 -2
- package/src/runtime/vue/components/account/SecurityAlerts.css +1 -1
- package/src/runtime/vue/components/account/SecurityPasskeys.css +3 -3
- package/src/runtime/vue/components/account/SecuritySessions.css +1 -1
- package/src/runtime/vue/components/account/SecuritySettings.css +1 -1
- package/src/runtime/vue/components/admin/AdminAccess.css +1 -1
- package/src/runtime/vue/components/admin/AdminAnnouncements.css +2 -2
- package/src/runtime/vue/components/admin/AdminBilling.css +1 -1
- package/src/runtime/vue/components/admin/AdminChart.css +1 -1
- package/src/runtime/vue/components/admin/AdminConsole.css +1 -0
- package/src/runtime/vue/components/admin/AdminExperiments.css +1 -1
- package/src/runtime/vue/components/admin/AdminFlags.css +2 -2
- package/src/runtime/vue/components/admin/AdminQueue.css +5 -3
- package/src/runtime/vue/components/admin/AdminQueueJob.vue +6 -2
- package/src/runtime/vue/components/admin/AdminReferrals.css +4 -2
- package/src/runtime/vue/components/admin/AdminReports.css +1 -1
- package/src/runtime/vue/components/admin/AdminRevenue.css +1 -1
- package/src/runtime/vue/components/admin/admin.css +3 -3
- package/src/runtime/vue/components/auth/AuthForm.css +7 -4
- package/src/runtime/vue/components/auth/AuthForm.vue +1 -2
- package/src/runtime/vue/components/auth/AuthFormChoose.css +2 -1
- package/src/runtime/vue/components/auth/AuthFormHeader.css +1 -1
- package/src/runtime/vue/components/auth/AuthFormPasskeyOffer.css +1 -1
- package/src/runtime/vue/components/auth/InviteRedeem.css +56 -2
- package/src/runtime/vue/components/auth/InviteRedeem.vue +110 -9
- package/src/runtime/vue/components/auth/ReauthenticateCode.css +1 -1
- package/src/runtime/vue/components/auth/ReauthenticateDialog.css +6 -3
- package/src/runtime/vue/components/auth/ReauthenticatePasskey.css +1 -1
- package/src/runtime/vue/components/auth/WaitlistForm.css +4 -2
- package/src/runtime/vue/components/auth/WaitlistForm.vue +5 -6
- package/src/runtime/vue/components/auth/WaitlistPlace.css +4 -2
- package/src/runtime/vue/components/auth/WaitlistShare.css +6 -4
- package/src/runtime/vue/components/auth/WaitlistShare.vue +2 -8
- package/src/runtime/vue/components/auth/WaitlistStatus.css +27 -1
- package/src/runtime/vue/components/auth/WaitlistStatus.vue +153 -31
- package/src/runtime/vue/components/billing/BillingHistory.css +2 -2
- package/src/runtime/vue/components/billing/BillingHistoryOrder.css +1 -1
- package/src/runtime/vue/components/billing/CancelConfirmGroup.vue +2 -8
- package/src/runtime/vue/components/billing/CancelFlow.css +6 -4
- package/src/runtime/vue/components/billing/GiftForm.css +89 -0
- package/src/runtime/vue/components/billing/GiftForm.vue +251 -0
- package/src/runtime/vue/components/billing/GiftList.css +5 -3
- package/src/runtime/vue/components/billing/GiftList.vue +21 -9
- package/src/runtime/vue/components/billing/GiftReceived.vue +11 -3
- package/src/runtime/vue/components/billing/PlanChangeConfirmGroup.vue +59 -0
- package/src/runtime/vue/components/billing/PricingChangeConfirm.vue +22 -0
- package/src/runtime/vue/components/billing/PricingPackCard.css +1 -1
- package/src/runtime/vue/components/billing/PricingPlanCard.css +31 -4
- package/src/runtime/vue/components/billing/PricingPlanCard.vue +17 -2
- package/src/runtime/vue/components/billing/PricingTable.css +2 -2
- package/src/runtime/vue/components/billing/PricingTable.vue +141 -28
- package/src/runtime/vue/components/billing/ReferralCard.css +6 -4
- package/src/runtime/vue/components/billing/ReferralLanding.css +14 -3
- package/src/runtime/vue/components/billing/ReferralLanding.vue +54 -3
- package/src/runtime/vue/components/billing/UpgradePrompt.css +6 -4
- package/src/runtime/vue/components/billing/UsageHistory.css +2 -2
- package/src/runtime/vue/components/billing/WithdrawalButton.css +5 -3
- package/src/runtime/vue/components/shared.css +62 -9
- package/src/runtime/vue/components/shell/AccessDenied.css +5 -3
- package/src/runtime/vue/components/shell/AiLabel.css +2 -2
- package/src/runtime/vue/components/shell/AppShell.css +5 -3
- package/src/runtime/vue/components/shell/ConfirmDialog.css +5 -3
- package/src/runtime/vue/components/shell/ConnectionStatus.css +1 -1
- package/src/runtime/vue/components/shell/ContactForm.css +4 -2
- package/src/runtime/vue/components/shell/Gate.css +5 -3
- package/src/runtime/vue/components/shell/LegalDocument.css +1 -1
- package/src/runtime/vue/components/shell/NoticeAnnouncement.css +1 -1
- package/src/runtime/vue/components/shell/NoticeDeletion.css +5 -3
- package/src/runtime/vue/components/shell/NoticeGift.css +1 -1
- package/src/runtime/vue/components/shell/NoticeImpersonation.css +1 -1
- package/src/runtime/vue/components/shell/NoticeLowCredits.css +6 -3
- package/src/runtime/vue/components/shell/NoticeMaintenance.css +1 -1
- package/src/runtime/vue/components/shell/NoticePastDue.css +5 -3
- package/src/runtime/vue/components/shell/NotificationInbox.css +6 -4
- package/src/runtime/vue/components/shell/ReportAppeal.vue +17 -14
- package/src/runtime/vue/components/shell/ReportNotice.css +1 -1
- package/src/runtime/vue/components/shell/UploadField.css +5 -3
- package/src/runtime/vue/components/shell/WorkspaceSwitcher.css +5 -3
- package/src/runtime/vue/components/tokens.css +30 -0
- package/src/runtime/vue/components/workspaces/AuditLog.css +2 -2
- package/src/runtime/vue/components/workspaces/WorkspaceBilling.css +75 -2
- package/src/runtime/vue/components/workspaces/WorkspaceBilling.vue +45 -53
- package/src/runtime/vue/components/workspaces/WorkspaceBillingPause.vue +79 -0
- package/src/runtime/vue/components/workspaces/WorkspaceBillingSwitch.vue +63 -0
- package/src/runtime/vue/components/workspaces/WorkspaceCredits.css +1 -0
- package/src/runtime/vue/components/workspaces/WorkspaceList.css +2 -2
- package/src/runtime/vue/components/workspaces/WorkspaceSettings.vue +47 -4
- package/src/runtime/vue/pages/gifts.vue +12 -7
- package/src/runtime/vue/pages/invite.vue +4 -2
- package/src/runtime/vue/pages/login.vue +8 -8
- package/src/runtime/vue/pages/report.vue +2 -3
- package/src/runtime/vue/pages/waitlist.vue +8 -5
package/dist/convex/legal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legal.js","sourceRoot":"","sources":["../../src/convex/legal.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,0EAA0E;AAC1E,wEAAwE;AACxE,6EAA6E;AAC7E,2EAA2E;AAC3E,wEAAwE;AAExE,OAAO,EAAE,oBAAoB,EAAqD,MAAM,mBAAmB,CAAA;AAE3G,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAU/C,8DAA8D;AAC9D,MAAM,CAAC,MAAM,eAAe,GAA4B,CAAC,SAAS,EAAE,OAAO,EAAE,eAAe,EAAE,eAAe,CAAC,CAAA;AA4C9G;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,UAAU,EAAE;QACV,UAAU,EAAE,MAAM;QAClB,IAAI,EAAE,QAAQ;QACd,SAAS,EAAE,4HAA4H;QACvI,QAAQ,EAAE,yFAAyF;QACnG,SAAS,EAAE,kCAAkC;QAC7C,YAAY,EAAE,qBAAqB;KACpC;IACD,IAAI,EAAE;QACJ,UAAU,EAAE,SAAS;QACrB,IAAI,EAAE,QAAQ;QACd,SAAS,EAAE,oGAAoG;QAC/G,QAAQ,EAAE,sEAAsE;QAChF,SAAS,EAAE,8BAA8B;QACzC,YAAY,EAAE,UAAU;KACzB;IACD,OAAO,EAAE;QACP,UAAU,EAAE,SAAS;QACrB,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AC5F,OAAQ,MAAM,CAAC,IAAI,CAAC,aAAa,CAAuB,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAA;AAC9G,CAAC;AAED,gGAAgG;AAChG,MAAM,UAAU,mBAAmB,CAAC,QAAiD,GAAG,EAAE,CAAC,IAAI;IAC7F,OAAQ,MAAM,CAAC,IAAI,CAAC,eAAe,CAAyB,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE;QAC1E,MAAM,IAAI,GAAuB,eAAe,CAAC,GAAG,CAAC,CAAA;QACrD,OAAO,IAAI,CAAC,UAAU,KAAK,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;IAC3D,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
package/dist/convex/log.js
CHANGED
|
@@ -23,6 +23,7 @@ export const LOG_CODES = {
|
|
|
23
23
|
'consent.under_age_cookie_unset': 'An age under the minimum was refused, but the browser could not be told to remember the refusal for a day; the refusal stands.',
|
|
24
24
|
'access.invitation_unsent': 'An invitation by address was made with "Email them", but its email was not sent (the provider refused it, or the address cannot receive mail here); the invitation stands.',
|
|
25
25
|
'access.ticket_unrecorded': 'A new account signed up with a ticket while the app was closed, and the ticket was not recorded against it (the ledger row or the access.ticket_used event); the account was created.',
|
|
26
|
+
'access.referral_unclaimed': 'A friend a member\'s ticket admitted may not count as the member\'s referral (memberTickets({ referrals })): the referral program threw, before its claim or while recording it on the member\'s activity; the account was created.',
|
|
26
27
|
'waitlist.mirror_drift': 'A launch-news contact could not be written to the email provider after its retries; its waitlist entry is flagged and the next maintenance pass tries again.',
|
|
27
28
|
'waitlist.admitted_unsent': 'A waitlist entry was admitted, but its "You\'re in" email was not sent; the ticket stands.',
|
|
28
29
|
'waitlist.confirmation_unsent': 'A new waitlist entry was recorded, but its confirmation email (the status link) or its join event was not sent; the entry stands.',
|
|
@@ -108,6 +109,13 @@ export const LOG_CODES = {
|
|
|
108
109
|
'ai.job_cancel_failed': 'A stalled job\'s workflow could not be canceled; the job is already failed and refunded.',
|
|
109
110
|
'ai.job_refund_retry': 'A failed job\'s refund did not reach the billing provider; it is tried again, later each time.',
|
|
110
111
|
'ai.job_refund_failed': 'A failed job\'s refund failed every try: its credits are still owed, and an administrator\'s retry runs the job on the charge it paid.',
|
|
112
|
+
'ai.job_billing_wait': 'A job\'s hold or charge found billing not synced for its owner yet (a balance never read, or no billing customer yet): it waits and is tried again, for about five minutes, then fails with that refusal.',
|
|
113
|
+
'ai.job_charge_owed': 'A job charged by output had its charge refused by the billing provider for a passing reason: the job runs on and ends done, its credits stay held, and the charge is tried again in the background.',
|
|
114
|
+
'ai.job_charge_unheld': 'An owed charge\'s credits could not be held again (the balance could not be read): the charge is still tried, and the balance is taken as it lands.',
|
|
115
|
+
'ai.job_charge_retry': 'An owed charge did not reach the billing provider; it is tried again, later each time.',
|
|
116
|
+
'ai.job_charge_given_up': 'An owed charge failed every try: the job keeps its result uncharged, its hold went back, and an administrator\'s retry from the Queue tab tries the charge again.',
|
|
117
|
+
'ai.job_charge_refused': 'The billing provider refused a job\'s charge by output in a way no retry changes (a revoked access token, a product or meter it does not have): the charge was given up at once, the job keeps its result uncharged, its hold went back, and an administrator\'s retry from the Queue tab tries it again.',
|
|
118
|
+
'ai.job_charge_unannounced': 'An owed charge ended, but defineJobQueue({ onOwedCharge }) could not be scheduled for it: the charge\'s outcome stands, and the app\'s rows about it were not told.',
|
|
111
119
|
'ai.guest_claim_failed': 'A visitor\'s guest jobs were not moved to the account that signed up in their browser (no workspace a minute on, or the app\'s setupAi({ guest: { claim } }) mutation threw): the jobs still run, and the app\'s rows stay where they were.',
|
|
112
120
|
'ai.job_cost_unreported': 'A finished job\'s cost could not be sent to the billing provider\'s cost insights; nothing was charged for it.',
|
|
113
121
|
'ai.cost_unrecorded': 'What a run\'s model calls cost (a metered action, a stream, a chat reply or a knowledge embedding) could not be recorded for the admin console\'s Costs tab and the AI spend alert; the run itself went through.',
|
package/dist/convex/log.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../src/convex/log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,eAAe,EAAE,oEAAoE;IACrF,0BAA0B,EAAE,oEAAoE;IAChG,iCAAiC,EAAE,kFAAkF;IACrH,6BAA6B,EAAE,wGAAwG;IACvI,iCAAiC,EAAE,oHAAoH;IACvJ,qBAAqB,EAAE,mGAAmG;IAC1H,0BAA0B,EAAE,0JAA0J;IACtL,2BAA2B,EAAE,2NAA2N;IACxP,gCAAgC,EAAE,gIAAgI;IAClK,0BAA0B,EAAE,4KAA4K;IACxM,0BAA0B,EAAE,uLAAuL;IACnN,uBAAuB,EAAE,8JAA8J;IACvL,0BAA0B,EAAE,4FAA4F;IACxH,8BAA8B,EAAE,mIAAmI;IACnK,sBAAsB,EAAE,wHAAwH;IAChJ,wBAAwB,EAAE,4VAA4V;IACtX,oBAAoB,EAAE,8NAA8N;IACpP,sBAAsB,EAAE,yJAAyJ;IACjL,oBAAoB,EAAE,kNAAkN;IACxO,qBAAqB,EAAE,0IAA0I;IACjK,qBAAqB,EAAE,gKAAgK;IACvL,4BAA4B,EAAE,gJAAgJ;IAC9K,sBAAsB,EAAE,qHAAqH;IAC7I,sBAAsB,EAAE,wIAAwI;IAChK,4BAA4B,EAAE,8PAA8P;IAC5R,2BAA2B,EAAE,gLAAgL;IAC7M,wBAAwB,EAAE,4JAA4J;IACtL,oBAAoB,EAAE,gRAAgR;IACtS,2BAA2B,EAAE,8LAA8L;IAC3N,wBAAwB,EAAE,uKAAuK;IACjM,4BAA4B,EAAE,uJAAuJ;IACrL,+BAA+B,EAAE,uHAAuH;IACxJ,wBAAwB,EAAE,yHAAyH;IACnJ,4BAA4B,EAAE,kKAAkK;IAChM,qBAAqB,EAAE,gKAAg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E,KAAe;IAC1G,MAAM,IAAI,GAAG,kBAAkB,IAAI,KAAK,OAAO,EAAE,CAAA;IACjD,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAA;;QACxC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AAClC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How many digits below its main unit the provider states `currency`
|
|
3
|
+
* (ISO 4217, either case) in: 2 for USD, EUR, HUF and ISK, 0 for JPY and
|
|
4
|
+
* KRW, 3 for KWD. Any other code counts as 2, the provider's own default.
|
|
5
|
+
* The same answer on every runtime: it reads no locale data.
|
|
6
|
+
*/
|
|
7
|
+
export declare function minorUnitDigits(currency: string): number;
|
|
8
|
+
/** An amount in `currency`'s smallest unit, in its main one: 1999 USD cents are 19.99, 1999 JPY are 1999, 500000 HUF are 5000. */
|
|
9
|
+
export declare function toMajorUnits(amount: number, currency: string): number;
|
|
10
|
+
//# sourceMappingURL=money.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"money.d.ts","sourceRoot":"","sources":["../../src/convex/money.ts"],"names":[],"mappings":"AAyBA;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGxD;AAED,kIAAkI;AAClI,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAErE"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Money as the billing provider states it: an integer in the currency's
|
|
2
|
+
// smallest unit. The provider counts every currency in hundredths except a
|
|
3
|
+
// fixed few: the ones it counts in whole units (JPY, KRW) and the dinars
|
|
4
|
+
// its payment processor counts in thousandths (KWD, BHD). Shared by the
|
|
5
|
+
// pages, which format prices, and the emails, which state them.
|
|
6
|
+
//
|
|
7
|
+
// A fixed table, never `Intl`'s digits: the CLDR data behind `Intl` writes
|
|
8
|
+
// HUF, ISK, IDR, COP and PKR with no decimals while the provider still
|
|
9
|
+
// states them in hundredths (a 5 000 Ft plan arrives as 500000), and it
|
|
10
|
+
// differs between ICU versions, so the server, the Convex runtime and each
|
|
11
|
+
// browser could disagree. The lists are Polar's own
|
|
12
|
+
// (`get_currency_decimal_factor` in its `server/polar/kit/currency.py`):
|
|
13
|
+
// Stripe's zero-decimal currencies but UGX, which Stripe still takes in
|
|
14
|
+
// hundredths, as it does ISK; and Stripe's three-decimal currencies
|
|
15
|
+
// (docs.stripe.com/currencies), none of which Polar sells yet. The renewal
|
|
16
|
+
// reminder email restates them, since an ejected email imports only from
|
|
17
|
+
// `nuxt-backend/email`; test/unit/billing-money.test.ts holds the two
|
|
18
|
+
// together.
|
|
19
|
+
/** The currencies the provider states in whole units: `1500` JPY is ¥1,500. */
|
|
20
|
+
const WHOLE_UNITS = new Set(['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']);
|
|
21
|
+
/** The currencies stated in thousandths: `1999` KWD is 1.999 KWD. */
|
|
22
|
+
const THOUSANDTHS = new Set(['BHD', 'JOD', 'KWD', 'OMR', 'TND']);
|
|
23
|
+
/**
|
|
24
|
+
* How many digits below its main unit the provider states `currency`
|
|
25
|
+
* (ISO 4217, either case) in: 2 for USD, EUR, HUF and ISK, 0 for JPY and
|
|
26
|
+
* KRW, 3 for KWD. Any other code counts as 2, the provider's own default.
|
|
27
|
+
* The same answer on every runtime: it reads no locale data.
|
|
28
|
+
*/
|
|
29
|
+
export function minorUnitDigits(currency) {
|
|
30
|
+
const code = currency.toUpperCase();
|
|
31
|
+
return WHOLE_UNITS.has(code) ? 0 : THOUSANDTHS.has(code) ? 3 : 2;
|
|
32
|
+
}
|
|
33
|
+
/** An amount in `currency`'s smallest unit, in its main one: 1999 USD cents are 19.99, 1999 JPY are 1999, 500000 HUF are 5000. */
|
|
34
|
+
export function toMajorUnits(amount, currency) {
|
|
35
|
+
return amount / 10 ** minorUnitDigits(currency);
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=money.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"money.js","sourceRoot":"","sources":["../../src/convex/money.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,2EAA2E;AAC3E,yEAAyE;AACzE,wEAAwE;AACxE,gEAAgE;AAChE,EAAE;AACF,2EAA2E;AAC3E,uEAAuE;AACvE,wEAAwE;AACxE,2EAA2E;AAC3E,oDAAoD;AACpD,yEAAyE;AACzE,wEAAwE;AACxE,oEAAoE;AACpE,2EAA2E;AAC3E,yEAAyE;AACzE,sEAAsE;AACtE,YAAY;AAEZ,+EAA+E;AAC/E,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAA;AAEtI,qEAAqE;AACrE,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAA;AAEhE;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,QAAgB;IAC9C,MAAM,IAAI,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAA;IACnC,OAAO,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAClE,CAAC;AAED,kIAAkI;AAClI,MAAM,UAAU,YAAY,CAAC,MAAc,EAAE,QAAgB;IAC3D,OAAO,MAAM,GAAG,EAAE,IAAI,eAAe,CAAC,QAAQ,CAAC,CAAA;AACjD,CAAC"}
|
|
@@ -8,4 +8,10 @@ export declare const REPORT_DETAILS_MAX = 4000;
|
|
|
8
8
|
export declare const REMOVAL_DEADLINE_MS: number;
|
|
9
9
|
/** Where the appeal token travels in the `report` page's address: its fragment, never sent to a server. */
|
|
10
10
|
export declare const APPEAL_FRAGMENT = "appeal=";
|
|
11
|
+
/**
|
|
12
|
+
* The appeal token an address's fragment carries (`#appeal=<token>`), or
|
|
13
|
+
* `null` for none. A fragment that is not percent-encoded right (`%E0`,
|
|
14
|
+
* from a link cut short) carries none either, rather than throwing.
|
|
15
|
+
*/
|
|
16
|
+
export declare function appealTokenOf(hash: string): string | null;
|
|
11
17
|
//# sourceMappingURL=report-rules.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report-rules.d.ts","sourceRoot":"","sources":["../../src/convex/report-rules.ts"],"names":[],"mappings":"AAIA,4FAA4F;AAC5F,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,aAAa,GAAG,SAAS,GAAG,OAAO,CAAA;AAEtH,6DAA6D;AAC7D,eAAO,MAAM,cAAc,EAAE,SAAS,YAAY,EAA2F,CAAA;AAE7I,0EAA0E;AAC1E,eAAO,MAAM,kBAAkB,OAAO,CAAA;AAEtC,4FAA4F;AAC5F,eAAO,MAAM,mBAAmB,QAAsB,CAAA;AAEtD,2GAA2G;AAC3G,eAAO,MAAM,eAAe,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"report-rules.d.ts","sourceRoot":"","sources":["../../src/convex/report-rules.ts"],"names":[],"mappings":"AAIA,4FAA4F;AAC5F,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,aAAa,GAAG,SAAS,GAAG,OAAO,CAAA;AAEtH,6DAA6D;AAC7D,eAAO,MAAM,cAAc,EAAE,SAAS,YAAY,EAA2F,CAAA;AAE7I,0EAA0E;AAC1E,eAAO,MAAM,kBAAkB,OAAO,CAAA;AAEtC,4FAA4F;AAC5F,eAAO,MAAM,mBAAmB,QAAsB,CAAA;AAEtD,2GAA2G;AAC3G,eAAO,MAAM,eAAe,YAAY,CAAA;AAExC;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CASzD"}
|
|
@@ -9,4 +9,19 @@ export const REPORT_DETAILS_MAX = 4000;
|
|
|
9
9
|
export const REMOVAL_DEADLINE_MS = 48 * 60 * 60 * 1000;
|
|
10
10
|
/** Where the appeal token travels in the `report` page's address: its fragment, never sent to a server. */
|
|
11
11
|
export const APPEAL_FRAGMENT = 'appeal=';
|
|
12
|
+
/**
|
|
13
|
+
* The appeal token an address's fragment carries (`#appeal=<token>`), or
|
|
14
|
+
* `null` for none. A fragment that is not percent-encoded right (`%E0`,
|
|
15
|
+
* from a link cut short) carries none either, rather than throwing.
|
|
16
|
+
*/
|
|
17
|
+
export function appealTokenOf(hash) {
|
|
18
|
+
let fragment;
|
|
19
|
+
try {
|
|
20
|
+
fragment = decodeURIComponent(hash.replace(/^#/, '')).trim();
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
return fragment.startsWith(APPEAL_FRAGMENT) ? fragment.slice(APPEAL_FRAGMENT.length) || null : null;
|
|
26
|
+
}
|
|
12
27
|
//# sourceMappingURL=report-rules.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report-rules.js","sourceRoot":"","sources":["../../src/convex/report-rules.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,wEAAwE;AACxE,2DAA2D;AAK3D,6DAA6D;AAC7D,MAAM,CAAC,MAAM,cAAc,GAA4B,CAAC,S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AC,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA;AACrG,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A usage event the fake billing provider took.
|
|
3
|
+
*
|
|
4
|
+
* @experimental
|
|
5
|
+
*/
|
|
6
|
+
export interface TestUsageEvent {
|
|
7
|
+
/** The event's name: the meter's event name, or `job.cost` for a job's cost report. */
|
|
8
|
+
name: string;
|
|
9
|
+
/** The billing entity it bills, as the provider's external customer id: a workspace, or an account under `billTo: 'user'`. */
|
|
10
|
+
customer: string;
|
|
11
|
+
/** Its idempotency key: a second event with the same key is a duplicate the provider drops. */
|
|
12
|
+
externalId?: string;
|
|
13
|
+
/** The credits it moves, read from its numeric metadata (the sum meter's property): positive for a charge, negative for a refund; absent for a report. */
|
|
14
|
+
value?: number;
|
|
15
|
+
/** Its metadata as sent: the meter's property, and what the charge named (`userId`, `job`, an app's own keys). */
|
|
16
|
+
metadata: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* What {@link stubBillingProvider} answers with, and what it took.
|
|
20
|
+
*
|
|
21
|
+
* @experimental
|
|
22
|
+
*/
|
|
23
|
+
export interface TestBillingProvider {
|
|
24
|
+
/** Every event it took, in order, each idempotency key once. */
|
|
25
|
+
readonly events: readonly TestUsageEvent[];
|
|
26
|
+
/** The charges it took: events that move credits up. */
|
|
27
|
+
readonly charges: readonly TestUsageEvent[];
|
|
28
|
+
/** The refunds it took: events that move credits back, their `value` negative. */
|
|
29
|
+
readonly refunds: readonly TestUsageEvent[];
|
|
30
|
+
/** How many ingest calls it refused. */
|
|
31
|
+
readonly refused: number;
|
|
32
|
+
/**
|
|
33
|
+
* Refuse the next charges (or refunds) with a 503, as a provider having
|
|
34
|
+
* trouble does: `times` of them, or every one until `accept()`.
|
|
35
|
+
* A refused event is not kept, so a retry under its key is new.
|
|
36
|
+
*/
|
|
37
|
+
refuse: (what?: 'charges' | 'refunds', times?: number) => void;
|
|
38
|
+
/** Take every event again. */
|
|
39
|
+
accept: () => void;
|
|
40
|
+
/** Put the `fetch` it replaced back: call it after the test. */
|
|
41
|
+
restore: () => void;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* How {@link stubBillingProvider} answers.
|
|
45
|
+
*
|
|
46
|
+
* @experimental
|
|
47
|
+
*/
|
|
48
|
+
export interface StubBillingProviderOptions {
|
|
49
|
+
/** The status a refused event gets. Default `503`. */
|
|
50
|
+
status?: number;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Answer the billing provider's usage-event ingest in `fetch`, as its API
|
|
54
|
+
* would: every charge, refund and cost report the package's billing sends
|
|
55
|
+
* is taken and kept once by its idempotency key, and reported back in
|
|
56
|
+
* `events`, `charges` and `refunds`. Any other request goes to the `fetch`
|
|
57
|
+
* it replaced, so it composes with `stubStorageFetch` in either order.
|
|
58
|
+
* Returns the fake, with `restore` to put `fetch` back.
|
|
59
|
+
*
|
|
60
|
+
* A charge reaches the provider only for an entity that is its customer:
|
|
61
|
+
* give it one with `seedBilling(t, entityId, { customer: true, credits })`.
|
|
62
|
+
* Without one, the charge is refused `not_ready` (`no_customer`) before any
|
|
63
|
+
* event is sent.
|
|
64
|
+
*
|
|
65
|
+
* @experimental
|
|
66
|
+
*
|
|
67
|
+
* @param options - The status a refused event gets.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* let provider: TestBillingProvider
|
|
72
|
+
* beforeEach(() => { provider = stubBillingProvider() })
|
|
73
|
+
* afterEach(() => provider.restore())
|
|
74
|
+
*
|
|
75
|
+
* test('a refused charge stays owed, then lands', async () => {
|
|
76
|
+
* provider.refuse('charges', 1)
|
|
77
|
+
* // …run the job with drain(t, vi)…
|
|
78
|
+
* expect(provider.charges).toEqual([expect.objectContaining({ value: 3, metadata: expect.objectContaining({ stripId }) })])
|
|
79
|
+
* })
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
export declare function stubBillingProvider(options?: StubBillingProviderOptions): TestBillingProvider;
|
|
83
|
+
//# sourceMappingURL=test-billing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-billing.d.ts","sourceRoot":"","sources":["../../src/convex/test-billing.ts"],"names":[],"mappings":"AAcA;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,uFAAuF;IACvF,IAAI,EAAE,MAAM,CAAA;IACZ,8HAA8H;IAC9H,QAAQ,EAAE,MAAM,CAAA;IAChB,+FAA+F;IAC/F,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,0JAA0J;IAC1J,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,kHAAkH;IAClH,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAClC;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,gEAAgE;IAChE,QAAQ,CAAC,MAAM,EAAE,SAAS,cAAc,EAAE,CAAA;IAC1C,wDAAwD;IACxD,QAAQ,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,CAAA;IAC3C,kFAAkF;IAClF,QAAQ,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,CAAA;IAC3C,wCAAwC;IACxC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB;;;;OAIG;IACH,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9D,8BAA8B;IAC9B,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,gEAAgE;IAChE,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IACzC,sDAAsD;IACtD,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAuCD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,0BAA+B,GAAG,mBAAmB,CAqDjG"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
// The billing provider's fake `nuxt-backend/test` hands an app: `fetch`
|
|
2
|
+
// answered for the provider's usage-event ingest, as its API answers it, so
|
|
3
|
+
// a test of credits that reach the provider (a job's charge, a refund, a
|
|
4
|
+
// cost report) runs the package's real billing with no network and no
|
|
5
|
+
// account. Each event is kept once by its idempotency key, as the provider
|
|
6
|
+
// keeps it, and a switch refuses the next charges or refunds with a 503.
|
|
7
|
+
// Development and production never load it.
|
|
8
|
+
/** The provider's API hosts: the sandbox tests bill in, and production. */
|
|
9
|
+
const PROVIDER_HOSTS = new Set(['sandbox-api.polar.sh', 'api.polar.sh']);
|
|
10
|
+
/** The usage-event ingest, as the provider's API serves it. */
|
|
11
|
+
const INGEST_PATH = '/v1/events/ingest';
|
|
12
|
+
/** A wire event's credits: its first finite number, the meter's property; the reserved `_cost` and `_llm` are not credits. */
|
|
13
|
+
function valueOf(metadata) {
|
|
14
|
+
for (const [key, value] of Object.entries(metadata)) {
|
|
15
|
+
if (!key.startsWith('_') && typeof value === 'number' && Number.isFinite(value))
|
|
16
|
+
return value;
|
|
17
|
+
}
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
/** A wire field that is text, or nothing. */
|
|
21
|
+
const textOf = (value) => typeof value === 'string' ? value : '';
|
|
22
|
+
/** A wire event, as the provider reads it (snake case). */
|
|
23
|
+
function eventOf(entry) {
|
|
24
|
+
const metadata = (entry.metadata && typeof entry.metadata === 'object' ? entry.metadata : {});
|
|
25
|
+
const value = valueOf(metadata);
|
|
26
|
+
return {
|
|
27
|
+
name: textOf(entry.name),
|
|
28
|
+
customer: textOf(entry.external_customer_id ?? entry.customer_id),
|
|
29
|
+
...(typeof entry.external_id === 'string' ? { externalId: entry.external_id } : {}),
|
|
30
|
+
...(value === undefined ? {} : { value }),
|
|
31
|
+
metadata,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/** Whether the next refusal falls on these events: a batch holding a charge counts as a charge, one holding a refund as a refund. */
|
|
35
|
+
function takesRefusal(refusals, events) {
|
|
36
|
+
for (const kind of ['charges', 'refunds']) {
|
|
37
|
+
if (refusals[kind] <= 0)
|
|
38
|
+
continue;
|
|
39
|
+
if (!events.some(event => event.value !== undefined && (kind === 'charges' ? event.value > 0 : event.value < 0)))
|
|
40
|
+
continue;
|
|
41
|
+
refusals[kind]--;
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Answer the billing provider's usage-event ingest in `fetch`, as its API
|
|
48
|
+
* would: every charge, refund and cost report the package's billing sends
|
|
49
|
+
* is taken and kept once by its idempotency key, and reported back in
|
|
50
|
+
* `events`, `charges` and `refunds`. Any other request goes to the `fetch`
|
|
51
|
+
* it replaced, so it composes with `stubStorageFetch` in either order.
|
|
52
|
+
* Returns the fake, with `restore` to put `fetch` back.
|
|
53
|
+
*
|
|
54
|
+
* A charge reaches the provider only for an entity that is its customer:
|
|
55
|
+
* give it one with `seedBilling(t, entityId, { customer: true, credits })`.
|
|
56
|
+
* Without one, the charge is refused `not_ready` (`no_customer`) before any
|
|
57
|
+
* event is sent.
|
|
58
|
+
*
|
|
59
|
+
* @experimental
|
|
60
|
+
*
|
|
61
|
+
* @param options - The status a refused event gets.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```ts
|
|
65
|
+
* let provider: TestBillingProvider
|
|
66
|
+
* beforeEach(() => { provider = stubBillingProvider() })
|
|
67
|
+
* afterEach(() => provider.restore())
|
|
68
|
+
*
|
|
69
|
+
* test('a refused charge stays owed, then lands', async () => {
|
|
70
|
+
* provider.refuse('charges', 1)
|
|
71
|
+
* // …run the job with drain(t, vi)…
|
|
72
|
+
* expect(provider.charges).toEqual([expect.objectContaining({ value: 3, metadata: expect.objectContaining({ stripId }) })])
|
|
73
|
+
* })
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
export function stubBillingProvider(options = {}) {
|
|
77
|
+
const status = options.status ?? 503;
|
|
78
|
+
const events = [];
|
|
79
|
+
const refusals = { charges: 0, refunds: 0 };
|
|
80
|
+
let refused = 0;
|
|
81
|
+
const original = globalThis.fetch;
|
|
82
|
+
globalThis.fetch = async (input, init) => {
|
|
83
|
+
const request = new Request(input, init);
|
|
84
|
+
const url = new URL(request.url);
|
|
85
|
+
if (!PROVIDER_HOSTS.has(url.host))
|
|
86
|
+
return original(input, init);
|
|
87
|
+
if (request.method !== 'POST' || url.pathname !== INGEST_PATH) {
|
|
88
|
+
return Response.json({ error: 'NotFound', detail: `The fake billing provider answers ${INGEST_PATH} only, not ${request.method} ${url.pathname}.` }, { status: 404 });
|
|
89
|
+
}
|
|
90
|
+
const body = await request.json();
|
|
91
|
+
const batch = (body.events ?? []).map(eventOf);
|
|
92
|
+
if (takesRefusal(refusals, batch)) {
|
|
93
|
+
refused++;
|
|
94
|
+
return Response.json({ error: 'ServiceUnavailable', detail: 'The fake billing provider refused this event, as asked.' }, { status });
|
|
95
|
+
}
|
|
96
|
+
let inserted = 0;
|
|
97
|
+
let duplicates = 0;
|
|
98
|
+
for (const event of batch) {
|
|
99
|
+
if (event.externalId !== undefined && events.some(kept => kept.externalId === event.externalId)) {
|
|
100
|
+
duplicates++;
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
events.push(event);
|
|
104
|
+
inserted++;
|
|
105
|
+
}
|
|
106
|
+
return Response.json({ inserted, duplicates });
|
|
107
|
+
};
|
|
108
|
+
return {
|
|
109
|
+
events,
|
|
110
|
+
get charges() {
|
|
111
|
+
return events.filter(event => event.value !== undefined && event.value > 0);
|
|
112
|
+
},
|
|
113
|
+
get refunds() {
|
|
114
|
+
return events.filter(event => event.value !== undefined && event.value < 0);
|
|
115
|
+
},
|
|
116
|
+
get refused() {
|
|
117
|
+
return refused;
|
|
118
|
+
},
|
|
119
|
+
refuse: (what = 'charges', times = Number.POSITIVE_INFINITY) => {
|
|
120
|
+
refusals[what] = times;
|
|
121
|
+
},
|
|
122
|
+
accept: () => {
|
|
123
|
+
refusals.charges = 0;
|
|
124
|
+
refusals.refunds = 0;
|
|
125
|
+
},
|
|
126
|
+
restore: () => {
|
|
127
|
+
globalThis.fetch = original;
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=test-billing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-billing.js","sourceRoot":"","sources":["../../src/convex/test-billing.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,4EAA4E;AAC5E,yEAAyE;AACzE,sEAAsE;AACtE,2EAA2E;AAC3E,yEAAyE;AACzE,4CAA4C;AAE5C,2EAA2E;AAC3E,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,sBAAsB,EAAE,cAAc,CAAC,CAAC,CAAA;AAExE,+DAA+D;AAC/D,MAAM,WAAW,GAAG,mBAAmB,CAAA;AA0DvC,8HAA8H;AAC9H,SAAS,OAAO,CAAC,QAAiC;IAChD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACpD,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;YAAE,OAAO,KAAK,CAAA;IAC/F,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,6CAA6C;AAC7C,MAAM,MAAM,GAAG,CAAC,KAAc,EAAU,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA;AAEjF,2DAA2D;AAC3D,SAAS,OAAO,CAAC,KAA8B;IAC7C,MAAM,QAAQ,GAAG,CAAC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AAC,OAAO,GAAG,CAAC,CAAA;YACpB,QAAQ,CAAC,OAAO,GAAG,CAAC,CAAA;QACtB,CAAC;QACD,OAAO,EAAE,GAAG,EAAE;YACZ,UAAU,CAAC,KAAK,GAAG,QAAQ,CAAA;QAC7B,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -3,6 +3,17 @@ import type { MeteredModel } from './integrations/ai/config.js';
|
|
|
3
3
|
export declare const TEST_MODEL_USD = 0.001;
|
|
4
4
|
/** What text carries for the mock safety classifier to flag it: `unsafe` and `S1`. Anything else is `safe`. */
|
|
5
5
|
export declare const TEST_UNSAFE_MARKER = "[[unsafe]]";
|
|
6
|
+
/**
|
|
7
|
+
* The marker that has the mock safety classifier answer chosen Llama Guard
|
|
8
|
+
* codes: `TEST_UNSAFE_CODE('S7')` is `[[unsafe:S7]]`, answered
|
|
9
|
+
* `unsafe\nS7`; several codes join with a comma (`'S1,S10'`). In text,
|
|
10
|
+
* or anywhere in an image's bytes.
|
|
11
|
+
*
|
|
12
|
+
* @experimental
|
|
13
|
+
*/
|
|
14
|
+
export declare const TEST_UNSAFE_CODE: (codes: string) => string;
|
|
15
|
+
/** How the mock classifier answers, as Llama Guard does: `safe`, or `unsafe` and the codes a marker asks for (`S1` for `[[unsafe]]`). */
|
|
16
|
+
export declare function classifierAnswer(content: string): string;
|
|
6
17
|
/**
|
|
7
18
|
* The picture the mock image model answers with: a valid 2×2 PNG, the same
|
|
8
19
|
* bytes every time, so a test can store it, sniff its type and sign it.
|
|
@@ -11,8 +22,9 @@ export declare const TEST_IMAGE_PNG: Uint8Array<ArrayBuffer>;
|
|
|
11
22
|
/**
|
|
12
23
|
* The mock for a model id: it answers with the prompt it was given, and a
|
|
13
24
|
* fixed cost. A safety classifier's id answers as Llama Guard does: `safe`,
|
|
14
|
-
* or `unsafe` and `S1` for
|
|
15
|
-
*
|
|
25
|
+
* or `unsafe` and `S1` for content that carries {@link TEST_UNSAFE_MARKER},
|
|
26
|
+
* or the codes {@link TEST_UNSAFE_CODE} names, in its text or an image's
|
|
27
|
+
* bytes. An image model's id adds {@link TEST_IMAGE_PNG} as a generated file.
|
|
16
28
|
*/
|
|
17
29
|
export declare function testModel(modelId: string): MeteredModel;
|
|
18
30
|
/** What embedding one text through the mock costs, in US dollars. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-models.d.ts","sourceRoot":"","sources":["../../src/convex/test-models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"test-models.d.ts","sourceRoot":"","sources":["../../src/convex/test-models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAe/D,yDAAyD;AACzD,eAAO,MAAM,cAAc,QAAQ,CAAA;AAanC,+GAA+G;AAC/G,eAAO,MAAM,kBAAkB,eAAe,CAAA;AAE9C;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,GAAI,OAAO,MAAM,KAAG,MAA+B,CAAA;AAsChF,yIAAyI;AACzI,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAIxD;AAQD;;;GAGG;AACH,eAAO,MAAM,cAAc,yBAAgK,CAAA;AAO3L;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CA2BvD;AAED,qEAAqE;AACrE,eAAO,MAAM,kBAAkB,UAAU,CAAA;AAEzC;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAWvE;AAED,wHAAwH;AACxH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,SAAO,0CAYnE;AAED,wEAAwE;AACxE,eAAO,MAAM,cAAc,OAAO,CAAA;AAElC;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,sCAc7C;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAKxC"}
|
|
@@ -4,7 +4,8 @@ import { TEST_EMBEDDING_MODELS, TEST_IMAGE_MODELS, TEST_MODELS } from './integra
|
|
|
4
4
|
// reports a fixed cost in the shape the AI Gateway reports it, so a test of a
|
|
5
5
|
// metered action settles through the path a live call does, with no key and
|
|
6
6
|
// no network. A safety classifier's id (Llama Guard, a safeguard model) gets
|
|
7
|
-
// a classifier instead, so `ai.requireSafe` passes or refuses on purpose,
|
|
7
|
+
// a classifier instead, so `ai.requireSafe` passes or refuses on purpose,
|
|
8
|
+
// from a marker in the text or in an image's bytes, and
|
|
8
9
|
// an image model's id (`google/gemini-2.5-flash-image`, `openai/gpt-image-1`)
|
|
9
10
|
// answers with a PNG beside the text, so a step that stores the image runs.
|
|
10
11
|
// Development and production never load it: it is installed by
|
|
@@ -23,6 +24,61 @@ function lastUserText(prompt) {
|
|
|
23
24
|
}
|
|
24
25
|
/** What text carries for the mock safety classifier to flag it: `unsafe` and `S1`. Anything else is `safe`. */
|
|
25
26
|
export const TEST_UNSAFE_MARKER = '[[unsafe]]';
|
|
27
|
+
/**
|
|
28
|
+
* The marker that has the mock safety classifier answer chosen Llama Guard
|
|
29
|
+
* codes: `TEST_UNSAFE_CODE('S7')` is `[[unsafe:S7]]`, answered
|
|
30
|
+
* `unsafe\nS7`; several codes join with a comma (`'S1,S10'`). In text,
|
|
31
|
+
* or anywhere in an image's bytes.
|
|
32
|
+
*
|
|
33
|
+
* @experimental
|
|
34
|
+
*/
|
|
35
|
+
export const TEST_UNSAFE_CODE = (codes) => `[[unsafe:${codes}]]`;
|
|
36
|
+
/** The markers the mock classifier reads: `[[unsafe]]`, or `[[unsafe:S7]]` with its codes. */
|
|
37
|
+
const CLASSIFIER_MARKER = /\[\[unsafe(?::(S\d{1,2}(?:,S\d{1,2})*))?\]\]/;
|
|
38
|
+
/** Bytes as text, so a marker inside an image is found. */
|
|
39
|
+
const latin1 = (bytes) => {
|
|
40
|
+
let text = '';
|
|
41
|
+
for (const byte of bytes)
|
|
42
|
+
text += String.fromCharCode(byte);
|
|
43
|
+
return text;
|
|
44
|
+
};
|
|
45
|
+
/** The bytes of a file part of a prompt, as text: raw bytes, or base64. A file by URL is not read. */
|
|
46
|
+
function fileText(part) {
|
|
47
|
+
const data = (part.data && typeof part.data === 'object' && 'type' in part.data ? part.data.type === 'data' ? part.data.data : undefined : part.data);
|
|
48
|
+
if (data instanceof Uint8Array)
|
|
49
|
+
return latin1(data);
|
|
50
|
+
if (typeof data !== 'string')
|
|
51
|
+
return '';
|
|
52
|
+
try {
|
|
53
|
+
return latin1(Uint8Array.from(atob(data), char => char.charCodeAt(0)));
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
return data;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/** What the last user message of a prompt holds for the classifier: its text, and its images' bytes as text. */
|
|
60
|
+
function lastUserContent(prompt) {
|
|
61
|
+
const user = [...prompt].reverse().find(message => message.role === 'user');
|
|
62
|
+
const content = user?.content;
|
|
63
|
+
if (typeof content === 'string')
|
|
64
|
+
return content;
|
|
65
|
+
if (!Array.isArray(content))
|
|
66
|
+
return '';
|
|
67
|
+
return content.map((part) => {
|
|
68
|
+
if (!part || typeof part !== 'object')
|
|
69
|
+
return '';
|
|
70
|
+
if ('text' in part)
|
|
71
|
+
return String(part.text);
|
|
72
|
+
return part.type === 'file' || part.type === 'image' ? fileText(part) : '';
|
|
73
|
+
}).join(' ');
|
|
74
|
+
}
|
|
75
|
+
/** How the mock classifier answers, as Llama Guard does: `safe`, or `unsafe` and the codes a marker asks for (`S1` for `[[unsafe]]`). */
|
|
76
|
+
export function classifierAnswer(content) {
|
|
77
|
+
const marker = CLASSIFIER_MARKER.exec(content);
|
|
78
|
+
if (!marker)
|
|
79
|
+
return 'safe';
|
|
80
|
+
return `unsafe\n${marker[1] ?? 'S1'}`;
|
|
81
|
+
}
|
|
26
82
|
/** Whether an id names a safety classifier: Llama Guard, or a policy-following safeguard model. */
|
|
27
83
|
const isClassifier = (modelId) => /llama-guard|safeguard/i.test(modelId);
|
|
28
84
|
/** Whether an id names a model that draws: its name says image (Gemini's and OpenAI's image models, Imagen), DALL·E or FLUX. */
|
|
@@ -39,14 +95,15 @@ const usage = {
|
|
|
39
95
|
/**
|
|
40
96
|
* The mock for a model id: it answers with the prompt it was given, and a
|
|
41
97
|
* fixed cost. A safety classifier's id answers as Llama Guard does: `safe`,
|
|
42
|
-
* or `unsafe` and `S1` for
|
|
43
|
-
*
|
|
98
|
+
* or `unsafe` and `S1` for content that carries {@link TEST_UNSAFE_MARKER},
|
|
99
|
+
* or the codes {@link TEST_UNSAFE_CODE} names, in its text or an image's
|
|
100
|
+
* bytes. An image model's id adds {@link TEST_IMAGE_PNG} as a generated file.
|
|
44
101
|
*/
|
|
45
102
|
export function testModel(modelId) {
|
|
46
103
|
if (!sdk)
|
|
47
104
|
throw new Error('[nuxt-backend/test] A model call under test needs the AI SDK: install it with `pnpm add ai`.');
|
|
48
105
|
const answer = isClassifier(modelId)
|
|
49
|
-
? (prompt) =>
|
|
106
|
+
? (prompt) => classifierAnswer(lastUserContent(prompt))
|
|
50
107
|
: (prompt) => `Test reply to: ${lastUserText(prompt) || 'an empty prompt'}`;
|
|
51
108
|
const providerMetadata = { gateway: { cost: String(TEST_MODEL_USD) } };
|
|
52
109
|
const finishReason = { unified: 'stop', raw: 'stop' };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-models.js","sourceRoot":"","sources":["../../src/convex/test-models.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAEnG,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,4EAA4E;AAC5E,6EAA6E;AAC7E,
|
|
1
|
+
{"version":3,"file":"test-models.js","sourceRoot":"","sources":["../../src/convex/test-models.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,EAAE,WAAW,EAAE,EAAE,GAAG,GAAG,GAAG,CAAC,EAAE;YAC5E,gBAAgB,EAAE,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,cAAc,GAAG,CAAC,CAAC,EAAE,EAAE;YAC/E,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE;SAClE,CAAC;KACH,CAAC,CAAA;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB;IAC/B,IAAI,CAAC,GAAG;QAAE,OACT;IAAC,UAAsC,CAAC,WAAW,CAAC,GAAG,SAAS,CAChE;IAAC,UAAsC,CAAC,qBAAqB,CAAC,GAAG,kBAAkB,CACnF;IAAC,UAAsC,CAAC,iBAAiB,CAAC,GAAG,cAAc,CAAA;AAC9E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-backend/_nuxt/CiCAOwUc.js"}}</script><link rel="stylesheet" href="/__nuxt-backend/_nuxt/entry.DsMplBp-.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-backend/_nuxt/CiCAOwUc.js"><script type="module" src="/__nuxt-backend/_nuxt/CiCAOwUc.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-backend",buildId:"
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-backend/_nuxt/CiCAOwUc.js"}}</script><link rel="stylesheet" href="/__nuxt-backend/_nuxt/entry.DsMplBp-.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-backend/_nuxt/CiCAOwUc.js"><script type="module" src="/__nuxt-backend/_nuxt/CiCAOwUc.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-backend",buildId:"e9d6e19e-077a-4bc9-a88e-863e94219dcc",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1794354164675,false]</script></body></html>
|
package/dist/eslint.d.mts
CHANGED
|
@@ -22,7 +22,8 @@ interface BackendEslintOptions {
|
|
|
22
22
|
/**
|
|
23
23
|
* Two flat-config entries: `nuxt-backend:convex` applies the Convex rules to
|
|
24
24
|
* the functions directory (tests excluded), and `nuxt-backend:generated`
|
|
25
|
-
* ignores every `_generated` folder in it
|
|
25
|
+
* ignores every `_generated` folder in it and the files the module generates
|
|
26
|
+
* there (brand, paths, labels and the billing id map).
|
|
26
27
|
*
|
|
27
28
|
* The rules parse TypeScript. Inside `withNuxt(…)` the parser is already set;
|
|
28
29
|
* a standalone config adds `typescript-eslint`'s parser for `.ts` files.
|
package/dist/eslint.mjs
CHANGED
|
@@ -10,6 +10,7 @@ const BACKEND_ESLINT_RULES = Object.freeze({
|
|
|
10
10
|
"@convex-dev/no-duplicate-indexes": "error",
|
|
11
11
|
"@convex-dev/no-process-env": "error"
|
|
12
12
|
});
|
|
13
|
+
const BACKEND_GENERATED_FILES = Object.freeze(["brand.generated.ts", "paths.generated.ts", "labels.generated.ts", "billing.generated.ts"]);
|
|
13
14
|
function normalizeDir(dir) {
|
|
14
15
|
let end = dir.length;
|
|
15
16
|
while (end > 0 && dir[end - 1] === "/") end--;
|
|
@@ -20,7 +21,7 @@ function backendEslint(options = {}) {
|
|
|
20
21
|
return [
|
|
21
22
|
{
|
|
22
23
|
name: "nuxt-backend:generated",
|
|
23
|
-
ignores: [`${dir}/**/_generated
|
|
24
|
+
ignores: [`${dir}/**/_generated/**`, ...BACKEND_GENERATED_FILES.map((file) => `${dir}/${file}`)]
|
|
24
25
|
},
|
|
25
26
|
{
|
|
26
27
|
name: "nuxt-backend:convex",
|