@chipmobilesdk/rn-ads 0.6.0 → 0.8.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 +139 -0
- package/README.md +4 -2
- package/lib/commonjs/config/resolveAdUnit.js +80 -0
- package/lib/commonjs/config/resolveAdUnit.js.map +1 -0
- package/lib/commonjs/config/types.js +138 -0
- package/lib/commonjs/config/types.js.map +1 -0
- package/lib/commonjs/config/validate.js +150 -0
- package/lib/commonjs/config/validate.js.map +1 -0
- package/lib/commonjs/core/adOriginatedReturn.js +119 -0
- package/lib/commonjs/core/adOriginatedReturn.js.map +1 -0
- package/lib/commonjs/core/adsInstance.js +129 -0
- package/lib/commonjs/core/adsInstance.js.map +1 -0
- package/lib/commonjs/core/consentFlow.js +154 -0
- package/lib/commonjs/core/consentFlow.js.map +1 -0
- package/lib/commonjs/core/enablement.js +64 -0
- package/lib/commonjs/core/enablement.js.map +1 -0
- package/lib/commonjs/core/fullScreenLock.js +48 -0
- package/lib/commonjs/core/fullScreenLock.js.map +1 -0
- package/lib/commonjs/core/gates.js +95 -0
- package/lib/commonjs/core/gates.js.map +1 -0
- package/lib/commonjs/core/initMachine.js +159 -0
- package/lib/commonjs/core/initMachine.js.map +1 -0
- package/lib/commonjs/core/instance/consent.js +155 -0
- package/lib/commonjs/core/instance/consent.js.map +1 -0
- package/lib/commonjs/core/instance/context.js +217 -0
- package/lib/commonjs/core/instance/context.js.map +1 -0
- package/lib/commonjs/core/instance/gate.js +194 -0
- package/lib/commonjs/core/instance/gate.js.map +1 -0
- package/lib/commonjs/core/instance/init.js +326 -0
- package/lib/commonjs/core/instance/init.js.map +1 -0
- package/lib/commonjs/core/instance/internals.js +115 -0
- package/lib/commonjs/core/instance/internals.js.map +1 -0
- package/lib/commonjs/core/instance/load.js +458 -0
- package/lib/commonjs/core/instance/load.js.map +1 -0
- package/lib/commonjs/core/instance/show.js +243 -0
- package/lib/commonjs/core/instance/show.js.map +1 -0
- package/lib/commonjs/core/instance/types.js +6 -0
- package/lib/commonjs/core/instance/types.js.map +1 -0
- package/lib/commonjs/core/placementMachine.js +116 -0
- package/lib/commonjs/core/placementMachine.js.map +1 -0
- package/lib/commonjs/core/privacyGate.js +93 -0
- package/lib/commonjs/core/privacyGate.js.map +1 -0
- package/lib/commonjs/core/requestThrottle.js +152 -0
- package/lib/commonjs/core/requestThrottle.js.map +1 -0
- package/lib/commonjs/core/retryPolicy.js +120 -0
- package/lib/commonjs/core/retryPolicy.js.map +1 -0
- package/lib/commonjs/core/rewardedSession.js +65 -0
- package/lib/commonjs/core/rewardedSession.js.map +1 -0
- package/lib/commonjs/core/timers.js +162 -0
- package/lib/commonjs/core/timers.js.map +1 -0
- package/lib/commonjs/diagnostics/correlation.js +33 -0
- package/lib/commonjs/diagnostics/correlation.js.map +1 -0
- package/lib/commonjs/diagnostics/errors.js +152 -0
- package/lib/commonjs/diagnostics/errors.js.map +1 -0
- package/lib/commonjs/diagnostics/events.js +132 -0
- package/lib/commonjs/diagnostics/events.js.map +1 -0
- package/lib/commonjs/engine/admobBanner.js +58 -0
- package/lib/commonjs/engine/admobBanner.js.map +1 -0
- package/lib/commonjs/engine/admobEngine.js +343 -0
- package/lib/commonjs/engine/admobEngine.js.map +1 -0
- package/lib/commonjs/engine/admobErrors.js +45 -0
- package/lib/commonjs/engine/admobErrors.js.map +1 -0
- package/lib/commonjs/engine/port.js +6 -0
- package/lib/commonjs/engine/port.js.map +1 -0
- package/lib/commonjs/engine/testAdUnits.js +61 -0
- package/lib/commonjs/engine/testAdUnits.js.map +1 -0
- package/lib/commonjs/index.js +218 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/react/AdsBanner.js +317 -0
- package/lib/commonjs/react/AdsBanner.js.map +1 -0
- package/lib/commonjs/react/AdsProvider.js +54 -0
- package/lib/commonjs/react/AdsProvider.js.map +1 -0
- package/lib/commonjs/react/hooks.js +63 -0
- package/lib/commonjs/react/hooks.js.map +1 -0
- package/lib/commonjs/testing/clock.js +76 -0
- package/lib/commonjs/testing/clock.js.map +1 -0
- package/lib/commonjs/testing/conformance.js +99 -0
- package/lib/commonjs/testing/conformance.js.map +1 -0
- package/lib/commonjs/testing/index.js +389 -0
- package/lib/commonjs/testing/index.js.map +1 -0
- package/lib/module/config/resolveAdUnit.js +75 -0
- package/lib/module/config/resolveAdUnit.js.map +1 -0
- package/lib/module/config/types.js +134 -0
- package/lib/module/config/types.js.map +1 -0
- package/lib/module/config/validate.js +146 -0
- package/lib/module/config/validate.js.map +1 -0
- package/lib/module/core/adOriginatedReturn.js +115 -0
- package/lib/module/core/adOriginatedReturn.js.map +1 -0
- package/lib/module/core/adsInstance.js +121 -0
- package/lib/module/core/adsInstance.js.map +1 -0
- package/lib/module/core/consentFlow.js +143 -0
- package/lib/module/core/consentFlow.js.map +1 -0
- package/lib/module/core/enablement.js +58 -0
- package/lib/module/core/enablement.js.map +1 -0
- package/lib/module/core/fullScreenLock.js +44 -0
- package/lib/module/core/fullScreenLock.js.map +1 -0
- package/lib/module/core/gates.js +91 -0
- package/lib/module/core/gates.js.map +1 -0
- package/lib/module/core/initMachine.js +152 -0
- package/lib/module/core/initMachine.js.map +1 -0
- package/lib/module/core/instance/consent.js +151 -0
- package/lib/module/core/instance/consent.js.map +1 -0
- package/lib/module/core/instance/context.js +212 -0
- package/lib/module/core/instance/context.js.map +1 -0
- package/lib/module/core/instance/gate.js +183 -0
- package/lib/module/core/instance/gate.js.map +1 -0
- package/lib/module/core/instance/init.js +321 -0
- package/lib/module/core/instance/init.js.map +1 -0
- package/lib/module/core/instance/internals.js +109 -0
- package/lib/module/core/instance/internals.js.map +1 -0
- package/lib/module/core/instance/load.js +452 -0
- package/lib/module/core/instance/load.js.map +1 -0
- package/lib/module/core/instance/show.js +238 -0
- package/lib/module/core/instance/show.js.map +1 -0
- package/lib/module/core/instance/types.js +4 -0
- package/lib/module/core/instance/types.js.map +1 -0
- package/lib/module/core/placementMachine.js +109 -0
- package/lib/module/core/placementMachine.js.map +1 -0
- package/lib/module/core/privacyGate.js +86 -0
- package/lib/module/core/privacyGate.js.map +1 -0
- package/lib/module/core/requestThrottle.js +146 -0
- package/lib/module/core/requestThrottle.js.map +1 -0
- package/lib/module/core/retryPolicy.js +113 -0
- package/lib/module/core/retryPolicy.js.map +1 -0
- package/lib/module/core/rewardedSession.js +61 -0
- package/lib/module/core/rewardedSession.js.map +1 -0
- package/lib/module/core/timers.js +150 -0
- package/lib/module/core/timers.js.map +1 -0
- package/lib/module/diagnostics/correlation.js +29 -0
- package/lib/module/diagnostics/correlation.js.map +1 -0
- package/lib/module/diagnostics/errors.js +143 -0
- package/lib/module/diagnostics/errors.js.map +1 -0
- package/lib/module/diagnostics/events.js +128 -0
- package/lib/module/diagnostics/events.js.map +1 -0
- package/lib/module/engine/admobBanner.js +52 -0
- package/lib/module/engine/admobBanner.js.map +1 -0
- package/lib/module/engine/admobEngine.js +334 -0
- package/lib/module/engine/admobEngine.js.map +1 -0
- package/lib/module/engine/admobErrors.js +41 -0
- package/lib/module/engine/admobErrors.js.map +1 -0
- package/lib/module/engine/port.js +4 -0
- package/lib/module/engine/port.js.map +1 -0
- package/lib/module/engine/testAdUnits.js +56 -0
- package/lib/module/engine/testAdUnits.js.map +1 -0
- package/lib/module/index.js +59 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/react/AdsBanner.js +312 -0
- package/lib/module/react/AdsBanner.js.map +1 -0
- package/lib/module/react/AdsProvider.js +48 -0
- package/lib/module/react/AdsProvider.js.map +1 -0
- package/lib/module/react/hooks.js +58 -0
- package/lib/module/react/hooks.js.map +1 -0
- package/lib/module/testing/clock.js +72 -0
- package/lib/module/testing/clock.js.map +1 -0
- package/lib/module/testing/conformance.js +93 -0
- package/lib/module/testing/conformance.js.map +1 -0
- package/lib/module/testing/index.js +366 -0
- package/lib/module/testing/index.js.map +1 -0
- package/lib/typescript/commonjs/config/resolveAdUnit.d.ts +43 -0
- package/lib/typescript/commonjs/config/resolveAdUnit.d.ts.map +1 -0
- package/lib/typescript/commonjs/config/types.d.ts +280 -0
- package/lib/typescript/commonjs/config/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/config/validate.d.ts +49 -0
- package/lib/typescript/commonjs/config/validate.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/adOriginatedReturn.d.ts +61 -0
- package/lib/typescript/commonjs/core/adOriginatedReturn.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/adsInstance.d.ts +33 -0
- package/lib/typescript/commonjs/core/adsInstance.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/consentFlow.d.ts +84 -0
- package/lib/typescript/commonjs/core/consentFlow.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/enablement.d.ts +74 -0
- package/lib/typescript/commonjs/core/enablement.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/fullScreenLock.d.ts +25 -0
- package/lib/typescript/commonjs/core/fullScreenLock.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/gates.d.ts +76 -0
- package/lib/typescript/commonjs/core/gates.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/initMachine.d.ts +66 -0
- package/lib/typescript/commonjs/core/initMachine.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/instance/consent.d.ts +4 -0
- package/lib/typescript/commonjs/core/instance/consent.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/instance/context.d.ts +118 -0
- package/lib/typescript/commonjs/core/instance/context.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/instance/gate.d.ts +38 -0
- package/lib/typescript/commonjs/core/instance/gate.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/instance/init.d.ts +13 -0
- package/lib/typescript/commonjs/core/instance/init.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/instance/internals.d.ts +60 -0
- package/lib/typescript/commonjs/core/instance/internals.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/instance/load.d.ts +9 -0
- package/lib/typescript/commonjs/core/instance/load.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/instance/show.d.ts +7 -0
- package/lib/typescript/commonjs/core/instance/show.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/instance/types.d.ts +240 -0
- package/lib/typescript/commonjs/core/instance/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/placementMachine.d.ts +55 -0
- package/lib/typescript/commonjs/core/placementMachine.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/privacyGate.d.ts +40 -0
- package/lib/typescript/commonjs/core/privacyGate.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/requestThrottle.d.ts +99 -0
- package/lib/typescript/commonjs/core/requestThrottle.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/retryPolicy.d.ts +66 -0
- package/lib/typescript/commonjs/core/retryPolicy.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/rewardedSession.d.ts +37 -0
- package/lib/typescript/commonjs/core/rewardedSession.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/timers.d.ts +135 -0
- package/lib/typescript/commonjs/core/timers.d.ts.map +1 -0
- package/lib/typescript/commonjs/diagnostics/correlation.d.ts +18 -0
- package/lib/typescript/commonjs/diagnostics/correlation.d.ts.map +1 -0
- package/lib/typescript/commonjs/diagnostics/errors.d.ts +59 -0
- package/lib/typescript/commonjs/diagnostics/errors.d.ts.map +1 -0
- package/lib/typescript/commonjs/diagnostics/events.d.ts +126 -0
- package/lib/typescript/commonjs/diagnostics/events.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/admobBanner.d.ts +10 -0
- package/lib/typescript/commonjs/engine/admobBanner.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/admobEngine.d.ts +71 -0
- package/lib/typescript/commonjs/engine/admobEngine.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/admobErrors.d.ts +9 -0
- package/lib/typescript/commonjs/engine/admobErrors.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/port.d.ts +171 -0
- package/lib/typescript/commonjs/engine/port.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/testAdUnits.d.ts +33 -0
- package/lib/typescript/commonjs/engine/testAdUnits.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +42 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/react/AdsBanner.d.ts +29 -0
- package/lib/typescript/commonjs/react/AdsBanner.d.ts.map +1 -0
- package/lib/typescript/commonjs/react/AdsProvider.d.ts +36 -0
- package/lib/typescript/commonjs/react/AdsProvider.d.ts.map +1 -0
- package/lib/typescript/commonjs/react/hooks.d.ts +27 -0
- package/lib/typescript/commonjs/react/hooks.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/clock.d.ts +29 -0
- package/lib/typescript/commonjs/testing/clock.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/conformance.d.ts +26 -0
- package/lib/typescript/commonjs/testing/conformance.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/index.d.ts +133 -0
- package/lib/typescript/commonjs/testing/index.d.ts.map +1 -0
- package/lib/typescript/module/config/resolveAdUnit.d.ts +43 -0
- package/lib/typescript/module/config/resolveAdUnit.d.ts.map +1 -0
- package/lib/typescript/module/config/types.d.ts +280 -0
- package/lib/typescript/module/config/types.d.ts.map +1 -0
- package/lib/typescript/module/config/validate.d.ts +49 -0
- package/lib/typescript/module/config/validate.d.ts.map +1 -0
- package/lib/typescript/module/core/adOriginatedReturn.d.ts +61 -0
- package/lib/typescript/module/core/adOriginatedReturn.d.ts.map +1 -0
- package/lib/typescript/module/core/adsInstance.d.ts +33 -0
- package/lib/typescript/module/core/adsInstance.d.ts.map +1 -0
- package/lib/typescript/module/core/consentFlow.d.ts +84 -0
- package/lib/typescript/module/core/consentFlow.d.ts.map +1 -0
- package/lib/typescript/module/core/enablement.d.ts +74 -0
- package/lib/typescript/module/core/enablement.d.ts.map +1 -0
- package/lib/typescript/module/core/fullScreenLock.d.ts +25 -0
- package/lib/typescript/module/core/fullScreenLock.d.ts.map +1 -0
- package/lib/typescript/module/core/gates.d.ts +76 -0
- package/lib/typescript/module/core/gates.d.ts.map +1 -0
- package/lib/typescript/module/core/initMachine.d.ts +66 -0
- package/lib/typescript/module/core/initMachine.d.ts.map +1 -0
- package/lib/typescript/module/core/instance/consent.d.ts +4 -0
- package/lib/typescript/module/core/instance/consent.d.ts.map +1 -0
- package/lib/typescript/module/core/instance/context.d.ts +118 -0
- package/lib/typescript/module/core/instance/context.d.ts.map +1 -0
- package/lib/typescript/module/core/instance/gate.d.ts +38 -0
- package/lib/typescript/module/core/instance/gate.d.ts.map +1 -0
- package/lib/typescript/module/core/instance/init.d.ts +13 -0
- package/lib/typescript/module/core/instance/init.d.ts.map +1 -0
- package/lib/typescript/module/core/instance/internals.d.ts +60 -0
- package/lib/typescript/module/core/instance/internals.d.ts.map +1 -0
- package/lib/typescript/module/core/instance/load.d.ts +9 -0
- package/lib/typescript/module/core/instance/load.d.ts.map +1 -0
- package/lib/typescript/module/core/instance/show.d.ts +7 -0
- package/lib/typescript/module/core/instance/show.d.ts.map +1 -0
- package/lib/typescript/module/core/instance/types.d.ts +240 -0
- package/lib/typescript/module/core/instance/types.d.ts.map +1 -0
- package/lib/typescript/module/core/placementMachine.d.ts +55 -0
- package/lib/typescript/module/core/placementMachine.d.ts.map +1 -0
- package/lib/typescript/module/core/privacyGate.d.ts +40 -0
- package/lib/typescript/module/core/privacyGate.d.ts.map +1 -0
- package/lib/typescript/module/core/requestThrottle.d.ts +99 -0
- package/lib/typescript/module/core/requestThrottle.d.ts.map +1 -0
- package/lib/typescript/module/core/retryPolicy.d.ts +66 -0
- package/lib/typescript/module/core/retryPolicy.d.ts.map +1 -0
- package/lib/typescript/module/core/rewardedSession.d.ts +37 -0
- package/lib/typescript/module/core/rewardedSession.d.ts.map +1 -0
- package/lib/typescript/module/core/timers.d.ts +135 -0
- package/lib/typescript/module/core/timers.d.ts.map +1 -0
- package/lib/typescript/module/diagnostics/correlation.d.ts +18 -0
- package/lib/typescript/module/diagnostics/correlation.d.ts.map +1 -0
- package/lib/typescript/module/diagnostics/errors.d.ts +59 -0
- package/lib/typescript/module/diagnostics/errors.d.ts.map +1 -0
- package/lib/typescript/module/diagnostics/events.d.ts +126 -0
- package/lib/typescript/module/diagnostics/events.d.ts.map +1 -0
- package/lib/typescript/module/engine/admobBanner.d.ts +10 -0
- package/lib/typescript/module/engine/admobBanner.d.ts.map +1 -0
- package/lib/typescript/module/engine/admobEngine.d.ts +71 -0
- package/lib/typescript/module/engine/admobEngine.d.ts.map +1 -0
- package/lib/typescript/module/engine/admobErrors.d.ts +9 -0
- package/lib/typescript/module/engine/admobErrors.d.ts.map +1 -0
- package/lib/typescript/module/engine/port.d.ts +171 -0
- package/lib/typescript/module/engine/port.d.ts.map +1 -0
- package/lib/typescript/module/engine/testAdUnits.d.ts +33 -0
- package/lib/typescript/module/engine/testAdUnits.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +42 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/react/AdsBanner.d.ts +29 -0
- package/lib/typescript/module/react/AdsBanner.d.ts.map +1 -0
- package/lib/typescript/module/react/AdsProvider.d.ts +36 -0
- package/lib/typescript/module/react/AdsProvider.d.ts.map +1 -0
- package/lib/typescript/module/react/hooks.d.ts +27 -0
- package/lib/typescript/module/react/hooks.d.ts.map +1 -0
- package/lib/typescript/module/testing/clock.d.ts +29 -0
- package/lib/typescript/module/testing/clock.d.ts.map +1 -0
- package/lib/typescript/module/testing/conformance.d.ts +26 -0
- package/lib/typescript/module/testing/conformance.d.ts.map +1 -0
- package/lib/typescript/module/testing/index.d.ts +133 -0
- package/lib/typescript/module/testing/index.d.ts.map +1 -0
- package/package.json +48 -12
- package/skills/sdk-rn-ads/SKILL.md +2 -1
- package/src/core/adsInstance.ts +72 -1829
- package/src/core/consentFlow.ts +1 -20
- package/src/core/instance/consent.ts +162 -0
- package/src/core/instance/context.ts +328 -0
- package/src/core/instance/gate.ts +147 -0
- package/src/core/instance/init.ts +262 -0
- package/src/core/instance/internals.ts +138 -0
- package/src/core/instance/load.ts +426 -0
- package/src/core/instance/show.ts +202 -0
- package/src/core/instance/types.ts +198 -0
- package/src/core/requestThrottle.ts +11 -17
- package/src/diagnostics/errors.ts +24 -5
- package/src/engine/admobBanner.tsx +55 -0
- package/src/engine/admobEngine.ts +21 -12
- package/src/engine/admobErrors.ts +44 -0
- package/src/engine/port.ts +46 -1
- package/src/engine/testAdUnits.ts +0 -5
- package/src/react/AdsBanner.tsx +81 -80
- package/src/testing/clock.ts +75 -0
- package/src/testing/index.ts +43 -68
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.FAKE_BANNER_TEST_ID = void 0;
|
|
7
|
+
Object.defineProperty(exports, "adsEngineChecks", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _conformance.adsEngineChecks;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
exports.allTestAdUnits = allTestAdUnits;
|
|
14
|
+
exports.createFakeAdsEngine = createFakeAdsEngine;
|
|
15
|
+
Object.defineProperty(exports, "createTestClock", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () {
|
|
18
|
+
return _clock.createTestClock;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(exports, "runAdsEngineConformance", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _conformance.runAdsEngineConformance;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
var _react = _interopRequireDefault(require("react"));
|
|
28
|
+
var _reactNative = require("react-native");
|
|
29
|
+
var _clock = require("./clock.js");
|
|
30
|
+
var _testAdUnits = require("../engine/testAdUnits.js");
|
|
31
|
+
var _conformance = require("./conformance.js");
|
|
32
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
33
|
+
/**
|
|
34
|
+
* Deterministic in-memory ads engine for tests (SC-012).
|
|
35
|
+
*
|
|
36
|
+
* This is a real implementation of the same `AdsEngine` port the AdMob adapter
|
|
37
|
+
* implements, not a parallel mock — so a contract change breaks it at compile
|
|
38
|
+
* time and it cannot drift. Nothing here touches a native module or a network.
|
|
39
|
+
*
|
|
40
|
+
* It exists to make the package's guarantees provable. The recorded call log is
|
|
41
|
+
* what SC-002 asserts against ("zero production identifiers reached the
|
|
42
|
+
* adapter") and what SC-003 asserts against ("zero calls before consent").
|
|
43
|
+
* Callback emission is fully caller-driven, which is what lets a test run the
|
|
44
|
+
* reward-before-dismiss and dismiss-before-reward orderings and demand the same
|
|
45
|
+
* outcome from both (SC-007).
|
|
46
|
+
*
|
|
47
|
+
* Exported from `@chipmobilesdk/rn-ads/testing`, never from the main entrypoint,
|
|
48
|
+
* so test doubles cannot reach a production bundle.
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* A privacy options form the test is holding open (0.4.0).
|
|
53
|
+
*
|
|
54
|
+
* Settle it whenever the test chooses, which is what lets `busy`, a second
|
|
55
|
+
* call, a consent update, and `dispose()` all be exercised *while* the form is
|
|
56
|
+
* on screen — in any order, rather than only the one a resolved promise allows.
|
|
57
|
+
*/
|
|
58
|
+
|
|
59
|
+
const DEFAULT_CONSENT = {
|
|
60
|
+
status: 'not_required',
|
|
61
|
+
canRequestAds: true,
|
|
62
|
+
isFormAvailable: false,
|
|
63
|
+
privacyOptions: 'not_required'
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Runs `task` on the next microtask, which is when a provider's callbacks would
|
|
67
|
+
* arrive. Written out because React Native's type declarations omit
|
|
68
|
+
* `queueMicrotask`, although Hermes has it.
|
|
69
|
+
*/
|
|
70
|
+
function nextMicrotask(task) {
|
|
71
|
+
Promise.resolve().then(task);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** The testID the fake banner renders under, for a test to find it by. */
|
|
75
|
+
const FAKE_BANNER_TEST_ID = exports.FAKE_BANNER_TEST_ID = 'ads-fake-banner';
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* The fake engine's banner component.
|
|
79
|
+
*
|
|
80
|
+
* It renders a host view carrying the props the package handed it, so a test
|
|
81
|
+
* can read them and call the callbacks: `getByTestId(FAKE_BANNER_TEST_ID)`.
|
|
82
|
+
* It used to render `null`, which left the props reachable only on the
|
|
83
|
+
* component instance — something `@testing-library/react-native` cannot see,
|
|
84
|
+
* since a host element is all a consumer's own tests can query.
|
|
85
|
+
*/
|
|
86
|
+
function FakeBanner(props) {
|
|
87
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
88
|
+
...props,
|
|
89
|
+
testID: FAKE_BANNER_TEST_ID
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
function createFakeAdsEngine(options = {}) {
|
|
93
|
+
const calls = [];
|
|
94
|
+
const consentCalls = [];
|
|
95
|
+
const clock = options.clock ?? (0, _clock.createTestClock)();
|
|
96
|
+
let consentInfo = {
|
|
97
|
+
...DEFAULT_CONSENT,
|
|
98
|
+
...options.consentInfo
|
|
99
|
+
};
|
|
100
|
+
let consentRequestFailure;
|
|
101
|
+
let consentFormFailure;
|
|
102
|
+
let privacyFormFailure;
|
|
103
|
+
let privacyFormResult = {};
|
|
104
|
+
let consentReadFailure;
|
|
105
|
+
/** Set by `holdPrivacyOptionsForm`; consumed by the next form. */
|
|
106
|
+
let heldForm = null;
|
|
107
|
+
const consent = {
|
|
108
|
+
async requestInfoUpdate(consentOptions) {
|
|
109
|
+
consentCalls.push({
|
|
110
|
+
kind: 'requestInfoUpdate',
|
|
111
|
+
options: consentOptions
|
|
112
|
+
});
|
|
113
|
+
if (consentRequestFailure !== undefined) {
|
|
114
|
+
throw consentRequestFailure;
|
|
115
|
+
}
|
|
116
|
+
return consentInfo;
|
|
117
|
+
},
|
|
118
|
+
async showFormIfRequired() {
|
|
119
|
+
consentCalls.push({
|
|
120
|
+
kind: 'showFormIfRequired'
|
|
121
|
+
});
|
|
122
|
+
if (consentFormFailure !== undefined) {
|
|
123
|
+
throw consentFormFailure;
|
|
124
|
+
}
|
|
125
|
+
// A presented form that the user completes moves the status on. The
|
|
126
|
+
// fake only does this when a form was actually required, mirroring the
|
|
127
|
+
// provider: showing nothing cannot change an answer.
|
|
128
|
+
// A region that required a form is one that requires a way back into
|
|
129
|
+
// it, which is what the provider reports once consent is obtained.
|
|
130
|
+
if (consentInfo.status === 'required' && consentInfo.isFormAvailable) {
|
|
131
|
+
consentInfo = {
|
|
132
|
+
status: 'obtained',
|
|
133
|
+
canRequestAds: true,
|
|
134
|
+
isFormAvailable: false,
|
|
135
|
+
privacyOptions: 'required'
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
return consentInfo;
|
|
139
|
+
},
|
|
140
|
+
async showPrivacyOptionsForm() {
|
|
141
|
+
consentCalls.push({
|
|
142
|
+
kind: 'showPrivacyOptionsForm'
|
|
143
|
+
});
|
|
144
|
+
const held = heldForm;
|
|
145
|
+
heldForm = null;
|
|
146
|
+
if (held) {
|
|
147
|
+
// Rejects if the test calls `fail`, which is exactly the provider's
|
|
148
|
+
// failure path; resolves with what the user left behind otherwise.
|
|
149
|
+
consentInfo = {
|
|
150
|
+
...consentInfo,
|
|
151
|
+
...(await held)
|
|
152
|
+
};
|
|
153
|
+
return consentInfo;
|
|
154
|
+
}
|
|
155
|
+
if (privacyFormFailure !== undefined) {
|
|
156
|
+
throw privacyFormFailure;
|
|
157
|
+
}
|
|
158
|
+
consentInfo = {
|
|
159
|
+
...consentInfo,
|
|
160
|
+
...privacyFormResult
|
|
161
|
+
};
|
|
162
|
+
return consentInfo;
|
|
163
|
+
},
|
|
164
|
+
async getInfo() {
|
|
165
|
+
consentCalls.push({
|
|
166
|
+
kind: 'getInfo'
|
|
167
|
+
});
|
|
168
|
+
if (consentReadFailure !== undefined) {
|
|
169
|
+
throw consentReadFailure;
|
|
170
|
+
}
|
|
171
|
+
return consentInfo;
|
|
172
|
+
},
|
|
173
|
+
reset() {
|
|
174
|
+
consentCalls.push({
|
|
175
|
+
kind: 'reset'
|
|
176
|
+
});
|
|
177
|
+
consentInfo = {
|
|
178
|
+
status: 'unknown',
|
|
179
|
+
canRequestAds: false,
|
|
180
|
+
isFormAvailable: true,
|
|
181
|
+
privacyOptions: 'unknown'
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
const listeners = new Map();
|
|
186
|
+
/** Callbacks queued before anyone subscribed; see `subscribe`. */
|
|
187
|
+
const pending = new Map();
|
|
188
|
+
const live = new Set();
|
|
189
|
+
let counter = 0;
|
|
190
|
+
function record(call) {
|
|
191
|
+
calls.push(call);
|
|
192
|
+
}
|
|
193
|
+
return {
|
|
194
|
+
calls,
|
|
195
|
+
consentCalls,
|
|
196
|
+
consent,
|
|
197
|
+
clock,
|
|
198
|
+
advance(ms) {
|
|
199
|
+
clock.advance(ms);
|
|
200
|
+
},
|
|
201
|
+
setConsentInfo(info) {
|
|
202
|
+
consentInfo = {
|
|
203
|
+
...consentInfo,
|
|
204
|
+
...info
|
|
205
|
+
};
|
|
206
|
+
},
|
|
207
|
+
failConsentRequest(cause = new Error('consent request failed')) {
|
|
208
|
+
consentRequestFailure = cause;
|
|
209
|
+
},
|
|
210
|
+
failConsentForm(cause = new Error('consent form failed')) {
|
|
211
|
+
consentFormFailure = cause;
|
|
212
|
+
},
|
|
213
|
+
setPrivacyOptionsFormResult(info) {
|
|
214
|
+
privacyFormResult = info;
|
|
215
|
+
},
|
|
216
|
+
failPrivacyOptionsForm(cause = new Error('privacy options form failed')) {
|
|
217
|
+
privacyFormFailure = cause;
|
|
218
|
+
},
|
|
219
|
+
holdPrivacyOptionsForm() {
|
|
220
|
+
let settle;
|
|
221
|
+
const promise = new Promise((resolve, reject) => {
|
|
222
|
+
settle = {
|
|
223
|
+
resolve,
|
|
224
|
+
reject
|
|
225
|
+
};
|
|
226
|
+
});
|
|
227
|
+
heldForm = promise;
|
|
228
|
+
return {
|
|
229
|
+
close(info = {}) {
|
|
230
|
+
settle.resolve(info);
|
|
231
|
+
},
|
|
232
|
+
fail(cause = new Error('privacy options form failed')) {
|
|
233
|
+
settle.reject(cause);
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
},
|
|
237
|
+
failConsentInfoRead(cause = new Error('consent information read failed')) {
|
|
238
|
+
consentReadFailure = cause;
|
|
239
|
+
},
|
|
240
|
+
isAvailable() {
|
|
241
|
+
return options.available !== false;
|
|
242
|
+
},
|
|
243
|
+
// Renders nothing. A test finds it in the tree by its `adUnitId` prop and
|
|
244
|
+
// calls `onLoaded`, `onFailed`, `onImpression` or `onClicked` itself, which
|
|
245
|
+
// is how a banner is driven without mocking a native module (ADS-12).
|
|
246
|
+
banner: {
|
|
247
|
+
isAvailable: () => options.available !== false,
|
|
248
|
+
Component: FakeBanner
|
|
249
|
+
},
|
|
250
|
+
async initialize(privacy) {
|
|
251
|
+
record({
|
|
252
|
+
kind: 'initialize',
|
|
253
|
+
privacy
|
|
254
|
+
});
|
|
255
|
+
if (options.failInitialize !== undefined) {
|
|
256
|
+
throw options.failInitialize;
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
async createFullScreen(format, adUnitId, request) {
|
|
260
|
+
counter += 1;
|
|
261
|
+
const id = `fake-${counter}`;
|
|
262
|
+
record({
|
|
263
|
+
kind: 'createFullScreen',
|
|
264
|
+
format,
|
|
265
|
+
adUnitId,
|
|
266
|
+
handleId: id,
|
|
267
|
+
request
|
|
268
|
+
});
|
|
269
|
+
live.add(id);
|
|
270
|
+
// A real provider delivers `loaded` to a listener attached after the
|
|
271
|
+
// ad object exists, so the callback is queued here and flushed when
|
|
272
|
+
// the caller subscribes. Emitting eagerly would race the caller's own
|
|
273
|
+
// subscribe and the event would be dropped — which is a property of
|
|
274
|
+
// this fake, not of the package, and would make the load look hung.
|
|
275
|
+
if (!options.neverCallBack) {
|
|
276
|
+
pending.set(id, {
|
|
277
|
+
type: 'loaded'
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
return {
|
|
281
|
+
id
|
|
282
|
+
};
|
|
283
|
+
},
|
|
284
|
+
async show(handle) {
|
|
285
|
+
record({
|
|
286
|
+
kind: 'show',
|
|
287
|
+
handleId: handle.id
|
|
288
|
+
});
|
|
289
|
+
if (options.failShow !== undefined) {
|
|
290
|
+
throw options.failShow;
|
|
291
|
+
}
|
|
292
|
+
if (!options.neverCallBack) {
|
|
293
|
+
// `show` is called with a listener already attached, so this one
|
|
294
|
+
// can go out directly on the next microtask.
|
|
295
|
+
nextMicrotask(() => {
|
|
296
|
+
for (const listener of Array.from(listeners.get(handle.id) ?? [])) {
|
|
297
|
+
listener({
|
|
298
|
+
type: 'opened'
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
subscribe(handle, listener) {
|
|
305
|
+
let set = listeners.get(handle.id);
|
|
306
|
+
if (!set) {
|
|
307
|
+
set = new Set();
|
|
308
|
+
listeners.set(handle.id, set);
|
|
309
|
+
}
|
|
310
|
+
set.add(listener);
|
|
311
|
+
// Flush whatever the provider would have delivered between creating
|
|
312
|
+
// the ad and this subscription.
|
|
313
|
+
const queued = pending.get(handle.id);
|
|
314
|
+
if (queued) {
|
|
315
|
+
pending.delete(handle.id);
|
|
316
|
+
nextMicrotask(() => {
|
|
317
|
+
for (const target of Array.from(listeners.get(handle.id) ?? [])) {
|
|
318
|
+
target(queued);
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
let active = true;
|
|
323
|
+
return () => {
|
|
324
|
+
if (!active) {
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
active = false;
|
|
328
|
+
set?.delete(listener);
|
|
329
|
+
if (set && set.size === 0) {
|
|
330
|
+
listeners.delete(handle.id);
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
},
|
|
334
|
+
dispose(handle) {
|
|
335
|
+
record({
|
|
336
|
+
kind: 'dispose',
|
|
337
|
+
handleId: handle.id
|
|
338
|
+
});
|
|
339
|
+
live.delete(handle.id);
|
|
340
|
+
listeners.delete(handle.id);
|
|
341
|
+
pending.delete(handle.id);
|
|
342
|
+
},
|
|
343
|
+
adUnitIds() {
|
|
344
|
+
return calls.filter(call => call.kind === 'createFullScreen').map(call => call.adUnitId);
|
|
345
|
+
},
|
|
346
|
+
liveHandles() {
|
|
347
|
+
return Array.from(live);
|
|
348
|
+
},
|
|
349
|
+
emit(handleId, event) {
|
|
350
|
+
for (const listener of Array.from(listeners.get(handleId) ?? [])) {
|
|
351
|
+
listener(event);
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
completeLoad(handleId) {
|
|
355
|
+
this.emit(handleId, {
|
|
356
|
+
type: 'loaded'
|
|
357
|
+
});
|
|
358
|
+
},
|
|
359
|
+
emitReward(handleId, reward = {
|
|
360
|
+
type: 'coins',
|
|
361
|
+
amount: 10
|
|
362
|
+
}) {
|
|
363
|
+
this.emit(handleId, {
|
|
364
|
+
type: 'rewarded',
|
|
365
|
+
reward
|
|
366
|
+
});
|
|
367
|
+
},
|
|
368
|
+
listenerCount() {
|
|
369
|
+
let total = 0;
|
|
370
|
+
for (const set of listeners.values()) {
|
|
371
|
+
total += set.size;
|
|
372
|
+
}
|
|
373
|
+
return total;
|
|
374
|
+
},
|
|
375
|
+
reset() {
|
|
376
|
+
calls.length = 0;
|
|
377
|
+
}
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
/** Google's official test ad unit for each format, as the package substitutes them (FR-011). */
|
|
381
|
+
function allTestAdUnits() {
|
|
382
|
+
return {
|
|
383
|
+
banner: (0, _testAdUnits.testAdUnitFor)('banner'),
|
|
384
|
+
interstitial: (0, _testAdUnits.testAdUnitFor)('interstitial'),
|
|
385
|
+
rewarded: (0, _testAdUnits.testAdUnitFor)('rewarded'),
|
|
386
|
+
app_open: (0, _testAdUnits.testAdUnitFor)('app_open')
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_clock","_testAdUnits","_conformance","e","__esModule","default","DEFAULT_CONSENT","status","canRequestAds","isFormAvailable","privacyOptions","nextMicrotask","task","Promise","resolve","then","FAKE_BANNER_TEST_ID","exports","FakeBanner","props","React","createElement","View","testID","createFakeAdsEngine","options","calls","consentCalls","clock","createTestClock","consentInfo","consentRequestFailure","consentFormFailure","privacyFormFailure","privacyFormResult","consentReadFailure","heldForm","consent","requestInfoUpdate","consentOptions","push","kind","undefined","showFormIfRequired","showPrivacyOptionsForm","held","getInfo","reset","listeners","Map","pending","live","Set","counter","record","call","advance","ms","setConsentInfo","info","failConsentRequest","cause","Error","failConsentForm","setPrivacyOptionsFormResult","failPrivacyOptionsForm","holdPrivacyOptionsForm","settle","promise","reject","close","fail","failConsentInfoRead","isAvailable","available","banner","Component","initialize","privacy","failInitialize","createFullScreen","format","adUnitId","request","id","handleId","add","neverCallBack","set","type","show","handle","failShow","listener","Array","from","get","subscribe","queued","delete","target","active","size","dispose","adUnitIds","filter","map","liveHandles","emit","event","completeLoad","emitReward","reward","amount","listenerCount","total","values","length","allTestAdUnits","testAdUnitFor","interstitial","rewarded","app_open"],"sourceRoot":"../../../src","sources":["testing/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAGA,IAAAE,MAAA,GAAAF,OAAA;AAGA,IAAAG,YAAA,GAAAH,OAAA;AA6ZA,IAAAI,YAAA,GAAAJ,OAAA;AAAyE,SAAAD,uB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;IACnCG,QAAQ,EAAE,IAAAH,0BAAa,EAAC,UAAU;EACnC,CAAC;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The production-traffic guarantee (FR-011, FR-011a).
|
|
5
|
+
*
|
|
6
|
+
* A pure function, deliberately. This is the single point where a production ad
|
|
7
|
+
* unit can be replaced by an official test one, which is what makes SC-002
|
|
8
|
+
* provable rather than merely intended: a guarantee enforced in one place can be
|
|
9
|
+
* asserted; one spread across three call sites is a hope.
|
|
10
|
+
*
|
|
11
|
+
* The rule, from the 2026-09-02 clarification session:
|
|
12
|
+
*
|
|
13
|
+
* production -> use what the app configured, always, no exceptions
|
|
14
|
+
* development / test -> if it is not one of our own official test units,
|
|
15
|
+
* replace it and say so, loudly, naming the key
|
|
16
|
+
*
|
|
17
|
+
* Substitution rather than rejection is a deliberate trade. Rejecting would
|
|
18
|
+
* block a developer whose only mistake was pulling a teammate's environment
|
|
19
|
+
* file, and turn a configuration smell into a broken integration at every
|
|
20
|
+
* startup. Substituting keeps the app working — which is what a non-production
|
|
21
|
+
* build is for — and reports the problem as a first-class signal. The accepted
|
|
22
|
+
* cost is that a warning can be ignored; it is bounded because production never
|
|
23
|
+
* substitutes, so the misconfiguration surfaces there as ordinary behavior
|
|
24
|
+
* rather than as hidden state.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
import { isOfficialTestAdUnit, testAdUnitFor } from "../engine/testAdUnits.js";
|
|
28
|
+
export function resolveAdUnit(placement, environment) {
|
|
29
|
+
const configured = placement.androidAdUnitId;
|
|
30
|
+
|
|
31
|
+
// Production is the one environment where the package must not second-guess
|
|
32
|
+
// the app. Substituting here would silently rewrite configuration that was
|
|
33
|
+
// asked for on purpose, and would cost the publisher live revenue.
|
|
34
|
+
if (environment === 'production') {
|
|
35
|
+
return {
|
|
36
|
+
effectiveAdUnitId: configured,
|
|
37
|
+
substituted: false
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Structural detection: anything that is not a known official test unit is
|
|
42
|
+
// treated as production-owned. Not a parse of AdMob's publisher-id format —
|
|
43
|
+
// see the note in engine/testAdUnits.ts on why that rule would be a liability.
|
|
44
|
+
if (isOfficialTestAdUnit(configured)) {
|
|
45
|
+
return {
|
|
46
|
+
effectiveAdUnitId: configured,
|
|
47
|
+
substituted: false
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
effectiveAdUnitId: testAdUnitFor(placement.format),
|
|
52
|
+
substituted: true
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Resolves a whole catalog at once, so the warning can name every affected
|
|
57
|
+
* placement in a single event rather than trickling one out per load — an
|
|
58
|
+
* integrator wants to fix the whole file, not discover it a placement at a time.
|
|
59
|
+
*/
|
|
60
|
+
export function resolvePlacementAdUnits(placements, environment) {
|
|
61
|
+
const byKey = new Map();
|
|
62
|
+
const substitutedKeys = [];
|
|
63
|
+
for (const placement of placements) {
|
|
64
|
+
const resolved = resolveAdUnit(placement, environment);
|
|
65
|
+
byKey.set(placement.key, resolved.effectiveAdUnitId);
|
|
66
|
+
if (resolved.substituted) {
|
|
67
|
+
substitutedKeys.push(placement.key);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
byKey,
|
|
72
|
+
substitutedKeys
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=resolveAdUnit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["isOfficialTestAdUnit","testAdUnitFor","resolveAdUnit","placement","environment","configured","androidAdUnitId","effectiveAdUnitId","substituted","format","resolvePlacementAdUnits","placements","byKey","Map","substitutedKeys","resolved","set","key","push"],"sourceRoot":"../../../src","sources":["config/resolveAdUnit.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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* Public configuration and state types (FR-001, FR-003, FR-004).
|
|
5
|
+
*
|
|
6
|
+
* Nothing here names a platform or an ad provider. That is the whole point:
|
|
7
|
+
* adding an iOS adapter later contributes an optional `iosAdUnitId` and a second
|
|
8
|
+
* engine implementation, and changes nothing a consumer already wrote (FR-006).
|
|
9
|
+
*
|
|
10
|
+
* The package persists none of this. Every value below lives for the lifetime of
|
|
11
|
+
* one instance and is released by `dispose()`.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Supported formats. Native and rewarded-interstitial remain deferred.
|
|
16
|
+
*
|
|
17
|
+
* `app_open` joined in 0.2.0. It is a member of this union rather than a
|
|
18
|
+
* separate concept because FR-132 forbids a parallel vocabulary: app-open uses
|
|
19
|
+
* the same placement states, events, and error codes as everything else. The
|
|
20
|
+
* cost is that a consumer's exhaustive `switch` over this union stops compiling
|
|
21
|
+
* — the one required migration step, documented in the 0.2.0 release notes.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Formats that take over the screen, and so contend for the single-show lock.
|
|
26
|
+
* App-open is included deliberately: two full-screen ads at once is a broken
|
|
27
|
+
* app regardless of which formats produced them (FR-129).
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
export function isFullScreenFormat(format) {
|
|
31
|
+
return format === 'interstitial' || format === 'rewarded' || format === 'app_open';
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Declared by the app, because the package cannot depend on any particular
|
|
36
|
+
* configuration mechanism (FR-015). Cross-checked against the runtime dev flag
|
|
37
|
+
* so a debug build claiming `production` is caught rather than trusted (FR-012).
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* One logical ad slot. `key` is the app's own stable name — `home_footer`, not
|
|
42
|
+
* an AdMob unit. Provider identifiers appear here in configuration and nowhere
|
|
43
|
+
* else in consumer code (FR-003, FR-007).
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Bounded retry for failed loads. Off unless `AdsConfig.retry` is supplied —
|
|
48
|
+
* upgrading from 0.1.0 without configuring this issues not one extra request
|
|
49
|
+
* (FR-134).
|
|
50
|
+
*
|
|
51
|
+
* Only errors already flagged `retryable` are retried. Configuration errors,
|
|
52
|
+
* consent errors, an unsupported platform, and a disabled or undecided instance
|
|
53
|
+
* never are (FR-135).
|
|
54
|
+
*
|
|
55
|
+
* Backoff is exponential with a fixed x2 multiplier and no jitter. Jitter exists
|
|
56
|
+
* to desynchronize a fleet hitting one server; a single device retrying its own
|
|
57
|
+
* load has no herd to avoid, and omitting it keeps the attempt count an exact
|
|
58
|
+
* assertion rather than a statistical one.
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Whether the app wants ads, including the case where it does not know yet.
|
|
63
|
+
*
|
|
64
|
+
* The package never resolves `undecided` on the app's behalf and never learns
|
|
65
|
+
* why the app chose what it chose — no entitlement, no receipt, no reason
|
|
66
|
+
* (FR-119, FR-120).
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Tools for exercising the consent flow from a device outside a
|
|
71
|
+
* consent-required region.
|
|
72
|
+
*
|
|
73
|
+
* **Stripped entirely when `environment` is `production`.** That is enforced at
|
|
74
|
+
* configuration validation rather than at each call site, so no path through the
|
|
75
|
+
* consent module can forget it, and the fact that they were ignored is
|
|
76
|
+
* observable through a `config_warning` event and `getIgnoredConsentTools()` —
|
|
77
|
+
* not merely documented (FR-113).
|
|
78
|
+
*/
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Consent status, normalized. Carries no provider type and no payload (FR-104).
|
|
82
|
+
*
|
|
83
|
+
* Shaped so an iOS adapter can later express both a consent flow and the
|
|
84
|
+
* platform's tracking-permission mechanism, plus the ordering between them,
|
|
85
|
+
* without changing shape.
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Whether the user must be offered a way to change their consent choice
|
|
90
|
+
* (FR-150), added in 0.4.0.
|
|
91
|
+
*
|
|
92
|
+
* The provider's verdict, forwarded — never the package's judgement about a
|
|
93
|
+
* region, exactly as `not_required` in `ConsentState` is not. `required` is the
|
|
94
|
+
* app's cue to show its own "Privacy options" entry; where that entry lives and
|
|
95
|
+
* what it says stay the app's.
|
|
96
|
+
*
|
|
97
|
+
* `unknown` before the first successful `requestInfoUpdate()`, after `reset()`,
|
|
98
|
+
* after a failed update, and on a platform with no adapter. It is not `not_required`:
|
|
99
|
+
* an app that hides the entry on `unknown` is right to, but it must not conclude
|
|
100
|
+
* the user has no right to one.
|
|
101
|
+
*/
|
|
102
|
+
|
|
103
|
+
/** Bounds exist because an unbounded timeout is the same defect as no timeout. */
|
|
104
|
+
|
|
105
|
+
/** Content ratings, normalized. Maps onto the provider's own rating scale. */
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Supplied before initialization (FR-016). Never logged, never persisted
|
|
109
|
+
* (FR-021). Everything except `canRequestAds` must reach the provider before it
|
|
110
|
+
* initializes, which is why changing one afterwards reports
|
|
111
|
+
* `requires_reinitialization` rather than pretending it applied (FR-020).
|
|
112
|
+
*/
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Why the consent gate is closed.
|
|
116
|
+
*
|
|
117
|
+
* The two original members keep their exact v1 meaning — the app's own gate —
|
|
118
|
+
* so no existing consumer's interpretation changes. The two added in 0.2.0 name
|
|
119
|
+
* the package's consent flow instead. The split exists because the gate has two
|
|
120
|
+
* independent inputs that combine as most-restrictive-wins, and a refusal has to
|
|
121
|
+
* say *which* of them is blocking or the app cannot act on it (FR-105a).
|
|
122
|
+
*/
|
|
123
|
+
|
|
124
|
+
/** FR-023. One per instance, observable without holding a provider object. */
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* FR-026. One per placement. Banners never reach `consumed` — they are
|
|
128
|
+
* continuous, not single-use.
|
|
129
|
+
*/
|
|
130
|
+
|
|
131
|
+
/** FR-047. The provider's reward descriptor, normalized. */
|
|
132
|
+
|
|
133
|
+
/** FR-005. Returned by every subscription; safe to call more than once. */
|
|
134
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["isFullScreenFormat","format"],"sourceRoot":"../../../src","sources":["config/types.ts"],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAGA,OAAO,SAASA,kBAAkBA,CAACC,MAAgB,EAA8B;EAChF,OAAOA,MAAM,KAAK,cAAc,IAAIA,MAAM,KAAK,UAAU,IAAIA,MAAM,KAAK,UAAU;AACnF;;AAEA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAmCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaA;;AAkDA;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;;AAqBA;AACA;AACA;AACA;;AAsBA;;AAMA","ignoreList":[]}
|