@fantastic.dev/better-stripe 0.4.0 → 0.6.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.
Files changed (162) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/MIGRATION.md +135 -0
  3. package/README.md +23 -2
  4. package/dist/client/billing/checkout.d.ts.map +1 -1
  5. package/dist/client/billing/checkout.js +22 -8
  6. package/dist/client/billing/checkout.js.map +1 -1
  7. package/dist/client/billing/subscriptionRouting.d.ts +24 -0
  8. package/dist/client/billing/subscriptionRouting.d.ts.map +1 -0
  9. package/dist/client/billing/subscriptionRouting.js +19 -0
  10. package/dist/client/billing/subscriptionRouting.js.map +1 -0
  11. package/dist/client/billing/subscriptions.d.ts +6 -6
  12. package/dist/client/billing/subscriptions.d.ts.map +1 -1
  13. package/dist/client/billing/subscriptions.js +31 -12
  14. package/dist/client/billing/subscriptions.js.map +1 -1
  15. package/dist/client/connect/disputes.js.map +1 -1
  16. package/dist/client/constants.js +1 -1
  17. package/dist/client/core/accountLinks.d.ts +1 -0
  18. package/dist/client/core/accountLinks.d.ts.map +1 -1
  19. package/dist/client/core/accountLinks.js +0 -6
  20. package/dist/client/core/accountLinks.js.map +1 -1
  21. package/dist/client/core/accountStatus.d.ts.map +1 -1
  22. package/dist/client/core/accountStatus.js +23 -8
  23. package/dist/client/core/accountStatus.js.map +1 -1
  24. package/dist/client/index.d.ts +5 -2
  25. package/dist/client/index.d.ts.map +1 -1
  26. package/dist/client/index.js.map +1 -1
  27. package/dist/client/types/documents.d.ts +1 -0
  28. package/dist/client/types/documents.d.ts.map +1 -1
  29. package/dist/client/types/events.d.ts +2 -1
  30. package/dist/client/types/events.d.ts.map +1 -1
  31. package/dist/client/types/options.d.ts +7 -0
  32. package/dist/client/types/options.d.ts.map +1 -1
  33. package/dist/client/utils/stripeDashboardUrl.d.ts.map +1 -1
  34. package/dist/client/utils/webhookEndpoints.d.ts.map +1 -1
  35. package/dist/client/webhooks/handler.d.ts.map +1 -1
  36. package/dist/client/webhooks/handler.js +35 -1
  37. package/dist/client/webhooks/handler.js.map +1 -1
  38. package/dist/client/webhooks/hooks.d.ts +1 -1
  39. package/dist/client/webhooks/hooks.d.ts.map +1 -1
  40. package/dist/client/webhooks/hooks.js +5 -1
  41. package/dist/client/webhooks/hooks.js.map +1 -1
  42. package/dist/client/webhooks/processors.d.ts.map +1 -1
  43. package/dist/client/webhooks/processors.js +12 -2
  44. package/dist/client/webhooks/processors.js.map +1 -1
  45. package/dist/client/webhooks/v2.d.ts.map +1 -1
  46. package/dist/client/webhooks/v2.js +11 -3
  47. package/dist/client/webhooks/v2.js.map +1 -1
  48. package/dist/component/_generated/component.d.ts +8 -0
  49. package/dist/component/_generated/component.d.ts.map +1 -1
  50. package/dist/component/_generated/server.d.ts +7 -1
  51. package/dist/component/_generated/server.d.ts.map +1 -1
  52. package/dist/component/_generated/server.js +2 -1
  53. package/dist/component/_generated/server.js.map +1 -1
  54. package/dist/component/billing/mutations.d.ts +29 -28
  55. package/dist/component/billing/mutations.d.ts.map +1 -1
  56. package/dist/component/billing/mutations.js +1 -0
  57. package/dist/component/billing/mutations.js.map +1 -1
  58. package/dist/component/billing/queries.d.ts +138 -131
  59. package/dist/component/billing/queries.d.ts.map +1 -1
  60. package/dist/component/billing/schema.d.ts +67 -65
  61. package/dist/component/billing/schema.d.ts.map +1 -1
  62. package/dist/component/billing/validators.d.ts +94 -91
  63. package/dist/component/billing/validators.d.ts.map +1 -1
  64. package/dist/component/billing/validators.js +1 -0
  65. package/dist/component/billing/validators.js.map +1 -1
  66. package/dist/component/connect/mutations.d.ts +37 -37
  67. package/dist/component/connect/queries.d.ts +115 -115
  68. package/dist/component/connect/queries.d.ts.map +1 -1
  69. package/dist/component/connect/queries.js +34 -71
  70. package/dist/component/connect/queries.js.map +1 -1
  71. package/dist/component/connect/schema.d.ts +73 -73
  72. package/dist/component/connect/validators.d.ts +119 -119
  73. package/dist/component/connect/validators.d.ts.map +1 -1
  74. package/dist/component/convex.config.d.ts +1 -0
  75. package/dist/component/convex.config.d.ts.map +1 -1
  76. package/dist/component/convex.config.js +2 -1
  77. package/dist/component/convex.config.js.map +1 -1
  78. package/dist/component/core/mutations.d.ts +12 -12
  79. package/dist/component/core/queries.d.ts +34 -34
  80. package/dist/component/core/schema.d.ts +11 -11
  81. package/dist/component/core/validators.d.ts +14 -14
  82. package/dist/component/core/validators.d.ts.map +1 -1
  83. package/dist/component/lib/fees.d.ts +12 -12
  84. package/dist/component/lib/fees.d.ts.map +1 -1
  85. package/dist/component/lib/fees.js +1 -1
  86. package/dist/component/lib/reversals.js.map +1 -1
  87. package/dist/component/products/mutations.d.ts +7 -7
  88. package/dist/component/products/queries.d.ts +33 -33
  89. package/dist/component/products/schema.d.ts +15 -15
  90. package/dist/component/products/validators.d.ts +16 -16
  91. package/dist/component/products/validators.d.ts.map +1 -1
  92. package/dist/component/schema.d.ts +173 -171
  93. package/dist/component/schema.d.ts.map +1 -1
  94. package/dist/component/webhooks/mutations.d.ts +3 -3
  95. package/dist/component/webhooks/queries.d.ts +12 -12
  96. package/dist/component/webhooks/schema.d.ts +7 -7
  97. package/dist/component/webhooks/validators.d.ts +10 -10
  98. package/dist/component/webhooks/validators.d.ts.map +1 -1
  99. package/dist/react/components/AccountCreateCard.js.map +1 -1
  100. package/dist/react/components/BuyerBillingView.js +1 -1
  101. package/dist/react/components/CheckoutSessionProviderWithKey.d.ts +1 -1
  102. package/dist/react/components/DisputeDetail.js +1 -1
  103. package/dist/react/components/DisputesList.js +1 -1
  104. package/dist/react/components/EarningsSummary.js +1 -1
  105. package/dist/react/components/EmbeddedCheckout.d.ts.map +1 -1
  106. package/dist/react/components/EmbeddedCheckout.js +1 -1
  107. package/dist/react/components/EmbeddedCheckout.js.map +1 -1
  108. package/dist/react/components/PayoutSchedule.js +1 -1
  109. package/dist/react/components/SplitBreakdown.js +1 -1
  110. package/dist/react/components/StripeProvider.d.ts +1 -1
  111. package/dist/react/components/StripeProviderWithKey.d.ts +1 -1
  112. package/dist/react/hooks/useAccount.d.ts.map +1 -1
  113. package/dist/react/hooks/useAccountOnboarding.d.ts.map +1 -1
  114. package/dist/react/hooks/useCheckout.d.ts.map +1 -1
  115. package/dist/react/hooks/useDisputeWithCountdown.d.ts.map +1 -1
  116. package/dist/react/hooks/useDisputes.d.ts.map +1 -1
  117. package/dist/react/hooks/useEarnings.d.ts.map +1 -1
  118. package/dist/react/hooks/useInvoices.d.ts.map +1 -1
  119. package/dist/react/hooks/usePaymentMethodActions.js.map +1 -1
  120. package/dist/react/hooks/usePaymentMethods.d.ts.map +1 -1
  121. package/dist/react/hooks/usePrices.d.ts.map +1 -1
  122. package/dist/react/hooks/useProducts.d.ts.map +1 -1
  123. package/dist/react/hooks/useSplitBreakdown.d.ts.map +1 -1
  124. package/dist/react/hooks/useSubscription.d.ts.map +1 -1
  125. package/dist/react/hooks/useSubscriptions.d.ts.map +1 -1
  126. package/dist/react/lib/stripe-element-styles.d.ts.map +1 -1
  127. package/dist/react/lib/stripe-element-styles.js.map +1 -1
  128. package/package.json +25 -23
  129. package/src/client/billing/checkout.test.ts +62 -14
  130. package/src/client/billing/checkout.ts +26 -10
  131. package/src/client/billing/subscriptionRouting.ts +25 -0
  132. package/src/client/billing/subscriptions.test.ts +90 -28
  133. package/src/client/billing/subscriptions.ts +53 -18
  134. package/src/client/constants.ts +1 -1
  135. package/src/client/core/accountLinks.test.ts +20 -13
  136. package/src/client/core/accountLinks.ts +2 -10
  137. package/src/client/core/accountStatus.test.ts +67 -0
  138. package/src/client/core/accountStatus.ts +30 -13
  139. package/src/client/helpers.test.ts +2 -2
  140. package/src/client/index.ts +49 -44
  141. package/src/client/stripe-version.test.ts +47 -0
  142. package/src/client/types/documents.ts +1 -0
  143. package/src/client/types/events.ts +2 -1
  144. package/src/client/types/options.ts +7 -0
  145. package/src/client/webhooks/handler.ts +38 -1
  146. package/src/client/webhooks/hooks.ts +3 -0
  147. package/src/client/webhooks/processors.test.ts +201 -40
  148. package/src/client/webhooks/processors.ts +21 -17
  149. package/src/client/webhooks/retry.integration.test.ts +196 -0
  150. package/src/client/webhooks/v2.test.ts +36 -0
  151. package/src/client/webhooks/v2.ts +14 -4
  152. package/src/component/_generated/component.ts +15 -28
  153. package/src/component/_generated/server.ts +9 -2
  154. package/src/component/billing/mutations.ts +1 -0
  155. package/src/component/billing/validators.ts +1 -0
  156. package/src/component/config-queries.test.ts +8 -4
  157. package/src/component/connect/queries.ts +31 -66
  158. package/src/component/convex.config.ts +2 -1
  159. package/src/component/earnings-totals.test.ts +27 -1
  160. package/src/component/lib/fees.ts +1 -1
  161. package/src/react/components/EmbeddedCheckout.render.test.tsx +57 -0
  162. package/src/react/components/EmbeddedCheckout.tsx +1 -0
@@ -5,33 +5,33 @@ export declare const subscriptionsTable: import("convex/server").TableDefinition
5
5
  accountId?: string | undefined;
6
6
  applicationFeeAmount?: number | undefined;
7
7
  applicationFeePercent?: number | undefined;
8
+ cancelAtPeriodEnd: boolean;
9
+ canceledAt?: string | undefined;
8
10
  chargeType?: "destination" | "separate" | undefined;
9
11
  currency?: string | undefined;
12
+ currentPeriodEnd?: string | undefined;
13
+ currentPeriodStart?: string | undefined;
10
14
  destinationAccountId?: string | undefined;
11
15
  feeCollectedAmount?: number | undefined;
12
16
  feeRefundedAmount?: number | undefined;
17
+ isCollectionPaused?: boolean | undefined;
18
+ isTrialing: boolean;
13
19
  metadata?: any;
14
20
  orgId?: string | undefined;
15
21
  priceId?: string | undefined;
22
+ quantity?: number | undefined;
16
23
  splitRecipients?: {
17
- percent?: number | undefined;
18
24
  amount?: number | undefined;
19
25
  destinationAccountId: string;
20
- role: "store" | "affiliate" | "other";
26
+ percent?: number | undefined;
27
+ role: "affiliate" | "other" | "store";
21
28
  }[] | undefined;
22
- canceledAt?: string | undefined;
23
- currentPeriodEnd?: string | undefined;
24
- currentPeriodStart?: string | undefined;
25
- quantity?: number | undefined;
29
+ status: "active" | "canceled" | "incomplete" | "incomplete_expired" | "past_due" | "paused" | "trialing" | "unpaid";
30
+ stripeSubscriptionId: string;
26
31
  trialEnd?: string | undefined;
27
32
  trialStart?: string | undefined;
28
- status: "active" | "trialing" | "past_due" | "canceled" | "incomplete" | "incomplete_expired" | "unpaid" | "paused";
29
33
  userId: string;
30
- cancelAtPeriodEnd: boolean;
31
- isTrialing: boolean;
32
- stripeSubscriptionId: string;
33
34
  }, {
34
- metadata: import("convex/values").VAny<any, "optional", string>;
35
35
  destinationAccountId: import("convex/values").VString<string | undefined, "optional">;
36
36
  applicationFeeAmount: import("convex/values").VFloat64<number | undefined, "optional">;
37
37
  applicationFeePercent: import("convex/values").VFloat64<number | undefined, "optional">;
@@ -39,43 +39,45 @@ export declare const subscriptionsTable: import("convex/server").TableDefinition
39
39
  feeRefundedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
40
40
  chargeType: import("convex/values").VUnion<"destination" | "separate" | undefined, [import("convex/values").VLiteral<"destination", "required">, import("convex/values").VLiteral<"separate", "required">], "optional", never>;
41
41
  splitRecipients: import("convex/values").VArray<{
42
- percent?: number | undefined;
43
42
  amount?: number | undefined;
44
43
  destinationAccountId: string;
45
- role: "store" | "affiliate" | "other";
46
- }[] | undefined, import("convex/values").VObject<{
47
44
  percent?: number | undefined;
45
+ role: "affiliate" | "other" | "store";
46
+ }[] | undefined, import("convex/values").VObject<{
48
47
  amount?: number | undefined;
49
48
  destinationAccountId: string;
50
- role: "store" | "affiliate" | "other";
49
+ percent?: number | undefined;
50
+ role: "affiliate" | "other" | "store";
51
51
  }, {
52
52
  destinationAccountId: import("convex/values").VString<string, "required">;
53
- role: import("convex/values").VUnion<"store" | "affiliate" | "other", [import("convex/values").VLiteral<"store", "required">, import("convex/values").VLiteral<"affiliate", "required">, import("convex/values").VLiteral<"other", "required">], "required", never>;
53
+ role: import("convex/values").VUnion<"affiliate" | "other" | "store", [import("convex/values").VLiteral<"store", "required">, import("convex/values").VLiteral<"affiliate", "required">, import("convex/values").VLiteral<"other", "required">], "required", never>;
54
54
  amount: import("convex/values").VFloat64<number | undefined, "optional">;
55
55
  percent: import("convex/values").VFloat64<number | undefined, "optional">;
56
- }, "required", "destinationAccountId" | "percent" | "amount" | "role">, "optional">;
56
+ }, "required", "amount" | "destinationAccountId" | "percent" | "role">, "optional">;
57
57
  stripeSubscriptionId: import("convex/values").VString<string, "required">;
58
58
  accountId: import("convex/values").VString<string | undefined, "optional">;
59
59
  userId: import("convex/values").VString<string, "required">;
60
60
  orgId: import("convex/values").VString<string | undefined, "optional">;
61
- status: import("convex/values").VUnion<"active" | "trialing" | "past_due" | "canceled" | "incomplete" | "incomplete_expired" | "unpaid" | "paused", [import("convex/values").VLiteral<"active", "required">, import("convex/values").VLiteral<"trialing", "required">, import("convex/values").VLiteral<"past_due", "required">, import("convex/values").VLiteral<"canceled", "required">, import("convex/values").VLiteral<"incomplete", "required">, import("convex/values").VLiteral<"incomplete_expired", "required">, import("convex/values").VLiteral<"unpaid", "required">, import("convex/values").VLiteral<"paused", "required">], "required", never>;
61
+ status: import("convex/values").VUnion<"active" | "canceled" | "incomplete" | "incomplete_expired" | "past_due" | "paused" | "trialing" | "unpaid", [import("convex/values").VLiteral<"active", "required">, import("convex/values").VLiteral<"trialing", "required">, import("convex/values").VLiteral<"past_due", "required">, import("convex/values").VLiteral<"canceled", "required">, import("convex/values").VLiteral<"incomplete", "required">, import("convex/values").VLiteral<"incomplete_expired", "required">, import("convex/values").VLiteral<"unpaid", "required">, import("convex/values").VLiteral<"paused", "required">], "required", never>;
62
62
  priceId: import("convex/values").VString<string | undefined, "optional">;
63
63
  quantity: import("convex/values").VFloat64<number | undefined, "optional">;
64
64
  currentPeriodStart: import("convex/values").VString<string | undefined, "optional">;
65
65
  currentPeriodEnd: import("convex/values").VString<string | undefined, "optional">;
66
66
  cancelAtPeriodEnd: import("convex/values").VBoolean<boolean, "required">;
67
+ isCollectionPaused: import("convex/values").VBoolean<boolean | undefined, "optional">;
67
68
  canceledAt: import("convex/values").VString<string | undefined, "optional">;
68
69
  isTrialing: import("convex/values").VBoolean<boolean, "required">;
69
70
  trialStart: import("convex/values").VString<string | undefined, "optional">;
70
71
  trialEnd: import("convex/values").VString<string | undefined, "optional">;
71
72
  currency: import("convex/values").VString<string | undefined, "optional">;
72
- }, "required", "accountId" | "applicationFeeAmount" | "applicationFeePercent" | "chargeType" | "currency" | "destinationAccountId" | "feeCollectedAmount" | "feeRefundedAmount" | "metadata" | "orgId" | "priceId" | "splitRecipients" | "status" | "userId" | "cancelAtPeriodEnd" | "canceledAt" | "currentPeriodEnd" | "currentPeriodStart" | "isTrialing" | "quantity" | "stripeSubscriptionId" | "trialEnd" | "trialStart" | `metadata.${string}`>, {
73
- by_stripe_subscription_id: ["stripeSubscriptionId", "_creationTime"];
74
- by_user_id: ["userId", "_creationTime"];
75
- by_org_id: ["orgId", "_creationTime"];
76
- by_status: ["status", "_creationTime"];
73
+ metadata: import("convex/values").VAny<any, "optional", string>;
74
+ }, "required", "accountId" | "applicationFeeAmount" | "applicationFeePercent" | "cancelAtPeriodEnd" | "canceledAt" | "chargeType" | "currency" | "currentPeriodEnd" | "currentPeriodStart" | "destinationAccountId" | "feeCollectedAmount" | "feeRefundedAmount" | "isCollectionPaused" | "isTrialing" | "metadata" | "orgId" | "priceId" | "quantity" | "splitRecipients" | "status" | "stripeSubscriptionId" | "trialEnd" | "trialStart" | "userId" | `metadata.${string}`>, {
77
75
  by_account_id: ["accountId", "_creationTime"];
78
76
  by_account_status: ["accountId", "status", "_creationTime"];
77
+ by_org_id: ["orgId", "_creationTime"];
78
+ by_status: ["status", "_creationTime"];
79
+ by_stripe_subscription_id: ["stripeSubscriptionId", "_creationTime"];
80
+ by_user_id: ["userId", "_creationTime"];
79
81
  }, {}, {}>;
80
82
  /**
81
83
  * Checkout sessions (embedded + redirect modes).
@@ -91,21 +93,20 @@ export declare const checkoutSessionsTable: import("convex/server").TableDefinit
91
93
  feeCollectedAmount?: number | undefined;
92
94
  feeRefundedAmount?: number | undefined;
93
95
  metadata?: any;
96
+ mode: "payment" | "setup" | "subscription";
94
97
  orgId?: string | undefined;
95
98
  priceId?: string | undefined;
96
99
  splitRecipients?: {
97
- percent?: number | undefined;
98
100
  amount?: number | undefined;
99
101
  destinationAccountId: string;
100
- role: "store" | "affiliate" | "other";
102
+ percent?: number | undefined;
103
+ role: "affiliate" | "other" | "store";
101
104
  }[] | undefined;
102
- url?: string | undefined;
103
- mode: "payment" | "subscription" | "setup";
104
- status: "open" | "complete" | "expired";
105
+ status: "complete" | "expired" | "open";
105
106
  stripeSessionId: string;
107
+ url?: string | undefined;
106
108
  userId: string;
107
109
  }, {
108
- metadata: import("convex/values").VAny<any, "optional", string>;
109
110
  destinationAccountId: import("convex/values").VString<string | undefined, "optional">;
110
111
  applicationFeeAmount: import("convex/values").VFloat64<number | undefined, "optional">;
111
112
  applicationFeePercent: import("convex/values").VFloat64<number | undefined, "optional">;
@@ -113,35 +114,36 @@ export declare const checkoutSessionsTable: import("convex/server").TableDefinit
113
114
  feeRefundedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
114
115
  chargeType: import("convex/values").VUnion<"destination" | "separate" | undefined, [import("convex/values").VLiteral<"destination", "required">, import("convex/values").VLiteral<"separate", "required">], "optional", never>;
115
116
  splitRecipients: import("convex/values").VArray<{
116
- percent?: number | undefined;
117
117
  amount?: number | undefined;
118
118
  destinationAccountId: string;
119
- role: "store" | "affiliate" | "other";
120
- }[] | undefined, import("convex/values").VObject<{
121
119
  percent?: number | undefined;
120
+ role: "affiliate" | "other" | "store";
121
+ }[] | undefined, import("convex/values").VObject<{
122
122
  amount?: number | undefined;
123
123
  destinationAccountId: string;
124
- role: "store" | "affiliate" | "other";
124
+ percent?: number | undefined;
125
+ role: "affiliate" | "other" | "store";
125
126
  }, {
126
127
  destinationAccountId: import("convex/values").VString<string, "required">;
127
- role: import("convex/values").VUnion<"store" | "affiliate" | "other", [import("convex/values").VLiteral<"store", "required">, import("convex/values").VLiteral<"affiliate", "required">, import("convex/values").VLiteral<"other", "required">], "required", never>;
128
+ role: import("convex/values").VUnion<"affiliate" | "other" | "store", [import("convex/values").VLiteral<"store", "required">, import("convex/values").VLiteral<"affiliate", "required">, import("convex/values").VLiteral<"other", "required">], "required", never>;
128
129
  amount: import("convex/values").VFloat64<number | undefined, "optional">;
129
130
  percent: import("convex/values").VFloat64<number | undefined, "optional">;
130
- }, "required", "destinationAccountId" | "percent" | "amount" | "role">, "optional">;
131
+ }, "required", "amount" | "destinationAccountId" | "percent" | "role">, "optional">;
131
132
  stripeSessionId: import("convex/values").VString<string, "required">;
132
133
  userId: import("convex/values").VString<string, "required">;
133
134
  orgId: import("convex/values").VString<string | undefined, "optional">;
134
135
  accountId: import("convex/values").VString<string | undefined, "optional">;
135
- mode: import("convex/values").VUnion<"payment" | "subscription" | "setup", [import("convex/values").VLiteral<"payment", "required">, import("convex/values").VLiteral<"subscription", "required">, import("convex/values").VLiteral<"setup", "required">], "required", never>;
136
- status: import("convex/values").VUnion<"open" | "complete" | "expired", [import("convex/values").VLiteral<"open", "required">, import("convex/values").VLiteral<"complete", "required">, import("convex/values").VLiteral<"expired", "required">], "required", never>;
136
+ mode: import("convex/values").VUnion<"payment" | "setup" | "subscription", [import("convex/values").VLiteral<"payment", "required">, import("convex/values").VLiteral<"subscription", "required">, import("convex/values").VLiteral<"setup", "required">], "required", never>;
137
+ status: import("convex/values").VUnion<"complete" | "expired" | "open", [import("convex/values").VLiteral<"open", "required">, import("convex/values").VLiteral<"complete", "required">, import("convex/values").VLiteral<"expired", "required">], "required", never>;
137
138
  clientSecret: import("convex/values").VString<string | undefined, "optional">;
138
139
  url: import("convex/values").VString<string | undefined, "optional">;
139
140
  priceId: import("convex/values").VString<string | undefined, "optional">;
140
141
  currency: import("convex/values").VString<string | undefined, "optional">;
142
+ metadata: import("convex/values").VAny<any, "optional", string>;
141
143
  }, "required", "accountId" | "applicationFeeAmount" | "applicationFeePercent" | "chargeType" | "clientSecret" | "currency" | "destinationAccountId" | "feeCollectedAmount" | "feeRefundedAmount" | "metadata" | "mode" | "orgId" | "priceId" | "splitRecipients" | "status" | "stripeSessionId" | "url" | "userId" | `metadata.${string}`>, {
144
+ by_account_id: ["accountId", "_creationTime"];
142
145
  by_stripe_session_id: ["stripeSessionId", "_creationTime"];
143
146
  by_user_id: ["userId", "_creationTime"];
144
- by_account_id: ["accountId", "_creationTime"];
145
147
  by_user_status: ["userId", "status", "_creationTime"];
146
148
  }, {}, {}>;
147
149
  /**
@@ -149,35 +151,34 @@ export declare const checkoutSessionsTable: import("convex/server").TableDefinit
149
151
  */
150
152
  export declare const invoicesTable: import("convex/server").TableDefinition<import("convex/values").VObject<{
151
153
  accountId?: string | undefined;
154
+ amountDue: number;
155
+ amountPaid: number;
152
156
  applicationFeeAmount?: number | undefined;
153
157
  applicationFeePercent?: number | undefined;
158
+ attemptCount?: number | undefined;
154
159
  chargeType?: "destination" | "separate" | undefined;
160
+ currency: string;
155
161
  destinationAccountId?: string | undefined;
156
162
  feeCollectedAmount?: number | undefined;
157
163
  feeRefundedAmount?: number | undefined;
164
+ hostedInvoiceUrl?: string | undefined;
165
+ invoicePdf?: string | undefined;
158
166
  metadata?: any;
167
+ nextPaymentAttempt?: string | undefined;
159
168
  orgId?: string | undefined;
169
+ periodEnd?: string | undefined;
170
+ periodStart?: string | undefined;
160
171
  splitRecipients?: {
161
- percent?: number | undefined;
162
172
  amount?: number | undefined;
163
173
  destinationAccountId: string;
164
- role: "store" | "affiliate" | "other";
174
+ percent?: number | undefined;
175
+ role: "affiliate" | "other" | "store";
165
176
  }[] | undefined;
166
- attemptCount?: number | undefined;
167
- hostedInvoiceUrl?: string | undefined;
168
- invoicePdf?: string | undefined;
169
- nextPaymentAttempt?: string | undefined;
170
- periodEnd?: string | undefined;
171
- periodStart?: string | undefined;
177
+ status: "draft" | "open" | "paid" | "uncollectible" | "void";
178
+ stripeInvoiceId: string;
172
179
  subscriptionId?: string | undefined;
173
- currency: string;
174
- status: "open" | "draft" | "paid" | "uncollectible" | "void";
175
180
  userId: string;
176
- amountDue: number;
177
- amountPaid: number;
178
- stripeInvoiceId: string;
179
181
  }, {
180
- metadata: import("convex/values").VAny<any, "optional", string>;
181
182
  destinationAccountId: import("convex/values").VString<string | undefined, "optional">;
182
183
  applicationFeeAmount: import("convex/values").VFloat64<number | undefined, "optional">;
183
184
  applicationFeePercent: import("convex/values").VFloat64<number | undefined, "optional">;
@@ -185,27 +186,27 @@ export declare const invoicesTable: import("convex/server").TableDefinition<impo
185
186
  feeRefundedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
186
187
  chargeType: import("convex/values").VUnion<"destination" | "separate" | undefined, [import("convex/values").VLiteral<"destination", "required">, import("convex/values").VLiteral<"separate", "required">], "optional", never>;
187
188
  splitRecipients: import("convex/values").VArray<{
188
- percent?: number | undefined;
189
189
  amount?: number | undefined;
190
190
  destinationAccountId: string;
191
- role: "store" | "affiliate" | "other";
192
- }[] | undefined, import("convex/values").VObject<{
193
191
  percent?: number | undefined;
192
+ role: "affiliate" | "other" | "store";
193
+ }[] | undefined, import("convex/values").VObject<{
194
194
  amount?: number | undefined;
195
195
  destinationAccountId: string;
196
- role: "store" | "affiliate" | "other";
196
+ percent?: number | undefined;
197
+ role: "affiliate" | "other" | "store";
197
198
  }, {
198
199
  destinationAccountId: import("convex/values").VString<string, "required">;
199
- role: import("convex/values").VUnion<"store" | "affiliate" | "other", [import("convex/values").VLiteral<"store", "required">, import("convex/values").VLiteral<"affiliate", "required">, import("convex/values").VLiteral<"other", "required">], "required", never>;
200
+ role: import("convex/values").VUnion<"affiliate" | "other" | "store", [import("convex/values").VLiteral<"store", "required">, import("convex/values").VLiteral<"affiliate", "required">, import("convex/values").VLiteral<"other", "required">], "required", never>;
200
201
  amount: import("convex/values").VFloat64<number | undefined, "optional">;
201
202
  percent: import("convex/values").VFloat64<number | undefined, "optional">;
202
- }, "required", "destinationAccountId" | "percent" | "amount" | "role">, "optional">;
203
+ }, "required", "amount" | "destinationAccountId" | "percent" | "role">, "optional">;
203
204
  stripeInvoiceId: import("convex/values").VString<string, "required">;
204
205
  userId: import("convex/values").VString<string, "required">;
205
206
  orgId: import("convex/values").VString<string | undefined, "optional">;
206
207
  accountId: import("convex/values").VString<string | undefined, "optional">;
207
208
  subscriptionId: import("convex/values").VString<string | undefined, "optional">;
208
- status: import("convex/values").VUnion<"open" | "draft" | "paid" | "uncollectible" | "void", [import("convex/values").VLiteral<"draft", "required">, import("convex/values").VLiteral<"open", "required">, import("convex/values").VLiteral<"paid", "required">, import("convex/values").VLiteral<"uncollectible", "required">, import("convex/values").VLiteral<"void", "required">], "required", never>;
209
+ status: import("convex/values").VUnion<"draft" | "open" | "paid" | "uncollectible" | "void", [import("convex/values").VLiteral<"draft", "required">, import("convex/values").VLiteral<"open", "required">, import("convex/values").VLiteral<"paid", "required">, import("convex/values").VLiteral<"uncollectible", "required">, import("convex/values").VLiteral<"void", "required">], "required", never>;
209
210
  currency: import("convex/values").VString<string, "required">;
210
211
  amountDue: import("convex/values").VFloat64<number, "required">;
211
212
  amountPaid: import("convex/values").VFloat64<number, "required">;
@@ -215,14 +216,15 @@ export declare const invoicesTable: import("convex/server").TableDefinition<impo
215
216
  periodEnd: import("convex/values").VString<string | undefined, "optional">;
216
217
  nextPaymentAttempt: import("convex/values").VString<string | undefined, "optional">;
217
218
  attemptCount: import("convex/values").VFloat64<number | undefined, "optional">;
218
- }, "required", "accountId" | "applicationFeeAmount" | "applicationFeePercent" | "chargeType" | "currency" | "destinationAccountId" | "feeCollectedAmount" | "feeRefundedAmount" | "metadata" | "orgId" | "splitRecipients" | "status" | "userId" | "amountDue" | "amountPaid" | "attemptCount" | "hostedInvoiceUrl" | "invoicePdf" | "nextPaymentAttempt" | "periodEnd" | "periodStart" | "stripeInvoiceId" | "subscriptionId" | `metadata.${string}`>, {
219
- by_stripe_invoice_id: ["stripeInvoiceId", "_creationTime"];
220
- by_user_id: ["userId", "_creationTime"];
221
- by_subscription_id: ["subscriptionId", "_creationTime"];
219
+ metadata: import("convex/values").VAny<any, "optional", string>;
220
+ }, "required", "accountId" | "amountDue" | "amountPaid" | "applicationFeeAmount" | "applicationFeePercent" | "attemptCount" | "chargeType" | "currency" | "destinationAccountId" | "feeCollectedAmount" | "feeRefundedAmount" | "hostedInvoiceUrl" | "invoicePdf" | "metadata" | "nextPaymentAttempt" | "orgId" | "periodEnd" | "periodStart" | "splitRecipients" | "status" | "stripeInvoiceId" | "subscriptionId" | "userId" | `metadata.${string}`>, {
222
221
  by_account_id: ["accountId", "_creationTime"];
223
222
  by_account_status: ["accountId", "status", "_creationTime"];
224
- by_user_status: ["userId", "status", "_creationTime"];
225
- by_subscription_status: ["subscriptionId", "status", "_creationTime"];
226
223
  by_status: ["status", "_creationTime"];
224
+ by_stripe_invoice_id: ["stripeInvoiceId", "_creationTime"];
225
+ by_subscription_id: ["subscriptionId", "_creationTime"];
226
+ by_subscription_status: ["subscriptionId", "status", "_creationTime"];
227
+ by_user_id: ["userId", "_creationTime"];
228
+ by_user_status: ["userId", "status", "_creationTime"];
227
229
  }, {}, {}>;
228
230
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/component/billing/schema.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAMuB,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAIc,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAQO,CAAC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/component/billing/schema.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAMuB,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAIc,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAQO,CAAC"}