@fantastic.dev/better-stripe 0.90.0 → 0.92.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 (239) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/dist/client/billing/renewalAttach/internal/acquisition/ownedAcquisition.d.ts +41 -0
  4. package/dist/client/billing/renewalAttach/internal/acquisition/ownedAcquisition.d.ts.map +1 -0
  5. package/dist/client/billing/renewalAttach/internal/acquisition/ownedAcquisition.js +187 -0
  6. package/dist/client/billing/renewalAttach/internal/acquisition/ownedAcquisition.js.map +1 -0
  7. package/dist/client/billing/renewalAttach/internal/acquisition/rawAcquisition.d.ts +2 -23
  8. package/dist/client/billing/renewalAttach/internal/acquisition/rawAcquisition.d.ts.map +1 -1
  9. package/dist/client/billing/renewalAttach/internal/acquisition/rawAcquisition.js +1 -112
  10. package/dist/client/billing/renewalAttach/internal/acquisition/rawAcquisition.js.map +1 -1
  11. package/dist/client/billing/renewalAttach/internal/acquisition/rawWireSource.d.ts +8 -3
  12. package/dist/client/billing/renewalAttach/internal/acquisition/rawWireSource.d.ts.map +1 -1
  13. package/dist/client/billing/renewalAttach/internal/acquisition/rawWireSource.js +1 -0
  14. package/dist/client/billing/renewalAttach/internal/acquisition/rawWireSource.js.map +1 -1
  15. package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/sourcePort.d.mts +1 -1
  16. package/dist/client/billing/renewalAttach/internal/configure/actor.d.ts +14 -0
  17. package/dist/client/billing/renewalAttach/internal/configure/actor.d.ts.map +1 -0
  18. package/dist/client/billing/renewalAttach/internal/configure/actor.js +444 -0
  19. package/dist/client/billing/renewalAttach/internal/configure/actor.js.map +1 -0
  20. package/dist/client/billing/renewalAttach/internal/configure/capture.d.ts +12 -0
  21. package/dist/client/billing/renewalAttach/internal/configure/capture.d.ts.map +1 -0
  22. package/dist/client/billing/renewalAttach/internal/configure/capture.js +99 -0
  23. package/dist/client/billing/renewalAttach/internal/configure/capture.js.map +1 -0
  24. package/dist/client/billing/renewalAttach/internal/configure/output.d.ts +16 -0
  25. package/dist/client/billing/renewalAttach/internal/configure/output.d.ts.map +1 -0
  26. package/dist/client/billing/renewalAttach/internal/configure/output.js +274 -0
  27. package/dist/client/billing/renewalAttach/internal/configure/output.js.map +1 -0
  28. package/dist/client/billing/renewalAttach/internal/configure/ownedContinuation.d.ts +3 -0
  29. package/dist/client/billing/renewalAttach/internal/configure/ownedContinuation.d.ts.map +1 -0
  30. package/dist/client/billing/renewalAttach/internal/configure/ownedContinuation.js +61 -0
  31. package/dist/client/billing/renewalAttach/internal/configure/ownedContinuation.js.map +1 -0
  32. package/dist/client/billing/renewalAttach/internal/configure/replay.d.ts +3 -0
  33. package/dist/client/billing/renewalAttach/internal/configure/replay.d.ts.map +1 -0
  34. package/dist/client/billing/renewalAttach/internal/configure/replay.js +9 -0
  35. package/dist/client/billing/renewalAttach/internal/configure/replay.js.map +1 -0
  36. package/dist/client/billing/renewalAttach/internal/configure/request.d.ts +39 -0
  37. package/dist/client/billing/renewalAttach/internal/configure/request.d.ts.map +1 -0
  38. package/dist/client/billing/renewalAttach/internal/configure/request.js +245 -0
  39. package/dist/client/billing/renewalAttach/internal/configure/request.js.map +1 -0
  40. package/dist/client/billing/renewalAttach/internal/configure/transport.d.ts +88 -0
  41. package/dist/client/billing/renewalAttach/internal/configure/transport.d.ts.map +1 -0
  42. package/dist/client/billing/renewalAttach/internal/configure/transport.js +289 -0
  43. package/dist/client/billing/renewalAttach/internal/configure/transport.js.map +1 -0
  44. package/dist/client/billing/renewalAttach/internal/observation/actor.d.ts +16 -0
  45. package/dist/client/billing/renewalAttach/internal/observation/actor.d.ts.map +1 -0
  46. package/dist/client/billing/renewalAttach/internal/observation/actor.js +383 -0
  47. package/dist/client/billing/renewalAttach/internal/observation/actor.js.map +1 -0
  48. package/dist/client/billing/renewalAttach/internal/observation/capture.d.ts +9 -0
  49. package/dist/client/billing/renewalAttach/internal/observation/capture.d.ts.map +1 -0
  50. package/dist/client/billing/renewalAttach/internal/observation/capture.js +216 -0
  51. package/dist/client/billing/renewalAttach/internal/observation/capture.js.map +1 -0
  52. package/dist/client/billing/renewalAttach/internal/observation/configureAcknowledgement.d.ts +5 -0
  53. package/dist/client/billing/renewalAttach/internal/observation/configureAcknowledgement.d.ts.map +1 -0
  54. package/dist/client/billing/renewalAttach/internal/observation/configureAcknowledgement.js +11 -0
  55. package/dist/client/billing/renewalAttach/internal/observation/configureAcknowledgement.js.map +1 -0
  56. package/dist/client/billing/renewalAttach/internal/observation/profile.d.ts +7 -0
  57. package/dist/client/billing/renewalAttach/internal/observation/profile.d.ts.map +1 -0
  58. package/dist/client/billing/renewalAttach/internal/observation/profile.js +190 -0
  59. package/dist/client/billing/renewalAttach/internal/observation/profile.js.map +1 -0
  60. package/dist/client/billing/renewalAttach/internal/observation/record.d.ts +5 -0
  61. package/dist/client/billing/renewalAttach/internal/observation/record.d.ts.map +1 -0
  62. package/dist/client/billing/renewalAttach/internal/observation/record.js +317 -0
  63. package/dist/client/billing/renewalAttach/internal/observation/record.js.map +1 -0
  64. package/dist/client/billing/renewalAttach/internal/observation/types.d.ts +84 -0
  65. package/dist/client/billing/renewalAttach/internal/observation/types.d.ts.map +1 -0
  66. package/dist/client/billing/renewalAttach/internal/observation/types.js +27 -0
  67. package/dist/client/billing/renewalAttach/internal/observation/types.js.map +1 -0
  68. package/dist/client/billing/renewalAttach/internal/operations/configureReadTransport.d.ts +18 -0
  69. package/dist/client/billing/renewalAttach/internal/operations/configureReadTransport.d.ts.map +1 -0
  70. package/dist/client/billing/renewalAttach/internal/operations/configureReadTransport.js +229 -0
  71. package/dist/client/billing/renewalAttach/internal/operations/configureReadTransport.js.map +1 -0
  72. package/dist/client/billing/renewalAttach/internal/operations/fixedTransport.d.ts +163 -0
  73. package/dist/client/billing/renewalAttach/internal/operations/fixedTransport.d.ts.map +1 -0
  74. package/dist/client/billing/renewalAttach/internal/operations/fixedTransport.js +443 -0
  75. package/dist/client/billing/renewalAttach/internal/operations/fixedTransport.js.map +1 -0
  76. package/dist/client/billing/renewalAttach/internal/operations/initialAttach.d.ts +8 -0
  77. package/dist/client/billing/renewalAttach/internal/operations/initialAttach.d.ts.map +1 -0
  78. package/dist/client/billing/renewalAttach/internal/operations/initialAttach.js +467 -0
  79. package/dist/client/billing/renewalAttach/internal/operations/initialAttach.js.map +1 -0
  80. package/dist/client/billing/renewalAttach/internal/operations/ownedAwait.d.ts +6 -0
  81. package/dist/client/billing/renewalAttach/internal/operations/ownedAwait.d.ts.map +1 -0
  82. package/dist/client/billing/renewalAttach/internal/operations/ownedAwait.js +59 -0
  83. package/dist/client/billing/renewalAttach/internal/operations/ownedAwait.js.map +1 -0
  84. package/dist/client/billing/renewalAttach/internal/operations/providerFailure.d.ts +10 -0
  85. package/dist/client/billing/renewalAttach/internal/operations/providerFailure.d.ts.map +1 -0
  86. package/dist/client/billing/renewalAttach/internal/operations/providerFailure.js +48 -0
  87. package/dist/client/billing/renewalAttach/internal/operations/providerFailure.js.map +1 -0
  88. package/dist/client/billing/renewalAttach/internal/operations/sourceOperations.d.ts +20 -0
  89. package/dist/client/billing/renewalAttach/internal/operations/sourceOperations.d.ts.map +1 -0
  90. package/dist/client/billing/renewalAttach/internal/operations/sourceOperations.js +44 -0
  91. package/dist/client/billing/renewalAttach/internal/operations/sourceOperations.js.map +1 -0
  92. package/dist/client/billing/renewalAttach/internal/operations/types.d.ts +42 -0
  93. package/dist/client/billing/renewalAttach/internal/operations/types.d.ts.map +1 -0
  94. package/dist/client/billing/renewalAttach/internal/operations/types.js +158 -0
  95. package/dist/client/billing/renewalAttach/internal/operations/types.js.map +1 -0
  96. package/dist/client/billing/renewalAttach/internal/preflight/configurePreflight.d.ts +5 -0
  97. package/dist/client/billing/renewalAttach/internal/preflight/configurePreflight.d.ts.map +1 -0
  98. package/dist/client/billing/renewalAttach/internal/preflight/configurePreflight.js +214 -0
  99. package/dist/client/billing/renewalAttach/internal/preflight/configurePreflight.js.map +1 -0
  100. package/dist/client/billing/renewalAttach/internal/preflight/grammar.d.ts +33 -0
  101. package/dist/client/billing/renewalAttach/internal/preflight/grammar.d.ts.map +1 -0
  102. package/dist/client/billing/renewalAttach/internal/preflight/grammar.js +208 -0
  103. package/dist/client/billing/renewalAttach/internal/preflight/grammar.js.map +1 -0
  104. package/dist/client/billing/renewalAttach/internal/preflight/output.d.ts +4 -0
  105. package/dist/client/billing/renewalAttach/internal/preflight/output.d.ts.map +1 -0
  106. package/dist/client/billing/renewalAttach/internal/preflight/output.js +25 -0
  107. package/dist/client/billing/renewalAttach/internal/preflight/output.js.map +1 -0
  108. package/dist/client/billing/renewalAttach/internal/preflight/record.d.ts +16 -0
  109. package/dist/client/billing/renewalAttach/internal/preflight/record.d.ts.map +1 -0
  110. package/dist/client/billing/renewalAttach/internal/preflight/record.js +93 -0
  111. package/dist/client/billing/renewalAttach/internal/preflight/record.js.map +1 -0
  112. package/dist/client/billing/renewalAttach/internal/preflight/relations.d.ts +7 -0
  113. package/dist/client/billing/renewalAttach/internal/preflight/relations.d.ts.map +1 -0
  114. package/dist/client/billing/renewalAttach/internal/preflight/relations.js +153 -0
  115. package/dist/client/billing/renewalAttach/internal/preflight/relations.js.map +1 -0
  116. package/dist/client/billing/renewalAttach/internal/recovery/material.d.ts +22 -0
  117. package/dist/client/billing/renewalAttach/internal/recovery/material.d.ts.map +1 -0
  118. package/dist/client/billing/renewalAttach/internal/recovery/material.js +221 -0
  119. package/dist/client/billing/renewalAttach/internal/recovery/material.js.map +1 -0
  120. package/dist/client/billing/renewalAttach/internal/recovery/output.d.ts +8 -0
  121. package/dist/client/billing/renewalAttach/internal/recovery/output.d.ts.map +1 -0
  122. package/dist/client/billing/renewalAttach/internal/recovery/output.js +101 -0
  123. package/dist/client/billing/renewalAttach/internal/recovery/output.js.map +1 -0
  124. package/dist/client/billing/renewalAttach/internal/recovery/record.d.ts +12 -0
  125. package/dist/client/billing/renewalAttach/internal/recovery/record.d.ts.map +1 -0
  126. package/dist/client/billing/renewalAttach/internal/recovery/record.js +186 -0
  127. package/dist/client/billing/renewalAttach/internal/recovery/record.js.map +1 -0
  128. package/dist/client/billing/renewalAttach/internal/recovery/recoveryActor.d.ts +5 -0
  129. package/dist/client/billing/renewalAttach/internal/recovery/recoveryActor.d.ts.map +1 -0
  130. package/dist/client/billing/renewalAttach/internal/recovery/recoveryActor.js +498 -0
  131. package/dist/client/billing/renewalAttach/internal/recovery/recoveryActor.js.map +1 -0
  132. package/dist/client/billing/renewalAttach/internal/recovery/relation.d.ts +21 -0
  133. package/dist/client/billing/renewalAttach/internal/recovery/relation.d.ts.map +1 -0
  134. package/dist/client/billing/renewalAttach/internal/recovery/relation.js +119 -0
  135. package/dist/client/billing/renewalAttach/internal/recovery/relation.js.map +1 -0
  136. package/dist/client/connect/payoutExecutionTestHelpers.d.ts +16 -16
  137. package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts +32 -32
  138. package/dist/component/balanceFunding/internal/actions.d.ts +11 -11
  139. package/dist/component/financialObservations/settlementHelpers.d.ts +3 -3
  140. package/dist/component/usage/allowance.fixtures.d.ts +16 -16
  141. package/dist/component/usageCredits/accounting.fixtures.d.ts +16 -16
  142. package/docs/renewal-context-reads.md +26 -8
  143. package/docs/renewal-material-observation.md +58 -0
  144. package/docs/renewal-phase-assembly.md +68 -0
  145. package/docs/renewal-raw-acquisition.md +19 -5
  146. package/package.json +1 -1
  147. package/src/client/billing/renewalAttach/internal/acquisition/ownedAcquisition.ts +304 -0
  148. package/src/client/billing/renewalAttach/internal/acquisition/rawAcquisition.ts +2 -160
  149. package/src/client/billing/renewalAttach/internal/acquisition/rawWireSource.ts +15 -3
  150. package/src/client/billing/renewalAttach/internal/configure/actor.ts +586 -0
  151. package/src/client/billing/renewalAttach/internal/configure/capture.ts +117 -0
  152. package/src/client/billing/renewalAttach/internal/configure/dispatch.integration.test.ts +32 -0
  153. package/src/client/billing/renewalAttach/internal/configure/limits.test.ts +510 -0
  154. package/src/client/billing/renewalAttach/internal/configure/order.integration.test.ts +207 -0
  155. package/src/client/billing/renewalAttach/internal/configure/output.ts +372 -0
  156. package/src/client/billing/renewalAttach/internal/configure/ownedContinuation.ts +56 -0
  157. package/src/client/billing/renewalAttach/internal/configure/ownership.integration.test.ts +148 -0
  158. package/src/client/billing/renewalAttach/internal/configure/replay.integration.test.ts +173 -0
  159. package/src/client/billing/renewalAttach/internal/configure/replay.ts +13 -0
  160. package/src/client/billing/renewalAttach/internal/configure/request.ts +312 -0
  161. package/src/client/billing/renewalAttach/internal/configure/transport.integration.test.ts +507 -0
  162. package/src/client/billing/renewalAttach/internal/configure/transport.ts +348 -0
  163. package/src/client/billing/renewalAttach/internal/observation/actor.ts +487 -0
  164. package/src/client/billing/renewalAttach/internal/observation/capture.ts +251 -0
  165. package/src/client/billing/renewalAttach/internal/observation/configureAcknowledgement.ts +20 -0
  166. package/src/client/billing/renewalAttach/internal/observation/observation.integration.test.ts +220 -0
  167. package/src/client/billing/renewalAttach/internal/observation/observationConfigureACK.integration.test.ts +36 -0
  168. package/src/client/billing/renewalAttach/internal/observation/observationConfigureACKControls.integration.test.ts +48 -0
  169. package/src/client/billing/renewalAttach/internal/observation/observationConfigureACKLifecycle.integration.test.ts +44 -0
  170. package/src/client/billing/renewalAttach/internal/observation/observationConfiguredHistory.integration.test.ts +34 -0
  171. package/src/client/billing/renewalAttach/internal/observation/observationRetirement.integration.test.ts +60 -0
  172. package/src/client/billing/renewalAttach/internal/observation/profile.ts +264 -0
  173. package/src/client/billing/renewalAttach/internal/observation/record.ts +408 -0
  174. package/src/client/billing/renewalAttach/internal/observation/types.ts +107 -0
  175. package/src/client/billing/renewalAttach/internal/operations/configureReadTransport.ts +285 -0
  176. package/src/client/billing/renewalAttach/internal/operations/defaultBindings.test.ts +69 -0
  177. package/src/client/billing/renewalAttach/internal/operations/fixedTransport.ts +574 -0
  178. package/src/client/billing/renewalAttach/internal/operations/initialAttach.integration.test.ts +34 -0
  179. package/src/client/billing/renewalAttach/internal/operations/initialAttach.ts +535 -0
  180. package/src/client/billing/renewalAttach/internal/operations/ownedAwait.ts +63 -0
  181. package/src/client/billing/renewalAttach/internal/operations/providerFailure.integration.test.ts +61 -0
  182. package/src/client/billing/renewalAttach/internal/operations/providerFailure.ts +66 -0
  183. package/src/client/billing/renewalAttach/internal/operations/sourceOperations.ts +50 -0
  184. package/src/client/billing/renewalAttach/internal/operations/transport.integration.test.ts +116 -0
  185. package/src/client/billing/renewalAttach/internal/operations/types.ts +223 -0
  186. package/src/client/billing/renewalAttach/internal/preflight/configurePreflight.integration.test.ts +285 -0
  187. package/src/client/billing/renewalAttach/internal/preflight/configurePreflight.ts +258 -0
  188. package/src/client/billing/renewalAttach/internal/preflight/configureReads.integration.test.ts +139 -0
  189. package/src/client/billing/renewalAttach/internal/preflight/grammar.ts +257 -0
  190. package/src/client/billing/renewalAttach/internal/preflight/output.ts +42 -0
  191. package/src/client/billing/renewalAttach/internal/preflight/owner.integration.test.ts +82 -0
  192. package/src/client/billing/renewalAttach/internal/preflight/preflight.integration.test.ts +354 -0
  193. package/src/client/billing/renewalAttach/internal/preflight/record.ts +127 -0
  194. package/src/client/billing/renewalAttach/internal/preflight/relations.ts +209 -0
  195. package/src/client/billing/renewalAttach/internal/recovery/material.ts +311 -0
  196. package/src/client/billing/renewalAttach/internal/recovery/output.ts +136 -0
  197. package/src/client/billing/renewalAttach/internal/recovery/record.ts +230 -0
  198. package/src/client/billing/renewalAttach/internal/recovery/recovery.integration.test.ts +463 -0
  199. package/src/client/billing/renewalAttach/internal/recovery/recoveryActor.ts +599 -0
  200. package/src/client/billing/renewalAttach/internal/recovery/relation.ts +175 -0
  201. package/src/client/billing/renewalAttach/internal/test-fixtures/attachEntries.ts +217 -0
  202. package/src/client/billing/renewalAttach/internal/test-fixtures/attachObservations.ts +226 -0
  203. package/src/client/billing/renewalAttach/internal/test-fixtures/attachScenario.ts +556 -0
  204. package/src/client/billing/renewalAttach/internal/test-fixtures/attachScenarioAssertions.ts +180 -0
  205. package/src/client/billing/renewalAttach/internal/test-fixtures/attachScenarioBarriers.ts +144 -0
  206. package/src/client/billing/renewalAttach/internal/test-fixtures/configurePreflightAssertions.ts +122 -0
  207. package/src/client/billing/renewalAttach/internal/test-fixtures/configurePreflightBarriers.ts +330 -0
  208. package/src/client/billing/renewalAttach/internal/test-fixtures/configurePreflightControls.ts +139 -0
  209. package/src/client/billing/renewalAttach/internal/test-fixtures/configurePreflightOperation.ts +513 -0
  210. package/src/client/billing/renewalAttach/internal/test-fixtures/configureReadNativeBaseline.ts +344 -0
  211. package/src/client/billing/renewalAttach/internal/test-fixtures/configureReadOperation.ts +278 -0
  212. package/src/client/billing/renewalAttach/internal/test-fixtures/configureReadPort.ts +17 -0
  213. package/src/client/billing/renewalAttach/internal/test-fixtures/configureWriteAssertions.ts +537 -0
  214. package/src/client/billing/renewalAttach/internal/test-fixtures/configureWriteBarriers.ts +125 -0
  215. package/src/client/billing/renewalAttach/internal/test-fixtures/configureWriteDeclarations.ts +325 -0
  216. package/src/client/billing/renewalAttach/internal/test-fixtures/configureWriteDelegate.ts +38 -0
  217. package/src/client/billing/renewalAttach/internal/test-fixtures/configureWriteHistory.ts +471 -0
  218. package/src/client/billing/renewalAttach/internal/test-fixtures/configureWriteObservations.ts +515 -0
  219. package/src/client/billing/renewalAttach/internal/test-fixtures/configureWriteOperation.ts +587 -0
  220. package/src/client/billing/renewalAttach/internal/test-fixtures/observationAssertions.ts +211 -0
  221. package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfigureACKAssertions.ts +115 -0
  222. package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfigureACKDeclarations.ts +141 -0
  223. package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfigureACKLifecycleAssertions.ts +74 -0
  224. package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfigureACKLifecycleDeclarations.ts +79 -0
  225. package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfigureACKLifecycleInstrumentation.ts +207 -0
  226. package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfigureACKLifecycleOperation.ts +494 -0
  227. package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfigureACKOperation.ts +452 -0
  228. package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfiguredHistoryAssertions.ts +88 -0
  229. package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfiguredHistoryDeclarations.ts +170 -0
  230. package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfiguredHistoryNative.ts +99 -0
  231. package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfiguredHistoryOperation.ts +411 -0
  232. package/src/client/billing/renewalAttach/internal/test-fixtures/observationDeclarations.ts +192 -0
  233. package/src/client/billing/renewalAttach/internal/test-fixtures/observationHTTP.ts +197 -0
  234. package/src/client/billing/renewalAttach/internal/test-fixtures/observationObservations.ts +269 -0
  235. package/src/client/billing/renewalAttach/internal/test-fixtures/observationOperation.ts +262 -0
  236. package/src/client/billing/renewalAttach/internal/test-fixtures/observationProbe.ts +319 -0
  237. package/src/client/billing/renewalAttach/internal/test-fixtures/ownedOperations.ts +94 -0
  238. package/src/client/billing/renewalAttach/internal/test-fixtures/sourceOperationPort.ts +16 -0
  239. package/src/client/billing/renewalAttach/internal/test-fixtures/stockHttp.ts +21 -0
@@ -0,0 +1,119 @@
1
+ import { need, closed, freeze } from "../material/nodeKernel.js";
2
+ import { equal, referenceId } from "../../../renewalAggregate/shared.js";
3
+ function object(value) {
4
+ need(value !== null && typeof value === "object" && !Array.isArray(value));
5
+ return value;
6
+ }
7
+ const couponID = (id) => typeof id === "string" &&
8
+ id.length > 0 &&
9
+ id.length <= 255 &&
10
+ /\S/.test(id) &&
11
+ id !== "." &&
12
+ id !== "..";
13
+ /** Complete Coupon counterpart relation; no enriched body replaces retained raw JSON. */
14
+ function rebuild(b) {
15
+ const subscription = b.wireSubscription;
16
+ need(subscription &&
17
+ subscription.items &&
18
+ Array.isArray(subscription.items.data) &&
19
+ subscription.items.data.length === 1);
20
+ const lists = [subscription.discounts, subscription.items.data[0].discounts];
21
+ need(lists.every((x) => Array.isArray(x) && x.length <= 20));
22
+ need(Array.isArray(b.couponReads) && b.couponReads.length <= 40);
23
+ const ids = new Map();
24
+ const joined = lists.map((list) => list.map((discount, index) => {
25
+ need(discount && discount.source);
26
+ const ref = discount.source.coupon, id = typeof ref === "string" ? ref : ref?.id;
27
+ need(couponID(id));
28
+ if (!ids.has(id)) {
29
+ const i = ids.size, row = closed(b.couponReads[i], [
30
+ "couponId",
31
+ "wireCoupon",
32
+ "association",
33
+ ]), association = closed(row.association, ["resource", "ordinal"]);
34
+ need(row.couponId === id &&
35
+ association.resource === "coupon" &&
36
+ association.ordinal === 4 + i);
37
+ const c = object(row.wireCoupon);
38
+ need(c.id === id && c.object === "coupon" && c.deleted !== true);
39
+ ids.set(id, i);
40
+ }
41
+ const couponReadIndex = ids.get(id);
42
+ need(couponReadIndex !== undefined);
43
+ const coupon = b.couponReads[couponReadIndex].wireCoupon;
44
+ need(typeof ref === "string" || equal(ref, coupon));
45
+ const joinedDiscount = {
46
+ ...discount,
47
+ source: { ...discount.source, coupon },
48
+ };
49
+ return {
50
+ index,
51
+ discountId: discount.id,
52
+ originalCouponReference: ref,
53
+ couponReadIndex,
54
+ joinedDiscount,
55
+ };
56
+ }));
57
+ need(ids.size === b.couponReads.length &&
58
+ equal(b.derivedCouponJoins, { subscription: joined[0], item: joined[1] }));
59
+ return {
60
+ subscription: joined[0].map((x) => x.joinedDiscount),
61
+ item: joined[1].map((x) => x.joinedDiscount),
62
+ };
63
+ }
64
+ /** One explicit root schedule association transition, with all residual material equal. */
65
+ export function replayCouponEligibility(value) {
66
+ const p = value.attachRequest.preparation, original = value.originalBundle, current = value.currentBundle;
67
+ need(Object.prototype.hasOwnProperty.call(original.wireSubscription, "schedule") &&
68
+ original.wireSubscription.schedule === null &&
69
+ Object.prototype.hasOwnProperty.call(current.wireSubscription, "schedule") &&
70
+ current.wireSubscription.schedule !== null);
71
+ const { schedule: oldAssociation, ...oldResidual } = original.wireSubscription, { schedule: currentAssociation, ...currentResidual } = current.wireSubscription;
72
+ need(oldAssociation === null &&
73
+ equal(p.subscription, original.wireSubscription) &&
74
+ equal(oldResidual, currentResidual));
75
+ for (const [key, wire] of [
76
+ ["targetPrice", "wireTargetPrice"],
77
+ ["billingCustomer", "wireBillingCustomer"],
78
+ ])
79
+ need(equal(p[key], original[wire]) && equal(original[wire], current[wire]));
80
+ rebuild(original);
81
+ const joined = rebuild(current);
82
+ need(equal(original.couponReads, current.couponReads));
83
+ const expected = p.expected, context = {
84
+ customerAccountId: expected.customerAccountId,
85
+ livemode: expected.livemode,
86
+ };
87
+ const scheduleId = referenceId(currentAssociation, "sub_sched", "subscription_schedule", context), customerId = referenceId(current.wireSubscription.customer, "cus", "customer", context);
88
+ function check(v, kind, depth) {
89
+ need(depth <= 40);
90
+ const prefix = kind === "customer"
91
+ ? "cus"
92
+ : kind === "subscription"
93
+ ? "sub"
94
+ : "sub_sched", id = kind === "customer"
95
+ ? customerId
96
+ : kind === "subscription"
97
+ ? expected.subscriptionId
98
+ : scheduleId;
99
+ need(referenceId(v, prefix, kind, context) === id);
100
+ if (typeof v === "string")
101
+ return;
102
+ const node = object(v);
103
+ need(!Object.prototype.hasOwnProperty.call(node, "deleted") ||
104
+ node.deleted === false);
105
+ if (kind !== "customer" &&
106
+ Object.prototype.hasOwnProperty.call(node, "customer"))
107
+ check(node.customer, "customer", depth + 1);
108
+ if (kind === "subscription" &&
109
+ Object.prototype.hasOwnProperty.call(node, "schedule"))
110
+ check(node.schedule, "subscription_schedule", depth + 1);
111
+ if (kind === "subscription_schedule" &&
112
+ Object.prototype.hasOwnProperty.call(node, "subscription"))
113
+ check(node.subscription, "subscription", depth + 1);
114
+ }
115
+ check(current.wireSubscription, "subscription", 0);
116
+ check(current.wireBillingCustomer, "customer", 0);
117
+ return freeze(joined);
118
+ }
119
+ //# sourceMappingURL=relation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relation.js","sourceRoot":"","sources":["../../../../../../src/client/billing/renewalAttach/internal/recovery/relation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAGzE,SAAS,MAAM,CAAC,KAAc;IAC5B,IAAI,CAAC,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3E,OAAO,KAAgC,CAAC;AAC1C,CAAC;AACD,MAAM,QAAQ,GAAG,CAAC,EAAW,EAAgB,EAAE,CAC7C,OAAO,EAAE,KAAK,QAAQ;IACtB,EAAE,CAAC,MAAM,GAAG,CAAC;IACb,EAAE,CAAC,MAAM,IAAI,GAAG;IAChB,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;IACb,EAAE,KAAK,GAAG;IACV,EAAE,KAAK,IAAI,CAAC;AAEd,yFAAyF;AACzF,SAAS,OAAO,CAAC,CAAS;IACxB,MAAM,YAAY,GAAG,CAAC,CAAC,gBAAgB,CAAC;IACxC,IAAI,CACF,YAAY;QACV,YAAY,CAAC,KAAK;QAClB,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC;QACtC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,CACvC,CAAC;IACF,MAAM,KAAK,GAAG,CAAC,YAAY,CAAC,SAAS,EAAE,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC7E,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,IAAI,EAAE,CAAC,C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AAc,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC;YAEtD,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;QAC9C,IACE,IAAI,KAAK,cAAc;YACvB,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC;YAEtD,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,uBAAuB,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;QAC3D,IACE,IAAI,KAAK,uBAAuB;YAChC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC;YAE1D,KAAK,CAAC,IAAI,CAAC,YAAY,EAAE,cAAc,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;IACxD,CAAC;IACD,KAAK,CAAC,OAAO,CAAC,gBAAgB,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC;IACnD,KAAK,CAAC,OAAO,CAAC,mBAAmB,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;IAClD,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC"}
@@ -2361,14 +2361,6 @@ export declare function setup(amounts?: number[]): Promise<{
2361
2361
  preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
2362
2362
  requestKey: string;
2363
2363
  result?: {
2364
- reason: "identity_changed" | "revision_changed" | "scope_busy";
2365
- retryable: false;
2366
- status: "conflict";
2367
- } | {
2368
- reason: "policy_invalid";
2369
- retryable: false;
2370
- status: "rejected";
2371
- } | {
2372
2364
  operation: {
2373
2365
  accountId: string;
2374
2366
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -2379,6 +2371,14 @@ export declare function setup(amounts?: number[]): Promise<{
2379
2371
  } | {
2380
2372
  enabled: boolean;
2381
2373
  status: "unchanged";
2374
+ } | {
2375
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
2376
+ retryable: false;
2377
+ status: "conflict";
2378
+ } | {
2379
+ reason: "policy_invalid";
2380
+ retryable: false;
2381
+ status: "rejected";
2382
2382
  } | {
2383
2383
  reason: "provider_pending";
2384
2384
  retryable: true;
@@ -2389,14 +2389,6 @@ export declare function setup(amounts?: number[]): Promise<{
2389
2389
  payload: import("convex/values").VString<string, "required">;
2390
2390
  preparationId: import("convex/values").VId<import("convex/values").GenericId<"balanceFundingPreparations">, "required">;
2391
2391
  result: import("convex/values").VUnion<{
2392
- reason: "identity_changed" | "revision_changed" | "scope_busy";
2393
- retryable: false;
2394
- status: "conflict";
2395
- } | {
2396
- reason: "policy_invalid";
2397
- retryable: false;
2398
- status: "rejected";
2399
- } | {
2400
2392
  operation: {
2401
2393
  accountId: string;
2402
2394
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -2407,6 +2399,14 @@ export declare function setup(amounts?: number[]): Promise<{
2407
2399
  } | {
2408
2400
  enabled: boolean;
2409
2401
  status: "unchanged";
2402
+ } | {
2403
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
2404
+ retryable: false;
2405
+ status: "conflict";
2406
+ } | {
2407
+ reason: "policy_invalid";
2408
+ retryable: false;
2409
+ status: "rejected";
2410
2410
  } | {
2411
2411
  reason: "provider_pending";
2412
2412
  retryable: true;
@@ -2351,6 +2351,14 @@ export declare function large(count?: number, amount?: number): Promise<{
2351
2351
  preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
2352
2352
  requestKey: string;
2353
2353
  result?: {
2354
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
2355
+ retryable: false;
2356
+ status: "conflict";
2357
+ } | {
2358
+ reason: "policy_invalid";
2359
+ retryable: false;
2360
+ status: "rejected";
2361
+ } | {
2354
2362
  operation: {
2355
2363
  accountId: string;
2356
2364
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -2361,14 +2369,6 @@ export declare function large(count?: number, amount?: number): Promise<{
2361
2369
  } | {
2362
2370
  enabled: boolean;
2363
2371
  status: "unchanged";
2364
- } | {
2365
- reason: "identity_changed" | "revision_changed" | "scope_busy";
2366
- retryable: false;
2367
- status: "conflict";
2368
- } | {
2369
- reason: "policy_invalid";
2370
- retryable: false;
2371
- status: "rejected";
2372
2372
  } | {
2373
2373
  reason: "provider_pending";
2374
2374
  retryable: true;
@@ -2379,6 +2379,14 @@ export declare function large(count?: number, amount?: number): Promise<{
2379
2379
  payload: import("convex/values").VString<string, "required">;
2380
2380
  preparationId: import("convex/values").VId<import("convex/values").GenericId<"balanceFundingPreparations">, "required">;
2381
2381
  result: import("convex/values").VUnion<{
2382
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
2383
+ retryable: false;
2384
+ status: "conflict";
2385
+ } | {
2386
+ reason: "policy_invalid";
2387
+ retryable: false;
2388
+ status: "rejected";
2389
+ } | {
2382
2390
  operation: {
2383
2391
  accountId: string;
2384
2392
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -2389,14 +2397,6 @@ export declare function large(count?: number, amount?: number): Promise<{
2389
2397
  } | {
2390
2398
  enabled: boolean;
2391
2399
  status: "unchanged";
2392
- } | {
2393
- reason: "identity_changed" | "revision_changed" | "scope_busy";
2394
- retryable: false;
2395
- status: "conflict";
2396
- } | {
2397
- reason: "policy_invalid";
2398
- retryable: false;
2399
- status: "rejected";
2400
2400
  } | {
2401
2401
  reason: "provider_pending";
2402
2402
  retryable: true;
@@ -7207,6 +7207,14 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
7207
7207
  preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
7208
7208
  requestKey: string;
7209
7209
  result?: {
7210
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
7211
+ retryable: false;
7212
+ status: "conflict";
7213
+ } | {
7214
+ reason: "policy_invalid";
7215
+ retryable: false;
7216
+ status: "rejected";
7217
+ } | {
7210
7218
  operation: {
7211
7219
  accountId: string;
7212
7220
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -7217,14 +7225,6 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
7217
7225
  } | {
7218
7226
  enabled: boolean;
7219
7227
  status: "unchanged";
7220
- } | {
7221
- reason: "identity_changed" | "revision_changed" | "scope_busy";
7222
- retryable: false;
7223
- status: "conflict";
7224
- } | {
7225
- reason: "policy_invalid";
7226
- retryable: false;
7227
- status: "rejected";
7228
7228
  } | {
7229
7229
  reason: "provider_pending";
7230
7230
  retryable: true;
@@ -7235,6 +7235,14 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
7235
7235
  payload: import("convex/values").VString<string, "required">;
7236
7236
  preparationId: import("convex/values").VId<import("convex/values").GenericId<"balanceFundingPreparations">, "required">;
7237
7237
  result: import("convex/values").VUnion<{
7238
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
7239
+ retryable: false;
7240
+ status: "conflict";
7241
+ } | {
7242
+ reason: "policy_invalid";
7243
+ retryable: false;
7244
+ status: "rejected";
7245
+ } | {
7238
7246
  operation: {
7239
7247
  accountId: string;
7240
7248
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -7245,14 +7253,6 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
7245
7253
  } | {
7246
7254
  enabled: boolean;
7247
7255
  status: "unchanged";
7248
- } | {
7249
- reason: "identity_changed" | "revision_changed" | "scope_busy";
7250
- retryable: false;
7251
- status: "conflict";
7252
- } | {
7253
- reason: "policy_invalid";
7254
- retryable: false;
7255
- status: "rejected";
7256
7256
  } | {
7257
7257
  reason: "provider_pending";
7258
7258
  retryable: true;
@@ -9,6 +9,17 @@ export declare const bridge: import("convex/server").RegisteredAction<"internal"
9
9
  stripeSubscriptionId: string;
10
10
  version: number;
11
11
  }, Promise<{
12
+ status: "ready";
13
+ value: {
14
+ customerAccount: string;
15
+ enabled?: boolean | undefined;
16
+ paymentMethodId: string | null;
17
+ paymentMethodTypes?: string[] | null | undefined;
18
+ phase: "apply" | "attach" | "create";
19
+ providerApiVersion: string;
20
+ stripeSubscriptionId: string;
21
+ };
22
+ } | {
12
23
  reason: "history_incomplete" | "provider_outcome_unknown";
13
24
  retryable: false;
14
25
  status: "unknown";
@@ -24,16 +35,5 @@ export declare const bridge: import("convex/server").RegisteredAction<"internal"
24
35
  reason: "provider_pending";
25
36
  retryable: true;
26
37
  status: "not_ready";
27
- } | {
28
- status: "ready";
29
- value: {
30
- customerAccount: string;
31
- enabled?: boolean | undefined;
32
- paymentMethodId: string | null;
33
- paymentMethodTypes?: string[] | null | undefined;
34
- phase: "apply" | "attach" | "create";
35
- providerApiVersion: string;
36
- stripeSubscriptionId: string;
37
- };
38
38
  }>>;
39
39
  //# sourceMappingURL=actions.d.ts.map
@@ -9,9 +9,9 @@ export declare function legOwnership(ctx: MutationCtx, bucketKey: string, prior:
9
9
  orgId: string | undefined;
10
10
  ownershipStatus: "ambiguous";
11
11
  } | {
12
- registrationId?: undefined;
13
12
  userId?: undefined;
14
13
  orgId?: undefined;
14
+ registrationId?: undefined;
15
15
  ownershipStatus: "ambiguous";
16
16
  } | {
17
17
  registrationId: import("convex/values").GenericId<"financialOwnership">;
@@ -19,9 +19,9 @@ export declare function legOwnership(ctx: MutationCtx, bucketKey: string, prior:
19
19
  orgId: string | undefined;
20
20
  ownershipStatus: "unknown";
21
21
  } | {
22
- registrationId?: undefined;
23
22
  userId?: undefined;
24
23
  orgId?: undefined;
24
+ registrationId?: undefined;
25
25
  ownershipStatus: "unknown";
26
26
  } | {
27
27
  registrationId: import("convex/values").GenericId<"financialOwnership">;
@@ -29,9 +29,9 @@ export declare function legOwnership(ctx: MutationCtx, bucketKey: string, prior:
29
29
  orgId: string | undefined;
30
30
  ownershipStatus: "contradictory";
31
31
  } | {
32
- registrationId?: undefined;
33
32
  userId?: undefined;
34
33
  orgId?: undefined;
34
+ registrationId?: undefined;
35
35
  ownershipStatus: "contradictory";
36
36
  } | {
37
37
  registrationId: import("convex/values").GenericId<"financialOwnership">;
@@ -2351,14 +2351,6 @@ export declare function setupAllowance(): Promise<{
2351
2351
  preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
2352
2352
  requestKey: string;
2353
2353
  result?: {
2354
- reason: "identity_changed" | "revision_changed" | "scope_busy";
2355
- retryable: false;
2356
- status: "conflict";
2357
- } | {
2358
- reason: "policy_invalid";
2359
- retryable: false;
2360
- status: "rejected";
2361
- } | {
2362
2354
  operation: {
2363
2355
  accountId: string;
2364
2356
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -2369,6 +2361,14 @@ export declare function setupAllowance(): Promise<{
2369
2361
  } | {
2370
2362
  enabled: boolean;
2371
2363
  status: "unchanged";
2364
+ } | {
2365
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
2366
+ retryable: false;
2367
+ status: "conflict";
2368
+ } | {
2369
+ reason: "policy_invalid";
2370
+ retryable: false;
2371
+ status: "rejected";
2372
2372
  } | {
2373
2373
  reason: "provider_pending";
2374
2374
  retryable: true;
@@ -2379,14 +2379,6 @@ export declare function setupAllowance(): Promise<{
2379
2379
  payload: import("convex/values").VString<string, "required">;
2380
2380
  preparationId: import("convex/values").VId<import("convex/values").GenericId<"balanceFundingPreparations">, "required">;
2381
2381
  result: import("convex/values").VUnion<{
2382
- reason: "identity_changed" | "revision_changed" | "scope_busy";
2383
- retryable: false;
2384
- status: "conflict";
2385
- } | {
2386
- reason: "policy_invalid";
2387
- retryable: false;
2388
- status: "rejected";
2389
- } | {
2390
2382
  operation: {
2391
2383
  accountId: string;
2392
2384
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -2397,6 +2389,14 @@ export declare function setupAllowance(): Promise<{
2397
2389
  } | {
2398
2390
  enabled: boolean;
2399
2391
  status: "unchanged";
2392
+ } | {
2393
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
2394
+ retryable: false;
2395
+ status: "conflict";
2396
+ } | {
2397
+ reason: "policy_invalid";
2398
+ retryable: false;
2399
+ status: "rejected";
2400
2400
  } | {
2401
2401
  reason: "provider_pending";
2402
2402
  retryable: true;
@@ -2351,6 +2351,14 @@ export declare function setupCredits(): Promise<{
2351
2351
  preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
2352
2352
  requestKey: string;
2353
2353
  result?: {
2354
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
2355
+ retryable: false;
2356
+ status: "conflict";
2357
+ } | {
2358
+ reason: "policy_invalid";
2359
+ retryable: false;
2360
+ status: "rejected";
2361
+ } | {
2354
2362
  operation: {
2355
2363
  accountId: string;
2356
2364
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -2361,14 +2369,6 @@ export declare function setupCredits(): Promise<{
2361
2369
  } | {
2362
2370
  enabled: boolean;
2363
2371
  status: "unchanged";
2364
- } | {
2365
- reason: "identity_changed" | "revision_changed" | "scope_busy";
2366
- retryable: false;
2367
- status: "conflict";
2368
- } | {
2369
- reason: "policy_invalid";
2370
- retryable: false;
2371
- status: "rejected";
2372
2372
  } | {
2373
2373
  reason: "provider_pending";
2374
2374
  retryable: true;
@@ -2379,6 +2379,14 @@ export declare function setupCredits(): Promise<{
2379
2379
  payload: import("convex/values").VString<string, "required">;
2380
2380
  preparationId: import("convex/values").VId<import("convex/values").GenericId<"balanceFundingPreparations">, "required">;
2381
2381
  result: import("convex/values").VUnion<{
2382
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
2383
+ retryable: false;
2384
+ status: "conflict";
2385
+ } | {
2386
+ reason: "policy_invalid";
2387
+ retryable: false;
2388
+ status: "rejected";
2389
+ } | {
2382
2390
  operation: {
2383
2391
  accountId: string;
2384
2392
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -2389,14 +2397,6 @@ export declare function setupCredits(): Promise<{
2389
2397
  } | {
2390
2398
  enabled: boolean;
2391
2399
  status: "unchanged";
2392
- } | {
2393
- reason: "identity_changed" | "revision_changed" | "scope_busy";
2394
- retryable: false;
2395
- status: "conflict";
2396
- } | {
2397
- reason: "policy_invalid";
2398
- retryable: false;
2399
- status: "rejected";
2400
2400
  } | {
2401
2401
  reason: "provider_pending";
2402
2402
  retryable: true;
@@ -49,12 +49,27 @@ changing its receiver, arguments, result or thrown value. The owner checks the
49
49
  same original wall and monotonic time bounds and closes permanently on expiry,
50
50
  regression or retirement. These modules do not read a clock at import time.
51
51
 
52
- The compiled entry registry remains empty, and the original Source and stock
53
- client bindings remain unbound. There is no package export or operational
54
- attachment actor in this increment. It does not authorize reads, dispatch a
55
- request, enable recovery or establish provider custody or native qualification.
56
- The internal Node-only mechanics are not a caller-supplied clock, client or
57
- qualification API. The public preparation and receipt constructors are unchanged.
52
+ The internal initial-attachment and explicit-recovery actors compose these
53
+ guards with the raw reader and event continuations. Each captured invocation is
54
+ single-use. Before acquisition, an actor checks the exact Source operation,
55
+ read-plan and delegate identities and the complete locally rebuilt attachment
56
+ request. Retained and fresh coverage require literal `true` from their selected
57
+ entry predicates.
58
+
59
+ An admitted invocation has a distinct transport pair with at most 43 GETs and
60
+ one creation POST. Dispatch, safe response and receipt events each require
61
+ send completion and a matching acknowledgement. Explicit unknown recovery
62
+ retains the original request, key, first-dispatch time and owner, while using a
63
+ new transport pair. An observed Schedule remains unowned evidence; matching its
64
+ shape never substitutes for the acknowledged creation response. Complete
65
+ acknowledged results pass bounded JSON admission before the final owner check.
66
+
67
+ The compiled registries remain empty, and the original Source and stock client
68
+ bindings remain unbound. Normal actor invocation refuses before Source access;
69
+ there is no package-root export or qualified operational entry. These internal
70
+ Node-only mechanics establish no provider custody or native qualification and
71
+ expose no caller-supplied clock, client or qualification API. The public
72
+ preparation and receipt constructors are unchanged.
58
73
 
59
74
  ## Internal initial material consistency
60
75
 
@@ -333,8 +348,11 @@ does not authenticate a response, prove that a POST succeeded, establish
333
348
  ownership, qualify a provider profile or authorize configuration. A coherent
334
349
  unsigned forgery can pass. No transport status or observation time is invented.
335
350
  Hosts must separately establish acknowledgement provenance and preserve the
336
- original records. Existing V1 configure and receipt consumers still reject V2;
337
- there is no migration, writer or V2 configure executor.
351
+ original records. Existing V1 configure and receipt consumers still reject V2.
352
+ There is no public migration or V2 configure executor. The internal configure
353
+ writer has empty Source bindings and requires separate operation, transport and
354
+ custody qualification before it can be enabled; see
355
+ [renewal phase assembly](renewal-phase-assembly.md#internal-configure-dispatch-and-explicit-replay).
338
356
 
339
357
  These helpers retain ordinary provider and caller metadata within their JSON
340
358
  limits. They do not redact, encrypt or certify that input or output is safe to
@@ -122,3 +122,61 @@ about whole-process memory or other SDK methods. Invalid raw capture rejects wit
122
122
  a fixed error; safe but insufficient material returns `unknown` or `conflict`
123
123
  with a fixed reason. No raw provider error is logged or returned. The host remains
124
124
  responsible for retaining its immutable request and response data when reads fail.
125
+
126
+ ## Internal owned observation and retained configure acknowledgements
127
+
128
+ `captureOwnedRenewalObservationV2` is internal; each captured handle permits one
129
+ invocation. Its fixed Source must bind the original Owner and origin, original
130
+ attachment entry and actual acknowledged attachment receipt identity to a distinct
131
+ observation entry. Reconstructing equal receipt data cannot establish that
132
+ association. The normal registry is empty and its loader unbound. There is no
133
+ public execution export or caller-supplied Owner, client or Source context.
134
+
135
+ After bounded record capture, the original configuration projection runs first.
136
+ A supported Failure returns the same object before the actor's explicit receipt
137
+ proof, classification or reads. Success requires the complete retained record and
138
+ attachment proof, original entry coverage and a live original Owner.
139
+
140
+ The read order is Schedule, expanded Subscription, target Price, billing Customer,
141
+ then unique Coupon IDs across the original and current subscription and item
142
+ discounts. Two distinct Coupon IDs give six GETs; the union permits at most 40
143
+ Coupons and 44 GETs. Complete bare response bodies and ordinary unknown fields are
144
+ retained. This invocation makes no POST and appends no C10 events. When both
145
+ configure fields are absent, it calls no configure-receipt constructor. The
146
+ optional branch reconstructs the retained receipt before current reads.
147
+
148
+ `owned_observation_data` contains `observation`, `reads`, the final read's
149
+ `observedAt`, `retainedConfigureAcknowledgement: "absent" | "present"` and
150
+ `operationalAuthority: false`. The complete pure-helper result is preserved.
151
+ Record, observer input and result each remain within 500000 serialized characters
152
+ and UTF-8 bytes, 10000 nodes counting repeated occurrences, and depth 40. The
153
+ result is detached and frozen before its final Owner check. Owner checks guard
154
+ settled continuations; they do not promise immediate cancellation of pending HTTP.
155
+
156
+ The fixed Source can omit both `configureAcknowledgement` and
157
+ `configureOperation`, or supply both. Supplying only one rejects before the
158
+ original projection. With both present, a supported original projection Failure
159
+ still returns unchanged before configure custody checks or reads.
160
+
161
+ The optional branch requires the actual configure operation and the exact
162
+ acknowledgement wrapper returned by its writer under the same original Owner, origin, attachment
163
+ entry and complete retained record. An equal reconstructed object does not
164
+ establish custody. A valid receipt that was constructed but never returned does
165
+ not satisfy this relation. The lookup exposes detached frozen data, including
166
+ the complete original receipt-constructor input, without exposing private history
167
+ or transport capabilities. The observer constructs a fresh receipt from that
168
+ input and checks the entire acknowledgement, including default-setting presence,
169
+ before acquiring current reads. It supplies the full retained input to the
170
+ unchanged public pure helper as `configureReceipt`.
171
+
172
+ The `present` marker describes this process-local returned-receipt association.
173
+ It does not establish durable custody after restart, provider qualification,
174
+ pending or effective state. A retained one-phase response can still produce an
175
+ honest `unknown` result. With complete configured historical material, the branch
176
+ preserves the pure helper's `pending_material_match` or
177
+ `current_target_material_match` comparisons. Those results remain unsigned
178
+ material predicates. The absent branch keeps the helper's existing
179
+ pending/effective classes and invoice-pointer limitation. Historical and terminal
180
+ provider qualification, successor invoice evidence and genuine Source binding
181
+ remain separate requirements. These sequential reads do not atomically exclude other provider
182
+ writers or establish payment, authentication or entitlement.