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