@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.
- package/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/dist/client/billing/renewalAttach/internal/acquisition/ownedAcquisition.d.ts +41 -0
- package/dist/client/billing/renewalAttach/internal/acquisition/ownedAcquisition.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/acquisition/ownedAcquisition.js +187 -0
- package/dist/client/billing/renewalAttach/internal/acquisition/ownedAcquisition.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/acquisition/rawAcquisition.d.ts +2 -23
- package/dist/client/billing/renewalAttach/internal/acquisition/rawAcquisition.d.ts.map +1 -1
- package/dist/client/billing/renewalAttach/internal/acquisition/rawAcquisition.js +1 -112
- package/dist/client/billing/renewalAttach/internal/acquisition/rawAcquisition.js.map +1 -1
- package/dist/client/billing/renewalAttach/internal/acquisition/rawWireSource.d.ts +8 -3
- package/dist/client/billing/renewalAttach/internal/acquisition/rawWireSource.d.ts.map +1 -1
- package/dist/client/billing/renewalAttach/internal/acquisition/rawWireSource.js +1 -0
- package/dist/client/billing/renewalAttach/internal/acquisition/rawWireSource.js.map +1 -1
- package/dist/client/billing/renewalAttach/internal/acquisition/test-fixtures/sourcePort.d.mts +1 -1
- package/dist/client/billing/renewalAttach/internal/configure/actor.d.ts +14 -0
- package/dist/client/billing/renewalAttach/internal/configure/actor.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/configure/actor.js +444 -0
- package/dist/client/billing/renewalAttach/internal/configure/actor.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/configure/capture.d.ts +12 -0
- package/dist/client/billing/renewalAttach/internal/configure/capture.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/configure/capture.js +99 -0
- package/dist/client/billing/renewalAttach/internal/configure/capture.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/configure/output.d.ts +16 -0
- package/dist/client/billing/renewalAttach/internal/configure/output.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/configure/output.js +274 -0
- package/dist/client/billing/renewalAttach/internal/configure/output.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/configure/ownedContinuation.d.ts +3 -0
- package/dist/client/billing/renewalAttach/internal/configure/ownedContinuation.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/configure/ownedContinuation.js +61 -0
- package/dist/client/billing/renewalAttach/internal/configure/ownedContinuation.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/configure/replay.d.ts +3 -0
- package/dist/client/billing/renewalAttach/internal/configure/replay.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/configure/replay.js +9 -0
- package/dist/client/billing/renewalAttach/internal/configure/replay.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/configure/request.d.ts +39 -0
- package/dist/client/billing/renewalAttach/internal/configure/request.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/configure/request.js +245 -0
- package/dist/client/billing/renewalAttach/internal/configure/request.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/configure/transport.d.ts +88 -0
- package/dist/client/billing/renewalAttach/internal/configure/transport.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/configure/transport.js +289 -0
- package/dist/client/billing/renewalAttach/internal/configure/transport.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/observation/actor.d.ts +16 -0
- package/dist/client/billing/renewalAttach/internal/observation/actor.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/observation/actor.js +383 -0
- package/dist/client/billing/renewalAttach/internal/observation/actor.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/observation/capture.d.ts +9 -0
- package/dist/client/billing/renewalAttach/internal/observation/capture.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/observation/capture.js +216 -0
- package/dist/client/billing/renewalAttach/internal/observation/capture.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/observation/configureAcknowledgement.d.ts +5 -0
- package/dist/client/billing/renewalAttach/internal/observation/configureAcknowledgement.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/observation/configureAcknowledgement.js +11 -0
- package/dist/client/billing/renewalAttach/internal/observation/configureAcknowledgement.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/observation/profile.d.ts +7 -0
- package/dist/client/billing/renewalAttach/internal/observation/profile.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/observation/profile.js +190 -0
- package/dist/client/billing/renewalAttach/internal/observation/profile.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/observation/record.d.ts +5 -0
- package/dist/client/billing/renewalAttach/internal/observation/record.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/observation/record.js +317 -0
- package/dist/client/billing/renewalAttach/internal/observation/record.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/observation/types.d.ts +84 -0
- package/dist/client/billing/renewalAttach/internal/observation/types.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/observation/types.js +27 -0
- package/dist/client/billing/renewalAttach/internal/observation/types.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/operations/configureReadTransport.d.ts +18 -0
- package/dist/client/billing/renewalAttach/internal/operations/configureReadTransport.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/operations/configureReadTransport.js +229 -0
- package/dist/client/billing/renewalAttach/internal/operations/configureReadTransport.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/operations/fixedTransport.d.ts +163 -0
- package/dist/client/billing/renewalAttach/internal/operations/fixedTransport.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/operations/fixedTransport.js +443 -0
- package/dist/client/billing/renewalAttach/internal/operations/fixedTransport.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/operations/initialAttach.d.ts +8 -0
- package/dist/client/billing/renewalAttach/internal/operations/initialAttach.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/operations/initialAttach.js +467 -0
- package/dist/client/billing/renewalAttach/internal/operations/initialAttach.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/operations/ownedAwait.d.ts +6 -0
- package/dist/client/billing/renewalAttach/internal/operations/ownedAwait.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/operations/ownedAwait.js +59 -0
- package/dist/client/billing/renewalAttach/internal/operations/ownedAwait.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/operations/providerFailure.d.ts +10 -0
- package/dist/client/billing/renewalAttach/internal/operations/providerFailure.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/operations/providerFailure.js +48 -0
- package/dist/client/billing/renewalAttach/internal/operations/providerFailure.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/operations/sourceOperations.d.ts +20 -0
- package/dist/client/billing/renewalAttach/internal/operations/sourceOperations.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/operations/sourceOperations.js +44 -0
- package/dist/client/billing/renewalAttach/internal/operations/sourceOperations.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/operations/types.d.ts +42 -0
- package/dist/client/billing/renewalAttach/internal/operations/types.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/operations/types.js +158 -0
- package/dist/client/billing/renewalAttach/internal/operations/types.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/preflight/configurePreflight.d.ts +5 -0
- package/dist/client/billing/renewalAttach/internal/preflight/configurePreflight.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/preflight/configurePreflight.js +214 -0
- package/dist/client/billing/renewalAttach/internal/preflight/configurePreflight.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/preflight/grammar.d.ts +33 -0
- package/dist/client/billing/renewalAttach/internal/preflight/grammar.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/preflight/grammar.js +208 -0
- package/dist/client/billing/renewalAttach/internal/preflight/grammar.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/preflight/output.d.ts +4 -0
- package/dist/client/billing/renewalAttach/internal/preflight/output.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/preflight/output.js +25 -0
- package/dist/client/billing/renewalAttach/internal/preflight/output.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/preflight/record.d.ts +16 -0
- package/dist/client/billing/renewalAttach/internal/preflight/record.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/preflight/record.js +93 -0
- package/dist/client/billing/renewalAttach/internal/preflight/record.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/preflight/relations.d.ts +7 -0
- package/dist/client/billing/renewalAttach/internal/preflight/relations.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/preflight/relations.js +153 -0
- package/dist/client/billing/renewalAttach/internal/preflight/relations.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/recovery/material.d.ts +22 -0
- package/dist/client/billing/renewalAttach/internal/recovery/material.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/recovery/material.js +221 -0
- package/dist/client/billing/renewalAttach/internal/recovery/material.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/recovery/output.d.ts +8 -0
- package/dist/client/billing/renewalAttach/internal/recovery/output.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/recovery/output.js +101 -0
- package/dist/client/billing/renewalAttach/internal/recovery/output.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/recovery/record.d.ts +12 -0
- package/dist/client/billing/renewalAttach/internal/recovery/record.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/recovery/record.js +186 -0
- package/dist/client/billing/renewalAttach/internal/recovery/record.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/recovery/recoveryActor.d.ts +5 -0
- package/dist/client/billing/renewalAttach/internal/recovery/recoveryActor.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/recovery/recoveryActor.js +498 -0
- package/dist/client/billing/renewalAttach/internal/recovery/recoveryActor.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/recovery/relation.d.ts +21 -0
- package/dist/client/billing/renewalAttach/internal/recovery/relation.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/recovery/relation.js +119 -0
- package/dist/client/billing/renewalAttach/internal/recovery/relation.js.map +1 -0
- package/dist/client/connect/payoutExecutionTestHelpers.d.ts +16 -16
- package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts +32 -32
- package/dist/component/balanceFunding/internal/actions.d.ts +11 -11
- package/dist/component/financialObservations/settlementHelpers.d.ts +3 -3
- package/dist/component/usage/allowance.fixtures.d.ts +16 -16
- package/dist/component/usageCredits/accounting.fixtures.d.ts +16 -16
- package/docs/renewal-context-reads.md +26 -8
- package/docs/renewal-material-observation.md +58 -0
- package/docs/renewal-phase-assembly.md +68 -0
- package/docs/renewal-raw-acquisition.md +19 -5
- package/package.json +1 -1
- package/src/client/billing/renewalAttach/internal/acquisition/ownedAcquisition.ts +304 -0
- package/src/client/billing/renewalAttach/internal/acquisition/rawAcquisition.ts +2 -160
- package/src/client/billing/renewalAttach/internal/acquisition/rawWireSource.ts +15 -3
- package/src/client/billing/renewalAttach/internal/configure/actor.ts +586 -0
- package/src/client/billing/renewalAttach/internal/configure/capture.ts +117 -0
- package/src/client/billing/renewalAttach/internal/configure/dispatch.integration.test.ts +32 -0
- package/src/client/billing/renewalAttach/internal/configure/limits.test.ts +510 -0
- package/src/client/billing/renewalAttach/internal/configure/order.integration.test.ts +207 -0
- package/src/client/billing/renewalAttach/internal/configure/output.ts +372 -0
- package/src/client/billing/renewalAttach/internal/configure/ownedContinuation.ts +56 -0
- package/src/client/billing/renewalAttach/internal/configure/ownership.integration.test.ts +148 -0
- package/src/client/billing/renewalAttach/internal/configure/replay.integration.test.ts +173 -0
- package/src/client/billing/renewalAttach/internal/configure/replay.ts +13 -0
- package/src/client/billing/renewalAttach/internal/configure/request.ts +312 -0
- package/src/client/billing/renewalAttach/internal/configure/transport.integration.test.ts +507 -0
- package/src/client/billing/renewalAttach/internal/configure/transport.ts +348 -0
- package/src/client/billing/renewalAttach/internal/observation/actor.ts +487 -0
- package/src/client/billing/renewalAttach/internal/observation/capture.ts +251 -0
- package/src/client/billing/renewalAttach/internal/observation/configureAcknowledgement.ts +20 -0
- package/src/client/billing/renewalAttach/internal/observation/observation.integration.test.ts +220 -0
- package/src/client/billing/renewalAttach/internal/observation/observationConfigureACK.integration.test.ts +36 -0
- package/src/client/billing/renewalAttach/internal/observation/observationConfigureACKControls.integration.test.ts +48 -0
- package/src/client/billing/renewalAttach/internal/observation/observationConfigureACKLifecycle.integration.test.ts +44 -0
- package/src/client/billing/renewalAttach/internal/observation/observationConfiguredHistory.integration.test.ts +34 -0
- package/src/client/billing/renewalAttach/internal/observation/observationRetirement.integration.test.ts +60 -0
- package/src/client/billing/renewalAttach/internal/observation/profile.ts +264 -0
- package/src/client/billing/renewalAttach/internal/observation/record.ts +408 -0
- package/src/client/billing/renewalAttach/internal/observation/types.ts +107 -0
- package/src/client/billing/renewalAttach/internal/operations/configureReadTransport.ts +285 -0
- package/src/client/billing/renewalAttach/internal/operations/defaultBindings.test.ts +69 -0
- package/src/client/billing/renewalAttach/internal/operations/fixedTransport.ts +574 -0
- package/src/client/billing/renewalAttach/internal/operations/initialAttach.integration.test.ts +34 -0
- package/src/client/billing/renewalAttach/internal/operations/initialAttach.ts +535 -0
- package/src/client/billing/renewalAttach/internal/operations/ownedAwait.ts +63 -0
- package/src/client/billing/renewalAttach/internal/operations/providerFailure.integration.test.ts +61 -0
- package/src/client/billing/renewalAttach/internal/operations/providerFailure.ts +66 -0
- package/src/client/billing/renewalAttach/internal/operations/sourceOperations.ts +50 -0
- package/src/client/billing/renewalAttach/internal/operations/transport.integration.test.ts +116 -0
- package/src/client/billing/renewalAttach/internal/operations/types.ts +223 -0
- package/src/client/billing/renewalAttach/internal/preflight/configurePreflight.integration.test.ts +285 -0
- package/src/client/billing/renewalAttach/internal/preflight/configurePreflight.ts +258 -0
- package/src/client/billing/renewalAttach/internal/preflight/configureReads.integration.test.ts +139 -0
- package/src/client/billing/renewalAttach/internal/preflight/grammar.ts +257 -0
- package/src/client/billing/renewalAttach/internal/preflight/output.ts +42 -0
- package/src/client/billing/renewalAttach/internal/preflight/owner.integration.test.ts +82 -0
- package/src/client/billing/renewalAttach/internal/preflight/preflight.integration.test.ts +354 -0
- package/src/client/billing/renewalAttach/internal/preflight/record.ts +127 -0
- package/src/client/billing/renewalAttach/internal/preflight/relations.ts +209 -0
- package/src/client/billing/renewalAttach/internal/recovery/material.ts +311 -0
- package/src/client/billing/renewalAttach/internal/recovery/output.ts +136 -0
- package/src/client/billing/renewalAttach/internal/recovery/record.ts +230 -0
- package/src/client/billing/renewalAttach/internal/recovery/recovery.integration.test.ts +463 -0
- package/src/client/billing/renewalAttach/internal/recovery/recoveryActor.ts +599 -0
- package/src/client/billing/renewalAttach/internal/recovery/relation.ts +175 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/attachEntries.ts +217 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/attachObservations.ts +226 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/attachScenario.ts +556 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/attachScenarioAssertions.ts +180 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/attachScenarioBarriers.ts +144 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/configurePreflightAssertions.ts +122 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/configurePreflightBarriers.ts +330 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/configurePreflightControls.ts +139 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/configurePreflightOperation.ts +513 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/configureReadNativeBaseline.ts +344 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/configureReadOperation.ts +278 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/configureReadPort.ts +17 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/configureWriteAssertions.ts +537 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/configureWriteBarriers.ts +125 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/configureWriteDeclarations.ts +325 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/configureWriteDelegate.ts +38 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/configureWriteHistory.ts +471 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/configureWriteObservations.ts +515 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/configureWriteOperation.ts +587 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/observationAssertions.ts +211 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfigureACKAssertions.ts +115 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfigureACKDeclarations.ts +141 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfigureACKLifecycleAssertions.ts +74 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfigureACKLifecycleDeclarations.ts +79 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfigureACKLifecycleInstrumentation.ts +207 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfigureACKLifecycleOperation.ts +494 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfigureACKOperation.ts +452 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfiguredHistoryAssertions.ts +88 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfiguredHistoryDeclarations.ts +170 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfiguredHistoryNative.ts +99 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/observationConfiguredHistoryOperation.ts +411 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/observationDeclarations.ts +192 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/observationHTTP.ts +197 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/observationObservations.ts +269 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/observationOperation.ts +262 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/observationProbe.ts +319 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/ownedOperations.ts +94 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/sourceOperationPort.ts +16 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/stockHttp.ts +21 -0
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
import { configuredHistoryResponse } from "./observationConfiguredHistoryNative.js";
|
|
2
|
+
import {
|
|
3
|
+
declarePreflightCase,
|
|
4
|
+
deepFreeze,
|
|
5
|
+
} from "./configurePreflightControls.js";
|
|
6
|
+
|
|
7
|
+
/** Every counterexample exists before any actual public constructor is called. */
|
|
8
|
+
export const writeCases = {
|
|
9
|
+
dispatch: [
|
|
10
|
+
"ack",
|
|
11
|
+
"defaults-null",
|
|
12
|
+
"defaults-object",
|
|
13
|
+
"request-id-absent",
|
|
14
|
+
"identity-only-ack",
|
|
15
|
+
],
|
|
16
|
+
ownership: [
|
|
17
|
+
"empty",
|
|
18
|
+
"capture-arity",
|
|
19
|
+
"invoke-arity",
|
|
20
|
+
"consumed",
|
|
21
|
+
"foreign-owner",
|
|
22
|
+
"foreign-origin",
|
|
23
|
+
"foreign-entry",
|
|
24
|
+
"foreign-class",
|
|
25
|
+
"foreign-operation",
|
|
26
|
+
"foreign-plan",
|
|
27
|
+
"foreign-delegate",
|
|
28
|
+
"cloned-ack",
|
|
29
|
+
"forged-preflight",
|
|
30
|
+
"original-failure",
|
|
31
|
+
"structural-failure",
|
|
32
|
+
],
|
|
33
|
+
order: [
|
|
34
|
+
"dispatch-send",
|
|
35
|
+
"dispatch-ack",
|
|
36
|
+
"wrong-ack",
|
|
37
|
+
"duplicate-ack",
|
|
38
|
+
"response-send",
|
|
39
|
+
"response-ack",
|
|
40
|
+
"wrong-c9",
|
|
41
|
+
"receipt-send",
|
|
42
|
+
"receipt-ack",
|
|
43
|
+
],
|
|
44
|
+
transport: [
|
|
45
|
+
"source-post-sync-throw",
|
|
46
|
+
"source-post-nonpromise",
|
|
47
|
+
"source-post-hostile-late-reject",
|
|
48
|
+
"get-reject",
|
|
49
|
+
"post-reject",
|
|
50
|
+
"conflict",
|
|
51
|
+
"diagnostics-empty",
|
|
52
|
+
"error-envelope-missing-optionals",
|
|
53
|
+
"diagnostics-unsafe",
|
|
54
|
+
"redirect307",
|
|
55
|
+
"redirect308",
|
|
56
|
+
"unsafe-body",
|
|
57
|
+
"unsafe-metadata",
|
|
58
|
+
"retire-get",
|
|
59
|
+
"retire-post",
|
|
60
|
+
"retire-response",
|
|
61
|
+
"retire-c9",
|
|
62
|
+
"retire-receipt",
|
|
63
|
+
"retire-final",
|
|
64
|
+
"foreign-catch",
|
|
65
|
+
"catch-once",
|
|
66
|
+
],
|
|
67
|
+
replay: [
|
|
68
|
+
"unknown-replay",
|
|
69
|
+
"unknown-replay-repeat",
|
|
70
|
+
"ack-closes-ancestor",
|
|
71
|
+
"acknowledged-prior",
|
|
72
|
+
"pending-prior",
|
|
73
|
+
"not-posted-prior",
|
|
74
|
+
"foreign-prior",
|
|
75
|
+
"cloned-prior",
|
|
76
|
+
"already-applied",
|
|
77
|
+
"baseline-drift",
|
|
78
|
+
"expired-owner",
|
|
79
|
+
],
|
|
80
|
+
limits: [
|
|
81
|
+
"whole-ack",
|
|
82
|
+
"whole-failure",
|
|
83
|
+
"token-forged",
|
|
84
|
+
"escaped-token",
|
|
85
|
+
"raw-digest",
|
|
86
|
+
"special-keys",
|
|
87
|
+
"repeated-reference",
|
|
88
|
+
"numeric-array",
|
|
89
|
+
"proxy",
|
|
90
|
+
"accessor",
|
|
91
|
+
"symbol",
|
|
92
|
+
"nonenumerable",
|
|
93
|
+
"cycle",
|
|
94
|
+
"pan",
|
|
95
|
+
"credential",
|
|
96
|
+
"utf8",
|
|
97
|
+
"nodes",
|
|
98
|
+
"depth",
|
|
99
|
+
"retention86399",
|
|
100
|
+
"retention86400",
|
|
101
|
+
"retention-negative",
|
|
102
|
+
"retention-unsafe",
|
|
103
|
+
],
|
|
104
|
+
} as const;
|
|
105
|
+
export type WriteCase =
|
|
106
|
+
| (typeof writeCases)[keyof typeof writeCases][number]
|
|
107
|
+
| "configured-history"
|
|
108
|
+
| "configured-history-onephase"
|
|
109
|
+
| "configured-history-drift";
|
|
110
|
+
|
|
111
|
+
export function declareConfigureWriteCase(name: WriteCase) {
|
|
112
|
+
const baseline = declarePreflightCase("positive");
|
|
113
|
+
const replay = {
|
|
114
|
+
initialMode:
|
|
115
|
+
name === "acknowledged-prior"
|
|
116
|
+
? "ack"
|
|
117
|
+
: name === "pending-prior"
|
|
118
|
+
? "pending-prior"
|
|
119
|
+
: "post-reject",
|
|
120
|
+
BMode:
|
|
121
|
+
name === "unknown-replay-repeat"
|
|
122
|
+
? "post-reject"
|
|
123
|
+
: name === "already-applied"
|
|
124
|
+
? "already-applied"
|
|
125
|
+
: name === "baseline-drift"
|
|
126
|
+
? "baseline-drift"
|
|
127
|
+
: "ack",
|
|
128
|
+
CMode: "ack",
|
|
129
|
+
previousC: name === "ack-closes-ancestor" ? "A" : "B",
|
|
130
|
+
BAt: baseline.laterAt,
|
|
131
|
+
CAt: baseline.laterAt + 1000,
|
|
132
|
+
} as const;
|
|
133
|
+
const response: Record<string, unknown> = structuredClone(baseline.schedule);
|
|
134
|
+
// C9 is operation acknowledgement. This raw reply deliberately retains its one phase.
|
|
135
|
+
delete response.default_settings;
|
|
136
|
+
if (name === "defaults-null") response.default_settings = null;
|
|
137
|
+
if (name === "defaults-object")
|
|
138
|
+
response.default_settings = structuredClone(
|
|
139
|
+
baseline.schedule.default_settings,
|
|
140
|
+
);
|
|
141
|
+
if (
|
|
142
|
+
name === "configured-history" ||
|
|
143
|
+
name === "configured-history-onephase" ||
|
|
144
|
+
name === "configured-history-drift"
|
|
145
|
+
)
|
|
146
|
+
Object.assign(response, configuredHistoryResponse(baseline, name));
|
|
147
|
+
const oracleResponse = structuredClone(response);
|
|
148
|
+
if (name === "wrong-c9") response.id = "sub_sched_foreign";
|
|
149
|
+
if (name === "unsafe-body") response.opaque = "sk_live_SYNTHETIC_UNSAFE";
|
|
150
|
+
const currentBundle = structuredClone(baseline.baselineBundle);
|
|
151
|
+
const currentSchedule = structuredClone(baseline.schedule);
|
|
152
|
+
if (name === "baseline-drift")
|
|
153
|
+
currentBundle.wireSubscription.metadata.keep = "drift";
|
|
154
|
+
if (name === "already-applied")
|
|
155
|
+
currentSchedule.phases.push(structuredClone(currentSchedule.phases[0]!));
|
|
156
|
+
const status =
|
|
157
|
+
name === "diagnostics-empty" ||
|
|
158
|
+
name === "error-envelope-missing-optionals" ||
|
|
159
|
+
name === "diagnostics-unsafe" ||
|
|
160
|
+
name === "conflict"
|
|
161
|
+
? 409
|
|
162
|
+
: name === "redirect307"
|
|
163
|
+
? 307
|
|
164
|
+
: name === "redirect308"
|
|
165
|
+
? 308
|
|
166
|
+
: 200;
|
|
167
|
+
const errorBody =
|
|
168
|
+
name === "diagnostics-empty"
|
|
169
|
+
? {}
|
|
170
|
+
: name === "error-envelope-missing-optionals"
|
|
171
|
+
? { error: {} }
|
|
172
|
+
: {
|
|
173
|
+
error: {
|
|
174
|
+
type: "idempotency_error",
|
|
175
|
+
code: "idempotency_key_in_use",
|
|
176
|
+
message: "Synthetic controlled conflict",
|
|
177
|
+
},
|
|
178
|
+
};
|
|
179
|
+
const expected = baseline.original.attachRequest.preparation.expected;
|
|
180
|
+
const currentItem = {
|
|
181
|
+
tax_rates: "",
|
|
182
|
+
price: expected.currentPriceId,
|
|
183
|
+
quantity: 3,
|
|
184
|
+
discounts: [{ discount: "di_item" }],
|
|
185
|
+
};
|
|
186
|
+
const targetItem = { ...currentItem, price: expected.targetPriceId };
|
|
187
|
+
const expectedPayload = {
|
|
188
|
+
end_behavior: "release",
|
|
189
|
+
proration_behavior: "none",
|
|
190
|
+
phases: [
|
|
191
|
+
{
|
|
192
|
+
default_tax_rates: "",
|
|
193
|
+
start_date: expected.periodStart,
|
|
194
|
+
end_date: expected.periodEnd,
|
|
195
|
+
currency: "usd",
|
|
196
|
+
proration_behavior: "create_prorations",
|
|
197
|
+
items: [currentItem],
|
|
198
|
+
discounts: [{ discount: "di_subscription" }],
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
default_tax_rates: "",
|
|
202
|
+
start_date: expected.periodEnd,
|
|
203
|
+
currency: "usd",
|
|
204
|
+
proration_behavior: "none",
|
|
205
|
+
billing_cycle_anchor: "automatic",
|
|
206
|
+
duration: { interval: "month", interval_count: 1 },
|
|
207
|
+
items: [targetItem],
|
|
208
|
+
discounts: [{ discount: "di_subscription" }],
|
|
209
|
+
},
|
|
210
|
+
],
|
|
211
|
+
};
|
|
212
|
+
return deepFreeze({
|
|
213
|
+
name,
|
|
214
|
+
expectedPayload,
|
|
215
|
+
replay,
|
|
216
|
+
baseline,
|
|
217
|
+
response,
|
|
218
|
+
oracleResponse,
|
|
219
|
+
currentBundle,
|
|
220
|
+
currentSchedule,
|
|
221
|
+
status,
|
|
222
|
+
errorBody,
|
|
223
|
+
requestId:
|
|
224
|
+
name === "request-id-absent"
|
|
225
|
+
? null
|
|
226
|
+
: name === "unsafe-metadata"
|
|
227
|
+
? "sk_live_SYNTHETIC_UNSAFE"
|
|
228
|
+
: "req_SYNTHETIC_CONFIGURE_WRITE",
|
|
229
|
+
oracleRequestId:
|
|
230
|
+
name === "request-id-absent" ? null : "req_SYNTHETIC_CONFIGURE_WRITE",
|
|
231
|
+
writeAt: baseline.scheduleAt,
|
|
232
|
+
replayAt: baseline.laterAt,
|
|
233
|
+
providerRejection: Object.freeze({
|
|
234
|
+
type: "StripeConnectionError",
|
|
235
|
+
code: "ECONNRESET",
|
|
236
|
+
}),
|
|
237
|
+
caps: { chars: 500000, bytes: 500000, nodes: 10000, depth: 40 },
|
|
238
|
+
retention: {
|
|
239
|
+
first: 100000,
|
|
240
|
+
before: 186399,
|
|
241
|
+
at: 186400,
|
|
242
|
+
negative: 99999,
|
|
243
|
+
unsafe: Number.MAX_SAFE_INTEGER + 1,
|
|
244
|
+
},
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/** All mutations are finite TEST recipes; applying them never changes the retained oracle. */
|
|
249
|
+
export function limitCounterexample(ack: unknown, name: WriteCase) {
|
|
250
|
+
const copy = structuredClone(ack) as Record<string, unknown>;
|
|
251
|
+
const raw = copy.rawReceipt as Record<string, unknown>;
|
|
252
|
+
const body = raw.providerSnapshot as Record<string, unknown>;
|
|
253
|
+
if (name === "whole-ack") body.opaque = "x".repeat(500000);
|
|
254
|
+
if (name === "utf8") body.opaque = "界".repeat(170000);
|
|
255
|
+
if (name === "nodes") body.opaque = Array(10001).fill(null);
|
|
256
|
+
if (name === "depth") {
|
|
257
|
+
let node: Record<string, unknown> = {};
|
|
258
|
+
body.opaque = node;
|
|
259
|
+
for (let i = 0; i < 41; i++) {
|
|
260
|
+
const next = {};
|
|
261
|
+
node.next = next;
|
|
262
|
+
node = next;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
if (name === "raw-digest" || name === "escaped-token")
|
|
266
|
+
body[name === "escaped-token" ? "request/logicalBinding" : "opaque"] =
|
|
267
|
+
"renewal:v2:sha256:" + "a".repeat(64);
|
|
268
|
+
if (name === "token-forged")
|
|
269
|
+
(copy.receipt as Record<string, unknown>).binding =
|
|
270
|
+
"renewal-configure-receipt:v2:sha256:" + "b".repeat(64);
|
|
271
|
+
if (name === "special-keys")
|
|
272
|
+
Object.defineProperty(body, "__proto__", {
|
|
273
|
+
value: { constructor: "retained", prototype: "retained" },
|
|
274
|
+
enumerable: true,
|
|
275
|
+
});
|
|
276
|
+
if (name === "repeated-reference") {
|
|
277
|
+
const shared = { retained: "twice" };
|
|
278
|
+
body.left = shared;
|
|
279
|
+
body.right = shared;
|
|
280
|
+
}
|
|
281
|
+
if (name === "numeric-array") body.opaque = ["zero", "one", "two"];
|
|
282
|
+
if (name === "proxy")
|
|
283
|
+
raw.providerSnapshot = new Proxy(body, {
|
|
284
|
+
ownKeys() {
|
|
285
|
+
throw Error("TEST_PROXY_REFLECTION");
|
|
286
|
+
},
|
|
287
|
+
});
|
|
288
|
+
if (name === "accessor")
|
|
289
|
+
Object.defineProperty(body, "opaque", {
|
|
290
|
+
get() {
|
|
291
|
+
throw Error("TEST_ACCESSOR_REFLECTION");
|
|
292
|
+
},
|
|
293
|
+
enumerable: true,
|
|
294
|
+
});
|
|
295
|
+
if (name === "symbol")
|
|
296
|
+
Object.defineProperty(body, Symbol("opaque"), {
|
|
297
|
+
value: "hidden",
|
|
298
|
+
enumerable: true,
|
|
299
|
+
});
|
|
300
|
+
if (name === "nonenumerable")
|
|
301
|
+
Object.defineProperty(body, "opaque", {
|
|
302
|
+
value: "hidden",
|
|
303
|
+
enumerable: false,
|
|
304
|
+
});
|
|
305
|
+
if (name === "cycle") body.opaque = body;
|
|
306
|
+
if (name === "pan") body.opaque = "4242424242424242";
|
|
307
|
+
if (name === "credential") body.opaque = "sk_live_SYNTHETIC_UNSAFE";
|
|
308
|
+
return copy;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/** The entire finite Source family's raw scenarios exist before any constructor. */
|
|
312
|
+
export function declareConfigureWriteFamily(name: WriteCase) {
|
|
313
|
+
const control = declareConfigureWriteCase(name);
|
|
314
|
+
const replay = (writeCases.replay as readonly string[]).includes(name);
|
|
315
|
+
return deepFreeze({
|
|
316
|
+
control,
|
|
317
|
+
stages: {
|
|
318
|
+
A: replay
|
|
319
|
+
? declareConfigureWriteCase(control.replay.initialMode)
|
|
320
|
+
: control,
|
|
321
|
+
B: declareConfigureWriteCase(control.replay.BMode),
|
|
322
|
+
C: declareConfigureWriteCase(control.replay.CMode),
|
|
323
|
+
},
|
|
324
|
+
});
|
|
325
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import type Stripe from "stripe";
|
|
3
|
+
import { data } from "./configurePreflightControls.js";
|
|
4
|
+
import type { WriteObservations } from "./configureWriteObservations.js";
|
|
5
|
+
import type { configureWriteBarriers } from "./configureWriteBarriers.js";
|
|
6
|
+
|
|
7
|
+
/** TEST-only extraction: original client/method/receiver/args/Promise remain unchanged. */
|
|
8
|
+
export function captureWriteTestDelegate(
|
|
9
|
+
client: Stripe,
|
|
10
|
+
method: Stripe["rawRequest"],
|
|
11
|
+
current: () => WriteObservations,
|
|
12
|
+
writeGates: ReturnType<typeof configureWriteBarriers>,
|
|
13
|
+
apiVersion: string,
|
|
14
|
+
) {
|
|
15
|
+
return Object.freeze({
|
|
16
|
+
rawRequest(...args: unknown[]) {
|
|
17
|
+
const state = current();
|
|
18
|
+
state.trace.push("delegate:" + String(args[0]));
|
|
19
|
+
state.delegateArgs.push(args);
|
|
20
|
+
const options = data(args[3]);
|
|
21
|
+
assert.equal(options.apiVersion, apiVersion);
|
|
22
|
+
assert.equal(options.maxNetworkRetries, 0);
|
|
23
|
+
assert.equal(
|
|
24
|
+
Object.prototype.hasOwnProperty.call(options, "stripeAccount"),
|
|
25
|
+
false,
|
|
26
|
+
);
|
|
27
|
+
const promise = Reflect.apply(method, client, args) as Promise<unknown>;
|
|
28
|
+
state.originalPromises.push(promise);
|
|
29
|
+
writeGates.pending.push(
|
|
30
|
+
promise.then(
|
|
31
|
+
() => {},
|
|
32
|
+
() => {},
|
|
33
|
+
),
|
|
34
|
+
);
|
|
35
|
+
return promise;
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
}
|