@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,16 @@
1
+ import type { ObservationReads } from "./types.js";
2
+ export declare function captureOwnedRenewalObservationV2(): Readonly<{
3
+ invoke(): Promise<Readonly<{
4
+ status: "not_dispatched";
5
+ reason: "OWNED_OBSERVATION_SOURCE_UNBOUND";
6
+ operationalAuthority: false;
7
+ }> | {
8
+ status: string;
9
+ observation: import("../../../renewalV2/observation.js").RenewalScheduleMaterialObservationV2;
10
+ reads: ObservationReads;
11
+ observedAt: number;
12
+ retainedConfigureAcknowledgement: string;
13
+ operationalAuthority: boolean;
14
+ } | import("../../../renewalAggregate/shared.js").Failure | undefined>;
15
+ }>;
16
+ //# sourceMappingURL=actor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actor.d.ts","sourceRoot":"","sources":["../../../../../../src/client/billing/renewalAttach/internal/observation/actor.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAOV,gBAAgB,EACjB,MAAM,YAAY,CAAC;AA4DpB,wBAAgB,gCAAgC;;;;;;;;;;;;;GAoY/C"}
@@ -0,0 +1,383 @@
1
+ import { types } from "node:util";
2
+ import { OWNER as ORIGINAL_OWNER } from "../originalOwner.js";
3
+ import { ORIGINAL_ORIGIN_ASSOCIATION, COMPILED_INITIAL_ENTRIES, COMPILED_OBSERVATION_ENTRIES, loadFixedObservationOperation, } from "../operations/sourceOperations.js";
4
+ import { projectRenewalConfigurationV2, constructRenewalScheduleAttachmentReceiptV2, constructRenewalConfigurationReceiptV2, } from "../../../renewalV2/index.js";
5
+ import { inspectRenewalScheduleMaterialV2 } from "../../../renewalV2/observation.js";
6
+ import { captureObservationRecord, verifyObservationRecord } from "./record.js";
7
+ import { captureObservationReply, captureObservationInput, admitObservationOutput, safeReadDiagnostics, } from "./capture.js";
8
+ import { baseReadRows, validateBaseRouting, observationCouponIds, couponReadRow, validateCoupon, } from "./profile.js";
9
+ import { checkOwnerResult } from "./types.js";
10
+ import { admitRetainedConfigureAcknowledgement } from "./configureAcknowledgement.js";
11
+ const stop = () => {
12
+ throw Error("OWNED_OBSERVATION_STOP");
13
+ };
14
+ const need = (value) => {
15
+ if (!value)
16
+ stop();
17
+ };
18
+ function object(value) {
19
+ need(value !== null &&
20
+ typeof value === "object" &&
21
+ !types.isProxy(value) &&
22
+ !Array.isArray(value));
23
+ const proto = Object.getPrototypeOf(value);
24
+ need(proto === Object.prototype || proto === null);
25
+ return value;
26
+ }
27
+ function field(value, key) {
28
+ object(value);
29
+ const d = Object.getOwnPropertyDescriptor(value, key);
30
+ need(d && d.enumerable && "value" in d);
31
+ return d.value;
32
+ }
33
+ function closed(value, required, optional = []) {
34
+ object(value);
35
+ const keys = Reflect.ownKeys(value);
36
+ need(required.every((k) => keys.includes(k)) &&
37
+ keys.every((k) => typeof k === "string" && [...required, ...optional].includes(k)));
38
+ const out = Object.create(null);
39
+ for (const key of keys)
40
+ Object.defineProperty(out, key, {
41
+ value: field(value, key),
42
+ enumerable: true,
43
+ });
44
+ return out;
45
+ }
46
+ function method(value, key) {
47
+ const fn = field(value, key);
48
+ need(typeof fn === "function" && !types.isProxy(fn));
49
+ return fn;
50
+ }
51
+ function providerError(failure) {
52
+ const error = Error("OWNED_OBSERVATION_PROVIDER_REJECTED");
53
+ Object.defineProperty(error, "failure", {
54
+ value: failure,
55
+ enumerable: false,
56
+ writable: false,
57
+ configurable: false,
58
+ });
59
+ return error;
60
+ }
61
+ export function captureOwnedRenewalObservationV2() {
62
+ if (arguments.length !== 0)
63
+ throw Error("OWNED_OBSERVATION_ARITY");
64
+ let used = false;
65
+ return Object.freeze({
66
+ async invoke() {
67
+ if (arguments.length !== 0 || used)
68
+ throw Error("OWNED_OBSERVATION_ONCE");
69
+ used = true;
70
+ if (COMPILED_OBSERVATION_ENTRIES.length === 0) {
71
+ return Object.freeze({
72
+ status: "not_dispatched",
73
+ reason: "OWNED_OBSERVATION_SOURCE_UNBOUND",
74
+ operationalAuthority: false,
75
+ });
76
+ }
77
+ // Fixed Source, never an input parameter or selected caller context.
78
+ const OWNER = ORIGINAL_OWNER, check = method(OWNER, "check");
79
+ function ownerCheck() {
80
+ const sample = Reflect.apply(check, OWNER, []);
81
+ checkOwnerResult(sample);
82
+ return sample;
83
+ }
84
+ async function owned(call) {
85
+ ownerCheck();
86
+ let value;
87
+ try {
88
+ value = await call();
89
+ }
90
+ catch (error) {
91
+ ownerCheck();
92
+ throw error;
93
+ }
94
+ ownerCheck();
95
+ return value;
96
+ }
97
+ ownerCheck();
98
+ let raw;
99
+ try {
100
+ raw = loadFixedObservationOperation();
101
+ }
102
+ catch {
103
+ ownerCheck();
104
+ stop();
105
+ }
106
+ ownerCheck();
107
+ const op = closed(raw, [
108
+ "owner",
109
+ "originAssociation",
110
+ "originalEntry",
111
+ "observationEntry",
112
+ "record",
113
+ "actualAttachAcknowledgement",
114
+ "readTransport",
115
+ ], ["configureAcknowledgement", "configureOperation"]);
116
+ need(op.owner === OWNER && OWNER === ORIGINAL_OWNER);
117
+ need(op.originAssociation === ORIGINAL_ORIGIN_ASSOCIATION);
118
+ object(op.originAssociation);
119
+ need(COMPILED_INITIAL_ENTRIES.includes(op.originalEntry) &&
120
+ COMPILED_OBSERVATION_ENTRIES.includes(op.observationEntry));
121
+ need(field(op.observationEntry, "originalEntry") === op.originalEntry);
122
+ const hasConfigureAcknowledgement = Object.prototype.hasOwnProperty.call(op, "configureAcknowledgement");
123
+ need(hasConfigureAcknowledgement ===
124
+ Object.prototype.hasOwnProperty.call(op, "configureOperation"));
125
+ const coversRetained = method(op.originalEntry, "coversRetained");
126
+ const coversObservation = method(op.observationEntry, "coversObservation");
127
+ closed(op.record, [
128
+ "configuration",
129
+ "request",
130
+ "attachReceipt",
131
+ "originalBundle",
132
+ ]);
133
+ need(field(op.record, "attachReceipt") === op.actualAttachAcknowledgement);
134
+ object(op.actualAttachAcknowledgement);
135
+ const delegate = op.readTransport;
136
+ closed(delegate, ["rawRequest"]);
137
+ const send = method(delegate, "rawRequest");
138
+ const captured = captureObservationRecord(op.record), record = captured.record;
139
+ ownerCheck();
140
+ let phase = "original-C6";
141
+ let invocation = null, generation = null, tokens = null, tokenSlot = null, lastRejected = null;
142
+ let pending = null;
143
+ let ordinal = 0, readerState = "unused", readState = "not_started";
144
+ function consume(token) {
145
+ ownerCheck();
146
+ if (tokens === null || token === null || typeof token !== "object")
147
+ return null;
148
+ const stored = tokens.get(token);
149
+ if (!stored ||
150
+ stored.invocation !== invocation ||
151
+ stored.generation !== generation ||
152
+ stored.attempt !== lastRejected ||
153
+ readState !== "actual_rejected" ||
154
+ pending !== null)
155
+ return null;
156
+ tokens.delete(token);
157
+ return Object.freeze({
158
+ category: "provider_rejected",
159
+ phase: "read",
160
+ resource: stored.attempt.resource,
161
+ ordinal: stored.attempt.ordinal,
162
+ request: stored.attempt.request,
163
+ diagnostics: stored.diagnostics,
164
+ outcome: "unknown",
165
+ operationalAuthority: false,
166
+ });
167
+ }
168
+ function takeReadFailure() {
169
+ ownerCheck();
170
+ const token = tokenSlot;
171
+ if (token === null || tokens === null)
172
+ return null;
173
+ const stored = tokens.get(token);
174
+ if (!stored ||
175
+ stored.invocation !== invocation ||
176
+ stored.generation !== generation ||
177
+ stored.attempt !== lastRejected ||
178
+ readState !== "actual_rejected" ||
179
+ pending !== null)
180
+ return null;
181
+ tokenSlot = null;
182
+ return token;
183
+ }
184
+ async function read(row) {
185
+ ownerCheck();
186
+ need(readerState === "running" &&
187
+ pending === null &&
188
+ readState !== "actual_rejected" &&
189
+ ordinal < 44);
190
+ need(row.ordinal === ordinal + 1 &&
191
+ row.method === "GET" &&
192
+ row.body === undefined &&
193
+ row.options.apiVersion === "2026-09-30.endive" &&
194
+ row.options.maxNetworkRetries === 0);
195
+ const request = Object.freeze({
196
+ method: "GET",
197
+ path: row.path,
198
+ apiVersion: row.options.apiVersion,
199
+ });
200
+ const attempt = {
201
+ invocation,
202
+ generation,
203
+ resource: row.resource,
204
+ ordinal: ++ordinal,
205
+ request,
206
+ promise: null,
207
+ };
208
+ pending = attempt;
209
+ readState = "pending";
210
+ let promise;
211
+ try {
212
+ promise = Reflect.apply(send, delegate, [
213
+ "GET",
214
+ row.path,
215
+ undefined,
216
+ row.options,
217
+ ]);
218
+ }
219
+ catch {
220
+ ownerCheck();
221
+ pending = null;
222
+ readerState = "failed";
223
+ stop();
224
+ }
225
+ attempt.promise = promise;
226
+ Object.freeze(attempt);
227
+ let reply;
228
+ try {
229
+ reply = await promise;
230
+ }
231
+ catch (error) {
232
+ ownerCheck();
233
+ need(pending === attempt &&
234
+ attempt.invocation === invocation &&
235
+ attempt.generation === generation &&
236
+ attempt.promise === promise);
237
+ readState = "actual_rejected";
238
+ readerState = "failed";
239
+ pending = null;
240
+ lastRejected = attempt;
241
+ const diagnostics = safeReadDiagnostics(error), token = Object.freeze(Object.create(null));
242
+ need(tokens !== null);
243
+ tokens.set(token, Object.freeze({ invocation, generation, attempt, diagnostics }));
244
+ tokenSlot = token;
245
+ const forwarded = takeReadFailure();
246
+ need(forwarded === token);
247
+ throw forwarded;
248
+ }
249
+ ownerCheck();
250
+ need(pending === attempt &&
251
+ attempt.invocation === invocation &&
252
+ attempt.generation === generation &&
253
+ attempt.promise === promise);
254
+ pending = null;
255
+ readState = "actual_fulfilled";
256
+ const body = captureObservationReply(reply);
257
+ ownerCheck();
258
+ return body;
259
+ }
260
+ try {
261
+ const desired = await owned(() => projectRenewalConfigurationV2(record.configuration));
262
+ ownerCheck();
263
+ if (desired.status !== "projected_configure_request")
264
+ return desired;
265
+ phase = "proof";
266
+ const receipt = await owned(() => constructRenewalScheduleAttachmentReceiptV2(record.configuration.attachReceipt));
267
+ ownerCheck();
268
+ verifyObservationRecord(captured, desired, receipt);
269
+ ownerCheck();
270
+ const retainedModule = await import("../material/classifiers.js");
271
+ ownerCheck();
272
+ // Fixed internal package code; module exports may be native DATA or SSR accessors.
273
+ const classifyRetained = retainedModule.classifyOwnedRetainedInitialAttachment;
274
+ ownerCheck();
275
+ need(typeof classifyRetained === "function" &&
276
+ !types.isProxy(classifyRetained));
277
+ const retained = await owned(() => Reflect.apply(classifyRetained, retainedModule, [
278
+ {
279
+ attachRequest: record.configuration.attachReceipt.attachRequest,
280
+ originalBundle: record.originalBundle,
281
+ },
282
+ ]));
283
+ ownerCheck();
284
+ need(retained.status === "classified");
285
+ const covered = Reflect.apply(coversRetained, op.originalEntry, [
286
+ retained.material,
287
+ record.originalBundle,
288
+ ]);
289
+ ownerCheck();
290
+ need(covered === true);
291
+ let configureReceipt;
292
+ if (hasConfigureAcknowledgement) {
293
+ const writer = await owned(() => import("../configure/actor.js"));
294
+ ownerCheck();
295
+ const readOwnedConfigureAcknowledgement = writer.readOwnedConfigureAcknowledgement;
296
+ ownerCheck();
297
+ need(typeof readOwnedConfigureAcknowledgement === "function" &&
298
+ !types.isProxy(readOwnedConfigureAcknowledgement));
299
+ const retainedACK = readOwnedConfigureAcknowledgement(op.configureOperation, op.configureAcknowledgement, record, op.actualAttachAcknowledgement, op.originAssociation, op.originalEntry);
300
+ ownerCheck();
301
+ const configured = await owned(() => constructRenewalConfigurationReceiptV2(retainedACK.rawReceipt));
302
+ ownerCheck();
303
+ configureReceipt = admitRetainedConfigureAcknowledgement(record, retainedACK, configured);
304
+ ownerCheck();
305
+ }
306
+ // New child/channel identity is allocated only after all original proof work.
307
+ invocation = Object.freeze({});
308
+ generation = Object.freeze({});
309
+ tokens = new WeakMap();
310
+ need(readerState === "unused" && ordinal === 0 && pending === null);
311
+ readerState = "running";
312
+ const rows = baseReadRows(record), base = [];
313
+ for (const row of rows) {
314
+ const body = await owned(() => read(row));
315
+ ownerCheck();
316
+ base.push(body);
317
+ }
318
+ const reads = {
319
+ schedule: base[0],
320
+ subscription: base[1],
321
+ targetPrice: base[2],
322
+ billingCustomer: base[3],
323
+ coupons: [],
324
+ };
325
+ validateBaseRouting(record, reads);
326
+ const couponIds = observationCouponIds(record, reads.subscription);
327
+ let finalSample = ownerCheck();
328
+ for (const id of couponIds) {
329
+ const body = await owned(() => read(couponReadRow(id, ordinal + 1)));
330
+ ownerCheck();
331
+ validateCoupon(record, id, body);
332
+ finalSample = ownerCheck();
333
+ reads.coupons.push(body);
334
+ }
335
+ need(pending === null && ordinal === 4 + couponIds.length && ordinal <= 44);
336
+ const observedAt = Math.floor(finalSample.wallMs / 1000);
337
+ need(Number.isSafeInteger(observedAt) && observedAt >= 0);
338
+ readerState = "closed";
339
+ readState = "closed";
340
+ const input = captureObservationInput({
341
+ configuration: record.configuration,
342
+ reads,
343
+ ...(configureReceipt === undefined ? {} : { configureReceipt }),
344
+ });
345
+ phase = "observer";
346
+ const observation = await owned(() => inspectRenewalScheduleMaterialV2(input));
347
+ ownerCheck();
348
+ const complete = Reflect.apply(coversObservation, op.observationEntry, [
349
+ record,
350
+ input,
351
+ observation,
352
+ ]);
353
+ ownerCheck();
354
+ need(complete === true);
355
+ const output = admitObservationOutput({
356
+ status: "owned_observation_data",
357
+ observation,
358
+ reads: input.reads,
359
+ observedAt,
360
+ retainedConfigureAcknowledgement: hasConfigureAcknowledgement
361
+ ? "present"
362
+ : "absent",
363
+ operationalAuthority: false,
364
+ });
365
+ ownerCheck();
366
+ return output;
367
+ }
368
+ catch (error) {
369
+ ownerCheck();
370
+ if (phase === "original-C6")
371
+ throw error;
372
+ const failure = consume(error);
373
+ if (failure !== null) {
374
+ const outward = providerError(failure);
375
+ ownerCheck();
376
+ throw outward;
377
+ }
378
+ stop();
379
+ }
380
+ },
381
+ });
382
+ }
383
+ //# sourceMappingURL=actor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actor.js","sourceRoot":"","sources":["../../../../../../src/client/billing/renewalAttach/internal/observation/actor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,KAAK,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACxB,4BAA4B,EAC5B,6BAA6B,GAC9B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,6BAA6B,EAC7B,2CAA2C,EAC3C,sCAAsC,GACvC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,gCAAgC,EAAE,MAAM,mCAAmC,CAAC;AACrF,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,EACb,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CA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0 +1,9 @@
1
+ import type { Diagnostics } from "./types.js";
2
+ export declare function rejectProxyJSON(value: unknown, transportRoot?: boolean): void;
3
+ export declare function captureObservationReply(reply: unknown): {
4
+ [k: string]: unknown;
5
+ };
6
+ export declare function captureObservationInput<T>(value: T): T;
7
+ export declare function admitObservationOutput<T>(value: T): T;
8
+ export declare function safeReadDiagnostics(error: unknown): Diagnostics;
9
+ //# sourceMappingURL=capture.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../../../../../src/client/billing/renewalAttach/internal/observation/capture.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAQ,WAAW,EAAE,MAAM,YAAY,CAAC;AA0CpD,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,aAAa,UAAQ,QAyBpE;AAaD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO;;EA4CrD;AACD,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAWtD;AACD,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CA2ErD;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,CAkC/D"}
@@ -0,0 +1,216 @@
1
+ import { types } from "node:util";
2
+ import { requiredJSONSnapshot } from "../material/requiredJson.js";
3
+ const stop = () => {
4
+ throw Error("OWNED_OBSERVATION_STOP");
5
+ };
6
+ const need = (x) => {
7
+ if (!x)
8
+ stop();
9
+ };
10
+ const nativeResponsePrototype = Response.prototype;
11
+ const nativeStatusGetter = Object.getOwnPropertyDescriptor(nativeResponsePrototype, "status").get;
12
+ const apply = Reflect.apply, isProxy = types.isProxy;
13
+ function closed(value, required, optional = []) {
14
+ need(value !== null &&
15
+ typeof value === "object" &&
16
+ !isProxy(value) &&
17
+ !Array.isArray(value));
18
+ const proto = Object.getPrototypeOf(value);
19
+ need(proto === Object.prototype || proto === null);
20
+ const keys = Reflect.ownKeys(value);
21
+ need(required.every((k) => keys.includes(k)) &&
22
+ keys.every((k) => typeof k === "string" && [...required, ...optional].includes(k)));
23
+ for (const key of keys) {
24
+ const d = Object.getOwnPropertyDescriptor(value, key);
25
+ need(d && d.enumerable && "value" in d);
26
+ }
27
+ return value;
28
+ }
29
+ // Proxy-first complete traversal before ordinary privacy copying. Repeated ordinary
30
+ // references are charged per occurrence; only active-path cycles are rejected.
31
+ export function rejectProxyJSON(value, transportRoot = false) {
32
+ const active = new Set();
33
+ let nodes = 0;
34
+ function walk(x, depth, isRoot) {
35
+ need(++nodes <= 10000 && depth <= 40);
36
+ need(!isProxy(x));
37
+ if (x === null || typeof x !== "object")
38
+ return;
39
+ need(!active.has(x));
40
+ active.add(x);
41
+ const array = Array.isArray(x), keys = Reflect.ownKeys(x);
42
+ need(keys.length <= 10001);
43
+ for (const key of keys) {
44
+ need(typeof key === "string");
45
+ const d = Object.getOwnPropertyDescriptor(x, key);
46
+ need(d && "value" in d);
47
+ if (isRoot && transportRoot && key === "lastResponse" && !d.enumerable)
48
+ continue;
49
+ if (array && key === "length")
50
+ continue;
51
+ need(d.enumerable);
52
+ walk(d.value, depth + 1, false);
53
+ }
54
+ active.delete(x);
55
+ }
56
+ walk(value, 0, true);
57
+ }
58
+ function freeze(value) {
59
+ if (value && typeof value === "object") {
60
+ for (const d of Object.values(Object.getOwnPropertyDescriptors(value)))
61
+ if ("value" in d)
62
+ freeze(d.value);
63
+ Object.freeze(value);
64
+ }
65
+ return value;
66
+ }
67
+ function ordinary(value) {
68
+ rejectProxyJSON(value);
69
+ return freeze(requiredJSONSnapshot(value));
70
+ }
71
+ export function captureObservationReply(reply) {
72
+ rejectProxyJSON(reply, true);
73
+ need(reply !== null && typeof reply === "object" && !Array.isArray(reply));
74
+ const proto = Object.getPrototypeOf(reply);
75
+ need(proto === Object.prototype || proto === null);
76
+ const meta = Object.getOwnPropertyDescriptor(reply, "lastResponse");
77
+ need(meta &&
78
+ !meta.enumerable &&
79
+ "value" in meta &&
80
+ meta.value !== null &&
81
+ typeof meta.value === "object");
82
+ const metadata = meta.value;
83
+ need(!isProxy(metadata));
84
+ const codes = [];
85
+ for (const key of ["status", "statusCode"]) {
86
+ const d = Object.getOwnPropertyDescriptor(metadata, key);
87
+ if (!d)
88
+ continue;
89
+ need("value" in d);
90
+ if (d.value !== undefined)
91
+ codes.push(d.value);
92
+ }
93
+ if (Object.getPrototypeOf(metadata) === nativeResponsePrototype)
94
+ codes.push(apply(nativeStatusGetter, metadata, []));
95
+ need(codes.length > 0 &&
96
+ codes.every((x) => typeof x === "number" &&
97
+ Number.isInteger(x) &&
98
+ x >= 200 &&
99
+ x < 300 &&
100
+ x === codes[0]));
101
+ const entries = [];
102
+ for (const key of Reflect.ownKeys(reply)) {
103
+ need(typeof key === "string");
104
+ if (key === "lastResponse")
105
+ continue;
106
+ const d = Object.getOwnPropertyDescriptor(reply, key);
107
+ need(d && d.enumerable && "value" in d);
108
+ entries.push([key, d.value]);
109
+ }
110
+ return ordinary(Object.fromEntries(entries));
111
+ }
112
+ export function captureObservationInput(value) {
113
+ const root = closed(value, ["configuration", "reads"], ["configureReceipt"]);
114
+ const reads = closed(root.reads, [
115
+ "schedule",
116
+ "subscription",
117
+ "targetPrice",
118
+ "billingCustomer",
119
+ "coupons",
120
+ ]);
121
+ need(Array.isArray(reads.coupons));
122
+ return ordinary(value);
123
+ }
124
+ export function admitObservationOutput(value) {
125
+ const root = closed(value, [
126
+ "status",
127
+ "observation",
128
+ "reads",
129
+ "observedAt",
130
+ "retainedConfigureAcknowledgement",
131
+ "operationalAuthority",
132
+ ]);
133
+ need(root.status === "owned_observation_data" &&
134
+ root.operationalAuthority === false &&
135
+ (root.retainedConfigureAcknowledgement === "absent" ||
136
+ root.retainedConfigureAcknowledgement === "present"));
137
+ need(typeof root.observedAt === "number" &&
138
+ Number.isSafeInteger(root.observedAt) &&
139
+ root.observedAt >= 0);
140
+ const reads = closed(root.reads, [
141
+ "schedule",
142
+ "subscription",
143
+ "targetPrice",
144
+ "billingCustomer",
145
+ "coupons",
146
+ ]);
147
+ need(Array.isArray(reads.coupons));
148
+ const r = closed(root.observation, [
149
+ "acknowledgementEstablished",
150
+ "authenticationEstablished",
151
+ "providerQualificationRequired",
152
+ "predicate",
153
+ ], [
154
+ "reason",
155
+ "observedItemId",
156
+ "nativePeriod",
157
+ "providerStatus",
158
+ "effectiveness",
159
+ ]);
160
+ need(r.acknowledgementEstablished === false &&
161
+ r.authenticationEstablished === false &&
162
+ r.providerQualificationRequired === true);
163
+ need(typeof r.predicate === "string" &&
164
+ [
165
+ "pending_material_match",
166
+ "current_target_material_match",
167
+ "attached_unconfigured_match",
168
+ "terminal_facts_only",
169
+ "unknown",
170
+ "conflict",
171
+ ].includes(r.predicate));
172
+ for (const key of [
173
+ "reason",
174
+ "observedItemId",
175
+ "providerStatus",
176
+ "effectiveness",
177
+ ])
178
+ if (Object.prototype.hasOwnProperty.call(r, key))
179
+ need(typeof r[key] === "string");
180
+ if (Object.prototype.hasOwnProperty.call(r, "nativePeriod")) {
181
+ const period = closed(r.nativePeriod, ["start", "end"]);
182
+ need(Number.isSafeInteger(period.start) && Number.isSafeInteger(period.end));
183
+ }
184
+ return ordinary(value);
185
+ }
186
+ // Only bounded own DATA is admitted. Diagnostics never authorize a failure.
187
+ export function safeReadDiagnostics(error) {
188
+ const out = {};
189
+ if (error === null || typeof error !== "object" || isProxy(error))
190
+ return Object.freeze(out);
191
+ for (const key of ["type", "code", "statusCode", "requestId"]) {
192
+ const d = Object.getOwnPropertyDescriptor(error, key);
193
+ if (!d || !("value" in d))
194
+ continue;
195
+ const value = d.value;
196
+ if (key === "statusCode") {
197
+ if (typeof value === "number" &&
198
+ Number.isInteger(value) &&
199
+ value >= 100 &&
200
+ value <= 599)
201
+ out[key] = value;
202
+ }
203
+ else if (typeof value === "string" &&
204
+ value.length >= 1 &&
205
+ value.length <= 255) {
206
+ try {
207
+ out[key] = requiredJSONSnapshot(value);
208
+ }
209
+ catch {
210
+ /* Unsupported diagnostics are omitted. */
211
+ }
212
+ }
213
+ }
214
+ return Object.freeze(out);
215
+ }
216
+ //# sourceMappingURL=capture.js.map