@fantastic.dev/better-stripe 0.4.0-bootstrap.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/CHANGELOG.md +318 -0
- package/README.md +1117 -0
- package/dist/client/billing/checkout.d.ts +75 -0
- package/dist/client/billing/checkout.d.ts.map +1 -0
- package/dist/client/billing/checkout.js +260 -0
- package/dist/client/billing/checkout.js.map +1 -0
- package/dist/client/billing/invoices.d.ts +37 -0
- package/dist/client/billing/invoices.d.ts.map +1 -0
- package/dist/client/billing/invoices.js +29 -0
- package/dist/client/billing/invoices.js.map +1 -0
- package/dist/client/billing/subscriptions.d.ts +179 -0
- package/dist/client/billing/subscriptions.d.ts.map +1 -0
- package/dist/client/billing/subscriptions.js +346 -0
- package/dist/client/billing/subscriptions.js.map +1 -0
- package/dist/client/connect/disputes.d.ts +112 -0
- package/dist/client/connect/disputes.d.ts.map +1 -0
- package/dist/client/connect/disputes.js +186 -0
- package/dist/client/connect/disputes.js.map +1 -0
- package/dist/client/connect/paymentMethodUtils.d.ts +17 -0
- package/dist/client/connect/paymentMethodUtils.d.ts.map +1 -0
- package/dist/client/connect/paymentMethodUtils.js +24 -0
- package/dist/client/connect/paymentMethodUtils.js.map +1 -0
- package/dist/client/connect/paymentMethods.d.ts +23 -0
- package/dist/client/connect/paymentMethods.d.ts.map +1 -0
- package/dist/client/connect/paymentMethods.js +27 -0
- package/dist/client/connect/paymentMethods.js.map +1 -0
- package/dist/client/connect/payouts.d.ts +47 -0
- package/dist/client/connect/payouts.d.ts.map +1 -0
- package/dist/client/connect/payouts.js +52 -0
- package/dist/client/connect/payouts.js.map +1 -0
- package/dist/client/connect/refundActor.d.ts +50 -0
- package/dist/client/connect/refundActor.d.ts.map +1 -0
- package/dist/client/connect/refundActor.js +17 -0
- package/dist/client/connect/refundActor.js.map +1 -0
- package/dist/client/connect/refunds.d.ts +75 -0
- package/dist/client/connect/refunds.d.ts.map +1 -0
- package/dist/client/connect/refunds.js +141 -0
- package/dist/client/connect/refunds.js.map +1 -0
- package/dist/client/connect/transfers.d.ts +189 -0
- package/dist/client/connect/transfers.d.ts.map +1 -0
- package/dist/client/connect/transfers.js +347 -0
- package/dist/client/connect/transfers.js.map +1 -0
- package/dist/client/constants.d.ts +15 -0
- package/dist/client/constants.d.ts.map +1 -0
- package/dist/client/constants.js +14 -0
- package/dist/client/constants.js.map +1 -0
- package/dist/client/core/accountLinks.d.ts +68 -0
- package/dist/client/core/accountLinks.d.ts.map +1 -0
- package/dist/client/core/accountLinks.js +131 -0
- package/dist/client/core/accountLinks.js.map +1 -0
- package/dist/client/core/accountStatus.d.ts +12 -0
- package/dist/client/core/accountStatus.d.ts.map +1 -0
- package/dist/client/core/accountStatus.js +56 -0
- package/dist/client/core/accountStatus.js.map +1 -0
- package/dist/client/core/accounts.d.ts +181 -0
- package/dist/client/core/accounts.d.ts.map +1 -0
- package/dist/client/core/accounts.js +359 -0
- package/dist/client/core/accounts.js.map +1 -0
- package/dist/client/core/config.d.ts +5 -0
- package/dist/client/core/config.d.ts.map +1 -0
- package/dist/client/core/config.js +11 -0
- package/dist/client/core/config.js.map +1 -0
- package/dist/client/core/descriptors.d.ts +24 -0
- package/dist/client/core/descriptors.d.ts.map +1 -0
- package/dist/client/core/descriptors.js +43 -0
- package/dist/client/core/descriptors.js.map +1 -0
- package/dist/client/core/fees.d.ts +83 -0
- package/dist/client/core/fees.d.ts.map +1 -0
- package/dist/client/core/fees.js +178 -0
- package/dist/client/core/fees.js.map +1 -0
- package/dist/client/errors.d.ts +20 -0
- package/dist/client/errors.d.ts.map +1 -0
- package/dist/client/errors.js +31 -0
- package/dist/client/errors.js.map +1 -0
- package/dist/client/helpers.d.ts +20 -0
- package/dist/client/helpers.d.ts.map +1 -0
- package/dist/client/helpers.js +46 -0
- package/dist/client/helpers.js.map +1 -0
- package/dist/client/index.d.ts +880 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +791 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/products/prices.d.ts +61 -0
- package/dist/client/products/prices.d.ts.map +1 -0
- package/dist/client/products/prices.js +92 -0
- package/dist/client/products/prices.js.map +1 -0
- package/dist/client/products/products.d.ts +65 -0
- package/dist/client/products/products.d.ts.map +1 -0
- package/dist/client/products/products.js +186 -0
- package/dist/client/products/products.js.map +1 -0
- package/dist/client/stripe-types.d.ts +44 -0
- package/dist/client/stripe-types.d.ts.map +1 -0
- package/dist/client/stripe-types.js +2 -0
- package/dist/client/stripe-types.js.map +1 -0
- package/dist/client/types/documents.d.ts +195 -0
- package/dist/client/types/documents.d.ts.map +1 -0
- package/dist/client/types/documents.js +2 -0
- package/dist/client/types/documents.js.map +1 -0
- package/dist/client/types/events.d.ts +43 -0
- package/dist/client/types/events.d.ts.map +1 -0
- package/dist/client/types/events.js +2 -0
- package/dist/client/types/events.js.map +1 -0
- package/dist/client/types/index.d.ts +5 -0
- package/dist/client/types/index.d.ts.map +1 -0
- package/dist/client/types/index.js +2 -0
- package/dist/client/types/index.js.map +1 -0
- package/dist/client/types/options.d.ts +79 -0
- package/dist/client/types/options.d.ts.map +1 -0
- package/dist/client/types/options.js +2 -0
- package/dist/client/types/options.js.map +1 -0
- package/dist/client/types/triggers.d.ts +101 -0
- package/dist/client/types/triggers.d.ts.map +1 -0
- package/dist/client/types/triggers.js +2 -0
- package/dist/client/types/triggers.js.map +1 -0
- package/dist/client/types.d.ts +2 -0
- package/dist/client/types.d.ts.map +1 -0
- package/dist/client/types.js +2 -0
- package/dist/client/types.js.map +1 -0
- package/dist/client/utils/data.d.ts +10 -0
- package/dist/client/utils/data.d.ts.map +1 -0
- package/dist/client/utils/data.js +13 -0
- package/dist/client/utils/data.js.map +1 -0
- package/dist/client/utils/owner.d.ts +22 -0
- package/dist/client/utils/owner.d.ts.map +1 -0
- package/dist/client/utils/owner.js +20 -0
- package/dist/client/utils/owner.js.map +1 -0
- package/dist/client/utils/stripeDashboardUrl.d.ts +12 -0
- package/dist/client/utils/stripeDashboardUrl.d.ts.map +1 -0
- package/dist/client/utils/stripeDashboardUrl.js +39 -0
- package/dist/client/utils/stripeDashboardUrl.js.map +1 -0
- package/dist/client/utils/webhookEndpoints.d.ts +83 -0
- package/dist/client/utils/webhookEndpoints.d.ts.map +1 -0
- package/dist/client/utils/webhookEndpoints.js +185 -0
- package/dist/client/utils/webhookEndpoints.js.map +1 -0
- package/dist/client/webhooks/handler.d.ts +4 -0
- package/dist/client/webhooks/handler.d.ts.map +1 -0
- package/dist/client/webhooks/handler.js +170 -0
- package/dist/client/webhooks/handler.js.map +1 -0
- package/dist/client/webhooks/helpers.d.ts +56 -0
- package/dist/client/webhooks/helpers.d.ts.map +1 -0
- package/dist/client/webhooks/helpers.js +229 -0
- package/dist/client/webhooks/helpers.js.map +1 -0
- package/dist/client/webhooks/hooks.d.ts +11 -0
- package/dist/client/webhooks/hooks.d.ts.map +1 -0
- package/dist/client/webhooks/hooks.js +134 -0
- package/dist/client/webhooks/hooks.js.map +1 -0
- package/dist/client/webhooks/index.d.ts +23 -0
- package/dist/client/webhooks/index.d.ts.map +1 -0
- package/dist/client/webhooks/index.js +35 -0
- package/dist/client/webhooks/index.js.map +1 -0
- package/dist/client/webhooks/processors.d.ts +4 -0
- package/dist/client/webhooks/processors.d.ts.map +1 -0
- package/dist/client/webhooks/processors.js +932 -0
- package/dist/client/webhooks/processors.js.map +1 -0
- package/dist/client/webhooks/v2.d.ts +11 -0
- package/dist/client/webhooks/v2.d.ts.map +1 -0
- package/dist/client/webhooks/v2.js +94 -0
- package/dist/client/webhooks/v2.js.map +1 -0
- package/dist/client/webhooks.d.ts +2 -0
- package/dist/client/webhooks.d.ts.map +1 -0
- package/dist/client/webhooks.js +4 -0
- package/dist/client/webhooks.js.map +1 -0
- package/dist/component/_generated/component.d.ts +1262 -0
- package/dist/component/_generated/component.d.ts.map +1 -0
- package/dist/component/_generated/component.js +11 -0
- package/dist/component/_generated/component.js.map +1 -0
- package/dist/component/_generated/dataModel.d.ts +46 -0
- package/dist/component/_generated/dataModel.d.ts.map +1 -0
- package/dist/component/_generated/dataModel.js +11 -0
- package/dist/component/_generated/dataModel.js.map +1 -0
- package/dist/component/_generated/server.d.ts +129 -0
- package/dist/component/_generated/server.d.ts.map +1 -0
- package/dist/component/_generated/server.js +79 -0
- package/dist/component/_generated/server.js.map +1 -0
- package/dist/component/billing/mutations.d.ts +86 -0
- package/dist/component/billing/mutations.d.ts.map +1 -0
- package/dist/component/billing/mutations.js +131 -0
- package/dist/component/billing/mutations.js.map +1 -0
- package/dist/component/billing/queries.d.ts +425 -0
- package/dist/component/billing/queries.d.ts.map +1 -0
- package/dist/component/billing/queries.js +304 -0
- package/dist/component/billing/queries.js.map +1 -0
- package/dist/component/billing/schema.d.ts +228 -0
- package/dist/component/billing/schema.d.ts.map +1 -0
- package/dist/component/billing/schema.js +33 -0
- package/dist/component/billing/schema.js.map +1 -0
- package/dist/component/billing/validators.d.ts +364 -0
- package/dist/component/billing/validators.d.ts.map +1 -0
- package/dist/component/billing/validators.js +98 -0
- package/dist/component/billing/validators.js.map +1 -0
- package/dist/component/connect/mutations.d.ts +182 -0
- package/dist/component/connect/mutations.d.ts.map +1 -0
- package/dist/component/connect/mutations.js +480 -0
- package/dist/component/connect/mutations.js.map +1 -0
- package/dist/component/connect/queries.d.ts +347 -0
- package/dist/component/connect/queries.d.ts.map +1 -0
- package/dist/component/connect/queries.js +449 -0
- package/dist/component/connect/queries.js.map +1 -0
- package/dist/component/connect/schema.d.ts +258 -0
- package/dist/component/connect/schema.d.ts.map +1 -0
- package/dist/component/connect/schema.js +70 -0
- package/dist/component/connect/schema.js.map +1 -0
- package/dist/component/connect/validators.d.ts +468 -0
- package/dist/component/connect/validators.d.ts.map +1 -0
- package/dist/component/connect/validators.js +250 -0
- package/dist/component/connect/validators.js.map +1 -0
- package/dist/component/convex.config.d.ts +5 -0
- package/dist/component/convex.config.d.ts.map +1 -0
- package/dist/component/convex.config.js +17 -0
- package/dist/component/convex.config.js.map +1 -0
- package/dist/component/core/mutations.d.ts +52 -0
- package/dist/component/core/mutations.d.ts.map +1 -0
- package/dist/component/core/mutations.js +153 -0
- package/dist/component/core/mutations.js.map +1 -0
- package/dist/component/core/queries.d.ts +95 -0
- package/dist/component/core/queries.d.ts.map +1 -0
- package/dist/component/core/queries.js +86 -0
- package/dist/component/core/queries.js.map +1 -0
- package/dist/component/core/schema.d.ts +41 -0
- package/dist/component/core/schema.d.ts.map +1 -0
- package/dist/component/core/schema.js +12 -0
- package/dist/component/core/schema.js.map +1 -0
- package/dist/component/core/validators.d.ts +65 -0
- package/dist/component/core/validators.d.ts.map +1 -0
- package/dist/component/core/validators.js +35 -0
- package/dist/component/core/validators.js.map +1 -0
- package/dist/component/lib/fees.d.ts +74 -0
- package/dist/component/lib/fees.d.ts.map +1 -0
- package/dist/component/lib/fees.js +51 -0
- package/dist/component/lib/fees.js.map +1 -0
- package/dist/component/lib/idempotency.d.ts +9 -0
- package/dist/component/lib/idempotency.d.ts.map +1 -0
- package/dist/component/lib/idempotency.js +18 -0
- package/dist/component/lib/idempotency.js.map +1 -0
- package/dist/component/lib/reversals.d.ts +48 -0
- package/dist/component/lib/reversals.d.ts.map +1 -0
- package/dist/component/lib/reversals.js +79 -0
- package/dist/component/lib/reversals.js.map +1 -0
- package/dist/component/lib/stripeFactory.d.ts +7 -0
- package/dist/component/lib/stripeFactory.d.ts.map +1 -0
- package/dist/component/lib/stripeFactory.js +28 -0
- package/dist/component/lib/stripeFactory.js.map +1 -0
- package/dist/component/products/mutations.d.ts +22 -0
- package/dist/component/products/mutations.d.ts.map +1 -0
- package/dist/component/products/mutations.js +63 -0
- package/dist/component/products/mutations.js.map +1 -0
- package/dist/component/products/queries.d.ts +109 -0
- package/dist/component/products/queries.d.ts.map +1 -0
- package/dist/component/products/queries.js +122 -0
- package/dist/component/products/queries.js.map +1 -0
- package/dist/component/products/schema.d.ts +58 -0
- package/dist/component/products/schema.d.ts.map +1 -0
- package/dist/component/products/schema.js +20 -0
- package/dist/component/products/schema.js.map +1 -0
- package/dist/component/products/validators.d.ts +86 -0
- package/dist/component/products/validators.d.ts.map +1 -0
- package/dist/component/products/validators.js +47 -0
- package/dist/component/products/validators.js.map +1 -0
- package/dist/component/schema.d.ts +555 -0
- package/dist/component/schema.d.ts.map +1 -0
- package/dist/component/schema.js +28 -0
- package/dist/component/schema.js.map +1 -0
- package/dist/component/webhooks/mutations.d.ts +30 -0
- package/dist/component/webhooks/mutations.d.ts.map +1 -0
- package/dist/component/webhooks/mutations.js +124 -0
- package/dist/component/webhooks/mutations.js.map +1 -0
- package/dist/component/webhooks/queries.d.ts +35 -0
- package/dist/component/webhooks/queries.d.ts.map +1 -0
- package/dist/component/webhooks/queries.js +41 -0
- package/dist/component/webhooks/queries.js.map +1 -0
- package/dist/component/webhooks/schema.d.ts +22 -0
- package/dist/component/webhooks/schema.d.ts.map +1 -0
- package/dist/component/webhooks/schema.js +9 -0
- package/dist/component/webhooks/schema.js.map +1 -0
- package/dist/component/webhooks/validators.d.ts +37 -0
- package/dist/component/webhooks/validators.d.ts.map +1 -0
- package/dist/component/webhooks/validators.js +22 -0
- package/dist/component/webhooks/validators.js.map +1 -0
- package/dist/react/components/AccountCloseButton.d.ts +42 -0
- package/dist/react/components/AccountCloseButton.d.ts.map +1 -0
- package/dist/react/components/AccountCloseButton.js +33 -0
- package/dist/react/components/AccountCloseButton.js.map +1 -0
- package/dist/react/components/AccountCloseCard.d.ts +31 -0
- package/dist/react/components/AccountCloseCard.d.ts.map +1 -0
- package/dist/react/components/AccountCloseCard.js +22 -0
- package/dist/react/components/AccountCloseCard.js.map +1 -0
- package/dist/react/components/AccountCreateButton.d.ts +37 -0
- package/dist/react/components/AccountCreateButton.d.ts.map +1 -0
- package/dist/react/components/AccountCreateButton.js +30 -0
- package/dist/react/components/AccountCreateButton.js.map +1 -0
- package/dist/react/components/AccountCreateCard.d.ts +48 -0
- package/dist/react/components/AccountCreateCard.d.ts.map +1 -0
- package/dist/react/components/AccountCreateCard.js +29 -0
- package/dist/react/components/AccountCreateCard.js.map +1 -0
- package/dist/react/components/AccountLoginButton.d.ts +31 -0
- package/dist/react/components/AccountLoginButton.d.ts.map +1 -0
- package/dist/react/components/AccountLoginButton.js +31 -0
- package/dist/react/components/AccountLoginButton.js.map +1 -0
- package/dist/react/components/AccountLoginCard.d.ts +33 -0
- package/dist/react/components/AccountLoginCard.d.ts.map +1 -0
- package/dist/react/components/AccountLoginCard.js +19 -0
- package/dist/react/components/AccountLoginCard.js.map +1 -0
- package/dist/react/components/AccountOnboardingButton.d.ts +37 -0
- package/dist/react/components/AccountOnboardingButton.d.ts.map +1 -0
- package/dist/react/components/AccountOnboardingButton.js +30 -0
- package/dist/react/components/AccountOnboardingButton.js.map +1 -0
- package/dist/react/components/AccountOnboardingCard.d.ts +56 -0
- package/dist/react/components/AccountOnboardingCard.d.ts.map +1 -0
- package/dist/react/components/AccountOnboardingCard.js +36 -0
- package/dist/react/components/AccountOnboardingCard.js.map +1 -0
- package/dist/react/components/AddCardForm.d.ts +18 -0
- package/dist/react/components/AddCardForm.d.ts.map +1 -0
- package/dist/react/components/AddCardForm.js +49 -0
- package/dist/react/components/AddCardForm.js.map +1 -0
- package/dist/react/components/BillingPortalLink.d.ts +23 -0
- package/dist/react/components/BillingPortalLink.d.ts.map +1 -0
- package/dist/react/components/BillingPortalLink.js +55 -0
- package/dist/react/components/BillingPortalLink.js.map +1 -0
- package/dist/react/components/BuyerBillingView.d.ts +80 -0
- package/dist/react/components/BuyerBillingView.d.ts.map +1 -0
- package/dist/react/components/BuyerBillingView.js +44 -0
- package/dist/react/components/BuyerBillingView.js.map +1 -0
- package/dist/react/components/CheckoutSessionProvider.d.ts +34 -0
- package/dist/react/components/CheckoutSessionProvider.d.ts.map +1 -0
- package/dist/react/components/CheckoutSessionProvider.js +38 -0
- package/dist/react/components/CheckoutSessionProvider.js.map +1 -0
- package/dist/react/components/CheckoutSessionProviderWithKey.d.ts +36 -0
- package/dist/react/components/CheckoutSessionProviderWithKey.d.ts.map +1 -0
- package/dist/react/components/CheckoutSessionProviderWithKey.js +36 -0
- package/dist/react/components/CheckoutSessionProviderWithKey.js.map +1 -0
- package/dist/react/components/CheckoutStatus.d.ts +25 -0
- package/dist/react/components/CheckoutStatus.d.ts.map +1 -0
- package/dist/react/components/CheckoutStatus.js +22 -0
- package/dist/react/components/CheckoutStatus.js.map +1 -0
- package/dist/react/components/ConnectProvider.d.ts +29 -0
- package/dist/react/components/ConnectProvider.d.ts.map +1 -0
- package/dist/react/components/ConnectProvider.js +25 -0
- package/dist/react/components/ConnectProvider.js.map +1 -0
- package/dist/react/components/ConnectRequirements.d.ts +55 -0
- package/dist/react/components/ConnectRequirements.d.ts.map +1 -0
- package/dist/react/components/ConnectRequirements.js +58 -0
- package/dist/react/components/ConnectRequirements.js.map +1 -0
- package/dist/react/components/ConnectStatusBadge.d.ts +26 -0
- package/dist/react/components/ConnectStatusBadge.d.ts.map +1 -0
- package/dist/react/components/ConnectStatusBadge.js +20 -0
- package/dist/react/components/ConnectStatusBadge.js.map +1 -0
- package/dist/react/components/DeletePaymentMethodDialog.d.ts +25 -0
- package/dist/react/components/DeletePaymentMethodDialog.d.ts.map +1 -0
- package/dist/react/components/DeletePaymentMethodDialog.js +16 -0
- package/dist/react/components/DeletePaymentMethodDialog.js.map +1 -0
- package/dist/react/components/DisputeDetail.d.ts +42 -0
- package/dist/react/components/DisputeDetail.d.ts.map +1 -0
- package/dist/react/components/DisputeDetail.js +34 -0
- package/dist/react/components/DisputeDetail.js.map +1 -0
- package/dist/react/components/DisputesList.d.ts +42 -0
- package/dist/react/components/DisputesList.d.ts.map +1 -0
- package/dist/react/components/DisputesList.js +47 -0
- package/dist/react/components/DisputesList.js.map +1 -0
- package/dist/react/components/EarningsSummary.d.ts +53 -0
- package/dist/react/components/EarningsSummary.d.ts.map +1 -0
- package/dist/react/components/EarningsSummary.js +37 -0
- package/dist/react/components/EarningsSummary.js.map +1 -0
- package/dist/react/components/EmbeddedCheckout.d.ts +18 -0
- package/dist/react/components/EmbeddedCheckout.d.ts.map +1 -0
- package/dist/react/components/EmbeddedCheckout.js +17 -0
- package/dist/react/components/EmbeddedCheckout.js.map +1 -0
- package/dist/react/components/EmbeddedDisputes.d.ts +21 -0
- package/dist/react/components/EmbeddedDisputes.d.ts.map +1 -0
- package/dist/react/components/EmbeddedDisputes.js +17 -0
- package/dist/react/components/EmbeddedDisputes.js.map +1 -0
- package/dist/react/components/EvidenceForm.d.ts +63 -0
- package/dist/react/components/EvidenceForm.d.ts.map +1 -0
- package/dist/react/components/EvidenceForm.js +79 -0
- package/dist/react/components/EvidenceForm.js.map +1 -0
- package/dist/react/components/IntervalSelector.d.ts +20 -0
- package/dist/react/components/IntervalSelector.d.ts.map +1 -0
- package/dist/react/components/IntervalSelector.js +15 -0
- package/dist/react/components/IntervalSelector.js.map +1 -0
- package/dist/react/components/PaymentMethodActions.d.ts +27 -0
- package/dist/react/components/PaymentMethodActions.d.ts.map +1 -0
- package/dist/react/components/PaymentMethodActions.js +23 -0
- package/dist/react/components/PaymentMethodActions.js.map +1 -0
- package/dist/react/components/PaymentMethodsList.d.ts +32 -0
- package/dist/react/components/PaymentMethodsList.d.ts.map +1 -0
- package/dist/react/components/PaymentMethodsList.js +18 -0
- package/dist/react/components/PaymentMethodsList.js.map +1 -0
- package/dist/react/components/PayoutSchedule.d.ts +55 -0
- package/dist/react/components/PayoutSchedule.d.ts.map +1 -0
- package/dist/react/components/PayoutSchedule.js +51 -0
- package/dist/react/components/PayoutSchedule.js.map +1 -0
- package/dist/react/components/PriceBadge.d.ts +19 -0
- package/dist/react/components/PriceBadge.d.ts.map +1 -0
- package/dist/react/components/PriceBadge.js +25 -0
- package/dist/react/components/PriceBadge.js.map +1 -0
- package/dist/react/components/PriceCard.d.ts +34 -0
- package/dist/react/components/PriceCard.d.ts.map +1 -0
- package/dist/react/components/PriceCard.js +20 -0
- package/dist/react/components/PriceCard.js.map +1 -0
- package/dist/react/components/PricePicker.d.ts +28 -0
- package/dist/react/components/PricePicker.d.ts.map +1 -0
- package/dist/react/components/PricePicker.js +32 -0
- package/dist/react/components/PricePicker.js.map +1 -0
- package/dist/react/components/SplitBreakdown.d.ts +45 -0
- package/dist/react/components/SplitBreakdown.d.ts.map +1 -0
- package/dist/react/components/SplitBreakdown.js +48 -0
- package/dist/react/components/SplitBreakdown.js.map +1 -0
- package/dist/react/components/StripeProvider.d.ts +30 -0
- package/dist/react/components/StripeProvider.d.ts.map +1 -0
- package/dist/react/components/StripeProvider.js +38 -0
- package/dist/react/components/StripeProvider.js.map +1 -0
- package/dist/react/components/StripeProviderWithKey.d.ts +33 -0
- package/dist/react/components/StripeProviderWithKey.d.ts.map +1 -0
- package/dist/react/components/StripeProviderWithKey.js +44 -0
- package/dist/react/components/StripeProviderWithKey.js.map +1 -0
- package/dist/react/components/SubscriptionActions.d.ts +31 -0
- package/dist/react/components/SubscriptionActions.d.ts.map +1 -0
- package/dist/react/components/SubscriptionActions.js +30 -0
- package/dist/react/components/SubscriptionActions.js.map +1 -0
- package/dist/react/components/SubscriptionCard.d.ts +41 -0
- package/dist/react/components/SubscriptionCard.d.ts.map +1 -0
- package/dist/react/components/SubscriptionCard.js +18 -0
- package/dist/react/components/SubscriptionCard.js.map +1 -0
- package/dist/react/components/SubscriptionLineItems.d.ts +23 -0
- package/dist/react/components/SubscriptionLineItems.d.ts.map +1 -0
- package/dist/react/components/SubscriptionLineItems.js +20 -0
- package/dist/react/components/SubscriptionLineItems.js.map +1 -0
- package/dist/react/components/TrialAlert.d.ts +19 -0
- package/dist/react/components/TrialAlert.d.ts.map +1 -0
- package/dist/react/components/TrialAlert.js +16 -0
- package/dist/react/components/TrialAlert.js.map +1 -0
- package/dist/react/hooks/useAccount.d.ts +14 -0
- package/dist/react/hooks/useAccount.d.ts.map +1 -0
- package/dist/react/hooks/useAccount.js +18 -0
- package/dist/react/hooks/useAccount.js.map +1 -0
- package/dist/react/hooks/useAccountOnboarding.d.ts +15 -0
- package/dist/react/hooks/useAccountOnboarding.d.ts.map +1 -0
- package/dist/react/hooks/useAccountOnboarding.js +19 -0
- package/dist/react/hooks/useAccountOnboarding.js.map +1 -0
- package/dist/react/hooks/useCheckout.d.ts +14 -0
- package/dist/react/hooks/useCheckout.d.ts.map +1 -0
- package/dist/react/hooks/useCheckout.js +18 -0
- package/dist/react/hooks/useCheckout.js.map +1 -0
- package/dist/react/hooks/useCheckoutSession.d.ts +62 -0
- package/dist/react/hooks/useCheckoutSession.d.ts.map +1 -0
- package/dist/react/hooks/useCheckoutSession.js +68 -0
- package/dist/react/hooks/useCheckoutSession.js.map +1 -0
- package/dist/react/hooks/useConfirmPayment.d.ts +38 -0
- package/dist/react/hooks/useConfirmPayment.d.ts.map +1 -0
- package/dist/react/hooks/useConfirmPayment.js +91 -0
- package/dist/react/hooks/useConfirmPayment.js.map +1 -0
- package/dist/react/hooks/useDisputeWithCountdown.d.ts +25 -0
- package/dist/react/hooks/useDisputeWithCountdown.d.ts.map +1 -0
- package/dist/react/hooks/useDisputeWithCountdown.js +19 -0
- package/dist/react/hooks/useDisputeWithCountdown.js.map +1 -0
- package/dist/react/hooks/useDisputes.d.ts +14 -0
- package/dist/react/hooks/useDisputes.d.ts.map +1 -0
- package/dist/react/hooks/useDisputes.js +15 -0
- package/dist/react/hooks/useDisputes.js.map +1 -0
- package/dist/react/hooks/useEarnings.d.ts +92 -0
- package/dist/react/hooks/useEarnings.d.ts.map +1 -0
- package/dist/react/hooks/useEarnings.js +35 -0
- package/dist/react/hooks/useEarnings.js.map +1 -0
- package/dist/react/hooks/useInvoices.d.ts +11 -0
- package/dist/react/hooks/useInvoices.d.ts.map +1 -0
- package/dist/react/hooks/useInvoices.js +11 -0
- package/dist/react/hooks/useInvoices.js.map +1 -0
- package/dist/react/hooks/usePaymentMethodActions.d.ts +74 -0
- package/dist/react/hooks/usePaymentMethodActions.d.ts.map +1 -0
- package/dist/react/hooks/usePaymentMethodActions.js +156 -0
- package/dist/react/hooks/usePaymentMethodActions.js.map +1 -0
- package/dist/react/hooks/usePaymentMethods.d.ts +23 -0
- package/dist/react/hooks/usePaymentMethods.d.ts.map +1 -0
- package/dist/react/hooks/usePaymentMethods.js +18 -0
- package/dist/react/hooks/usePaymentMethods.js.map +1 -0
- package/dist/react/hooks/usePrices.d.ts +12 -0
- package/dist/react/hooks/usePrices.d.ts.map +1 -0
- package/dist/react/hooks/usePrices.js +16 -0
- package/dist/react/hooks/usePrices.js.map +1 -0
- package/dist/react/hooks/useProducts.d.ts +10 -0
- package/dist/react/hooks/useProducts.d.ts.map +1 -0
- package/dist/react/hooks/useProducts.js +11 -0
- package/dist/react/hooks/useProducts.js.map +1 -0
- package/dist/react/hooks/useSplitBreakdown.d.ts +58 -0
- package/dist/react/hooks/useSplitBreakdown.d.ts.map +1 -0
- package/dist/react/hooks/useSplitBreakdown.js +59 -0
- package/dist/react/hooks/useSplitBreakdown.js.map +1 -0
- package/dist/react/hooks/useStripeConfig.d.ts +14 -0
- package/dist/react/hooks/useStripeConfig.d.ts.map +1 -0
- package/dist/react/hooks/useStripeConfig.js +21 -0
- package/dist/react/hooks/useStripeConfig.js.map +1 -0
- package/dist/react/hooks/useStripeMode.d.ts +3 -0
- package/dist/react/hooks/useStripeMode.d.ts.map +1 -0
- package/dist/react/hooks/useStripeMode.js +6 -0
- package/dist/react/hooks/useStripeMode.js.map +1 -0
- package/dist/react/hooks/useStripePublishableKey.d.ts +2 -0
- package/dist/react/hooks/useStripePublishableKey.d.ts.map +1 -0
- package/dist/react/hooks/useStripePublishableKey.js +6 -0
- package/dist/react/hooks/useStripePublishableKey.js.map +1 -0
- package/dist/react/hooks/useSubscription.d.ts +17 -0
- package/dist/react/hooks/useSubscription.d.ts.map +1 -0
- package/dist/react/hooks/useSubscription.js +30 -0
- package/dist/react/hooks/useSubscription.js.map +1 -0
- package/dist/react/hooks/useSubscriptions.d.ts +11 -0
- package/dist/react/hooks/useSubscriptions.d.ts.map +1 -0
- package/dist/react/hooks/useSubscriptions.js +13 -0
- package/dist/react/hooks/useSubscriptions.js.map +1 -0
- package/dist/react/index.d.ts +108 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +87 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/lib/connect-requirement-keys.d.ts +14 -0
- package/dist/react/lib/connect-requirement-keys.d.ts.map +1 -0
- package/dist/react/lib/connect-requirement-keys.js +57 -0
- package/dist/react/lib/connect-requirement-keys.js.map +1 -0
- package/dist/react/lib/price-helpers.d.ts +31 -0
- package/dist/react/lib/price-helpers.d.ts.map +1 -0
- package/dist/react/lib/price-helpers.js +46 -0
- package/dist/react/lib/price-helpers.js.map +1 -0
- package/dist/react/lib/stripe-element-styles.d.ts +91 -0
- package/dist/react/lib/stripe-element-styles.d.ts.map +1 -0
- package/dist/react/lib/stripe-element-styles.js +131 -0
- package/dist/react/lib/stripe-element-styles.js.map +1 -0
- package/dist/react/lib/subscription-helpers.d.ts +33 -0
- package/dist/react/lib/subscription-helpers.d.ts.map +1 -0
- package/dist/react/lib/subscription-helpers.js +47 -0
- package/dist/react/lib/subscription-helpers.js.map +1 -0
- package/dist/react/types.d.ts +20 -0
- package/dist/react/types.d.ts.map +1 -0
- package/dist/react/types.js +2 -0
- package/dist/react/types.js.map +1 -0
- package/dist/testing/assert-test-env.d.ts +6 -0
- package/dist/testing/assert-test-env.d.ts.map +1 -0
- package/dist/testing/assert-test-env.js +15 -0
- package/dist/testing/assert-test-env.js.map +1 -0
- package/dist/testing/fixtures.d.ts +38 -0
- package/dist/testing/fixtures.d.ts.map +1 -0
- package/dist/testing/fixtures.js +54 -0
- package/dist/testing/fixtures.js.map +1 -0
- package/dist/testing/index.d.ts +4 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +4 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/mock-webhooks.d.ts +19 -0
- package/dist/testing/mock-webhooks.d.ts.map +1 -0
- package/dist/testing/mock-webhooks.js +81 -0
- package/dist/testing/mock-webhooks.js.map +1 -0
- package/package.json +131 -0
- package/src/client/billing/checkout.test.ts +1234 -0
- package/src/client/billing/checkout.ts +416 -0
- package/src/client/billing/invoices.test.ts +237 -0
- package/src/client/billing/invoices.ts +93 -0
- package/src/client/billing/subscriptions.test.ts +987 -0
- package/src/client/billing/subscriptions.ts +604 -0
- package/src/client/component-api-types.test.ts +137 -0
- package/src/client/connect/disputes.test.ts +487 -0
- package/src/client/connect/disputes.ts +302 -0
- package/src/client/connect/paymentMethodUtils.test.ts +83 -0
- package/src/client/connect/paymentMethodUtils.ts +28 -0
- package/src/client/connect/paymentMethods.test.ts +66 -0
- package/src/client/connect/paymentMethods.ts +55 -0
- package/src/client/connect/payouts.test.ts +132 -0
- package/src/client/connect/payouts.ts +105 -0
- package/src/client/connect/refundActor.test.ts +121 -0
- package/src/client/connect/refundActor.ts +60 -0
- package/src/client/connect/refunds.test.ts +341 -0
- package/src/client/connect/refunds.ts +256 -0
- package/src/client/connect/transfers.test.ts +492 -0
- package/src/client/connect/transfers.ts +572 -0
- package/src/client/constants.ts +15 -0
- package/src/client/core/accountLinks.test.ts +378 -0
- package/src/client/core/accountLinks.ts +211 -0
- package/src/client/core/accountStatus.test.ts +102 -0
- package/src/client/core/accountStatus.ts +91 -0
- package/src/client/core/accounts.test.ts +1496 -0
- package/src/client/core/accounts.ts +667 -0
- package/src/client/core/config.test.ts +68 -0
- package/src/client/core/config.ts +27 -0
- package/src/client/core/descriptors.test.ts +68 -0
- package/src/client/core/descriptors.ts +46 -0
- package/src/client/core/fees.test.ts +377 -0
- package/src/client/core/fees.ts +268 -0
- package/src/client/errors.test.ts +66 -0
- package/src/client/errors.ts +70 -0
- package/src/client/helpers.test.ts +74 -0
- package/src/client/helpers.ts +94 -0
- package/src/client/index.test.ts +1848 -0
- package/src/client/index.ts +1872 -0
- package/src/client/products/prices.test.ts +345 -0
- package/src/client/products/prices.ts +194 -0
- package/src/client/products/products.test.ts +476 -0
- package/src/client/products/products.ts +335 -0
- package/src/client/setup.test.ts +47 -0
- package/src/client/stripe-types.ts +108 -0
- package/src/client/types/documents.ts +245 -0
- package/src/client/types/events.ts +72 -0
- package/src/client/types/index.ts +43 -0
- package/src/client/types/options.ts +103 -0
- package/src/client/types/triggers.ts +293 -0
- package/src/client/types.ts +35 -0
- package/src/client/utils/data.test.ts +59 -0
- package/src/client/utils/data.ts +22 -0
- package/src/client/utils/owner.test.ts +35 -0
- package/src/client/utils/owner.ts +27 -0
- package/src/client/utils/stripeDashboardUrl.test.ts +71 -0
- package/src/client/utils/stripeDashboardUrl.ts +71 -0
- package/src/client/utils/webhookEndpoints.test.ts +454 -0
- package/src/client/utils/webhookEndpoints.ts +271 -0
- package/src/client/webhook-handlers.test.ts +603 -0
- package/src/client/webhooks/handler.test.ts +604 -0
- package/src/client/webhooks/handler.ts +256 -0
- package/src/client/webhooks/helpers.test.ts +330 -0
- package/src/client/webhooks/helpers.ts +277 -0
- package/src/client/webhooks/hooks.test.ts +111 -0
- package/src/client/webhooks/hooks.ts +177 -0
- package/src/client/webhooks/index.ts +51 -0
- package/src/client/webhooks/processors.test.ts +2392 -0
- package/src/client/webhooks/processors.ts +1166 -0
- package/src/client/webhooks/v2.test.ts +396 -0
- package/src/client/webhooks/v2.ts +124 -0
- package/src/client/webhooks.test.ts +1689 -0
- package/src/client/webhooks.ts +3 -0
- package/src/component/_generated/api.ts +86 -0
- package/src/component/_generated/component.ts +1758 -0
- package/src/component/_generated/dataModel.ts +60 -0
- package/src/component/_generated/server.ts +164 -0
- package/src/component/billing/mutations.ts +155 -0
- package/src/component/billing/queries.ts +378 -0
- package/src/component/billing/schema.ts +40 -0
- package/src/component/billing/validators.ts +137 -0
- package/src/component/config-queries.test.ts +47 -0
- package/src/component/connect/mutations.ts +624 -0
- package/src/component/connect/queries.ts +537 -0
- package/src/component/connect/schema.ts +90 -0
- package/src/component/connect/validators.ts +333 -0
- package/src/component/connect.test.ts +721 -0
- package/src/component/convex.config.ts +17 -0
- package/src/component/core/mutations.ts +182 -0
- package/src/component/core/queries.ts +100 -0
- package/src/component/core/schema.ts +13 -0
- package/src/component/core/validators.ts +55 -0
- package/src/component/earnings-totals.test.ts +196 -0
- package/src/component/fee-routing.test.ts +124 -0
- package/src/component/lib/fees.ts +64 -0
- package/src/component/lib/idempotency.test.ts +37 -0
- package/src/component/lib/idempotency.ts +20 -0
- package/src/component/lib/reversals.ts +113 -0
- package/src/component/lib/stripeFactory.ts +30 -0
- package/src/component/products/mutations.ts +73 -0
- package/src/component/products/queries.ts +149 -0
- package/src/component/products/schema.ts +22 -0
- package/src/component/products/validators.ts +63 -0
- package/src/component/public.test.ts +1858 -0
- package/src/component/reversal-races.test.ts +920 -0
- package/src/component/schema.ts +45 -0
- package/src/component/subscription-scoping.test.ts +118 -0
- package/src/component/transfers.test.ts +402 -0
- package/src/component/triggers.test.ts +359 -0
- package/src/component/webhooks/mutations.ts +151 -0
- package/src/component/webhooks/queries.ts +44 -0
- package/src/component/webhooks/schema.ts +10 -0
- package/src/component/webhooks/validators.ts +30 -0
- package/src/react/components/AccountCloseButton.tsx +91 -0
- package/src/react/components/AccountCloseCard.tsx +84 -0
- package/src/react/components/AccountCreateButton.tsx +83 -0
- package/src/react/components/AccountCreateCard.tsx +123 -0
- package/src/react/components/AccountLoginButton.tsx +69 -0
- package/src/react/components/AccountLoginCard.tsx +99 -0
- package/src/react/components/AccountOnboardingButton.tsx +83 -0
- package/src/react/components/AccountOnboardingCard.test.ts +27 -0
- package/src/react/components/AccountOnboardingCard.tsx +152 -0
- package/src/react/components/AddCardForm.tsx +80 -0
- package/src/react/components/BillingPortalLink.tsx +93 -0
- package/src/react/components/BuyerBillingView.render.test.tsx +207 -0
- package/src/react/components/BuyerBillingView.tsx +193 -0
- package/src/react/components/CheckoutSessionProvider.tsx +70 -0
- package/src/react/components/CheckoutSessionProviderWithKey.tsx +99 -0
- package/src/react/components/CheckoutStatus.tsx +71 -0
- package/src/react/components/ConnectProvider.tsx +58 -0
- package/src/react/components/ConnectRequirements.tsx +159 -0
- package/src/react/components/ConnectStatusBadge.tsx +60 -0
- package/src/react/components/DeletePaymentMethodDialog.tsx +61 -0
- package/src/react/components/DisputeDetail.render.test.tsx +143 -0
- package/src/react/components/DisputeDetail.tsx +111 -0
- package/src/react/components/DisputesList.render.test.tsx +244 -0
- package/src/react/components/DisputesList.tsx +120 -0
- package/src/react/components/EarningsSummary.render.test.tsx +153 -0
- package/src/react/components/EarningsSummary.tsx +131 -0
- package/src/react/components/EmbeddedCheckout.test.ts +25 -0
- package/src/react/components/EmbeddedCheckout.tsx +54 -0
- package/src/react/components/EmbeddedDisputes.render.test.tsx +142 -0
- package/src/react/components/EmbeddedDisputes.tsx +38 -0
- package/src/react/components/EvidenceForm.render.test.tsx +215 -0
- package/src/react/components/EvidenceForm.tsx +176 -0
- package/src/react/components/IntervalSelector.tsx +58 -0
- package/src/react/components/PaymentMethodActions.tsx +68 -0
- package/src/react/components/PaymentMethodsList.tsx +81 -0
- package/src/react/components/PayoutSchedule.render.test.tsx +178 -0
- package/src/react/components/PayoutSchedule.tsx +148 -0
- package/src/react/components/PriceBadge.render.test.tsx +134 -0
- package/src/react/components/PriceBadge.tsx +49 -0
- package/src/react/components/PriceCard.render.test.tsx +135 -0
- package/src/react/components/PriceCard.tsx +83 -0
- package/src/react/components/PricePicker.tsx +95 -0
- package/src/react/components/SplitBreakdown.render.test.tsx +168 -0
- package/src/react/components/SplitBreakdown.tsx +121 -0
- package/src/react/components/StripeProvider.test.ts +45 -0
- package/src/react/components/StripeProvider.tsx +80 -0
- package/src/react/components/StripeProviderWithKey.tsx +95 -0
- package/src/react/components/SubscriptionActions.tsx +79 -0
- package/src/react/components/SubscriptionCard.tsx +92 -0
- package/src/react/components/SubscriptionLineItems.tsx +62 -0
- package/src/react/components/TrialAlert.render.test.tsx +132 -0
- package/src/react/components/TrialAlert.tsx +44 -0
- package/src/react/hooks/skipSentinel.test.ts +85 -0
- package/src/react/hooks/useAccount.ts +28 -0
- package/src/react/hooks/useAccountOnboarding.test.ts +75 -0
- package/src/react/hooks/useAccountOnboarding.ts +35 -0
- package/src/react/hooks/useCheckout.ts +33 -0
- package/src/react/hooks/useCheckoutSession.ts +110 -0
- package/src/react/hooks/useConfirmPayment.ts +117 -0
- package/src/react/hooks/useDisputeWithCountdown.test.ts +90 -0
- package/src/react/hooks/useDisputeWithCountdown.ts +48 -0
- package/src/react/hooks/useDisputes.test.ts +75 -0
- package/src/react/hooks/useDisputes.ts +28 -0
- package/src/react/hooks/useEarnings.test.ts +159 -0
- package/src/react/hooks/useEarnings.ts +132 -0
- package/src/react/hooks/useInvoices.test.ts +79 -0
- package/src/react/hooks/useInvoices.ts +25 -0
- package/src/react/hooks/usePaymentMethodActions.ts +206 -0
- package/src/react/hooks/usePaymentMethods.ts +44 -0
- package/src/react/hooks/usePrices.ts +26 -0
- package/src/react/hooks/useProducts.test.ts +75 -0
- package/src/react/hooks/useProducts.ts +24 -0
- package/src/react/hooks/useSplitBreakdown.test.ts +151 -0
- package/src/react/hooks/useSplitBreakdown.ts +118 -0
- package/src/react/hooks/useStripeConfig.ts +31 -0
- package/src/react/hooks/useStripeMode.test.ts +49 -0
- package/src/react/hooks/useStripeMode.ts +9 -0
- package/src/react/hooks/useStripePublishableKey.test.ts +35 -0
- package/src/react/hooks/useStripePublishableKey.ts +9 -0
- package/src/react/hooks/useSubscription.ts +52 -0
- package/src/react/hooks/useSubscriptions.ts +33 -0
- package/src/react/index.payment-element.test.ts +41 -0
- package/src/react/index.test.ts +167 -0
- package/src/react/index.ts +279 -0
- package/src/react/lib/connect-requirement-keys.test.ts +73 -0
- package/src/react/lib/connect-requirement-keys.ts +66 -0
- package/src/react/lib/price-helpers.test.ts +199 -0
- package/src/react/lib/price-helpers.ts +68 -0
- package/src/react/lib/stripe-element-styles.test.ts +94 -0
- package/src/react/lib/stripe-element-styles.ts +178 -0
- package/src/react/lib/subscription-helpers.test.ts +127 -0
- package/src/react/lib/subscription-helpers.ts +64 -0
- package/src/react/types.ts +32 -0
- package/src/test.ts +5 -0
- package/src/testing/assert-test-env.test.ts +33 -0
- package/src/testing/assert-test-env.ts +20 -0
- package/src/testing/fixtures.ts +95 -0
- package/src/testing/index.ts +13 -0
- package/src/testing/mock-webhooks.test.ts +97 -0
- package/src/testing/mock-webhooks.ts +101 -0
- package/src/vite-env.d.ts +4 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import Stripe from "stripe";
|
|
2
|
+
import { STRIPE_API_VERSION } from "../../client/constants.js";
|
|
3
|
+
/**
|
|
4
|
+
* Keyed cache for Stripe SDK instances.
|
|
5
|
+
* Safe for tests and mixed environments — different keys get different clients.
|
|
6
|
+
*
|
|
7
|
+
* NOTE: This cache is unbounded and persists for the process lifetime.
|
|
8
|
+
* In practice, a Convex component typically uses 1-2 keys (test + live).
|
|
9
|
+
* API key rotation requires a process restart to pick up new keys.
|
|
10
|
+
*/
|
|
11
|
+
const _clients = new Map();
|
|
12
|
+
/**
|
|
13
|
+
* Get or create a Stripe SDK instance for the given API key.
|
|
14
|
+
* Uses the component's pinned API version.
|
|
15
|
+
*/
|
|
16
|
+
export function getStripe(apiKey) {
|
|
17
|
+
const cacheKey = `${apiKey}:${STRIPE_API_VERSION}`;
|
|
18
|
+
let client = _clients.get(cacheKey);
|
|
19
|
+
if (!client) {
|
|
20
|
+
client = new Stripe(apiKey, {
|
|
21
|
+
apiVersion: STRIPE_API_VERSION,
|
|
22
|
+
typescript: true,
|
|
23
|
+
});
|
|
24
|
+
_clients.set(cacheKey, client);
|
|
25
|
+
}
|
|
26
|
+
return client;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=stripeFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stripeFactory.js","sourceRoot":"","sources":["../../../src/component/lib/stripeFactory.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D;;;;;;;GAOG;AACH,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAkB,CAAC;AAE3C;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,MAAc;IACtC,MAAM,QAAQ,GAAG,GAAG,MAAM,IAAI,kBAAkB,EAAE,CAAC;IACnD,IAAI,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACpC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE;YAC1B,UAAU,EAAE,kBAAkB;YAC9B,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;QACH,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const upsertProduct: import("convex/server").RegisteredMutation<"public", {
|
|
2
|
+
accountId?: string | undefined;
|
|
3
|
+
metadata?: any;
|
|
4
|
+
description?: string | undefined;
|
|
5
|
+
active: boolean;
|
|
6
|
+
name: string;
|
|
7
|
+
stripeProductId: string;
|
|
8
|
+
}, Promise<null>>;
|
|
9
|
+
export declare const upsertPrice: import("convex/server").RegisteredMutation<"public", {
|
|
10
|
+
metadata?: any;
|
|
11
|
+
interval?: "day" | "week" | "month" | "year" | undefined;
|
|
12
|
+
intervalCount?: number | undefined;
|
|
13
|
+
nickname?: string | undefined;
|
|
14
|
+
type: "one_time" | "recurring";
|
|
15
|
+
currency: string;
|
|
16
|
+
active: boolean;
|
|
17
|
+
productId: string;
|
|
18
|
+
stripePriceId: string;
|
|
19
|
+
stripeProductId: string;
|
|
20
|
+
unitAmount: number;
|
|
21
|
+
}, Promise<null>>;
|
|
22
|
+
//# sourceMappingURL=mutations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../../src/component/products/mutations.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,aAAa;;;;;;;iBA0BxB,CAAC;AAMH,eAAO,MAAM,WAAW;;;;;;;;;;;;iBA+BtB,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { v } from "convex/values";
|
|
2
|
+
import { mutation } from "../_generated/server";
|
|
3
|
+
import { priceIntervalValidator, priceTypeValidator } from "./validators";
|
|
4
|
+
// =============================================================================
|
|
5
|
+
// PRODUCT MUTATIONS
|
|
6
|
+
// =============================================================================
|
|
7
|
+
export const upsertProduct = mutation({
|
|
8
|
+
args: {
|
|
9
|
+
stripeProductId: v.string(),
|
|
10
|
+
accountId: v.optional(v.string()),
|
|
11
|
+
name: v.string(),
|
|
12
|
+
description: v.optional(v.string()),
|
|
13
|
+
active: v.boolean(),
|
|
14
|
+
metadata: v.optional(v.any()),
|
|
15
|
+
},
|
|
16
|
+
returns: v.null(),
|
|
17
|
+
handler: async (ctx, args) => {
|
|
18
|
+
const existing = await ctx.db
|
|
19
|
+
.query("products")
|
|
20
|
+
.withIndex("by_stripe_product_id", (q) => q.eq("stripeProductId", args.stripeProductId))
|
|
21
|
+
.first();
|
|
22
|
+
if (existing) {
|
|
23
|
+
await ctx.db.patch("products", existing._id, args);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
await ctx.db.insert("products", args);
|
|
27
|
+
}
|
|
28
|
+
return null;
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
// =============================================================================
|
|
32
|
+
// PRICE MUTATIONS
|
|
33
|
+
// =============================================================================
|
|
34
|
+
export const upsertPrice = mutation({
|
|
35
|
+
args: {
|
|
36
|
+
stripePriceId: v.string(),
|
|
37
|
+
productId: v.string(),
|
|
38
|
+
stripeProductId: v.string(),
|
|
39
|
+
nickname: v.optional(v.string()),
|
|
40
|
+
unitAmount: v.number(),
|
|
41
|
+
currency: v.string(),
|
|
42
|
+
active: v.boolean(),
|
|
43
|
+
type: priceTypeValidator,
|
|
44
|
+
interval: priceIntervalValidator,
|
|
45
|
+
intervalCount: v.optional(v.number()),
|
|
46
|
+
metadata: v.optional(v.any()),
|
|
47
|
+
},
|
|
48
|
+
returns: v.null(),
|
|
49
|
+
handler: async (ctx, args) => {
|
|
50
|
+
const existing = await ctx.db
|
|
51
|
+
.query("prices")
|
|
52
|
+
.withIndex("by_stripe_price_id", (q) => q.eq("stripePriceId", args.stripePriceId))
|
|
53
|
+
.first();
|
|
54
|
+
if (existing) {
|
|
55
|
+
await ctx.db.patch("prices", existing._id, args);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
await ctx.db.insert("prices", args);
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
//# sourceMappingURL=mutations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutations.js","sourceRoot":"","sources":["../../../src/component/products/mutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAElC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAE1E,gFAAgF;AAChF,oBAAoB;AACpB,gFAAgF;AAEhF,MAAM,CAAC,MAAM,aAAa,GAAG,QAAQ,CAAC;IACpC,IAAI,EAAE;QACJ,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE;QAC3B,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;QACjC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,WAAW,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;QACnC,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;QACnB,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;KAC9B;IACD,OAAO,EA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AC,CAAC,CAAC,GAAG,EAAE,CAAC;KAC9B;IACD,OAAO,EAAE,CAAC,CAAC,IAAI,EAAE;IACjB,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QAC3B,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,EAAE;aAC1B,KAAK,CAAC,QAAQ,CAAC;aACf,SAAS,CAAC,oBAAoB,EAAE,CAAC,CAAC,EAAE,EAAE,CACrC,CAAC,CAAC,EAAE,CAAC,eAAe,EAAE,IAAI,CAAC,aAAa,CAAC,CAC1C;aACA,KAAK,EAAE,CAAC;QAEX,IAAI,QAAQ,EAAE,CAAC;YACb,MAAM,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACnD,CAAC;aAAM,CAAC;YACN,MAAM,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACtC,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
export declare const getProduct: import("convex/server").RegisteredQuery<"public", {
|
|
2
|
+
productId: import("convex/values").GenericId<"products">;
|
|
3
|
+
}, Promise<{
|
|
4
|
+
_id: import("convex/values").GenericId<"products">;
|
|
5
|
+
_creationTime: number;
|
|
6
|
+
accountId?: string | undefined;
|
|
7
|
+
metadata?: any;
|
|
8
|
+
description?: string | undefined;
|
|
9
|
+
active: boolean;
|
|
10
|
+
name: string;
|
|
11
|
+
stripeProductId: string;
|
|
12
|
+
} | null>>;
|
|
13
|
+
export declare const getProductByStripeId: import("convex/server").RegisteredQuery<"public", {
|
|
14
|
+
stripeProductId: string;
|
|
15
|
+
}, Promise<{
|
|
16
|
+
_id: import("convex/values").GenericId<"products">;
|
|
17
|
+
_creationTime: number;
|
|
18
|
+
accountId?: string | undefined;
|
|
19
|
+
metadata?: any;
|
|
20
|
+
description?: string | undefined;
|
|
21
|
+
active: boolean;
|
|
22
|
+
name: string;
|
|
23
|
+
stripeProductId: string;
|
|
24
|
+
} | null>>;
|
|
25
|
+
export declare const listProducts: import("convex/server").RegisteredQuery<"public", {
|
|
26
|
+
accountId?: string | undefined;
|
|
27
|
+
active?: boolean | undefined;
|
|
28
|
+
limit?: number | undefined;
|
|
29
|
+
}, Promise<{
|
|
30
|
+
_id: import("convex/values").GenericId<"products">;
|
|
31
|
+
_creationTime: number;
|
|
32
|
+
accountId?: string | undefined;
|
|
33
|
+
metadata?: any;
|
|
34
|
+
description?: string | undefined;
|
|
35
|
+
active: boolean;
|
|
36
|
+
name: string;
|
|
37
|
+
stripeProductId: string;
|
|
38
|
+
}[]>>;
|
|
39
|
+
export declare const getPrice: import("convex/server").RegisteredQuery<"public", {
|
|
40
|
+
priceId: import("convex/values").GenericId<"prices">;
|
|
41
|
+
}, Promise<{
|
|
42
|
+
_id: import("convex/values").GenericId<"prices">;
|
|
43
|
+
_creationTime: number;
|
|
44
|
+
metadata?: any;
|
|
45
|
+
interval?: "day" | "week" | "month" | "year" | undefined;
|
|
46
|
+
intervalCount?: number | undefined;
|
|
47
|
+
nickname?: string | undefined;
|
|
48
|
+
type: "one_time" | "recurring";
|
|
49
|
+
currency: string;
|
|
50
|
+
active: boolean;
|
|
51
|
+
productId: string;
|
|
52
|
+
stripePriceId: string;
|
|
53
|
+
stripeProductId: string;
|
|
54
|
+
unitAmount: number;
|
|
55
|
+
} | null>>;
|
|
56
|
+
export declare const getPriceByStripeId: import("convex/server").RegisteredQuery<"public", {
|
|
57
|
+
stripePriceId: string;
|
|
58
|
+
}, Promise<{
|
|
59
|
+
_id: import("convex/values").GenericId<"prices">;
|
|
60
|
+
_creationTime: number;
|
|
61
|
+
metadata?: any;
|
|
62
|
+
interval?: "day" | "week" | "month" | "year" | undefined;
|
|
63
|
+
intervalCount?: number | undefined;
|
|
64
|
+
nickname?: string | undefined;
|
|
65
|
+
type: "one_time" | "recurring";
|
|
66
|
+
currency: string;
|
|
67
|
+
active: boolean;
|
|
68
|
+
productId: string;
|
|
69
|
+
stripePriceId: string;
|
|
70
|
+
stripeProductId: string;
|
|
71
|
+
unitAmount: number;
|
|
72
|
+
} | null>>;
|
|
73
|
+
export declare const listPrices: import("convex/server").RegisteredQuery<"public", {
|
|
74
|
+
active?: boolean | undefined;
|
|
75
|
+
limit?: number | undefined;
|
|
76
|
+
productId?: string | undefined;
|
|
77
|
+
}, Promise<{
|
|
78
|
+
_id: import("convex/values").GenericId<"prices">;
|
|
79
|
+
_creationTime: number;
|
|
80
|
+
metadata?: any;
|
|
81
|
+
interval?: "day" | "week" | "month" | "year" | undefined;
|
|
82
|
+
intervalCount?: number | undefined;
|
|
83
|
+
nickname?: string | undefined;
|
|
84
|
+
type: "one_time" | "recurring";
|
|
85
|
+
currency: string;
|
|
86
|
+
active: boolean;
|
|
87
|
+
productId: string;
|
|
88
|
+
stripePriceId: string;
|
|
89
|
+
stripeProductId: string;
|
|
90
|
+
unitAmount: number;
|
|
91
|
+
}[]>>;
|
|
92
|
+
export declare const listPricesByProduct: import("convex/server").RegisteredQuery<"public", {
|
|
93
|
+
stripeProductId: string;
|
|
94
|
+
}, Promise<{
|
|
95
|
+
_id: import("convex/values").GenericId<"prices">;
|
|
96
|
+
_creationTime: number;
|
|
97
|
+
metadata?: any;
|
|
98
|
+
interval?: "day" | "week" | "month" | "year" | undefined;
|
|
99
|
+
intervalCount?: number | undefined;
|
|
100
|
+
nickname?: string | undefined;
|
|
101
|
+
type: "one_time" | "recurring";
|
|
102
|
+
currency: string;
|
|
103
|
+
active: boolean;
|
|
104
|
+
productId: string;
|
|
105
|
+
stripePriceId: string;
|
|
106
|
+
stripeProductId: string;
|
|
107
|
+
unitAmount: number;
|
|
108
|
+
}[]>>;
|
|
109
|
+
//# sourceMappingURL=queries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../../src/component/products/queries.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,UAAU;;;;;;;;;;;UAMrB,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;UAW/B,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;KAsCvB,CAAC;AAMH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;UAMnB,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;UAW7B,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;KAsCrB,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;KAa9B,CAAC"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { v } from "convex/values";
|
|
2
|
+
import { query } from "../_generated/server";
|
|
3
|
+
import { priceDocValidator, productDocValidator } from "./validators";
|
|
4
|
+
// =============================================================================
|
|
5
|
+
// PRODUCT QUERIES
|
|
6
|
+
// =============================================================================
|
|
7
|
+
export const getProduct = query({
|
|
8
|
+
args: { productId: v.id("products") },
|
|
9
|
+
returns: v.union(productDocValidator, v.null()),
|
|
10
|
+
handler: async (ctx, args) => {
|
|
11
|
+
return await ctx.db.get("products", args.productId);
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
export const getProductByStripeId = query({
|
|
15
|
+
args: { stripeProductId: v.string() },
|
|
16
|
+
returns: v.union(productDocValidator, v.null()),
|
|
17
|
+
handler: async (ctx, args) => {
|
|
18
|
+
return await ctx.db
|
|
19
|
+
.query("products")
|
|
20
|
+
.withIndex("by_stripe_product_id", (q) => q.eq("stripeProductId", args.stripeProductId))
|
|
21
|
+
.first();
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
export const listProducts = query({
|
|
25
|
+
args: {
|
|
26
|
+
accountId: v.optional(v.string()),
|
|
27
|
+
active: v.optional(v.boolean()),
|
|
28
|
+
limit: v.optional(v.number()),
|
|
29
|
+
},
|
|
30
|
+
returns: v.array(productDocValidator),
|
|
31
|
+
handler: async (ctx, args) => {
|
|
32
|
+
const limit = args.limit ?? 50;
|
|
33
|
+
if (args.accountId !== undefined && args.active !== undefined) {
|
|
34
|
+
const { accountId, active } = args;
|
|
35
|
+
return await ctx.db
|
|
36
|
+
.query("products")
|
|
37
|
+
.withIndex("by_account_active", (q) => q.eq("accountId", accountId).eq("active", active))
|
|
38
|
+
.take(limit);
|
|
39
|
+
}
|
|
40
|
+
if (args.accountId !== undefined) {
|
|
41
|
+
const accountId = args.accountId;
|
|
42
|
+
return await ctx.db
|
|
43
|
+
.query("products")
|
|
44
|
+
.withIndex("by_account_id", (q) => q.eq("accountId", accountId))
|
|
45
|
+
.take(limit);
|
|
46
|
+
}
|
|
47
|
+
if (args.active !== undefined) {
|
|
48
|
+
const active = args.active;
|
|
49
|
+
return await ctx.db
|
|
50
|
+
.query("products")
|
|
51
|
+
.withIndex("by_active", (q) => q.eq("active", active))
|
|
52
|
+
.take(limit);
|
|
53
|
+
}
|
|
54
|
+
return await ctx.db.query("products").take(limit);
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
// =============================================================================
|
|
58
|
+
// PRICE QUERIES
|
|
59
|
+
// =============================================================================
|
|
60
|
+
export const getPrice = query({
|
|
61
|
+
args: { priceId: v.id("prices") },
|
|
62
|
+
returns: v.union(priceDocValidator, v.null()),
|
|
63
|
+
handler: async (ctx, args) => {
|
|
64
|
+
return await ctx.db.get("prices", args.priceId);
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
export const getPriceByStripeId = query({
|
|
68
|
+
args: { stripePriceId: v.string() },
|
|
69
|
+
returns: v.union(priceDocValidator, v.null()),
|
|
70
|
+
handler: async (ctx, args) => {
|
|
71
|
+
return await ctx.db
|
|
72
|
+
.query("prices")
|
|
73
|
+
.withIndex("by_stripe_price_id", (q) => q.eq("stripePriceId", args.stripePriceId))
|
|
74
|
+
.first();
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
export const listPrices = query({
|
|
78
|
+
args: {
|
|
79
|
+
productId: v.optional(v.string()),
|
|
80
|
+
active: v.optional(v.boolean()),
|
|
81
|
+
limit: v.optional(v.number()),
|
|
82
|
+
},
|
|
83
|
+
returns: v.array(priceDocValidator),
|
|
84
|
+
handler: async (ctx, args) => {
|
|
85
|
+
const limit = args.limit ?? 50;
|
|
86
|
+
if (args.productId !== undefined && args.active !== undefined) {
|
|
87
|
+
const { productId, active } = args;
|
|
88
|
+
return await ctx.db
|
|
89
|
+
.query("prices")
|
|
90
|
+
.withIndex("by_product_active", (q) => q.eq("productId", productId).eq("active", active))
|
|
91
|
+
.take(limit);
|
|
92
|
+
}
|
|
93
|
+
if (args.productId !== undefined) {
|
|
94
|
+
const productId = args.productId;
|
|
95
|
+
return await ctx.db
|
|
96
|
+
.query("prices")
|
|
97
|
+
.withIndex("by_product_id", (q) => q.eq("productId", productId))
|
|
98
|
+
.take(limit);
|
|
99
|
+
}
|
|
100
|
+
if (args.active !== undefined) {
|
|
101
|
+
const active = args.active;
|
|
102
|
+
return await ctx.db
|
|
103
|
+
.query("prices")
|
|
104
|
+
.withIndex("by_active", (q) => q.eq("active", active))
|
|
105
|
+
.take(limit);
|
|
106
|
+
}
|
|
107
|
+
return await ctx.db.query("prices").take(limit);
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
export const listPricesByProduct = query({
|
|
111
|
+
args: { stripeProductId: v.string() },
|
|
112
|
+
returns: v.array(priceDocValidator),
|
|
113
|
+
handler: async (ctx, args) => {
|
|
114
|
+
// A product typically has a small, bounded number of prices.
|
|
115
|
+
// eslint-disable-next-line @convex-dev/no-collect-in-query
|
|
116
|
+
return await ctx.db
|
|
117
|
+
.query("prices")
|
|
118
|
+
.withIndex("by_stripe_product_id", (q) => q.eq("stripeProductId", args.stripeProductId))
|
|
119
|
+
.collect();
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
//# sourceMappingURL=queries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
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
|
+
*/
|
|
4
|
+
export declare const productsTable: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
5
|
+
accountId?: string | undefined;
|
|
6
|
+
metadata?: any;
|
|
7
|
+
description?: string | undefined;
|
|
8
|
+
active: boolean;
|
|
9
|
+
name: string;
|
|
10
|
+
stripeProductId: string;
|
|
11
|
+
}, {
|
|
12
|
+
stripeProductId: import("convex/values").VString<string, "required">;
|
|
13
|
+
accountId: import("convex/values").VString<string | undefined, "optional">;
|
|
14
|
+
name: import("convex/values").VString<string, "required">;
|
|
15
|
+
description: import("convex/values").VString<string | undefined, "optional">;
|
|
16
|
+
active: import("convex/values").VBoolean<boolean, "required">;
|
|
17
|
+
metadata: import("convex/values").VAny<any, "optional", string>;
|
|
18
|
+
}, "required", "accountId" | "metadata" | "active" | "name" | "stripeProductId" | "description" | `metadata.${string}`>, {
|
|
19
|
+
by_stripe_product_id: ["stripeProductId", "_creationTime"];
|
|
20
|
+
by_account_id: ["accountId", "_creationTime"];
|
|
21
|
+
by_account_active: ["accountId", "active", "_creationTime"];
|
|
22
|
+
by_active: ["active", "_creationTime"];
|
|
23
|
+
}, {}, {}>;
|
|
24
|
+
/**
|
|
25
|
+
* Prices linked to products.
|
|
26
|
+
*/
|
|
27
|
+
export declare const pricesTable: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
28
|
+
metadata?: any;
|
|
29
|
+
interval?: "day" | "week" | "month" | "year" | undefined;
|
|
30
|
+
intervalCount?: number | undefined;
|
|
31
|
+
nickname?: string | undefined;
|
|
32
|
+
type: "one_time" | "recurring";
|
|
33
|
+
currency: string;
|
|
34
|
+
active: boolean;
|
|
35
|
+
productId: string;
|
|
36
|
+
stripePriceId: string;
|
|
37
|
+
stripeProductId: string;
|
|
38
|
+
unitAmount: number;
|
|
39
|
+
}, {
|
|
40
|
+
stripePriceId: import("convex/values").VString<string, "required">;
|
|
41
|
+
productId: import("convex/values").VString<string, "required">;
|
|
42
|
+
stripeProductId: import("convex/values").VString<string, "required">;
|
|
43
|
+
nickname: import("convex/values").VString<string | undefined, "optional">;
|
|
44
|
+
unitAmount: import("convex/values").VFloat64<number, "required">;
|
|
45
|
+
currency: import("convex/values").VString<string, "required">;
|
|
46
|
+
active: import("convex/values").VBoolean<boolean, "required">;
|
|
47
|
+
type: import("convex/values").VUnion<"one_time" | "recurring", [import("convex/values").VLiteral<"one_time", "required">, import("convex/values").VLiteral<"recurring", "required">], "required", never>;
|
|
48
|
+
interval: import("convex/values").VUnion<"day" | "week" | "month" | "year" | undefined, [import("convex/values").VLiteral<"day", "required">, import("convex/values").VLiteral<"week", "required">, import("convex/values").VLiteral<"month", "required">, import("convex/values").VLiteral<"year", "required">], "optional", never>;
|
|
49
|
+
intervalCount: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
50
|
+
metadata: import("convex/values").VAny<any, "optional", string>;
|
|
51
|
+
}, "required", "type" | "currency" | "metadata" | "active" | "interval" | "intervalCount" | "nickname" | "productId" | "stripePriceId" | "stripeProductId" | "unitAmount" | `metadata.${string}`>, {
|
|
52
|
+
by_stripe_price_id: ["stripePriceId", "_creationTime"];
|
|
53
|
+
by_product_id: ["productId", "_creationTime"];
|
|
54
|
+
by_stripe_product_id: ["stripeProductId", "_creationTime"];
|
|
55
|
+
by_product_active: ["productId", "active", "_creationTime"];
|
|
56
|
+
by_active: ["active", "_creationTime"];
|
|
57
|
+
}, {}, {}>;
|
|
58
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/component/products/schema.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;UAIO,CAAC;AAElC;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAKS,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { defineTable } from "convex/server";
|
|
2
|
+
import { priceFields, productFields } from "./validators";
|
|
3
|
+
/**
|
|
4
|
+
* Products synced from Stripe.
|
|
5
|
+
*/
|
|
6
|
+
export const productsTable = defineTable(productFields)
|
|
7
|
+
.index("by_stripe_product_id", ["stripeProductId"])
|
|
8
|
+
.index("by_account_id", ["accountId"])
|
|
9
|
+
.index("by_account_active", ["accountId", "active"])
|
|
10
|
+
.index("by_active", ["active"]);
|
|
11
|
+
/**
|
|
12
|
+
* Prices linked to products.
|
|
13
|
+
*/
|
|
14
|
+
export const pricesTable = defineTable(priceFields)
|
|
15
|
+
.index("by_stripe_price_id", ["stripePriceId"])
|
|
16
|
+
.index("by_product_id", ["productId"])
|
|
17
|
+
.index("by_stripe_product_id", ["stripeProductId"])
|
|
18
|
+
.index("by_product_active", ["productId", "active"])
|
|
19
|
+
.index("by_active", ["active"]);
|
|
20
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/component/products/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE1D;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC,aAAa,CAAC;KACpD,KAAK,CAAC,sBAAsB,EAAE,CAAC,iBAAiB,CAAC,CAAC;KAClD,KAAK,CAAC,eAAe,EAAE,CAAC,WAAW,CAAC,CAAC;KACrC,KAAK,CAAC,mBAAmB,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;KACnD,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC;KAChD,KAAK,CAAC,oBAAoB,EAAE,CAAC,eAAe,CAAC,CAAC;KAC9C,KAAK,CAAC,eAAe,EAAE,CAAC,WAAW,CAAC,CAAC;KACrC,KAAK,CAAC,sBAAsB,EAAE,CAAC,iBAAiB,CAAC,CAAC;KAClD,KAAK,CAAC,mBAAmB,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;KACnD,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { type Infer } from "convex/values";
|
|
2
|
+
export declare const priceTypeValidator: import("convex/values").VUnion<"one_time" | "recurring", [import("convex/values").VLiteral<"one_time", "required">, import("convex/values").VLiteral<"recurring", "required">], "required", never>;
|
|
3
|
+
export type PriceType = Infer<typeof priceTypeValidator>;
|
|
4
|
+
export declare const priceIntervalValidator: import("convex/values").VUnion<"day" | "week" | "month" | "year" | undefined, [import("convex/values").VLiteral<"day", "required">, import("convex/values").VLiteral<"week", "required">, import("convex/values").VLiteral<"month", "required">, import("convex/values").VLiteral<"year", "required">], "optional", never>;
|
|
5
|
+
/**
|
|
6
|
+
* Field validators for the `products` table.
|
|
7
|
+
* Shared between the schema definition and the doc validator so the
|
|
8
|
+
* two can never drift apart.
|
|
9
|
+
*/
|
|
10
|
+
export declare const productFields: {
|
|
11
|
+
stripeProductId: import("convex/values").VString<string, "required">;
|
|
12
|
+
accountId: import("convex/values").VString<string | undefined, "optional">;
|
|
13
|
+
name: import("convex/values").VString<string, "required">;
|
|
14
|
+
description: import("convex/values").VString<string | undefined, "optional">;
|
|
15
|
+
active: import("convex/values").VBoolean<boolean, "required">;
|
|
16
|
+
metadata: import("convex/values").VAny<any, "optional", string>;
|
|
17
|
+
};
|
|
18
|
+
/** Full `products` document, including system fields. */
|
|
19
|
+
export declare const productDocValidator: import("convex/values").VObject<{
|
|
20
|
+
accountId?: string | undefined;
|
|
21
|
+
metadata?: any;
|
|
22
|
+
description?: string | undefined;
|
|
23
|
+
active: boolean;
|
|
24
|
+
name: string;
|
|
25
|
+
stripeProductId: string;
|
|
26
|
+
_id: import("convex/values").GenericId<"products">;
|
|
27
|
+
_creationTime: number;
|
|
28
|
+
}, {
|
|
29
|
+
stripeProductId: import("convex/values").VString<string, "required">;
|
|
30
|
+
accountId: import("convex/values").VString<string | undefined, "optional">;
|
|
31
|
+
name: import("convex/values").VString<string, "required">;
|
|
32
|
+
description: import("convex/values").VString<string | undefined, "optional">;
|
|
33
|
+
active: import("convex/values").VBoolean<boolean, "required">;
|
|
34
|
+
metadata: import("convex/values").VAny<any, "optional", string>;
|
|
35
|
+
_id: import("convex/values").VId<import("convex/values").GenericId<"products">, "required">;
|
|
36
|
+
_creationTime: import("convex/values").VFloat64<number, "required">;
|
|
37
|
+
}, "required", "accountId" | "metadata" | "active" | "name" | "stripeProductId" | "description" | "_id" | "_creationTime" | `metadata.${string}`>;
|
|
38
|
+
/**
|
|
39
|
+
* Field validators for the `prices` table.
|
|
40
|
+
* Shared between the schema definition and the doc validator so the
|
|
41
|
+
* two can never drift apart.
|
|
42
|
+
*/
|
|
43
|
+
export declare const priceFields: {
|
|
44
|
+
stripePriceId: import("convex/values").VString<string, "required">;
|
|
45
|
+
productId: import("convex/values").VString<string, "required">;
|
|
46
|
+
stripeProductId: import("convex/values").VString<string, "required">;
|
|
47
|
+
nickname: import("convex/values").VString<string | undefined, "optional">;
|
|
48
|
+
unitAmount: import("convex/values").VFloat64<number, "required">;
|
|
49
|
+
currency: import("convex/values").VString<string, "required">;
|
|
50
|
+
active: import("convex/values").VBoolean<boolean, "required">;
|
|
51
|
+
type: import("convex/values").VUnion<"one_time" | "recurring", [import("convex/values").VLiteral<"one_time", "required">, import("convex/values").VLiteral<"recurring", "required">], "required", never>;
|
|
52
|
+
interval: import("convex/values").VUnion<"day" | "week" | "month" | "year" | undefined, [import("convex/values").VLiteral<"day", "required">, import("convex/values").VLiteral<"week", "required">, import("convex/values").VLiteral<"month", "required">, import("convex/values").VLiteral<"year", "required">], "optional", never>;
|
|
53
|
+
intervalCount: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
54
|
+
metadata: import("convex/values").VAny<any, "optional", string>;
|
|
55
|
+
};
|
|
56
|
+
/** Full `prices` document, including system fields. */
|
|
57
|
+
export declare const priceDocValidator: import("convex/values").VObject<{
|
|
58
|
+
metadata?: any;
|
|
59
|
+
interval?: "day" | "week" | "month" | "year" | undefined;
|
|
60
|
+
intervalCount?: number | undefined;
|
|
61
|
+
nickname?: string | undefined;
|
|
62
|
+
type: "one_time" | "recurring";
|
|
63
|
+
currency: string;
|
|
64
|
+
active: boolean;
|
|
65
|
+
productId: string;
|
|
66
|
+
stripePriceId: string;
|
|
67
|
+
stripeProductId: string;
|
|
68
|
+
unitAmount: number;
|
|
69
|
+
_id: import("convex/values").GenericId<"prices">;
|
|
70
|
+
_creationTime: number;
|
|
71
|
+
}, {
|
|
72
|
+
stripePriceId: import("convex/values").VString<string, "required">;
|
|
73
|
+
productId: import("convex/values").VString<string, "required">;
|
|
74
|
+
stripeProductId: import("convex/values").VString<string, "required">;
|
|
75
|
+
nickname: import("convex/values").VString<string | undefined, "optional">;
|
|
76
|
+
unitAmount: import("convex/values").VFloat64<number, "required">;
|
|
77
|
+
currency: import("convex/values").VString<string, "required">;
|
|
78
|
+
active: import("convex/values").VBoolean<boolean, "required">;
|
|
79
|
+
type: import("convex/values").VUnion<"one_time" | "recurring", [import("convex/values").VLiteral<"one_time", "required">, import("convex/values").VLiteral<"recurring", "required">], "required", never>;
|
|
80
|
+
interval: import("convex/values").VUnion<"day" | "week" | "month" | "year" | undefined, [import("convex/values").VLiteral<"day", "required">, import("convex/values").VLiteral<"week", "required">, import("convex/values").VLiteral<"month", "required">, import("convex/values").VLiteral<"year", "required">], "optional", never>;
|
|
81
|
+
intervalCount: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
82
|
+
metadata: import("convex/values").VAny<any, "optional", string>;
|
|
83
|
+
_id: import("convex/values").VId<import("convex/values").GenericId<"prices">, "required">;
|
|
84
|
+
_creationTime: import("convex/values").VFloat64<number, "required">;
|
|
85
|
+
}, "required", "type" | "currency" | "metadata" | "active" | "interval" | "intervalCount" | "nickname" | "productId" | "stripePriceId" | "stripeProductId" | "unitAmount" | "_id" | "_creationTime" | `metadata.${string}`>;
|
|
86
|
+
//# sourceMappingURL=validators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../../src/component/products/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAK,MAAM,eAAe,CAAC;AAE9C,eAAO,MAAM,kBAAkB,oMAG9B,CAAC;AACF,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEzD,eAAO,MAAM,sBAAsB,4TAOlC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa;;;;;;;CAOzB,CAAC;AAEF,yDAAyD;AACzD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;iJAI9B,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;CAYvB,CAAC;AAEF,uDAAuD;AACvD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;2NAI5B,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { v } from "convex/values";
|
|
2
|
+
export const priceTypeValidator = v.union(v.literal("one_time"), v.literal("recurring"));
|
|
3
|
+
export const priceIntervalValidator = v.optional(v.union(v.literal("day"), v.literal("week"), v.literal("month"), v.literal("year")));
|
|
4
|
+
/**
|
|
5
|
+
* Field validators for the `products` table.
|
|
6
|
+
* Shared between the schema definition and the doc validator so the
|
|
7
|
+
* two can never drift apart.
|
|
8
|
+
*/
|
|
9
|
+
export const productFields = {
|
|
10
|
+
stripeProductId: v.string(),
|
|
11
|
+
accountId: v.optional(v.string()),
|
|
12
|
+
name: v.string(),
|
|
13
|
+
description: v.optional(v.string()),
|
|
14
|
+
active: v.boolean(),
|
|
15
|
+
metadata: v.optional(v.any()),
|
|
16
|
+
};
|
|
17
|
+
/** Full `products` document, including system fields. */
|
|
18
|
+
export const productDocValidator = v.object({
|
|
19
|
+
_id: v.id("products"),
|
|
20
|
+
_creationTime: v.number(),
|
|
21
|
+
...productFields,
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* Field validators for the `prices` table.
|
|
25
|
+
* Shared between the schema definition and the doc validator so the
|
|
26
|
+
* two can never drift apart.
|
|
27
|
+
*/
|
|
28
|
+
export const priceFields = {
|
|
29
|
+
stripePriceId: v.string(),
|
|
30
|
+
productId: v.string(),
|
|
31
|
+
stripeProductId: v.string(),
|
|
32
|
+
nickname: v.optional(v.string()),
|
|
33
|
+
unitAmount: v.number(),
|
|
34
|
+
currency: v.string(),
|
|
35
|
+
active: v.boolean(),
|
|
36
|
+
type: priceTypeValidator,
|
|
37
|
+
interval: priceIntervalValidator,
|
|
38
|
+
intervalCount: v.optional(v.number()),
|
|
39
|
+
metadata: v.optional(v.any()),
|
|
40
|
+
};
|
|
41
|
+
/** Full `prices` document, including system fields. */
|
|
42
|
+
export const priceDocValidator = v.object({
|
|
43
|
+
_id: v.id("prices"),
|
|
44
|
+
_creationTime: v.number(),
|
|
45
|
+
...priceFields,
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=validators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../../../src/component/products/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,CAAC,EAAE,MAAM,eAAe,CAAC;AAE9C,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CACvC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,EACrB,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CACvB,CAAC;AAGF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,QAAQ,CAC9C,CAAC,CAAC,KAAK,CACL,CAAC,CAAC,OAAO,CA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