@fantastic.dev/better-stripe 0.4.0 → 0.5.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 +34 -0
- package/MIGRATION.md +135 -0
- package/README.md +23 -2
- package/dist/client/billing/checkout.d.ts.map +1 -1
- package/dist/client/billing/checkout.js +22 -8
- package/dist/client/billing/checkout.js.map +1 -1
- package/dist/client/billing/subscriptionRouting.d.ts +24 -0
- package/dist/client/billing/subscriptionRouting.d.ts.map +1 -0
- package/dist/client/billing/subscriptionRouting.js +19 -0
- package/dist/client/billing/subscriptionRouting.js.map +1 -0
- package/dist/client/billing/subscriptions.d.ts +6 -6
- package/dist/client/billing/subscriptions.d.ts.map +1 -1
- package/dist/client/billing/subscriptions.js +31 -12
- package/dist/client/billing/subscriptions.js.map +1 -1
- package/dist/client/connect/disputes.js.map +1 -1
- package/dist/client/constants.js +1 -1
- package/dist/client/core/accountLinks.d.ts +1 -0
- package/dist/client/core/accountLinks.d.ts.map +1 -1
- package/dist/client/core/accountLinks.js +0 -6
- package/dist/client/core/accountLinks.js.map +1 -1
- package/dist/client/core/accountStatus.d.ts.map +1 -1
- package/dist/client/core/accountStatus.js +23 -8
- package/dist/client/core/accountStatus.js.map +1 -1
- package/dist/client/index.d.ts +5 -2
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/types/documents.d.ts +1 -0
- package/dist/client/types/documents.d.ts.map +1 -1
- package/dist/client/types/events.d.ts +2 -1
- package/dist/client/types/events.d.ts.map +1 -1
- package/dist/client/types/options.d.ts +7 -0
- package/dist/client/types/options.d.ts.map +1 -1
- package/dist/client/utils/stripeDashboardUrl.d.ts.map +1 -1
- package/dist/client/utils/webhookEndpoints.d.ts.map +1 -1
- package/dist/client/webhooks/handler.d.ts.map +1 -1
- package/dist/client/webhooks/handler.js +35 -1
- package/dist/client/webhooks/handler.js.map +1 -1
- package/dist/client/webhooks/hooks.d.ts +1 -1
- package/dist/client/webhooks/hooks.d.ts.map +1 -1
- package/dist/client/webhooks/hooks.js +5 -1
- package/dist/client/webhooks/hooks.js.map +1 -1
- package/dist/client/webhooks/processors.d.ts.map +1 -1
- package/dist/client/webhooks/processors.js +12 -2
- package/dist/client/webhooks/processors.js.map +1 -1
- package/dist/client/webhooks/v2.d.ts.map +1 -1
- package/dist/client/webhooks/v2.js +11 -3
- package/dist/client/webhooks/v2.js.map +1 -1
- package/dist/component/_generated/component.d.ts +8 -0
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/_generated/server.d.ts +7 -1
- package/dist/component/_generated/server.d.ts.map +1 -1
- package/dist/component/_generated/server.js +2 -1
- package/dist/component/_generated/server.js.map +1 -1
- package/dist/component/billing/mutations.d.ts +29 -28
- package/dist/component/billing/mutations.d.ts.map +1 -1
- package/dist/component/billing/mutations.js +1 -0
- package/dist/component/billing/mutations.js.map +1 -1
- package/dist/component/billing/queries.d.ts +138 -131
- package/dist/component/billing/queries.d.ts.map +1 -1
- package/dist/component/billing/schema.d.ts +67 -65
- package/dist/component/billing/schema.d.ts.map +1 -1
- package/dist/component/billing/validators.d.ts +94 -91
- package/dist/component/billing/validators.d.ts.map +1 -1
- package/dist/component/billing/validators.js +1 -0
- package/dist/component/billing/validators.js.map +1 -1
- package/dist/component/connect/mutations.d.ts +37 -37
- package/dist/component/connect/queries.d.ts +115 -115
- package/dist/component/connect/queries.d.ts.map +1 -1
- package/dist/component/connect/queries.js +34 -71
- package/dist/component/connect/queries.js.map +1 -1
- package/dist/component/connect/schema.d.ts +73 -73
- package/dist/component/connect/validators.d.ts +119 -119
- package/dist/component/connect/validators.d.ts.map +1 -1
- package/dist/component/convex.config.d.ts +1 -0
- package/dist/component/convex.config.d.ts.map +1 -1
- package/dist/component/convex.config.js +2 -1
- package/dist/component/convex.config.js.map +1 -1
- package/dist/component/core/mutations.d.ts +12 -12
- package/dist/component/core/queries.d.ts +34 -34
- package/dist/component/core/schema.d.ts +11 -11
- package/dist/component/core/validators.d.ts +14 -14
- package/dist/component/core/validators.d.ts.map +1 -1
- package/dist/component/lib/fees.d.ts +12 -12
- package/dist/component/lib/fees.d.ts.map +1 -1
- package/dist/component/lib/fees.js +1 -1
- package/dist/component/lib/reversals.js.map +1 -1
- package/dist/component/products/mutations.d.ts +7 -7
- package/dist/component/products/queries.d.ts +33 -33
- package/dist/component/products/schema.d.ts +15 -15
- package/dist/component/products/validators.d.ts +16 -16
- package/dist/component/products/validators.d.ts.map +1 -1
- package/dist/component/schema.d.ts +173 -171
- package/dist/component/schema.d.ts.map +1 -1
- package/dist/component/webhooks/mutations.d.ts +3 -3
- package/dist/component/webhooks/queries.d.ts +12 -12
- package/dist/component/webhooks/schema.d.ts +7 -7
- package/dist/component/webhooks/validators.d.ts +10 -10
- package/dist/component/webhooks/validators.d.ts.map +1 -1
- package/dist/react/components/AccountCreateCard.js.map +1 -1
- package/dist/react/components/BuyerBillingView.js +1 -1
- package/dist/react/components/CheckoutSessionProviderWithKey.d.ts +1 -1
- package/dist/react/components/DisputeDetail.js +1 -1
- package/dist/react/components/DisputesList.js +1 -1
- package/dist/react/components/EarningsSummary.js +1 -1
- package/dist/react/components/EmbeddedCheckout.d.ts.map +1 -1
- package/dist/react/components/EmbeddedCheckout.js +1 -1
- package/dist/react/components/EmbeddedCheckout.js.map +1 -1
- package/dist/react/components/PayoutSchedule.js +1 -1
- package/dist/react/components/SplitBreakdown.js +1 -1
- package/dist/react/components/StripeProvider.d.ts +1 -1
- package/dist/react/components/StripeProviderWithKey.d.ts +1 -1
- package/dist/react/hooks/useAccount.d.ts.map +1 -1
- package/dist/react/hooks/useAccountOnboarding.d.ts.map +1 -1
- package/dist/react/hooks/useCheckout.d.ts.map +1 -1
- package/dist/react/hooks/useDisputeWithCountdown.d.ts.map +1 -1
- package/dist/react/hooks/useDisputes.d.ts.map +1 -1
- package/dist/react/hooks/useEarnings.d.ts.map +1 -1
- package/dist/react/hooks/useInvoices.d.ts.map +1 -1
- package/dist/react/hooks/usePaymentMethodActions.js.map +1 -1
- package/dist/react/hooks/usePaymentMethods.d.ts.map +1 -1
- package/dist/react/hooks/usePrices.d.ts.map +1 -1
- package/dist/react/hooks/useProducts.d.ts.map +1 -1
- package/dist/react/hooks/useSplitBreakdown.d.ts.map +1 -1
- package/dist/react/hooks/useSubscription.d.ts.map +1 -1
- package/dist/react/hooks/useSubscriptions.d.ts.map +1 -1
- package/dist/react/lib/stripe-element-styles.d.ts.map +1 -1
- package/dist/react/lib/stripe-element-styles.js.map +1 -1
- package/package.json +25 -23
- package/src/client/billing/checkout.test.ts +62 -14
- package/src/client/billing/checkout.ts +26 -10
- package/src/client/billing/subscriptionRouting.ts +25 -0
- package/src/client/billing/subscriptions.test.ts +90 -28
- package/src/client/billing/subscriptions.ts +53 -18
- package/src/client/constants.ts +1 -1
- package/src/client/core/accountLinks.test.ts +20 -13
- package/src/client/core/accountLinks.ts +2 -10
- package/src/client/core/accountStatus.test.ts +67 -0
- package/src/client/core/accountStatus.ts +30 -13
- package/src/client/helpers.test.ts +2 -2
- package/src/client/index.ts +49 -44
- package/src/client/stripe-version.test.ts +47 -0
- package/src/client/types/documents.ts +1 -0
- package/src/client/types/events.ts +2 -1
- package/src/client/types/options.ts +7 -0
- package/src/client/webhooks/handler.ts +38 -1
- package/src/client/webhooks/hooks.ts +3 -0
- package/src/client/webhooks/processors.test.ts +201 -40
- package/src/client/webhooks/processors.ts +21 -17
- package/src/client/webhooks/retry.integration.test.ts +196 -0
- package/src/client/webhooks/v2.test.ts +36 -0
- package/src/client/webhooks/v2.ts +14 -4
- package/src/component/_generated/component.ts +15 -28
- package/src/component/_generated/server.ts +9 -2
- package/src/component/billing/mutations.ts +1 -0
- package/src/component/billing/validators.ts +1 -0
- package/src/component/config-queries.test.ts +8 -4
- package/src/component/connect/queries.ts +31 -66
- package/src/component/convex.config.ts +2 -1
- package/src/component/earnings-totals.test.ts +27 -1
- package/src/component/lib/fees.ts +1 -1
- package/src/react/components/EmbeddedCheckout.render.test.tsx +57 -0
- package/src/react/components/EmbeddedCheckout.tsx +1 -0
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export declare const productsTable: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
5
5
|
accountId?: string | undefined;
|
|
6
|
-
metadata?: any;
|
|
7
|
-
description?: string | undefined;
|
|
8
6
|
active: boolean;
|
|
7
|
+
description?: string | undefined;
|
|
8
|
+
metadata?: any;
|
|
9
9
|
name: string;
|
|
10
10
|
stripeProductId: string;
|
|
11
11
|
}, {
|
|
@@ -15,26 +15,26 @@ export declare const productsTable: import("convex/server").TableDefinition<impo
|
|
|
15
15
|
description: import("convex/values").VString<string | undefined, "optional">;
|
|
16
16
|
active: import("convex/values").VBoolean<boolean, "required">;
|
|
17
17
|
metadata: import("convex/values").VAny<any, "optional", string>;
|
|
18
|
-
}, "required", "accountId" | "
|
|
19
|
-
by_stripe_product_id: ["stripeProductId", "_creationTime"];
|
|
20
|
-
by_account_id: ["accountId", "_creationTime"];
|
|
18
|
+
}, "required", "accountId" | "active" | "description" | "metadata" | "name" | "stripeProductId" | `metadata.${string}`>, {
|
|
21
19
|
by_account_active: ["accountId", "active", "_creationTime"];
|
|
20
|
+
by_account_id: ["accountId", "_creationTime"];
|
|
22
21
|
by_active: ["active", "_creationTime"];
|
|
22
|
+
by_stripe_product_id: ["stripeProductId", "_creationTime"];
|
|
23
23
|
}, {}, {}>;
|
|
24
24
|
/**
|
|
25
25
|
* Prices linked to products.
|
|
26
26
|
*/
|
|
27
27
|
export declare const pricesTable: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
active: boolean;
|
|
29
|
+
currency: string;
|
|
30
|
+
interval?: "day" | "month" | "week" | "year" | undefined;
|
|
30
31
|
intervalCount?: number | undefined;
|
|
32
|
+
metadata?: any;
|
|
31
33
|
nickname?: string | undefined;
|
|
32
|
-
type: "one_time" | "recurring";
|
|
33
|
-
currency: string;
|
|
34
|
-
active: boolean;
|
|
35
34
|
productId: string;
|
|
36
35
|
stripePriceId: string;
|
|
37
36
|
stripeProductId: string;
|
|
37
|
+
type: "one_time" | "recurring";
|
|
38
38
|
unitAmount: number;
|
|
39
39
|
}, {
|
|
40
40
|
stripePriceId: import("convex/values").VString<string, "required">;
|
|
@@ -45,14 +45,14 @@ export declare const pricesTable: import("convex/server").TableDefinition<import
|
|
|
45
45
|
currency: import("convex/values").VString<string, "required">;
|
|
46
46
|
active: import("convex/values").VBoolean<boolean, "required">;
|
|
47
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" | "
|
|
48
|
+
interval: import("convex/values").VUnion<"day" | "month" | "week" | "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
49
|
intervalCount: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
50
50
|
metadata: import("convex/values").VAny<any, "optional", string>;
|
|
51
|
-
}, "required", "
|
|
52
|
-
|
|
51
|
+
}, "required", "active" | "currency" | "interval" | "intervalCount" | "metadata" | "nickname" | "productId" | "stripePriceId" | "stripeProductId" | "type" | "unitAmount" | `metadata.${string}`>, {
|
|
52
|
+
by_active: ["active", "_creationTime"];
|
|
53
|
+
by_product_active: ["productId", "active", "_creationTime"];
|
|
53
54
|
by_product_id: ["productId", "_creationTime"];
|
|
55
|
+
by_stripe_price_id: ["stripePriceId", "_creationTime"];
|
|
54
56
|
by_stripe_product_id: ["stripeProductId", "_creationTime"];
|
|
55
|
-
by_product_active: ["productId", "active", "_creationTime"];
|
|
56
|
-
by_active: ["active", "_creationTime"];
|
|
57
57
|
}, {}, {}>;
|
|
58
58
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Infer } from "convex/values";
|
|
2
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
3
|
export type PriceType = Infer<typeof priceTypeValidator>;
|
|
4
|
-
export declare const priceIntervalValidator: import("convex/values").VUnion<"day" | "
|
|
4
|
+
export declare const priceIntervalValidator: import("convex/values").VUnion<"day" | "month" | "week" | "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
5
|
/**
|
|
6
6
|
* Field validators for the `products` table.
|
|
7
7
|
* Shared between the schema definition and the doc validator so the
|
|
@@ -17,14 +17,14 @@ export declare const productFields: {
|
|
|
17
17
|
};
|
|
18
18
|
/** Full `products` document, including system fields. */
|
|
19
19
|
export declare const productDocValidator: import("convex/values").VObject<{
|
|
20
|
+
_creationTime: number;
|
|
21
|
+
_id: import("convex/values").GenericId<"products">;
|
|
20
22
|
accountId?: string | undefined;
|
|
21
|
-
metadata?: any;
|
|
22
|
-
description?: string | undefined;
|
|
23
23
|
active: boolean;
|
|
24
|
+
description?: string | undefined;
|
|
25
|
+
metadata?: any;
|
|
24
26
|
name: string;
|
|
25
27
|
stripeProductId: string;
|
|
26
|
-
_id: import("convex/values").GenericId<"products">;
|
|
27
|
-
_creationTime: number;
|
|
28
28
|
}, {
|
|
29
29
|
stripeProductId: import("convex/values").VString<string, "required">;
|
|
30
30
|
accountId: import("convex/values").VString<string | undefined, "optional">;
|
|
@@ -34,7 +34,7 @@ export declare const productDocValidator: import("convex/values").VObject<{
|
|
|
34
34
|
metadata: import("convex/values").VAny<any, "optional", string>;
|
|
35
35
|
_id: import("convex/values").VId<import("convex/values").GenericId<"products">, "required">;
|
|
36
36
|
_creationTime: import("convex/values").VFloat64<number, "required">;
|
|
37
|
-
}, "required", "
|
|
37
|
+
}, "required", "_creationTime" | "_id" | "accountId" | "active" | "description" | "metadata" | "name" | "stripeProductId" | `metadata.${string}`>;
|
|
38
38
|
/**
|
|
39
39
|
* Field validators for the `prices` table.
|
|
40
40
|
* Shared between the schema definition and the doc validator so the
|
|
@@ -49,25 +49,25 @@ export declare const priceFields: {
|
|
|
49
49
|
currency: import("convex/values").VString<string, "required">;
|
|
50
50
|
active: import("convex/values").VBoolean<boolean, "required">;
|
|
51
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" | "
|
|
52
|
+
interval: import("convex/values").VUnion<"day" | "month" | "week" | "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
53
|
intervalCount: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
54
54
|
metadata: import("convex/values").VAny<any, "optional", string>;
|
|
55
55
|
};
|
|
56
56
|
/** Full `prices` document, including system fields. */
|
|
57
57
|
export declare const priceDocValidator: import("convex/values").VObject<{
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
_creationTime: number;
|
|
59
|
+
_id: import("convex/values").GenericId<"prices">;
|
|
60
|
+
active: boolean;
|
|
61
|
+
currency: string;
|
|
62
|
+
interval?: "day" | "month" | "week" | "year" | undefined;
|
|
60
63
|
intervalCount?: number | undefined;
|
|
64
|
+
metadata?: any;
|
|
61
65
|
nickname?: string | undefined;
|
|
62
|
-
type: "one_time" | "recurring";
|
|
63
|
-
currency: string;
|
|
64
|
-
active: boolean;
|
|
65
66
|
productId: string;
|
|
66
67
|
stripePriceId: string;
|
|
67
68
|
stripeProductId: string;
|
|
69
|
+
type: "one_time" | "recurring";
|
|
68
70
|
unitAmount: number;
|
|
69
|
-
_id: import("convex/values").GenericId<"prices">;
|
|
70
|
-
_creationTime: number;
|
|
71
71
|
}, {
|
|
72
72
|
stripePriceId: import("convex/values").VString<string, "required">;
|
|
73
73
|
productId: import("convex/values").VString<string, "required">;
|
|
@@ -77,10 +77,10 @@ export declare const priceDocValidator: import("convex/values").VObject<{
|
|
|
77
77
|
currency: import("convex/values").VString<string, "required">;
|
|
78
78
|
active: import("convex/values").VBoolean<boolean, "required">;
|
|
79
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" | "
|
|
80
|
+
interval: import("convex/values").VUnion<"day" | "month" | "week" | "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
81
|
intervalCount: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
82
82
|
metadata: import("convex/values").VAny<any, "optional", string>;
|
|
83
83
|
_id: import("convex/values").VId<import("convex/values").GenericId<"prices">, "required">;
|
|
84
84
|
_creationTime: import("convex/values").VFloat64<number, "required">;
|
|
85
|
-
}, "required", "
|
|
85
|
+
}, "required", "_creationTime" | "_id" | "active" | "currency" | "interval" | "intervalCount" | "metadata" | "nickname" | "productId" | "stripePriceId" | "stripeProductId" | "type" | "unitAmount" | `metadata.${string}`>;
|
|
86
86
|
//# sourceMappingURL=validators.d.ts.map
|
|
@@ -1 +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
|
|
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;IACxB,eAAe;IACf,SAAS;IACT,IAAI;IACJ,WAAW;IACX,MAAM;IACN,QAAQ;CACT,CAAC;AAEF,yDAAyD;AACzD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;iJAI9B,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,WAAW;IACtB,aAAa;IACb,SAAS;IACT,eAAe;IACf,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,MAAM;IACN,IAAI;IACJ,QAAQ;IACR,aAAa;IACb,QAAQ;CACT,CAAC;AAEF,uDAAuD;AACvD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;2NAI5B,CAAC"}
|