@fantastic.dev/better-stripe 0.88.1 → 0.90.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (335) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/dist/client/billing/renewalAttach/internal/acquisition/array-order.test.d.ts +2 -0
  4. package/dist/client/billing/renewalAttach/internal/acquisition/array-order.test.d.ts.map +1 -0
  5. package/dist/client/billing/renewalAttach/internal/acquisition/array-order.test.js +61 -0
  6. package/dist/client/billing/renewalAttach/internal/acquisition/array-order.test.js.map +1 -0
  7. package/dist/client/billing/renewalAttach/internal/acquisition/coupon-stop-order.test.d.ts +2 -0
  8. package/dist/client/billing/renewalAttach/internal/acquisition/coupon-stop-order.test.d.ts.map +1 -0
  9. package/dist/client/billing/renewalAttach/internal/acquisition/coupon-stop-order.test.js +18 -0
  10. package/dist/client/billing/renewalAttach/internal/acquisition/coupon-stop-order.test.js.map +1 -0
  11. package/dist/client/billing/renewalAttach/internal/acquisition/fetch-metadata.test.d.ts +2 -0
  12. package/dist/client/billing/renewalAttach/internal/acquisition/fetch-metadata.test.d.ts.map +1 -0
  13. package/dist/client/billing/renewalAttach/internal/acquisition/fetch-metadata.test.js +67 -0
  14. package/dist/client/billing/renewalAttach/internal/acquisition/fetch-metadata.test.js.map +1 -0
  15. package/dist/client/billing/renewalAttach/internal/acquisition/raw-acquisition.test.d.ts +2 -0
  16. package/dist/client/billing/renewalAttach/internal/acquisition/raw-acquisition.test.d.ts.map +1 -0
  17. package/dist/client/billing/renewalAttach/internal/acquisition/raw-acquisition.test.js +372 -0
  18. package/dist/client/billing/renewalAttach/internal/acquisition/raw-acquisition.test.js.map +1 -0
  19. package/dist/client/billing/renewalAttach/internal/acquisition/rawAcquisition.d.ts +24 -0
  20. package/dist/client/billing/renewalAttach/internal/acquisition/rawAcquisition.d.ts.map +1 -0
  21. package/dist/client/billing/renewalAttach/internal/acquisition/rawAcquisition.js +113 -0
  22. package/dist/client/billing/renewalAttach/internal/acquisition/rawAcquisition.js.map +1 -0
  23. package/dist/client/billing/renewalAttach/internal/acquisition/rawCouponJoins.d.ts +55 -0
  24. package/dist/client/billing/renewalAttach/internal/acquisition/rawCouponJoins.d.ts.map +1 -0
  25. package/dist/client/billing/renewalAttach/internal/acquisition/rawCouponJoins.js +87 -0
  26. package/dist/client/billing/renewalAttach/internal/acquisition/rawCouponJoins.js.map +1 -0
  27. package/dist/client/billing/renewalAttach/internal/acquisition/rawWireSource.d.ts +7 -0
  28. package/dist/client/billing/renewalAttach/internal/acquisition/rawWireSource.d.ts.map +1 -0
  29. package/dist/client/billing/renewalAttach/internal/acquisition/rawWireSource.js +130 -0
  30. package/dist/client/billing/renewalAttach/internal/acquisition/rawWireSource.js.map +1 -0
  31. package/dist/client/billing/renewalAttach/internal/acquisition/readLifetime.d.ts +14 -0
  32. package/dist/client/billing/renewalAttach/internal/acquisition/readLifetime.d.ts.map +1 -0
  33. package/dist/client/billing/renewalAttach/internal/acquisition/readLifetime.js +60 -0
  34. package/dist/client/billing/renewalAttach/internal/acquisition/readLifetime.js.map +1 -0
  35. package/dist/client/billing/renewalAttach/internal/acquisition/sourceBinding.test.d.ts +2 -0
  36. package/dist/client/billing/renewalAttach/internal/acquisition/sourceBinding.test.d.ts.map +1 -0
  37. package/dist/client/billing/renewalAttach/internal/acquisition/sourceBinding.test.js +126 -0
  38. package/dist/client/billing/renewalAttach/internal/acquisition/sourceBinding.test.js.map +1 -0
  39. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/fixture.d.mts +627 -0
  40. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/fixture.d.mts.map +1 -0
  41. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/fixture.mjs +488 -0
  42. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/fixture.mjs.map +1 -0
  43. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/raw-retention-fixture.d.mts +214 -0
  44. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/raw-retention-fixture.d.mts.map +1 -0
  45. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/raw-retention-fixture.mjs +63 -0
  46. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/raw-retention-fixture.mjs.map +1 -0
  47. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/scenario.d.mts +75 -0
  48. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/scenario.d.mts.map +1 -0
  49. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/scenario.mjs +145 -0
  50. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/scenario.mjs.map +1 -0
  51. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/sourcePort.d.mts +7 -0
  52. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/sourcePort.d.mts.map +1 -0
  53. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/sourcePort.mjs +26 -0
  54. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/sourcePort.mjs.map +1 -0
  55. package/dist/client/billing/renewalAttach/internal/c10/appendAck.d.ts +14 -0
  56. package/dist/client/billing/renewalAttach/internal/c10/appendAck.d.ts.map +1 -0
  57. package/dist/client/billing/renewalAttach/internal/c10/appendAck.js +202 -0
  58. package/dist/client/billing/renewalAttach/internal/c10/appendAck.js.map +1 -0
  59. package/dist/client/billing/renewalAttach/internal/c10/attachEvents.d.ts +23 -0
  60. package/dist/client/billing/renewalAttach/internal/c10/attachEvents.d.ts.map +1 -0
  61. package/dist/client/billing/renewalAttach/internal/c10/attachEvents.js +117 -0
  62. package/dist/client/billing/renewalAttach/internal/c10/attachEvents.js.map +1 -0
  63. package/dist/client/billing/renewalAttach/internal/c10/configureEvents.d.ts +23 -0
  64. package/dist/client/billing/renewalAttach/internal/c10/configureEvents.d.ts.map +1 -0
  65. package/dist/client/billing/renewalAttach/internal/c10/configureEvents.js +111 -0
  66. package/dist/client/billing/renewalAttach/internal/c10/configureEvents.js.map +1 -0
  67. package/dist/client/billing/renewalAttach/internal/c10/eventCapture.d.ts +11 -0
  68. package/dist/client/billing/renewalAttach/internal/c10/eventCapture.d.ts.map +1 -0
  69. package/dist/client/billing/renewalAttach/internal/c10/eventCapture.js +376 -0
  70. package/dist/client/billing/renewalAttach/internal/c10/eventCapture.js.map +1 -0
  71. package/dist/client/billing/renewalAttach/internal/c10/eventCodec.d.ts +16 -0
  72. package/dist/client/billing/renewalAttach/internal/c10/eventCodec.d.ts.map +1 -0
  73. package/dist/client/billing/renewalAttach/internal/c10/eventCodec.js +119 -0
  74. package/dist/client/billing/renewalAttach/internal/c10/eventCodec.js.map +1 -0
  75. package/dist/client/billing/renewalAttach/internal/c10/ownData.d.ts +30 -0
  76. package/dist/client/billing/renewalAttach/internal/c10/ownData.d.ts.map +1 -0
  77. package/dist/client/billing/renewalAttach/internal/c10/ownData.js +74 -0
  78. package/dist/client/billing/renewalAttach/internal/c10/ownData.js.map +1 -0
  79. package/dist/client/billing/renewalAttach/internal/c10/ownerBinding.d.ts +3 -0
  80. package/dist/client/billing/renewalAttach/internal/c10/ownerBinding.d.ts.map +1 -0
  81. package/dist/client/billing/renewalAttach/internal/c10/ownerBinding.js +3 -0
  82. package/dist/client/billing/renewalAttach/internal/c10/ownerBinding.js.map +1 -0
  83. package/dist/client/billing/renewalAttach/internal/c10/privacy.d.ts +2 -0
  84. package/dist/client/billing/renewalAttach/internal/c10/privacy.d.ts.map +1 -0
  85. package/dist/client/billing/renewalAttach/internal/c10/privacy.js +175 -0
  86. package/dist/client/billing/renewalAttach/internal/c10/privacy.js.map +1 -0
  87. package/dist/client/billing/renewalAttach/internal/c10/publicApi.d.ts +3 -0
  88. package/dist/client/billing/renewalAttach/internal/c10/publicApi.d.ts.map +1 -0
  89. package/dist/client/billing/renewalAttach/internal/c10/publicApi.js +3 -0
  90. package/dist/client/billing/renewalAttach/internal/c10/publicApi.js.map +1 -0
  91. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/compilerIndex.d.mts +3 -0
  92. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/compilerIndex.d.mts.map +1 -0
  93. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/compilerIndex.mjs +4 -0
  94. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/compilerIndex.mjs.map +1 -0
  95. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/fixture.d.mts +26 -0
  96. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/fixture.d.mts.map +1 -0
  97. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/fixture.mjs +42 -0
  98. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/fixture.mjs.map +1 -0
  99. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f00.d.mts +7 -0
  100. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f00.d.mts.map +1 -0
  101. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f00.mjs +60 -0
  102. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f00.mjs.map +1 -0
  103. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f01.d.mts +335 -0
  104. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f01.d.mts.map +1 -0
  105. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f01.mjs +122 -0
  106. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f01.mjs.map +1 -0
  107. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f02.d.mts +46 -0
  108. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f02.d.mts.map +1 -0
  109. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f02.mjs +87 -0
  110. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f02.mjs.map +1 -0
  111. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f03.d.mts +35 -0
  112. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f03.d.mts.map +1 -0
  113. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f03.mjs +90 -0
  114. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f03.mjs.map +1 -0
  115. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f04.d.mts +132 -0
  116. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f04.d.mts.map +1 -0
  117. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f04.mjs +82 -0
  118. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f04.mjs.map +1 -0
  119. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f05.d.mts +4 -0
  120. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f05.d.mts.map +1 -0
  121. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f05.mjs +23 -0
  122. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f05.mjs.map +1 -0
  123. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f06.d.mts +16 -0
  124. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f06.d.mts.map +1 -0
  125. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f06.mjs +41 -0
  126. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f06.mjs.map +1 -0
  127. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f07.d.mts +43 -0
  128. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f07.d.mts.map +1 -0
  129. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f07.mjs +132 -0
  130. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f07.mjs.map +1 -0
  131. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f08.d.mts +200 -0
  132. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f08.d.mts.map +1 -0
  133. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f08.mjs +150 -0
  134. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f08.mjs.map +1 -0
  135. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f09.d.mts +124 -0
  136. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f09.d.mts.map +1 -0
  137. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f09.mjs +127 -0
  138. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f09.mjs.map +1 -0
  139. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f10.d.mts +3 -0
  140. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f10.d.mts.map +1 -0
  141. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f10.mjs +69 -0
  142. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f10.mjs.map +1 -0
  143. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f11.d.mts +2 -0
  144. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f11.d.mts.map +1 -0
  145. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f11.mjs +152 -0
  146. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f11.mjs.map +1 -0
  147. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f12.d.mts +2 -0
  148. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f12.d.mts.map +1 -0
  149. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f12.mjs +2 -0
  150. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f12.mjs.map +1 -0
  151. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f13.d.mts +5 -0
  152. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f13.d.mts.map +1 -0
  153. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f13.mjs +243 -0
  154. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f13.mjs.map +1 -0
  155. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f14.d.mts +17 -0
  156. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f14.d.mts.map +1 -0
  157. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f14.mjs +75 -0
  158. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f14.mjs.map +1 -0
  159. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f15.d.mts +2 -0
  160. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f15.d.mts.map +1 -0
  161. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f15.mjs +173 -0
  162. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f15.mjs.map +1 -0
  163. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f16.d.mts +4 -0
  164. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f16.d.mts.map +1 -0
  165. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f16.mjs +4 -0
  166. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f16.mjs.map +1 -0
  167. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f17.d.mts +7 -0
  168. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f17.d.mts.map +1 -0
  169. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f17.mjs +30 -0
  170. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f17.mjs.map +1 -0
  171. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f18.d.mts +29 -0
  172. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f18.d.mts.map +1 -0
  173. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f18.mjs +33 -0
  174. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f18.mjs.map +1 -0
  175. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f19.json +452 -0
  176. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f20.d.mts +2 -0
  177. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f20.d.mts.map +1 -0
  178. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f20.mjs +173 -0
  179. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f20.mjs.map +1 -0
  180. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f21.d.mts +2 -0
  181. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f21.d.mts.map +1 -0
  182. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f21.mjs +449 -0
  183. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f21.mjs.map +1 -0
  184. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f22.d.mts +9 -0
  185. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f22.d.mts.map +1 -0
  186. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f22.mjs +27 -0
  187. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f22.mjs.map +1 -0
  188. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f23.d.mts +7 -0
  189. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f23.d.mts.map +1 -0
  190. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f23.mjs +150 -0
  191. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f23.mjs.map +1 -0
  192. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f24.d.mts +3 -0
  193. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f24.d.mts.map +1 -0
  194. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f24.mjs +503 -0
  195. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f24.mjs.map +1 -0
  196. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f25.d.mts +2 -0
  197. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f25.d.mts.map +1 -0
  198. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f25.mjs +91 -0
  199. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f25.mjs.map +1 -0
  200. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f26.d.mts +14 -0
  201. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f26.d.mts.map +1 -0
  202. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f26.mjs +41 -0
  203. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f26.mjs.map +1 -0
  204. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f27.d.mts +103 -0
  205. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f27.d.mts.map +1 -0
  206. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f27.mjs +46 -0
  207. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f27.mjs.map +1 -0
  208. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f28.d.mts +73 -0
  209. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f28.d.mts.map +1 -0
  210. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f28.mjs +294 -0
  211. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f28.mjs.map +1 -0
  212. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f29.d.mts +2 -0
  213. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f29.d.mts.map +1 -0
  214. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f29.mjs +60 -0
  215. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f29.mjs.map +1 -0
  216. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/publishedRawkeyHelper.d.mts +58 -0
  217. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/publishedRawkeyHelper.d.mts.map +1 -0
  218. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/publishedRawkeyHelper.mjs +96 -0
  219. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/publishedRawkeyHelper.mjs.map +1 -0
  220. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/semanticSetup.d.ts +2 -0
  221. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/semanticSetup.d.ts.map +1 -0
  222. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/semanticSetup.js +40 -0
  223. package/dist/client/billing/renewalAttach/internal/c10/test-fixtures/semanticSetup.js.map +1 -0
  224. package/dist/client/billing/renewalAttach/internal/material/capture.d.ts +88 -0
  225. package/dist/client/billing/renewalAttach/internal/material/capture.d.ts.map +1 -0
  226. package/dist/client/billing/renewalAttach/internal/material/capture.js +181 -0
  227. package/dist/client/billing/renewalAttach/internal/material/capture.js.map +1 -0
  228. package/dist/client/billing/renewalAttach/internal/material/classifiers.d.ts +522 -0
  229. package/dist/client/billing/renewalAttach/internal/material/classifiers.d.ts.map +1 -0
  230. package/dist/client/billing/renewalAttach/internal/material/classifiers.js +226 -0
  231. package/dist/client/billing/renewalAttach/internal/material/classifiers.js.map +1 -0
  232. package/dist/client/billing/renewalAttach/internal/material/nodeKernel.d.ts +17 -0
  233. package/dist/client/billing/renewalAttach/internal/material/nodeKernel.d.ts.map +1 -0
  234. package/dist/client/billing/renewalAttach/internal/material/nodeKernel.js +95 -0
  235. package/dist/client/billing/renewalAttach/internal/material/nodeKernel.js.map +1 -0
  236. package/dist/client/billing/renewalAttach/internal/material/readMaterial.d.ts +338 -0
  237. package/dist/client/billing/renewalAttach/internal/material/readMaterial.d.ts.map +1 -0
  238. package/dist/client/billing/renewalAttach/internal/material/readMaterial.js +122 -0
  239. package/dist/client/billing/renewalAttach/internal/material/readMaterial.js.map +1 -0
  240. package/dist/client/billing/renewalAttach/internal/material/requiredJson.d.ts +2 -0
  241. package/dist/client/billing/renewalAttach/internal/material/requiredJson.d.ts.map +1 -0
  242. package/dist/client/billing/renewalAttach/internal/material/requiredJson.js +174 -0
  243. package/dist/client/billing/renewalAttach/internal/material/requiredJson.js.map +1 -0
  244. package/dist/client/billing/renewalAttach/internal/originalOwner.d.ts +27 -0
  245. package/dist/client/billing/renewalAttach/internal/originalOwner.d.ts.map +1 -0
  246. package/dist/client/billing/renewalAttach/internal/originalOwner.js +236 -0
  247. package/dist/client/billing/renewalAttach/internal/originalOwner.js.map +1 -0
  248. package/dist/client/billing/renewalAttach/internal/sourceBindings.d.ts +5 -0
  249. package/dist/client/billing/renewalAttach/internal/sourceBindings.d.ts.map +1 -0
  250. package/dist/client/billing/renewalAttach/internal/sourceBindings.js +9 -0
  251. package/dist/client/billing/renewalAttach/internal/sourceBindings.js.map +1 -0
  252. package/dist/client/billing/renewalAttach/internal/stockRawDelegate.d.ts +6 -0
  253. package/dist/client/billing/renewalAttach/internal/stockRawDelegate.d.ts.map +1 -0
  254. package/dist/client/billing/renewalAttach/internal/stockRawDelegate.js +35 -0
  255. package/dist/client/billing/renewalAttach/internal/stockRawDelegate.js.map +1 -0
  256. package/docs/renewal-context-reads.md +43 -0
  257. package/docs/renewal-phase-assembly.md +23 -0
  258. package/docs/renewal-raw-acquisition.md +64 -0
  259. package/package.json +1 -1
  260. package/src/client/billing/renewalAttach/internal/acquisition/array-order.test.js +70 -0
  261. package/src/client/billing/renewalAttach/internal/acquisition/coupon-stop-order.test.js +23 -0
  262. package/src/client/billing/renewalAttach/internal/acquisition/fetch-metadata.test.js +77 -0
  263. package/src/client/billing/renewalAttach/internal/acquisition/raw-acquisition.test.js +418 -0
  264. package/src/client/billing/renewalAttach/internal/acquisition/rawAcquisition.ts +160 -0
  265. package/src/client/billing/renewalAttach/internal/acquisition/rawCouponJoins.ts +110 -0
  266. package/src/client/billing/renewalAttach/internal/acquisition/rawWireSource.ts +156 -0
  267. package/src/client/billing/renewalAttach/internal/acquisition/readLifetime.ts +64 -0
  268. package/src/client/billing/renewalAttach/internal/acquisition/sourceBinding.test.js +138 -0
  269. package/src/client/billing/renewalAttach/internal/acquisition/test-fixtures/fixture.mjs +510 -0
  270. package/src/client/billing/renewalAttach/internal/acquisition/test-fixtures/raw-retention-fixture.mjs +64 -0
  271. package/src/client/billing/renewalAttach/internal/acquisition/test-fixtures/scenario.mjs +159 -0
  272. package/src/client/billing/renewalAttach/internal/acquisition/test-fixtures/sourcePort.mjs +25 -0
  273. package/src/client/billing/renewalAttach/internal/c10/appendAck.first.test.ts +86 -0
  274. package/src/client/billing/renewalAttach/internal/c10/appendAck.ts +226 -0
  275. package/src/client/billing/renewalAttach/internal/c10/appendCodec.test.ts +186 -0
  276. package/src/client/billing/renewalAttach/internal/c10/arrayOrder.test.ts +47 -0
  277. package/src/client/billing/renewalAttach/internal/c10/attachEvents.ts +144 -0
  278. package/src/client/billing/renewalAttach/internal/c10/compiler.test.ts +443 -0
  279. package/src/client/billing/renewalAttach/internal/c10/configureEvents.ts +145 -0
  280. package/src/client/billing/renewalAttach/internal/c10/eventCapture.ts +464 -0
  281. package/src/client/billing/renewalAttach/internal/c10/eventCodec.ts +131 -0
  282. package/src/client/billing/renewalAttach/internal/c10/hardening.test.ts +175 -0
  283. package/src/client/billing/renewalAttach/internal/c10/historicalClassifier.test.ts +114 -0
  284. package/src/client/billing/renewalAttach/internal/c10/ownData.ts +103 -0
  285. package/src/client/billing/renewalAttach/internal/c10/ownerBinding.ts +2 -0
  286. package/src/client/billing/renewalAttach/internal/c10/ownerContinuations.test.ts +283 -0
  287. package/src/client/billing/renewalAttach/internal/c10/privacy.ts +181 -0
  288. package/src/client/billing/renewalAttach/internal/c10/publicApi.ts +8 -0
  289. package/src/client/billing/renewalAttach/internal/c10/reflectionPrivacy.test.ts +87 -0
  290. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/compilerIndex.mjs +3 -0
  291. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/fixture.mjs +49 -0
  292. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f00.mjs +63 -0
  293. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f01.mjs +160 -0
  294. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f02.mjs +88 -0
  295. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f03.mjs +102 -0
  296. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f04.mjs +82 -0
  297. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f05.mjs +20 -0
  298. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f06.mjs +41 -0
  299. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f07.mjs +137 -0
  300. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f08.mjs +153 -0
  301. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f09.mjs +127 -0
  302. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f10.mjs +85 -0
  303. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f11.mjs +170 -0
  304. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f12.mjs +6 -0
  305. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f13.mjs +295 -0
  306. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f14.mjs +78 -0
  307. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f15.mjs +177 -0
  308. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f16.mjs +8 -0
  309. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f17.mjs +34 -0
  310. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f18.mjs +32 -0
  311. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f19.json +452 -0
  312. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f20.mjs +177 -0
  313. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f21.mjs +466 -0
  314. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f22.mjs +29 -0
  315. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f23.mjs +165 -0
  316. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f24.mjs +507 -0
  317. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f25.mjs +89 -0
  318. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f26.mjs +38 -0
  319. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f27.mjs +45 -0
  320. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f28.mjs +309 -0
  321. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/frozen/f29.mjs +58 -0
  322. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/publishedRawkeyHelper.mjs +104 -0
  323. package/src/client/billing/renewalAttach/internal/c10/test-fixtures/semanticSetup.ts +43 -0
  324. package/src/client/billing/renewalAttach/internal/material/capture.ts +243 -0
  325. package/src/client/billing/renewalAttach/internal/material/classifiers.test.ts +510 -0
  326. package/src/client/billing/renewalAttach/internal/material/classifiers.ts +313 -0
  327. package/src/client/billing/renewalAttach/internal/material/nodeKernel.ts +118 -0
  328. package/src/client/billing/renewalAttach/internal/material/readMaterial.ts +176 -0
  329. package/src/client/billing/renewalAttach/internal/material/requiredJson.ts +183 -0
  330. package/src/client/billing/renewalAttach/internal/originalOwner.test.ts +258 -0
  331. package/src/client/billing/renewalAttach/internal/originalOwner.ts +280 -0
  332. package/src/client/billing/renewalAttach/internal/sourceBindings.test.ts +13 -0
  333. package/src/client/billing/renewalAttach/internal/sourceBindings.ts +8 -0
  334. package/src/client/billing/renewalAttach/internal/stockRawDelegate.test.ts +156 -0
  335. package/src/client/billing/renewalAttach/internal/stockRawDelegate.ts +43 -0
@@ -0,0 +1,309 @@
1
+ import { INTENT } from "./f25.mjs";
2
+
3
+ // Synthetic provider-shaped reads. These unit fixtures are not provider receipts.
4
+ export const API_VERSION = "2026-09-30.endive";
5
+ export const stamp = (iso) => Date.parse(iso) / 1000;
6
+ const START = INTENT.T0;
7
+ const END = INTENT.T1;
8
+ const OBSERVED = INTENT.OBSERVED;
9
+
10
+ export function alter(value, path, next) {
11
+ const result = structuredClone(value);
12
+ let cursor = result;
13
+ for (const key of path.slice(0, -1)) cursor = cursor[key];
14
+ cursor[path[path.length - 1]] = next;
15
+ return result;
16
+ }
17
+
18
+ export function price(id, product, interval, count) {
19
+ return {
20
+ id,
21
+ object: "price",
22
+ product,
23
+ active: true,
24
+ livemode: false,
25
+ type: "recurring",
26
+ currency: "usd",
27
+ billing_scheme: "per_unit",
28
+ created: START - 1000,
29
+ metadata: { catalog: "retained" },
30
+ nickname: id,
31
+ unit_amount: id === INTENT.PRICE_TARGET ? 2000 : 1000,
32
+ unit_amount_decimal: id === INTENT.PRICE_TARGET ? "2000" : "1000",
33
+ tiers_mode: null,
34
+ transform_quantity: null,
35
+ recurring: {
36
+ interval,
37
+ interval_count: count,
38
+ usage_type: "licensed",
39
+ meter: null,
40
+ trial_period_days: null,
41
+ },
42
+ };
43
+ }
44
+
45
+ // Raw JSON wire shape: Stripe23 declares Decimal objects, while HTTP JSON parsing retains strings.
46
+
47
+ export function nativePlanForPrice(p) {
48
+ return {
49
+ id: p.id,
50
+ object: "plan",
51
+ active: p.active,
52
+ amount: p.unit_amount,
53
+ amount_decimal: p.unit_amount_decimal,
54
+ billing_scheme: "per_unit",
55
+ created: p.created,
56
+ currency: p.currency,
57
+ interval: p.recurring.interval,
58
+ interval_count: p.recurring.interval_count,
59
+ livemode: p.livemode,
60
+ metadata: p.metadata,
61
+ meter: p.recurring.meter,
62
+ nickname: p.nickname,
63
+ product: p.product,
64
+ tiers_mode: null,
65
+ transform_usage: null,
66
+ trial_period_days: p.recurring.trial_period_days,
67
+ usage_type: "licensed",
68
+ };
69
+ }
70
+
71
+ function discount(level, start) {
72
+ return {
73
+ id: `di_${level}`,
74
+ object: "discount",
75
+ customer: INTENT.MIRROR,
76
+ customer_account: INTENT.BUYER,
77
+ start: start - 100,
78
+ end: null,
79
+ subscription: level === "subscription" ? INTENT.SUB_SCHEDULED : null,
80
+ subscription_item: level === "item" ? INTENT.ITEM_SCHEDULED : null,
81
+ source: {
82
+ type: "coupon",
83
+ coupon: {
84
+ id: `custom-${level}-offer`,
85
+ object: "coupon",
86
+ livemode: false,
87
+ duration: "forever",
88
+ valid: true,
89
+ applies_to: {
90
+ products: [INTENT.PRODUCT_ORIGINAL, INTENT.PRODUCT_TARGET],
91
+ },
92
+ },
93
+ },
94
+ };
95
+ }
96
+
97
+ const invoiceSettings = () => ({
98
+ account_tax_ids: null,
99
+ custom_fields: null,
100
+ days_until_due: null,
101
+ description: null,
102
+ footer: null,
103
+ issuer: { type: "self" },
104
+ });
105
+
106
+ export function fixture(options = {}) {
107
+ const start = options.start ?? START;
108
+ const end = options.end ?? END;
109
+ const observedAt = options.observedAt ?? OBSERVED;
110
+ const currentPrice = price(
111
+ INTENT.PRICE_ORIGINAL,
112
+ INTENT.PRODUCT_ORIGINAL,
113
+ options.currentInterval ?? "month",
114
+ options.currentCount ?? 1,
115
+ );
116
+ const targetPrice = {
117
+ ...price(
118
+ INTENT.PRICE_TARGET,
119
+ INTENT.PRODUCT_TARGET,
120
+ options.targetInterval ?? "month",
121
+ options.targetCount ?? 1,
122
+ ),
123
+ ...options.target,
124
+ };
125
+ const originalItem = {
126
+ id: INTENT.ITEM_SCHEDULED,
127
+ object: "subscription_item",
128
+ subscription: INTENT.SUB_SCHEDULED,
129
+ current_period_start: start,
130
+ current_period_end: end,
131
+ quantity: 3,
132
+ price: currentPrice,
133
+ plan: nativePlanForPrice(currentPrice),
134
+ billing_thresholds: null,
135
+ current_trial: null,
136
+ tax_rates: [],
137
+ discounts: [discount("item", start)],
138
+ metadata: { seat: "retained" },
139
+ ...options.item,
140
+ };
141
+ if (options.omitItemCurrentTrial) delete originalItem.current_trial;
142
+ const subscription = {
143
+ id: INTENT.SUB_SCHEDULED,
144
+ object: "subscription",
145
+ customer: INTENT.MIRROR,
146
+ customer_account: INTENT.BUYER,
147
+ livemode: false,
148
+ status: "active",
149
+ currency: "usd",
150
+ schedule: null,
151
+ cancel_at: null,
152
+ cancel_at_period_end: false,
153
+ canceled_at: null,
154
+ ended_at: null,
155
+ pause_collection: null,
156
+ pending_update: null,
157
+ pending_setup_intent: null,
158
+ pending_invoice_item_interval: null,
159
+ next_pending_invoice_item_invoice: null,
160
+ managed_payments: null,
161
+ billing_schedules: [],
162
+ billing_thresholds: null,
163
+ billing_mode: { type: "classic", flexible: null },
164
+ billing_cycle_anchor: start,
165
+ billing_cycle_anchor_config: null,
166
+ default_source: null,
167
+ default_payment_method: null,
168
+ application_fee_percent: null,
169
+ payment_settings: {
170
+ payment_method_options: null,
171
+ payment_method_types: null,
172
+ save_default_payment_method: "off",
173
+ },
174
+ collection_method: "charge_automatically",
175
+ days_until_due: null,
176
+ automatic_tax: { enabled: false, liability: null, disabled_reason: null },
177
+ default_tax_rates: [],
178
+ description: null,
179
+ invoice_settings: {
180
+ account_tax_ids: null,
181
+ custom_fields: null,
182
+ description: null,
183
+ footer: null,
184
+ issuer: { type: "self" },
185
+ },
186
+ on_behalf_of: null,
187
+ transfer_data: null,
188
+ discounts: [discount("subscription", start)],
189
+ metadata: { keep: "original" },
190
+ trial_start: start - 100_000,
191
+ trial_end: start - 90_000,
192
+ trial_settings: null,
193
+ items: { object: "list", has_more: false, data: [originalItem] },
194
+ ...options.subscription,
195
+ };
196
+ const billingCustomer = {
197
+ id: INTENT.MIRROR,
198
+ object: "customer",
199
+ customer_account: INTENT.BUYER,
200
+ livemode: false,
201
+ discount: null,
202
+ ...(options.customer ?? {}),
203
+ };
204
+ const expected = {
205
+ customerAccountId: INTENT.BUYER,
206
+ subscriptionId: INTENT.SUB_SCHEDULED,
207
+ itemId: INTENT.ITEM_SCHEDULED,
208
+ currentPriceId: INTENT.PRICE_ORIGINAL,
209
+ currentProductId: INTENT.PRODUCT_ORIGINAL,
210
+ targetPriceId: INTENT.PRICE_TARGET,
211
+ targetProductId: INTENT.PRODUCT_TARGET,
212
+ periodStart: start,
213
+ periodEnd: end,
214
+ livemode: false,
215
+ };
216
+ const phaseItem = {
217
+ price: INTENT.PRICE_ORIGINAL,
218
+ plan: INTENT.PRICE_ORIGINAL,
219
+ quantity: 3,
220
+ billing_thresholds: null,
221
+ tax_rates: [],
222
+ metadata: {},
223
+ discounts: [
224
+ {
225
+ discount: INTENT.DISCOUNT_S_ITEM,
226
+ coupon: INTENT.COUPON_ITEM,
227
+ promotion_code: null,
228
+ },
229
+ ],
230
+ ...options.phaseItem,
231
+ };
232
+ const defaults = {
233
+ application_fee_percent: null,
234
+ automatic_tax: { enabled: false, liability: null, disabled_reason: null },
235
+ billing_cycle_anchor: "automatic",
236
+ billing_thresholds: null,
237
+ collection_method: "charge_automatically",
238
+ default_payment_method: null,
239
+ description: null,
240
+ invoice_settings: invoiceSettings(),
241
+ on_behalf_of: null,
242
+ transfer_data: null,
243
+ ...options.defaults,
244
+ };
245
+ const phase = {
246
+ start_date: start,
247
+ end_date: end,
248
+ currency: "usd",
249
+ items: [phaseItem],
250
+ add_invoice_items: [],
251
+ application_fee_percent: null,
252
+ billing_cycle_anchor: null,
253
+ billing_thresholds: null,
254
+ collection_method: null,
255
+ default_payment_method: null,
256
+ default_tax_rates: [],
257
+ description: null,
258
+ invoice_settings: null,
259
+ metadata: {},
260
+ on_behalf_of: null,
261
+ transfer_data: null,
262
+ proration_behavior: "create_prorations",
263
+ trial: false,
264
+ trial_end: null,
265
+ discounts: [
266
+ {
267
+ discount: INTENT.DISCOUNT_S_SUB,
268
+ coupon: INTENT.COUPON_SUBSCRIPTION,
269
+ promotion_code: null,
270
+ },
271
+ ],
272
+ ...options.phase,
273
+ };
274
+ const schedule = {
275
+ id: INTENT.SCHEDULE,
276
+ object: "subscription_schedule",
277
+ application: null,
278
+ customer: INTENT.MIRROR,
279
+ customer_account: INTENT.BUYER,
280
+ livemode: false,
281
+ subscription: INTENT.SUB_SCHEDULED,
282
+ status: "active",
283
+ end_behavior: "release",
284
+ created: observedAt - 60,
285
+ canceled_at: null,
286
+ completed_at: null,
287
+ released_at: null,
288
+ released_subscription: null,
289
+ metadata: {},
290
+ test_clock: null,
291
+ billing_mode: subscription.billing_mode,
292
+ pause_schedules: [],
293
+ current_phase: { start_date: start, end_date: end },
294
+ default_settings: defaults,
295
+ phases: [phase],
296
+ ...(options.schedule ?? {}),
297
+ };
298
+ return {
299
+ subscription,
300
+ originalItem,
301
+ targetPrice,
302
+ billingCustomer,
303
+ expected,
304
+ phase,
305
+ defaults,
306
+ schedule,
307
+ observedAt,
308
+ };
309
+ }
@@ -0,0 +1,58 @@
1
+ // Independent fixed TEST request facts, declared from immutable intent before any SDK call.
2
+ import { INTENT as I } from "./f25.mjs";
3
+ const freeze = (x) => {
4
+ if (x && typeof x === "object") {
5
+ for (const v of Object.values(x)) freeze(v);
6
+ Object.freeze(x);
7
+ }
8
+ return x;
9
+ };
10
+ // Exact selected phase settings: empty retained tax rates emit empty strings;
11
+ // inherited null phase PM/settings remain absent, forever redemptions retain IDs.
12
+ export const declaredConfigureWire = freeze({
13
+ scope: "platform",
14
+ apiVersion: I.API_VERSION,
15
+ method: "POST",
16
+ path: "/v1/subscription_schedules/" + I.SCHEDULE,
17
+ key: I.CONFIGURE_KEY,
18
+ firstDispatchedAt: I.CONFIGURE_FIRST_DISPATCHED_AT,
19
+ payload: {
20
+ end_behavior: "release",
21
+ proration_behavior: "none",
22
+ phases: [
23
+ {
24
+ default_tax_rates: "",
25
+ start_date: I.T0,
26
+ end_date: I.T1,
27
+ currency: "usd",
28
+ proration_behavior: "create_prorations",
29
+ items: [
30
+ {
31
+ tax_rates: "",
32
+ price: I.PRICE_ORIGINAL,
33
+ quantity: 1,
34
+ discounts: [{ discount: I.DISCOUNT_S_ITEM }],
35
+ },
36
+ ],
37
+ discounts: [{ discount: I.DISCOUNT_S_SUB }],
38
+ },
39
+ {
40
+ default_tax_rates: "",
41
+ start_date: I.T1,
42
+ currency: "usd",
43
+ proration_behavior: "none",
44
+ billing_cycle_anchor: "automatic",
45
+ duration: { interval: "month", interval_count: 1 },
46
+ items: [
47
+ {
48
+ tax_rates: "",
49
+ price: I.PRICE_TARGET,
50
+ quantity: 1,
51
+ discounts: [{ discount: I.DISCOUNT_S_ITEM }],
52
+ },
53
+ ],
54
+ discounts: [{ discount: I.DISCOUNT_S_SUB }],
55
+ },
56
+ ],
57
+ },
58
+ });
@@ -0,0 +1,104 @@
1
+ // NEW synthetic Source-only variations, declared before any public child construction.
2
+ import { createHash } from "node:crypto";
3
+ import { fixture as rawFixture } from "./frozen/f18.mjs";
4
+ export const copy = (x) => structuredClone(x);
5
+ export const own = (body, key, value = { SYNTHETIC_RETAINED: true }) =>
6
+ Object.defineProperty(body, key, {
7
+ value: copy(value),
8
+ enumerable: true,
9
+ writable: true,
10
+ configurable: true,
11
+ });
12
+ export function order(x) {
13
+ if (Array.isArray(x)) return x.map(order);
14
+ if (x !== null && typeof x === "object")
15
+ return Object.fromEntries(
16
+ Object.entries(x)
17
+ .sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0))
18
+ .map(([k, v]) => [k, order(v)]),
19
+ );
20
+ return x;
21
+ }
22
+ export const binding = (family, preimage) =>
23
+ family +
24
+ ":v2:sha256:" +
25
+ createHash("sha256")
26
+ .update(
27
+ JSON.stringify(
28
+ order(["betterstripe-renewal-binding", 2, family, preimage]),
29
+ ),
30
+ "utf8",
31
+ )
32
+ .digest("hex");
33
+ export function expectedPrepared(raw) {
34
+ const bound = {
35
+ version: 2,
36
+ scope: "platform",
37
+ expected: copy(raw.expected),
38
+ quantity: raw.subscription.items.data[0].quantity,
39
+ providerSnapshot: {
40
+ subscription: copy(raw.subscription),
41
+ targetPrice: copy(raw.targetPrice),
42
+ ...(Object.hasOwn(raw, "billingCustomer")
43
+ ? { billingCustomer: copy(raw.billingCustomer) }
44
+ : {}),
45
+ },
46
+ };
47
+ return {
48
+ ...bound,
49
+ status: "prepared",
50
+ preservation: "requires_schedule_validation",
51
+ requestIdentity: { key: raw.key, binding: binding("renewal", bound) },
52
+ };
53
+ }
54
+ export const wire = (x) => ({
55
+ scope: x.scope,
56
+ apiVersion: x.apiVersion,
57
+ method: x.method,
58
+ path: x.path,
59
+ payload: copy(x.payload),
60
+ key: x.key,
61
+ firstDispatchedAt: x.firstDispatchedAt,
62
+ });
63
+ export function attachCase(field, key, replay = false) {
64
+ const x = rawFixture().freshAttach;
65
+ own(x.attachRequest.preparation[field], key);
66
+ own(x[field === "subscription" ? "freshSubscription" : field], key);
67
+ if (replay) {
68
+ x.intent = "replay_unknown";
69
+ x.freshSubscription.schedule = "sub_sched_ObservedSYNTHETIC";
70
+ }
71
+ return x;
72
+ }
73
+ export function configureCase() {
74
+ const x = rawFixture().freshConfigure,
75
+ c = x.configuration;
76
+ for (const field of ["subscription", "targetPrice", "billingCustomer"]) {
77
+ own(c.preparation[field], "__proto__");
78
+ own(c.attachReceipt.attachRequest.preparation[field], "__proto__");
79
+ own(c[field === "subscription" ? "freshSubscription" : field], "__proto__");
80
+ own(x[field === "subscription" ? "freshSubscription" : field], "__proto__");
81
+ }
82
+ for (const body of [c.attachReceipt.providerSnapshot, c.schedule, x.schedule])
83
+ own(body, "__proto__", { SYNTHETIC_SCHEDULE: true });
84
+ return x;
85
+ }
86
+ export function measure(x) {
87
+ let nodes = 0,
88
+ depth = 0;
89
+ function walk(v, n) {
90
+ nodes++;
91
+ depth = Math.max(depth, n);
92
+ if (v !== null && typeof v === "object")
93
+ for (const child of Object.values(v)) walk(child, n + 1);
94
+ }
95
+ walk(x, 0);
96
+ const text = JSON.stringify(x);
97
+ return {
98
+ chars: text.length,
99
+ utf8: Buffer.byteLength(text, "utf8"),
100
+ nodes,
101
+ depth,
102
+ };
103
+ }
104
+ export { rawFixture };
@@ -0,0 +1,43 @@
1
+ // TEST-only equivalent of the accepted semantic owner/timer port. No runtime binding.
2
+ import { beforeEach, afterEach, vi } from "vitest";
3
+ import { setTimeout as wake, clearTimeout as cancel } from "node:timers";
4
+ const time = vi.hoisted(() => ({ wallMs: 1000, ns: 1000000000n }));
5
+ vi.mock("../ownerBinding.js", () => ({
6
+ SOURCE_OWNER: Object.freeze({
7
+ basis: Object.freeze({
8
+ startWallMs: 1000,
9
+ startNs: 1000000000n,
10
+ workEndWallMs: 1000001000,
11
+ workEndNs: 1000001000000000n,
12
+ endWallMs: 1000031000,
13
+ endNs: 1000031000000000n,
14
+ }),
15
+ check() {
16
+ return { wallMs: time.wallMs, ns: time.ns };
17
+ },
18
+ subscribe() {
19
+ return () => {};
20
+ },
21
+ }),
22
+ }));
23
+ beforeEach(() => {
24
+ time.wallMs = 1000;
25
+ time.ns = 1000000000n;
26
+ vi.stubGlobal("fetch", () => {
27
+ throw Error("NETWORK_FORBIDDEN");
28
+ });
29
+ vi.stubGlobal(
30
+ "setTimeout",
31
+ (fn: (...args: unknown[]) => void, delay: number, ...args: unknown[]) => {
32
+ const wallTarget = time.wallMs + delay,
33
+ nsTarget = time.ns + BigInt(delay) * 1000000n;
34
+ return wake(() => {
35
+ time.wallMs = Math.max(time.wallMs, wallTarget);
36
+ time.ns = time.ns > nsTarget ? time.ns : nsTarget;
37
+ fn(...args);
38
+ }, delay);
39
+ },
40
+ );
41
+ vi.stubGlobal("clearTimeout", cancel);
42
+ });
43
+ afterEach(() => vi.unstubAllGlobals());