@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,245 @@
1
+ import { types } from "node:util";
2
+ import { requiredJSONSnapshot } from "../material/requiredJson.js";
3
+ import { resourceId } from "../../../renewalAggregate/shared.js";
4
+ import { closed } from "../operations/types.js";
5
+ export const API = "2026-09-30.endive";
6
+ export const stop = () => {
7
+ throw Error("CONFIGURE_WRITE_STOP");
8
+ };
9
+ export function need(value) {
10
+ if (!value)
11
+ stop();
12
+ }
13
+ export function ownMethod(raw, key) {
14
+ need(raw !== null && typeof raw === "object" && !types.isProxy(raw));
15
+ const d = Object.getOwnPropertyDescriptor(raw, key);
16
+ need(d &&
17
+ d.enumerable &&
18
+ "value" in d &&
19
+ typeof d.value === "function" &&
20
+ !types.isProxy(d.value));
21
+ return d.value;
22
+ }
23
+ const query = "?" +
24
+ new URLSearchParams(["discounts", "items.data.discounts", "items.data.price"].map((value, i) => ["expand[" + i + "]", value]));
25
+ const plurals = {
26
+ subscription: "subscriptions",
27
+ price: "prices",
28
+ customer: "customers",
29
+ coupon: "coupons",
30
+ schedule: "subscription_schedules",
31
+ };
32
+ const prefixes = {
33
+ subscription: "sub",
34
+ price: "price",
35
+ customer: "cus",
36
+ schedule: "sub_sched",
37
+ };
38
+ function idFor(resource, path) {
39
+ const root = "/v1/" + plurals[resource] + "/";
40
+ need(path.startsWith(root));
41
+ if (resource === "subscription")
42
+ need(path.endsWith(query));
43
+ const encoded = path.slice(root.length, resource === "subscription" ? -query.length : undefined);
44
+ let id;
45
+ try {
46
+ id = decodeURIComponent(encoded);
47
+ }
48
+ catch {
49
+ return stop();
50
+ }
51
+ need(encodeURIComponent(id) === encoded);
52
+ if (resource === "coupon")
53
+ need(id.length >= 1 &&
54
+ id.length <= 255 &&
55
+ /\S/.test(id) &&
56
+ id !== "." &&
57
+ id !== "..");
58
+ else
59
+ need(resourceId(prefixes[resource]).safeParse(id).success);
60
+ return id;
61
+ }
62
+ /** Stateless closed fixed44 profile; explicit undefined bodies are never JSON encoded. */
63
+ export function capturePlan(raw) {
64
+ need(!types.isProxy(raw) &&
65
+ Array.isArray(raw) &&
66
+ Object.getPrototypeOf(raw) === Array.prototype);
67
+ const length = Object.getOwnPropertyDescriptor(raw, "length"), count = length?.value;
68
+ need(length &&
69
+ "value" in length &&
70
+ typeof count === "number" &&
71
+ Number.isSafeInteger(count) &&
72
+ count >= 4 &&
73
+ count <= 44);
74
+ const keys = Reflect.ownKeys(raw);
75
+ need(keys.length === count + 1 && keys.every((k) => typeof k === "string"));
76
+ const result = [], coupons = new Set();
77
+ for (let i = 0; i < count; i++) {
78
+ const d = Object.getOwnPropertyDescriptor(raw, String(i));
79
+ need(d && d.enumerable && "value" in d && !types.isProxy(d.value));
80
+ const row = closed(d.value, [
81
+ "resource",
82
+ "ordinal",
83
+ "method",
84
+ "path",
85
+ "body",
86
+ "options",
87
+ ]);
88
+ need(!types.isProxy(row.options));
89
+ const options = closed(row.options, ["apiVersion", "maxNetworkRetries"]);
90
+ const resource = i === 0
91
+ ? "subscription"
92
+ : i === 1
93
+ ? "price"
94
+ : i === 2
95
+ ? "customer"
96
+ : i === count - 1
97
+ ? "schedule"
98
+ : "coupon";
99
+ need(row.resource === resource &&
100
+ row.ordinal === i + 1 &&
101
+ row.method === "GET" &&
102
+ typeof row.path === "string" &&
103
+ row.body === undefined &&
104
+ options.apiVersion === API &&
105
+ options.maxNetworkRetries === 0);
106
+ const id = idFor(resource, row.path);
107
+ requiredJSONSnapshot(row.path);
108
+ if (resource === "coupon") {
109
+ need(!coupons.has(id));
110
+ coupons.add(id);
111
+ }
112
+ result.push(Object.freeze({
113
+ resource,
114
+ ordinal: i + 1,
115
+ method: "GET",
116
+ path: row.path,
117
+ body: undefined,
118
+ id,
119
+ options: Object.freeze({ apiVersion: API, maxNetworkRetries: 0 }),
120
+ }));
121
+ }
122
+ need(coupons.size <= 40);
123
+ return Object.freeze(result);
124
+ }
125
+ export function samePlan(a, b) {
126
+ return (a.length === b.length &&
127
+ a.every((r, i) => {
128
+ const s = b[i];
129
+ return (r.resource === s.resource &&
130
+ r.ordinal === s.ordinal &&
131
+ r.method === s.method &&
132
+ r.path === s.path &&
133
+ r.body === s.body &&
134
+ r.id === s.id &&
135
+ r.options.apiVersion === s.options.apiVersion &&
136
+ r.options.maxNetworkRetries === s.options.maxNetworkRetries);
137
+ }));
138
+ }
139
+ export function expectedPlan(record) {
140
+ const e = record.configuration.preparation.expected, customer = record.originalBundle.wireBillingCustomer.id;
141
+ need(typeof customer === "string");
142
+ const paths = [
143
+ "/v1/subscriptions/" + encodeURIComponent(e.subscriptionId) + query,
144
+ "/v1/prices/" + encodeURIComponent(e.targetPriceId),
145
+ "/v1/customers/" + encodeURIComponent(customer),
146
+ ...record.originalBundle.couponReads.map((row) => {
147
+ need(typeof row.couponId === "string");
148
+ return "/v1/coupons/" + encodeURIComponent(row.couponId);
149
+ }),
150
+ "/v1/subscription_schedules/" +
151
+ encodeURIComponent(record.attachReceipt.scheduleId),
152
+ ];
153
+ return capturePlan(paths.map((path, i) => ({
154
+ resource: i === 0
155
+ ? "subscription"
156
+ : i === 1
157
+ ? "price"
158
+ : i === 2
159
+ ? "customer"
160
+ : i === paths.length - 1
161
+ ? "schedule"
162
+ : "coupon",
163
+ ordinal: i + 1,
164
+ method: "GET",
165
+ path,
166
+ body: undefined,
167
+ options: { apiVersion: API, maxNetworkRetries: 0 },
168
+ })));
169
+ }
170
+ export function assertRequest(raw) {
171
+ need(!types.isProxy(raw));
172
+ const r = closed(raw, [
173
+ "version",
174
+ "stage",
175
+ "scope",
176
+ "apiVersion",
177
+ "logicalBinding",
178
+ "scheduleId",
179
+ "method",
180
+ "path",
181
+ "key",
182
+ "payload",
183
+ "firstDispatchedAt",
184
+ "attachReceiptBinding",
185
+ "baselineBinding",
186
+ "defaultSettingsBinding",
187
+ "status",
188
+ "providerQualification",
189
+ "profile",
190
+ "requestIdentity",
191
+ ]);
192
+ need(r.version === 2 &&
193
+ r.stage === "configure" &&
194
+ r.scope === "platform" &&
195
+ r.apiVersion === API &&
196
+ r.method === "POST" &&
197
+ r.status === "projected_configure_request" &&
198
+ r.providerQualification === "required");
199
+ need(typeof r.scheduleId === "string" &&
200
+ resourceId("sub_sched").safeParse(r.scheduleId).success &&
201
+ r.path === "/v1/subscription_schedules/" + r.scheduleId);
202
+ need(typeof r.key === "string" &&
203
+ r.key.length >= 1 &&
204
+ r.key.length <= 255 &&
205
+ typeof r.firstDispatchedAt === "number" &&
206
+ Number.isSafeInteger(r.firstDispatchedAt) &&
207
+ r.firstDispatchedAt >= 0);
208
+ need(!types.isProxy(r.profile) && !types.isProxy(r.requestIdentity));
209
+ const p = closed(r.profile, [
210
+ "apiVersion",
211
+ "billingMode",
212
+ "cadence",
213
+ "anchor",
214
+ ]), identity = closed(r.requestIdentity, ["key", "binding"]);
215
+ need(p.apiVersion === API &&
216
+ (p.billingMode === "classic" || p.billingMode === "flexible") &&
217
+ (p.cadence === "same" || p.cadence === "changed") &&
218
+ (p.anchor === "ordinary" || p.anchor === "calendar_edge") &&
219
+ identity.key === r.key);
220
+ need(!types.isProxy(r.payload));
221
+ const payload = closed(r.payload, [
222
+ "end_behavior",
223
+ "proration_behavior",
224
+ "phases",
225
+ ]);
226
+ need(payload.end_behavior === "release" &&
227
+ payload.proration_behavior === "none" &&
228
+ !types.isProxy(payload.phases) &&
229
+ Array.isArray(payload.phases) &&
230
+ payload.phases.length === 2);
231
+ requiredJSONSnapshot({ key: r.key, payload: r.payload, profile: p });
232
+ }
233
+ export function seven(request) {
234
+ const { scope, apiVersion, method, path, payload, key, firstDispatchedAt } = request;
235
+ return Object.freeze({
236
+ scope,
237
+ apiVersion,
238
+ method,
239
+ path,
240
+ payload,
241
+ key,
242
+ firstDispatchedAt,
243
+ });
244
+ }
245
+ //# sourceMappingURL=request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../../../../src/client/billing/renewalAttach/internal/configure/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAIhD,MAAM,CAAC,MAAM,GAAG,GAAG,mBAAmB,CAAC;AACvC,MAAM,CAAC,MAAM,IAAI,GAAG,GAAU,EAAE;IAC9B,MAAM,KAAK,CAAC,sBAAsB,CAAC,CAAC;AACtC,CAAC,CAAC;AACF,MAAM,UAAU,IAAI,CAAC,KAAc;IACjC,IAAI,CAAC,KAAK;QAAE,IAAI,EAAE,CAAC;AACrB,CAAC;AAED,MAAM,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,88 @@
1
+ import { type Row } from "./request.js";
2
+ import type { Diagnostics } from "../operations/providerFailure.js";
3
+ export type Disposition = "NOT_STARTED" | "PENDING" | "REJECTED" | "FULFILLED_UNVERIFIED" | "FULFILLED_SAFE";
4
+ export declare function createConfigureWriteTransport(): Readonly<{
5
+ transport: Readonly<{
6
+ readTransport: Readonly<{
7
+ rawRequest(verb: "GET", path: string, body: undefined, options: unknown): Promise<unknown>;
8
+ }>;
9
+ postDisposition(): Disposition;
10
+ postConfigure(): Promise<Readonly<{
11
+ outcome: "not_started";
12
+ }> | Readonly<{
13
+ outcome: "post_unknown";
14
+ }> | Readonly<{
15
+ outcome: "provider_rejected";
16
+ }> | Readonly<{
17
+ outcome: "fulfilled_safe";
18
+ body: Record<string, unknown>;
19
+ transport: {
20
+ status: number;
21
+ requestId?: string | undefined;
22
+ };
23
+ }> | Readonly<{
24
+ outcome: "fulfilled_unverified";
25
+ }>>;
26
+ }>;
27
+ capability: Readonly<{
28
+ assertSourceOperationBinding(actualOperation: unknown, originalRequest: unknown, actualReadPlan: unknown, actualDelegate: unknown, originalMethod: unknown, expected: readonly Row[]): boolean;
29
+ reserveAcquisition(): boolean;
30
+ consumeReadCatch(): Readonly<{
31
+ phase: "read" | "post";
32
+ resource: string;
33
+ ordinal: number;
34
+ diagnostics: Diagnostics;
35
+ }> | null;
36
+ consumePostCatch(actualReply: unknown): Readonly<{
37
+ phase: "read" | "post";
38
+ resource: string;
39
+ ordinal: number;
40
+ diagnostics: Diagnostics;
41
+ }> | null;
42
+ consumeNotStarted(actualReply: unknown): boolean;
43
+ discardFulfilledQuarantine(): void;
44
+ }>;
45
+ }>;
46
+ export declare function createConfigureReplayTransport(): Readonly<{
47
+ transport: Readonly<{
48
+ readTransport: Readonly<{
49
+ rawRequest(verb: "GET", path: string, body: undefined, options: unknown): Promise<unknown>;
50
+ }>;
51
+ postDisposition(): Disposition;
52
+ postConfigure(): Promise<Readonly<{
53
+ outcome: "not_started";
54
+ }> | Readonly<{
55
+ outcome: "post_unknown";
56
+ }> | Readonly<{
57
+ outcome: "provider_rejected";
58
+ }> | Readonly<{
59
+ outcome: "fulfilled_safe";
60
+ body: Record<string, unknown>;
61
+ transport: {
62
+ status: number;
63
+ requestId?: string | undefined;
64
+ };
65
+ }> | Readonly<{
66
+ outcome: "fulfilled_unverified";
67
+ }>>;
68
+ }>;
69
+ capability: Readonly<{
70
+ assertSourceOperationBinding(actualOperation: unknown, originalRequest: unknown, actualReadPlan: unknown, actualDelegate: unknown, originalMethod: unknown, expected: readonly Row[]): boolean;
71
+ reserveAcquisition(): boolean;
72
+ consumeReadCatch(): Readonly<{
73
+ phase: "read" | "post";
74
+ resource: string;
75
+ ordinal: number;
76
+ diagnostics: Diagnostics;
77
+ }> | null;
78
+ consumePostCatch(actualReply: unknown): Readonly<{
79
+ phase: "read" | "post";
80
+ resource: string;
81
+ ordinal: number;
82
+ diagnostics: Diagnostics;
83
+ }> | null;
84
+ consumeNotStarted(actualReply: unknown): boolean;
85
+ discardFulfilledQuarantine(): void;
86
+ }>;
87
+ }>;
88
+ //# sourceMappingURL=transport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../../../../../src/client/billing/renewalAttach/internal/configure/transport.ts"],"names":[],"mappings":"AAUA,OAAO,EAML,KAAK,GAAG,EACT,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAQpE,MAAM,MAAM,WAAW,GACnB,aAAa,GACb,SAAS,GACT,UAAU,GACV,sBAAsB,GACtB,gBAAgB,CAAC;AAqTrB,wBAAgB,6BAA6B;;;6BA3NjC,KAAK,QACL,MAAM,QACN,SAAS,WACN,OAAO,GACf,OAAO,CAAC,OAAO,CAAC;;2BAiDA,WAAW;;qBAYa,aAAa;;qBAqBpB,cAAc;;qBASN,mBAAmB;;qBA0BhD,gBAAgB;;;;;;;qBAMK,sBAAsB;;;;sDAMvC,OAAO,mBACP,OAAO,kBACR,OAAO,kBACP,OAAO,kBACP,OAAO,YACb,SAAS,GAAG,EAAE;;;mBA9OrB,MAAM,GAAG,MAAM;sBACZ,MAAM;qBACP,MAAM;yBACF,WAAW;;sCAuRQ,OAAO;mBA1RhC,MAAM,GAAG,MAAM;sBACZ,MAAM;qBACP,MAAM;yBACF,WAAW;;uCAySS,OAAO;;;GAsBzC;AACD,wBAAgB,8BAA8B;;;6BA/NlC,KAAK,QACL,MAAM,QACN,SAAS,WACN,OAAO,GACf,OAAO,CAAC,OAAO,CAAC;;2BAiDA,WAAW;;qBAYa,aAAa;;qBAqBpB,cAAc;;qBASN,mBAAmB;;qBA0BhD,gBAAgB;;;;;;;qBAMK,sBAAsB;;;;sDAMvC,OAAO,mBACP,OAAO,kBACR,OAAO,kBACP,OAAO,kBACP,OAAO,YACb,SAAS,GAAG,EAAE;;;mBA9OrB,MAAM,GAAG,MAAM;sBACZ,MAAM;qBACP,MAAM;yBACF,WAAW;;sCAuRQ,OAAO;mBA1RhC,MAAM,GAAG,MAAM;sBACZ,MAAM;qBACP,MAAM;yBACF,WAAW;;uCAySS,OAAO;;;GA0BzC"}
@@ -0,0 +1,289 @@
1
+ import { types } from "node:util";
2
+ import { OWNER } from "../originalOwner.js";
3
+ import { closed } from "../operations/types.js";
4
+ import { equal } from "../../../renewalAggregate/shared.js";
5
+ import { loadConfigureWriteTransportSource, loadConfigureReplayTransportSource, } from "../operations/sourceOperations.js";
6
+ import { captureConfigureRequest } from "./output.js";
7
+ import { captureConfigureReply, configureDiagnostics } from "./capture.js";
8
+ import { capturePlan, samePlan, ownMethod, need, stop, } from "./request.js";
9
+ function build(load) {
10
+ OWNER.check();
11
+ const raw = load();
12
+ OWNER.check();
13
+ need(!types.isProxy(raw));
14
+ const frame = closed(raw, [
15
+ "owner",
16
+ "operation",
17
+ "request",
18
+ "readPlan",
19
+ "delegate",
20
+ ]);
21
+ need(frame.owner === OWNER);
22
+ const operation = frame.operation, readPlanReference = frame.readPlan, delegate = frame.delegate;
23
+ const request = captureConfigureRequest(frame.request), plan = capturePlan(readPlanReference), method = ownMethod(delegate, "rawRequest"), generation = Object.freeze({});
24
+ let phase = "unused", index = 0, closedOwner = false, checking = false, dispatching = false, postState = "NOT_STARTED";
25
+ let pending = null, readCatch = null, lastRead = null, postAttempt = null;
26
+ const postCatches = new WeakMap(), notStarted = new WeakSet();
27
+ let _quarantine = null;
28
+ function gate() {
29
+ if (closedOwner || checking) {
30
+ closedOwner = true;
31
+ stop();
32
+ }
33
+ checking = true;
34
+ try {
35
+ OWNER.check();
36
+ if (closedOwner)
37
+ stop();
38
+ }
39
+ catch {
40
+ closedOwner = true;
41
+ stop();
42
+ }
43
+ finally {
44
+ checking = false;
45
+ }
46
+ }
47
+ const live = () => {
48
+ try {
49
+ gate();
50
+ return true;
51
+ }
52
+ catch {
53
+ return false;
54
+ }
55
+ };
56
+ const valid = (a) => pending === a && a.generation === generation;
57
+ function start(kind, resource, args) {
58
+ need(pending === null && !dispatching);
59
+ // A synchronous throw or non-Promise result is not an actual asynchronous catch.
60
+ let promise;
61
+ dispatching = true;
62
+ try {
63
+ promise = Reflect.apply(method, delegate, args);
64
+ }
65
+ finally {
66
+ dispatching = false;
67
+ }
68
+ need(types.isPromise(promise));
69
+ const attempt = Object.freeze({
70
+ generation,
71
+ ordinal: index + 1,
72
+ phase: kind,
73
+ resource,
74
+ promise: promise,
75
+ });
76
+ need(attempt.ordinal <= (kind === "read" ? 44 : 45));
77
+ pending = attempt;
78
+ return attempt;
79
+ }
80
+ const readTransport = Object.freeze({
81
+ async rawRequest(verb, path, body, options) {
82
+ need(arguments.length === 4);
83
+ gate();
84
+ need(phase === "reserved" &&
85
+ pending === null &&
86
+ !dispatching &&
87
+ index < plan.length);
88
+ const row = plan[index];
89
+ need(!types.isProxy(options));
90
+ const o = closed(options, ["apiVersion", "maxNetworkRetries"]);
91
+ need(verb === row.method &&
92
+ path === row.path &&
93
+ body === undefined &&
94
+ o.apiVersion === row.options.apiVersion &&
95
+ o.maxNetworkRetries === 0);
96
+ const a = start("read", row.resource, [verb, path, body, row.options]);
97
+ let reply;
98
+ try {
99
+ reply = await a.promise;
100
+ }
101
+ catch (error) {
102
+ phase = "failed";
103
+ lastRead = a;
104
+ if (live() && valid(a))
105
+ readCatch = {
106
+ attempt: a,
107
+ fact: Object.freeze({
108
+ phase: "read",
109
+ resource: a.resource,
110
+ ordinal: a.ordinal,
111
+ diagnostics: configureDiagnostics(error),
112
+ }),
113
+ };
114
+ pending = null;
115
+ return stop();
116
+ }
117
+ gate();
118
+ need(valid(a));
119
+ pending = null;
120
+ index++;
121
+ if (index === plan.length)
122
+ phase = "readclosed";
123
+ return reply;
124
+ },
125
+ });
126
+ const transport = Object.freeze({
127
+ readTransport,
128
+ postDisposition() {
129
+ need(arguments.length === 0);
130
+ return postState;
131
+ },
132
+ async postConfigure() {
133
+ need(arguments.length === 0);
134
+ if (phase !== "readclosed" ||
135
+ pending !== null ||
136
+ postState !== "NOT_STARTED" ||
137
+ !live()) {
138
+ const reply = Object.freeze({ outcome: "not_started" });
139
+ notStarted.add(reply);
140
+ return reply;
141
+ }
142
+ phase = "posting";
143
+ // Mark mutation uncertainty before invoking the actual stock delegate.
144
+ postState = "PENDING";
145
+ let a;
146
+ try {
147
+ a = start("post", "configure", [
148
+ request.method,
149
+ request.path,
150
+ request.payload,
151
+ {
152
+ apiVersion: request.apiVersion,
153
+ idempotencyKey: request.key,
154
+ maxNetworkRetries: 0,
155
+ },
156
+ ]);
157
+ }
158
+ catch {
159
+ phase = "failed";
160
+ return Object.freeze({ outcome: "post_unknown" });
161
+ }
162
+ postAttempt = a;
163
+ let reply;
164
+ try {
165
+ reply = await a.promise;
166
+ }
167
+ catch (error) {
168
+ postState = "REJECTED";
169
+ phase = "failed";
170
+ const record = Object.freeze({ outcome: "provider_rejected" });
171
+ if (live() && valid(a))
172
+ postCatches.set(record, {
173
+ attempt: a,
174
+ fact: Object.freeze({
175
+ phase: "post",
176
+ resource: "configure",
177
+ ordinal: a.ordinal,
178
+ diagnostics: configureDiagnostics(error),
179
+ }),
180
+ });
181
+ pending = null;
182
+ return record;
183
+ }
184
+ if (valid(a) && postAttempt === a)
185
+ _quarantine = { attempt: a, raw: reply };
186
+ postState = "FULFILLED_UNVERIFIED";
187
+ phase = "fulfilled";
188
+ try {
189
+ gate();
190
+ need(valid(a));
191
+ const admitted = captureConfigureReply(reply);
192
+ gate();
193
+ pending = null;
194
+ postState = "FULFILLED_SAFE";
195
+ return Object.freeze({
196
+ outcome: "fulfilled_safe",
197
+ body: admitted.body,
198
+ transport: admitted.transport,
199
+ });
200
+ }
201
+ catch {
202
+ pending = null;
203
+ return Object.freeze({ outcome: "fulfilled_unverified" });
204
+ }
205
+ },
206
+ });
207
+ const capability = Object.freeze({
208
+ assertSourceOperationBinding(actualOperation, originalRequest, actualReadPlan, actualDelegate, originalMethod, expected) {
209
+ need(arguments.length === 6);
210
+ gate();
211
+ if (phase !== "unused" ||
212
+ operation !== actualOperation ||
213
+ actualReadPlan !== readPlanReference ||
214
+ actualDelegate !== delegate ||
215
+ originalMethod !== method) {
216
+ phase = "invalid";
217
+ return false;
218
+ }
219
+ const matches = equal(request, captureConfigureRequest(originalRequest)) &&
220
+ samePlan(plan, capturePlan(actualReadPlan)) &&
221
+ samePlan(plan, expected);
222
+ gate();
223
+ phase = matches ? "bound" : "invalid";
224
+ return matches;
225
+ },
226
+ reserveAcquisition() {
227
+ need(arguments.length === 0);
228
+ gate();
229
+ if (phase !== "bound" || index !== 0 || pending !== null)
230
+ return false;
231
+ phase = "reserved";
232
+ return true;
233
+ },
234
+ consumeReadCatch() {
235
+ need(arguments.length === 0);
236
+ if (!live())
237
+ return null;
238
+ const slot = readCatch;
239
+ if (!slot ||
240
+ slot.attempt !== lastRead ||
241
+ slot.attempt.generation !== generation ||
242
+ pending !== null ||
243
+ phase !== "failed")
244
+ return null;
245
+ readCatch = null;
246
+ return slot.fact;
247
+ },
248
+ consumePostCatch(actualReply) {
249
+ need(arguments.length === 1);
250
+ if (!live())
251
+ return null;
252
+ const slot = actualReply !== null && typeof actualReply === "object"
253
+ ? postCatches.get(actualReply)
254
+ : undefined;
255
+ if (!slot ||
256
+ slot.attempt !== postAttempt ||
257
+ slot.attempt.generation !== generation ||
258
+ pending !== null ||
259
+ postState !== "REJECTED")
260
+ return null;
261
+ postCatches.delete(actualReply);
262
+ return slot.fact;
263
+ },
264
+ consumeNotStarted(actualReply) {
265
+ need(arguments.length === 1);
266
+ if (actualReply === null ||
267
+ typeof actualReply !== "object" ||
268
+ !notStarted.has(actualReply) ||
269
+ postState !== "NOT_STARTED")
270
+ return false;
271
+ notStarted.delete(actualReply);
272
+ return true;
273
+ },
274
+ // No Owner sample/callback/reflection here: final actor gate immediately precedes this.
275
+ discardFulfilledQuarantine() {
276
+ _quarantine = null;
277
+ },
278
+ });
279
+ return Object.freeze({ transport, capability });
280
+ }
281
+ export function createConfigureWriteTransport() {
282
+ need(arguments.length === 0);
283
+ return build(loadConfigureWriteTransportSource);
284
+ }
285
+ export function createConfigureReplayTransport() {
286
+ need(arguments.length === 0);
287
+ return build(loadConfigureReplayTransportSource);
288
+ }
289
+ //# sourceMappingURL=transport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transport.js","sourceRoot":"","sources":["../../../../../../src/client/billing/renewalAttach/internal/configure/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AAC5D,OAAO,EACL,iCAAiC,EACjC,kCAAkC,GACnC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CA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