@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,145 @@
|
|
|
1
|
+
import type { CapturedNode } from "./eventCodec.js";
|
|
2
|
+
import type {
|
|
3
|
+
ProjectedRenewalConfigurationV2,
|
|
4
|
+
ConstructRenewalConfigurationReceiptV2Options,
|
|
5
|
+
} from "../../../renewalV2/index.js";
|
|
6
|
+
// One distinct configure-stage channel, sequence1..3. No combined producer lineage.
|
|
7
|
+
import { need, stop, field, equalNodes, freeze, sevenWire } from "./ownData.js";
|
|
8
|
+
import {
|
|
9
|
+
captureConfigureSource,
|
|
10
|
+
captureConfigureDispatch,
|
|
11
|
+
captureConfigureResponse,
|
|
12
|
+
captureConfigureReceipt,
|
|
13
|
+
} from "./eventCapture.js";
|
|
14
|
+
import { materialize } from "./eventCodec.js";
|
|
15
|
+
import { createStageChannel } from "./appendAck.js";
|
|
16
|
+
import {
|
|
17
|
+
projectRenewalConfigurationV2,
|
|
18
|
+
constructRenewalConfigurationReceiptV2,
|
|
19
|
+
} from "./publicApi.js";
|
|
20
|
+
export function createConfigureEventCompiler(raw: unknown, options: unknown) {
|
|
21
|
+
const channel = createStageChannel(options);
|
|
22
|
+
let source: ReturnType<typeof captureConfigureSource>;
|
|
23
|
+
try {
|
|
24
|
+
channel.gate();
|
|
25
|
+
source = captureConfigureSource(raw);
|
|
26
|
+
channel.gate();
|
|
27
|
+
} catch {
|
|
28
|
+
channel.close();
|
|
29
|
+
stop();
|
|
30
|
+
}
|
|
31
|
+
const append = channel.append;
|
|
32
|
+
let position = 0,
|
|
33
|
+
busy = false,
|
|
34
|
+
closed = false,
|
|
35
|
+
request: ProjectedRenewalConfigurationV2 | undefined,
|
|
36
|
+
requestNode: CapturedNode | undefined,
|
|
37
|
+
response:
|
|
38
|
+
| Readonly<{
|
|
39
|
+
body: unknown;
|
|
40
|
+
transport: ConstructRenewalConfigurationReceiptV2Options["transport"];
|
|
41
|
+
}>
|
|
42
|
+
| undefined;
|
|
43
|
+
async function locked(
|
|
44
|
+
expected: number,
|
|
45
|
+
capture: (value: unknown) => CapturedNode,
|
|
46
|
+
value: unknown,
|
|
47
|
+
action: (node: CapturedNode) => void | Promise<void>,
|
|
48
|
+
) {
|
|
49
|
+
try {
|
|
50
|
+
channel.gate();
|
|
51
|
+
if (closed || busy || position !== expected) {
|
|
52
|
+
closed = true;
|
|
53
|
+
channel.close();
|
|
54
|
+
stop();
|
|
55
|
+
}
|
|
56
|
+
busy = true;
|
|
57
|
+
const node = capture(value);
|
|
58
|
+
channel.gate();
|
|
59
|
+
return await channel.run(async () => {
|
|
60
|
+
channel.gate();
|
|
61
|
+
await action(node);
|
|
62
|
+
channel.gate();
|
|
63
|
+
need(!closed);
|
|
64
|
+
await append(node);
|
|
65
|
+
channel.gate();
|
|
66
|
+
need(!closed);
|
|
67
|
+
position++;
|
|
68
|
+
return Object.freeze({
|
|
69
|
+
kind: "C10_EVENT_DATA_APPENDED",
|
|
70
|
+
stageChannel: "configure",
|
|
71
|
+
actualFulfillmentEstablished: false,
|
|
72
|
+
authenticationEstablished: false,
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
} catch {
|
|
76
|
+
closed = true;
|
|
77
|
+
channel.close();
|
|
78
|
+
stop();
|
|
79
|
+
} finally {
|
|
80
|
+
busy = false;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const dispatch = (value: unknown) =>
|
|
85
|
+
locked(0, captureConfigureDispatch, value, async (node) => {
|
|
86
|
+
channel.gate();
|
|
87
|
+
const r = await projectRenewalConfigurationV2(source);
|
|
88
|
+
channel.gate();
|
|
89
|
+
need(r.status === "projected_configure_request" && !closed);
|
|
90
|
+
const proof = captureConfigureDispatch({
|
|
91
|
+
event: "dispatch",
|
|
92
|
+
stage: "configure",
|
|
93
|
+
request: r,
|
|
94
|
+
});
|
|
95
|
+
need(equalNodes(node, proof));
|
|
96
|
+
request = freeze(r);
|
|
97
|
+
requestNode = field(proof, "request");
|
|
98
|
+
});
|
|
99
|
+
const responseEvent = (value: unknown) =>
|
|
100
|
+
locked(1, captureConfigureResponse, value, async (node) => {
|
|
101
|
+
need(
|
|
102
|
+
request &&
|
|
103
|
+
requestNode &&
|
|
104
|
+
equalNodes(field(node, "request"), requestNode),
|
|
105
|
+
);
|
|
106
|
+
response = freeze({
|
|
107
|
+
body: materialize(field(node, "body")),
|
|
108
|
+
transport: materialize(
|
|
109
|
+
field(node, "transport"),
|
|
110
|
+
) as ConstructRenewalConfigurationReceiptV2Options["transport"],
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
const receipt = (value: unknown) =>
|
|
114
|
+
locked(2, captureConfigureReceipt, value, async (node) => {
|
|
115
|
+
need(
|
|
116
|
+
response &&
|
|
117
|
+
request &&
|
|
118
|
+
requestNode &&
|
|
119
|
+
equalNodes(field(node, "request"), requestNode),
|
|
120
|
+
);
|
|
121
|
+
channel.gate();
|
|
122
|
+
const r = await constructRenewalConfigurationReceiptV2({
|
|
123
|
+
configuration: source,
|
|
124
|
+
actualDispatch: sevenWire(request),
|
|
125
|
+
providerSnapshot: response.body as Record<string, unknown>,
|
|
126
|
+
transport: response.transport,
|
|
127
|
+
});
|
|
128
|
+
channel.gate();
|
|
129
|
+
need(!closed);
|
|
130
|
+
const proof = captureConfigureReceipt({
|
|
131
|
+
event: "receipt",
|
|
132
|
+
stage: "configure",
|
|
133
|
+
request,
|
|
134
|
+
receipt: r,
|
|
135
|
+
});
|
|
136
|
+
need(equalNodes(node, proof));
|
|
137
|
+
});
|
|
138
|
+
return Object.freeze({
|
|
139
|
+
stageChannel: "configure",
|
|
140
|
+
combinedProducerLineageEstablished: false,
|
|
141
|
+
dispatch,
|
|
142
|
+
response: responseEvent,
|
|
143
|
+
receipt,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
@@ -0,0 +1,464 @@
|
|
|
1
|
+
import type { CapturedNode } from "./eventCodec.js";
|
|
2
|
+
import type {
|
|
3
|
+
ConstructRenewalScheduleAttachmentReceiptV2Options,
|
|
4
|
+
ProjectRenewalConfigurationV2Options,
|
|
5
|
+
} from "../../../renewalV2/index.js";
|
|
6
|
+
type Stage = "attach" | "configure";
|
|
7
|
+
type EventKind = "dispatch" | "response" | "receipt";
|
|
8
|
+
type Schema = { required: string[]; optional: string[] };
|
|
9
|
+
// Six fixed mixed event captures. Pending derived slots remain unverified until full own reconstruction.
|
|
10
|
+
import { requiredJSONSnapshot } from "./privacy.js";
|
|
11
|
+
import { objectNode, scalarNode, materialize } from "./eventCodec.js";
|
|
12
|
+
import { need, stop, field, scalar, freeze, closed } from "./ownData.js";
|
|
13
|
+
const attachKeys = [
|
|
14
|
+
"version",
|
|
15
|
+
"stage",
|
|
16
|
+
"scope",
|
|
17
|
+
"apiVersion",
|
|
18
|
+
"logicalBinding",
|
|
19
|
+
"method",
|
|
20
|
+
"path",
|
|
21
|
+
"payload",
|
|
22
|
+
"key",
|
|
23
|
+
"firstDispatchedAt",
|
|
24
|
+
"requestIdentity",
|
|
25
|
+
];
|
|
26
|
+
const configureKeys = [
|
|
27
|
+
"version",
|
|
28
|
+
"stage",
|
|
29
|
+
"scope",
|
|
30
|
+
"apiVersion",
|
|
31
|
+
"logicalBinding",
|
|
32
|
+
"scheduleId",
|
|
33
|
+
"method",
|
|
34
|
+
"path",
|
|
35
|
+
"key",
|
|
36
|
+
"payload",
|
|
37
|
+
"firstDispatchedAt",
|
|
38
|
+
"attachReceiptBinding",
|
|
39
|
+
"baselineBinding",
|
|
40
|
+
"defaultSettingsBinding",
|
|
41
|
+
"status",
|
|
42
|
+
"providerQualification",
|
|
43
|
+
"profile",
|
|
44
|
+
"requestIdentity",
|
|
45
|
+
];
|
|
46
|
+
const attachedKeys = [
|
|
47
|
+
"version",
|
|
48
|
+
"stage",
|
|
49
|
+
"scope",
|
|
50
|
+
"logicalBinding",
|
|
51
|
+
"request",
|
|
52
|
+
"scheduleId",
|
|
53
|
+
"subscriptionId",
|
|
54
|
+
"customerAccountId",
|
|
55
|
+
"livemode",
|
|
56
|
+
"providerSnapshot",
|
|
57
|
+
"binding",
|
|
58
|
+
];
|
|
59
|
+
const storedKeys = [
|
|
60
|
+
"version",
|
|
61
|
+
"stage",
|
|
62
|
+
"scope",
|
|
63
|
+
"verification",
|
|
64
|
+
"apiVersion",
|
|
65
|
+
"logicalBinding",
|
|
66
|
+
"request",
|
|
67
|
+
"attachReceiptBinding",
|
|
68
|
+
"scheduleId",
|
|
69
|
+
"subscriptionId",
|
|
70
|
+
"customerAccountId",
|
|
71
|
+
"billingCustomerId",
|
|
72
|
+
"livemode",
|
|
73
|
+
"providerSnapshot",
|
|
74
|
+
"transport",
|
|
75
|
+
"providerSnapshotBinding",
|
|
76
|
+
"binding",
|
|
77
|
+
];
|
|
78
|
+
const pendingRequest = (prefix: string, stage: Stage): [string, string][] =>
|
|
79
|
+
stage === "attach"
|
|
80
|
+
? [
|
|
81
|
+
[prefix + "/logicalBinding", "renewal"],
|
|
82
|
+
[prefix + "/requestIdentity/binding", "renewal-attach"],
|
|
83
|
+
]
|
|
84
|
+
: [
|
|
85
|
+
[prefix + "/logicalBinding", "renewal"],
|
|
86
|
+
[prefix + "/attachReceiptBinding", "renewal-attach-receipt"],
|
|
87
|
+
[prefix + "/baselineBinding", "renewal-baseline"],
|
|
88
|
+
[prefix + "/defaultSettingsBinding", "renewal-defaults"],
|
|
89
|
+
[prefix + "/requestIdentity/binding", "renewal-configure"],
|
|
90
|
+
];
|
|
91
|
+
function fixed(stage: Stage, kind: EventKind) {
|
|
92
|
+
const schemas = new Map<string, Schema>(),
|
|
93
|
+
pending = new Map(pendingRequest("request", stage));
|
|
94
|
+
const set = (p: string, required: string[], optional: string[] = []) =>
|
|
95
|
+
schemas.set(p, { required, optional });
|
|
96
|
+
set(
|
|
97
|
+
"",
|
|
98
|
+
kind === "dispatch"
|
|
99
|
+
? ["event", "stage", "request"]
|
|
100
|
+
: kind === "response"
|
|
101
|
+
? [
|
|
102
|
+
"event",
|
|
103
|
+
"stage",
|
|
104
|
+
"request",
|
|
105
|
+
"body",
|
|
106
|
+
stage === "attach" ? "status" : "transport",
|
|
107
|
+
]
|
|
108
|
+
: ["event", "stage", "request", "receipt"],
|
|
109
|
+
);
|
|
110
|
+
function request(p: string) {
|
|
111
|
+
set(p, stage === "attach" ? attachKeys : configureKeys);
|
|
112
|
+
set(p + "/requestIdentity", ["key", "binding"]);
|
|
113
|
+
set(
|
|
114
|
+
p + "/payload",
|
|
115
|
+
stage === "attach"
|
|
116
|
+
? ["from_subscription"]
|
|
117
|
+
: ["end_behavior", "proration_behavior", "phases"],
|
|
118
|
+
);
|
|
119
|
+
if (stage === "configure")
|
|
120
|
+
set(p + "/profile", ["apiVersion", "billingMode", "cadence", "anchor"]);
|
|
121
|
+
}
|
|
122
|
+
request("request");
|
|
123
|
+
if (kind === "response" && stage === "configure")
|
|
124
|
+
set("transport", ["status"], ["requestId"]);
|
|
125
|
+
if (kind === "receipt") {
|
|
126
|
+
set(
|
|
127
|
+
"receipt",
|
|
128
|
+
stage === "attach" ? attachedKeys : storedKeys,
|
|
129
|
+
stage === "attach" ? [] : ["defaultSettingsBinding"],
|
|
130
|
+
);
|
|
131
|
+
request("receipt/request");
|
|
132
|
+
for (const [p, f] of pendingRequest("receipt/request", stage))
|
|
133
|
+
pending.set(p, f);
|
|
134
|
+
pending.set("receipt/logicalBinding", "renewal");
|
|
135
|
+
pending.set(
|
|
136
|
+
"receipt/binding",
|
|
137
|
+
stage === "attach"
|
|
138
|
+
? "renewal-attach-receipt"
|
|
139
|
+
: "renewal-configure-receipt",
|
|
140
|
+
);
|
|
141
|
+
if (stage === "configure") {
|
|
142
|
+
set("receipt/transport", ["status"], ["requestId"]);
|
|
143
|
+
pending.set("receipt/attachReceiptBinding", "renewal-attach-receipt");
|
|
144
|
+
pending.set(
|
|
145
|
+
"receipt/providerSnapshotBinding",
|
|
146
|
+
"renewal-configured-baseline",
|
|
147
|
+
);
|
|
148
|
+
pending.set(
|
|
149
|
+
"receipt/defaultSettingsBinding",
|
|
150
|
+
"renewal-configured-defaults",
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return { schemas, pending };
|
|
155
|
+
}
|
|
156
|
+
const pathKey = (parts: string[]) =>
|
|
157
|
+
parts.map((k) => k.replace(/~/g, "~0").replace(/\//g, "~1")).join("/");
|
|
158
|
+
function stringSize(text: string) {
|
|
159
|
+
let bytes = 2,
|
|
160
|
+
characters = 2;
|
|
161
|
+
for (let i = 0; i < text.length; i++) {
|
|
162
|
+
const n = text.charCodeAt(i);
|
|
163
|
+
if (n === 34 || n === 92 || [8, 9, 10, 12, 13].includes(n)) {
|
|
164
|
+
bytes += 2;
|
|
165
|
+
characters += 2;
|
|
166
|
+
} else if (n < 32) {
|
|
167
|
+
bytes += 6;
|
|
168
|
+
characters += 6;
|
|
169
|
+
} else if (
|
|
170
|
+
n >= 0xd800 &&
|
|
171
|
+
n <= 0xdbff &&
|
|
172
|
+
i + 1 < text.length &&
|
|
173
|
+
text.charCodeAt(i + 1) >= 0xdc00 &&
|
|
174
|
+
text.charCodeAt(i + 1) <= 0xdfff
|
|
175
|
+
) {
|
|
176
|
+
bytes += 4;
|
|
177
|
+
characters += 2;
|
|
178
|
+
i++;
|
|
179
|
+
} else if (n >= 0xd800 && n <= 0xdfff) {
|
|
180
|
+
bytes += 6;
|
|
181
|
+
characters += 6;
|
|
182
|
+
} else {
|
|
183
|
+
bytes += n < 128 ? 1 : n < 2048 ? 2 : 3;
|
|
184
|
+
characters++;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return { bytes, characters };
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function captureTree(
|
|
191
|
+
raw: unknown,
|
|
192
|
+
schemas: Map<string, Schema>,
|
|
193
|
+
pending: Map<string, string>,
|
|
194
|
+
): CapturedNode {
|
|
195
|
+
let nodes = 0,
|
|
196
|
+
rawChars = 0,
|
|
197
|
+
chars = 0,
|
|
198
|
+
bytes = 0;
|
|
199
|
+
const active = new Set<object>();
|
|
200
|
+
const charge = (c: number, b: number) => {
|
|
201
|
+
chars += c;
|
|
202
|
+
bytes += b;
|
|
203
|
+
need(chars <= 500000 && bytes <= 500000 && rawChars <= 500000);
|
|
204
|
+
};
|
|
205
|
+
const string = (s: string, derived: string | undefined) => {
|
|
206
|
+
need(s.length <= 500000);
|
|
207
|
+
if (derived)
|
|
208
|
+
need(new RegExp("^" + derived + ":v2:sha256:[a-f0-9]{64}$").test(s));
|
|
209
|
+
else requiredJSONSnapshot(s);
|
|
210
|
+
rawChars += s.length;
|
|
211
|
+
const n = stringSize(s);
|
|
212
|
+
charge(n.characters, n.bytes);
|
|
213
|
+
};
|
|
214
|
+
function shape(keys: string[], spec: Schema | undefined) {
|
|
215
|
+
if (spec)
|
|
216
|
+
need(
|
|
217
|
+
spec.required.every((k) => keys.includes(k)) &&
|
|
218
|
+
keys.every(
|
|
219
|
+
(k) => spec.required.includes(k) || spec.optional.includes(k),
|
|
220
|
+
),
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
function walk(v: unknown, path: string[], depth: number): CapturedNode {
|
|
224
|
+
need(++nodes <= 10000 && depth <= 40);
|
|
225
|
+
const p = pathKey(path),
|
|
226
|
+
spec = schemas.get(p);
|
|
227
|
+
if (typeof v === "string") {
|
|
228
|
+
need(!spec);
|
|
229
|
+
string(v, pending.get(p));
|
|
230
|
+
return scalarNode(v);
|
|
231
|
+
}
|
|
232
|
+
if (v === null || typeof v === "number" || typeof v === "boolean") {
|
|
233
|
+
need(!spec && !pending.has(p));
|
|
234
|
+
requiredJSONSnapshot(v);
|
|
235
|
+
const n = String(v).length;
|
|
236
|
+
charge(n, n);
|
|
237
|
+
return scalarNode(v);
|
|
238
|
+
}
|
|
239
|
+
need(v && typeof v === "object" && !active.has(v));
|
|
240
|
+
const array = Array.isArray(v),
|
|
241
|
+
proto = Object.getPrototypeOf(v);
|
|
242
|
+
need(
|
|
243
|
+
array
|
|
244
|
+
? proto === Array.prototype
|
|
245
|
+
: proto === Object.prototype || proto === null,
|
|
246
|
+
);
|
|
247
|
+
need(!spec || !array);
|
|
248
|
+
const keys = Reflect.ownKeys(v);
|
|
249
|
+
need(keys.length <= 10001 && keys.every((k) => typeof k === "string"));
|
|
250
|
+
const length = array ? Object.getOwnPropertyDescriptor(v, "length") : null;
|
|
251
|
+
if (array)
|
|
252
|
+
need(
|
|
253
|
+
length &&
|
|
254
|
+
Object.prototype.hasOwnProperty.call(length, "value") &&
|
|
255
|
+
Number.isSafeInteger(length!.value) &&
|
|
256
|
+
length!.value >= 0 &&
|
|
257
|
+
length!.value <= 10000,
|
|
258
|
+
);
|
|
259
|
+
const actual = (keys as string[]).filter((k) => !(array && k === "length"));
|
|
260
|
+
shape(actual, spec);
|
|
261
|
+
const entries: [string, CapturedNode][] = [];
|
|
262
|
+
active.add(v);
|
|
263
|
+
for (const k of actual) {
|
|
264
|
+
if (array) need(/^(0|[1-9][0-9]*)$/.test(k) && Number(k) < length!.value);
|
|
265
|
+
const desc = Object.getOwnPropertyDescriptor(v, k);
|
|
266
|
+
need(
|
|
267
|
+
desc &&
|
|
268
|
+
desc.enumerable &&
|
|
269
|
+
Object.prototype.hasOwnProperty.call(desc, "value"),
|
|
270
|
+
);
|
|
271
|
+
const child = desc.value;
|
|
272
|
+
// Only name+safe null/boolean is checked here: no secret value/getter is copied or read again.
|
|
273
|
+
requiredJSONSnapshot(
|
|
274
|
+
Object.fromEntries([[k, child === null ? null : true]]),
|
|
275
|
+
);
|
|
276
|
+
rawChars += k.length;
|
|
277
|
+
if (!array) {
|
|
278
|
+
const z = stringSize(k);
|
|
279
|
+
charge(z.characters, z.bytes);
|
|
280
|
+
} else charge(0, 0);
|
|
281
|
+
entries.push([k, walk(child, [...path, k], depth + 1)]);
|
|
282
|
+
}
|
|
283
|
+
active.delete(v);
|
|
284
|
+
if (array) {
|
|
285
|
+
need(entries.length === length!.value);
|
|
286
|
+
entries.sort(([a], [b]) => Number(a) - Number(b));
|
|
287
|
+
}
|
|
288
|
+
shape(
|
|
289
|
+
entries.map(([k]) => k),
|
|
290
|
+
spec,
|
|
291
|
+
);
|
|
292
|
+
const framing =
|
|
293
|
+
2 + Math.max(0, entries.length - 1) + (array ? 0 : entries.length);
|
|
294
|
+
charge(framing, framing);
|
|
295
|
+
return array
|
|
296
|
+
? Object.freeze({
|
|
297
|
+
kind: "array",
|
|
298
|
+
entries: Object.freeze(entries.map((x) => Object.freeze(x))),
|
|
299
|
+
})
|
|
300
|
+
: objectNode(entries);
|
|
301
|
+
}
|
|
302
|
+
return walk(raw, [], 0);
|
|
303
|
+
}
|
|
304
|
+
function capture(raw: unknown, stage: Stage, kind: EventKind): CapturedNode {
|
|
305
|
+
try {
|
|
306
|
+
const { schemas, pending } = fixed(stage, kind),
|
|
307
|
+
root = captureTree(raw, schemas, pending);
|
|
308
|
+
need(
|
|
309
|
+
scalar(field(root, "event")) === kind &&
|
|
310
|
+
scalar(field(root, "stage")) === stage,
|
|
311
|
+
);
|
|
312
|
+
for (const p of kind === "receipt"
|
|
313
|
+
? ["request", "receipt/request"]
|
|
314
|
+
: ["request"]) {
|
|
315
|
+
const r = p.split("/").reduce((n, k) => field(n, k), root);
|
|
316
|
+
need(
|
|
317
|
+
scalar(field(r, "version")) === 2 &&
|
|
318
|
+
scalar(field(r, "stage")) ===
|
|
319
|
+
(stage === "attach" ? "attach" : "configure"),
|
|
320
|
+
);
|
|
321
|
+
need(
|
|
322
|
+
scalar(field(field(r, "requestIdentity"), "key")) ===
|
|
323
|
+
scalar(field(r, "key")),
|
|
324
|
+
);
|
|
325
|
+
}
|
|
326
|
+
if (kind === "response") {
|
|
327
|
+
const transport = stage === "attach" ? root : field(root, "transport"),
|
|
328
|
+
status = scalar(field(transport, "status"));
|
|
329
|
+
need(
|
|
330
|
+
typeof status === "number" &&
|
|
331
|
+
Number.isInteger(status) &&
|
|
332
|
+
status >= 200 &&
|
|
333
|
+
status <= 299,
|
|
334
|
+
);
|
|
335
|
+
const id =
|
|
336
|
+
stage === "configure"
|
|
337
|
+
? (
|
|
338
|
+
transport as Extract<CapturedNode, { kind: "object" | "array" }>
|
|
339
|
+
).entries.find(([k]) => k === "requestId")
|
|
340
|
+
: null;
|
|
341
|
+
if (id) {
|
|
342
|
+
const value = scalar(id[1]);
|
|
343
|
+
need(
|
|
344
|
+
typeof value === "string" && value.length >= 1 && value.length <= 255,
|
|
345
|
+
);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
if (kind === "receipt") {
|
|
349
|
+
const r = field(root, "receipt");
|
|
350
|
+
need(
|
|
351
|
+
scalar(field(r, "version")) === 2 &&
|
|
352
|
+
scalar(field(r, "stage")) ===
|
|
353
|
+
(stage === "attach"
|
|
354
|
+
? "attached_unconfigured"
|
|
355
|
+
: "configure_acknowledged"),
|
|
356
|
+
);
|
|
357
|
+
}
|
|
358
|
+
return root;
|
|
359
|
+
} catch {
|
|
360
|
+
stop();
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
export const captureAttachDispatch = (raw: unknown) =>
|
|
364
|
+
capture(raw, "attach", "dispatch");
|
|
365
|
+
export const captureAttachResponse = (raw: unknown) =>
|
|
366
|
+
capture(raw, "attach", "response");
|
|
367
|
+
export const captureAttachReceipt = (raw: unknown) =>
|
|
368
|
+
capture(raw, "attach", "receipt");
|
|
369
|
+
export const captureConfigureDispatch = (raw: unknown) =>
|
|
370
|
+
capture(raw, "configure", "dispatch");
|
|
371
|
+
export const captureConfigureResponse = (raw: unknown) =>
|
|
372
|
+
capture(raw, "configure", "response");
|
|
373
|
+
export const captureConfigureReceipt = (raw: unknown) =>
|
|
374
|
+
capture(raw, "configure", "receipt");
|
|
375
|
+
|
|
376
|
+
// Fixed ordinary constructor roots, not mixed claims or caller-selected capture contexts.
|
|
377
|
+
function rawSchemas(stage: Stage) {
|
|
378
|
+
const schemas = new Map<string, Schema>(),
|
|
379
|
+
set = (p: string, r: string[], o: string[] = []) =>
|
|
380
|
+
schemas.set(p, { required: r, optional: o });
|
|
381
|
+
const preparation = (p: string) =>
|
|
382
|
+
set(
|
|
383
|
+
p,
|
|
384
|
+
["subscription", "targetPrice", "expected", "key"],
|
|
385
|
+
["billingCustomer"],
|
|
386
|
+
);
|
|
387
|
+
const request = (p: string) => {
|
|
388
|
+
set(p, ["preparation", "apiVersion", "attachKey", "firstDispatchedAt"]);
|
|
389
|
+
preparation(p ? p + "/preparation" : "preparation");
|
|
390
|
+
};
|
|
391
|
+
if (stage === "attach") request("");
|
|
392
|
+
else {
|
|
393
|
+
set(
|
|
394
|
+
"",
|
|
395
|
+
[
|
|
396
|
+
"preparation",
|
|
397
|
+
"attachReceipt",
|
|
398
|
+
"freshSubscription",
|
|
399
|
+
"targetPrice",
|
|
400
|
+
"schedule",
|
|
401
|
+
"apiVersion",
|
|
402
|
+
"observedAt",
|
|
403
|
+
"firstDispatchedAt",
|
|
404
|
+
"configureKey",
|
|
405
|
+
],
|
|
406
|
+
["billingCustomer"],
|
|
407
|
+
);
|
|
408
|
+
preparation("preparation");
|
|
409
|
+
set("attachReceipt", [
|
|
410
|
+
"attachRequest",
|
|
411
|
+
"actualDispatch",
|
|
412
|
+
"providerSnapshot",
|
|
413
|
+
]);
|
|
414
|
+
request("attachReceipt/attachRequest");
|
|
415
|
+
set("attachReceipt/actualDispatch", [
|
|
416
|
+
"scope",
|
|
417
|
+
"apiVersion",
|
|
418
|
+
"method",
|
|
419
|
+
"path",
|
|
420
|
+
"payload",
|
|
421
|
+
"key",
|
|
422
|
+
"firstDispatchedAt",
|
|
423
|
+
]);
|
|
424
|
+
set("attachReceipt/actualDispatch/payload", ["from_subscription"]);
|
|
425
|
+
}
|
|
426
|
+
return schemas;
|
|
427
|
+
}
|
|
428
|
+
function precheckSource(raw: unknown, schemas: Map<string, Schema>) {
|
|
429
|
+
const visit = (value: unknown, path: string): void => {
|
|
430
|
+
const spec = schemas.get(path);
|
|
431
|
+
need(spec);
|
|
432
|
+
const own = closed(value, spec.required, spec.optional);
|
|
433
|
+
for (const key of Object.keys(own)) {
|
|
434
|
+
const child = path ? path + "/" + key : key;
|
|
435
|
+
if (schemas.has(child)) visit(own[key], child);
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
visit(raw, "");
|
|
439
|
+
}
|
|
440
|
+
function source(raw: unknown, stage: Stage): unknown {
|
|
441
|
+
try {
|
|
442
|
+
const schemas = rawSchemas(stage);
|
|
443
|
+
// 1. Names-first own-data precheck only: no full data clone/serialization/cost.
|
|
444
|
+
precheckSource(raw, schemas);
|
|
445
|
+
// 2. ORIGINAL full ordinary privacy/bounds admission FIRST. Discard reflection-ordered copy.
|
|
446
|
+
requiredJSONSnapshot(raw);
|
|
447
|
+
// 3. Recheck original descriptors with identical scalar/key privacy + WHOLE budgets;
|
|
448
|
+
// retain numeric-index array semantics. Materialize ONLY after that pass succeeds.
|
|
449
|
+
const node = captureTree(raw, schemas, new Map()),
|
|
450
|
+
value = materialize(node);
|
|
451
|
+
// 4. Ordinary re-admission of the own stable plain graph before C1/hash/promotion.
|
|
452
|
+
return freeze(requiredJSONSnapshot(value));
|
|
453
|
+
} catch {
|
|
454
|
+
stop();
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
// The closed raw schemas are captured here; public constructors still validate every semantic field.
|
|
458
|
+
export const captureAttachSource = (raw: unknown) =>
|
|
459
|
+
source(
|
|
460
|
+
raw,
|
|
461
|
+
"attach",
|
|
462
|
+
) as ConstructRenewalScheduleAttachmentReceiptV2Options["attachRequest"];
|
|
463
|
+
export const captureConfigureSource = (raw: unknown) =>
|
|
464
|
+
source(raw, "configure") as ProjectRenewalConfigurationV2Options;
|