@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,131 @@
|
|
|
1
|
+
/** Private C10 canonical bytes; the public C1–C9 family table is unchanged. */
|
|
2
|
+
export type CapturedNode =
|
|
3
|
+
| Readonly<{ kind: "scalar"; value: unknown }>
|
|
4
|
+
| Readonly<{
|
|
5
|
+
kind: "object" | "array";
|
|
6
|
+
entries: readonly (readonly [string, CapturedNode])[];
|
|
7
|
+
}>;
|
|
8
|
+
export type Entry = readonly [string, CapturedNode];
|
|
9
|
+
function fail(): never {
|
|
10
|
+
throw Error("C10_SOURCE_STOP");
|
|
11
|
+
}
|
|
12
|
+
export const objectNode = (entries: readonly Entry[]): CapturedNode =>
|
|
13
|
+
Object.freeze({
|
|
14
|
+
kind: "object",
|
|
15
|
+
entries: Object.freeze(entries.map((e) => Object.freeze(e))),
|
|
16
|
+
});
|
|
17
|
+
export const scalarNode = (value: unknown): CapturedNode =>
|
|
18
|
+
Object.freeze({ kind: "scalar", value });
|
|
19
|
+
export const omit = (node: CapturedNode, keys: readonly string[]) => {
|
|
20
|
+
if (node.kind !== "object") fail();
|
|
21
|
+
return objectNode(node.entries.filter(([k]) => !keys.includes(k)));
|
|
22
|
+
};
|
|
23
|
+
function ordered(entries: readonly Entry[]) {
|
|
24
|
+
const index = (k: string) =>
|
|
25
|
+
/^(0|[1-9][0-9]*)$/.test(k) && Number(k) <= 4294967294;
|
|
26
|
+
return [...entries].sort(([a], [b]) => {
|
|
27
|
+
const ai = index(a),
|
|
28
|
+
bi = index(b);
|
|
29
|
+
return ai && bi
|
|
30
|
+
? Number(a) - Number(b)
|
|
31
|
+
: ai
|
|
32
|
+
? -1
|
|
33
|
+
: bi
|
|
34
|
+
? 1
|
|
35
|
+
: a < b
|
|
36
|
+
? -1
|
|
37
|
+
: a > b
|
|
38
|
+
? 1
|
|
39
|
+
: 0;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
export function encode(node: CapturedNode): string {
|
|
43
|
+
let nodes = 0,
|
|
44
|
+
total = 0;
|
|
45
|
+
function part(s: string) {
|
|
46
|
+
total += s.length;
|
|
47
|
+
if (total > 500000) fail();
|
|
48
|
+
return s;
|
|
49
|
+
}
|
|
50
|
+
function walk(n: CapturedNode, depth: number): string {
|
|
51
|
+
if (++nodes > 10000 || depth > 40) fail();
|
|
52
|
+
if (n.kind === "scalar") {
|
|
53
|
+
const text = JSON.stringify(n.value);
|
|
54
|
+
if (text === undefined) fail();
|
|
55
|
+
return part(text);
|
|
56
|
+
}
|
|
57
|
+
if (n.kind === "array")
|
|
58
|
+
return (
|
|
59
|
+
part("[") +
|
|
60
|
+
n.entries
|
|
61
|
+
.map(([, v], i) => (i ? part(",") : "") + walk(v, depth + 1))
|
|
62
|
+
.join("") +
|
|
63
|
+
part("]")
|
|
64
|
+
);
|
|
65
|
+
if (n.kind !== "object") fail();
|
|
66
|
+
return (
|
|
67
|
+
part("{") +
|
|
68
|
+
ordered(n.entries)
|
|
69
|
+
.map(
|
|
70
|
+
([k, v], i) =>
|
|
71
|
+
(i ? part(",") : "") +
|
|
72
|
+
part(JSON.stringify(k)) +
|
|
73
|
+
part(":") +
|
|
74
|
+
walk(v, depth + 1),
|
|
75
|
+
)
|
|
76
|
+
.join("") +
|
|
77
|
+
part("}")
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
const text = walk(node, 0);
|
|
81
|
+
if (new TextEncoder().encode(text).byteLength > 500000) fail();
|
|
82
|
+
return text;
|
|
83
|
+
}
|
|
84
|
+
export function materialize(node: CapturedNode): unknown {
|
|
85
|
+
if (node.kind === "scalar") return node.value;
|
|
86
|
+
if (node.kind === "array") return node.entries.map(([, v]) => materialize(v));
|
|
87
|
+
return Object.fromEntries(
|
|
88
|
+
ordered(node.entries).map(([k, v]) => [k, materialize(v)]),
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
function rawBound(node: CapturedNode) {
|
|
92
|
+
let count = 0;
|
|
93
|
+
function walk(n: CapturedNode) {
|
|
94
|
+
if (n.kind === "scalar") {
|
|
95
|
+
if (typeof n.value === "string") count += n.value.length;
|
|
96
|
+
} else
|
|
97
|
+
for (const [k, v] of n.entries) {
|
|
98
|
+
count += k.length;
|
|
99
|
+
walk(v);
|
|
100
|
+
}
|
|
101
|
+
if (count > 500000) fail();
|
|
102
|
+
}
|
|
103
|
+
walk(node);
|
|
104
|
+
}
|
|
105
|
+
export async function eventDigest(node: CapturedNode): Promise<string> {
|
|
106
|
+
try {
|
|
107
|
+
const tuple: CapturedNode = {
|
|
108
|
+
kind: "array",
|
|
109
|
+
entries: [
|
|
110
|
+
["0", scalarNode("betterstripe-renewal-binding")],
|
|
111
|
+
["1", scalarNode(2)],
|
|
112
|
+
["2", scalarNode("unbound-qualification-event")],
|
|
113
|
+
["3", node],
|
|
114
|
+
],
|
|
115
|
+
};
|
|
116
|
+
rawBound(tuple);
|
|
117
|
+
const bytes = new TextEncoder().encode(encode(tuple)),
|
|
118
|
+
subtle = globalThis.crypto?.subtle;
|
|
119
|
+
if (!subtle || typeof subtle.digest !== "function") fail();
|
|
120
|
+
const result = await subtle.digest("SHA-256", bytes);
|
|
121
|
+
if (!(result instanceof ArrayBuffer) || result.byteLength !== 32) fail();
|
|
122
|
+
return (
|
|
123
|
+
"unbound-qualification-event:v2:sha256:" +
|
|
124
|
+
Array.from(new Uint8Array(result), (v) =>
|
|
125
|
+
v.toString(16).padStart(2, "0"),
|
|
126
|
+
).join("")
|
|
127
|
+
);
|
|
128
|
+
} catch {
|
|
129
|
+
fail();
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import type { EventRecord } from "./ownData.js";
|
|
2
|
+
import "./test-fixtures/semanticSetup.js";
|
|
3
|
+
import { it as test } from "vitest";
|
|
4
|
+
import assert from "node:assert/strict";
|
|
5
|
+
const { fixture, copy, wire, sdk } =
|
|
6
|
+
await import("./test-fixtures/fixture.mjs");
|
|
7
|
+
const { createAttachEventCompiler, createConfigureEventCompiler } =
|
|
8
|
+
await import("./test-fixtures/compilerIndex.mjs");
|
|
9
|
+
const {
|
|
10
|
+
objectNode: O,
|
|
11
|
+
scalarNode: S,
|
|
12
|
+
eventDigest,
|
|
13
|
+
} = await import("./eventCodec.js");
|
|
14
|
+
const delivery = () => {
|
|
15
|
+
const records: EventRecord[] = [];
|
|
16
|
+
return {
|
|
17
|
+
records,
|
|
18
|
+
options: {
|
|
19
|
+
timeoutMs: 5000,
|
|
20
|
+
send: async (r: EventRecord, ack: (value: unknown) => void) => {
|
|
21
|
+
records.push(r);
|
|
22
|
+
ack({ sequence: r.sequence, binding: r.binding });
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
test("fully coherent C9 for another body cannot substitute retained same response", async () => {
|
|
28
|
+
const f = await fixture(),
|
|
29
|
+
d = delivery(),
|
|
30
|
+
c = createConfigureEventCompiler(f.sourceConfigure, d.options);
|
|
31
|
+
await c.dispatch({
|
|
32
|
+
event: "dispatch",
|
|
33
|
+
stage: "configure",
|
|
34
|
+
request: f.configure,
|
|
35
|
+
});
|
|
36
|
+
await c.response({
|
|
37
|
+
event: "response",
|
|
38
|
+
stage: "configure",
|
|
39
|
+
request: f.configure,
|
|
40
|
+
body: f.s.configuredBody,
|
|
41
|
+
transport: f.transport,
|
|
42
|
+
});
|
|
43
|
+
const other = copy(f.s.configuredBody);
|
|
44
|
+
other.metadata.c10_full_forgery = "ordinary";
|
|
45
|
+
const forged = await sdk.constructRenewalConfigurationReceiptV2({
|
|
46
|
+
configuration: f.sourceConfigure,
|
|
47
|
+
actualDispatch: wire(f.configure),
|
|
48
|
+
providerSnapshot: other,
|
|
49
|
+
transport: f.transport,
|
|
50
|
+
});
|
|
51
|
+
await assert.rejects(
|
|
52
|
+
c.receipt({
|
|
53
|
+
event: "receipt",
|
|
54
|
+
stage: "configure",
|
|
55
|
+
request: f.configure,
|
|
56
|
+
receipt: forged,
|
|
57
|
+
}),
|
|
58
|
+
/C10_SOURCE_STOP/,
|
|
59
|
+
);
|
|
60
|
+
assert.equal(d.records.length, 2);
|
|
61
|
+
});
|
|
62
|
+
test("complete C6 status profile and providerQualification compared beyond C6 preimage", async () => {
|
|
63
|
+
const f = await fixture();
|
|
64
|
+
for (const kind of ["status", "profile", "qualification"]) {
|
|
65
|
+
const d = delivery(),
|
|
66
|
+
c = createConfigureEventCompiler(f.sourceConfigure, d.options),
|
|
67
|
+
request = copy(f.configure);
|
|
68
|
+
if (kind === "status") request.status = "forged";
|
|
69
|
+
if (kind === "profile") request.profile.billingMode = "classic";
|
|
70
|
+
if (kind === "qualification") request.providerQualification = "qualified";
|
|
71
|
+
await assert.rejects(
|
|
72
|
+
c.dispatch({ event: "dispatch", stage: "configure", request }),
|
|
73
|
+
/C10_SOURCE_STOP/,
|
|
74
|
+
);
|
|
75
|
+
assert.equal(d.records.length, 0, kind);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
test("live source Proxy get trap is never used for selected own-data values", async () => {
|
|
79
|
+
const f = await fixture(),
|
|
80
|
+
d = delivery();
|
|
81
|
+
let gets = 0;
|
|
82
|
+
const raw = new Proxy(copy(f.sourceAttach), {
|
|
83
|
+
get() {
|
|
84
|
+
gets++;
|
|
85
|
+
throw Error("GET_TRAP");
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
const c = createAttachEventCompiler(raw, d.options);
|
|
89
|
+
await c.dispatch({ event: "dispatch", stage: "attach", request: f.request });
|
|
90
|
+
assert.equal(gets, 0);
|
|
91
|
+
assert.equal(d.records.length, 1);
|
|
92
|
+
});
|
|
93
|
+
test("response credential text stops before C10 hash or send", async () => {
|
|
94
|
+
const f = await fixture(),
|
|
95
|
+
d = delivery(),
|
|
96
|
+
c = createAttachEventCompiler(f.sourceAttach, d.options);
|
|
97
|
+
await c.dispatch({ event: "dispatch", stage: "attach", request: f.request });
|
|
98
|
+
const body = copy(f.s.attach.providerSnapshot);
|
|
99
|
+
body.extra = "sk_test_SYNTHETIC";
|
|
100
|
+
let hashes = 0;
|
|
101
|
+
const original = globalThis.crypto.subtle.digest;
|
|
102
|
+
globalThis.crypto.subtle.digest = function (...a) {
|
|
103
|
+
hashes++;
|
|
104
|
+
return original.apply(this, a);
|
|
105
|
+
};
|
|
106
|
+
try {
|
|
107
|
+
await assert.rejects(
|
|
108
|
+
c.response({
|
|
109
|
+
event: "response",
|
|
110
|
+
stage: "attach",
|
|
111
|
+
request: f.request,
|
|
112
|
+
body,
|
|
113
|
+
status: 200,
|
|
114
|
+
}),
|
|
115
|
+
/C10_SOURCE_STOP/,
|
|
116
|
+
);
|
|
117
|
+
assert.equal(hashes, 0);
|
|
118
|
+
assert.equal(d.records.length, 1);
|
|
119
|
+
} finally {
|
|
120
|
+
globalThis.crypto.subtle.digest = original;
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
test("stage channels explicitly each start1 and do not establish combined lineage", async () => {
|
|
124
|
+
const f = await fixture(),
|
|
125
|
+
a = delivery(),
|
|
126
|
+
b = delivery(),
|
|
127
|
+
ca = createAttachEventCompiler(f.sourceAttach, a.options),
|
|
128
|
+
cb = createConfigureEventCompiler(f.sourceConfigure, b.options);
|
|
129
|
+
await ca.dispatch({ event: "dispatch", stage: "attach", request: f.request });
|
|
130
|
+
await cb.dispatch({
|
|
131
|
+
event: "dispatch",
|
|
132
|
+
stage: "configure",
|
|
133
|
+
request: f.configure,
|
|
134
|
+
});
|
|
135
|
+
assert.equal(ca.stageChannel, "attach");
|
|
136
|
+
assert.equal(cb.stageChannel, "configure");
|
|
137
|
+
assert.equal(ca.combinedProducerLineageEstablished, false);
|
|
138
|
+
assert.equal(cb.combinedProducerLineageEstablished, false);
|
|
139
|
+
assert.equal(a.records[0].sequence, 1);
|
|
140
|
+
assert.equal(b.records[0].sequence, 1);
|
|
141
|
+
assert.throws(
|
|
142
|
+
() =>
|
|
143
|
+
createAttachEventCompiler(f.sourceAttach, {
|
|
144
|
+
...a.options,
|
|
145
|
+
startSequence: 9,
|
|
146
|
+
}),
|
|
147
|
+
/C10_SOURCE_STOP/,
|
|
148
|
+
);
|
|
149
|
+
});
|
|
150
|
+
test("codec raw array-index character budget independently enforced before hash", async () => {
|
|
151
|
+
const array = Object.freeze({
|
|
152
|
+
kind: "array" as const,
|
|
153
|
+
entries: Object.freeze(
|
|
154
|
+
Array.from({ length: 7500 }, (_, i) =>
|
|
155
|
+
Object.freeze([String(i), S(0)] as const),
|
|
156
|
+
),
|
|
157
|
+
),
|
|
158
|
+
});
|
|
159
|
+
const node = O([
|
|
160
|
+
["text", S("x".repeat(480000))],
|
|
161
|
+
["items", array],
|
|
162
|
+
]);
|
|
163
|
+
let hashes = 0;
|
|
164
|
+
const original = globalThis.crypto.subtle.digest;
|
|
165
|
+
globalThis.crypto.subtle.digest = function (...a) {
|
|
166
|
+
hashes++;
|
|
167
|
+
return original.apply(this, a);
|
|
168
|
+
};
|
|
169
|
+
try {
|
|
170
|
+
await assert.rejects(eventDigest(node), /C10_SOURCE_STOP/);
|
|
171
|
+
assert.equal(hashes, 0);
|
|
172
|
+
} finally {
|
|
173
|
+
globalThis.crypto.subtle.digest = original;
|
|
174
|
+
}
|
|
175
|
+
});
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { EventRecord } from "./ownData.js";
|
|
2
|
+
import "./test-fixtures/semanticSetup.js";
|
|
3
|
+
import { it as test } from "vitest";
|
|
4
|
+
import assert from "node:assert/strict";
|
|
5
|
+
import {
|
|
6
|
+
createAttachEventCompiler,
|
|
7
|
+
createConfigureEventCompiler,
|
|
8
|
+
} from "./test-fixtures/compilerIndex.mjs";
|
|
9
|
+
import * as sdk from "./publicApi.js";
|
|
10
|
+
import * as material from "./test-fixtures/frozen/f12.mjs";
|
|
11
|
+
import {
|
|
12
|
+
copy,
|
|
13
|
+
wire,
|
|
14
|
+
configureCase,
|
|
15
|
+
expectedPrepared,
|
|
16
|
+
binding,
|
|
17
|
+
} from "./test-fixtures/publishedRawkeyHelper.mjs";
|
|
18
|
+
// NEW raw facts are declared by configureCase before constructing any child. No provider observed.
|
|
19
|
+
test("0881 six C10 events and both classifier stages rebuild the same complete raw children", async () => {
|
|
20
|
+
const x = configureCase(),
|
|
21
|
+
sourceConfigure = copy(x.configuration),
|
|
22
|
+
sourceAttach = copy(sourceConfigure.attachReceipt.attachRequest);
|
|
23
|
+
const prepared = await sdk.prepareRenewalPriceReplacementV2(
|
|
24
|
+
copy(sourceAttach.preparation),
|
|
25
|
+
);
|
|
26
|
+
assert.deepEqual(prepared, expectedPrepared(sourceAttach.preparation));
|
|
27
|
+
const request = await sdk.prepareRenewalScheduleAttachmentV2({
|
|
28
|
+
prepared,
|
|
29
|
+
apiVersion: sourceAttach.apiVersion,
|
|
30
|
+
attachKey: sourceAttach.attachKey,
|
|
31
|
+
firstDispatchedAt: sourceAttach.firstDispatchedAt,
|
|
32
|
+
});
|
|
33
|
+
const attach = await sdk.constructRenewalScheduleAttachmentReceiptV2(
|
|
34
|
+
copy(sourceConfigure.attachReceipt),
|
|
35
|
+
);
|
|
36
|
+
const configure = await sdk.projectRenewalConfigurationV2(
|
|
37
|
+
copy(sourceConfigure),
|
|
38
|
+
);
|
|
39
|
+
assert.equal(configure.status, "projected_configure_request");
|
|
40
|
+
// Identity-valid unchanged baseline response deliberately makes no configuration-application claim.
|
|
41
|
+
const responseBody = copy(sourceConfigure.schedule),
|
|
42
|
+
transport = { status: 200, requestId: "req_SYNTHETIC_ADOPTION" };
|
|
43
|
+
const stored = await sdk.constructRenewalConfigurationReceiptV2({
|
|
44
|
+
configuration: copy(sourceConfigure),
|
|
45
|
+
actualDispatch: wire(configure),
|
|
46
|
+
providerSnapshot: responseBody,
|
|
47
|
+
transport,
|
|
48
|
+
});
|
|
49
|
+
const a = await material.classifyRetainedAttachmentV2({
|
|
50
|
+
attachRequest: copy(sourceAttach),
|
|
51
|
+
intent: "initial",
|
|
52
|
+
}),
|
|
53
|
+
c = await material.classifyFreshConfigurationV2(copy(x));
|
|
54
|
+
assert.equal(a.status, "classified");
|
|
55
|
+
assert.equal(c.status, "classified");
|
|
56
|
+
assert.deepEqual(a.material.originalPrepared, prepared);
|
|
57
|
+
assert.deepEqual(c.material.originalPrepared, prepared);
|
|
58
|
+
assert.deepEqual(a.material.completeRequest, request);
|
|
59
|
+
assert.deepEqual(c.material.completeRequest, configure);
|
|
60
|
+
assert.deepEqual(c.material.stageEvidence.acknowledgedAttachReceipt, attach);
|
|
61
|
+
for (const stage of ["attach", "configure"] as const) {
|
|
62
|
+
const records: EventRecord[] = [],
|
|
63
|
+
opts = {
|
|
64
|
+
timeoutMs: 5000,
|
|
65
|
+
send: async (r: EventRecord, ack: (value: unknown) => void) => {
|
|
66
|
+
records.push(r);
|
|
67
|
+
ack({ sequence: r.sequence, binding: r.binding });
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
const compiler =
|
|
71
|
+
stage === "attach"
|
|
72
|
+
? createAttachEventCompiler(sourceAttach, opts)
|
|
73
|
+
: createConfigureEventCompiler(sourceConfigure, opts);
|
|
74
|
+
const events =
|
|
75
|
+
stage === "attach"
|
|
76
|
+
? [
|
|
77
|
+
{ event: "dispatch", stage, request },
|
|
78
|
+
{
|
|
79
|
+
event: "response",
|
|
80
|
+
stage,
|
|
81
|
+
request,
|
|
82
|
+
body: copy(sourceConfigure.attachReceipt.providerSnapshot),
|
|
83
|
+
status: 200,
|
|
84
|
+
},
|
|
85
|
+
{ event: "receipt", stage, request, receipt: attach },
|
|
86
|
+
]
|
|
87
|
+
: [
|
|
88
|
+
{ event: "dispatch", stage, request: configure },
|
|
89
|
+
{
|
|
90
|
+
event: "response",
|
|
91
|
+
stage,
|
|
92
|
+
request: configure,
|
|
93
|
+
body: responseBody,
|
|
94
|
+
transport,
|
|
95
|
+
},
|
|
96
|
+
{ event: "receipt", stage, request: configure, receipt: stored },
|
|
97
|
+
];
|
|
98
|
+
const expected = copy(events);
|
|
99
|
+
for (const event of events)
|
|
100
|
+
await compiler[event.event as "dispatch" | "response" | "receipt"](event);
|
|
101
|
+
assert.equal(records.length, 3);
|
|
102
|
+
for (const [i, r] of records.entries()) {
|
|
103
|
+
assert.equal(r.sequence, i + 1);
|
|
104
|
+
assert.deepEqual(r.data, expected[i]);
|
|
105
|
+
assert.equal(
|
|
106
|
+
r.binding,
|
|
107
|
+
binding("unbound-qualification-event", {
|
|
108
|
+
sequence: i + 1,
|
|
109
|
+
data: expected[i],
|
|
110
|
+
}),
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
});
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { CapturedNode } from "./eventCodec.js";
|
|
2
|
+
export function stop(): never {
|
|
3
|
+
throw Error("C10_SOURCE_STOP");
|
|
4
|
+
}
|
|
5
|
+
export function need(x: unknown): asserts x {
|
|
6
|
+
if (!x) stop();
|
|
7
|
+
}
|
|
8
|
+
export function freeze<T>(x: T): T {
|
|
9
|
+
if (x && typeof x === "object") {
|
|
10
|
+
for (const v of Object.values(x)) freeze(v);
|
|
11
|
+
Object.freeze(x);
|
|
12
|
+
}
|
|
13
|
+
return x;
|
|
14
|
+
}
|
|
15
|
+
export function closed(
|
|
16
|
+
raw: unknown,
|
|
17
|
+
required: readonly string[],
|
|
18
|
+
optional: readonly string[] = [],
|
|
19
|
+
): Record<string, unknown> {
|
|
20
|
+
need(raw && typeof raw === "object" && !Array.isArray(raw));
|
|
21
|
+
const p = Object.getPrototypeOf(raw);
|
|
22
|
+
need(p === Object.prototype || p === null);
|
|
23
|
+
const keys = Reflect.ownKeys(raw);
|
|
24
|
+
need(
|
|
25
|
+
keys.every(
|
|
26
|
+
(k) =>
|
|
27
|
+
typeof k === "string" && (required.includes(k) || optional.includes(k)),
|
|
28
|
+
) && required.every((k) => keys.includes(k)),
|
|
29
|
+
);
|
|
30
|
+
const out = Object.create(null) as Record<string, unknown>;
|
|
31
|
+
for (const k of keys) {
|
|
32
|
+
need(typeof k === "string");
|
|
33
|
+
const d = Object.getOwnPropertyDescriptor(raw, k);
|
|
34
|
+
need(d && d.enumerable && Object.prototype.hasOwnProperty.call(d, "value"));
|
|
35
|
+
out[k] = d.value;
|
|
36
|
+
}
|
|
37
|
+
return out;
|
|
38
|
+
}
|
|
39
|
+
export function equalNodes(a: CapturedNode, b: CapturedNode): boolean {
|
|
40
|
+
if (a.kind !== b.kind) return false;
|
|
41
|
+
if (a.kind === "scalar") return b.kind === "scalar" && a.value === b.value;
|
|
42
|
+
if (b.kind === "scalar" || a.entries.length !== b.entries.length)
|
|
43
|
+
return false;
|
|
44
|
+
const other = new Map(b.entries);
|
|
45
|
+
return a.entries.every(
|
|
46
|
+
([k, v]) => other.has(k) && equalNodes(v, other.get(k)!),
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
export function field(node: CapturedNode, key: string): CapturedNode {
|
|
50
|
+
need(node.kind === "object");
|
|
51
|
+
const pair = node.entries.find(([k]) => k === key);
|
|
52
|
+
need(pair);
|
|
53
|
+
return pair[1];
|
|
54
|
+
}
|
|
55
|
+
export function scalar(node: CapturedNode): unknown {
|
|
56
|
+
need(node.kind === "scalar");
|
|
57
|
+
return node.value;
|
|
58
|
+
}
|
|
59
|
+
export interface EventRecord {
|
|
60
|
+
readonly sequence: number;
|
|
61
|
+
readonly binding: string;
|
|
62
|
+
readonly data: unknown;
|
|
63
|
+
}
|
|
64
|
+
export interface AppendOptions {
|
|
65
|
+
readonly timeoutMs: number;
|
|
66
|
+
readonly send: (
|
|
67
|
+
record: Readonly<EventRecord>,
|
|
68
|
+
ack: (value: unknown) => void,
|
|
69
|
+
) => unknown;
|
|
70
|
+
}
|
|
71
|
+
export function options(raw: unknown): AppendOptions {
|
|
72
|
+
try {
|
|
73
|
+
const x = closed(raw, ["send", "timeoutMs"]);
|
|
74
|
+
need(
|
|
75
|
+
typeof x.send === "function" &&
|
|
76
|
+
typeof x.timeoutMs === "number" &&
|
|
77
|
+
Number.isSafeInteger(x.timeoutMs) &&
|
|
78
|
+
x.timeoutMs >= 1 &&
|
|
79
|
+
x.timeoutMs <= 5000,
|
|
80
|
+
);
|
|
81
|
+
return x as unknown as AppendOptions;
|
|
82
|
+
} catch {
|
|
83
|
+
stop();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
type Wire = {
|
|
87
|
+
scope: string;
|
|
88
|
+
apiVersion: string;
|
|
89
|
+
method: string;
|
|
90
|
+
path: string;
|
|
91
|
+
payload: unknown;
|
|
92
|
+
key: string;
|
|
93
|
+
firstDispatchedAt: number;
|
|
94
|
+
};
|
|
95
|
+
export const sevenWire = <T extends Wire>(r: T): Pick<T, keyof Wire> => ({
|
|
96
|
+
scope: r.scope,
|
|
97
|
+
apiVersion: r.apiVersion,
|
|
98
|
+
method: r.method,
|
|
99
|
+
path: r.path,
|
|
100
|
+
payload: r.payload,
|
|
101
|
+
key: r.key,
|
|
102
|
+
firstDispatchedAt: r.firstDispatchedAt,
|
|
103
|
+
});
|