@fantastic.dev/better-stripe 0.113.0 → 0.119.2

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 (1144) hide show
  1. package/CHANGELOG.md +94 -0
  2. package/MIGRATION.md +50 -4
  3. package/README.md +69 -2
  4. package/dist/client/billing/renewalAggregate/phases.d.ts.map +1 -1
  5. package/dist/client/billing/renewalAggregate/phases.js +27 -13
  6. package/dist/client/billing/renewalAggregate/phases.js.map +1 -1
  7. package/dist/client/billing/renewalAggregate/preflight.d.ts +1 -0
  8. package/dist/client/billing/renewalAggregate/preflight.d.ts.map +1 -1
  9. package/dist/client/billing/renewalAggregate/readMaterial.d.ts +2 -1
  10. package/dist/client/billing/renewalAggregate/readMaterial.d.ts.map +1 -1
  11. package/dist/client/billing/renewalAggregate/readMaterial.js +28 -5
  12. package/dist/client/billing/renewalAggregate/readMaterial.js.map +1 -1
  13. package/dist/client/billing/renewalAggregate/sourceDiscounts.d.ts +1 -1
  14. package/dist/client/billing/renewalAggregate/sourceDiscounts.d.ts.map +1 -1
  15. package/dist/client/billing/renewalAggregate/sourceDiscounts.js +2 -2
  16. package/dist/client/billing/renewalAggregate/sourceDiscounts.js.map +1 -1
  17. package/dist/client/billing/renewalAttach/attachmentProfile.d.ts +13 -0
  18. package/dist/client/billing/renewalAttach/attachmentProfile.d.ts.map +1 -0
  19. package/dist/client/billing/renewalAttach/attachmentProfile.js +15 -0
  20. package/dist/client/billing/renewalAttach/attachmentProfile.js.map +1 -0
  21. package/dist/client/billing/renewalAttach/internal/c10/eventCapture.js +1 -1
  22. package/dist/client/billing/renewalAttach/internal/c10/eventCapture.js.map +1 -1
  23. package/dist/client/billing/renewalAttach/internal/material/classifiers.d.ts +1 -1
  24. package/dist/client/billing/renewalAttach/internal/material/classifiers.d.ts.map +1 -1
  25. package/dist/client/billing/renewalAttach/internal/material/classifiers.js +11 -10
  26. package/dist/client/billing/renewalAttach/internal/material/classifiers.js.map +1 -1
  27. package/dist/client/billing/renewalAttach/internal/material/readMaterial.d.ts +1 -1
  28. package/dist/client/billing/renewalAttach/internal/material/readMaterial.d.ts.map +1 -1
  29. package/dist/client/billing/renewalAttach/internal/material/readMaterial.js +20 -5
  30. package/dist/client/billing/renewalAttach/internal/material/readMaterial.js.map +1 -1
  31. package/dist/client/billing/renewalAttach/internal/operations/configureReadTransport.d.ts.map +1 -1
  32. package/dist/client/billing/renewalAttach/internal/operations/configureReadTransport.js +7 -7
  33. package/dist/client/billing/renewalAttach/internal/operations/configureReadTransport.js.map +1 -1
  34. package/dist/client/billing/renewalAttach/internal/operations/initialAttach.d.ts.map +1 -1
  35. package/dist/client/billing/renewalAttach/internal/operations/initialAttach.js +5 -3
  36. package/dist/client/billing/renewalAttach/internal/operations/initialAttach.js.map +1 -1
  37. package/dist/client/billing/renewalAttach/internal/preflight/grammar.js +1 -1
  38. package/dist/client/billing/renewalAttach/internal/preflight/grammar.js.map +1 -1
  39. package/dist/client/billing/renewalAttach/internal/producer/attachAcknowledgement.d.ts.map +1 -1
  40. package/dist/client/billing/renewalAttach/internal/producer/attachAcknowledgement.js +4 -4
  41. package/dist/client/billing/renewalAttach/internal/producer/attachAcknowledgement.js.map +1 -1
  42. package/dist/client/billing/renewalAttach/internal/producer/configureWriteFactory.d.ts.map +1 -1
  43. package/dist/client/billing/renewalAttach/internal/producer/configureWriteFactory.js +7 -6
  44. package/dist/client/billing/renewalAttach/internal/producer/configureWriteFactory.js.map +1 -1
  45. package/dist/client/billing/renewalAttach/internal/producer/invocationProducer.d.ts +3 -0
  46. package/dist/client/billing/renewalAttach/internal/producer/invocationProducer.d.ts.map +1 -1
  47. package/dist/client/billing/renewalAttach/internal/producer/invocationProducer.js +16 -1
  48. package/dist/client/billing/renewalAttach/internal/producer/invocationProducer.js.map +1 -1
  49. package/dist/client/billing/renewalAttach/internal/producer/nodeAttachmentProfile.d.ts +9 -0
  50. package/dist/client/billing/renewalAttach/internal/producer/nodeAttachmentProfile.d.ts.map +1 -0
  51. package/dist/client/billing/renewalAttach/internal/producer/nodeAttachmentProfile.js +83 -0
  52. package/dist/client/billing/renewalAttach/internal/producer/nodeAttachmentProfile.js.map +1 -0
  53. package/dist/client/billing/renewalAttach/liveAttachment.d.ts +12 -0
  54. package/dist/client/billing/renewalAttach/liveAttachment.d.ts.map +1 -0
  55. package/dist/client/billing/renewalAttach/liveAttachment.js +23 -0
  56. package/dist/client/billing/renewalAttach/liveAttachment.js.map +1 -0
  57. package/dist/client/billing/renewalAttach/nodeAttachment.d.ts +4 -0
  58. package/dist/client/billing/renewalAttach/nodeAttachment.d.ts.map +1 -0
  59. package/dist/client/billing/renewalAttach/nodeAttachment.js +154 -0
  60. package/dist/client/billing/renewalAttach/nodeAttachment.js.map +1 -0
  61. package/dist/client/billing/renewalAttach/nodeConfiguration.d.ts +3 -0
  62. package/dist/client/billing/renewalAttach/nodeConfiguration.d.ts.map +1 -0
  63. package/dist/client/billing/renewalAttach/nodeConfiguration.js +126 -0
  64. package/dist/client/billing/renewalAttach/nodeConfiguration.js.map +1 -0
  65. package/dist/client/billing/renewalV2/configureInput.d.ts +1 -0
  66. package/dist/client/billing/renewalV2/configureInput.d.ts.map +1 -1
  67. package/dist/client/billing/renewalV2/configureInput.js +2 -1
  68. package/dist/client/billing/renewalV2/configureInput.js.map +1 -1
  69. package/dist/client/billing/renewalV2/index.d.ts +3 -0
  70. package/dist/client/billing/renewalV2/index.d.ts.map +1 -1
  71. package/dist/client/billing/renewalV2/index.js +1 -1
  72. package/dist/client/billing/renewalV2/index.js.map +1 -1
  73. package/dist/client/billing/renewalV2/observationInput.d.ts +1 -0
  74. package/dist/client/billing/renewalV2/observationInput.d.ts.map +1 -1
  75. package/dist/client/index.d.ts +7 -14
  76. package/dist/client/index.d.ts.map +1 -1
  77. package/dist/client/index.js +10 -2
  78. package/dist/client/index.js.map +1 -1
  79. package/dist/client/node.d.ts +2 -0
  80. package/dist/client/node.d.ts.map +1 -0
  81. package/dist/client/node.js +9 -0
  82. package/dist/client/node.js.map +1 -0
  83. package/dist/client/renewal.d.ts +4 -0
  84. package/dist/client/renewal.d.ts.map +1 -1
  85. package/dist/client/renewal.js +2 -1
  86. package/dist/client/renewal.js.map +1 -1
  87. package/dist/client/renewalAttachmentPreparation.d.ts +23 -0
  88. package/dist/client/renewalAttachmentPreparation.d.ts.map +1 -0
  89. package/dist/client/renewalAttachmentPreparation.js +89 -0
  90. package/dist/client/renewalAttachmentPreparation.js.map +1 -0
  91. package/dist/client/renewalAttachmentRuntime.d.ts +6 -0
  92. package/dist/client/renewalAttachmentRuntime.d.ts.map +1 -0
  93. package/dist/client/renewalAttachmentRuntime.js +13 -0
  94. package/dist/client/renewalAttachmentRuntime.js.map +1 -0
  95. package/dist/client/renewalAttachmentTypes.d.ts +45 -0
  96. package/dist/client/renewalAttachmentTypes.d.ts.map +1 -0
  97. package/dist/client/renewalAttachmentTypes.js +2 -0
  98. package/dist/client/renewalAttachmentTypes.js.map +1 -0
  99. package/dist/client/renewalConfigurationPreparation.d.ts +27 -0
  100. package/dist/client/renewalConfigurationPreparation.d.ts.map +1 -0
  101. package/dist/client/renewalConfigurationPreparation.js +78 -0
  102. package/dist/client/renewalConfigurationPreparation.js.map +1 -0
  103. package/dist/client/renewalConfigurationRuntime.d.ts +6 -0
  104. package/dist/client/renewalConfigurationRuntime.d.ts.map +1 -0
  105. package/dist/client/renewalConfigurationRuntime.js +12 -0
  106. package/dist/client/renewalConfigurationRuntime.js.map +1 -0
  107. package/dist/client/renewalConfigurationTypes.d.ts +19 -0
  108. package/dist/client/renewalConfigurationTypes.d.ts.map +1 -0
  109. package/dist/client/renewalConfigurationTypes.js +2 -0
  110. package/dist/client/renewalConfigurationTypes.js.map +1 -0
  111. package/dist/client/renewalContextClient.d.ts +5 -0
  112. package/dist/client/renewalContextClient.d.ts.map +1 -1
  113. package/dist/client/renewalContextClient.js +9 -0
  114. package/dist/client/renewalContextClient.js.map +1 -1
  115. package/dist/client/types/documents.d.ts +2 -0
  116. package/dist/client/types/documents.d.ts.map +1 -1
  117. package/dist/client/webhooks/helpers.d.ts.map +1 -1
  118. package/dist/client/webhooks/helpers.js +1 -0
  119. package/dist/client/webhooks/helpers.js.map +1 -1
  120. package/dist/client/webhooks/ledger.d.ts +31 -0
  121. package/dist/client/webhooks/ledger.d.ts.map +1 -0
  122. package/dist/client/webhooks/ledger.js +13 -0
  123. package/dist/client/webhooks/ledger.js.map +1 -0
  124. package/dist/client/webhooks/processors.d.ts.map +1 -1
  125. package/dist/client/webhooks/processors.js +6 -3
  126. package/dist/client/webhooks/processors.js.map +1 -1
  127. package/dist/client/webhooks/subscriptionDeleted.d.ts.map +1 -1
  128. package/dist/client/webhooks/subscriptionDeleted.js +3 -2
  129. package/dist/client/webhooks/subscriptionDeleted.js.map +1 -1
  130. package/dist/component/_generated/api.d.ts +2 -0
  131. package/dist/component/_generated/api.d.ts.map +1 -1
  132. package/dist/component/_generated/api.js.map +1 -1
  133. package/dist/component/_generated/component.d.ts +18 -1
  134. package/dist/component/_generated/component.d.ts.map +1 -1
  135. package/dist/component/balanceFunding/internal/actions.d.ts +11 -11
  136. package/dist/component/balanceFunding/preparationHandlers.d.ts +8 -8
  137. package/dist/component/billing/mutations.d.ts +2 -1
  138. package/dist/component/billing/mutations.d.ts.map +1 -1
  139. package/dist/component/billing/mutations.js +28 -3
  140. package/dist/component/billing/mutations.js.map +1 -1
  141. package/dist/component/billing/queries.d.ts +8 -0
  142. package/dist/component/billing/queries.d.ts.map +1 -1
  143. package/dist/component/billing/schema.d.ts +3 -1
  144. package/dist/component/billing/schema.d.ts.map +1 -1
  145. package/dist/component/billing/validators.d.ts +16 -1
  146. package/dist/component/billing/validators.d.ts.map +1 -1
  147. package/dist/component/billing/validators.js +8 -0
  148. package/dist/component/billing/validators.js.map +1 -1
  149. package/dist/component/billingHistory/queries.d.ts +1 -0
  150. package/dist/component/billingHistory/queries.d.ts.map +1 -1
  151. package/dist/component/core/mutations.d.ts +4 -0
  152. package/dist/component/core/mutations.d.ts.map +1 -1
  153. package/dist/component/core/mutations.js +6 -0
  154. package/dist/component/core/mutations.js.map +1 -1
  155. package/dist/component/core/stripeMode.d.ts +8 -0
  156. package/dist/component/core/stripeMode.d.ts.map +1 -0
  157. package/dist/component/core/stripeMode.js +23 -0
  158. package/dist/component/core/stripeMode.js.map +1 -0
  159. package/dist/component/earnings/triggers.d.ts +6 -4
  160. package/dist/component/earnings/triggers.d.ts.map +1 -1
  161. package/dist/component/financialObservations/settlementHelpers.d.ts +3 -3
  162. package/dist/component/payoutRelease/queries.d.ts +2 -2
  163. package/dist/component/payoutRelease/queries.d.ts.map +1 -1
  164. package/dist/component/processingCostReconciliation/rollback.d.ts +1 -1
  165. package/dist/component/schema.d.ts +4 -2
  166. package/dist/component/webhooks/mutations.d.ts +19 -0
  167. package/dist/component/webhooks/mutations.d.ts.map +1 -1
  168. package/dist/component/webhooks/mutations.js +56 -0
  169. package/dist/component/webhooks/mutations.js.map +1 -1
  170. package/dist/component/webhooks/schema.d.ts +1 -1
  171. package/dist/component/webhooks/schema.d.ts.map +1 -1
  172. package/dist/component/webhooks/schema.js +2 -1
  173. package/dist/component/webhooks/schema.js.map +1 -1
  174. package/docs/README.md +43 -8
  175. package/docs/billing-history.md +1 -1
  176. package/docs/client-api.md +63 -10
  177. package/docs/evidence/native-metering/mixed-settlement-2026-10-20.json +1 -1
  178. package/docs/evidence/native-metering/product-flows-2026-10-19.json +1 -1
  179. package/docs/example-routing.md +93 -0
  180. package/docs/pull-request-standard.md +142 -0
  181. package/docs/react-workflows-audit.md +1 -2
  182. package/docs/read-contracts.md +6 -5
  183. package/docs/releasing.md +30 -2
  184. package/docs/renewal-attachment.md +176 -0
  185. package/docs/renewal-configuration.md +127 -0
  186. package/docs/renewal-context-reads.md +9 -5
  187. package/docs/settlement.md +2 -1
  188. package/docs/stripe-sandbox-worktrees.md +245 -0
  189. package/docs/webhooks.md +110 -1
  190. package/docs/worktrees.md +134 -0
  191. package/package.json +14 -2
  192. package/src/client/billing/renewalAggregate/phases.ts +31 -13
  193. package/src/client/billing/renewalAggregate/readMaterial.ts +36 -2
  194. package/src/client/billing/renewalAggregate/sourceDiscounts.ts +3 -1
  195. package/src/client/billing/renewalAttach/attachmentProfile.ts +22 -0
  196. package/src/client/billing/renewalAttach/internal/c10/eventCapture.ts +1 -1
  197. package/src/client/billing/renewalAttach/internal/material/classifiers.ts +26 -7
  198. package/src/client/billing/renewalAttach/internal/material/readMaterial.ts +26 -2
  199. package/src/client/billing/renewalAttach/internal/operations/configureReadTransport.ts +10 -9
  200. package/src/client/billing/renewalAttach/internal/operations/initialAttach.ts +5 -3
  201. package/src/client/billing/renewalAttach/internal/preflight/grammar.ts +1 -1
  202. package/src/client/billing/renewalAttach/internal/producer/attachAcknowledgement.ts +4 -6
  203. package/src/client/billing/renewalAttach/internal/producer/configureWriteFactory.ts +10 -8
  204. package/src/client/billing/renewalAttach/internal/producer/invocationProducer.ts +28 -1
  205. package/src/client/billing/renewalAttach/internal/producer/nodeAttachmentProfile.ts +108 -0
  206. package/src/client/billing/renewalAttach/liveAttachment.ts +43 -0
  207. package/src/client/billing/renewalAttach/nodeAttachment.ts +181 -0
  208. package/src/client/billing/renewalAttach/nodeConfiguration.ts +147 -0
  209. package/src/client/billing/renewalV2/configureInput.ts +2 -1
  210. package/src/client/billing/renewalV2/index.ts +7 -1
  211. package/src/client/index.ts +13 -15
  212. package/src/client/node.ts +8 -0
  213. package/src/client/renewal.ts +17 -0
  214. package/src/client/renewalAttachmentPreparation.ts +118 -0
  215. package/src/client/renewalAttachmentRuntime.ts +25 -0
  216. package/src/client/renewalAttachmentTypes.ts +51 -0
  217. package/src/client/renewalConfigurationPreparation.ts +92 -0
  218. package/src/client/renewalConfigurationRuntime.ts +24 -0
  219. package/src/client/renewalConfigurationTypes.ts +30 -0
  220. package/src/client/renewalContextClient.ts +22 -0
  221. package/src/client/types/documents.ts +2 -0
  222. package/src/client/webhooks/helpers.ts +1 -0
  223. package/src/client/webhooks/ledger.ts +48 -0
  224. package/src/client/webhooks/processors.ts +5 -0
  225. package/src/client/webhooks/subscriptionDeleted.ts +3 -2
  226. package/src/component/_generated/api.ts +2 -0
  227. package/src/component/_generated/component.ts +18 -1
  228. package/src/component/billing/mutations.ts +35 -2
  229. package/src/component/billing/validators.ts +12 -0
  230. package/src/component/core/mutations.ts +6 -0
  231. package/src/component/core/stripeMode.ts +30 -0
  232. package/src/component/webhooks/mutations.ts +66 -0
  233. package/src/component/webhooks/schema.ts +2 -1
  234. package/dist/client/billing/renewalAttach/internal/acquisition/array-order.test.d.ts +0 -2
  235. package/dist/client/billing/renewalAttach/internal/acquisition/array-order.test.d.ts.map +0 -1
  236. package/dist/client/billing/renewalAttach/internal/acquisition/array-order.test.js +0 -61
  237. package/dist/client/billing/renewalAttach/internal/acquisition/array-order.test.js.map +0 -1
  238. package/dist/client/billing/renewalAttach/internal/acquisition/coupon-stop-order.test.d.ts +0 -2
  239. package/dist/client/billing/renewalAttach/internal/acquisition/coupon-stop-order.test.d.ts.map +0 -1
  240. package/dist/client/billing/renewalAttach/internal/acquisition/coupon-stop-order.test.js +0 -18
  241. package/dist/client/billing/renewalAttach/internal/acquisition/coupon-stop-order.test.js.map +0 -1
  242. package/dist/client/billing/renewalAttach/internal/acquisition/fetch-metadata.test.d.ts +0 -2
  243. package/dist/client/billing/renewalAttach/internal/acquisition/fetch-metadata.test.d.ts.map +0 -1
  244. package/dist/client/billing/renewalAttach/internal/acquisition/fetch-metadata.test.js +0 -67
  245. package/dist/client/billing/renewalAttach/internal/acquisition/fetch-metadata.test.js.map +0 -1
  246. package/dist/client/billing/renewalAttach/internal/acquisition/raw-acquisition.test.d.ts +0 -2
  247. package/dist/client/billing/renewalAttach/internal/acquisition/raw-acquisition.test.d.ts.map +0 -1
  248. package/dist/client/billing/renewalAttach/internal/acquisition/raw-acquisition.test.js +0 -372
  249. package/dist/client/billing/renewalAttach/internal/acquisition/raw-acquisition.test.js.map +0 -1
  250. package/dist/client/billing/renewalAttach/internal/acquisition/sourceBinding.test.d.ts +0 -2
  251. package/dist/client/billing/renewalAttach/internal/acquisition/sourceBinding.test.d.ts.map +0 -1
  252. package/dist/client/billing/renewalAttach/internal/acquisition/sourceBinding.test.js +0 -126
  253. package/dist/client/billing/renewalAttach/internal/acquisition/sourceBinding.test.js.map +0 -1
  254. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/fixture.d.mts +0 -627
  255. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/fixture.d.mts.map +0 -1
  256. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/fixture.mjs +0 -488
  257. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/fixture.mjs.map +0 -1
  258. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/raw-retention-fixture.d.mts +0 -214
  259. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/raw-retention-fixture.d.mts.map +0 -1
  260. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/raw-retention-fixture.mjs +0 -63
  261. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/raw-retention-fixture.mjs.map +0 -1
  262. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/scenario.d.mts +0 -75
  263. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/scenario.d.mts.map +0 -1
  264. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/scenario.mjs +0 -145
  265. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/scenario.mjs.map +0 -1
  266. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/sourcePort.d.mts +0 -7
  267. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/sourcePort.d.mts.map +0 -1
  268. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/sourcePort.mjs +0 -26
  269. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/sourcePort.mjs.map +0 -1
  270. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/compilerIndex.d.mts +0 -3
  271. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/compilerIndex.d.mts.map +0 -1
  272. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/compilerIndex.mjs +0 -4
  273. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/compilerIndex.mjs.map +0 -1
  274. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/fixture.d.mts +0 -26
  275. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/fixture.d.mts.map +0 -1
  276. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/fixture.mjs +0 -42
  277. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/fixture.mjs.map +0 -1
  278. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f00.d.mts +0 -7
  279. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f00.d.mts.map +0 -1
  280. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f00.mjs +0 -60
  281. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f00.mjs.map +0 -1
  282. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f01.d.mts +0 -335
  283. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f01.d.mts.map +0 -1
  284. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f01.mjs +0 -122
  285. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f01.mjs.map +0 -1
  286. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f02.d.mts +0 -46
  287. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f02.d.mts.map +0 -1
  288. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f02.mjs +0 -87
  289. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f02.mjs.map +0 -1
  290. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f03.d.mts +0 -35
  291. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f03.d.mts.map +0 -1
  292. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f03.mjs +0 -90
  293. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f03.mjs.map +0 -1
  294. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f04.d.mts +0 -132
  295. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f04.d.mts.map +0 -1
  296. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f04.mjs +0 -82
  297. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f04.mjs.map +0 -1
  298. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f05.d.mts +0 -4
  299. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f05.d.mts.map +0 -1
  300. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f05.mjs +0 -23
  301. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f05.mjs.map +0 -1
  302. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f06.d.mts +0 -16
  303. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f06.d.mts.map +0 -1
  304. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f06.mjs +0 -41
  305. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f06.mjs.map +0 -1
  306. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f07.d.mts +0 -43
  307. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f07.d.mts.map +0 -1
  308. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f07.mjs +0 -132
  309. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f07.mjs.map +0 -1
  310. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f08.d.mts +0 -200
  311. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f08.d.mts.map +0 -1
  312. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f08.mjs +0 -150
  313. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f08.mjs.map +0 -1
  314. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f09.d.mts +0 -124
  315. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f09.d.mts.map +0 -1
  316. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f09.mjs +0 -127
  317. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f09.mjs.map +0 -1
  318. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f10.d.mts +0 -3
  319. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f10.d.mts.map +0 -1
  320. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f10.mjs +0 -69
  321. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f10.mjs.map +0 -1
  322. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f11.d.mts +0 -2
  323. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f11.d.mts.map +0 -1
  324. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f11.mjs +0 -152
  325. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f11.mjs.map +0 -1
  326. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f12.d.mts +0 -2
  327. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f12.d.mts.map +0 -1
  328. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f12.mjs +0 -2
  329. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f12.mjs.map +0 -1
  330. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f13.d.mts +0 -5
  331. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f13.d.mts.map +0 -1
  332. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f13.mjs +0 -243
  333. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f13.mjs.map +0 -1
  334. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f14.d.mts +0 -17
  335. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f14.d.mts.map +0 -1
  336. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f14.mjs +0 -75
  337. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f14.mjs.map +0 -1
  338. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f15.d.mts +0 -2
  339. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f15.d.mts.map +0 -1
  340. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f15.mjs +0 -173
  341. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f15.mjs.map +0 -1
  342. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f16.d.mts +0 -4
  343. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f16.d.mts.map +0 -1
  344. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f16.mjs +0 -4
  345. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f16.mjs.map +0 -1
  346. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f17.d.mts +0 -7
  347. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f17.d.mts.map +0 -1
  348. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f17.mjs +0 -30
  349. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f17.mjs.map +0 -1
  350. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f18.d.mts +0 -29
  351. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f18.d.mts.map +0 -1
  352. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f18.mjs +0 -33
  353. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f18.mjs.map +0 -1
  354. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f19.json +0 -452
  355. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f20.d.mts +0 -2
  356. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f20.d.mts.map +0 -1
  357. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f20.mjs +0 -173
  358. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f20.mjs.map +0 -1
  359. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f21.d.mts +0 -2
  360. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f21.d.mts.map +0 -1
  361. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f21.mjs +0 -449
  362. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f21.mjs.map +0 -1
  363. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f22.d.mts +0 -9
  364. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f22.d.mts.map +0 -1
  365. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f22.mjs +0 -27
  366. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f22.mjs.map +0 -1
  367. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f23.d.mts +0 -7
  368. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f23.d.mts.map +0 -1
  369. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f23.mjs +0 -150
  370. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f23.mjs.map +0 -1
  371. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f24.d.mts +0 -3
  372. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f24.d.mts.map +0 -1
  373. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f24.mjs +0 -503
  374. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f24.mjs.map +0 -1
  375. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f25.d.mts +0 -2
  376. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f25.d.mts.map +0 -1
  377. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f25.mjs +0 -91
  378. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f25.mjs.map +0 -1
  379. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f26.d.mts +0 -14
  380. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f26.d.mts.map +0 -1
  381. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f26.mjs +0 -41
  382. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f26.mjs.map +0 -1
  383. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f27.d.mts +0 -103
  384. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f27.d.mts.map +0 -1
  385. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f27.mjs +0 -46
  386. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f27.mjs.map +0 -1
  387. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f28.d.mts +0 -73
  388. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f28.d.mts.map +0 -1
  389. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f28.mjs +0 -294
  390. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f28.mjs.map +0 -1
  391. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f29.d.mts +0 -2
  392. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f29.d.mts.map +0 -1
  393. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f29.mjs +0 -60
  394. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f29.mjs.map +0 -1
  395. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/publishedRawkeyHelper.d.mts +0 -58
  396. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/publishedRawkeyHelper.d.mts.map +0 -1
  397. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/publishedRawkeyHelper.mjs +0 -96
  398. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/publishedRawkeyHelper.mjs.map +0 -1
  399. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/semanticSetup.d.ts +0 -2
  400. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/semanticSetup.d.ts.map +0 -1
  401. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/semanticSetup.js +0 -40
  402. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/semanticSetup.js.map +0 -1
  403. package/dist/client/connect/payoutAdoptionTestHelpers.d.ts +0 -10349
  404. package/dist/client/connect/payoutAdoptionTestHelpers.d.ts.map +0 -1
  405. package/dist/client/connect/payoutAdoptionTestHelpers.js +0 -242
  406. package/dist/client/connect/payoutAdoptionTestHelpers.js.map +0 -1
  407. package/dist/client/connect/payoutExecutionTestHelpers.d.ts +0 -5166
  408. package/dist/client/connect/payoutExecutionTestHelpers.d.ts.map +0 -1
  409. package/dist/client/connect/payoutExecutionTestHelpers.js +0 -208
  410. package/dist/client/connect/payoutExecutionTestHelpers.js.map +0 -1
  411. package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts +0 -10341
  412. package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts.map +0 -1
  413. package/dist/client/connect/payoutLargeAdoptionTestHelpers.js +0 -55
  414. package/dist/client/connect/payoutLargeAdoptionTestHelpers.js.map +0 -1
  415. package/dist/client/connect/payoutSyncTestHelpers.d.ts +0 -5098
  416. package/dist/client/connect/payoutSyncTestHelpers.d.ts.map +0 -1
  417. package/dist/client/connect/payoutSyncTestHelpers.js +0 -62
  418. package/dist/client/connect/payoutSyncTestHelpers.js.map +0 -1
  419. package/dist/client/paymentSource/resolver.fixtures.d.ts +0 -220
  420. package/dist/client/paymentSource/resolver.fixtures.d.ts.map +0 -1
  421. package/dist/client/paymentSource/resolver.fixtures.js +0 -189
  422. package/dist/client/paymentSource/resolver.fixtures.js.map +0 -1
  423. package/dist/client/recoveryWorkflow/provider.fixture.d.ts +0 -21
  424. package/dist/client/recoveryWorkflow/provider.fixture.d.ts.map +0 -1
  425. package/dist/client/recoveryWorkflow/provider.fixture.js +0 -125
  426. package/dist/client/recoveryWorkflow/provider.fixture.js.map +0 -1
  427. package/dist/client/settlement/authorization.fixture.d.ts +0 -148
  428. package/dist/client/settlement/authorization.fixture.d.ts.map +0 -1
  429. package/dist/client/settlement/authorization.fixture.js +0 -178
  430. package/dist/client/settlement/authorization.fixture.js.map +0 -1
  431. package/dist/client/setup.test.d.ts +0 -18
  432. package/dist/client/setup.test.d.ts.map +0 -1
  433. package/dist/client/setup.test.js +0 -33
  434. package/dist/client/setup.test.js.map +0 -1
  435. package/dist/client/usage/correctionTransport.fixtures.d.ts +0 -37
  436. package/dist/client/usage/correctionTransport.fixtures.d.ts.map +0 -1
  437. package/dist/client/usage/correctionTransport.fixtures.js +0 -322
  438. package/dist/client/usage/correctionTransport.fixtures.js.map +0 -1
  439. package/dist/client/usage/creditSettlement.fixtures.d.ts +0 -216
  440. package/dist/client/usage/creditSettlement.fixtures.d.ts.map +0 -1
  441. package/dist/client/usage/creditSettlement.fixtures.js +0 -59
  442. package/dist/client/usage/creditSettlement.fixtures.js.map +0 -1
  443. package/dist/client/usage/creditTransport.fixtures.d.ts +0 -108
  444. package/dist/client/usage/creditTransport.fixtures.d.ts.map +0 -1
  445. package/dist/client/usage/creditTransport.fixtures.js +0 -293
  446. package/dist/client/usage/creditTransport.fixtures.js.map +0 -1
  447. package/dist/client/usage/invoiceSale.fixtures.d.ts +0 -285
  448. package/dist/client/usage/invoiceSale.fixtures.d.ts.map +0 -1
  449. package/dist/client/usage/invoiceSale.fixtures.js +0 -104
  450. package/dist/client/usage/invoiceSale.fixtures.js.map +0 -1
  451. package/dist/client/usage/mixedInvoice.fixtures.d.ts +0 -315
  452. package/dist/client/usage/mixedInvoice.fixtures.d.ts.map +0 -1
  453. package/dist/client/usage/mixedInvoice.fixtures.js +0 -55
  454. package/dist/client/usage/mixedInvoice.fixtures.js.map +0 -1
  455. package/dist/client/usage/subscription.fixtures.d.ts +0 -118
  456. package/dist/client/usage/subscription.fixtures.d.ts.map +0 -1
  457. package/dist/client/usage/subscription.fixtures.js +0 -84
  458. package/dist/client/usage/subscription.fixtures.js.map +0 -1
  459. package/dist/client/usage/subscriptionTransport.fixtures.d.ts +0 -25
  460. package/dist/client/usage/subscriptionTransport.fixtures.d.ts.map +0 -1
  461. package/dist/client/usage/subscriptionTransport.fixtures.js +0 -206
  462. package/dist/client/usage/subscriptionTransport.fixtures.js.map +0 -1
  463. package/dist/client/webhooks/payoutReconciliationTestHelpers.d.ts +0 -117
  464. package/dist/client/webhooks/payoutReconciliationTestHelpers.d.ts.map +0 -1
  465. package/dist/client/webhooks/payoutReconciliationTestHelpers.js +0 -105
  466. package/dist/client/webhooks/payoutReconciliationTestHelpers.js.map +0 -1
  467. package/dist/component/usage/allowance.fixtures.d.ts +0 -5088
  468. package/dist/component/usage/allowance.fixtures.d.ts.map +0 -1
  469. package/dist/component/usage/allowance.fixtures.js +0 -67
  470. package/dist/component/usage/allowance.fixtures.js.map +0 -1
  471. package/dist/component/usageCredits/accounting.fixtures.d.ts +0 -5111
  472. package/dist/component/usageCredits/accounting.fixtures.d.ts.map +0 -1
  473. package/dist/component/usageCredits/accounting.fixtures.js +0 -89
  474. package/dist/component/usageCredits/accounting.fixtures.js.map +0 -1
  475. package/dist/react/workflows/Usage.fixtures.d.ts +0 -17
  476. package/dist/react/workflows/Usage.fixtures.d.ts.map +0 -1
  477. package/dist/react/workflows/Usage.fixtures.js +0 -79
  478. package/dist/react/workflows/Usage.fixtures.js.map +0 -1
  479. package/dist/test.d.ts +0 -6
  480. package/dist/test.d.ts.map +0 -1
  481. package/dist/test.js +0 -15
  482. package/dist/test.js.map +0 -1
  483. package/dist/testing/component-db.d.ts +0 -3
  484. package/dist/testing/component-db.d.ts.map +0 -1
  485. package/dist/testing/component-db.js +0 -26
  486. package/dist/testing/component-db.js.map +0 -1
  487. package/src/client/balanceFundingWorkflow/capture.test.ts +0 -144
  488. package/src/client/billing/balanceFunding.test.ts +0 -257
  489. package/src/client/billing/balanceFundingTransport.test.ts +0 -89
  490. package/src/client/billing/captured-checkout-payment.test.ts +0 -272
  491. package/src/client/billing/checkout-idempotency.test.ts +0 -82
  492. package/src/client/billing/checkout-ui-modes.test.ts +0 -49
  493. package/src/client/billing/checkout.test.ts +0 -1282
  494. package/src/client/billing/checkoutPages.test.ts +0 -270
  495. package/src/client/billing/historyPages.test.ts +0 -58
  496. package/src/client/billing/intents.test.ts +0 -216
  497. package/src/client/billing/intentsTransport.test.ts +0 -94
  498. package/src/client/billing/invoicePages.test.ts +0 -174
  499. package/src/client/billing/invoicePaymentPages.test.ts +0 -354
  500. package/src/client/billing/invoicePaymentRead.test.ts +0 -233
  501. package/src/client/billing/invoicePaymentReadTransport.test.ts +0 -101
  502. package/src/client/billing/invoicePreview.test.ts +0 -123
  503. package/src/client/billing/invoicePreviewTransport.test.ts +0 -70
  504. package/src/client/billing/invoices.test.ts +0 -243
  505. package/src/client/billing/prepared-checkout.test.ts +0 -430
  506. package/src/client/billing/providerReads.test.ts +0 -60
  507. package/src/client/billing/renewal-discount-projection.test.ts +0 -207
  508. package/src/client/billing/renewal-item-settings-projection.test.ts +0 -79
  509. package/src/client/billing/renewal-price-replacement.test.ts +0 -503
  510. package/src/client/billing/renewal-settings-projection.test.ts +0 -300
  511. package/src/client/billing/renewalAggregate/configure.test.ts +0 -372
  512. package/src/client/billing/renewalAggregate/preflight.test.ts +0 -233
  513. package/src/client/billing/renewalAggregate/sourceAndTaxRetention.test.ts +0 -247
  514. package/src/client/billing/renewalAttach/couponEvidence.test.ts +0 -103
  515. package/src/client/billing/renewalAttach/internal/acquisition/array-order.test.js +0 -70
  516. package/src/client/billing/renewalAttach/internal/acquisition/coupon-stop-order.test.js +0 -23
  517. package/src/client/billing/renewalAttach/internal/acquisition/fetch-metadata.test.js +0 -77
  518. package/src/client/billing/renewalAttach/internal/acquisition/raw-acquisition.test.js +0 -418
  519. package/src/client/billing/renewalAttach/internal/acquisition/sourceBinding.test.js +0 -138
  520. package/src/client/billing/renewalAttach/internal/acquisition/test-fixtures/fixture.mjs +0 -510
  521. package/src/client/billing/renewalAttach/internal/acquisition/test-fixtures/raw-retention-fixture.mjs +0 -64
  522. package/src/client/billing/renewalAttach/internal/acquisition/test-fixtures/scenario.mjs +0 -159
  523. package/src/client/billing/renewalAttach/internal/acquisition/test-fixtures/sourcePort.mjs +0 -25
  524. package/src/client/billing/renewalAttach/internal/c10/appendAck.first.test.ts +0 -86
  525. package/src/client/billing/renewalAttach/internal/c10/appendCodec.test.ts +0 -186
  526. package/src/client/billing/renewalAttach/internal/c10/arrayOrder.test.ts +0 -47
  527. package/src/client/billing/renewalAttach/internal/c10/compiler.test.ts +0 -443
  528. package/src/client/billing/renewalAttach/internal/c10/hardening.test.ts +0 -175
  529. package/src/client/billing/renewalAttach/internal/c10/historicalClassifier.test.ts +0 -114
  530. package/src/client/billing/renewalAttach/internal/c10/ownerContinuations.test.ts +0 -283
  531. package/src/client/billing/renewalAttach/internal/c10/reflectionPrivacy.test.ts +0 -87
  532. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/compilerIndex.mjs +0 -3
  533. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/fixture.mjs +0 -49
  534. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f00.mjs +0 -63
  535. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f01.mjs +0 -160
  536. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f02.mjs +0 -88
  537. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f03.mjs +0 -102
  538. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f04.mjs +0 -82
  539. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f05.mjs +0 -20
  540. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f06.mjs +0 -41
  541. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f07.mjs +0 -137
  542. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f08.mjs +0 -153
  543. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f09.mjs +0 -127
  544. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f10.mjs +0 -85
  545. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f11.mjs +0 -170
  546. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f12.mjs +0 -6
  547. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f13.mjs +0 -295
  548. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f14.mjs +0 -78
  549. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f15.mjs +0 -177
  550. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f16.mjs +0 -8
  551. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f17.mjs +0 -34
  552. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f18.mjs +0 -32
  553. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f19.json +0 -452
  554. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f20.mjs +0 -177
  555. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f21.mjs +0 -466
  556. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f22.mjs +0 -29
  557. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f23.mjs +0 -165
  558. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f24.mjs +0 -507
  559. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f25.mjs +0 -89
  560. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f26.mjs +0 -38
  561. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f27.mjs +0 -45
  562. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f28.mjs +0 -309
  563. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f29.mjs +0 -58
  564. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/publishedRawkeyHelper.mjs +0 -104
  565. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/semanticSetup.ts +0 -43
  566. package/src/client/billing/renewalAttach/internal/configure/dispatch.integration.test.ts +0 -32
  567. package/src/client/billing/renewalAttach/internal/configure/limits.test.ts +0 -510
  568. package/src/client/billing/renewalAttach/internal/configure/order.integration.test.ts +0 -207
  569. package/src/client/billing/renewalAttach/internal/configure/ownership.integration.test.ts +0 -148
  570. package/src/client/billing/renewalAttach/internal/configure/replay.integration.test.ts +0 -173
  571. package/src/client/billing/renewalAttach/internal/configure/transport.integration.test.ts +0 -507
  572. package/src/client/billing/renewalAttach/internal/material/classifiers.test.ts +0 -510
  573. package/src/client/billing/renewalAttach/internal/observation/freshActor.integration.test.ts +0 -360
  574. package/src/client/billing/renewalAttach/internal/observation/freshActorControls.integration.test.ts +0 -442
  575. package/src/client/billing/renewalAttach/internal/observation/history.integration.test.ts +0 -79
  576. package/src/client/billing/renewalAttach/internal/observation/historyControls.integration.test.ts +0 -238
  577. package/src/client/billing/renewalAttach/internal/observation/invoiceActor.integration.test.ts +0 -142
  578. package/src/client/billing/renewalAttach/internal/observation/invoiceActorControls.integration.test.ts +0 -495
  579. package/src/client/billing/renewalAttach/internal/observation/observation.integration.test.ts +0 -220
  580. package/src/client/billing/renewalAttach/internal/observation/observationConfigureACK.integration.test.ts +0 -36
  581. package/src/client/billing/renewalAttach/internal/observation/observationConfigureACKControls.integration.test.ts +0 -48
  582. package/src/client/billing/renewalAttach/internal/observation/observationConfigureACKLifecycle.integration.test.ts +0 -44
  583. package/src/client/billing/renewalAttach/internal/observation/observationConfiguredHistory.integration.test.ts +0 -34
  584. package/src/client/billing/renewalAttach/internal/observation/observationRetirement.integration.test.ts +0 -60
  585. package/src/client/billing/renewalAttach/internal/observation/reader.integration.test.ts +0 -93
  586. package/src/client/billing/renewalAttach/internal/observation/readerControls.integration.test.ts +0 -553
  587. package/src/client/billing/renewalAttach/internal/observation/witnessAcquisition.integration.test.ts +0 -348
  588. package/src/client/billing/renewalAttach/internal/observation/witnessActor.integration.test.ts +0 -204
  589. package/src/client/billing/renewalAttach/internal/observation/witnessCapabilities.integration.test.ts +0 -231
  590. package/src/client/billing/renewalAttach/internal/observation/witnessHistorical.integration.test.ts +0 -98
  591. package/src/client/billing/renewalAttach/internal/observation/witnessImmutable.integration.test.ts +0 -78
  592. package/src/client/billing/renewalAttach/internal/observation/witnessInvoice.integration.test.ts +0 -85
  593. package/src/client/billing/renewalAttach/internal/observation/witnessLifecycle.integration.test.ts +0 -264
  594. package/src/client/billing/renewalAttach/internal/observation/witnessProfile.integration.test.ts +0 -93
  595. package/src/client/billing/renewalAttach/internal/observation/witnessRPCControls.integration.test.ts +0 -256
  596. package/src/client/billing/renewalAttach/internal/operationJournal.acknowledgement.integration.test.ts +0 -500
  597. package/src/client/billing/renewalAttach/internal/operationJournal.c10.integration.test.ts +0 -560
  598. package/src/client/billing/renewalAttach/internal/operationJournal.controls.integration.test.ts +0 -356
  599. package/src/client/billing/renewalAttach/internal/operationJournal.integration.test.ts +0 -560
  600. package/src/client/billing/renewalAttach/internal/operationJournal.methods.integration.test.ts +0 -534
  601. package/src/client/billing/renewalAttach/internal/operations/defaultBindings.test.ts +0 -69
  602. package/src/client/billing/renewalAttach/internal/operations/initialAttach.integration.test.ts +0 -34
  603. package/src/client/billing/renewalAttach/internal/operations/providerFailure.integration.test.ts +0 -61
  604. package/src/client/billing/renewalAttach/internal/operations/transport.integration.test.ts +0 -116
  605. package/src/client/billing/renewalAttach/internal/originalOwner.test.ts +0 -258
  606. package/src/client/billing/renewalAttach/internal/preflight/configurePreflight.integration.test.ts +0 -285
  607. package/src/client/billing/renewalAttach/internal/preflight/configureReads.integration.test.ts +0 -139
  608. package/src/client/billing/renewalAttach/internal/preflight/owner.integration.test.ts +0 -82
  609. package/src/client/billing/renewalAttach/internal/preflight/preflight.integration.test.ts +0 -354
  610. package/src/client/billing/renewalAttach/internal/producer/producerAcknowledgement.integration.test.ts +0 -320
  611. package/src/client/billing/renewalAttach/internal/producer/producerAcknowledgementControls.integration.test.ts +0 -411
  612. package/src/client/billing/renewalAttach/internal/producer/producerAcquisition.integration.test.ts +0 -240
  613. package/src/client/billing/renewalAttach/internal/producer/producerActor.integration.test.ts +0 -526
  614. package/src/client/billing/renewalAttach/internal/producer/producerChannels.integration.test.ts +0 -350
  615. package/src/client/billing/renewalAttach/internal/producer/producerClock.integration.test.ts +0 -175
  616. package/src/client/billing/renewalAttach/internal/producer/producerConfigureAdmission.integration.test.ts +0 -203
  617. package/src/client/billing/renewalAttach/internal/producer/producerConfigureChannelControls.integration.test.ts +0 -542
  618. package/src/client/billing/renewalAttach/internal/producer/producerConfigureChannels.integration.test.ts +0 -321
  619. package/src/client/billing/renewalAttach/internal/producer/producerConfigureControls.integration.test.ts +0 -566
  620. package/src/client/billing/renewalAttach/internal/producer/producerConfigurePreflight.integration.test.ts +0 -67
  621. package/src/client/billing/renewalAttach/internal/producer/producerConfigurePreflightControls.integration.test.ts +0 -475
  622. package/src/client/billing/renewalAttach/internal/producer/producerConfigureRecovery.integration.test.ts +0 -99
  623. package/src/client/billing/renewalAttach/internal/producer/producerConfigureRecoveryControls.integration.test.ts +0 -420
  624. package/src/client/billing/renewalAttach/internal/producer/producerConfigureWrite.integration.test.ts +0 -158
  625. package/src/client/billing/renewalAttach/internal/producer/producerConfigureWriteControls.integration.test.ts +0 -549
  626. package/src/client/billing/renewalAttach/internal/producer/producerGuards.integration.test.ts +0 -323
  627. package/src/client/billing/renewalAttach/internal/producer/producerInitial.integration.test.ts +0 -301
  628. package/src/client/billing/renewalAttach/internal/producer/producerIsolation.integration.test.ts +0 -531
  629. package/src/client/billing/renewalAttach/internal/producer/producerMaterial.integration.test.ts +0 -251
  630. package/src/client/billing/renewalAttach/internal/producer/producerOwner.integration.test.ts +0 -449
  631. package/src/client/billing/renewalAttach/internal/producer/producerRecovery.integration.test.ts +0 -394
  632. package/src/client/billing/renewalAttach/internal/producer/producerRecoveryControls.integration.test.ts +0 -437
  633. package/src/client/billing/renewalAttach/internal/producer/producerRecoveryIsolation.integration.test.ts +0 -332
  634. package/src/client/billing/renewalAttach/internal/producer/producerTransport.integration.test.ts +0 -440
  635. package/src/client/billing/renewalAttach/internal/recovery/recovery.integration.test.ts +0 -463
  636. package/src/client/billing/renewalAttach/internal/sourceBindings.test.ts +0 -13
  637. package/src/client/billing/renewalAttach/internal/stockRawDelegate.test.ts +0 -156
  638. package/src/client/billing/renewalAttach/internal/test-fixtures/attachEntries.ts +0 -217
  639. package/src/client/billing/renewalAttach/internal/test-fixtures/attachObservations.ts +0 -226
  640. package/src/client/billing/renewalAttach/internal/test-fixtures/attachScenario.ts +0 -556
  641. package/src/client/billing/renewalAttach/internal/test-fixtures/attachScenarioAssertions.ts +0 -180
  642. package/src/client/billing/renewalAttach/internal/test-fixtures/attachScenarioBarriers.ts +0 -144
  643. package/src/client/billing/renewalAttach/internal/test-fixtures/configurePreflightAssertions.ts +0 -122
  644. package/src/client/billing/renewalAttach/internal/test-fixtures/configurePreflightBarriers.ts +0 -330
  645. package/src/client/billing/renewalAttach/internal/test-fixtures/configurePreflightControls.ts +0 -139
  646. package/src/client/billing/renewalAttach/internal/test-fixtures/configurePreflightOperation.ts +0 -513
  647. package/src/client/billing/renewalAttach/internal/test-fixtures/configureReadNativeBaseline.ts +0 -344
  648. package/src/client/billing/renewalAttach/internal/test-fixtures/configureReadOperation.ts +0 -278
  649. package/src/client/billing/renewalAttach/internal/test-fixtures/configureReadPort.ts +0 -17
  650. package/src/client/billing/renewalAttach/internal/test-fixtures/configureWriteAssertions.ts +0 -537
  651. package/src/client/billing/renewalAttach/internal/test-fixtures/configureWriteBarriers.ts +0 -125
  652. package/src/client/billing/renewalAttach/internal/test-fixtures/configureWriteDeclarations.ts +0 -325
  653. package/src/client/billing/renewalAttach/internal/test-fixtures/configureWriteDelegate.ts +0 -38
  654. package/src/client/billing/renewalAttach/internal/test-fixtures/configureWriteHistory.ts +0 -471
  655. package/src/client/billing/renewalAttach/internal/test-fixtures/configureWriteObservations.ts +0 -515
  656. package/src/client/billing/renewalAttach/internal/test-fixtures/configureWriteOperation.ts +0 -587
  657. package/src/client/billing/renewalAttach/internal/test-fixtures/freshObservation.ts +0 -94
  658. package/src/client/billing/renewalAttach/internal/test-fixtures/historySnapshot.ts +0 -51
  659. package/src/client/billing/renewalAttach/internal/test-fixtures/invoiceObservation.ts +0 -160
  660. package/src/client/billing/renewalAttach/internal/test-fixtures/observationAssertions.ts +0 -211
  661. package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfigureACKAssertions.ts +0 -115
  662. package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfigureACKDeclarations.ts +0 -141
  663. package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfigureACKLifecycleAssertions.ts +0 -74
  664. package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfigureACKLifecycleDeclarations.ts +0 -79
  665. package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfigureACKLifecycleInstrumentation.ts +0 -207
  666. package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfigureACKLifecycleOperation.ts +0 -494
  667. package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfigureACKOperation.ts +0 -452
  668. package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfiguredHistoryAssertions.ts +0 -88
  669. package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfiguredHistoryDeclarations.ts +0 -170
  670. package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfiguredHistoryNative.ts +0 -99
  671. package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfiguredHistoryOperation.ts +0 -411
  672. package/src/client/billing/renewalAttach/internal/test-fixtures/observationDeclarations.ts +0 -192
  673. package/src/client/billing/renewalAttach/internal/test-fixtures/observationHTTP.ts +0 -197
  674. package/src/client/billing/renewalAttach/internal/test-fixtures/observationObservations.ts +0 -269
  675. package/src/client/billing/renewalAttach/internal/test-fixtures/observationOperation.ts +0 -262
  676. package/src/client/billing/renewalAttach/internal/test-fixtures/observationProbe.ts +0 -319
  677. package/src/client/billing/renewalAttach/internal/test-fixtures/observationReader.ts +0 -101
  678. package/src/client/billing/renewalAttach/internal/test-fixtures/ownedOperations.ts +0 -94
  679. package/src/client/billing/renewalAttach/internal/test-fixtures/producerConfigureAdmission.ts +0 -538
  680. package/src/client/billing/renewalAttach/internal/test-fixtures/producerInitialDeclarations.ts +0 -5
  681. package/src/client/billing/renewalAttach/internal/test-fixtures/producerInitialOperation.ts +0 -335
  682. package/src/client/billing/renewalAttach/internal/test-fixtures/sourceOperationPort.ts +0 -16
  683. package/src/client/billing/renewalAttach/internal/test-fixtures/stockHttp.ts +0 -21
  684. package/src/client/billing/renewalAttach/internal/test-fixtures/witnessHistory.ts +0 -70
  685. package/src/client/billing/renewalAttach/internal/test-fixtures/witnessObservation.ts +0 -353
  686. package/src/client/billing/renewalAttach/reader.test.ts +0 -409
  687. package/src/client/billing/renewalAttach/wireJson.test.ts +0 -265
  688. package/src/client/billing/renewalObservation/evidence-admission.test.ts +0 -219
  689. package/src/client/billing/renewalObservation/evidence-history.test.ts +0 -187
  690. package/src/client/billing/renewalObservation/evidence-invoice-controls.test.ts +0 -293
  691. package/src/client/billing/renewalObservation/evidence-invoice-identity.test.ts +0 -61
  692. package/src/client/billing/renewalObservation/evidence-invoice.test.ts +0 -177
  693. package/src/client/billing/renewalObservation/evidence-material.test.ts +0 -289
  694. package/src/client/billing/renewalObservation/evidence-v1.test.ts +0 -371
  695. package/src/client/billing/renewalV2/configure.test.ts +0 -362
  696. package/src/client/billing/renewalV2/configureReceipt.test.ts +0 -558
  697. package/src/client/billing/renewalV2/index.test.ts +0 -414
  698. package/src/client/billing/renewalV2/observation.boundary-review.test.ts +0 -49
  699. package/src/client/billing/renewalV2/observation.test.ts +0 -334
  700. package/src/client/billing/renewalV2/rawRetention.test.ts +0 -293
  701. package/src/client/billing/renewalV2/receipt.test.ts +0 -289
  702. package/src/client/billing/setup-intent-read.test.ts +0 -324
  703. package/src/client/billing/subscription-payment-method.test.ts +0 -460
  704. package/src/client/billing/subscriptionCancellation.test.ts +0 -68
  705. package/src/client/billing/subscriptions.test.ts +0 -1049
  706. package/src/client/charge-currency.test.ts +0 -113
  707. package/src/client/component-api-types.test.ts +0 -137
  708. package/src/client/connect/commissionReceipts.test.ts +0 -157
  709. package/src/client/connect/dispute-upload.test.ts +0 -208
  710. package/src/client/connect/disputes.test.ts +0 -502
  711. package/src/client/connect/paymentMethodUtils.test.ts +0 -83
  712. package/src/client/connect/paymentMethods.test.ts +0 -68
  713. package/src/client/connect/payoutAdoption.test.ts +0 -186
  714. package/src/client/connect/payoutAdoptionAge.test.ts +0 -89
  715. package/src/client/connect/payoutAdoptionAllocation.test.ts +0 -132
  716. package/src/client/connect/payoutAdoptionConcurrency.test.ts +0 -266
  717. package/src/client/connect/payoutAdoptionTestHelpers.ts +0 -269
  718. package/src/client/connect/payoutAllocation.test.ts +0 -325
  719. package/src/client/connect/payoutCacheIdentity.test.ts +0 -93
  720. package/src/client/connect/payoutCollection.test.ts +0 -74
  721. package/src/client/connect/payoutDeadline.test.ts +0 -238
  722. package/src/client/connect/payoutExecution.test.ts +0 -294
  723. package/src/client/connect/payoutExecutionTestHelpers.ts +0 -244
  724. package/src/client/connect/payoutHistory.test.ts +0 -145
  725. package/src/client/connect/payoutLargeAdoption.test.ts +0 -541
  726. package/src/client/connect/payoutLargeAdoptionTestHelpers.ts +0 -74
  727. package/src/client/connect/payoutLargeHistory.test.ts +0 -222
  728. package/src/client/connect/payoutLiabilityVersion.test.ts +0 -221
  729. package/src/client/connect/payoutOutcomeBatches.test.ts +0 -40
  730. package/src/client/connect/payoutPreview.test.ts +0 -414
  731. package/src/client/connect/payoutQualificationFreshness.test.ts +0 -192
  732. package/src/client/connect/payoutReceipt.test.ts +0 -312
  733. package/src/client/connect/payoutReconciliation.test.ts +0 -414
  734. package/src/client/connect/payoutReturnedAdoption.test.ts +0 -157
  735. package/src/client/connect/payoutSnapshot.test.ts +0 -118
  736. package/src/client/connect/payoutSync.test.ts +0 -313
  737. package/src/client/connect/payoutSyncTestHelpers.ts +0 -82
  738. package/src/client/connect/payoutWorker.test.ts +0 -201
  739. package/src/client/connect/payouts.test.ts +0 -132
  740. package/src/client/connect/refundActor.test.ts +0 -121
  741. package/src/client/connect/refundPrincipal.test.ts +0 -46
  742. package/src/client/connect/refundSync.test.ts +0 -239
  743. package/src/client/connect/refundSync.transport.test.ts +0 -396
  744. package/src/client/connect/refunds.test.ts +0 -438
  745. package/src/client/connect/transferReceipt.pagination.test.ts +0 -209
  746. package/src/client/connect/transferReceipt.test.ts +0 -520
  747. package/src/client/connect/transferReceiptBaseline.test.ts +0 -55
  748. package/src/client/connect/transfers.test.ts +0 -557
  749. package/src/client/core/account-close-guard.test.ts +0 -349
  750. package/src/client/core/account-close-orchestration.test.ts +0 -131
  751. package/src/client/core/account-closure-preview.test.ts +0 -219
  752. package/src/client/core/account-closure.test.ts +0 -317
  753. package/src/client/core/account-idempotency.test.ts +0 -78
  754. package/src/client/core/account-session-client.test.ts +0 -74
  755. package/src/client/core/accountConfigurations.test.ts +0 -183
  756. package/src/client/core/accountLinks.test.ts +0 -389
  757. package/src/client/core/accountStatus.test.ts +0 -169
  758. package/src/client/core/accounts.test.ts +0 -1385
  759. package/src/client/core/billingPortal.test.ts +0 -249
  760. package/src/client/core/billingPortalFlow.test.ts +0 -349
  761. package/src/client/core/billingPortalIdentity.test.ts +0 -418
  762. package/src/client/core/config.test.ts +0 -69
  763. package/src/client/core/descriptors.test.ts +0 -70
  764. package/src/client/core/fees.test.ts +0 -369
  765. package/src/client/core/idempotency.test.ts +0 -10
  766. package/src/client/core/personal-account-mapping.test.ts +0 -71
  767. package/src/client/costRecovery-import.test.ts +0 -174
  768. package/src/client/costRecovery-invoiceReceipt.test.ts +0 -140
  769. package/src/client/costRecovery-invoices.test.ts +0 -470
  770. package/src/client/costRecovery-invoices.transport.test.ts +0 -107
  771. package/src/client/costRecovery.test.ts +0 -110
  772. package/src/client/customer-preview-thin.test.ts +0 -41
  773. package/src/client/customer-preview-webhooks.test.ts +0 -150
  774. package/src/client/customer-preview.test.ts +0 -366
  775. package/src/client/errors.test.ts +0 -66
  776. package/src/client/financialObservations.test.ts +0 -109
  777. package/src/client/financialOutcomes/outcomes.test.ts +0 -254
  778. package/src/client/financialOwnership.test.ts +0 -80
  779. package/src/client/helpers.test.ts +0 -74
  780. package/src/client/index.test.ts +0 -1784
  781. package/src/client/operationEvidence.test.ts +0 -110
  782. package/src/client/originalIdReadOptions.test.ts +0 -63
  783. package/src/client/paymentSource/resolver.fixtures.ts +0 -216
  784. package/src/client/paymentSource/resolver.test.ts +0 -386
  785. package/src/client/payoutPolicy.test.ts +0 -579
  786. package/src/client/payoutRevisionMigration.test.ts +0 -40
  787. package/src/client/processingCostDeficit/calculator.test.ts +0 -176
  788. package/src/client/processingCostReconciliation/invoiceProvider.test.ts +0 -353
  789. package/src/client/processingCostReconciliation/provider.test.ts +0 -324
  790. package/src/client/products/catalog-idempotency.test.ts +0 -116
  791. package/src/client/products/catalog.test.ts +0 -389
  792. package/src/client/products/fixedPrice.test.ts +0 -57
  793. package/src/client/products/identity.test.ts +0 -91
  794. package/src/client/products/prices.test.ts +0 -375
  795. package/src/client/products/product-descriptor-inheritance.test.ts +0 -245
  796. package/src/client/products/product-descriptors.test.ts +0 -260
  797. package/src/client/products/product-set-idempotency.test.ts +0 -188
  798. package/src/client/products/products.test.ts +0 -517
  799. package/src/client/readPagination.test.ts +0 -83
  800. package/src/client/recoveryWorkflow/client.test.ts +0 -37
  801. package/src/client/recoveryWorkflow/provider.fixture.ts +0 -143
  802. package/src/client/recoveryWorkflow/provider.test.ts +0 -509
  803. package/src/client/refund-command-evidence.test.ts +0 -68
  804. package/src/client/refund-command-normalization.test.ts +0 -61
  805. package/src/client/refund-context-shapes.test.ts +0 -127
  806. package/src/client/refund-context.test.ts +0 -404
  807. package/src/client/refund-history.test.ts +0 -67
  808. package/src/client/reversalObservations.test.ts +0 -69
  809. package/src/client/settlement/allocation.test.ts +0 -98
  810. package/src/client/settlement/authorization.fixture.ts +0 -199
  811. package/src/client/settlement/authorization.test.ts +0 -160
  812. package/src/client/settlement/commissions.test.ts +0 -103
  813. package/src/client/settlement/execution.test.ts +0 -191
  814. package/src/client/settlement/policy-context.test.ts +0 -277
  815. package/src/client/settlement/processingCosts.test.ts +0 -349
  816. package/src/client/settlement/processingCostsTransport.test.ts +0 -135
  817. package/src/client/settlement/verifiedSale.test.ts +0 -139
  818. package/src/client/setup.test.ts +0 -47
  819. package/src/client/singleAttemptHttpClient.test.ts +0 -70
  820. package/src/client/strictStripeTransport.test.ts +0 -73
  821. package/src/client/stripe-version.test.ts +0 -53
  822. package/src/client/transferContinuation.test.ts +0 -90
  823. package/src/client/transferObservations.test.ts +0 -98
  824. package/src/client/usage/allowanceClient.test.ts +0 -93
  825. package/src/client/usage/allowanceTerms.test.ts +0 -131
  826. package/src/client/usage/boundaries.test.ts +0 -136
  827. package/src/client/usage/catalog.test.ts +0 -464
  828. package/src/client/usage/catalogMath.test.ts +0 -13
  829. package/src/client/usage/contracts.test.ts +0 -145
  830. package/src/client/usage/correctionClient.test.ts +0 -153
  831. package/src/client/usage/correctionCredits.test.ts +0 -156
  832. package/src/client/usage/correctionInvoice.test.ts +0 -127
  833. package/src/client/usage/correctionRecovery.test.ts +0 -113
  834. package/src/client/usage/correctionTransport.fixtures.ts +0 -372
  835. package/src/client/usage/creditBackingIsolation.test.ts +0 -110
  836. package/src/client/usage/creditCapacity.test.ts +0 -162
  837. package/src/client/usage/creditClient.test.ts +0 -221
  838. package/src/client/usage/creditInvoice.test.ts +0 -149
  839. package/src/client/usage/creditObservation.test.ts +0 -150
  840. package/src/client/usage/creditProofBounds.test.ts +0 -187
  841. package/src/client/usage/creditProvider.test.ts +0 -276
  842. package/src/client/usage/creditRevenue.test.ts +0 -105
  843. package/src/client/usage/creditSettlement.fixtures.ts +0 -70
  844. package/src/client/usage/creditSettlement.test.ts +0 -66
  845. package/src/client/usage/creditSettlementRecovery.test.ts +0 -173
  846. package/src/client/usage/creditTerms.test.ts +0 -48
  847. package/src/client/usage/creditTransport.fixtures.ts +0 -308
  848. package/src/client/usage/deliveryProvider.test.ts +0 -316
  849. package/src/client/usage/invoiceObservation.test.ts +0 -195
  850. package/src/client/usage/invoiceSale.fixtures.ts +0 -103
  851. package/src/client/usage/invoiceSale.test.ts +0 -252
  852. package/src/client/usage/ledger-client.test.ts +0 -74
  853. package/src/client/usage/mixedInvoice.fixtures.ts +0 -54
  854. package/src/client/usage/mixedInvoiceSale.test.ts +0 -92
  855. package/src/client/usage/mixedSettlement.test.ts +0 -187
  856. package/src/client/usage/providerObservation.test.ts +0 -207
  857. package/src/client/usage/reconciliation.test.ts +0 -117
  858. package/src/client/usage/record-composition.test.ts +0 -195
  859. package/src/client/usage/settlement.test.ts +0 -179
  860. package/src/client/usage/subscription.fixtures.ts +0 -84
  861. package/src/client/usage/subscriptionAbandonment.test.ts +0 -124
  862. package/src/client/usage/subscriptionCheckout.test.ts +0 -44
  863. package/src/client/usage/subscriptionClient.test.ts +0 -375
  864. package/src/client/usage/subscriptionProvider.test.ts +0 -48
  865. package/src/client/usage/subscriptionTerms.test.ts +0 -158
  866. package/src/client/usage/subscriptionTransport.fixtures.ts +0 -247
  867. package/src/client/usage/summary.test.ts +0 -222
  868. package/src/client/utils/data.test.ts +0 -61
  869. package/src/client/utils/owner.test.ts +0 -38
  870. package/src/client/utils/stripeDashboardUrl.test.ts +0 -71
  871. package/src/client/utils/webhookEndpoints.test.ts +0 -459
  872. package/src/client/webhook-handlers.test.ts +0 -569
  873. package/src/client/webhooks/handler.test.ts +0 -601
  874. package/src/client/webhooks/helpers.test.ts +0 -343
  875. package/src/client/webhooks/hooks.test.ts +0 -119
  876. package/src/client/webhooks/meterErrors.test.ts +0 -164
  877. package/src/client/webhooks/payout-canceled.integration.test.ts +0 -230
  878. package/src/client/webhooks/payout-reconciliation.integration.test.ts +0 -168
  879. package/src/client/webhooks/payoutReconciliationTestHelpers.ts +0 -135
  880. package/src/client/webhooks/processors.test.ts +0 -2553
  881. package/src/client/webhooks/refund-delivery.test.ts +0 -512
  882. package/src/client/webhooks/refund-reconciliation.test.ts +0 -320
  883. package/src/client/webhooks/retry.integration.test.ts +0 -196
  884. package/src/client/webhooks/subscription-deleted-dispatch.test.ts +0 -61
  885. package/src/client/webhooks/subscription-deleted.integration.test.ts +0 -313
  886. package/src/client/webhooks/usageSubscriptions.test.ts +0 -162
  887. package/src/client/webhooks/v2.test.ts +0 -432
  888. package/src/client/webhooks.test.ts +0 -1681
  889. package/src/component/accountClosure/blockers.test.ts +0 -114
  890. package/src/component/affiliatePayouts/affiliate-direct-payout.test.ts +0 -159
  891. package/src/component/affiliateRecovery/affiliate-component-pagination.test.ts +0 -56
  892. package/src/component/affiliateRecovery/affiliate-recovery-lifecycle.test.ts +0 -586
  893. package/src/component/balanceFunding/failure.test.ts +0 -116
  894. package/src/component/balanceFunding/import.test.ts +0 -221
  895. package/src/component/balanceFunding/lookup.test.ts +0 -113
  896. package/src/component/balanceFunding/preparation.test.ts +0 -146
  897. package/src/component/balanceFunding/requestLookup.test.ts +0 -160
  898. package/src/component/balanceFunding/scopeLookup.test.ts +0 -94
  899. package/src/component/balanceFunding/state.test.ts +0 -352
  900. package/src/component/balanceFunding/validation.test.ts +0 -100
  901. package/src/component/balanceFunding/workflow.fixtures.ts +0 -366
  902. package/src/component/balanceFunding/workflow.test.ts +0 -552
  903. package/src/component/billing/checkout.test.ts +0 -89
  904. package/src/component/billing/invoices.test.ts +0 -294
  905. package/src/component/billing/store-subscriptions.test.ts +0 -31
  906. package/src/component/billing/subscription-scoping.test.ts +0 -120
  907. package/src/component/billing/subscriptions.test.ts +0 -477
  908. package/src/component/billingHistory/guards.test.ts +0 -235
  909. package/src/component/billingHistory/options.test.ts +0 -35
  910. package/src/component/billingHistory/pages.test.ts +0 -74
  911. package/src/component/connect/connect.test.ts +0 -715
  912. package/src/component/connect/fee-routing.test.ts +0 -122
  913. package/src/component/connect/payment-unique.test.ts +0 -195
  914. package/src/component/connect/payments.test.ts +0 -88
  915. package/src/component/connect/payouts.test.ts +0 -173
  916. package/src/component/connect/reversal-races.test.ts +0 -958
  917. package/src/component/connect/seller-case-ownership.test.ts +0 -60
  918. package/src/component/connect/transfers.test.ts +0 -517
  919. package/src/component/core/accounts.test.ts +0 -266
  920. package/src/component/core/config-queries.test.ts +0 -49
  921. package/src/component/core/original-id-unique.test.ts +0 -209
  922. package/src/component/core/payout-reset-safety.test.ts +0 -175
  923. package/src/component/core/personal-account-mapping.test.ts +0 -173
  924. package/src/component/core/reset.test.ts +0 -131
  925. package/src/component/costRecovery/cost-recovery.test.ts +0 -343
  926. package/src/component/costRecovery/preparation.test.ts +0 -355
  927. package/src/component/durableExecution/composition.test.ts +0 -568
  928. package/src/component/durableExecution/crossDomain.test.ts +0 -241
  929. package/src/component/durableExecution/crossDomainBoundaries.test.ts +0 -233
  930. package/src/component/durableExecution/crossDomainDisputes.test.ts +0 -108
  931. package/src/component/durableExecution/crossDomainMigration.test.ts +0 -192
  932. package/src/component/durableExecution/crossDomainWebhooks.test.ts +0 -122
  933. package/src/component/earnings/currency-migration.test.ts +0 -118
  934. package/src/component/earnings/currency-totals.test.ts +0 -94
  935. package/src/component/earnings/earnings-totals.test.ts +0 -237
  936. package/src/component/earnings/paired-adjustment.test.ts +0 -258
  937. package/src/component/earnings/summary-arithmetic.test.ts +0 -250
  938. package/src/component/financialObservations/continuation.test.ts +0 -445
  939. package/src/component/financialObservations/observation-boundaries.test.ts +0 -466
  940. package/src/component/financialObservations/settlement-observations.test.ts +0 -86
  941. package/src/component/financialObservations/transfer-batches.test.ts +0 -61
  942. package/src/component/financialObservations/transfer-boundaries.test.ts +0 -116
  943. package/src/component/financialObservations/transfer-continuation-guards.test.ts +0 -428
  944. package/src/component/financialObservations/transfer-continuation.test.ts +0 -154
  945. package/src/component/financialObservations/transfer-observations.test.ts +0 -212
  946. package/src/component/financialObservations/transfer-overflow.test.ts +0 -181
  947. package/src/component/financialObservations/transfer-writers.test.ts +0 -162
  948. package/src/component/financialOwnership/financial-ownership.test.ts +0 -102
  949. package/src/component/financialOwnership/ownership-boundaries.test.ts +0 -308
  950. package/src/component/lib/idempotency.test.ts +0 -37
  951. package/src/component/operationEvidence/integrity.test.ts +0 -257
  952. package/src/component/operationEvidence/maintenance.test.ts +0 -152
  953. package/src/component/operationEvidence/reads.test.ts +0 -140
  954. package/src/component/payoutPolicy/payout-policy-adoption.test.ts +0 -130
  955. package/src/component/payoutPolicy/payout-policy.test.ts +0 -247
  956. package/src/component/payoutRelease/payout-adoption.test.ts +0 -268
  957. package/src/component/payoutRelease/payout-fees.test.ts +0 -223
  958. package/src/component/payoutRelease/payout-recovery-integration.test.ts +0 -171
  959. package/src/component/payoutRelease/payout-release-snapshot.test.ts +0 -56
  960. package/src/component/payoutRelease/payout-release.test.ts +0 -587
  961. package/src/component/payoutRelease/progress.test.ts +0 -63
  962. package/src/component/payoutSnapshots/legacy-revisions.test.ts +0 -246
  963. package/src/component/payoutSnapshots/payout-revisions.test.ts +0 -124
  964. package/src/component/payoutSnapshots/payout-snapshots.test.ts +0 -438
  965. package/src/component/payoutSnapshots/revision-journal-callbacks.test.ts +0 -160
  966. package/src/component/payoutSnapshots/revision-journal-held.test.ts +0 -94
  967. package/src/component/payoutSnapshots/revision-journal.test.ts +0 -310
  968. package/src/component/payoutSnapshots/revision-migration.test.ts +0 -128
  969. package/src/component/payoutSync/payout-sync.test.ts +0 -116
  970. package/src/component/payoutWorker/payout-component-pagination.test.ts +0 -211
  971. package/src/component/payoutWorker/payout-worker.test.ts +0 -164
  972. package/src/component/processingCostReconciliation/adoption.test.ts +0 -206
  973. package/src/component/processingCostReconciliation/invoice.test.ts +0 -152
  974. package/src/component/processingCostReconciliation/state.test.ts +0 -407
  975. package/src/component/processingCostReconciliation/workflow.test.ts +0 -329
  976. package/src/component/products/identity.test.ts +0 -217
  977. package/src/component/products/products.test.ts +0 -239
  978. package/src/component/products/provider-price-pagination.test.ts +0 -174
  979. package/src/component/products/read-pagination.test.ts +0 -192
  980. package/src/component/recoveryWorkflow/bridge.test.ts +0 -481
  981. package/src/component/recoveryWorkflow/journal.test.ts +0 -104
  982. package/src/component/recoveryWorkflow/state.test.ts +0 -191
  983. package/src/component/refundHistory/command-evidence.test.ts +0 -288
  984. package/src/component/refundHistory/command-normalization-resource.test.ts +0 -77
  985. package/src/component/refundHistory/command-normalization.test.ts +0 -229
  986. package/src/component/refundHistory/command-provenance.test.ts +0 -59
  987. package/src/component/refundHistory/original-seller-boundaries.test.ts +0 -138
  988. package/src/component/refundHistory/original-seller.test.ts +0 -175
  989. package/src/component/refundHistory/refund-history.test.ts +0 -197
  990. package/src/component/refundSync/refund-sync.test.ts +0 -255
  991. package/src/component/renewalOperations/acknowledgement.fixtures.ts +0 -552
  992. package/src/component/renewalOperations/acknowledgement.test.ts +0 -573
  993. package/src/component/renewalOperations/acknowledgementReads.test.ts +0 -442
  994. package/src/component/renewalOperations/acknowledgementV2.test.ts +0 -493
  995. package/src/component/renewalOperations/acknowledgementV2Publication.test.ts +0 -373
  996. package/src/component/renewalOperations/basisBinding.test.ts +0 -567
  997. package/src/component/renewalOperations/basisLifecycle.test.ts +0 -569
  998. package/src/component/renewalOperations/boundHistory.test.ts +0 -474
  999. package/src/component/renewalOperations/configureAcknowledgement.test.ts +0 -30
  1000. package/src/component/renewalOperations/configureAcknowledgementControls.test.ts +0 -96
  1001. package/src/component/renewalOperations/configureBasis.test.ts +0 -77
  1002. package/src/component/renewalOperations/configureCreation.test.ts +0 -75
  1003. package/src/component/renewalOperations/configureJournal.fixtures.ts +0 -407
  1004. package/src/component/renewalOperations/configurePolicy.test.ts +0 -105
  1005. package/src/component/renewalOperations/configurePublication.test.ts +0 -85
  1006. package/src/component/renewalOperations/configureReceiptBounds.test.ts +0 -39
  1007. package/src/component/renewalOperations/configureSourceControls.test.ts +0 -65
  1008. package/src/component/renewalOperations/historyReads.test.ts +0 -595
  1009. package/src/component/renewalOperations/initialBasis.test.ts +0 -578
  1010. package/src/component/renewalOperations/journal.test.ts +0 -567
  1011. package/src/component/renewalOperations/payload.test.ts +0 -589
  1012. package/src/component/renewalOperations/payloadEncoding.test.ts +0 -592
  1013. package/src/component/renewalOperations/timingPolicy.fixtures.ts +0 -193
  1014. package/src/component/renewalOperations/timingPolicy.test.ts +0 -523
  1015. package/src/component/renewalWitnesses/bounds.test.ts +0 -204
  1016. package/src/component/renewalWitnesses/codec.test.ts +0 -84
  1017. package/src/component/renewalWitnesses/controls.test.ts +0 -250
  1018. package/src/component/renewalWitnesses/protocol.test.ts +0 -63
  1019. package/src/component/renewalWitnesses/routes.test.ts +0 -154
  1020. package/src/component/reversalObservations/boundaries.test.ts +0 -62
  1021. package/src/component/reversalObservations/capture-integrity.test.ts +0 -119
  1022. package/src/component/reversalObservations/continuation.test.ts +0 -131
  1023. package/src/component/reversalObservations/lifecycle.test.ts +0 -81
  1024. package/src/component/reversalObservations/provenance.test.ts +0 -167
  1025. package/src/component/settlement/affiliate-clawbacks.test.ts +0 -369
  1026. package/src/component/settlement/settlement-claims.test.ts +0 -130
  1027. package/src/component/usage/allowance.fixtures.ts +0 -77
  1028. package/src/component/usage/allowance.test.ts +0 -372
  1029. package/src/component/usage/allowanceBounds.test.ts +0 -79
  1030. package/src/component/usage/historyIsolation.test.ts +0 -124
  1031. package/src/component/usage/ledger.test.ts +0 -303
  1032. package/src/component/usageCorrections/corrections.test.ts +0 -389
  1033. package/src/component/usageCredits/accounting.fixtures.ts +0 -96
  1034. package/src/component/usageCredits/accounting.test.ts +0 -483
  1035. package/src/component/usageCredits/freshness.test.ts +0 -33
  1036. package/src/component/usageCredits/quotas.test.ts +0 -63
  1037. package/src/component/usageDelivery/concurrency.test.ts +0 -62
  1038. package/src/component/usageDelivery/workflow.test.ts +0 -402
  1039. package/src/component/usageObservations/history.test.ts +0 -87
  1040. package/src/component/usageObservations/queries.test.ts +0 -162
  1041. package/src/component/usageSubscriptions/acceptance.test.ts +0 -122
  1042. package/src/component/usageSubscriptions/history.test.ts +0 -126
  1043. package/src/component/usageSubscriptions/mutations.test.ts +0 -205
  1044. package/src/component/webhooks/events.test.ts +0 -121
  1045. package/src/component/webhooks/triggers.test.ts +0 -360
  1046. package/src/react/components/AccountOnboardingCard.test.ts +0 -27
  1047. package/src/react/components/BuyerBillingView.render.test.tsx +0 -212
  1048. package/src/react/components/ConnectProvider.live.test.tsx +0 -61
  1049. package/src/react/components/DisputeDetail.render.test.tsx +0 -147
  1050. package/src/react/components/DisputesList.render.test.tsx +0 -265
  1051. package/src/react/components/EarningsSummary.render.test.tsx +0 -149
  1052. package/src/react/components/EmbeddedCheckout.render.test.tsx +0 -57
  1053. package/src/react/components/EmbeddedCheckout.test.ts +0 -25
  1054. package/src/react/components/EmbeddedDisputes.render.test.tsx +0 -144
  1055. package/src/react/components/EvidenceForm.render.test.tsx +0 -208
  1056. package/src/react/components/PayoutSchedule.render.test.tsx +0 -193
  1057. package/src/react/components/PriceBadge.render.test.tsx +0 -134
  1058. package/src/react/components/PriceCard.render.test.tsx +0 -172
  1059. package/src/react/components/SplitBreakdown.render.test.tsx +0 -191
  1060. package/src/react/components/StripeProvider.test.ts +0 -45
  1061. package/src/react/components/TrialAlert.render.test.tsx +0 -132
  1062. package/src/react/hooks/skipSentinel.test.ts +0 -85
  1063. package/src/react/hooks/useAccountOnboarding.test.ts +0 -75
  1064. package/src/react/hooks/useCheckoutSession.promotions.test.tsx +0 -303
  1065. package/src/react/hooks/useConfirmPayment.test.tsx +0 -47
  1066. package/src/react/hooks/useCurrencyEarnings.test.ts +0 -59
  1067. package/src/react/hooks/useDisputeWithCountdown.test.ts +0 -90
  1068. package/src/react/hooks/useDisputes.test.ts +0 -75
  1069. package/src/react/hooks/useEarnings.test.ts +0 -194
  1070. package/src/react/hooks/useInvoices.test.ts +0 -79
  1071. package/src/react/hooks/useProducts.test.ts +0 -75
  1072. package/src/react/hooks/useSplitBreakdown.test.ts +0 -151
  1073. package/src/react/hooks/useStripeMode.test.ts +0 -46
  1074. package/src/react/hooks/useStripePublishableKey.test.ts +0 -35
  1075. package/src/react/index.payment-element.test.ts +0 -26
  1076. package/src/react/index.test.ts +0 -172
  1077. package/src/react/lib/connect-requirement-keys.test.ts +0 -73
  1078. package/src/react/lib/price-helpers.test.ts +0 -212
  1079. package/src/react/lib/stripe-element-styles.test.ts +0 -94
  1080. package/src/react/lib/subscription-helpers.test.ts +0 -127
  1081. package/src/react/read-contracts.render.test.tsx +0 -20
  1082. package/src/react/workflows/Account.test.tsx +0 -31
  1083. package/src/react/workflows/AffiliatePayoutEditor.test.tsx +0 -90
  1084. package/src/react/workflows/AffiliateRateEditor.test.tsx +0 -36
  1085. package/src/react/workflows/AffiliateRecovery.test.tsx +0 -106
  1086. package/src/react/workflows/Billing.test.tsx +0 -45
  1087. package/src/react/workflows/BillingPlans.test.tsx +0 -31
  1088. package/src/react/workflows/BillingPortal.test.tsx +0 -101
  1089. package/src/react/workflows/Checkout.test.tsx +0 -148
  1090. package/src/react/workflows/CheckoutChooser.test.tsx +0 -44
  1091. package/src/react/workflows/CheckoutForm.test.tsx +0 -66
  1092. package/src/react/workflows/CheckoutForms.test.tsx +0 -163
  1093. package/src/react/workflows/ClipboardButton.test.tsx +0 -34
  1094. package/src/react/workflows/Collections.test.tsx +0 -122
  1095. package/src/react/workflows/Connect.test.tsx +0 -50
  1096. package/src/react/workflows/Costs.test.tsx +0 -62
  1097. package/src/react/workflows/Disputes.test.tsx +0 -64
  1098. package/src/react/workflows/Earnings.test.ts +0 -19
  1099. package/src/react/workflows/EvidenceUpload.test.tsx +0 -56
  1100. package/src/react/workflows/Financials.test.tsx +0 -35
  1101. package/src/react/workflows/IntegrationSwitch.test.tsx +0 -61
  1102. package/src/react/workflows/Onboarding.test.tsx +0 -148
  1103. package/src/react/workflows/Overview.test.tsx +0 -57
  1104. package/src/react/workflows/Pagination.test.tsx +0 -53
  1105. package/src/react/workflows/PaymentMethods.test.tsx +0 -60
  1106. package/src/react/workflows/PaymentReceipt.test.tsx +0 -24
  1107. package/src/react/workflows/PayoutProgress.test.tsx +0 -356
  1108. package/src/react/workflows/PayoutSettings.test.tsx +0 -139
  1109. package/src/react/workflows/Payouts.test.tsx +0 -145
  1110. package/src/react/workflows/PlanPricingEditor.currency.test.tsx +0 -164
  1111. package/src/react/workflows/PlanPricingEditor.test.tsx +0 -79
  1112. package/src/react/workflows/PlanPricingEditor.zero.test.tsx +0 -100
  1113. package/src/react/workflows/Products.test.tsx +0 -282
  1114. package/src/react/workflows/ReferralLinks.test.tsx +0 -39
  1115. package/src/react/workflows/Refunds.currency.test.tsx +0 -290
  1116. package/src/react/workflows/Refunds.test.tsx +0 -75
  1117. package/src/react/workflows/SaveCard.test.tsx +0 -127
  1118. package/src/react/workflows/Setup.test.tsx +0 -25
  1119. package/src/react/workflows/Storefront.test.tsx +0 -82
  1120. package/src/react/workflows/SubscriptionOverview.test.tsx +0 -27
  1121. package/src/react/workflows/Subscriptions.test.tsx +0 -61
  1122. package/src/react/workflows/Tasks.test.tsx +0 -23
  1123. package/src/react/workflows/Usage.fixtures.ts +0 -88
  1124. package/src/react/workflows/Usage.test.tsx +0 -388
  1125. package/src/react/workflows/UsageConfiguration.test.tsx +0 -393
  1126. package/src/react/workflows/UsageHistory.test.tsx +0 -206
  1127. package/src/react/workflows/UsagePriceRow.test.tsx +0 -140
  1128. package/src/react/workflows/current-subscription.test.ts +0 -29
  1129. package/src/react/workflows/filters.test.ts +0 -12
  1130. package/src/react/workflows/native-interactions.test.tsx +0 -73
  1131. package/src/react/workflows/public-workflows.test.tsx +0 -216
  1132. package/src/react/workflows/refund-preview.test.ts +0 -65
  1133. package/src/react/workflows/usage-configuration-validation.test.ts +0 -107
  1134. package/src/react/workflows/useWorkflowAction.commit.test.tsx +0 -194
  1135. package/src/react/workflows/useWorkflowAction.ssr.test.tsx +0 -20
  1136. package/src/react/workflows/useWorkflowAction.test.tsx +0 -54
  1137. package/src/react/workflows/useWorkflowResource.test.tsx +0 -41
  1138. package/src/test.ts +0 -21
  1139. package/src/testing/assert-test-env.test.ts +0 -33
  1140. package/src/testing/component-db.ts +0 -24
  1141. package/src/testing/crossDomain/fixture.ts +0 -96
  1142. package/src/testing/crossDomain/host.ts +0 -288
  1143. package/src/testing/crossDomain/transport.ts +0 -293
  1144. package/src/testing/mock-webhooks.test.ts +0 -97
@@ -1,1681 +0,0 @@
1
- // @vitest-environment edge-runtime
2
- import { type Mock, beforeEach, describe, expect, it, vi } from "vitest";
3
-
4
- import type {
5
- RegisterRoutesConfig,
6
- V2ThinEvent,
7
- WebhookActionCtx,
8
- } from "./types.js";
9
- // ---------------------------------------------------------------------------
10
- // Import after mocks are set up
11
- // ---------------------------------------------------------------------------
12
-
13
- // We can't call registerRoutes directly because it needs HttpRouter.
14
- // Instead, import the module and extract handleWebhookRequest via registerRoutes.
15
- import { registerRoutes } from "./webhooks.js";
16
- import { mockQualifiedRefund } from "../../tests/fixtures/qualified-refund.js";
17
-
18
- // ---------------------------------------------------------------------------
19
- // Mock Stripe SDK
20
- // ---------------------------------------------------------------------------
21
-
22
- const mockConstructEventAsync = vi.fn();
23
- const mockParseEventNotification = vi.fn();
24
- const mockParseEventNotificationAsync = vi.fn();
25
- const mockAccountRetrieve = vi.fn();
26
- const mockRefundRetrieve = vi.fn();
27
-
28
- vi.mock("stripe", () => {
29
- return {
30
- default: class StripeMock {
31
- webhooks = { constructEventAsync: mockConstructEventAsync };
32
- parseEventNotification = mockParseEventNotification;
33
- parseEventNotificationAsync = mockParseEventNotificationAsync;
34
- v2 = { core: { accounts: { retrieve: mockAccountRetrieve } } };
35
- products = { retrieve: vi.fn() };
36
- refunds = { retrieve: mockRefundRetrieve };
37
- },
38
- };
39
- });
40
-
41
- // Mock httpActionGeneric to capture the raw handler
42
- let _capturedHandler:
43
- ((ctx: any, request: Request) => Promise<Response>) | undefined;
44
-
45
- vi.mock("convex/server", () => ({
46
- httpActionGeneric: (fn: any) => fn,
47
- }));
48
-
49
- // ---------------------------------------------------------------------------
50
- // Helpers
51
- // ---------------------------------------------------------------------------
52
-
53
- function createMockCtx(
54
- overrides?: Partial<Omit<WebhookActionCtx, "scheduler">> & {
55
- scheduler?: { runAfter: Mock };
56
- },
57
- ): WebhookActionCtx {
58
- return {
59
- runMutation: vi.fn().mockResolvedValue("inserted"),
60
- runQuery: vi.fn().mockResolvedValue(null),
61
- runAction: vi.fn().mockResolvedValue(null),
62
- ...overrides,
63
- } as WebhookActionCtx;
64
- }
65
-
66
- const TO_REFERENCE_PATH = Symbol.for("toReferencePath");
67
-
68
- function makeRef(path: string) {
69
- return { [TO_REFERENCE_PATH]: `betterStripe/${path}` };
70
- }
71
-
72
- function createMockComponent(): any {
73
- return {
74
- core: {
75
- queries: {
76
- getAccount: makeRef("core/queries/getAccount"),
77
- getAccountByStripeId: makeRef("core/queries/getAccountByStripeId"),
78
- getAccountByUserId: makeRef("core/queries/getAccountByUserId"),
79
- },
80
- mutations: {
81
- upsertAccount: makeRef("core/mutations/upsertAccount"),
82
- upsertAccountInternal: makeRef("core/mutations/upsertAccountInternal"),
83
- },
84
- },
85
- products: {
86
- queries: {
87
- getProductByStripeId: makeRef("products/queries/getProductByStripeId"),
88
- },
89
- mutations: {
90
- upsertProduct: makeRef("products/mutations/upsertProduct"),
91
- upsertPrice: makeRef("products/mutations/upsertPrice"),
92
- },
93
- },
94
- billing: {
95
- queries: {
96
- getCheckoutSessionByStripeId: makeRef(
97
- "billing/queries/getCheckoutSessionByStripeId",
98
- ),
99
- getSubscriptionByStripeId: makeRef(
100
- "billing/queries/getSubscriptionByStripeId",
101
- ),
102
- },
103
- mutations: {
104
- upsertSubscription: makeRef("billing/mutations/upsertSubscription"),
105
- upsertCheckoutSession: makeRef(
106
- "billing/mutations/upsertCheckoutSession",
107
- ),
108
- upsertInvoice: makeRef("billing/mutations/upsertInvoice"),
109
- },
110
- },
111
- connect: {
112
- queries: {
113
- getRefundByStripeId: makeRef("connect/queries/getRefundByStripeId"),
114
- getDisputeByStripeId: makeRef("connect/queries/getDisputeByStripeId"),
115
- },
116
- mutations: {
117
- upsertPayment: makeRef("connect/mutations/upsertPayment"),
118
- upsertPayout: makeRef("connect/mutations/upsertPayout"),
119
- upsertRefund: makeRef("connect/mutations/upsertRefund"),
120
- upsertDispute: makeRef("connect/mutations/upsertDispute"),
121
- },
122
- },
123
- webhooks: {
124
- mutations: {
125
- insertWebhookEvent: makeRef("webhooks/mutations/insertWebhookEvent"),
126
- markWebhookEventProcessed: makeRef(
127
- "webhooks/mutations/markWebhookEventProcessed",
128
- ),
129
- markWebhookEventFailed: makeRef(
130
- "webhooks/mutations/markWebhookEventFailed",
131
- ),
132
- },
133
- },
134
- };
135
- }
136
-
137
- function makeBaseConfig(
138
- overrides?: Partial<RegisterRoutesConfig>,
139
- ): RegisterRoutesConfig {
140
- return {
141
- stripeSecretKey: "sk_test_123",
142
- webhookSecret: "whsec_test_123",
143
- ...overrides,
144
- };
145
- }
146
-
147
- function makeRequest(body: unknown, headers?: Record<string, string>): Request {
148
- return new Request("https://example.com/stripe/webhook", {
149
- method: "POST",
150
- body: typeof body === "string" ? body : JSON.stringify(body),
151
- headers: {
152
- "stripe-signature": "test_sig_123",
153
- "content-type": "application/json",
154
- ...headers,
155
- },
156
- });
157
- }
158
-
159
- function makeV1Event(type: string, obj: Record<string, any> = {}): any {
160
- return {
161
- id: "evt_test_" + Math.random().toString(36).slice(2, 8),
162
- type,
163
- livemode: false,
164
- data: { object: obj },
165
- };
166
- }
167
-
168
- function makeV2ThinEvent(overrides?: Partial<V2ThinEvent>): V2ThinEvent {
169
- return {
170
- id: "evt_v2_test_" + Math.random().toString(36).slice(2, 8),
171
- type: "v2.core.account.updated",
172
- created: new Date().toISOString(),
173
- livemode: false,
174
- related_object: {
175
- id: "acct_test_123",
176
- type: "v2.core.account",
177
- url: "/v2/core/accounts/acct_test_123",
178
- },
179
- ...overrides,
180
- };
181
- }
182
-
183
- async function parseJson(response: Response): Promise<any> {
184
- return JSON.parse(await response.text());
185
- }
186
-
187
- // ---------------------------------------------------------------------------
188
- // Tests
189
- // ---------------------------------------------------------------------------
190
-
191
- describe("webhooks", () => {
192
- let ctx: WebhookActionCtx;
193
- let component: ReturnType<typeof createMockComponent>;
194
- let handler: (ctx: WebhookActionCtx, request: Request) => Promise<Response>;
195
-
196
- beforeEach(() => {
197
- vi.clearAllMocks();
198
- ctx = createMockCtx();
199
- component = createMockComponent();
200
-
201
- // Default: constructEventAsync returns a valid V1 event
202
- mockConstructEventAsync.mockResolvedValue(
203
- makeV1Event("product.created", {
204
- id: "prod_123",
205
- name: "Test",
206
- active: true,
207
- }),
208
- );
209
-
210
- // Set up the handler via registerRoutes, using a fresh component each time
211
- let rawHandler: any;
212
- const fakeRouter = {
213
- route: (opts: any) => {
214
- rawHandler = opts.handler;
215
- },
216
- };
217
- registerRoutes(fakeRouter as any, component, makeBaseConfig());
218
- handler = rawHandler;
219
- });
220
-
221
- // =========================================================================
222
- // Signature & Parse
223
- // =========================================================================
224
-
225
- describe("Signature & Parse", () => {
226
- it("returns 400 for missing stripe-signature header", async () => {
227
- const request = new Request("https://example.com/stripe/webhook", {
228
- method: "POST",
229
- body: JSON.stringify({ type: "product.created" }),
230
- headers: { "content-type": "application/json" },
231
- // No stripe-signature header
232
- });
233
-
234
- const response = await handler(ctx, request);
235
- expect(response.status).toBe(400);
236
- const body = await parseJson(response);
237
- expect(body.error).toMatch(/missing stripe-signature/i);
238
- });
239
-
240
- it("returns 400 for invalid JSON body", async () => {
241
- const request = new Request("https://example.com/stripe/webhook", {
242
- method: "POST",
243
- body: "not-json{{{{",
244
- headers: {
245
- "stripe-signature": "test_sig",
246
- "content-type": "application/json",
247
- },
248
- });
249
-
250
- const response = await handler(ctx, request);
251
- expect(response.status).toBe(400);
252
- const body = await parseJson(response);
253
- expect(body.error).toMatch(/invalid json/i);
254
- });
255
-
256
- it("returns 400 for failed signature verification", async () => {
257
- mockConstructEventAsync.mockRejectedValue(
258
- new Error("Signature verification failed"),
259
- );
260
-
261
- const request = makeRequest({ type: "product.created", id: "evt_123" });
262
- const response = await handler(ctx, request);
263
- expect(response.status).toBe(400);
264
- const body = await parseJson(response);
265
- expect(body.error).toMatch(/signature verification failed/i);
266
- });
267
- });
268
-
269
- // =========================================================================
270
- // Dedup
271
- // =========================================================================
272
-
273
- describe("Dedup", () => {
274
- it("returns 200 for duplicate event (already processed)", async () => {
275
- const event = makeV1Event("product.created", {
276
- id: "prod_123",
277
- name: "Test",
278
- active: true,
279
- });
280
- mockConstructEventAsync.mockResolvedValue(event);
281
- (ctx.runMutation as Mock).mockResolvedValueOnce("already_processed");
282
-
283
- const request = makeRequest({ type: "product.created" });
284
- const response = await handler(ctx, request);
285
- expect(response.status).toBe(200);
286
- const body = await parseJson(response);
287
- expect(body.deduplicated).toBe(true);
288
- });
289
-
290
- it("returns 200 for duplicate event (currently processing)", async () => {
291
- const event = makeV1Event("product.created", {
292
- id: "prod_123",
293
- name: "Test",
294
- active: true,
295
- });
296
- mockConstructEventAsync.mockResolvedValue(event);
297
- (ctx.runMutation as Mock).mockResolvedValueOnce("processing");
298
-
299
- const request = makeRequest({ type: "product.created" });
300
- const response = await handler(ctx, request);
301
- expect(response.status).toBe(200);
302
- const body = await parseJson(response);
303
- expect(body.deduplicated).toBe(true);
304
- });
305
- });
306
-
307
- // =========================================================================
308
- // Happy path (V1)
309
- // =========================================================================
310
-
311
- describe("Happy path", () => {
312
- it("calls processEvent for valid V1 events", async () => {
313
- const event = makeV1Event("product.created", {
314
- id: "prod_123",
315
- name: "Test Product",
316
- active: true,
317
- description: null,
318
- metadata: {},
319
- });
320
- mockConstructEventAsync.mockResolvedValue(event);
321
-
322
- const request = makeRequest({ type: "product.created" });
323
- const response = await handler(ctx, request);
324
- expect(response.status).toBe(200);
325
-
326
- // Verify upsertProduct was called
327
- expect(ctx.runMutation).toHaveBeenCalledWith(
328
- component.products.mutations.upsertProduct,
329
- expect.objectContaining({
330
- stripeProductId: "prod_123",
331
- name: "Test Product",
332
- active: true,
333
- }),
334
- );
335
- });
336
-
337
- it("returns 500 when processEvent throws", async () => {
338
- const event = makeV1Event("product.created", {
339
- id: "prod_123",
340
- name: "Test",
341
- active: true,
342
- });
343
- mockConstructEventAsync.mockResolvedValue(event);
344
-
345
- // First call: insertWebhookEvent (success)
346
- // Second call: upsertProduct (throws)
347
- (ctx.runMutation as Mock)
348
- .mockResolvedValueOnce("inserted") // insertWebhookEvent
349
- .mockRejectedValueOnce(new Error("DB write failed")); // upsertProduct
350
-
351
- const request = makeRequest({ type: "product.created" });
352
- const response = await handler(ctx, request);
353
- expect(response.status).toBe(500);
354
- const body = await parseJson(response);
355
- expect(body.error).toMatch(/sync processing failed/i);
356
- });
357
-
358
- it("marks event as failed in ledger on error", async () => {
359
- const event = makeV1Event("product.created", {
360
- id: "prod_123",
361
- name: "Test",
362
- active: true,
363
- });
364
- mockConstructEventAsync.mockResolvedValue(event);
365
-
366
- (ctx.runMutation as Mock)
367
- .mockResolvedValueOnce("inserted") // insertWebhookEvent
368
- .mockRejectedValueOnce(new Error("DB write failed")) // upsertProduct
369
- .mockResolvedValueOnce(undefined); // markWebhookEventFailed
370
-
371
- const request = makeRequest({ type: "product.created" });
372
- await handler(ctx, request);
373
-
374
- expect(ctx.runMutation).toHaveBeenCalledWith(
375
- component.webhooks.mutations.markWebhookEventFailed,
376
- expect.objectContaining({
377
- stripeEventId: event.id,
378
- error: "DB write failed",
379
- }),
380
- );
381
- });
382
-
383
- it("reprocesses a previously failed event on Stripe retry", async () => {
384
- const event = makeV1Event("product.created", {
385
- id: "prod_retry",
386
- name: "Retry Product",
387
- active: true,
388
- metadata: {},
389
- });
390
- mockConstructEventAsync.mockResolvedValue(event);
391
-
392
- // --- First delivery: processor mutation rejects ---
393
- (ctx.runMutation as Mock)
394
- .mockResolvedValueOnce("inserted") // insertWebhookEvent
395
- .mockRejectedValueOnce(new Error("trigger exploded")) // upsertProduct
396
- .mockResolvedValueOnce(undefined); // markWebhookEventFailed
397
-
398
- const first = await handler(
399
- ctx,
400
- makeRequest({ type: "product.created" }),
401
- );
402
- expect(first.status).toBe(500);
403
- expect(ctx.runMutation).toHaveBeenCalledWith(
404
- component.webhooks.mutations.markWebhookEventFailed,
405
- expect.objectContaining({
406
- stripeEventId: event.id,
407
- error: "trigger exploded",
408
- }),
409
- );
410
-
411
- // --- Second delivery of the SAME event id: insertWebhookEvent resets
412
- // the failed ledger row and returns "inserted" again, so the handler
413
- // must fully reprocess instead of deduplicating.
414
- (ctx.runMutation as Mock).mockClear();
415
- (ctx.runMutation as Mock).mockResolvedValue("inserted");
416
-
417
- const second = await handler(
418
- ctx,
419
- makeRequest({ type: "product.created" }),
420
- );
421
- expect(second.status).toBe(200);
422
- expect(JSON.parse(await second.text()).deduplicated).toBeUndefined();
423
- expect(ctx.runMutation).toHaveBeenCalledWith(
424
- component.products.mutations.upsertProduct,
425
- expect.objectContaining({ stripeProductId: "prod_retry" }),
426
- );
427
- expect(ctx.runMutation).toHaveBeenCalledWith(
428
- component.webhooks.mutations.markWebhookEventProcessed,
429
- { stripeEventId: event.id },
430
- );
431
- });
432
-
433
- it("runHooks error does not crash handler", async () => {
434
- const event = makeV1Event("product.created", {
435
- id: "prod_123",
436
- name: "Test",
437
- active: true,
438
- metadata: {},
439
- });
440
- mockConstructEventAsync.mockResolvedValue(event);
441
-
442
- // Re-register with hooks that throw
443
- let rawHandler: any;
444
- const fakeRouter = {
445
- route: (opts: any) => {
446
- rawHandler = opts.handler;
447
- },
448
- };
449
- registerRoutes(fakeRouter as any, component, {
450
- ...makeBaseConfig(),
451
- onEvent: async () => {
452
- throw new Error("Hook exploded");
453
- },
454
- });
455
-
456
- const response = await rawHandler(
457
- ctx,
458
- makeRequest({ type: "product.created" }),
459
- );
460
- // Handler should still return 200 despite hook error
461
- expect(response.status).toBe(200);
462
- });
463
- });
464
-
465
- // =========================================================================
466
- // V2 Events
467
- // =========================================================================
468
-
469
- describe("V2 Events", () => {
470
- const v2Body = (event: V2ThinEvent) => JSON.stringify(event);
471
-
472
- function makeV2Request(event: V2ThinEvent): Request {
473
- return new Request("https://example.com/stripe/webhook", {
474
- method: "POST",
475
- body: v2Body(event),
476
- headers: {
477
- "stripe-signature": "test_sig_v2",
478
- "content-type": "application/json",
479
- },
480
- });
481
- }
482
-
483
- function setupV2Mocks(accountOverrides?: Record<string, any>) {
484
- const defaultAccount = {
485
- id: "acct_test_123",
486
- contact_email: "test@example.com",
487
- identity: {
488
- business_details: { registered_name: "Test Business" },
489
- country: "US",
490
- },
491
- metadata: { userId: "user_123" },
492
- requirements: {},
493
- configuration: {
494
- customer: { applied: true },
495
- },
496
- ...accountOverrides,
497
- };
498
- mockAccountRetrieve.mockResolvedValue(defaultAccount);
499
- return defaultAccount;
500
- }
501
-
502
- it("verifies signature via parseEventNotificationAsync, not constructEventAsync", async () => {
503
- // stripe-node v22+ throws if a thin payload is passed to
504
- // webhooks.constructEventAsync ("Use stripe.parseEventNotificationAsync
505
- // instead"), so the V2 path MUST use the thin-event API.
506
- const thinEvent = makeV2ThinEvent();
507
- mockParseEventNotificationAsync.mockResolvedValue(thinEvent);
508
- setupV2Mocks();
509
-
510
- const request = makeV2Request(thinEvent);
511
- await handler(ctx, request);
512
-
513
- expect(mockParseEventNotificationAsync).toHaveBeenCalledWith(
514
- v2Body(thinEvent),
515
- "test_sig_v2",
516
- "whsec_test_123",
517
- );
518
- expect(mockConstructEventAsync).not.toHaveBeenCalled();
519
- });
520
-
521
- it("uses webhookSecretV2 for thin-event verification when configured", async () => {
522
- const thinEvent = makeV2ThinEvent();
523
- mockParseEventNotificationAsync.mockResolvedValue(thinEvent);
524
- setupV2Mocks();
525
-
526
- let rawHandler: any;
527
- const fakeRouter = {
528
- route: (opts: any) => {
529
- rawHandler = opts.handler;
530
- },
531
- };
532
- registerRoutes(fakeRouter as any, component, {
533
- ...makeBaseConfig(),
534
- webhookSecretV2: "whsec_v2_456",
535
- });
536
-
537
- await rawHandler(ctx, makeV2Request(thinEvent));
538
-
539
- expect(mockParseEventNotificationAsync).toHaveBeenCalledWith(
540
- v2Body(thinEvent),
541
- "test_sig_v2",
542
- "whsec_v2_456",
543
- );
544
- });
545
-
546
- it("returns 400 when thin-event verification fails", async () => {
547
- const thinEvent = makeV2ThinEvent();
548
- mockParseEventNotificationAsync.mockRejectedValue(
549
- new Error("No signatures found matching the expected signature"),
550
- );
551
-
552
- const request = makeV2Request(thinEvent);
553
- const response = await handler(ctx, request);
554
-
555
- expect(response.status).toBe(400);
556
- const body = await parseJson(response);
557
- expect(body.error).toMatch(/signature/i);
558
- });
559
-
560
- it("uses parsed body as verified event data", async () => {
561
- const thinEvent = makeV2ThinEvent({ id: "evt_v2_parsed" });
562
- mockParseEventNotificationAsync.mockResolvedValue({});
563
- setupV2Mocks();
564
-
565
- const request = makeV2Request(thinEvent);
566
- await handler(ctx, request);
567
-
568
- // The ledger should use the event ID from the parsed body
569
- expect(ctx.runMutation).toHaveBeenCalledWith(
570
- component.webhooks.mutations.insertWebhookEvent,
571
- expect.objectContaining({
572
- stripeEventId: "evt_v2_parsed",
573
- }),
574
- );
575
- });
576
-
577
- it("duplicate event returns 200", async () => {
578
- const thinEvent = makeV2ThinEvent();
579
- mockParseEventNotificationAsync.mockResolvedValue(thinEvent);
580
- (ctx.runMutation as Mock).mockResolvedValueOnce("already_processed");
581
-
582
- const request = makeV2Request(thinEvent);
583
- const response = await handler(ctx, request);
584
- expect(response.status).toBe(200);
585
- const body = await parseJson(response);
586
- expect(body.deduplicated).toBe(true);
587
- });
588
-
589
- it("calls upsertAccount mutation", async () => {
590
- const thinEvent = makeV2ThinEvent();
591
- mockParseEventNotificationAsync.mockResolvedValue(thinEvent);
592
- setupV2Mocks();
593
-
594
- const request = makeV2Request(thinEvent);
595
- const response = await handler(ctx, request);
596
- expect(response.status).toBe(200);
597
-
598
- expect(ctx.runMutation).toHaveBeenCalledWith(
599
- component.core.mutations.upsertAccountInternal,
600
- expect.objectContaining({
601
- stripeAccountId: "acct_test_123",
602
- userId: "user_123",
603
- email: "test@example.com",
604
- name: "Test Business",
605
- }),
606
- );
607
- });
608
-
609
- it("calls onEvent hook", async () => {
610
- const thinEvent = makeV2ThinEvent();
611
- mockParseEventNotificationAsync.mockResolvedValue(thinEvent);
612
- setupV2Mocks();
613
-
614
- const onEvent = vi.fn().mockResolvedValue(undefined);
615
-
616
- let rawHandler: any;
617
- const fakeRouter = {
618
- route: (opts: any) => {
619
- rawHandler = opts.handler;
620
- },
621
- };
622
- registerRoutes(fakeRouter as any, component, {
623
- ...makeBaseConfig(),
624
- onEvent,
625
- });
626
-
627
- const response = await rawHandler(ctx, makeV2Request(thinEvent));
628
- expect(response.status).toBe(200);
629
- expect(onEvent).toHaveBeenCalledWith(ctx, thinEvent);
630
- });
631
-
632
- it("calls typed event handler", async () => {
633
- const thinEvent = makeV2ThinEvent({ type: "v2.core.account.updated" });
634
- mockParseEventNotificationAsync.mockResolvedValue(thinEvent);
635
- setupV2Mocks();
636
-
637
- const typedHandler = vi.fn().mockResolvedValue(undefined);
638
-
639
- let rawHandler: any;
640
- const fakeRouter = {
641
- route: (opts: any) => {
642
- rawHandler = opts.handler;
643
- },
644
- };
645
- registerRoutes(fakeRouter as any, component, {
646
- ...makeBaseConfig(),
647
- events: { "v2.core.account.updated": typedHandler },
648
- });
649
-
650
- const response = await rawHandler(ctx, makeV2Request(thinEvent));
651
- expect(response.status).toBe(200);
652
- expect(typedHandler).toHaveBeenCalledWith(ctx, thinEvent);
653
- });
654
-
655
- it("marks ledger failed on sync error", async () => {
656
- const thinEvent = makeV2ThinEvent();
657
- mockParseEventNotificationAsync.mockResolvedValue(thinEvent);
658
- mockAccountRetrieve.mockRejectedValue(new Error("Stripe API down"));
659
-
660
- (ctx.runMutation as Mock)
661
- .mockResolvedValueOnce("inserted") // insertWebhookEvent
662
- .mockResolvedValueOnce(undefined); // markWebhookEventFailed
663
-
664
- const request = makeV2Request(thinEvent);
665
- const response = await handler(ctx, request);
666
- expect(response.status).toBe(500);
667
-
668
- expect(ctx.runMutation).toHaveBeenCalledWith(
669
- component.webhooks.mutations.markWebhookEventFailed,
670
- expect.objectContaining({
671
- stripeEventId: thinEvent.id,
672
- error: "Stripe API down",
673
- }),
674
- );
675
- });
676
-
677
- it("marks ledger processed on success", async () => {
678
- const thinEvent = makeV2ThinEvent();
679
- mockParseEventNotificationAsync.mockResolvedValue(thinEvent);
680
- setupV2Mocks();
681
-
682
- const request = makeV2Request(thinEvent);
683
- const response = await handler(ctx, request);
684
- expect(response.status).toBe(200);
685
-
686
- expect(ctx.runMutation).toHaveBeenCalledWith(
687
- component.webhooks.mutations.markWebhookEventProcessed,
688
- { stripeEventId: thinEvent.id },
689
- );
690
- });
691
-
692
- it("derives pending onboarding status", async () => {
693
- const thinEvent = makeV2ThinEvent();
694
- mockParseEventNotificationAsync.mockResolvedValue(thinEvent);
695
- setupV2Mocks({
696
- requirements: {},
697
- configuration: {},
698
- });
699
-
700
- const request = makeV2Request(thinEvent);
701
- await handler(ctx, request);
702
-
703
- expect(ctx.runMutation).toHaveBeenCalledWith(
704
- component.core.mutations.upsertAccountInternal,
705
- expect.objectContaining({
706
- onboardingStatus: "pending",
707
- }),
708
- );
709
- });
710
-
711
- it("derives in_progress when requirements due", async () => {
712
- const thinEvent = makeV2ThinEvent();
713
- mockParseEventNotificationAsync.mockResolvedValue(thinEvent);
714
- setupV2Mocks({
715
- requirements: {
716
- entries: [
717
- {
718
- description: "business_url",
719
- awaiting_action_from: "user",
720
- errors: [],
721
- impact: { restricts_capabilities: [] },
722
- minimum_deadline: { status: "currently_due" },
723
- requested_reasons: [],
724
- },
725
- {
726
- description: "tos_acceptance",
727
- awaiting_action_from: "user",
728
- errors: [],
729
- impact: { restricts_capabilities: [] },
730
- minimum_deadline: { status: "currently_due" },
731
- requested_reasons: [],
732
- },
733
- ],
734
- },
735
- configuration: {},
736
- });
737
-
738
- const request = makeV2Request(thinEvent);
739
- await handler(ctx, request);
740
-
741
- expect(ctx.runMutation).toHaveBeenCalledWith(
742
- component.core.mutations.upsertAccountInternal,
743
- expect.objectContaining({
744
- onboardingStatus: "in_progress",
745
- }),
746
- );
747
- });
748
-
749
- it("derives restricted when deadline is past_due", async () => {
750
- const thinEvent = makeV2ThinEvent();
751
- mockParseEventNotificationAsync.mockResolvedValue(thinEvent);
752
- setupV2Mocks({
753
- requirements: {
754
- entries: [
755
- {
756
- description: "tos_acceptance",
757
- awaiting_action_from: "user",
758
- errors: [],
759
- impact: { restricts_capabilities: [] },
760
- minimum_deadline: { status: "currently_due" },
761
- requested_reasons: [],
762
- },
763
- ],
764
- summary: {
765
- minimum_deadline: { status: "past_due" },
766
- },
767
- },
768
- configuration: {},
769
- });
770
-
771
- const request = makeV2Request(thinEvent);
772
- await handler(ctx, request);
773
-
774
- expect(ctx.runMutation).toHaveBeenCalledWith(
775
- component.core.mutations.upsertAccountInternal,
776
- expect.objectContaining({
777
- onboardingStatus: "restricted",
778
- }),
779
- );
780
- });
781
-
782
- it("derives complete when configurations applied", async () => {
783
- const thinEvent = makeV2ThinEvent();
784
- mockParseEventNotificationAsync.mockResolvedValue(thinEvent);
785
- setupV2Mocks({
786
- requirements: {},
787
- configuration: {
788
- customer: { applied: true },
789
- merchant: { applied: true },
790
- },
791
- });
792
-
793
- const request = makeV2Request(thinEvent);
794
- await handler(ctx, request);
795
-
796
- expect(ctx.runMutation).toHaveBeenCalledWith(
797
- component.core.mutations.upsertAccountInternal,
798
- expect.objectContaining({
799
- onboardingStatus: "complete",
800
- }),
801
- );
802
- });
803
-
804
- it("persists missingRequirements array", async () => {
805
- const thinEvent = makeV2ThinEvent();
806
- mockParseEventNotificationAsync.mockResolvedValue(thinEvent);
807
- setupV2Mocks({
808
- requirements: {
809
- entries: [
810
- {
811
- description: "business_url",
812
- awaiting_action_from: "user",
813
- errors: [],
814
- impact: { restricts_capabilities: [] },
815
- minimum_deadline: { status: "currently_due" },
816
- requested_reasons: [],
817
- },
818
- {
819
- description: "tos_acceptance",
820
- awaiting_action_from: "user",
821
- errors: [],
822
- impact: { restricts_capabilities: [] },
823
- minimum_deadline: { status: "past_due" },
824
- requested_reasons: [],
825
- },
826
- {
827
- description: "identity_document",
828
- awaiting_action_from: "stripe",
829
- errors: [],
830
- impact: { restricts_capabilities: [] },
831
- minimum_deadline: { status: "currently_due" },
832
- requested_reasons: [],
833
- },
834
- ],
835
- },
836
- configuration: {},
837
- });
838
-
839
- const request = makeV2Request(thinEvent);
840
- await handler(ctx, request);
841
-
842
- expect(ctx.runMutation).toHaveBeenCalledWith(
843
- component.core.mutations.upsertAccountInternal,
844
- expect.objectContaining({
845
- missingRequirements: expect.arrayContaining([
846
- "business_url",
847
- "tos_acceptance",
848
- "identity_document",
849
- ]),
850
- }),
851
- );
852
- });
853
- });
854
-
855
- // =========================================================================
856
- // Domain routing
857
- // =========================================================================
858
-
859
- describe("Domain routing", () => {
860
- it("product events: upserts product via mutation", async () => {
861
- const event = makeV1Event("product.updated", {
862
- id: "prod_456",
863
- name: "Updated Product",
864
- description: "A description",
865
- active: false,
866
- metadata: { tier: "premium" },
867
- });
868
- mockConstructEventAsync.mockResolvedValue(event);
869
-
870
- const request = makeRequest({ type: "product.updated" });
871
- const response = await handler(ctx, request);
872
- expect(response.status).toBe(200);
873
-
874
- expect(ctx.runMutation).toHaveBeenCalledWith(
875
- component.products.mutations.upsertProduct,
876
- expect.objectContaining({
877
- stripeProductId: "prod_456",
878
- name: "Updated Product",
879
- description: "A description",
880
- active: false,
881
- metadata: { tier: "premium" },
882
- }),
883
- );
884
- });
885
-
886
- it("subscription events: upserts with trial fields", async () => {
887
- const trialStart = Math.floor(Date.now() / 1000);
888
- const trialEnd = trialStart + 14 * 86400;
889
- const event = makeV1Event("customer.subscription.created", {
890
- id: "sub_123",
891
- status: "trialing",
892
- customer: "cus_abc",
893
- cancel_at_period_end: false,
894
- canceled_at: null,
895
- trial_start: trialStart,
896
- trial_end: trialEnd,
897
- metadata: { userId: "user_42" },
898
- items: {
899
- data: [
900
- {
901
- price: { id: "price_123" },
902
- quantity: 1,
903
- current_period_start: trialStart,
904
- current_period_end: trialEnd,
905
- },
906
- ],
907
- },
908
- });
909
- mockConstructEventAsync.mockResolvedValue(event);
910
-
911
- const request = makeRequest({ type: "customer.subscription.created" });
912
- const response = await handler(ctx, request);
913
- expect(response.status).toBe(200);
914
-
915
- expect(ctx.runMutation).toHaveBeenCalledWith(
916
- component.billing.mutations.upsertSubscription,
917
- expect.objectContaining({
918
- stripeSubscriptionId: "sub_123",
919
- isTrialing: true,
920
- trialStart: new Date(trialStart * 1000).toISOString(),
921
- trialEnd: new Date(trialEnd * 1000).toISOString(),
922
- userId: "user_42",
923
- }),
924
- );
925
- });
926
-
927
- it("checkout events: merges metadata", async () => {
928
- const event = makeV1Event("checkout.session.completed", {
929
- id: "cs_123",
930
- mode: "subscription",
931
- status: "complete",
932
- customer: "cus_abc",
933
- url: null,
934
- metadata: { userId: "user_42", plan: "pro" },
935
- });
936
- mockConstructEventAsync.mockResolvedValue(event);
937
-
938
- // Simulate existing session with old metadata
939
- (ctx.runQuery as Mock).mockImplementation(
940
- async (ref: any, _args: any) => {
941
- if (
942
- ref?.[TO_REFERENCE_PATH] ===
943
- component.billing.queries.getCheckoutSessionByStripeId[
944
- TO_REFERENCE_PATH
945
- ]
946
- ) {
947
- return { metadata: { previousKey: "old_value" } };
948
- }
949
- return null;
950
- },
951
- );
952
-
953
- const request = makeRequest({ type: "checkout.session.completed" });
954
- const response = await handler(ctx, request);
955
- expect(response.status).toBe(200);
956
-
957
- expect(ctx.runMutation).toHaveBeenCalledWith(
958
- component.billing.mutations.upsertCheckoutSession,
959
- expect.objectContaining({
960
- stripeSessionId: "cs_123",
961
- metadata: expect.objectContaining({
962
- previousKey: "old_value",
963
- userId: "user_42",
964
- plan: "pro",
965
- }),
966
- }),
967
- );
968
- });
969
-
970
- it("trial_will_end events: upserts subscription with trial fields", async () => {
971
- const trialStart = Math.floor(Date.now() / 1000) - 11 * 86400;
972
- const trialEnd = trialStart + 14 * 86400;
973
- const event = makeV1Event("customer.subscription.trial_will_end", {
974
- id: "sub_trial_456",
975
- status: "trialing",
976
- customer: "cus_abc",
977
- cancel_at_period_end: false,
978
- canceled_at: null,
979
- trial_start: trialStart,
980
- trial_end: trialEnd,
981
- metadata: { userId: "user_42" },
982
- items: {
983
- data: [
984
- {
985
- price: { id: "price_123" },
986
- quantity: 1,
987
- current_period_start: trialStart,
988
- current_period_end: trialEnd,
989
- },
990
- ],
991
- },
992
- });
993
- mockConstructEventAsync.mockResolvedValue(event);
994
-
995
- const request = makeRequest({
996
- type: "customer.subscription.trial_will_end",
997
- });
998
- const response = await handler(ctx, request);
999
- expect(response.status).toBe(200);
1000
-
1001
- expect(ctx.runMutation).toHaveBeenCalledWith(
1002
- component.billing.mutations.upsertSubscription,
1003
- expect.objectContaining({
1004
- stripeSubscriptionId: "sub_trial_456",
1005
- isTrialing: true,
1006
- trialStart: new Date(trialStart * 1000).toISOString(),
1007
- trialEnd: new Date(trialEnd * 1000).toISOString(),
1008
- userId: "user_42",
1009
- }),
1010
- );
1011
- });
1012
-
1013
- it("refund events: qualifies current refund with payment intent + charge link", async () => {
1014
- const event = makeV1Event("refund.created", {
1015
- id: "re_123",
1016
- payment_intent: "pi_abc",
1017
- charge: "ch_xyz",
1018
- amount: 500,
1019
- currency: "usd",
1020
- status: "succeeded",
1021
- reason: "requested_by_customer",
1022
- metadata: { note: "partial" },
1023
- });
1024
- mockConstructEventAsync.mockResolvedValue(event);
1025
- const refund = mockQualifiedRefund(
1026
- ctx,
1027
- mockRefundRetrieve,
1028
- event.data.object,
1029
- );
1030
-
1031
- const request = makeRequest({ type: "refund.created" });
1032
- const response = await handler(ctx, request);
1033
- expect(response.status).toBe(200);
1034
-
1035
- expect(ctx.runMutation).toHaveBeenCalledWith(
1036
- makeRef("refundSync/mutations/finish"),
1037
- expect.objectContaining({
1038
- generation: 1,
1039
- apiContext: "platform",
1040
- refund: expect.objectContaining(refund),
1041
- }),
1042
- );
1043
- expect(ctx.runMutation).not.toHaveBeenCalledWith(
1044
- component.connect.mutations.upsertRefund,
1045
- expect.anything(),
1046
- );
1047
- });
1048
-
1049
- it("refund events: holds invalid current status instead of clamping a raw snapshot", async () => {
1050
- const event = makeV1Event("refund.updated", {
1051
- id: "re_456",
1052
- object: "refund",
1053
- payment_intent: "pi_abc",
1054
- charge: "ch_xyz",
1055
- amount: 500,
1056
- currency: "usd",
1057
- status: "weird_status",
1058
- reason: "not_a_real_reason",
1059
- });
1060
- mockConstructEventAsync.mockResolvedValue(event);
1061
- mockRefundRetrieve.mockResolvedValue(event.data.object);
1062
- (ctx.runMutation as Mock)
1063
- .mockResolvedValueOnce("inserted")
1064
- .mockResolvedValueOnce(1);
1065
- const response = await handler(
1066
- ctx,
1067
- makeRequest({ type: "refund.updated" }),
1068
- );
1069
- expect(response.status).toBe(500);
1070
- expect(ctx.runMutation).not.toHaveBeenCalledWith(
1071
- component.connect.mutations.upsertRefund,
1072
- expect.anything(),
1073
- );
1074
- expect(ctx.runMutation).toHaveBeenCalledWith(
1075
- component.webhooks.mutations.markWebhookEventFailed,
1076
- expect.objectContaining({ stripeEventId: event.id }),
1077
- );
1078
- });
1079
-
1080
- it("dispute events: upserts dispute and records the originating event suffix", async () => {
1081
- const event = makeV1Event("charge.dispute.funds_withdrawn", {
1082
- id: "dp_123",
1083
- payment_intent: "pi_abc",
1084
- charge: "ch_xyz",
1085
- amount: 2000,
1086
- currency: "usd",
1087
- status: "needs_response",
1088
- reason: "fraudulent",
1089
- is_charge_refundable: true,
1090
- metadata: {},
1091
- });
1092
- mockConstructEventAsync.mockResolvedValue(event);
1093
-
1094
- const request = makeRequest({ type: "charge.dispute.funds_withdrawn" });
1095
- const response = await handler(ctx, request);
1096
- expect(response.status).toBe(200);
1097
-
1098
- expect(ctx.runMutation).toHaveBeenCalledWith(
1099
- component.connect.mutations.upsertDispute,
1100
- expect.objectContaining({
1101
- stripeDisputeId: "dp_123",
1102
- stripePaymentIntentId: "pi_abc",
1103
- stripeChargeId: "ch_xyz",
1104
- amount: 2000,
1105
- status: "needs_response",
1106
- reason: "fraudulent",
1107
- isChargeRefundable: true,
1108
- lastEvent: "funds_withdrawn",
1109
- }),
1110
- );
1111
- });
1112
-
1113
- it("unhandled event type: logs and returns 200", async () => {
1114
- const event = makeV1Event("some.unknown.event", { id: "obj_999" });
1115
- mockConstructEventAsync.mockResolvedValue(event);
1116
-
1117
- const consoleSpy = vi.spyOn(console, "info").mockImplementation(() => {});
1118
-
1119
- const request = makeRequest({ type: "some.unknown.event" });
1120
- const response = await handler(ctx, request);
1121
- expect(response.status).toBe(200);
1122
-
1123
- expect(consoleSpy).toHaveBeenCalledWith(
1124
- expect.stringContaining("Unhandled event type: some.unknown.event"),
1125
- );
1126
- consoleSpy.mockRestore();
1127
- });
1128
- });
1129
-
1130
- // =========================================================================
1131
- // Trigger dispatchers
1132
- // =========================================================================
1133
-
1134
- describe("Trigger dispatchers", () => {
1135
- /** App-side refs (e.g. internal.stripe.*) are NOT component refs. */
1136
- function makeAppRef(path: string) {
1137
- return { [TO_REFERENCE_PATH]: path };
1138
- }
1139
-
1140
- // The two webhook handler refs the app exports from `webhookHandlers()`.
1141
- const syncWebhook = makeAppRef("app/stripe/syncWebhook");
1142
- const asyncWebhook = makeAppRef("app/stripe/asyncWebhook");
1143
- const webhookRefs = { syncWebhook, asyncWebhook };
1144
-
1145
- function setupHandlerWithWebhooks(
1146
- webhooks: Record<string, unknown>,
1147
- ): (ctx: WebhookActionCtx, request: Request) => Promise<Response> {
1148
- let rawHandler: any;
1149
- const fakeRouter = {
1150
- route: (opts: any) => {
1151
- rawHandler = opts.handler;
1152
- },
1153
- };
1154
- registerRoutes(fakeRouter as any, component, {
1155
- ...makeBaseConfig(),
1156
- webhooks: webhooks as any,
1157
- });
1158
- return rawHandler;
1159
- }
1160
-
1161
- function makeSubscriptionEvent(type: string): any {
1162
- return makeV1Event(type, {
1163
- id: "sub_777",
1164
- status: "active",
1165
- customer: "cus_abc",
1166
- cancel_at_period_end: false,
1167
- canceled_at: null,
1168
- trial_start: null,
1169
- trial_end: null,
1170
- metadata: { userId: "user_42" },
1171
- items: {
1172
- data: [
1173
- {
1174
- price: { id: "price_123" },
1175
- quantity: 1,
1176
- current_period_start: 1700000000,
1177
- current_period_end: 1702592000,
1178
- },
1179
- ],
1180
- },
1181
- });
1182
- }
1183
-
1184
- it("routes subscription upsert through syncWebhook (dispatcher: subscriptionUpserted)", async () => {
1185
- const triggerHandler = setupHandlerWithWebhooks(webhookRefs);
1186
-
1187
- const event = makeSubscriptionEvent("customer.subscription.updated");
1188
- mockConstructEventAsync.mockResolvedValue(event);
1189
-
1190
- const response = await triggerHandler(
1191
- ctx,
1192
- makeRequest({ type: "customer.subscription.updated" }),
1193
- );
1194
- expect(response.status).toBe(200);
1195
-
1196
- expect(ctx.runMutation).toHaveBeenCalledWith(syncWebhook, {
1197
- dispatcher: "subscriptionUpserted",
1198
- data: expect.objectContaining({
1199
- stripeSubscriptionId: "sub_777",
1200
- status: "active",
1201
- userId: "user_42",
1202
- priceId: "price_123",
1203
- }),
1204
- });
1205
- expect(ctx.runMutation).not.toHaveBeenCalledWith(
1206
- component.billing.mutations.upsertSubscription,
1207
- expect.anything(),
1208
- );
1209
- });
1210
-
1211
- it("falls back to direct component mutation without webhooks", async () => {
1212
- const event = makeSubscriptionEvent("customer.subscription.updated");
1213
- mockConstructEventAsync.mockResolvedValue(event);
1214
-
1215
- const response = await handler(
1216
- ctx,
1217
- makeRequest({ type: "customer.subscription.updated" }),
1218
- );
1219
- expect(response.status).toBe(200);
1220
-
1221
- expect(ctx.runMutation).toHaveBeenCalledWith(
1222
- component.billing.mutations.upsertSubscription,
1223
- expect.objectContaining({
1224
- stripeSubscriptionId: "sub_777",
1225
- status: "active",
1226
- }),
1227
- );
1228
- });
1229
-
1230
- it("routes subscription deletion through syncWebhook (dispatcher: subscriptionDeleted)", async () => {
1231
- const triggerHandler = setupHandlerWithWebhooks(webhookRefs);
1232
-
1233
- const event = makeSubscriptionEvent("customer.subscription.deleted");
1234
- mockConstructEventAsync.mockResolvedValue(event);
1235
-
1236
- const response = await triggerHandler(
1237
- ctx,
1238
- makeRequest({ type: "customer.subscription.deleted" }),
1239
- );
1240
- expect(response.status).toBe(200);
1241
-
1242
- expect(ctx.runMutation).toHaveBeenCalledWith(syncWebhook, {
1243
- dispatcher: "subscriptionDeleted",
1244
- data: expect.objectContaining({ stripeSubscriptionId: "sub_777" }),
1245
- });
1246
- expect(ctx.runMutation).not.toHaveBeenCalledWith(syncWebhook, {
1247
- dispatcher: "subscriptionUpserted",
1248
- data: expect.anything(),
1249
- });
1250
- expect(ctx.runMutation).not.toHaveBeenCalledWith(
1251
- component.billing.mutations.upsertSubscription,
1252
- expect.anything(),
1253
- );
1254
- });
1255
-
1256
- it("routes V2 account upsert through syncWebhook (dispatcher: accountUpserted)", async () => {
1257
- const triggerHandler = setupHandlerWithWebhooks(webhookRefs);
1258
-
1259
- const thinEvent = makeV2ThinEvent();
1260
- mockParseEventNotificationAsync.mockResolvedValue(thinEvent);
1261
- mockAccountRetrieve.mockResolvedValue({
1262
- id: "acct_test_123",
1263
- contact_email: "test@example.com",
1264
- identity: {
1265
- business_details: { registered_name: "Test Business" },
1266
- country: "US",
1267
- },
1268
- metadata: { userId: "user_123" },
1269
- requirements: {},
1270
- configuration: { customer: { applied: true } },
1271
- });
1272
-
1273
- const response = await triggerHandler(ctx, makeRequest(thinEvent));
1274
- expect(response.status).toBe(200);
1275
-
1276
- expect(ctx.runMutation).toHaveBeenCalledWith(syncWebhook, {
1277
- dispatcher: "accountUpserted",
1278
- data: expect.objectContaining({
1279
- stripeAccountId: "acct_test_123",
1280
- userId: "user_123",
1281
- email: "test@example.com",
1282
- }),
1283
- });
1284
- expect(ctx.runMutation).not.toHaveBeenCalledWith(
1285
- component.core.mutations.upsertAccountInternal,
1286
- expect.anything(),
1287
- );
1288
- });
1289
-
1290
- it("routes checkout upsert through syncWebhook (dispatcher: checkoutSessionUpserted)", async () => {
1291
- const triggerHandler = setupHandlerWithWebhooks(webhookRefs);
1292
-
1293
- const event = makeV1Event("checkout.session.completed", {
1294
- id: "cs_999",
1295
- mode: "subscription",
1296
- status: "complete",
1297
- customer: "cus_abc",
1298
- url: null,
1299
- metadata: { userId: "user_42" },
1300
- });
1301
- mockConstructEventAsync.mockResolvedValue(event);
1302
-
1303
- const response = await triggerHandler(
1304
- ctx,
1305
- makeRequest({ type: "checkout.session.completed" }),
1306
- );
1307
- expect(response.status).toBe(200);
1308
-
1309
- expect(ctx.runMutation).toHaveBeenCalledWith(syncWebhook, {
1310
- dispatcher: "checkoutSessionUpserted",
1311
- data: expect.objectContaining({
1312
- stripeSessionId: "cs_999",
1313
- userId: "user_42",
1314
- }),
1315
- });
1316
- expect(ctx.runMutation).not.toHaveBeenCalledWith(
1317
- component.billing.mutations.upsertCheckoutSession,
1318
- expect.anything(),
1319
- );
1320
- });
1321
-
1322
- it("syncWebhook rejection returns 500 and marks the ledger row failed", async () => {
1323
- const triggerHandler = setupHandlerWithWebhooks(webhookRefs);
1324
-
1325
- const event = makeSubscriptionEvent("customer.subscription.updated");
1326
- mockConstructEventAsync.mockResolvedValue(event);
1327
-
1328
- (ctx.runMutation as Mock)
1329
- .mockResolvedValueOnce("inserted") // insertWebhookEvent
1330
- .mockRejectedValueOnce(new Error("sync trigger threw")) // syncWebhook
1331
- .mockResolvedValueOnce(undefined); // markWebhookEventFailed
1332
-
1333
- const response = await triggerHandler(
1334
- ctx,
1335
- makeRequest({ type: "customer.subscription.updated" }),
1336
- );
1337
- expect(response.status).toBe(500);
1338
-
1339
- expect(ctx.runMutation).toHaveBeenCalledWith(syncWebhook, {
1340
- dispatcher: "subscriptionUpserted",
1341
- data: expect.objectContaining({ stripeSubscriptionId: "sub_777" }),
1342
- });
1343
- expect(ctx.runMutation).toHaveBeenCalledWith(
1344
- component.webhooks.mutations.markWebhookEventFailed,
1345
- expect.objectContaining({
1346
- stripeEventId: event.id,
1347
- error: "sync trigger threw",
1348
- }),
1349
- );
1350
- });
1351
- });
1352
-
1353
- // =========================================================================
1354
- // Async hook scheduling
1355
- // =========================================================================
1356
-
1357
- describe("Async hook scheduling", () => {
1358
- /** App-side refs (e.g. internal.stripe.*) are NOT component refs. */
1359
- function makeAppRef(path: string) {
1360
- return { [TO_REFERENCE_PATH]: path };
1361
- }
1362
-
1363
- // The two webhook handler refs the app exports from `webhookHandlers()`.
1364
- const syncWebhook = makeAppRef("app/stripe/syncWebhook");
1365
- const asyncWebhook = makeAppRef("app/stripe/asyncWebhook");
1366
- const webhookRefs = { syncWebhook, asyncWebhook };
1367
-
1368
- function setupHandlerWithWebhooks(
1369
- webhooks: Record<string, unknown> | undefined,
1370
- ): (ctx: WebhookActionCtx, request: Request) => Promise<Response> {
1371
- let rawHandler: any;
1372
- const fakeRouter = {
1373
- route: (opts: any) => {
1374
- rawHandler = opts.handler;
1375
- },
1376
- };
1377
- registerRoutes(fakeRouter as any, component, {
1378
- ...makeBaseConfig(),
1379
- webhooks: webhooks as any,
1380
- });
1381
- return rawHandler;
1382
- }
1383
-
1384
- function makeCheckoutEvent(): any {
1385
- return makeV1Event("checkout.session.completed", {
1386
- id: "cs_hook_123",
1387
- mode: "subscription",
1388
- status: "complete",
1389
- customer: "cus_abc",
1390
- url: null,
1391
- metadata: { userId: "user_42" },
1392
- });
1393
- }
1394
-
1395
- function makeSubscriptionEvent(type: string): any {
1396
- return makeV1Event(type, {
1397
- id: "sub_hook_777",
1398
- status: "canceled",
1399
- customer: "cus_abc",
1400
- cancel_at_period_end: false,
1401
- canceled_at: 1700000000,
1402
- trial_start: null,
1403
- trial_end: null,
1404
- metadata: { userId: "user_42" },
1405
- items: {
1406
- data: [
1407
- {
1408
- price: { id: "price_123" },
1409
- quantity: 1,
1410
- current_period_start: 1700000000,
1411
- current_period_end: 1702592000,
1412
- },
1413
- ],
1414
- },
1415
- });
1416
- }
1417
-
1418
- it("checkout.session.completed schedules asyncWebhook (hook: afterCheckoutCompleted) with the committed doc", async () => {
1419
- const runAfter = vi.fn().mockResolvedValue(undefined);
1420
- const schedCtx = createMockCtx({ scheduler: { runAfter } });
1421
-
1422
- const sessionDoc = {
1423
- _id: "doc_cs_1",
1424
- stripeSessionId: "cs_hook_123",
1425
- status: "complete",
1426
- };
1427
- (schedCtx.runQuery as Mock).mockResolvedValue(sessionDoc);
1428
-
1429
- const triggerHandler = setupHandlerWithWebhooks(webhookRefs);
1430
- mockConstructEventAsync.mockResolvedValue(makeCheckoutEvent());
1431
-
1432
- const response = await triggerHandler(
1433
- schedCtx,
1434
- makeRequest({ type: "checkout.session.completed" }),
1435
- );
1436
- expect(response.status).toBe(200);
1437
-
1438
- expect(schedCtx.runQuery).toHaveBeenCalledWith(
1439
- component.billing.queries.getCheckoutSessionByStripeId,
1440
- { stripeSessionId: "cs_hook_123" },
1441
- );
1442
- expect(runAfter).toHaveBeenCalledWith(0, asyncWebhook, {
1443
- hook: "afterCheckoutCompleted",
1444
- doc: sessionDoc,
1445
- });
1446
- });
1447
-
1448
- it("schedules the hook only after the ledger row is marked processed", async () => {
1449
- const callOrder: string[] = [];
1450
- const runAfter = vi.fn().mockImplementation(async () => {
1451
- callOrder.push("runAfter");
1452
- });
1453
- const schedCtx = createMockCtx({ scheduler: { runAfter } });
1454
- (schedCtx.runQuery as Mock).mockResolvedValue({
1455
- stripeSessionId: "cs_hook_123",
1456
- });
1457
- (schedCtx.runMutation as Mock).mockImplementation(async (ref: any) => {
1458
- if (
1459
- ref?.[TO_REFERENCE_PATH] ===
1460
- component.webhooks.mutations.markWebhookEventProcessed[
1461
- TO_REFERENCE_PATH
1462
- ]
1463
- ) {
1464
- callOrder.push("markProcessed");
1465
- }
1466
- return "inserted";
1467
- });
1468
-
1469
- const triggerHandler = setupHandlerWithWebhooks(webhookRefs);
1470
- mockConstructEventAsync.mockResolvedValue(makeCheckoutEvent());
1471
-
1472
- const response = await triggerHandler(
1473
- schedCtx,
1474
- makeRequest({ type: "checkout.session.completed" }),
1475
- );
1476
- expect(response.status).toBe(200);
1477
- expect(callOrder).toEqual(["markProcessed", "runAfter"]);
1478
- });
1479
-
1480
- it("customer.subscription.deleted schedules afterSubscriptionCanceled, not afterSubscriptionUpdated", async () => {
1481
- const runAfter = vi.fn().mockResolvedValue(undefined);
1482
- const schedCtx = createMockCtx({ scheduler: { runAfter } });
1483
-
1484
- const subDoc = { _id: "doc_sub_1", stripeSubscriptionId: "sub_hook_777" };
1485
- (schedCtx.runQuery as Mock).mockResolvedValue(subDoc);
1486
-
1487
- const triggerHandler = setupHandlerWithWebhooks(webhookRefs);
1488
- mockConstructEventAsync.mockResolvedValue(
1489
- makeSubscriptionEvent("customer.subscription.deleted"),
1490
- );
1491
-
1492
- const response = await triggerHandler(
1493
- schedCtx,
1494
- makeRequest({ type: "customer.subscription.deleted" }),
1495
- );
1496
- expect(response.status).toBe(200);
1497
-
1498
- expect(schedCtx.runQuery).toHaveBeenCalledWith(
1499
- component.billing.queries.getSubscriptionByStripeId,
1500
- { stripeSubscriptionId: "sub_hook_777" },
1501
- );
1502
- expect(runAfter).toHaveBeenCalledWith(0, asyncWebhook, {
1503
- hook: "afterSubscriptionCanceled",
1504
- doc: subDoc,
1505
- });
1506
- expect(runAfter).not.toHaveBeenCalledWith(
1507
- 0,
1508
- asyncWebhook,
1509
- expect.objectContaining({ hook: "afterSubscriptionUpdated" }),
1510
- );
1511
- });
1512
-
1513
- it("customer.subscription.trial_will_end schedules afterTrialEnding with the subscription doc", async () => {
1514
- const runAfter = vi.fn().mockResolvedValue(undefined);
1515
- const schedCtx = createMockCtx({ scheduler: { runAfter } });
1516
-
1517
- const subDoc = {
1518
- _id: "doc_sub_trial",
1519
- stripeSubscriptionId: "sub_hook_777",
1520
- isTrialing: true,
1521
- };
1522
- (schedCtx.runQuery as Mock).mockResolvedValue(subDoc);
1523
-
1524
- const triggerHandler = setupHandlerWithWebhooks(webhookRefs);
1525
- mockConstructEventAsync.mockResolvedValue(
1526
- makeSubscriptionEvent("customer.subscription.trial_will_end"),
1527
- );
1528
-
1529
- const response = await triggerHandler(
1530
- schedCtx,
1531
- makeRequest({ type: "customer.subscription.trial_will_end" }),
1532
- );
1533
- expect(response.status).toBe(200);
1534
-
1535
- expect(schedCtx.runQuery).toHaveBeenCalledWith(
1536
- component.billing.queries.getSubscriptionByStripeId,
1537
- { stripeSubscriptionId: "sub_hook_777" },
1538
- );
1539
- expect(runAfter).toHaveBeenCalledWith(0, asyncWebhook, {
1540
- hook: "afterTrialEnding",
1541
- doc: subDoc,
1542
- });
1543
- });
1544
-
1545
- it("no scheduler on ctx: warns, does not throw, still returns 200", async () => {
1546
- const plainCtx = createMockCtx(); // no scheduler
1547
- (plainCtx.runQuery as Mock).mockResolvedValue({
1548
- stripeSessionId: "cs_hook_123",
1549
- });
1550
-
1551
- const warnSpy = vi.spyOn(console, "warn").mockImplementation(() => {});
1552
-
1553
- const triggerHandler = setupHandlerWithWebhooks(webhookRefs);
1554
- mockConstructEventAsync.mockResolvedValue(makeCheckoutEvent());
1555
-
1556
- const response = await triggerHandler(
1557
- plainCtx,
1558
- makeRequest({ type: "checkout.session.completed" }),
1559
- );
1560
- expect(response.status).toBe(200);
1561
- expect(warnSpy).toHaveBeenCalledWith(
1562
- expect.stringContaining(
1563
- "Async hook afterCheckoutCompleted configured but ctx.scheduler unavailable",
1564
- ),
1565
- );
1566
- warnSpy.mockRestore();
1567
- });
1568
-
1569
- it("no webhooks configured: does not schedule, returns 200", async () => {
1570
- const runAfter = vi.fn().mockResolvedValue(undefined);
1571
- const schedCtx = createMockCtx({ scheduler: { runAfter } });
1572
- (schedCtx.runQuery as Mock).mockResolvedValue({
1573
- stripeSessionId: "cs_hook_123",
1574
- });
1575
-
1576
- // No webhooks pair -> async hooks are skipped entirely.
1577
- const triggerHandler = setupHandlerWithWebhooks(undefined);
1578
- mockConstructEventAsync.mockResolvedValue(makeCheckoutEvent());
1579
-
1580
- const response = await triggerHandler(
1581
- schedCtx,
1582
- makeRequest({ type: "checkout.session.completed" }),
1583
- );
1584
- expect(response.status).toBe(200);
1585
- expect(runAfter).not.toHaveBeenCalled();
1586
- });
1587
-
1588
- it("doc fetch returns null: no runAfter call, no throw", async () => {
1589
- const runAfter = vi.fn().mockResolvedValue(undefined);
1590
- const schedCtx = createMockCtx({ scheduler: { runAfter } });
1591
- // Default runQuery resolves null — doc not found
1592
-
1593
- const triggerHandler = setupHandlerWithWebhooks(webhookRefs);
1594
- mockConstructEventAsync.mockResolvedValue(makeCheckoutEvent());
1595
-
1596
- const response = await triggerHandler(
1597
- schedCtx,
1598
- makeRequest({ type: "checkout.session.completed" }),
1599
- );
1600
- expect(response.status).toBe(200);
1601
- expect(runAfter).not.toHaveBeenCalled();
1602
- });
1603
-
1604
- it("V2 account event schedules afterAccountUpdated with the account doc", async () => {
1605
- const runAfter = vi.fn().mockResolvedValue(undefined);
1606
- const schedCtx = createMockCtx({ scheduler: { runAfter } });
1607
-
1608
- const accountDoc = {
1609
- _id: "doc_acct_1",
1610
- stripeAccountId: "acct_test_123",
1611
- onboardingStatus: "complete",
1612
- };
1613
- (schedCtx.runQuery as Mock).mockResolvedValue(accountDoc);
1614
-
1615
- const thinEvent = makeV2ThinEvent();
1616
- mockParseEventNotificationAsync.mockResolvedValue(thinEvent);
1617
- mockAccountRetrieve.mockResolvedValue({
1618
- id: "acct_test_123",
1619
- contact_email: "test@example.com",
1620
- identity: {
1621
- business_details: { registered_name: "Test Business" },
1622
- country: "US",
1623
- },
1624
- metadata: { userId: "user_123" },
1625
- requirements: {},
1626
- configuration: { customer: { applied: true } },
1627
- });
1628
-
1629
- const triggerHandler = setupHandlerWithWebhooks(webhookRefs);
1630
-
1631
- const request = new Request("https://example.com/stripe/webhook", {
1632
- method: "POST",
1633
- body: JSON.stringify(thinEvent),
1634
- headers: {
1635
- "stripe-signature": "test_sig_v2",
1636
- "content-type": "application/json",
1637
- },
1638
- });
1639
- const response = await triggerHandler(schedCtx, request);
1640
- expect(response.status).toBe(200);
1641
-
1642
- expect(schedCtx.runQuery).toHaveBeenCalledWith(
1643
- component.core.queries.getAccountByStripeId,
1644
- { stripeAccountId: "acct_test_123" },
1645
- );
1646
- expect(runAfter).toHaveBeenCalledWith(0, asyncWebhook, {
1647
- hook: "afterAccountUpdated",
1648
- doc: accountDoc,
1649
- });
1650
- });
1651
-
1652
- it("runAfter rejection is logged and the webhook still returns 200", async () => {
1653
- const runAfter = vi
1654
- .fn()
1655
- .mockRejectedValue(new Error("scheduler exploded"));
1656
- const schedCtx = createMockCtx({ scheduler: { runAfter } });
1657
- (schedCtx.runQuery as Mock).mockResolvedValue({
1658
- stripeSessionId: "cs_hook_123",
1659
- });
1660
-
1661
- const consoleSpy = vi
1662
- .spyOn(console, "error")
1663
- .mockImplementation(() => {});
1664
-
1665
- const triggerHandler = setupHandlerWithWebhooks(webhookRefs);
1666
- mockConstructEventAsync.mockResolvedValue(makeCheckoutEvent());
1667
-
1668
- const response = await triggerHandler(
1669
- schedCtx,
1670
- makeRequest({ type: "checkout.session.completed" }),
1671
- );
1672
- expect(response.status).toBe(200);
1673
- expect(runAfter).toHaveBeenCalled();
1674
- expect(consoleSpy).toHaveBeenCalledWith(
1675
- expect.stringContaining("Failed to schedule async hook"),
1676
- expect.any(Error),
1677
- );
1678
- consoleSpy.mockRestore();
1679
- });
1680
- });
1681
- });