@fantastic.dev/better-stripe 0.89.0 → 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 +6 -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/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 +28 -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
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import { afterEach, expect, it, vi } from "vitest";
|
|
2
|
+
import type { EventRecord } from "./ownData.js";
|
|
3
|
+
|
|
4
|
+
function deferred<T>() {
|
|
5
|
+
let resolve!: (value: T) => void;
|
|
6
|
+
const promise = new Promise<T>((r) => {
|
|
7
|
+
resolve = r;
|
|
8
|
+
});
|
|
9
|
+
return { promise, resolve };
|
|
10
|
+
}
|
|
11
|
+
afterEach(() => {
|
|
12
|
+
vi.doUnmock("../sourceBindings.js");
|
|
13
|
+
vi.doUnmock("./publicApi.js");
|
|
14
|
+
vi.resetModules();
|
|
15
|
+
vi.useRealTimers();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
async function rig() {
|
|
19
|
+
vi.resetModules();
|
|
20
|
+
const { fixture } = await import("./test-fixtures/fixture.mjs");
|
|
21
|
+
const f = await fixture();
|
|
22
|
+
const start = f.sourceAttach.firstDispatchedAt * 1000;
|
|
23
|
+
const time = { wallMs: start, ns: BigInt(start) * 1_000_000n };
|
|
24
|
+
const basis = {
|
|
25
|
+
startWallMs: start,
|
|
26
|
+
startNs: time.ns,
|
|
27
|
+
workEndWallMs: start + 180_000,
|
|
28
|
+
workEndNs: time.ns + 180_000_000_000n,
|
|
29
|
+
endWallMs: start + 210_000,
|
|
30
|
+
endNs: time.ns + 210_000_000_000n,
|
|
31
|
+
};
|
|
32
|
+
const source = {
|
|
33
|
+
clock: {
|
|
34
|
+
basis,
|
|
35
|
+
sample: () => ({ ...time }),
|
|
36
|
+
subscribeRetirement: () => () => {},
|
|
37
|
+
},
|
|
38
|
+
originalPolicy: {
|
|
39
|
+
firstDispatchedAt: f.sourceAttach.firstDispatchedAt,
|
|
40
|
+
periodStart: f.sourceAttach.firstDispatchedAt - 1,
|
|
41
|
+
periodEnd: f.sourceAttach.firstDispatchedAt + 1000,
|
|
42
|
+
},
|
|
43
|
+
originAssociation: Object.freeze({}),
|
|
44
|
+
};
|
|
45
|
+
vi.doMock("../sourceBindings.js", () => ({
|
|
46
|
+
loadOwnedOriginalSource: () => source,
|
|
47
|
+
}));
|
|
48
|
+
const { OWNER } = await import("../originalOwner.js");
|
|
49
|
+
return { f, time, basis, OWNER };
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const boundaries = [
|
|
53
|
+
["C1", "prepareRenewalPriceReplacementV2", "attach", "dispatch"],
|
|
54
|
+
["C2", "prepareRenewalScheduleAttachmentV2", "attach", "dispatch"],
|
|
55
|
+
["C3", "constructRenewalScheduleAttachmentReceiptV2", "attach", "receipt"],
|
|
56
|
+
["C6", "projectRenewalConfigurationV2", "configure", "dispatch"],
|
|
57
|
+
["C9", "constructRenewalConfigurationReceiptV2", "configure", "receipt"],
|
|
58
|
+
] as const;
|
|
59
|
+
|
|
60
|
+
for (const [family, method, stage, branch] of boundaries) {
|
|
61
|
+
it(`actual original owner retirement rejects held real ${family} before the next continuation`, async () => {
|
|
62
|
+
const { f, OWNER } = await rig();
|
|
63
|
+
const api = await import("./publicApi.js");
|
|
64
|
+
const entered = deferred<void>(),
|
|
65
|
+
release = deferred<void>();
|
|
66
|
+
const calls: string[] = [];
|
|
67
|
+
const held: Promise<unknown>[] = [];
|
|
68
|
+
const facade = Object.fromEntries(
|
|
69
|
+
Object.entries(api).map(([name, fn]) => [
|
|
70
|
+
name,
|
|
71
|
+
async (...args: unknown[]) => {
|
|
72
|
+
calls.push(name);
|
|
73
|
+
const value = await Reflect.apply(fn, undefined, args);
|
|
74
|
+
if (name === method) {
|
|
75
|
+
entered.resolve();
|
|
76
|
+
await release.promise;
|
|
77
|
+
}
|
|
78
|
+
return value;
|
|
79
|
+
},
|
|
80
|
+
]),
|
|
81
|
+
);
|
|
82
|
+
vi.doMock("./publicApi.js", () => facade);
|
|
83
|
+
const { createAttachEventCompiler } = await import("./attachEvents.js");
|
|
84
|
+
const { createConfigureEventCompiler } =
|
|
85
|
+
await import("./configureEvents.js");
|
|
86
|
+
const records: EventRecord[] = [];
|
|
87
|
+
const options = {
|
|
88
|
+
timeoutMs: 5000,
|
|
89
|
+
send(record: EventRecord, ack: (v: unknown) => void) {
|
|
90
|
+
records.push(record);
|
|
91
|
+
ack({ sequence: record.sequence, binding: record.binding });
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
const request = stage === "attach" ? f.request : f.configure;
|
|
95
|
+
const compiler =
|
|
96
|
+
stage === "attach"
|
|
97
|
+
? createAttachEventCompiler(f.sourceAttach, options)
|
|
98
|
+
: createConfigureEventCompiler(f.sourceConfigure, options);
|
|
99
|
+
if (branch === "receipt") {
|
|
100
|
+
await compiler.dispatch({ event: "dispatch", stage, request });
|
|
101
|
+
await compiler.response(
|
|
102
|
+
stage === "attach"
|
|
103
|
+
? {
|
|
104
|
+
event: "response",
|
|
105
|
+
stage,
|
|
106
|
+
request,
|
|
107
|
+
body: f.s.attach.providerSnapshot,
|
|
108
|
+
status: 200,
|
|
109
|
+
}
|
|
110
|
+
: {
|
|
111
|
+
event: "response",
|
|
112
|
+
stage,
|
|
113
|
+
request,
|
|
114
|
+
body: f.s.configuredBody,
|
|
115
|
+
transport: f.transport,
|
|
116
|
+
},
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
const before = records.length;
|
|
120
|
+
const operation =
|
|
121
|
+
branch === "dispatch"
|
|
122
|
+
? compiler.dispatch({ event: "dispatch", stage, request })
|
|
123
|
+
: compiler.receipt({
|
|
124
|
+
event: "receipt",
|
|
125
|
+
stage,
|
|
126
|
+
request,
|
|
127
|
+
receipt: stage === "attach" ? f.attach : f.stored,
|
|
128
|
+
});
|
|
129
|
+
// A setup refusal must fail this prerequisite rather than hang at the barrier.
|
|
130
|
+
const settled = operation.then(
|
|
131
|
+
() => {
|
|
132
|
+
throw Error("SETTLED_BEFORE_REAL_CONSTRUCTOR_BARRIER");
|
|
133
|
+
},
|
|
134
|
+
() => {
|
|
135
|
+
throw Error("REFUSED_BEFORE_REAL_CONSTRUCTOR_BARRIER");
|
|
136
|
+
},
|
|
137
|
+
);
|
|
138
|
+
held.push(settled.catch(() => {}));
|
|
139
|
+
try {
|
|
140
|
+
await Promise.race([entered.promise, settled]);
|
|
141
|
+
const entries = calls.length;
|
|
142
|
+
OWNER.retire();
|
|
143
|
+
await expect(operation).rejects.toThrow("C10_SOURCE_STOP");
|
|
144
|
+
expect(records).toHaveLength(before);
|
|
145
|
+
release.resolve();
|
|
146
|
+
await Promise.all(held);
|
|
147
|
+
expect(calls).toHaveLength(entries);
|
|
148
|
+
expect(() => OWNER.check()).toThrow("ORIGINAL_OWNER_STOP");
|
|
149
|
+
} finally {
|
|
150
|
+
release.resolve();
|
|
151
|
+
await operation.catch(() => {});
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
it("ACK alone cannot succeed after actual owner retirement while send remains held", async () => {
|
|
157
|
+
const { OWNER } = await rig();
|
|
158
|
+
const { createAppendAckAdapter } = await import("./appendAck.js");
|
|
159
|
+
const { scalarNode } = await import("./eventCodec.js");
|
|
160
|
+
const entered = deferred<void>(),
|
|
161
|
+
release = deferred<void>();
|
|
162
|
+
let sends = 0;
|
|
163
|
+
const append = createAppendAckAdapter({
|
|
164
|
+
timeoutMs: 5000,
|
|
165
|
+
send(record: EventRecord, ack: (v: unknown) => void) {
|
|
166
|
+
sends++;
|
|
167
|
+
ack({ sequence: record.sequence, binding: record.binding });
|
|
168
|
+
entered.resolve();
|
|
169
|
+
return release.promise;
|
|
170
|
+
},
|
|
171
|
+
});
|
|
172
|
+
const operation = append(scalarNode("ordinary"));
|
|
173
|
+
try {
|
|
174
|
+
await entered.promise;
|
|
175
|
+
OWNER.retire();
|
|
176
|
+
await expect(operation).rejects.toThrow("C10_SOURCE_STOP");
|
|
177
|
+
release.resolve();
|
|
178
|
+
await expect(append(scalarNode("late"))).rejects.toThrow("C10_SOURCE_STOP");
|
|
179
|
+
expect(sends).toBe(1);
|
|
180
|
+
} finally {
|
|
181
|
+
release.resolve();
|
|
182
|
+
await operation.catch(() => {});
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
it.each(["append", "original"] as const)(
|
|
187
|
+
"%s deadline closes held send without resetting the original basis",
|
|
188
|
+
async (limit) => {
|
|
189
|
+
const { OWNER, time, basis } = await rig();
|
|
190
|
+
vi.useFakeTimers();
|
|
191
|
+
if (limit === "original") {
|
|
192
|
+
time.wallMs = basis.workEndWallMs - 20;
|
|
193
|
+
time.ns = basis.workEndNs - 20_000_000n;
|
|
194
|
+
}
|
|
195
|
+
const { createAppendAckAdapter } = await import("./appendAck.js");
|
|
196
|
+
const { scalarNode } = await import("./eventCodec.js");
|
|
197
|
+
const entered = deferred<void>(),
|
|
198
|
+
release = deferred<void>();
|
|
199
|
+
const append = createAppendAckAdapter({
|
|
200
|
+
timeoutMs: limit === "append" ? 25 : 5000,
|
|
201
|
+
send(record: EventRecord, ack: (v: unknown) => void) {
|
|
202
|
+
ack({ sequence: record.sequence, binding: record.binding });
|
|
203
|
+
entered.resolve();
|
|
204
|
+
return release.promise;
|
|
205
|
+
},
|
|
206
|
+
});
|
|
207
|
+
const operation = append(scalarNode("ordinary"));
|
|
208
|
+
const rejection = expect(operation).rejects.toThrow("C10_SOURCE_STOP");
|
|
209
|
+
try {
|
|
210
|
+
await entered.promise;
|
|
211
|
+
const originalBasis = OWNER.basis;
|
|
212
|
+
const delta = limit === "append" ? 25 : 20;
|
|
213
|
+
time.wallMs += delta;
|
|
214
|
+
time.ns += BigInt(delta) * 1_000_000n;
|
|
215
|
+
await vi.advanceTimersByTimeAsync(delta);
|
|
216
|
+
await rejection;
|
|
217
|
+
expect(originalBasis.startWallMs).toBe(basis.startWallMs);
|
|
218
|
+
if (limit === "append") expect(OWNER.check().retired).toBe(false);
|
|
219
|
+
else expect(() => OWNER.check()).toThrow("ORIGINAL_OWNER_STOP");
|
|
220
|
+
} finally {
|
|
221
|
+
release.resolve();
|
|
222
|
+
await operation.catch(() => {});
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
);
|
|
226
|
+
|
|
227
|
+
it("retirement at the real C10 digest return prevents actual send", async () => {
|
|
228
|
+
const { OWNER } = await rig();
|
|
229
|
+
const { createAppendAckAdapter } = await import("./appendAck.js");
|
|
230
|
+
const { scalarNode } = await import("./eventCodec.js");
|
|
231
|
+
const original = globalThis.crypto.subtle.digest;
|
|
232
|
+
const entered = deferred<void>(),
|
|
233
|
+
release = deferred<void>();
|
|
234
|
+
let sends = 0,
|
|
235
|
+
realDigests = 0;
|
|
236
|
+
const operations: Promise<ArrayBuffer>[] = [];
|
|
237
|
+
const spy = vi
|
|
238
|
+
.spyOn(globalThis.crypto.subtle, "digest")
|
|
239
|
+
.mockImplementation(function (algorithm, input) {
|
|
240
|
+
// This facade forwards the actual receiver and original bytes without replacement.
|
|
241
|
+
const operation = Reflect.apply(original, globalThis.crypto.subtle, [
|
|
242
|
+
algorithm,
|
|
243
|
+
input,
|
|
244
|
+
]).then(async (value: ArrayBuffer) => {
|
|
245
|
+
realDigests++;
|
|
246
|
+
entered.resolve();
|
|
247
|
+
await release.promise;
|
|
248
|
+
return value;
|
|
249
|
+
});
|
|
250
|
+
operations.push(operation);
|
|
251
|
+
return operation;
|
|
252
|
+
});
|
|
253
|
+
const append = createAppendAckAdapter({
|
|
254
|
+
timeoutMs: 5000,
|
|
255
|
+
send() {
|
|
256
|
+
sends++;
|
|
257
|
+
},
|
|
258
|
+
});
|
|
259
|
+
const operation = append(scalarNode("ordinary"));
|
|
260
|
+
const settled = operation.then(
|
|
261
|
+
() => {
|
|
262
|
+
throw Error("SETTLED_BEFORE_DIGEST");
|
|
263
|
+
},
|
|
264
|
+
() => {
|
|
265
|
+
throw Error("REFUSED_BEFORE_DIGEST");
|
|
266
|
+
},
|
|
267
|
+
);
|
|
268
|
+
void settled.catch(() => {});
|
|
269
|
+
try {
|
|
270
|
+
await Promise.race([entered.promise, settled]);
|
|
271
|
+
OWNER.retire();
|
|
272
|
+
await expect(operation).rejects.toThrow("C10_SOURCE_STOP");
|
|
273
|
+
release.resolve();
|
|
274
|
+
await Promise.all(operations);
|
|
275
|
+
expect(realDigests).toBe(1);
|
|
276
|
+
expect(sends).toBe(0);
|
|
277
|
+
} finally {
|
|
278
|
+
release.resolve();
|
|
279
|
+
await operation.catch(() => {});
|
|
280
|
+
await Promise.allSettled(operations);
|
|
281
|
+
spy.mockRestore();
|
|
282
|
+
}
|
|
283
|
+
});
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
// Private required-material prerequisite. No operator, PII or typed-field admission.
|
|
2
|
+
const STOP = "REQUIRED_JSON_PRIVACY_STOP";
|
|
3
|
+
const credentialNames = new Set([
|
|
4
|
+
"clientsecret",
|
|
5
|
+
"confirmationsecret",
|
|
6
|
+
"accesstoken",
|
|
7
|
+
"refreshtoken",
|
|
8
|
+
"authorization",
|
|
9
|
+
"apikey",
|
|
10
|
+
"secretkey",
|
|
11
|
+
"adminkey",
|
|
12
|
+
"privatekey",
|
|
13
|
+
"stripesecretkey",
|
|
14
|
+
"cardnumber",
|
|
15
|
+
"creditcardnumber",
|
|
16
|
+
"cvc",
|
|
17
|
+
"cvv",
|
|
18
|
+
"bankaccountnumber",
|
|
19
|
+
"routingnumber",
|
|
20
|
+
"iban",
|
|
21
|
+
"accountnumber",
|
|
22
|
+
]);
|
|
23
|
+
const credentialText =
|
|
24
|
+
/(?:sk|rk)_(?:test|live)_|whsec_|_secret_|\bBearer\s+|\bAuthorization\s*:|-----BEGIN (?:[A-Z]+ )?PRIVATE KEY-----|(?:^|\D)(?:\d[ -]?){12,18}\d(?:$|\D)/i;
|
|
25
|
+
function fail(): never {
|
|
26
|
+
throw new Error(STOP);
|
|
27
|
+
}
|
|
28
|
+
// Counts JSON escaping without serializing or reading object properties.
|
|
29
|
+
function stringSize(text: string) {
|
|
30
|
+
let bytes = 2,
|
|
31
|
+
characters = 2;
|
|
32
|
+
for (let i = 0; i < text.length; i++) {
|
|
33
|
+
const n = text.charCodeAt(i);
|
|
34
|
+
if (n === 34 || n === 92 || [8, 9, 10, 12, 13].includes(n)) {
|
|
35
|
+
bytes += 2;
|
|
36
|
+
characters += 2;
|
|
37
|
+
} else if (n < 32) {
|
|
38
|
+
bytes += 6;
|
|
39
|
+
characters += 6;
|
|
40
|
+
} else if (
|
|
41
|
+
n >= 0xd800 &&
|
|
42
|
+
n <= 0xdbff &&
|
|
43
|
+
i + 1 < text.length &&
|
|
44
|
+
text.charCodeAt(i + 1) >= 0xdc00 &&
|
|
45
|
+
text.charCodeAt(i + 1) <= 0xdfff
|
|
46
|
+
) {
|
|
47
|
+
bytes += 4;
|
|
48
|
+
characters += 2;
|
|
49
|
+
i++;
|
|
50
|
+
} else if (n >= 0xd800 && n <= 0xdfff) {
|
|
51
|
+
bytes += 6;
|
|
52
|
+
characters += 6;
|
|
53
|
+
} else {
|
|
54
|
+
bytes += n < 128 ? 1 : n < 2048 ? 2 : 3;
|
|
55
|
+
characters++;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return { bytes, characters };
|
|
59
|
+
}
|
|
60
|
+
export function requiredJSONSnapshot(value: unknown): unknown {
|
|
61
|
+
try {
|
|
62
|
+
let nodes = 0,
|
|
63
|
+
rawCharacters = 0,
|
|
64
|
+
jsonCharacters = 0,
|
|
65
|
+
utf8Bytes = 0;
|
|
66
|
+
const active = new Set<object>(),
|
|
67
|
+
captures = new Map<
|
|
68
|
+
object,
|
|
69
|
+
{ array: boolean; entries: [string, unknown][] }
|
|
70
|
+
>();
|
|
71
|
+
function charge(characters: number, bytes: number) {
|
|
72
|
+
jsonCharacters += characters;
|
|
73
|
+
utf8Bytes += bytes;
|
|
74
|
+
if (jsonCharacters > 500000 || utf8Bytes > 500000) fail();
|
|
75
|
+
}
|
|
76
|
+
function string(text: string) {
|
|
77
|
+
if (credentialText.test(text)) fail();
|
|
78
|
+
rawCharacters += text.length;
|
|
79
|
+
if (rawCharacters > 500000) fail();
|
|
80
|
+
const size = stringSize(text);
|
|
81
|
+
charge(size.characters, size.bytes);
|
|
82
|
+
}
|
|
83
|
+
function scan(item: unknown, depth: number): void {
|
|
84
|
+
if (++nodes > 10000 || depth > 40) fail();
|
|
85
|
+
if (typeof item === "string") {
|
|
86
|
+
string(item);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (item === null) {
|
|
90
|
+
charge(4, 4);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (typeof item === "boolean") {
|
|
94
|
+
charge(item ? 4 : 5, item ? 4 : 5);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
if (typeof item === "number") {
|
|
98
|
+
if (
|
|
99
|
+
!Number.isFinite(item) ||
|
|
100
|
+
(Number.isInteger(item) && !Number.isSafeInteger(item))
|
|
101
|
+
)
|
|
102
|
+
fail();
|
|
103
|
+
const size = String(item).length;
|
|
104
|
+
charge(size, size);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (!item || typeof item !== "object" || active.has(item)) fail();
|
|
108
|
+
const array = Array.isArray(item),
|
|
109
|
+
proto = Object.getPrototypeOf(item);
|
|
110
|
+
if (
|
|
111
|
+
array
|
|
112
|
+
? proto !== Array.prototype
|
|
113
|
+
: proto !== Object.prototype && proto !== null
|
|
114
|
+
)
|
|
115
|
+
fail();
|
|
116
|
+
const keys = Reflect.ownKeys(item);
|
|
117
|
+
if (keys.some((key) => typeof key !== "string")) fail();
|
|
118
|
+
const length = array
|
|
119
|
+
? Object.getOwnPropertyDescriptor(item, "length")
|
|
120
|
+
: null;
|
|
121
|
+
if (
|
|
122
|
+
array &&
|
|
123
|
+
(!length ||
|
|
124
|
+
!("value" in length) ||
|
|
125
|
+
!Number.isSafeInteger(length!.value) ||
|
|
126
|
+
length!.value > 10000)
|
|
127
|
+
)
|
|
128
|
+
fail();
|
|
129
|
+
const entries: [string, unknown][] = [];
|
|
130
|
+
for (const key of keys) {
|
|
131
|
+
if (typeof key !== "string") fail();
|
|
132
|
+
if (array && key === "length") continue;
|
|
133
|
+
if (entries.length >= 10000) fail();
|
|
134
|
+
if (
|
|
135
|
+
array &&
|
|
136
|
+
(!/^(0|[1-9][0-9]*)$/.test(key) || Number(key) >= length!.value)
|
|
137
|
+
)
|
|
138
|
+
fail();
|
|
139
|
+
// Secret names themselves are not secret values. Non-null values stop.
|
|
140
|
+
const descriptor = Object.getOwnPropertyDescriptor(item, key);
|
|
141
|
+
if (!descriptor || !descriptor.enumerable || !("value" in descriptor))
|
|
142
|
+
fail();
|
|
143
|
+
if (
|
|
144
|
+
credentialNames.has(key.replace(/[^A-Za-z0-9]/g, "").toLowerCase()) &&
|
|
145
|
+
descriptor.value !== null
|
|
146
|
+
)
|
|
147
|
+
fail();
|
|
148
|
+
if (!array) string(key);
|
|
149
|
+
else {
|
|
150
|
+
rawCharacters += key.length;
|
|
151
|
+
if (rawCharacters > 500000) fail();
|
|
152
|
+
}
|
|
153
|
+
entries.push([key, descriptor.value]);
|
|
154
|
+
}
|
|
155
|
+
if (array && entries.length !== length!.value) fail();
|
|
156
|
+
charge(
|
|
157
|
+
2 + Math.max(0, entries.length - 1) + (array ? 0 : entries.length),
|
|
158
|
+
2 + Math.max(0, entries.length - 1) + (array ? 0 : entries.length),
|
|
159
|
+
);
|
|
160
|
+
active.add(item);
|
|
161
|
+
for (const [, child] of entries) scan(child, depth + 1);
|
|
162
|
+
active.delete(item);
|
|
163
|
+
// Internal descriptor capture only. No detached JSON clone exists until all scans pass.
|
|
164
|
+
captures.set(item, { array, entries });
|
|
165
|
+
}
|
|
166
|
+
scan(value, 0);
|
|
167
|
+
function copy(item: unknown): unknown {
|
|
168
|
+
if (!item || typeof item !== "object") return item;
|
|
169
|
+
const { array, entries } = captures.get(item)!;
|
|
170
|
+
if (array) return entries.map(([, child]) => copy(child));
|
|
171
|
+
return Object.fromEntries(
|
|
172
|
+
entries
|
|
173
|
+
.sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0))
|
|
174
|
+
.map(([key, child]) => [key, copy(child)]),
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
return copy(value);
|
|
178
|
+
} catch {
|
|
179
|
+
fail();
|
|
180
|
+
}
|
|
181
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Internal standard repo constructors only, no caller-selected resolver. */
|
|
2
|
+
export {
|
|
3
|
+
prepareRenewalPriceReplacementV2,
|
|
4
|
+
prepareRenewalScheduleAttachmentV2,
|
|
5
|
+
constructRenewalScheduleAttachmentReceiptV2,
|
|
6
|
+
projectRenewalConfigurationV2,
|
|
7
|
+
constructRenewalConfigurationReceiptV2,
|
|
8
|
+
} from "../../../renewalV2/index.js";
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import "./test-fixtures/semanticSetup.js";
|
|
2
|
+
import { it as test } from "vitest";
|
|
3
|
+
import assert from "node:assert/strict";
|
|
4
|
+
const { fixture, copy } = await import("./test-fixtures/fixture.mjs");
|
|
5
|
+
const { createAttachEventCompiler } =
|
|
6
|
+
await import("./test-fixtures/compilerIndex.mjs");
|
|
7
|
+
for (const kind of [
|
|
8
|
+
"secret-object",
|
|
9
|
+
"secret-array",
|
|
10
|
+
"secret-text",
|
|
11
|
+
"whole-bytes",
|
|
12
|
+
])
|
|
13
|
+
test(
|
|
14
|
+
"reflection between ordinary admission and detach rejects " +
|
|
15
|
+
kind +
|
|
16
|
+
" before materialize/hash",
|
|
17
|
+
async () => {
|
|
18
|
+
const f = await fixture(),
|
|
19
|
+
raw = copy(f.sourceAttach);
|
|
20
|
+
let prototypes = 0,
|
|
21
|
+
clones = 0,
|
|
22
|
+
hashes = 0;
|
|
23
|
+
const property =
|
|
24
|
+
kind.startsWith("secret-") && kind !== "secret-text"
|
|
25
|
+
? "client_secret"
|
|
26
|
+
: "unclassified";
|
|
27
|
+
const value =
|
|
28
|
+
kind === "secret-object"
|
|
29
|
+
? {}
|
|
30
|
+
: kind === "secret-array"
|
|
31
|
+
? []
|
|
32
|
+
: kind === "secret-text"
|
|
33
|
+
? "sk_test_SYNTHETIC"
|
|
34
|
+
: Array.from({ length: 20 }, () => "x".repeat(30000));
|
|
35
|
+
raw.preparation.subscription = new Proxy(raw.preparation.subscription, {
|
|
36
|
+
getPrototypeOf(t) {
|
|
37
|
+
prototypes++;
|
|
38
|
+
if (prototypes === 2)
|
|
39
|
+
Object.defineProperty(t, property, {
|
|
40
|
+
value,
|
|
41
|
+
enumerable: true,
|
|
42
|
+
configurable: true,
|
|
43
|
+
});
|
|
44
|
+
return Object.prototype;
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
const originalEntries = Object.fromEntries,
|
|
48
|
+
originalDigest = globalThis.crypto.subtle.digest;
|
|
49
|
+
Object.fromEntries = function (
|
|
50
|
+
entries: Iterable<readonly [PropertyKey, unknown]>,
|
|
51
|
+
) {
|
|
52
|
+
const rows = Array.from(entries);
|
|
53
|
+
if (
|
|
54
|
+
rows.some(
|
|
55
|
+
([k, v]) =>
|
|
56
|
+
k === property &&
|
|
57
|
+
v !== null &&
|
|
58
|
+
(typeof v === "object" || typeof v === "string"),
|
|
59
|
+
)
|
|
60
|
+
)
|
|
61
|
+
clones++;
|
|
62
|
+
return originalEntries(rows);
|
|
63
|
+
};
|
|
64
|
+
globalThis.crypto.subtle.digest = function (...a) {
|
|
65
|
+
hashes++;
|
|
66
|
+
return originalDigest.apply(this, a);
|
|
67
|
+
};
|
|
68
|
+
try {
|
|
69
|
+
assert.throws(
|
|
70
|
+
() =>
|
|
71
|
+
createAttachEventCompiler(raw, {
|
|
72
|
+
timeoutMs: 5000,
|
|
73
|
+
send: async () => {
|
|
74
|
+
throw Error("NO_SEND");
|
|
75
|
+
},
|
|
76
|
+
}),
|
|
77
|
+
/C10_SOURCE_STOP/,
|
|
78
|
+
);
|
|
79
|
+
assert.ok(prototypes >= 2);
|
|
80
|
+
assert.equal(clones, 0);
|
|
81
|
+
assert.equal(hashes, 0);
|
|
82
|
+
} finally {
|
|
83
|
+
Object.fromEntries = originalEntries;
|
|
84
|
+
globalThis.crypto.subtle.digest = originalDigest;
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Raw synthetic sources only; never imports the TEST owner/model/first-construction entry.
|
|
2
|
+
import { instantiateRequired } from "./frozen/f24.mjs";
|
|
3
|
+
import * as sdk from "../../../../renewalV2/index.js";
|
|
4
|
+
export const copy = (x) => structuredClone(x);
|
|
5
|
+
export const wire = (x) => ({
|
|
6
|
+
scope: x.scope,
|
|
7
|
+
apiVersion: x.apiVersion,
|
|
8
|
+
method: x.method,
|
|
9
|
+
path: x.path,
|
|
10
|
+
payload: copy(x.payload),
|
|
11
|
+
key: x.key,
|
|
12
|
+
firstDispatchedAt: x.firstDispatchedAt,
|
|
13
|
+
});
|
|
14
|
+
export async function fixture() {
|
|
15
|
+
const s = instantiateRequired(),
|
|
16
|
+
sourceAttach = copy(s.attach.attachRequest),
|
|
17
|
+
sourceConfigure = copy(s.configuration);
|
|
18
|
+
const prepared = await sdk.prepareRenewalPriceReplacementV2(
|
|
19
|
+
sourceAttach.preparation,
|
|
20
|
+
),
|
|
21
|
+
request = await sdk.prepareRenewalScheduleAttachmentV2({
|
|
22
|
+
prepared,
|
|
23
|
+
apiVersion: sourceAttach.apiVersion,
|
|
24
|
+
attachKey: sourceAttach.attachKey,
|
|
25
|
+
firstDispatchedAt: sourceAttach.firstDispatchedAt,
|
|
26
|
+
}),
|
|
27
|
+
attach = await sdk.constructRenewalScheduleAttachmentReceiptV2(s.attach),
|
|
28
|
+
configure = await sdk.projectRenewalConfigurationV2(sourceConfigure);
|
|
29
|
+
if (configure.status !== "projected_configure_request")
|
|
30
|
+
throw Error("SYNTHETIC_CONFIGURE_UNSUPPORTED");
|
|
31
|
+
const transport = { status: 200, requestId: "req_SYNTHETIC_C10" },
|
|
32
|
+
stored = await sdk.constructRenewalConfigurationReceiptV2({
|
|
33
|
+
configuration: sourceConfigure,
|
|
34
|
+
actualDispatch: s.configuredDispatch,
|
|
35
|
+
providerSnapshot: s.configuredBody,
|
|
36
|
+
transport,
|
|
37
|
+
});
|
|
38
|
+
return {
|
|
39
|
+
s,
|
|
40
|
+
sourceAttach,
|
|
41
|
+
sourceConfigure,
|
|
42
|
+
request,
|
|
43
|
+
attach,
|
|
44
|
+
configure,
|
|
45
|
+
stored,
|
|
46
|
+
transport,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export { sdk };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { object, timestamp, unsupported } from "./f02.mjs";
|
|
3
|
+
const mode = z
|
|
4
|
+
.object({
|
|
5
|
+
type: z.enum(["classic", "flexible"]),
|
|
6
|
+
flexible: z
|
|
7
|
+
.object({
|
|
8
|
+
proration_discounts: z.enum(["included", "itemized"]).optional(),
|
|
9
|
+
})
|
|
10
|
+
.strict()
|
|
11
|
+
.nullable(),
|
|
12
|
+
updated_at: timestamp.optional(),
|
|
13
|
+
})
|
|
14
|
+
.strict()
|
|
15
|
+
.refine((value) => value.type !== "classic" || value.flexible === null);
|
|
16
|
+
const anchorConfig = z
|
|
17
|
+
.object({
|
|
18
|
+
day_of_month: z.number().int().min(1).max(31),
|
|
19
|
+
month: z.number().int().min(1).max(12).nullable(),
|
|
20
|
+
hour: z.number().int().min(0).max(23).nullable(),
|
|
21
|
+
minute: z.number().int().min(0).max(59).nullable(),
|
|
22
|
+
second: z.number().int().min(0).max(59).nullable(),
|
|
23
|
+
})
|
|
24
|
+
.strict()
|
|
25
|
+
.nullable();
|
|
26
|
+
export function profileOf(subscription, currentPrice, targetPrice, apiVersion) {
|
|
27
|
+
const parsedMode = mode.safeParse(subscription.billing_mode);
|
|
28
|
+
if (!parsedMode.success) unsupported("unsupported_billing_mode");
|
|
29
|
+
const parsedConfig = anchorConfig.safeParse(
|
|
30
|
+
subscription.billing_cycle_anchor_config,
|
|
31
|
+
);
|
|
32
|
+
if (!parsedConfig.success) unsupported("unsupported_anchor_config");
|
|
33
|
+
const anchor = timestamp.safeParse(subscription.billing_cycle_anchor);
|
|
34
|
+
if (
|
|
35
|
+
!anchor.success ||
|
|
36
|
+
!Number.isFinite(new Date(anchor.data * 1000).getTime())
|
|
37
|
+
)
|
|
38
|
+
unsupported("unsupported_numeric_anchor");
|
|
39
|
+
const current = object(object(currentPrice).recurring);
|
|
40
|
+
const target = object(object(targetPrice).recurring);
|
|
41
|
+
const cadence =
|
|
42
|
+
current.interval === target.interval &&
|
|
43
|
+
current.interval_count === target.interval_count
|
|
44
|
+
? "same"
|
|
45
|
+
: "changed";
|
|
46
|
+
if (parsedConfig.data !== null) {
|
|
47
|
+
if (current.interval !== "month" && current.interval !== "year")
|
|
48
|
+
unsupported("unsupported_anchor_config_cadence");
|
|
49
|
+
if (cadence === "changed")
|
|
50
|
+
unsupported("unsupported_changed_cadence_anchor_config");
|
|
51
|
+
}
|
|
52
|
+
const calendar = current.interval === "month" || current.interval === "year";
|
|
53
|
+
const edge =
|
|
54
|
+
calendar &&
|
|
55
|
+
(new Date(anchor.data * 1000).getUTCDate() >= 29 ||
|
|
56
|
+
(parsedConfig.data?.day_of_month ?? 0) >= 29);
|
|
57
|
+
return {
|
|
58
|
+
apiVersion,
|
|
59
|
+
billingMode: parsedMode.data.type,
|
|
60
|
+
cadence,
|
|
61
|
+
anchor: edge ? "calendar_edge" : "ordinary",
|
|
62
|
+
};
|
|
63
|
+
}
|