@fantastic.dev/better-stripe 0.42.0 → 0.44.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 (127) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +11 -4
  3. package/dist/client/connect/payoutAdoptionTestHelpers.d.ts +1022 -0
  4. package/dist/client/connect/payoutAdoptionTestHelpers.d.ts.map +1 -1
  5. package/dist/client/connect/payoutExecutionTestHelpers.d.ts +511 -0
  6. package/dist/client/connect/payoutExecutionTestHelpers.d.ts.map +1 -1
  7. package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts +1054 -32
  8. package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts.map +1 -1
  9. package/dist/client/connect/payoutSyncTestHelpers.d.ts +527 -16
  10. package/dist/client/connect/payoutSyncTestHelpers.d.ts.map +1 -1
  11. package/dist/client/costRecovery-invoices.d.ts +3 -2
  12. package/dist/client/costRecovery-invoices.d.ts.map +1 -1
  13. package/dist/client/costRecovery-invoices.js +10 -5
  14. package/dist/client/costRecovery-invoices.js.map +1 -1
  15. package/dist/client/costRecovery.d.ts +4 -2
  16. package/dist/client/costRecovery.d.ts.map +1 -1
  17. package/dist/client/costRecovery.js +2 -2
  18. package/dist/client/costRecovery.js.map +1 -1
  19. package/dist/client/processingCostReconciliation/client.d.ts +14 -0
  20. package/dist/client/processingCostReconciliation/client.d.ts.map +1 -0
  21. package/dist/client/processingCostReconciliation/client.js +35 -0
  22. package/dist/client/processingCostReconciliation/client.js.map +1 -0
  23. package/dist/client/processingCostReconciliation/contracts.d.ts +172 -0
  24. package/dist/client/processingCostReconciliation/contracts.d.ts.map +1 -0
  25. package/dist/client/processingCostReconciliation/contracts.js +55 -0
  26. package/dist/client/processingCostReconciliation/contracts.js.map +1 -0
  27. package/dist/client/processingCostReconciliation/invoiceFunding.d.ts +15 -0
  28. package/dist/client/processingCostReconciliation/invoiceFunding.d.ts.map +1 -0
  29. package/dist/client/processingCostReconciliation/invoiceFunding.js +195 -0
  30. package/dist/client/processingCostReconciliation/invoiceFunding.js.map +1 -0
  31. package/dist/client/processingCostReconciliation/provider.d.ts +9 -0
  32. package/dist/client/processingCostReconciliation/provider.d.ts.map +1 -0
  33. package/dist/client/processingCostReconciliation/provider.js +148 -0
  34. package/dist/client/processingCostReconciliation/provider.js.map +1 -0
  35. package/dist/client/settlement/processingCostHistory.d.ts +12 -0
  36. package/dist/client/settlement/processingCostHistory.d.ts.map +1 -0
  37. package/dist/client/settlement/processingCostHistory.js +20 -0
  38. package/dist/client/settlement/processingCostHistory.js.map +1 -0
  39. package/dist/client/settlement/processingCosts.d.ts +3 -0
  40. package/dist/client/settlement/processingCosts.d.ts.map +1 -1
  41. package/dist/client/settlement/processingCosts.js +27 -7
  42. package/dist/client/settlement/processingCosts.js.map +1 -1
  43. package/dist/component/_generated/api.d.ts +18 -0
  44. package/dist/component/_generated/api.d.ts.map +1 -1
  45. package/dist/component/_generated/api.js.map +1 -1
  46. package/dist/component/_generated/component.d.ts +515 -0
  47. package/dist/component/_generated/component.d.ts.map +1 -1
  48. package/dist/component/balanceFunding/internal/actions.d.ts +11 -11
  49. package/dist/component/balanceFunding/mutations.d.ts +16 -16
  50. package/dist/component/balanceFunding/stateHandlers.d.ts +8 -8
  51. package/dist/component/balanceFunding/workflowValidators.d.ts +16 -16
  52. package/dist/component/earnings/triggers.d.ts +318 -16
  53. package/dist/component/earnings/triggers.d.ts.map +1 -1
  54. package/dist/component/payoutRelease/queries.d.ts +2 -2
  55. package/dist/component/payoutRelease/queries.d.ts.map +1 -1
  56. package/dist/component/processingCostReconciliation/adoption.d.ts +29 -0
  57. package/dist/component/processingCostReconciliation/adoption.d.ts.map +1 -0
  58. package/dist/component/processingCostReconciliation/adoption.js +58 -0
  59. package/dist/component/processingCostReconciliation/adoption.js.map +1 -0
  60. package/dist/component/processingCostReconciliation/bridge.d.ts +45 -0
  61. package/dist/component/processingCostReconciliation/bridge.d.ts.map +1 -0
  62. package/dist/component/processingCostReconciliation/bridge.js +41 -0
  63. package/dist/component/processingCostReconciliation/bridge.js.map +1 -0
  64. package/dist/component/processingCostReconciliation/helpers.d.ts +327 -0
  65. package/dist/component/processingCostReconciliation/helpers.d.ts.map +1 -0
  66. package/dist/component/processingCostReconciliation/helpers.js +39 -0
  67. package/dist/component/processingCostReconciliation/helpers.js.map +1 -0
  68. package/dist/component/processingCostReconciliation/mutations.d.ts +303 -0
  69. package/dist/component/processingCostReconciliation/mutations.d.ts.map +1 -0
  70. package/dist/component/processingCostReconciliation/mutations.js +121 -0
  71. package/dist/component/processingCostReconciliation/mutations.js.map +1 -0
  72. package/dist/component/processingCostReconciliation/queries.d.ts +422 -0
  73. package/dist/component/processingCostReconciliation/queries.d.ts.map +1 -0
  74. package/dist/component/processingCostReconciliation/queries.js +19 -0
  75. package/dist/component/processingCostReconciliation/queries.js.map +1 -0
  76. package/dist/component/processingCostReconciliation/rollback.d.ts +21 -0
  77. package/dist/component/processingCostReconciliation/rollback.d.ts.map +1 -0
  78. package/dist/component/processingCostReconciliation/rollback.js +54 -0
  79. package/dist/component/processingCostReconciliation/rollback.js.map +1 -0
  80. package/dist/component/processingCostReconciliation/schema.d.ts +2460 -0
  81. package/dist/component/processingCostReconciliation/schema.d.ts.map +1 -0
  82. package/dist/component/processingCostReconciliation/schema.js +137 -0
  83. package/dist/component/processingCostReconciliation/schema.js.map +1 -0
  84. package/dist/component/processingCostReconciliation/steps.d.ts +306 -0
  85. package/dist/component/processingCostReconciliation/steps.d.ts.map +1 -0
  86. package/dist/component/processingCostReconciliation/steps.js +149 -0
  87. package/dist/component/processingCostReconciliation/steps.js.map +1 -0
  88. package/dist/component/processingCostReconciliation/validation.d.ts +13 -0
  89. package/dist/component/processingCostReconciliation/validation.d.ts.map +1 -0
  90. package/dist/component/processingCostReconciliation/validation.js +61 -0
  91. package/dist/component/processingCostReconciliation/validation.js.map +1 -0
  92. package/dist/component/processingCostReconciliation/workflow.d.ts +105 -0
  93. package/dist/component/processingCostReconciliation/workflow.d.ts.map +1 -0
  94. package/dist/component/processingCostReconciliation/workflow.js +33 -0
  95. package/dist/component/processingCostReconciliation/workflow.js.map +1 -0
  96. package/dist/component/schema.d.ts +511 -0
  97. package/dist/component/schema.js +2 -0
  98. package/dist/component/schema.js.map +1 -1
  99. package/docs/react-workflows.md +16 -8
  100. package/package.json +1 -1
  101. package/src/client/costRecovery-invoices.ts +19 -4
  102. package/src/client/costRecovery.ts +4 -2
  103. package/src/client/processingCostReconciliation/client.ts +75 -0
  104. package/src/client/processingCostReconciliation/contracts.ts +176 -0
  105. package/src/client/processingCostReconciliation/invoiceFunding.ts +270 -0
  106. package/src/client/processingCostReconciliation/invoiceProvider.test.ts +353 -0
  107. package/src/client/processingCostReconciliation/provider.test.ts +324 -0
  108. package/src/client/processingCostReconciliation/provider.ts +178 -0
  109. package/src/client/settlement/processingCostHistory.ts +31 -0
  110. package/src/client/settlement/processingCosts.ts +50 -15
  111. package/src/component/_generated/api.ts +18 -0
  112. package/src/component/_generated/component.ts +570 -0
  113. package/src/component/processingCostReconciliation/adoption.test.ts +206 -0
  114. package/src/component/processingCostReconciliation/adoption.ts +77 -0
  115. package/src/component/processingCostReconciliation/bridge.ts +50 -0
  116. package/src/component/processingCostReconciliation/helpers.ts +55 -0
  117. package/src/component/processingCostReconciliation/invoice.test.ts +152 -0
  118. package/src/component/processingCostReconciliation/mutations.ts +148 -0
  119. package/src/component/processingCostReconciliation/queries.ts +18 -0
  120. package/src/component/processingCostReconciliation/rollback.ts +72 -0
  121. package/src/component/processingCostReconciliation/schema.ts +191 -0
  122. package/src/component/processingCostReconciliation/state.test.ts +407 -0
  123. package/src/component/processingCostReconciliation/steps.ts +168 -0
  124. package/src/component/processingCostReconciliation/validation.ts +79 -0
  125. package/src/component/processingCostReconciliation/workflow.test.ts +329 -0
  126. package/src/component/processingCostReconciliation/workflow.ts +50 -0
  127. package/src/component/schema.ts +2 -0
package/CHANGELOG.md CHANGED
@@ -26,6 +26,37 @@
26
26
  - Remove internal tracker references from public documentation and add a
27
27
  regression check that prevents their reintroduction.
28
28
 
29
+ ## [0.44.0](https://github.com/FantasticDevHQ/better-stripe/compare/v0.43.0...v0.44.0) (2026-10-17)
30
+
31
+ ### Features
32
+
33
+ - migrate example balance funding to component workflows ([68f6cb4](https://github.com/FantasticDevHQ/better-stripe/commit/68f6cb471c07b79ca8f0dba6d2d160fd250baf32))
34
+ - move example balance funding into component workflows ([93ac5ce](https://github.com/FantasticDevHQ/better-stripe/commit/93ac5ce036120e42c0dd3b1cb23295965b7da98d))
35
+
36
+ ### Bug Fixes
37
+
38
+ - fence legacy workers and recover abandoned funding observers ([eaa8c2c](https://github.com/FantasticDevHQ/better-stripe/commit/eaa8c2c214d73f5ee49d76df8b005a2293d02f85))
39
+
40
+ ### Tests
41
+
42
+ - ratchet balance funding adapter coverage floors ([5cce0eb](https://github.com/FantasticDevHQ/better-stripe/commit/5cce0ebd5114f39c4a17a5f1284d42876304f510))
43
+ - ratchet funding migration recovery coverage floors ([1a1bec5](https://github.com/FantasticDevHQ/better-stripe/commit/1a1bec5215786812734cfe4be0e8027f793c5cb3))
44
+
45
+ ## [0.43.0](https://github.com/FantasticDevHQ/better-stripe/compare/v0.42.0...v0.43.0) (2026-10-17)
46
+
47
+ ### Features
48
+
49
+ - add guarded processing-cost reconciliation workflow ([79f2741](https://github.com/FantasticDevHQ/better-stripe/commit/79f27416e8cdf13d18c4afe4a90a07f9ba7b4ced))
50
+ - reconcile processing-cost claims with guarded workflow ([96f1fd1](https://github.com/FantasticDevHQ/better-stripe/commit/96f1fd1e93bba08a5182acb1c453e5ea5621fcbd))
51
+
52
+ ### Bug Fixes
53
+
54
+ - bind bounded processing transactions to original cost sources ([4165f5a](https://github.com/FantasticDevHQ/better-stripe/commit/4165f5af3af550d43c5575652c2a2b162da74748))
55
+
56
+ ### Tests
57
+
58
+ - ratchet processing-cost reconciliation coverage floors ([d462d9a](https://github.com/FantasticDevHQ/better-stripe/commit/d462d9ad9ee623de2f3460a0979435448ebbab85))
59
+
29
60
  ## [0.42.0](https://github.com/FantasticDevHQ/better-stripe/compare/v0.41.0...v0.42.0) (2026-10-17)
30
61
 
31
62
  ### Features
package/README.md CHANGED
@@ -70,7 +70,7 @@ claim execution are completed.
70
70
 
71
71
  ## Status
72
72
 
73
- **Version**: `0.42.0` <!-- x-release-please-version --> (pre-1.0). API may change between minor versions until 1.0.
73
+ **Version**: `0.44.0` <!-- x-release-please-version --> (pre-1.0). API may change between minor versions until 1.0.
74
74
 
75
75
  Used in production by its authors. Webhook pipeline is covered by unit tests and a live E2E harness (`npm run e2e:webhooks`) that fires real Stripe-signed events and asserts the ledger.
76
76
 
@@ -694,10 +694,17 @@ changes cause an error instead of being overwritten. Provider errors are
694
694
  preserved. Never accept restoration records or account IDs from an unauthenticated
695
695
  browser as authority.
696
696
 
697
- Serialize changes per subscription in the host. Persist the operation identity
697
+ The example now uses component-owned
698
+ [`balanceFundingWorkflow`](docs/balance-funding-workflow.md) for preparation,
699
+ apply, receipts and reconciliation. Its host adapter keeps consent and request
700
+ references; it no longer writes a second financial operation ledger. Existing
701
+ example installations should follow the
702
+ [cutover runbook](docs/example-balance-funding-cutover.md) before retiring legacy
703
+ records. The stateless methods above remain supported.
704
+
705
+ When using those stateless methods, serialize changes per subscription in the host. Persist the operation identity
698
706
  before the provider call, reuse it after a timeout or host write failure, and use
699
- a new identity for each later enable/disable cycle. The example's durable pending
700
- operation prevents an opposite change from racing an unfinished operation; retry
707
+ a new identity for each later enable/disable cycle. An unfinished operation must prevent an opposite change from racing it; retry
701
708
  the pending change first. Preserve the preparation through retries. Keys must be
702
709
  nonempty, contain no line breaks, and be at most 247 characters because the package
703
710
  adds phase suffixes. Stripe's idempotency retention window still applies.