@fantastic.dev/better-stripe 0.70.0 → 0.72.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 (112) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +1 -1
  3. package/dist/client/connect/payoutAdoptionTestHelpers.d.ts +524 -50
  4. package/dist/client/connect/payoutAdoptionTestHelpers.d.ts.map +1 -1
  5. package/dist/client/connect/payoutExecutionTestHelpers.d.ts +246 -9
  6. package/dist/client/connect/payoutExecutionTestHelpers.d.ts.map +1 -1
  7. package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts +524 -50
  8. package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts.map +1 -1
  9. package/dist/client/connect/payoutSyncTestHelpers.d.ts +246 -9
  10. package/dist/client/connect/payoutSyncTestHelpers.d.ts.map +1 -1
  11. package/dist/client/paymentSource/resolver.d.ts +6 -1
  12. package/dist/client/paymentSource/resolver.d.ts.map +1 -1
  13. package/dist/client/paymentSource/resolver.js +49 -41
  14. package/dist/client/paymentSource/resolver.js.map +1 -1
  15. package/dist/client/processingCostReconciliation/provider.d.ts.map +1 -1
  16. package/dist/client/processingCostReconciliation/provider.js +14 -2
  17. package/dist/client/processingCostReconciliation/provider.js.map +1 -1
  18. package/dist/client/readContracts.d.ts +1 -0
  19. package/dist/client/readContracts.d.ts.map +1 -1
  20. package/dist/client/readContracts.js.map +1 -1
  21. package/dist/client/settlement/authorization.fixture.d.ts +26 -0
  22. package/dist/client/settlement/authorization.fixture.d.ts.map +1 -1
  23. package/dist/client/settlement/execution.d.ts +2 -0
  24. package/dist/client/settlement/execution.d.ts.map +1 -1
  25. package/dist/client/settlement/execution.js.map +1 -1
  26. package/dist/client/usage/index.d.ts +1 -0
  27. package/dist/client/usage/index.d.ts.map +1 -1
  28. package/dist/client/usage/invoiceSale.d.ts +8 -0
  29. package/dist/client/usage/invoiceSale.d.ts.map +1 -1
  30. package/dist/client/usage/invoiceSale.js +3 -0
  31. package/dist/client/usage/invoiceSale.js.map +1 -1
  32. package/dist/client/usage/mixedInvoice.fixtures.d.ts +315 -0
  33. package/dist/client/usage/mixedInvoice.fixtures.d.ts.map +1 -0
  34. package/dist/client/usage/mixedInvoice.fixtures.js +55 -0
  35. package/dist/client/usage/mixedInvoice.fixtures.js.map +1 -0
  36. package/dist/client/usage/mixedInvoiceSale.d.ts +6 -0
  37. package/dist/client/usage/mixedInvoiceSale.d.ts.map +1 -0
  38. package/dist/client/usage/mixedInvoiceSale.js +160 -0
  39. package/dist/client/usage/mixedInvoiceSale.js.map +1 -0
  40. package/dist/client/usage/observationClient.d.ts +2 -2
  41. package/dist/client/usage/observationClient.d.ts.map +1 -1
  42. package/dist/client/usage/retainedInvoiceSource.d.ts +20 -0
  43. package/dist/client/usage/retainedInvoiceSource.d.ts.map +1 -0
  44. package/dist/client/usage/retainedInvoiceSource.js +92 -0
  45. package/dist/client/usage/retainedInvoiceSource.js.map +1 -0
  46. package/dist/client/usage/settlement.d.ts +5 -0
  47. package/dist/client/usage/settlement.d.ts.map +1 -1
  48. package/dist/client/usage/settlement.js +28 -9
  49. package/dist/client/usage/settlement.js.map +1 -1
  50. package/dist/component/_generated/component.d.ts +66 -0
  51. package/dist/component/_generated/component.d.ts.map +1 -1
  52. package/dist/component/balanceFunding/internal/actions.d.ts +11 -11
  53. package/dist/component/balanceFunding/mutations.d.ts +16 -16
  54. package/dist/component/balanceFunding/preparationHandlers.d.ts +8 -8
  55. package/dist/component/balanceFunding/workflowValidators.d.ts +16 -16
  56. package/dist/component/earnings/triggers.d.ts +84 -6
  57. package/dist/component/earnings/triggers.d.ts.map +1 -1
  58. package/dist/component/processingCostReconciliation/rollback.d.ts +1 -1
  59. package/dist/component/products/queries.d.ts +1 -0
  60. package/dist/component/products/queries.d.ts.map +1 -1
  61. package/dist/component/products/queries.js +14 -8
  62. package/dist/component/products/queries.js.map +1 -1
  63. package/dist/component/recoveryWorkflow/helpers.d.ts +13 -0
  64. package/dist/component/recoveryWorkflow/helpers.d.ts.map +1 -1
  65. package/dist/component/recoveryWorkflow/mutations.d.ts +13 -0
  66. package/dist/component/recoveryWorkflow/mutations.d.ts.map +1 -1
  67. package/dist/component/recoveryWorkflow/queries.d.ts +26 -0
  68. package/dist/component/recoveryWorkflow/queries.d.ts.map +1 -1
  69. package/dist/component/recoveryWorkflow/schema.d.ts +464 -16
  70. package/dist/component/recoveryWorkflow/schema.d.ts.map +1 -1
  71. package/dist/component/schema.d.ts +246 -9
  72. package/dist/component/settlement/mutations.d.ts +26 -0
  73. package/dist/component/settlement/mutations.d.ts.map +1 -1
  74. package/dist/component/settlement/queries.d.ts +13 -0
  75. package/dist/component/settlement/queries.d.ts.map +1 -1
  76. package/dist/component/settlement/schema.d.ts +122 -3
  77. package/dist/component/settlement/schema.d.ts.map +1 -1
  78. package/dist/component/settlement/schema.js +2 -0
  79. package/dist/component/settlement/schema.js.map +1 -1
  80. package/dist/component/usage/allowance.fixtures.d.ts +262 -25
  81. package/dist/component/usage/allowance.fixtures.d.ts.map +1 -1
  82. package/dist/component/usageCredits/accounting.fixtures.d.ts +246 -9
  83. package/dist/component/usageCredits/accounting.fixtures.d.ts.map +1 -1
  84. package/dist/shared/usageInvoiceLines.d.ts +32 -0
  85. package/dist/shared/usageInvoiceLines.d.ts.map +1 -0
  86. package/dist/shared/usageInvoiceLines.js +13 -0
  87. package/dist/shared/usageInvoiceLines.js.map +1 -0
  88. package/docs/evidence/native-metering/mixed-settlement-2026-10-20.json +284 -0
  89. package/docs/metering-setup.md +3 -2
  90. package/docs/read-contracts.md +9 -2
  91. package/docs/usage-example.md +24 -5
  92. package/docs/usage-settlement.md +74 -8
  93. package/docs/usage-verification.md +22 -2
  94. package/package.json +1 -1
  95. package/src/client/paymentSource/resolver.ts +80 -59
  96. package/src/client/processingCostReconciliation/provider.ts +20 -2
  97. package/src/client/readContracts.ts +1 -0
  98. package/src/client/readPagination.test.ts +21 -0
  99. package/src/client/settlement/execution.ts +2 -0
  100. package/src/client/usage/index.ts +2 -0
  101. package/src/client/usage/invoiceSale.ts +10 -0
  102. package/src/client/usage/mixedInvoice.fixtures.ts +54 -0
  103. package/src/client/usage/mixedInvoiceSale.test.ts +92 -0
  104. package/src/client/usage/mixedInvoiceSale.ts +196 -0
  105. package/src/client/usage/mixedSettlement.test.ts +187 -0
  106. package/src/client/usage/retainedInvoiceSource.ts +118 -0
  107. package/src/client/usage/settlement.ts +47 -9
  108. package/src/component/_generated/component.ts +51 -0
  109. package/src/component/products/provider-price-pagination.test.ts +174 -0
  110. package/src/component/products/queries.ts +24 -10
  111. package/src/component/settlement/schema.ts +2 -0
  112. package/src/shared/usageInvoiceLines.ts +14 -0
@@ -1427,6 +1427,19 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
1427
1427
  }[];
1428
1428
  usageSource?: {
1429
1429
  customerAccount: string;
1430
+ invoiceLines?: {
1431
+ amount: number;
1432
+ kind: "fixed" | "metered";
1433
+ lineId: string;
1434
+ period: {
1435
+ end: number;
1436
+ start: number;
1437
+ };
1438
+ quantity: string;
1439
+ stripePriceId: string;
1440
+ stripeProductId: string;
1441
+ subscriptionItemId: string;
1442
+ }[] | undefined;
1430
1443
  invoicePaymentId: string;
1431
1444
  livemode: boolean;
1432
1445
  meterId: string;
@@ -1504,6 +1517,19 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
1504
1517
  }[];
1505
1518
  usageSource?: {
1506
1519
  customerAccount: string;
1520
+ invoiceLines?: {
1521
+ amount: number;
1522
+ kind: "fixed" | "metered";
1523
+ lineId: string;
1524
+ period: {
1525
+ end: number;
1526
+ start: number;
1527
+ };
1528
+ quantity: string;
1529
+ stripePriceId: string;
1530
+ stripeProductId: string;
1531
+ subscriptionItemId: string;
1532
+ }[] | undefined;
1507
1533
  invoicePaymentId: string;
1508
1534
  livemode: boolean;
1509
1535
  meterId: string;
@@ -1533,6 +1559,19 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
1533
1559
  sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
1534
1560
  usageSource: import("convex/values").VObject<{
1535
1561
  customerAccount: string;
1562
+ invoiceLines?: {
1563
+ amount: number;
1564
+ kind: "fixed" | "metered";
1565
+ lineId: string;
1566
+ period: {
1567
+ end: number;
1568
+ start: number;
1569
+ };
1570
+ quantity: string;
1571
+ stripePriceId: string;
1572
+ stripeProductId: string;
1573
+ subscriptionItemId: string;
1574
+ }[] | undefined;
1536
1575
  invoicePaymentId: string;
1537
1576
  livemode: boolean;
1538
1577
  meterId: string;
@@ -1547,6 +1586,46 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
1547
1586
  subscriptionId: string;
1548
1587
  subscriptionItemId: string;
1549
1588
  } | undefined, {
1589
+ invoiceLines: import("convex/values").VArray<{
1590
+ amount: number;
1591
+ kind: "fixed" | "metered";
1592
+ lineId: string;
1593
+ period: {
1594
+ end: number;
1595
+ start: number;
1596
+ };
1597
+ quantity: string;
1598
+ stripePriceId: string;
1599
+ stripeProductId: string;
1600
+ subscriptionItemId: string;
1601
+ }[] | undefined, import("convex/values").VObject<{
1602
+ amount: number;
1603
+ kind: "fixed" | "metered";
1604
+ lineId: string;
1605
+ period: {
1606
+ end: number;
1607
+ start: number;
1608
+ };
1609
+ quantity: string;
1610
+ stripePriceId: string;
1611
+ stripeProductId: string;
1612
+ subscriptionItemId: string;
1613
+ }, {
1614
+ lineId: import("convex/values").VString<string, "required">;
1615
+ stripePriceId: import("convex/values").VString<string, "required">;
1616
+ stripeProductId: import("convex/values").VString<string, "required">;
1617
+ subscriptionItemId: import("convex/values").VString<string, "required">;
1618
+ period: import("convex/values").VObject<{
1619
+ end: number;
1620
+ start: number;
1621
+ }, {
1622
+ start: import("convex/values").VFloat64<number, "required">;
1623
+ end: import("convex/values").VFloat64<number, "required">;
1624
+ }, "required", "end" | "start">;
1625
+ amount: import("convex/values").VFloat64<number, "required">;
1626
+ quantity: import("convex/values").VString<string, "required">;
1627
+ kind: import("convex/values").VUnion<"fixed" | "metered", [import("convex/values").VLiteral<"fixed", "required">, import("convex/values").VLiteral<"metered", "required">], "required", never>;
1628
+ }, "required", "amount" | "kind" | "lineId" | "period" | "period.end" | "period.start" | "quantity" | "stripePriceId" | "stripeProductId" | "subscriptionItemId">, "optional">;
1550
1629
  stripeAccountId: import("convex/values").VString<string, "required">;
1551
1630
  customerAccount: import("convex/values").VString<string, "required">;
1552
1631
  livemode: import("convex/values").VBoolean<boolean, "required">;
@@ -1564,7 +1643,7 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
1564
1643
  end: import("convex/values").VFloat64<number, "required">;
1565
1644
  }, "required", "end" | "start">;
1566
1645
  model: import("convex/values").VUnion<"included_overage" | "pay_as_you_go", [import("convex/values").VLiteral<"pay_as_you_go", "required">, import("convex/values").VLiteral<"included_overage", "required">], "required", never>;
1567
- }, "optional", "customerAccount" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
1646
+ }, "optional", "customerAccount" | "invoiceLines" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
1568
1647
  creditSource: import("convex/values").VObject<{
1569
1648
  creditGrantId: string;
1570
1649
  customerAccount: string;
@@ -1601,7 +1680,7 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
1601
1680
  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>;
1602
1681
  amount: import("convex/values").VFloat64<number, "required">;
1603
1682
  }, "required", "amount" | "destinationAccountId" | "role">, "required">;
1604
- }, "optional", "adjustmentAmount" | "creditSource" | "creditSource.creditGrantId" | "creditSource.customerAccount" | "creditSource.livemode" | "creditSource.purchaseId" | "creditSource.stripeAccountId" | "creditSource.stripePriceId" | "creditSource.stripeProductId" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "policyContext" | "policyContext.fields" | "policyContext.namespace" | "policyContext.version" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers" | "usageSource" | "usageSource.customerAccount" | "usageSource.invoicePaymentId" | "usageSource.livemode" | "usageSource.meterId" | "usageSource.model" | "usageSource.period" | "usageSource.period.end" | "usageSource.period.start" | "usageSource.stripeAccountId" | "usageSource.stripePriceId" | "usageSource.stripeProductId" | "usageSource.subscriptionId" | "usageSource.subscriptionItemId" | `policyContext.fields.${string}`>;
1683
+ }, "optional", "adjustmentAmount" | "creditSource" | "creditSource.creditGrantId" | "creditSource.customerAccount" | "creditSource.livemode" | "creditSource.purchaseId" | "creditSource.stripeAccountId" | "creditSource.stripePriceId" | "creditSource.stripeProductId" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "policyContext" | "policyContext.fields" | "policyContext.namespace" | "policyContext.version" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers" | "usageSource" | "usageSource.customerAccount" | "usageSource.invoiceLines" | "usageSource.invoicePaymentId" | "usageSource.livemode" | "usageSource.meterId" | "usageSource.model" | "usageSource.period" | "usageSource.period.end" | "usageSource.period.start" | "usageSource.stripeAccountId" | "usageSource.stripePriceId" | "usageSource.stripeProductId" | "usageSource.subscriptionId" | "usageSource.subscriptionItemId" | `policyContext.fields.${string}`>;
1605
1684
  version: import("convex/values").VFloat64<number, "required">;
1606
1685
  sourceKind: import("convex/values").VUnion<"invoice" | "settlement", [import("convex/values").VLiteral<"settlement", "required">, import("convex/values").VLiteral<"invoice", "required">], "required", never>;
1607
1686
  sourceId: import("convex/values").VString<string, "required">;
@@ -1612,7 +1691,7 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
1612
1691
  activePhase: import("convex/values").VUnion<"execute" | "reconcile" | undefined, [import("convex/values").VLiteral<"execute", "required">, import("convex/values").VLiteral<"reconcile", "required">], "optional", never>;
1613
1692
  resumeQueued: import("convex/values").VBoolean<boolean, "required">;
1614
1693
  outcome: import("convex/values").VUnion<"collect" | "release" | undefined, [import("convex/values").VLiteral<"collect", "required">, import("convex/values").VLiteral<"release", "required">], "optional", never>;
1615
- }, "required", "accountId" | "activePhase" | "allocation" | "allocation.adjustmentAmount" | "allocation.creditSource" | "allocation.creditSource.creditGrantId" | "allocation.creditSource.customerAccount" | "allocation.creditSource.livemode" | "allocation.creditSource.purchaseId" | "allocation.creditSource.stripeAccountId" | "allocation.creditSource.stripePriceId" | "allocation.creditSource.stripeProductId" | "allocation.currency" | "allocation.gross" | "allocation.paymentId" | "allocation.paymentIntentId" | "allocation.platformNet" | "allocation.policyContext" | "allocation.policyContext.fields" | "allocation.policyContext.namespace" | "allocation.policyContext.version" | "allocation.processingFee" | "allocation.sourceChargeId" | "allocation.sourceInvoiceId" | "allocation.transfers" | "allocation.usageSource" | "allocation.usageSource.customerAccount" | "allocation.usageSource.invoicePaymentId" | "allocation.usageSource.livemode" | "allocation.usageSource.meterId" | "allocation.usageSource.model" | "allocation.usageSource.period" | "allocation.usageSource.period.end" | "allocation.usageSource.period.start" | "allocation.usageSource.stripeAccountId" | "allocation.usageSource.stripePriceId" | "allocation.usageSource.stripeProductId" | "allocation.usageSource.subscriptionId" | "allocation.usageSource.subscriptionItemId" | "cancelRequested" | "completion" | "currency" | "definitionVersion" | "groupKey" | "maxAttempts" | "outcome" | "provider" | "providerApiVersion" | "providerStarted" | "releaseUncollectible" | "resumeQueued" | "retryDelayMs" | "scopeKey" | "sourceId" | "sourceKind" | "status" | "version" | "workflowId" | `allocation.policyContext.fields.${string}`>, {
1694
+ }, "required", "accountId" | "activePhase" | "allocation" | "allocation.adjustmentAmount" | "allocation.creditSource" | "allocation.creditSource.creditGrantId" | "allocation.creditSource.customerAccount" | "allocation.creditSource.livemode" | "allocation.creditSource.purchaseId" | "allocation.creditSource.stripeAccountId" | "allocation.creditSource.stripePriceId" | "allocation.creditSource.stripeProductId" | "allocation.currency" | "allocation.gross" | "allocation.paymentId" | "allocation.paymentIntentId" | "allocation.platformNet" | "allocation.policyContext" | "allocation.policyContext.fields" | "allocation.policyContext.namespace" | "allocation.policyContext.version" | "allocation.processingFee" | "allocation.sourceChargeId" | "allocation.sourceInvoiceId" | "allocation.transfers" | "allocation.usageSource" | "allocation.usageSource.customerAccount" | "allocation.usageSource.invoiceLines" | "allocation.usageSource.invoicePaymentId" | "allocation.usageSource.livemode" | "allocation.usageSource.meterId" | "allocation.usageSource.model" | "allocation.usageSource.period" | "allocation.usageSource.period.end" | "allocation.usageSource.period.start" | "allocation.usageSource.stripeAccountId" | "allocation.usageSource.stripePriceId" | "allocation.usageSource.stripeProductId" | "allocation.usageSource.subscriptionId" | "allocation.usageSource.subscriptionItemId" | "cancelRequested" | "completion" | "currency" | "definitionVersion" | "groupKey" | "maxAttempts" | "outcome" | "provider" | "providerApiVersion" | "providerStarted" | "releaseUncollectible" | "resumeQueued" | "retryDelayMs" | "scopeKey" | "sourceId" | "sourceKind" | "status" | "version" | "workflowId" | `allocation.policyContext.fields.${string}`>, {
1616
1695
  by_group: ["groupKey", "_creationTime"];
1617
1696
  by_source: ["sourceKind", "sourceId", "_creationTime"];
1618
1697
  }, {}, {}>;
@@ -1650,6 +1729,19 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
1650
1729
  }[];
1651
1730
  usageSource?: {
1652
1731
  customerAccount: string;
1732
+ invoiceLines?: {
1733
+ amount: number;
1734
+ kind: "fixed" | "metered";
1735
+ lineId: string;
1736
+ period: {
1737
+ end: number;
1738
+ start: number;
1739
+ };
1740
+ quantity: string;
1741
+ stripePriceId: string;
1742
+ stripeProductId: string;
1743
+ subscriptionItemId: string;
1744
+ }[] | undefined;
1653
1745
  invoicePaymentId: string;
1654
1746
  livemode: boolean;
1655
1747
  meterId: string;
@@ -1713,6 +1805,19 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
1713
1805
  }[];
1714
1806
  usageSource?: {
1715
1807
  customerAccount: string;
1808
+ invoiceLines?: {
1809
+ amount: number;
1810
+ kind: "fixed" | "metered";
1811
+ lineId: string;
1812
+ period: {
1813
+ end: number;
1814
+ start: number;
1815
+ };
1816
+ quantity: string;
1817
+ stripePriceId: string;
1818
+ stripeProductId: string;
1819
+ subscriptionItemId: string;
1820
+ }[] | undefined;
1716
1821
  invoicePaymentId: string;
1717
1822
  livemode: boolean;
1718
1823
  meterId: string;
@@ -1781,6 +1886,19 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
1781
1886
  }[];
1782
1887
  usageSource?: {
1783
1888
  customerAccount: string;
1889
+ invoiceLines?: {
1890
+ amount: number;
1891
+ kind: "fixed" | "metered";
1892
+ lineId: string;
1893
+ period: {
1894
+ end: number;
1895
+ start: number;
1896
+ };
1897
+ quantity: string;
1898
+ stripePriceId: string;
1899
+ stripeProductId: string;
1900
+ subscriptionItemId: string;
1901
+ }[] | undefined;
1784
1902
  invoicePaymentId: string;
1785
1903
  livemode: boolean;
1786
1904
  meterId: string;
@@ -1810,6 +1928,19 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
1810
1928
  sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
1811
1929
  usageSource: import("convex/values").VObject<{
1812
1930
  customerAccount: string;
1931
+ invoiceLines?: {
1932
+ amount: number;
1933
+ kind: "fixed" | "metered";
1934
+ lineId: string;
1935
+ period: {
1936
+ end: number;
1937
+ start: number;
1938
+ };
1939
+ quantity: string;
1940
+ stripePriceId: string;
1941
+ stripeProductId: string;
1942
+ subscriptionItemId: string;
1943
+ }[] | undefined;
1813
1944
  invoicePaymentId: string;
1814
1945
  livemode: boolean;
1815
1946
  meterId: string;
@@ -1824,6 +1955,46 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
1824
1955
  subscriptionId: string;
1825
1956
  subscriptionItemId: string;
1826
1957
  } | undefined, {
1958
+ invoiceLines: import("convex/values").VArray<{
1959
+ amount: number;
1960
+ kind: "fixed" | "metered";
1961
+ lineId: string;
1962
+ period: {
1963
+ end: number;
1964
+ start: number;
1965
+ };
1966
+ quantity: string;
1967
+ stripePriceId: string;
1968
+ stripeProductId: string;
1969
+ subscriptionItemId: string;
1970
+ }[] | undefined, import("convex/values").VObject<{
1971
+ amount: number;
1972
+ kind: "fixed" | "metered";
1973
+ lineId: string;
1974
+ period: {
1975
+ end: number;
1976
+ start: number;
1977
+ };
1978
+ quantity: string;
1979
+ stripePriceId: string;
1980
+ stripeProductId: string;
1981
+ subscriptionItemId: string;
1982
+ }, {
1983
+ lineId: import("convex/values").VString<string, "required">;
1984
+ stripePriceId: import("convex/values").VString<string, "required">;
1985
+ stripeProductId: import("convex/values").VString<string, "required">;
1986
+ subscriptionItemId: import("convex/values").VString<string, "required">;
1987
+ period: import("convex/values").VObject<{
1988
+ end: number;
1989
+ start: number;
1990
+ }, {
1991
+ start: import("convex/values").VFloat64<number, "required">;
1992
+ end: import("convex/values").VFloat64<number, "required">;
1993
+ }, "required", "end" | "start">;
1994
+ amount: import("convex/values").VFloat64<number, "required">;
1995
+ quantity: import("convex/values").VString<string, "required">;
1996
+ kind: import("convex/values").VUnion<"fixed" | "metered", [import("convex/values").VLiteral<"fixed", "required">, import("convex/values").VLiteral<"metered", "required">], "required", never>;
1997
+ }, "required", "amount" | "kind" | "lineId" | "period" | "period.end" | "period.start" | "quantity" | "stripePriceId" | "stripeProductId" | "subscriptionItemId">, "optional">;
1827
1998
  stripeAccountId: import("convex/values").VString<string, "required">;
1828
1999
  customerAccount: import("convex/values").VString<string, "required">;
1829
2000
  livemode: import("convex/values").VBoolean<boolean, "required">;
@@ -1841,7 +2012,7 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
1841
2012
  end: import("convex/values").VFloat64<number, "required">;
1842
2013
  }, "required", "end" | "start">;
1843
2014
  model: import("convex/values").VUnion<"included_overage" | "pay_as_you_go", [import("convex/values").VLiteral<"pay_as_you_go", "required">, import("convex/values").VLiteral<"included_overage", "required">], "required", never>;
1844
- }, "optional", "customerAccount" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
2015
+ }, "optional", "customerAccount" | "invoiceLines" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
1845
2016
  creditSource: import("convex/values").VObject<{
1846
2017
  creditGrantId: string;
1847
2018
  customerAccount: string;
@@ -1878,10 +2049,10 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
1878
2049
  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>;
1879
2050
  amount: import("convex/values").VFloat64<number, "required">;
1880
2051
  }, "required", "amount" | "destinationAccountId" | "role">, "required">;
1881
- }, "optional", "adjustmentAmount" | "creditSource" | "creditSource.creditGrantId" | "creditSource.customerAccount" | "creditSource.livemode" | "creditSource.purchaseId" | "creditSource.stripeAccountId" | "creditSource.stripePriceId" | "creditSource.stripeProductId" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "policyContext" | "policyContext.fields" | "policyContext.namespace" | "policyContext.version" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers" | "usageSource" | "usageSource.customerAccount" | "usageSource.invoicePaymentId" | "usageSource.livemode" | "usageSource.meterId" | "usageSource.model" | "usageSource.period" | "usageSource.period.end" | "usageSource.period.start" | "usageSource.stripeAccountId" | "usageSource.stripePriceId" | "usageSource.stripeProductId" | "usageSource.subscriptionId" | "usageSource.subscriptionItemId" | `policyContext.fields.${string}`>;
1882
- }, "required", "accountId" | "allocation" | "allocation.adjustmentAmount" | "allocation.creditSource" | "allocation.creditSource.creditGrantId" | "allocation.creditSource.customerAccount" | "allocation.creditSource.livemode" | "allocation.creditSource.purchaseId" | "allocation.creditSource.stripeAccountId" | "allocation.creditSource.stripePriceId" | "allocation.creditSource.stripeProductId" | "allocation.currency" | "allocation.gross" | "allocation.paymentId" | "allocation.paymentIntentId" | "allocation.platformNet" | "allocation.policyContext" | "allocation.policyContext.fields" | "allocation.policyContext.namespace" | "allocation.policyContext.version" | "allocation.processingFee" | "allocation.sourceChargeId" | "allocation.sourceInvoiceId" | "allocation.transfers" | "allocation.usageSource" | "allocation.usageSource.customerAccount" | "allocation.usageSource.invoicePaymentId" | "allocation.usageSource.livemode" | "allocation.usageSource.meterId" | "allocation.usageSource.model" | "allocation.usageSource.period" | "allocation.usageSource.period.end" | "allocation.usageSource.period.start" | "allocation.usageSource.stripeAccountId" | "allocation.usageSource.stripePriceId" | "allocation.usageSource.stripeProductId" | "allocation.usageSource.subscriptionId" | "allocation.usageSource.subscriptionItemId" | "completion" | "currency" | "definitionVersion" | "groupKey" | "maxAttempts" | "provider" | "providerApiVersion" | "releaseUncollectible" | "retryDelayMs" | "scopeKey" | `allocation.policyContext.fields.${string}`>;
2052
+ }, "optional", "adjustmentAmount" | "creditSource" | "creditSource.creditGrantId" | "creditSource.customerAccount" | "creditSource.livemode" | "creditSource.purchaseId" | "creditSource.stripeAccountId" | "creditSource.stripePriceId" | "creditSource.stripeProductId" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "policyContext" | "policyContext.fields" | "policyContext.namespace" | "policyContext.version" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers" | "usageSource" | "usageSource.customerAccount" | "usageSource.invoiceLines" | "usageSource.invoicePaymentId" | "usageSource.livemode" | "usageSource.meterId" | "usageSource.model" | "usageSource.period" | "usageSource.period.end" | "usageSource.period.start" | "usageSource.stripeAccountId" | "usageSource.stripePriceId" | "usageSource.stripeProductId" | "usageSource.subscriptionId" | "usageSource.subscriptionItemId" | `policyContext.fields.${string}`>;
2053
+ }, "required", "accountId" | "allocation" | "allocation.adjustmentAmount" | "allocation.creditSource" | "allocation.creditSource.creditGrantId" | "allocation.creditSource.customerAccount" | "allocation.creditSource.livemode" | "allocation.creditSource.purchaseId" | "allocation.creditSource.stripeAccountId" | "allocation.creditSource.stripePriceId" | "allocation.creditSource.stripeProductId" | "allocation.currency" | "allocation.gross" | "allocation.paymentId" | "allocation.paymentIntentId" | "allocation.platformNet" | "allocation.policyContext" | "allocation.policyContext.fields" | "allocation.policyContext.namespace" | "allocation.policyContext.version" | "allocation.processingFee" | "allocation.sourceChargeId" | "allocation.sourceInvoiceId" | "allocation.transfers" | "allocation.usageSource" | "allocation.usageSource.customerAccount" | "allocation.usageSource.invoiceLines" | "allocation.usageSource.invoicePaymentId" | "allocation.usageSource.livemode" | "allocation.usageSource.meterId" | "allocation.usageSource.model" | "allocation.usageSource.period" | "allocation.usageSource.period.end" | "allocation.usageSource.period.start" | "allocation.usageSource.stripeAccountId" | "allocation.usageSource.stripePriceId" | "allocation.usageSource.stripeProductId" | "allocation.usageSource.subscriptionId" | "allocation.usageSource.subscriptionItemId" | "completion" | "currency" | "definitionVersion" | "groupKey" | "maxAttempts" | "provider" | "providerApiVersion" | "releaseUncollectible" | "retryDelayMs" | "scopeKey" | `allocation.policyContext.fields.${string}`>;
1883
2054
  operationId: import("convex/values").VId<import("convex/values").GenericId<"recoveryWorkflowOperations">, "required">;
1884
- }, "required", "binding" | "binding.accountId" | "binding.allocation" | "binding.allocation.adjustmentAmount" | "binding.allocation.creditSource" | "binding.allocation.creditSource.creditGrantId" | "binding.allocation.creditSource.customerAccount" | "binding.allocation.creditSource.livemode" | "binding.allocation.creditSource.purchaseId" | "binding.allocation.creditSource.stripeAccountId" | "binding.allocation.creditSource.stripePriceId" | "binding.allocation.creditSource.stripeProductId" | "binding.allocation.currency" | "binding.allocation.gross" | "binding.allocation.paymentId" | "binding.allocation.paymentIntentId" | "binding.allocation.platformNet" | "binding.allocation.policyContext" | "binding.allocation.policyContext.fields" | "binding.allocation.policyContext.namespace" | "binding.allocation.policyContext.version" | "binding.allocation.processingFee" | "binding.allocation.sourceChargeId" | "binding.allocation.sourceInvoiceId" | "binding.allocation.transfers" | "binding.allocation.usageSource" | "binding.allocation.usageSource.customerAccount" | "binding.allocation.usageSource.invoicePaymentId" | "binding.allocation.usageSource.livemode" | "binding.allocation.usageSource.meterId" | "binding.allocation.usageSource.model" | "binding.allocation.usageSource.period" | "binding.allocation.usageSource.period.end" | "binding.allocation.usageSource.period.start" | "binding.allocation.usageSource.stripeAccountId" | "binding.allocation.usageSource.stripePriceId" | "binding.allocation.usageSource.stripeProductId" | "binding.allocation.usageSource.subscriptionId" | "binding.allocation.usageSource.subscriptionItemId" | "binding.completion" | "binding.currency" | "binding.definitionVersion" | "binding.groupKey" | "binding.maxAttempts" | "binding.provider" | "binding.providerApiVersion" | "binding.releaseUncollectible" | "binding.retryDelayMs" | "binding.scopeKey" | "operationId" | "requestKey" | `binding.allocation.policyContext.fields.${string}`>, {
2055
+ }, "required", "binding" | "binding.accountId" | "binding.allocation" | "binding.allocation.adjustmentAmount" | "binding.allocation.creditSource" | "binding.allocation.creditSource.creditGrantId" | "binding.allocation.creditSource.customerAccount" | "binding.allocation.creditSource.livemode" | "binding.allocation.creditSource.purchaseId" | "binding.allocation.creditSource.stripeAccountId" | "binding.allocation.creditSource.stripePriceId" | "binding.allocation.creditSource.stripeProductId" | "binding.allocation.currency" | "binding.allocation.gross" | "binding.allocation.paymentId" | "binding.allocation.paymentIntentId" | "binding.allocation.platformNet" | "binding.allocation.policyContext" | "binding.allocation.policyContext.fields" | "binding.allocation.policyContext.namespace" | "binding.allocation.policyContext.version" | "binding.allocation.processingFee" | "binding.allocation.sourceChargeId" | "binding.allocation.sourceInvoiceId" | "binding.allocation.transfers" | "binding.allocation.usageSource" | "binding.allocation.usageSource.customerAccount" | "binding.allocation.usageSource.invoiceLines" | "binding.allocation.usageSource.invoicePaymentId" | "binding.allocation.usageSource.livemode" | "binding.allocation.usageSource.meterId" | "binding.allocation.usageSource.model" | "binding.allocation.usageSource.period" | "binding.allocation.usageSource.period.end" | "binding.allocation.usageSource.period.start" | "binding.allocation.usageSource.stripeAccountId" | "binding.allocation.usageSource.stripePriceId" | "binding.allocation.usageSource.stripeProductId" | "binding.allocation.usageSource.subscriptionId" | "binding.allocation.usageSource.subscriptionItemId" | "binding.completion" | "binding.currency" | "binding.definitionVersion" | "binding.groupKey" | "binding.maxAttempts" | "binding.provider" | "binding.providerApiVersion" | "binding.releaseUncollectible" | "binding.retryDelayMs" | "binding.scopeKey" | "operationId" | "requestKey" | `binding.allocation.policyContext.fields.${string}`>, {
1885
2056
  by_key: ["requestKey", "_creationTime"];
1886
2057
  }, {}, {}>;
1887
2058
  balanceFundingPreparations: import("convex/server").TableDefinition<import("convex/values").VObject<{
@@ -2189,14 +2360,6 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
2189
2360
  preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
2190
2361
  requestKey: string;
2191
2362
  result?: {
2192
- reason: "identity_changed" | "revision_changed" | "scope_busy";
2193
- retryable: false;
2194
- status: "conflict";
2195
- } | {
2196
- reason: "policy_invalid";
2197
- retryable: false;
2198
- status: "rejected";
2199
- } | {
2200
2363
  operation: {
2201
2364
  accountId: string;
2202
2365
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -2207,6 +2370,14 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
2207
2370
  } | {
2208
2371
  enabled: boolean;
2209
2372
  status: "unchanged";
2373
+ } | {
2374
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
2375
+ retryable: false;
2376
+ status: "conflict";
2377
+ } | {
2378
+ reason: "policy_invalid";
2379
+ retryable: false;
2380
+ status: "rejected";
2210
2381
  } | {
2211
2382
  reason: "provider_pending";
2212
2383
  retryable: true;
@@ -2217,14 +2388,6 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
2217
2388
  payload: import("convex/values").VString<string, "required">;
2218
2389
  preparationId: import("convex/values").VId<import("convex/values").GenericId<"balanceFundingPreparations">, "required">;
2219
2390
  result: import("convex/values").VUnion<{
2220
- reason: "identity_changed" | "revision_changed" | "scope_busy";
2221
- retryable: false;
2222
- status: "conflict";
2223
- } | {
2224
- reason: "policy_invalid";
2225
- retryable: false;
2226
- status: "rejected";
2227
- } | {
2228
2391
  operation: {
2229
2392
  accountId: string;
2230
2393
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -2235,6 +2398,14 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
2235
2398
  } | {
2236
2399
  enabled: boolean;
2237
2400
  status: "unchanged";
2401
+ } | {
2402
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
2403
+ retryable: false;
2404
+ status: "conflict";
2405
+ } | {
2406
+ reason: "policy_invalid";
2407
+ retryable: false;
2408
+ status: "rejected";
2238
2409
  } | {
2239
2410
  reason: "provider_pending";
2240
2411
  retryable: true;
@@ -3709,6 +3880,19 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
3709
3880
  }[];
3710
3881
  usageSource?: {
3711
3882
  customerAccount: string;
3883
+ invoiceLines?: {
3884
+ amount: number;
3885
+ kind: "fixed" | "metered";
3886
+ lineId: string;
3887
+ period: {
3888
+ end: number;
3889
+ start: number;
3890
+ };
3891
+ quantity: string;
3892
+ stripePriceId: string;
3893
+ stripeProductId: string;
3894
+ subscriptionItemId: string;
3895
+ }[] | undefined;
3712
3896
  invoicePaymentId: string;
3713
3897
  livemode: boolean;
3714
3898
  meterId: string;
@@ -3738,6 +3922,19 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
3738
3922
  sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
3739
3923
  usageSource: import("convex/values").VObject<{
3740
3924
  customerAccount: string;
3925
+ invoiceLines?: {
3926
+ amount: number;
3927
+ kind: "fixed" | "metered";
3928
+ lineId: string;
3929
+ period: {
3930
+ end: number;
3931
+ start: number;
3932
+ };
3933
+ quantity: string;
3934
+ stripePriceId: string;
3935
+ stripeProductId: string;
3936
+ subscriptionItemId: string;
3937
+ }[] | undefined;
3741
3938
  invoicePaymentId: string;
3742
3939
  livemode: boolean;
3743
3940
  meterId: string;
@@ -3752,6 +3949,46 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
3752
3949
  subscriptionId: string;
3753
3950
  subscriptionItemId: string;
3754
3951
  } | undefined, {
3952
+ invoiceLines: import("convex/values").VArray<{
3953
+ amount: number;
3954
+ kind: "fixed" | "metered";
3955
+ lineId: string;
3956
+ period: {
3957
+ end: number;
3958
+ start: number;
3959
+ };
3960
+ quantity: string;
3961
+ stripePriceId: string;
3962
+ stripeProductId: string;
3963
+ subscriptionItemId: string;
3964
+ }[] | undefined, import("convex/values").VObject<{
3965
+ amount: number;
3966
+ kind: "fixed" | "metered";
3967
+ lineId: string;
3968
+ period: {
3969
+ end: number;
3970
+ start: number;
3971
+ };
3972
+ quantity: string;
3973
+ stripePriceId: string;
3974
+ stripeProductId: string;
3975
+ subscriptionItemId: string;
3976
+ }, {
3977
+ lineId: import("convex/values").VString<string, "required">;
3978
+ stripePriceId: import("convex/values").VString<string, "required">;
3979
+ stripeProductId: import("convex/values").VString<string, "required">;
3980
+ subscriptionItemId: import("convex/values").VString<string, "required">;
3981
+ period: import("convex/values").VObject<{
3982
+ end: number;
3983
+ start: number;
3984
+ }, {
3985
+ start: import("convex/values").VFloat64<number, "required">;
3986
+ end: import("convex/values").VFloat64<number, "required">;
3987
+ }, "required", "end" | "start">;
3988
+ amount: import("convex/values").VFloat64<number, "required">;
3989
+ quantity: import("convex/values").VString<string, "required">;
3990
+ kind: import("convex/values").VUnion<"fixed" | "metered", [import("convex/values").VLiteral<"fixed", "required">, import("convex/values").VLiteral<"metered", "required">], "required", never>;
3991
+ }, "required", "amount" | "kind" | "lineId" | "period" | "period.end" | "period.start" | "quantity" | "stripePriceId" | "stripeProductId" | "subscriptionItemId">, "optional">;
3755
3992
  stripeAccountId: import("convex/values").VString<string, "required">;
3756
3993
  customerAccount: import("convex/values").VString<string, "required">;
3757
3994
  livemode: import("convex/values").VBoolean<boolean, "required">;
@@ -3769,7 +4006,7 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
3769
4006
  end: import("convex/values").VFloat64<number, "required">;
3770
4007
  }, "required", "end" | "start">;
3771
4008
  model: import("convex/values").VUnion<"included_overage" | "pay_as_you_go", [import("convex/values").VLiteral<"pay_as_you_go", "required">, import("convex/values").VLiteral<"included_overage", "required">], "required", never>;
3772
- }, "optional", "customerAccount" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
4009
+ }, "optional", "customerAccount" | "invoiceLines" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
3773
4010
  creditSource: import("convex/values").VObject<{
3774
4011
  creditGrantId: string;
3775
4012
  customerAccount: string;
@@ -3806,7 +4043,7 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
3806
4043
  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>;
3807
4044
  amount: import("convex/values").VFloat64<number, "required">;
3808
4045
  }, "required", "amount" | "destinationAccountId" | "role">, "required">;
3809
- }, "required", "adjustmentAmount" | "creditSource" | "creditSource.creditGrantId" | "creditSource.customerAccount" | "creditSource.livemode" | "creditSource.purchaseId" | "creditSource.stripeAccountId" | "creditSource.stripePriceId" | "creditSource.stripeProductId" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "policyContext" | "policyContext.fields" | "policyContext.namespace" | "policyContext.version" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers" | "usageSource" | "usageSource.customerAccount" | "usageSource.invoicePaymentId" | "usageSource.livemode" | "usageSource.meterId" | "usageSource.model" | "usageSource.period" | "usageSource.period.end" | "usageSource.period.start" | "usageSource.stripeAccountId" | "usageSource.stripePriceId" | "usageSource.stripeProductId" | "usageSource.subscriptionId" | "usageSource.subscriptionItemId" | `policyContext.fields.${string}`>, {
4046
+ }, "required", "adjustmentAmount" | "creditSource" | "creditSource.creditGrantId" | "creditSource.customerAccount" | "creditSource.livemode" | "creditSource.purchaseId" | "creditSource.stripeAccountId" | "creditSource.stripePriceId" | "creditSource.stripeProductId" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "policyContext" | "policyContext.fields" | "policyContext.namespace" | "policyContext.version" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers" | "usageSource" | "usageSource.customerAccount" | "usageSource.invoiceLines" | "usageSource.invoicePaymentId" | "usageSource.livemode" | "usageSource.meterId" | "usageSource.model" | "usageSource.period" | "usageSource.period.end" | "usageSource.period.start" | "usageSource.stripeAccountId" | "usageSource.stripePriceId" | "usageSource.stripeProductId" | "usageSource.subscriptionId" | "usageSource.subscriptionItemId" | `policyContext.fields.${string}`>, {
3810
4047
  by_source_charge: ["sourceChargeId", "_creationTime"];
3811
4048
  }, {}, {}>;
3812
4049
  commissionTerms: import("convex/server").TableDefinition<import("convex/values").VObject<{
@@ -6045,6 +6282,19 @@ export declare function historical(currency?: string): Promise<{
6045
6282
  }[];
6046
6283
  usageSource?: {
6047
6284
  customerAccount: string;
6285
+ invoiceLines?: {
6286
+ amount: number;
6287
+ kind: "fixed" | "metered";
6288
+ lineId: string;
6289
+ period: {
6290
+ end: number;
6291
+ start: number;
6292
+ };
6293
+ quantity: string;
6294
+ stripePriceId: string;
6295
+ stripeProductId: string;
6296
+ subscriptionItemId: string;
6297
+ }[] | undefined;
6048
6298
  invoicePaymentId: string;
6049
6299
  livemode: boolean;
6050
6300
  meterId: string;
@@ -6122,6 +6372,19 @@ export declare function historical(currency?: string): Promise<{
6122
6372
  }[];
6123
6373
  usageSource?: {
6124
6374
  customerAccount: string;
6375
+ invoiceLines?: {
6376
+ amount: number;
6377
+ kind: "fixed" | "metered";
6378
+ lineId: string;
6379
+ period: {
6380
+ end: number;
6381
+ start: number;
6382
+ };
6383
+ quantity: string;
6384
+ stripePriceId: string;
6385
+ stripeProductId: string;
6386
+ subscriptionItemId: string;
6387
+ }[] | undefined;
6125
6388
  invoicePaymentId: string;
6126
6389
  livemode: boolean;
6127
6390
  meterId: string;
@@ -6151,6 +6414,19 @@ export declare function historical(currency?: string): Promise<{
6151
6414
  sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
6152
6415
  usageSource: import("convex/values").VObject<{
6153
6416
  customerAccount: string;
6417
+ invoiceLines?: {
6418
+ amount: number;
6419
+ kind: "fixed" | "metered";
6420
+ lineId: string;
6421
+ period: {
6422
+ end: number;
6423
+ start: number;
6424
+ };
6425
+ quantity: string;
6426
+ stripePriceId: string;
6427
+ stripeProductId: string;
6428
+ subscriptionItemId: string;
6429
+ }[] | undefined;
6154
6430
  invoicePaymentId: string;
6155
6431
  livemode: boolean;
6156
6432
  meterId: string;
@@ -6165,6 +6441,46 @@ export declare function historical(currency?: string): Promise<{
6165
6441
  subscriptionId: string;
6166
6442
  subscriptionItemId: string;
6167
6443
  } | undefined, {
6444
+ invoiceLines: import("convex/values").VArray<{
6445
+ amount: number;
6446
+ kind: "fixed" | "metered";
6447
+ lineId: string;
6448
+ period: {
6449
+ end: number;
6450
+ start: number;
6451
+ };
6452
+ quantity: string;
6453
+ stripePriceId: string;
6454
+ stripeProductId: string;
6455
+ subscriptionItemId: string;
6456
+ }[] | undefined, import("convex/values").VObject<{
6457
+ amount: number;
6458
+ kind: "fixed" | "metered";
6459
+ lineId: string;
6460
+ period: {
6461
+ end: number;
6462
+ start: number;
6463
+ };
6464
+ quantity: string;
6465
+ stripePriceId: string;
6466
+ stripeProductId: string;
6467
+ subscriptionItemId: string;
6468
+ }, {
6469
+ lineId: import("convex/values").VString<string, "required">;
6470
+ stripePriceId: import("convex/values").VString<string, "required">;
6471
+ stripeProductId: import("convex/values").VString<string, "required">;
6472
+ subscriptionItemId: import("convex/values").VString<string, "required">;
6473
+ period: import("convex/values").VObject<{
6474
+ end: number;
6475
+ start: number;
6476
+ }, {
6477
+ start: import("convex/values").VFloat64<number, "required">;
6478
+ end: import("convex/values").VFloat64<number, "required">;
6479
+ }, "required", "end" | "start">;
6480
+ amount: import("convex/values").VFloat64<number, "required">;
6481
+ quantity: import("convex/values").VString<string, "required">;
6482
+ kind: import("convex/values").VUnion<"fixed" | "metered", [import("convex/values").VLiteral<"fixed", "required">, import("convex/values").VLiteral<"metered", "required">], "required", never>;
6483
+ }, "required", "amount" | "kind" | "lineId" | "period" | "period.end" | "period.start" | "quantity" | "stripePriceId" | "stripeProductId" | "subscriptionItemId">, "optional">;
6168
6484
  stripeAccountId: import("convex/values").VString<string, "required">;
6169
6485
  customerAccount: import("convex/values").VString<string, "required">;
6170
6486
  livemode: import("convex/values").VBoolean<boolean, "required">;
@@ -6182,7 +6498,7 @@ export declare function historical(currency?: string): Promise<{
6182
6498
  end: import("convex/values").VFloat64<number, "required">;
6183
6499
  }, "required", "end" | "start">;
6184
6500
  model: import("convex/values").VUnion<"included_overage" | "pay_as_you_go", [import("convex/values").VLiteral<"pay_as_you_go", "required">, import("convex/values").VLiteral<"included_overage", "required">], "required", never>;
6185
- }, "optional", "customerAccount" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
6501
+ }, "optional", "customerAccount" | "invoiceLines" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
6186
6502
  creditSource: import("convex/values").VObject<{
6187
6503
  creditGrantId: string;
6188
6504
  customerAccount: string;
@@ -6219,7 +6535,7 @@ export declare function historical(currency?: string): Promise<{
6219
6535
  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>;
6220
6536
  amount: import("convex/values").VFloat64<number, "required">;
6221
6537
  }, "required", "amount" | "destinationAccountId" | "role">, "required">;
6222
- }, "optional", "adjustmentAmount" | "creditSource" | "creditSource.creditGrantId" | "creditSource.customerAccount" | "creditSource.livemode" | "creditSource.purchaseId" | "creditSource.stripeAccountId" | "creditSource.stripePriceId" | "creditSource.stripeProductId" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "policyContext" | "policyContext.fields" | "policyContext.namespace" | "policyContext.version" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers" | "usageSource" | "usageSource.customerAccount" | "usageSource.invoicePaymentId" | "usageSource.livemode" | "usageSource.meterId" | "usageSource.model" | "usageSource.period" | "usageSource.period.end" | "usageSource.period.start" | "usageSource.stripeAccountId" | "usageSource.stripePriceId" | "usageSource.stripeProductId" | "usageSource.subscriptionId" | "usageSource.subscriptionItemId" | `policyContext.fields.${string}`>;
6538
+ }, "optional", "adjustmentAmount" | "creditSource" | "creditSource.creditGrantId" | "creditSource.customerAccount" | "creditSource.livemode" | "creditSource.purchaseId" | "creditSource.stripeAccountId" | "creditSource.stripePriceId" | "creditSource.stripeProductId" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "policyContext" | "policyContext.fields" | "policyContext.namespace" | "policyContext.version" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers" | "usageSource" | "usageSource.customerAccount" | "usageSource.invoiceLines" | "usageSource.invoicePaymentId" | "usageSource.livemode" | "usageSource.meterId" | "usageSource.model" | "usageSource.period" | "usageSource.period.end" | "usageSource.period.start" | "usageSource.stripeAccountId" | "usageSource.stripePriceId" | "usageSource.stripeProductId" | "usageSource.subscriptionId" | "usageSource.subscriptionItemId" | `policyContext.fields.${string}`>;
6223
6539
  version: import("convex/values").VFloat64<number, "required">;
6224
6540
  sourceKind: import("convex/values").VUnion<"invoice" | "settlement", [import("convex/values").VLiteral<"settlement", "required">, import("convex/values").VLiteral<"invoice", "required">], "required", never>;
6225
6541
  sourceId: import("convex/values").VString<string, "required">;
@@ -6230,7 +6546,7 @@ export declare function historical(currency?: string): Promise<{
6230
6546
  activePhase: import("convex/values").VUnion<"execute" | "reconcile" | undefined, [import("convex/values").VLiteral<"execute", "required">, import("convex/values").VLiteral<"reconcile", "required">], "optional", never>;
6231
6547
  resumeQueued: import("convex/values").VBoolean<boolean, "required">;
6232
6548
  outcome: import("convex/values").VUnion<"collect" | "release" | undefined, [import("convex/values").VLiteral<"collect", "required">, import("convex/values").VLiteral<"release", "required">], "optional", never>;
6233
- }, "required", "accountId" | "activePhase" | "allocation" | "allocation.adjustmentAmount" | "allocation.creditSource" | "allocation.creditSource.creditGrantId" | "allocation.creditSource.customerAccount" | "allocation.creditSource.livemode" | "allocation.creditSource.purchaseId" | "allocation.creditSource.stripeAccountId" | "allocation.creditSource.stripePriceId" | "allocation.creditSource.stripeProductId" | "allocation.currency" | "allocation.gross" | "allocation.paymentId" | "allocation.paymentIntentId" | "allocation.platformNet" | "allocation.policyContext" | "allocation.policyContext.fields" | "allocation.policyContext.namespace" | "allocation.policyContext.version" | "allocation.processingFee" | "allocation.sourceChargeId" | "allocation.sourceInvoiceId" | "allocation.transfers" | "allocation.usageSource" | "allocation.usageSource.customerAccount" | "allocation.usageSource.invoicePaymentId" | "allocation.usageSource.livemode" | "allocation.usageSource.meterId" | "allocation.usageSource.model" | "allocation.usageSource.period" | "allocation.usageSource.period.end" | "allocation.usageSource.period.start" | "allocation.usageSource.stripeAccountId" | "allocation.usageSource.stripePriceId" | "allocation.usageSource.stripeProductId" | "allocation.usageSource.subscriptionId" | "allocation.usageSource.subscriptionItemId" | "cancelRequested" | "completion" | "currency" | "definitionVersion" | "groupKey" | "maxAttempts" | "outcome" | "provider" | "providerApiVersion" | "providerStarted" | "releaseUncollectible" | "resumeQueued" | "retryDelayMs" | "scopeKey" | "sourceId" | "sourceKind" | "status" | "version" | "workflowId" | `allocation.policyContext.fields.${string}`>, {
6549
+ }, "required", "accountId" | "activePhase" | "allocation" | "allocation.adjustmentAmount" | "allocation.creditSource" | "allocation.creditSource.creditGrantId" | "allocation.creditSource.customerAccount" | "allocation.creditSource.livemode" | "allocation.creditSource.purchaseId" | "allocation.creditSource.stripeAccountId" | "allocation.creditSource.stripePriceId" | "allocation.creditSource.stripeProductId" | "allocation.currency" | "allocation.gross" | "allocation.paymentId" | "allocation.paymentIntentId" | "allocation.platformNet" | "allocation.policyContext" | "allocation.policyContext.fields" | "allocation.policyContext.namespace" | "allocation.policyContext.version" | "allocation.processingFee" | "allocation.sourceChargeId" | "allocation.sourceInvoiceId" | "allocation.transfers" | "allocation.usageSource" | "allocation.usageSource.customerAccount" | "allocation.usageSource.invoiceLines" | "allocation.usageSource.invoicePaymentId" | "allocation.usageSource.livemode" | "allocation.usageSource.meterId" | "allocation.usageSource.model" | "allocation.usageSource.period" | "allocation.usageSource.period.end" | "allocation.usageSource.period.start" | "allocation.usageSource.stripeAccountId" | "allocation.usageSource.stripePriceId" | "allocation.usageSource.stripeProductId" | "allocation.usageSource.subscriptionId" | "allocation.usageSource.subscriptionItemId" | "cancelRequested" | "completion" | "currency" | "definitionVersion" | "groupKey" | "maxAttempts" | "outcome" | "provider" | "providerApiVersion" | "providerStarted" | "releaseUncollectible" | "resumeQueued" | "retryDelayMs" | "scopeKey" | "sourceId" | "sourceKind" | "status" | "version" | "workflowId" | `allocation.policyContext.fields.${string}`>, {
6234
6550
  by_group: ["groupKey", "_creationTime"];
6235
6551
  by_source: ["sourceKind", "sourceId", "_creationTime"];
6236
6552
  }, {}, {}>;
@@ -6268,6 +6584,19 @@ export declare function historical(currency?: string): Promise<{
6268
6584
  }[];
6269
6585
  usageSource?: {
6270
6586
  customerAccount: string;
6587
+ invoiceLines?: {
6588
+ amount: number;
6589
+ kind: "fixed" | "metered";
6590
+ lineId: string;
6591
+ period: {
6592
+ end: number;
6593
+ start: number;
6594
+ };
6595
+ quantity: string;
6596
+ stripePriceId: string;
6597
+ stripeProductId: string;
6598
+ subscriptionItemId: string;
6599
+ }[] | undefined;
6271
6600
  invoicePaymentId: string;
6272
6601
  livemode: boolean;
6273
6602
  meterId: string;
@@ -6331,6 +6660,19 @@ export declare function historical(currency?: string): Promise<{
6331
6660
  }[];
6332
6661
  usageSource?: {
6333
6662
  customerAccount: string;
6663
+ invoiceLines?: {
6664
+ amount: number;
6665
+ kind: "fixed" | "metered";
6666
+ lineId: string;
6667
+ period: {
6668
+ end: number;
6669
+ start: number;
6670
+ };
6671
+ quantity: string;
6672
+ stripePriceId: string;
6673
+ stripeProductId: string;
6674
+ subscriptionItemId: string;
6675
+ }[] | undefined;
6334
6676
  invoicePaymentId: string;
6335
6677
  livemode: boolean;
6336
6678
  meterId: string;
@@ -6399,6 +6741,19 @@ export declare function historical(currency?: string): Promise<{
6399
6741
  }[];
6400
6742
  usageSource?: {
6401
6743
  customerAccount: string;
6744
+ invoiceLines?: {
6745
+ amount: number;
6746
+ kind: "fixed" | "metered";
6747
+ lineId: string;
6748
+ period: {
6749
+ end: number;
6750
+ start: number;
6751
+ };
6752
+ quantity: string;
6753
+ stripePriceId: string;
6754
+ stripeProductId: string;
6755
+ subscriptionItemId: string;
6756
+ }[] | undefined;
6402
6757
  invoicePaymentId: string;
6403
6758
  livemode: boolean;
6404
6759
  meterId: string;
@@ -6428,6 +6783,19 @@ export declare function historical(currency?: string): Promise<{
6428
6783
  sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
6429
6784
  usageSource: import("convex/values").VObject<{
6430
6785
  customerAccount: string;
6786
+ invoiceLines?: {
6787
+ amount: number;
6788
+ kind: "fixed" | "metered";
6789
+ lineId: string;
6790
+ period: {
6791
+ end: number;
6792
+ start: number;
6793
+ };
6794
+ quantity: string;
6795
+ stripePriceId: string;
6796
+ stripeProductId: string;
6797
+ subscriptionItemId: string;
6798
+ }[] | undefined;
6431
6799
  invoicePaymentId: string;
6432
6800
  livemode: boolean;
6433
6801
  meterId: string;
@@ -6442,6 +6810,46 @@ export declare function historical(currency?: string): Promise<{
6442
6810
  subscriptionId: string;
6443
6811
  subscriptionItemId: string;
6444
6812
  } | undefined, {
6813
+ invoiceLines: import("convex/values").VArray<{
6814
+ amount: number;
6815
+ kind: "fixed" | "metered";
6816
+ lineId: string;
6817
+ period: {
6818
+ end: number;
6819
+ start: number;
6820
+ };
6821
+ quantity: string;
6822
+ stripePriceId: string;
6823
+ stripeProductId: string;
6824
+ subscriptionItemId: string;
6825
+ }[] | undefined, import("convex/values").VObject<{
6826
+ amount: number;
6827
+ kind: "fixed" | "metered";
6828
+ lineId: string;
6829
+ period: {
6830
+ end: number;
6831
+ start: number;
6832
+ };
6833
+ quantity: string;
6834
+ stripePriceId: string;
6835
+ stripeProductId: string;
6836
+ subscriptionItemId: string;
6837
+ }, {
6838
+ lineId: import("convex/values").VString<string, "required">;
6839
+ stripePriceId: import("convex/values").VString<string, "required">;
6840
+ stripeProductId: import("convex/values").VString<string, "required">;
6841
+ subscriptionItemId: import("convex/values").VString<string, "required">;
6842
+ period: import("convex/values").VObject<{
6843
+ end: number;
6844
+ start: number;
6845
+ }, {
6846
+ start: import("convex/values").VFloat64<number, "required">;
6847
+ end: import("convex/values").VFloat64<number, "required">;
6848
+ }, "required", "end" | "start">;
6849
+ amount: import("convex/values").VFloat64<number, "required">;
6850
+ quantity: import("convex/values").VString<string, "required">;
6851
+ kind: import("convex/values").VUnion<"fixed" | "metered", [import("convex/values").VLiteral<"fixed", "required">, import("convex/values").VLiteral<"metered", "required">], "required", never>;
6852
+ }, "required", "amount" | "kind" | "lineId" | "period" | "period.end" | "period.start" | "quantity" | "stripePriceId" | "stripeProductId" | "subscriptionItemId">, "optional">;
6445
6853
  stripeAccountId: import("convex/values").VString<string, "required">;
6446
6854
  customerAccount: import("convex/values").VString<string, "required">;
6447
6855
  livemode: import("convex/values").VBoolean<boolean, "required">;
@@ -6459,7 +6867,7 @@ export declare function historical(currency?: string): Promise<{
6459
6867
  end: import("convex/values").VFloat64<number, "required">;
6460
6868
  }, "required", "end" | "start">;
6461
6869
  model: import("convex/values").VUnion<"included_overage" | "pay_as_you_go", [import("convex/values").VLiteral<"pay_as_you_go", "required">, import("convex/values").VLiteral<"included_overage", "required">], "required", never>;
6462
- }, "optional", "customerAccount" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
6870
+ }, "optional", "customerAccount" | "invoiceLines" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
6463
6871
  creditSource: import("convex/values").VObject<{
6464
6872
  creditGrantId: string;
6465
6873
  customerAccount: string;
@@ -6496,10 +6904,10 @@ export declare function historical(currency?: string): Promise<{
6496
6904
  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>;
6497
6905
  amount: import("convex/values").VFloat64<number, "required">;
6498
6906
  }, "required", "amount" | "destinationAccountId" | "role">, "required">;
6499
- }, "optional", "adjustmentAmount" | "creditSource" | "creditSource.creditGrantId" | "creditSource.customerAccount" | "creditSource.livemode" | "creditSource.purchaseId" | "creditSource.stripeAccountId" | "creditSource.stripePriceId" | "creditSource.stripeProductId" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "policyContext" | "policyContext.fields" | "policyContext.namespace" | "policyContext.version" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers" | "usageSource" | "usageSource.customerAccount" | "usageSource.invoicePaymentId" | "usageSource.livemode" | "usageSource.meterId" | "usageSource.model" | "usageSource.period" | "usageSource.period.end" | "usageSource.period.start" | "usageSource.stripeAccountId" | "usageSource.stripePriceId" | "usageSource.stripeProductId" | "usageSource.subscriptionId" | "usageSource.subscriptionItemId" | `policyContext.fields.${string}`>;
6500
- }, "required", "accountId" | "allocation" | "allocation.adjustmentAmount" | "allocation.creditSource" | "allocation.creditSource.creditGrantId" | "allocation.creditSource.customerAccount" | "allocation.creditSource.livemode" | "allocation.creditSource.purchaseId" | "allocation.creditSource.stripeAccountId" | "allocation.creditSource.stripePriceId" | "allocation.creditSource.stripeProductId" | "allocation.currency" | "allocation.gross" | "allocation.paymentId" | "allocation.paymentIntentId" | "allocation.platformNet" | "allocation.policyContext" | "allocation.policyContext.fields" | "allocation.policyContext.namespace" | "allocation.policyContext.version" | "allocation.processingFee" | "allocation.sourceChargeId" | "allocation.sourceInvoiceId" | "allocation.transfers" | "allocation.usageSource" | "allocation.usageSource.customerAccount" | "allocation.usageSource.invoicePaymentId" | "allocation.usageSource.livemode" | "allocation.usageSource.meterId" | "allocation.usageSource.model" | "allocation.usageSource.period" | "allocation.usageSource.period.end" | "allocation.usageSource.period.start" | "allocation.usageSource.stripeAccountId" | "allocation.usageSource.stripePriceId" | "allocation.usageSource.stripeProductId" | "allocation.usageSource.subscriptionId" | "allocation.usageSource.subscriptionItemId" | "completion" | "currency" | "definitionVersion" | "groupKey" | "maxAttempts" | "provider" | "providerApiVersion" | "releaseUncollectible" | "retryDelayMs" | "scopeKey" | `allocation.policyContext.fields.${string}`>;
6907
+ }, "optional", "adjustmentAmount" | "creditSource" | "creditSource.creditGrantId" | "creditSource.customerAccount" | "creditSource.livemode" | "creditSource.purchaseId" | "creditSource.stripeAccountId" | "creditSource.stripePriceId" | "creditSource.stripeProductId" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "policyContext" | "policyContext.fields" | "policyContext.namespace" | "policyContext.version" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers" | "usageSource" | "usageSource.customerAccount" | "usageSource.invoiceLines" | "usageSource.invoicePaymentId" | "usageSource.livemode" | "usageSource.meterId" | "usageSource.model" | "usageSource.period" | "usageSource.period.end" | "usageSource.period.start" | "usageSource.stripeAccountId" | "usageSource.stripePriceId" | "usageSource.stripeProductId" | "usageSource.subscriptionId" | "usageSource.subscriptionItemId" | `policyContext.fields.${string}`>;
6908
+ }, "required", "accountId" | "allocation" | "allocation.adjustmentAmount" | "allocation.creditSource" | "allocation.creditSource.creditGrantId" | "allocation.creditSource.customerAccount" | "allocation.creditSource.livemode" | "allocation.creditSource.purchaseId" | "allocation.creditSource.stripeAccountId" | "allocation.creditSource.stripePriceId" | "allocation.creditSource.stripeProductId" | "allocation.currency" | "allocation.gross" | "allocation.paymentId" | "allocation.paymentIntentId" | "allocation.platformNet" | "allocation.policyContext" | "allocation.policyContext.fields" | "allocation.policyContext.namespace" | "allocation.policyContext.version" | "allocation.processingFee" | "allocation.sourceChargeId" | "allocation.sourceInvoiceId" | "allocation.transfers" | "allocation.usageSource" | "allocation.usageSource.customerAccount" | "allocation.usageSource.invoiceLines" | "allocation.usageSource.invoicePaymentId" | "allocation.usageSource.livemode" | "allocation.usageSource.meterId" | "allocation.usageSource.model" | "allocation.usageSource.period" | "allocation.usageSource.period.end" | "allocation.usageSource.period.start" | "allocation.usageSource.stripeAccountId" | "allocation.usageSource.stripePriceId" | "allocation.usageSource.stripeProductId" | "allocation.usageSource.subscriptionId" | "allocation.usageSource.subscriptionItemId" | "completion" | "currency" | "definitionVersion" | "groupKey" | "maxAttempts" | "provider" | "providerApiVersion" | "releaseUncollectible" | "retryDelayMs" | "scopeKey" | `allocation.policyContext.fields.${string}`>;
6501
6909
  operationId: import("convex/values").VId<import("convex/values").GenericId<"recoveryWorkflowOperations">, "required">;
6502
- }, "required", "binding" | "binding.accountId" | "binding.allocation" | "binding.allocation.adjustmentAmount" | "binding.allocation.creditSource" | "binding.allocation.creditSource.creditGrantId" | "binding.allocation.creditSource.customerAccount" | "binding.allocation.creditSource.livemode" | "binding.allocation.creditSource.purchaseId" | "binding.allocation.creditSource.stripeAccountId" | "binding.allocation.creditSource.stripePriceId" | "binding.allocation.creditSource.stripeProductId" | "binding.allocation.currency" | "binding.allocation.gross" | "binding.allocation.paymentId" | "binding.allocation.paymentIntentId" | "binding.allocation.platformNet" | "binding.allocation.policyContext" | "binding.allocation.policyContext.fields" | "binding.allocation.policyContext.namespace" | "binding.allocation.policyContext.version" | "binding.allocation.processingFee" | "binding.allocation.sourceChargeId" | "binding.allocation.sourceInvoiceId" | "binding.allocation.transfers" | "binding.allocation.usageSource" | "binding.allocation.usageSource.customerAccount" | "binding.allocation.usageSource.invoicePaymentId" | "binding.allocation.usageSource.livemode" | "binding.allocation.usageSource.meterId" | "binding.allocation.usageSource.model" | "binding.allocation.usageSource.period" | "binding.allocation.usageSource.period.end" | "binding.allocation.usageSource.period.start" | "binding.allocation.usageSource.stripeAccountId" | "binding.allocation.usageSource.stripePriceId" | "binding.allocation.usageSource.stripeProductId" | "binding.allocation.usageSource.subscriptionId" | "binding.allocation.usageSource.subscriptionItemId" | "binding.completion" | "binding.currency" | "binding.definitionVersion" | "binding.groupKey" | "binding.maxAttempts" | "binding.provider" | "binding.providerApiVersion" | "binding.releaseUncollectible" | "binding.retryDelayMs" | "binding.scopeKey" | "operationId" | "requestKey" | `binding.allocation.policyContext.fields.${string}`>, {
6910
+ }, "required", "binding" | "binding.accountId" | "binding.allocation" | "binding.allocation.adjustmentAmount" | "binding.allocation.creditSource" | "binding.allocation.creditSource.creditGrantId" | "binding.allocation.creditSource.customerAccount" | "binding.allocation.creditSource.livemode" | "binding.allocation.creditSource.purchaseId" | "binding.allocation.creditSource.stripeAccountId" | "binding.allocation.creditSource.stripePriceId" | "binding.allocation.creditSource.stripeProductId" | "binding.allocation.currency" | "binding.allocation.gross" | "binding.allocation.paymentId" | "binding.allocation.paymentIntentId" | "binding.allocation.platformNet" | "binding.allocation.policyContext" | "binding.allocation.policyContext.fields" | "binding.allocation.policyContext.namespace" | "binding.allocation.policyContext.version" | "binding.allocation.processingFee" | "binding.allocation.sourceChargeId" | "binding.allocation.sourceInvoiceId" | "binding.allocation.transfers" | "binding.allocation.usageSource" | "binding.allocation.usageSource.customerAccount" | "binding.allocation.usageSource.invoiceLines" | "binding.allocation.usageSource.invoicePaymentId" | "binding.allocation.usageSource.livemode" | "binding.allocation.usageSource.meterId" | "binding.allocation.usageSource.model" | "binding.allocation.usageSource.period" | "binding.allocation.usageSource.period.end" | "binding.allocation.usageSource.period.start" | "binding.allocation.usageSource.stripeAccountId" | "binding.allocation.usageSource.stripePriceId" | "binding.allocation.usageSource.stripeProductId" | "binding.allocation.usageSource.subscriptionId" | "binding.allocation.usageSource.subscriptionItemId" | "binding.completion" | "binding.currency" | "binding.definitionVersion" | "binding.groupKey" | "binding.maxAttempts" | "binding.provider" | "binding.providerApiVersion" | "binding.releaseUncollectible" | "binding.retryDelayMs" | "binding.scopeKey" | "operationId" | "requestKey" | `binding.allocation.policyContext.fields.${string}`>, {
6503
6911
  by_key: ["requestKey", "_creationTime"];
6504
6912
  }, {}, {}>;
6505
6913
  balanceFundingPreparations: import("convex/server").TableDefinition<import("convex/values").VObject<{
@@ -6807,14 +7215,6 @@ export declare function historical(currency?: string): Promise<{
6807
7215
  preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
6808
7216
  requestKey: string;
6809
7217
  result?: {
6810
- reason: "identity_changed" | "revision_changed" | "scope_busy";
6811
- retryable: false;
6812
- status: "conflict";
6813
- } | {
6814
- reason: "policy_invalid";
6815
- retryable: false;
6816
- status: "rejected";
6817
- } | {
6818
7218
  operation: {
6819
7219
  accountId: string;
6820
7220
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -6825,6 +7225,14 @@ export declare function historical(currency?: string): Promise<{
6825
7225
  } | {
6826
7226
  enabled: boolean;
6827
7227
  status: "unchanged";
7228
+ } | {
7229
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
7230
+ retryable: false;
7231
+ status: "conflict";
7232
+ } | {
7233
+ reason: "policy_invalid";
7234
+ retryable: false;
7235
+ status: "rejected";
6828
7236
  } | {
6829
7237
  reason: "provider_pending";
6830
7238
  retryable: true;
@@ -6835,14 +7243,6 @@ export declare function historical(currency?: string): Promise<{
6835
7243
  payload: import("convex/values").VString<string, "required">;
6836
7244
  preparationId: import("convex/values").VId<import("convex/values").GenericId<"balanceFundingPreparations">, "required">;
6837
7245
  result: import("convex/values").VUnion<{
6838
- reason: "identity_changed" | "revision_changed" | "scope_busy";
6839
- retryable: false;
6840
- status: "conflict";
6841
- } | {
6842
- reason: "policy_invalid";
6843
- retryable: false;
6844
- status: "rejected";
6845
- } | {
6846
7246
  operation: {
6847
7247
  accountId: string;
6848
7248
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -6853,6 +7253,14 @@ export declare function historical(currency?: string): Promise<{
6853
7253
  } | {
6854
7254
  enabled: boolean;
6855
7255
  status: "unchanged";
7256
+ } | {
7257
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
7258
+ retryable: false;
7259
+ status: "conflict";
7260
+ } | {
7261
+ reason: "policy_invalid";
7262
+ retryable: false;
7263
+ status: "rejected";
6856
7264
  } | {
6857
7265
  reason: "provider_pending";
6858
7266
  retryable: true;
@@ -8327,6 +8735,19 @@ export declare function historical(currency?: string): Promise<{
8327
8735
  }[];
8328
8736
  usageSource?: {
8329
8737
  customerAccount: string;
8738
+ invoiceLines?: {
8739
+ amount: number;
8740
+ kind: "fixed" | "metered";
8741
+ lineId: string;
8742
+ period: {
8743
+ end: number;
8744
+ start: number;
8745
+ };
8746
+ quantity: string;
8747
+ stripePriceId: string;
8748
+ stripeProductId: string;
8749
+ subscriptionItemId: string;
8750
+ }[] | undefined;
8330
8751
  invoicePaymentId: string;
8331
8752
  livemode: boolean;
8332
8753
  meterId: string;
@@ -8356,6 +8777,19 @@ export declare function historical(currency?: string): Promise<{
8356
8777
  sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
8357
8778
  usageSource: import("convex/values").VObject<{
8358
8779
  customerAccount: string;
8780
+ invoiceLines?: {
8781
+ amount: number;
8782
+ kind: "fixed" | "metered";
8783
+ lineId: string;
8784
+ period: {
8785
+ end: number;
8786
+ start: number;
8787
+ };
8788
+ quantity: string;
8789
+ stripePriceId: string;
8790
+ stripeProductId: string;
8791
+ subscriptionItemId: string;
8792
+ }[] | undefined;
8359
8793
  invoicePaymentId: string;
8360
8794
  livemode: boolean;
8361
8795
  meterId: string;
@@ -8370,6 +8804,46 @@ export declare function historical(currency?: string): Promise<{
8370
8804
  subscriptionId: string;
8371
8805
  subscriptionItemId: string;
8372
8806
  } | undefined, {
8807
+ invoiceLines: import("convex/values").VArray<{
8808
+ amount: number;
8809
+ kind: "fixed" | "metered";
8810
+ lineId: string;
8811
+ period: {
8812
+ end: number;
8813
+ start: number;
8814
+ };
8815
+ quantity: string;
8816
+ stripePriceId: string;
8817
+ stripeProductId: string;
8818
+ subscriptionItemId: string;
8819
+ }[] | undefined, import("convex/values").VObject<{
8820
+ amount: number;
8821
+ kind: "fixed" | "metered";
8822
+ lineId: string;
8823
+ period: {
8824
+ end: number;
8825
+ start: number;
8826
+ };
8827
+ quantity: string;
8828
+ stripePriceId: string;
8829
+ stripeProductId: string;
8830
+ subscriptionItemId: string;
8831
+ }, {
8832
+ lineId: import("convex/values").VString<string, "required">;
8833
+ stripePriceId: import("convex/values").VString<string, "required">;
8834
+ stripeProductId: import("convex/values").VString<string, "required">;
8835
+ subscriptionItemId: import("convex/values").VString<string, "required">;
8836
+ period: import("convex/values").VObject<{
8837
+ end: number;
8838
+ start: number;
8839
+ }, {
8840
+ start: import("convex/values").VFloat64<number, "required">;
8841
+ end: import("convex/values").VFloat64<number, "required">;
8842
+ }, "required", "end" | "start">;
8843
+ amount: import("convex/values").VFloat64<number, "required">;
8844
+ quantity: import("convex/values").VString<string, "required">;
8845
+ kind: import("convex/values").VUnion<"fixed" | "metered", [import("convex/values").VLiteral<"fixed", "required">, import("convex/values").VLiteral<"metered", "required">], "required", never>;
8846
+ }, "required", "amount" | "kind" | "lineId" | "period" | "period.end" | "period.start" | "quantity" | "stripePriceId" | "stripeProductId" | "subscriptionItemId">, "optional">;
8373
8847
  stripeAccountId: import("convex/values").VString<string, "required">;
8374
8848
  customerAccount: import("convex/values").VString<string, "required">;
8375
8849
  livemode: import("convex/values").VBoolean<boolean, "required">;
@@ -8387,7 +8861,7 @@ export declare function historical(currency?: string): Promise<{
8387
8861
  end: import("convex/values").VFloat64<number, "required">;
8388
8862
  }, "required", "end" | "start">;
8389
8863
  model: import("convex/values").VUnion<"included_overage" | "pay_as_you_go", [import("convex/values").VLiteral<"pay_as_you_go", "required">, import("convex/values").VLiteral<"included_overage", "required">], "required", never>;
8390
- }, "optional", "customerAccount" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
8864
+ }, "optional", "customerAccount" | "invoiceLines" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
8391
8865
  creditSource: import("convex/values").VObject<{
8392
8866
  creditGrantId: string;
8393
8867
  customerAccount: string;
@@ -8424,7 +8898,7 @@ export declare function historical(currency?: string): Promise<{
8424
8898
  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>;
8425
8899
  amount: import("convex/values").VFloat64<number, "required">;
8426
8900
  }, "required", "amount" | "destinationAccountId" | "role">, "required">;
8427
- }, "required", "adjustmentAmount" | "creditSource" | "creditSource.creditGrantId" | "creditSource.customerAccount" | "creditSource.livemode" | "creditSource.purchaseId" | "creditSource.stripeAccountId" | "creditSource.stripePriceId" | "creditSource.stripeProductId" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "policyContext" | "policyContext.fields" | "policyContext.namespace" | "policyContext.version" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers" | "usageSource" | "usageSource.customerAccount" | "usageSource.invoicePaymentId" | "usageSource.livemode" | "usageSource.meterId" | "usageSource.model" | "usageSource.period" | "usageSource.period.end" | "usageSource.period.start" | "usageSource.stripeAccountId" | "usageSource.stripePriceId" | "usageSource.stripeProductId" | "usageSource.subscriptionId" | "usageSource.subscriptionItemId" | `policyContext.fields.${string}`>, {
8901
+ }, "required", "adjustmentAmount" | "creditSource" | "creditSource.creditGrantId" | "creditSource.customerAccount" | "creditSource.livemode" | "creditSource.purchaseId" | "creditSource.stripeAccountId" | "creditSource.stripePriceId" | "creditSource.stripeProductId" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "policyContext" | "policyContext.fields" | "policyContext.namespace" | "policyContext.version" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers" | "usageSource" | "usageSource.customerAccount" | "usageSource.invoiceLines" | "usageSource.invoicePaymentId" | "usageSource.livemode" | "usageSource.meterId" | "usageSource.model" | "usageSource.period" | "usageSource.period.end" | "usageSource.period.start" | "usageSource.stripeAccountId" | "usageSource.stripePriceId" | "usageSource.stripeProductId" | "usageSource.subscriptionId" | "usageSource.subscriptionItemId" | `policyContext.fields.${string}`>, {
8428
8902
  by_source_charge: ["sourceChargeId", "_creationTime"];
8429
8903
  }, {}, {}>;
8430
8904
  commissionTerms: import("convex/server").TableDefinition<import("convex/values").VObject<{