@chipmobilesdk/rn-ads 0.7.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.
Files changed (319) hide show
  1. package/CHANGELOG.md +88 -0
  2. package/lib/commonjs/config/resolveAdUnit.js +80 -0
  3. package/lib/commonjs/config/resolveAdUnit.js.map +1 -0
  4. package/lib/commonjs/config/types.js +138 -0
  5. package/lib/commonjs/config/types.js.map +1 -0
  6. package/lib/commonjs/config/validate.js +150 -0
  7. package/lib/commonjs/config/validate.js.map +1 -0
  8. package/lib/commonjs/core/adOriginatedReturn.js +119 -0
  9. package/lib/commonjs/core/adOriginatedReturn.js.map +1 -0
  10. package/lib/commonjs/core/adsInstance.js +129 -0
  11. package/lib/commonjs/core/adsInstance.js.map +1 -0
  12. package/lib/commonjs/core/consentFlow.js +154 -0
  13. package/lib/commonjs/core/consentFlow.js.map +1 -0
  14. package/lib/commonjs/core/enablement.js +64 -0
  15. package/lib/commonjs/core/enablement.js.map +1 -0
  16. package/lib/commonjs/core/fullScreenLock.js +48 -0
  17. package/lib/commonjs/core/fullScreenLock.js.map +1 -0
  18. package/lib/commonjs/core/gates.js +95 -0
  19. package/lib/commonjs/core/gates.js.map +1 -0
  20. package/lib/commonjs/core/initMachine.js +159 -0
  21. package/lib/commonjs/core/initMachine.js.map +1 -0
  22. package/lib/commonjs/core/instance/consent.js +155 -0
  23. package/lib/commonjs/core/instance/consent.js.map +1 -0
  24. package/lib/commonjs/core/instance/context.js +217 -0
  25. package/lib/commonjs/core/instance/context.js.map +1 -0
  26. package/lib/commonjs/core/instance/gate.js +194 -0
  27. package/lib/commonjs/core/instance/gate.js.map +1 -0
  28. package/lib/commonjs/core/instance/init.js +326 -0
  29. package/lib/commonjs/core/instance/init.js.map +1 -0
  30. package/lib/commonjs/core/instance/internals.js +115 -0
  31. package/lib/commonjs/core/instance/internals.js.map +1 -0
  32. package/lib/commonjs/core/instance/load.js +458 -0
  33. package/lib/commonjs/core/instance/load.js.map +1 -0
  34. package/lib/commonjs/core/instance/show.js +243 -0
  35. package/lib/commonjs/core/instance/show.js.map +1 -0
  36. package/lib/commonjs/core/instance/types.js +6 -0
  37. package/lib/commonjs/core/instance/types.js.map +1 -0
  38. package/lib/commonjs/core/placementMachine.js +116 -0
  39. package/lib/commonjs/core/placementMachine.js.map +1 -0
  40. package/lib/commonjs/core/privacyGate.js +93 -0
  41. package/lib/commonjs/core/privacyGate.js.map +1 -0
  42. package/lib/commonjs/core/requestThrottle.js +152 -0
  43. package/lib/commonjs/core/requestThrottle.js.map +1 -0
  44. package/lib/commonjs/core/retryPolicy.js +120 -0
  45. package/lib/commonjs/core/retryPolicy.js.map +1 -0
  46. package/lib/commonjs/core/rewardedSession.js +65 -0
  47. package/lib/commonjs/core/rewardedSession.js.map +1 -0
  48. package/lib/commonjs/core/timers.js +162 -0
  49. package/lib/commonjs/core/timers.js.map +1 -0
  50. package/lib/commonjs/diagnostics/correlation.js +33 -0
  51. package/lib/commonjs/diagnostics/correlation.js.map +1 -0
  52. package/lib/commonjs/diagnostics/errors.js +152 -0
  53. package/lib/commonjs/diagnostics/errors.js.map +1 -0
  54. package/lib/commonjs/diagnostics/events.js +132 -0
  55. package/lib/commonjs/diagnostics/events.js.map +1 -0
  56. package/lib/commonjs/engine/admobBanner.js +58 -0
  57. package/lib/commonjs/engine/admobBanner.js.map +1 -0
  58. package/lib/commonjs/engine/admobEngine.js +343 -0
  59. package/lib/commonjs/engine/admobEngine.js.map +1 -0
  60. package/lib/commonjs/engine/admobErrors.js +45 -0
  61. package/lib/commonjs/engine/admobErrors.js.map +1 -0
  62. package/lib/commonjs/engine/port.js +6 -0
  63. package/lib/commonjs/engine/port.js.map +1 -0
  64. package/lib/commonjs/engine/testAdUnits.js +61 -0
  65. package/lib/commonjs/engine/testAdUnits.js.map +1 -0
  66. package/lib/commonjs/index.js +218 -0
  67. package/lib/commonjs/index.js.map +1 -0
  68. package/lib/commonjs/package.json +1 -0
  69. package/lib/commonjs/react/AdsBanner.js +317 -0
  70. package/lib/commonjs/react/AdsBanner.js.map +1 -0
  71. package/lib/commonjs/react/AdsProvider.js +54 -0
  72. package/lib/commonjs/react/AdsProvider.js.map +1 -0
  73. package/lib/commonjs/react/hooks.js +63 -0
  74. package/lib/commonjs/react/hooks.js.map +1 -0
  75. package/lib/commonjs/testing/clock.js +76 -0
  76. package/lib/commonjs/testing/clock.js.map +1 -0
  77. package/lib/commonjs/testing/conformance.js +99 -0
  78. package/lib/commonjs/testing/conformance.js.map +1 -0
  79. package/lib/commonjs/testing/index.js +389 -0
  80. package/lib/commonjs/testing/index.js.map +1 -0
  81. package/lib/module/config/resolveAdUnit.js +75 -0
  82. package/lib/module/config/resolveAdUnit.js.map +1 -0
  83. package/lib/module/config/types.js +134 -0
  84. package/lib/module/config/types.js.map +1 -0
  85. package/lib/module/config/validate.js +146 -0
  86. package/lib/module/config/validate.js.map +1 -0
  87. package/lib/module/core/adOriginatedReturn.js +115 -0
  88. package/lib/module/core/adOriginatedReturn.js.map +1 -0
  89. package/lib/module/core/adsInstance.js +121 -0
  90. package/lib/module/core/adsInstance.js.map +1 -0
  91. package/lib/module/core/consentFlow.js +143 -0
  92. package/lib/module/core/consentFlow.js.map +1 -0
  93. package/lib/module/core/enablement.js +58 -0
  94. package/lib/module/core/enablement.js.map +1 -0
  95. package/lib/module/core/fullScreenLock.js +44 -0
  96. package/lib/module/core/fullScreenLock.js.map +1 -0
  97. package/lib/module/core/gates.js +91 -0
  98. package/lib/module/core/gates.js.map +1 -0
  99. package/lib/module/core/initMachine.js +152 -0
  100. package/lib/module/core/initMachine.js.map +1 -0
  101. package/lib/module/core/instance/consent.js +151 -0
  102. package/lib/module/core/instance/consent.js.map +1 -0
  103. package/lib/module/core/instance/context.js +212 -0
  104. package/lib/module/core/instance/context.js.map +1 -0
  105. package/lib/module/core/instance/gate.js +183 -0
  106. package/lib/module/core/instance/gate.js.map +1 -0
  107. package/lib/module/core/instance/init.js +321 -0
  108. package/lib/module/core/instance/init.js.map +1 -0
  109. package/lib/module/core/instance/internals.js +109 -0
  110. package/lib/module/core/instance/internals.js.map +1 -0
  111. package/lib/module/core/instance/load.js +452 -0
  112. package/lib/module/core/instance/load.js.map +1 -0
  113. package/lib/module/core/instance/show.js +238 -0
  114. package/lib/module/core/instance/show.js.map +1 -0
  115. package/lib/module/core/instance/types.js +4 -0
  116. package/lib/module/core/instance/types.js.map +1 -0
  117. package/lib/module/core/placementMachine.js +109 -0
  118. package/lib/module/core/placementMachine.js.map +1 -0
  119. package/lib/module/core/privacyGate.js +86 -0
  120. package/lib/module/core/privacyGate.js.map +1 -0
  121. package/lib/module/core/requestThrottle.js +146 -0
  122. package/lib/module/core/requestThrottle.js.map +1 -0
  123. package/lib/module/core/retryPolicy.js +113 -0
  124. package/lib/module/core/retryPolicy.js.map +1 -0
  125. package/lib/module/core/rewardedSession.js +61 -0
  126. package/lib/module/core/rewardedSession.js.map +1 -0
  127. package/lib/module/core/timers.js +150 -0
  128. package/lib/module/core/timers.js.map +1 -0
  129. package/lib/module/diagnostics/correlation.js +29 -0
  130. package/lib/module/diagnostics/correlation.js.map +1 -0
  131. package/lib/module/diagnostics/errors.js +143 -0
  132. package/lib/module/diagnostics/errors.js.map +1 -0
  133. package/lib/module/diagnostics/events.js +128 -0
  134. package/lib/module/diagnostics/events.js.map +1 -0
  135. package/lib/module/engine/admobBanner.js +52 -0
  136. package/lib/module/engine/admobBanner.js.map +1 -0
  137. package/lib/module/engine/admobEngine.js +334 -0
  138. package/lib/module/engine/admobEngine.js.map +1 -0
  139. package/lib/module/engine/admobErrors.js +41 -0
  140. package/lib/module/engine/admobErrors.js.map +1 -0
  141. package/lib/module/engine/port.js +4 -0
  142. package/lib/module/engine/port.js.map +1 -0
  143. package/lib/module/engine/testAdUnits.js +56 -0
  144. package/lib/module/engine/testAdUnits.js.map +1 -0
  145. package/lib/module/index.js +59 -0
  146. package/lib/module/index.js.map +1 -0
  147. package/lib/module/package.json +1 -0
  148. package/lib/module/react/AdsBanner.js +312 -0
  149. package/lib/module/react/AdsBanner.js.map +1 -0
  150. package/lib/module/react/AdsProvider.js +48 -0
  151. package/lib/module/react/AdsProvider.js.map +1 -0
  152. package/lib/module/react/hooks.js +58 -0
  153. package/lib/module/react/hooks.js.map +1 -0
  154. package/lib/module/testing/clock.js +72 -0
  155. package/lib/module/testing/clock.js.map +1 -0
  156. package/lib/module/testing/conformance.js +93 -0
  157. package/lib/module/testing/conformance.js.map +1 -0
  158. package/lib/module/testing/index.js +366 -0
  159. package/lib/module/testing/index.js.map +1 -0
  160. package/lib/typescript/commonjs/config/resolveAdUnit.d.ts +43 -0
  161. package/lib/typescript/commonjs/config/resolveAdUnit.d.ts.map +1 -0
  162. package/lib/typescript/commonjs/config/types.d.ts +280 -0
  163. package/lib/typescript/commonjs/config/types.d.ts.map +1 -0
  164. package/lib/typescript/commonjs/config/validate.d.ts +49 -0
  165. package/lib/typescript/commonjs/config/validate.d.ts.map +1 -0
  166. package/lib/typescript/commonjs/core/adOriginatedReturn.d.ts +61 -0
  167. package/lib/typescript/commonjs/core/adOriginatedReturn.d.ts.map +1 -0
  168. package/lib/typescript/commonjs/core/adsInstance.d.ts +33 -0
  169. package/lib/typescript/commonjs/core/adsInstance.d.ts.map +1 -0
  170. package/lib/typescript/commonjs/core/consentFlow.d.ts +84 -0
  171. package/lib/typescript/commonjs/core/consentFlow.d.ts.map +1 -0
  172. package/lib/typescript/commonjs/core/enablement.d.ts +74 -0
  173. package/lib/typescript/commonjs/core/enablement.d.ts.map +1 -0
  174. package/lib/typescript/commonjs/core/fullScreenLock.d.ts +25 -0
  175. package/lib/typescript/commonjs/core/fullScreenLock.d.ts.map +1 -0
  176. package/lib/typescript/commonjs/core/gates.d.ts +76 -0
  177. package/lib/typescript/commonjs/core/gates.d.ts.map +1 -0
  178. package/lib/typescript/commonjs/core/initMachine.d.ts +66 -0
  179. package/lib/typescript/commonjs/core/initMachine.d.ts.map +1 -0
  180. package/lib/typescript/commonjs/core/instance/consent.d.ts +4 -0
  181. package/lib/typescript/commonjs/core/instance/consent.d.ts.map +1 -0
  182. package/lib/typescript/commonjs/core/instance/context.d.ts +118 -0
  183. package/lib/typescript/commonjs/core/instance/context.d.ts.map +1 -0
  184. package/lib/typescript/commonjs/core/instance/gate.d.ts +38 -0
  185. package/lib/typescript/commonjs/core/instance/gate.d.ts.map +1 -0
  186. package/lib/typescript/commonjs/core/instance/init.d.ts +13 -0
  187. package/lib/typescript/commonjs/core/instance/init.d.ts.map +1 -0
  188. package/lib/typescript/commonjs/core/instance/internals.d.ts +60 -0
  189. package/lib/typescript/commonjs/core/instance/internals.d.ts.map +1 -0
  190. package/lib/typescript/commonjs/core/instance/load.d.ts +9 -0
  191. package/lib/typescript/commonjs/core/instance/load.d.ts.map +1 -0
  192. package/lib/typescript/commonjs/core/instance/show.d.ts +7 -0
  193. package/lib/typescript/commonjs/core/instance/show.d.ts.map +1 -0
  194. package/lib/typescript/commonjs/core/instance/types.d.ts +240 -0
  195. package/lib/typescript/commonjs/core/instance/types.d.ts.map +1 -0
  196. package/lib/typescript/commonjs/core/placementMachine.d.ts +55 -0
  197. package/lib/typescript/commonjs/core/placementMachine.d.ts.map +1 -0
  198. package/lib/typescript/commonjs/core/privacyGate.d.ts +40 -0
  199. package/lib/typescript/commonjs/core/privacyGate.d.ts.map +1 -0
  200. package/lib/typescript/commonjs/core/requestThrottle.d.ts +99 -0
  201. package/lib/typescript/commonjs/core/requestThrottle.d.ts.map +1 -0
  202. package/lib/typescript/commonjs/core/retryPolicy.d.ts +66 -0
  203. package/lib/typescript/commonjs/core/retryPolicy.d.ts.map +1 -0
  204. package/lib/typescript/commonjs/core/rewardedSession.d.ts +37 -0
  205. package/lib/typescript/commonjs/core/rewardedSession.d.ts.map +1 -0
  206. package/lib/typescript/commonjs/core/timers.d.ts +135 -0
  207. package/lib/typescript/commonjs/core/timers.d.ts.map +1 -0
  208. package/lib/typescript/commonjs/diagnostics/correlation.d.ts +18 -0
  209. package/lib/typescript/commonjs/diagnostics/correlation.d.ts.map +1 -0
  210. package/lib/typescript/commonjs/diagnostics/errors.d.ts +59 -0
  211. package/lib/typescript/commonjs/diagnostics/errors.d.ts.map +1 -0
  212. package/lib/typescript/commonjs/diagnostics/events.d.ts +126 -0
  213. package/lib/typescript/commonjs/diagnostics/events.d.ts.map +1 -0
  214. package/lib/typescript/commonjs/engine/admobBanner.d.ts +10 -0
  215. package/lib/typescript/commonjs/engine/admobBanner.d.ts.map +1 -0
  216. package/lib/typescript/commonjs/engine/admobEngine.d.ts +71 -0
  217. package/lib/typescript/commonjs/engine/admobEngine.d.ts.map +1 -0
  218. package/lib/typescript/commonjs/engine/admobErrors.d.ts +9 -0
  219. package/lib/typescript/commonjs/engine/admobErrors.d.ts.map +1 -0
  220. package/lib/typescript/commonjs/engine/port.d.ts +171 -0
  221. package/lib/typescript/commonjs/engine/port.d.ts.map +1 -0
  222. package/lib/typescript/commonjs/engine/testAdUnits.d.ts +33 -0
  223. package/lib/typescript/commonjs/engine/testAdUnits.d.ts.map +1 -0
  224. package/lib/typescript/commonjs/index.d.ts +42 -0
  225. package/lib/typescript/commonjs/index.d.ts.map +1 -0
  226. package/lib/typescript/commonjs/package.json +1 -0
  227. package/lib/typescript/commonjs/react/AdsBanner.d.ts +29 -0
  228. package/lib/typescript/commonjs/react/AdsBanner.d.ts.map +1 -0
  229. package/lib/typescript/commonjs/react/AdsProvider.d.ts +36 -0
  230. package/lib/typescript/commonjs/react/AdsProvider.d.ts.map +1 -0
  231. package/lib/typescript/commonjs/react/hooks.d.ts +27 -0
  232. package/lib/typescript/commonjs/react/hooks.d.ts.map +1 -0
  233. package/lib/typescript/commonjs/testing/clock.d.ts +29 -0
  234. package/lib/typescript/commonjs/testing/clock.d.ts.map +1 -0
  235. package/lib/typescript/commonjs/testing/conformance.d.ts +26 -0
  236. package/lib/typescript/commonjs/testing/conformance.d.ts.map +1 -0
  237. package/lib/typescript/commonjs/testing/index.d.ts +133 -0
  238. package/lib/typescript/commonjs/testing/index.d.ts.map +1 -0
  239. package/lib/typescript/module/config/resolveAdUnit.d.ts +43 -0
  240. package/lib/typescript/module/config/resolveAdUnit.d.ts.map +1 -0
  241. package/lib/typescript/module/config/types.d.ts +280 -0
  242. package/lib/typescript/module/config/types.d.ts.map +1 -0
  243. package/lib/typescript/module/config/validate.d.ts +49 -0
  244. package/lib/typescript/module/config/validate.d.ts.map +1 -0
  245. package/lib/typescript/module/core/adOriginatedReturn.d.ts +61 -0
  246. package/lib/typescript/module/core/adOriginatedReturn.d.ts.map +1 -0
  247. package/lib/typescript/module/core/adsInstance.d.ts +33 -0
  248. package/lib/typescript/module/core/adsInstance.d.ts.map +1 -0
  249. package/lib/typescript/module/core/consentFlow.d.ts +84 -0
  250. package/lib/typescript/module/core/consentFlow.d.ts.map +1 -0
  251. package/lib/typescript/module/core/enablement.d.ts +74 -0
  252. package/lib/typescript/module/core/enablement.d.ts.map +1 -0
  253. package/lib/typescript/module/core/fullScreenLock.d.ts +25 -0
  254. package/lib/typescript/module/core/fullScreenLock.d.ts.map +1 -0
  255. package/lib/typescript/module/core/gates.d.ts +76 -0
  256. package/lib/typescript/module/core/gates.d.ts.map +1 -0
  257. package/lib/typescript/module/core/initMachine.d.ts +66 -0
  258. package/lib/typescript/module/core/initMachine.d.ts.map +1 -0
  259. package/lib/typescript/module/core/instance/consent.d.ts +4 -0
  260. package/lib/typescript/module/core/instance/consent.d.ts.map +1 -0
  261. package/lib/typescript/module/core/instance/context.d.ts +118 -0
  262. package/lib/typescript/module/core/instance/context.d.ts.map +1 -0
  263. package/lib/typescript/module/core/instance/gate.d.ts +38 -0
  264. package/lib/typescript/module/core/instance/gate.d.ts.map +1 -0
  265. package/lib/typescript/module/core/instance/init.d.ts +13 -0
  266. package/lib/typescript/module/core/instance/init.d.ts.map +1 -0
  267. package/lib/typescript/module/core/instance/internals.d.ts +60 -0
  268. package/lib/typescript/module/core/instance/internals.d.ts.map +1 -0
  269. package/lib/typescript/module/core/instance/load.d.ts +9 -0
  270. package/lib/typescript/module/core/instance/load.d.ts.map +1 -0
  271. package/lib/typescript/module/core/instance/show.d.ts +7 -0
  272. package/lib/typescript/module/core/instance/show.d.ts.map +1 -0
  273. package/lib/typescript/module/core/instance/types.d.ts +240 -0
  274. package/lib/typescript/module/core/instance/types.d.ts.map +1 -0
  275. package/lib/typescript/module/core/placementMachine.d.ts +55 -0
  276. package/lib/typescript/module/core/placementMachine.d.ts.map +1 -0
  277. package/lib/typescript/module/core/privacyGate.d.ts +40 -0
  278. package/lib/typescript/module/core/privacyGate.d.ts.map +1 -0
  279. package/lib/typescript/module/core/requestThrottle.d.ts +99 -0
  280. package/lib/typescript/module/core/requestThrottle.d.ts.map +1 -0
  281. package/lib/typescript/module/core/retryPolicy.d.ts +66 -0
  282. package/lib/typescript/module/core/retryPolicy.d.ts.map +1 -0
  283. package/lib/typescript/module/core/rewardedSession.d.ts +37 -0
  284. package/lib/typescript/module/core/rewardedSession.d.ts.map +1 -0
  285. package/lib/typescript/module/core/timers.d.ts +135 -0
  286. package/lib/typescript/module/core/timers.d.ts.map +1 -0
  287. package/lib/typescript/module/diagnostics/correlation.d.ts +18 -0
  288. package/lib/typescript/module/diagnostics/correlation.d.ts.map +1 -0
  289. package/lib/typescript/module/diagnostics/errors.d.ts +59 -0
  290. package/lib/typescript/module/diagnostics/errors.d.ts.map +1 -0
  291. package/lib/typescript/module/diagnostics/events.d.ts +126 -0
  292. package/lib/typescript/module/diagnostics/events.d.ts.map +1 -0
  293. package/lib/typescript/module/engine/admobBanner.d.ts +10 -0
  294. package/lib/typescript/module/engine/admobBanner.d.ts.map +1 -0
  295. package/lib/typescript/module/engine/admobEngine.d.ts +71 -0
  296. package/lib/typescript/module/engine/admobEngine.d.ts.map +1 -0
  297. package/lib/typescript/module/engine/admobErrors.d.ts +9 -0
  298. package/lib/typescript/module/engine/admobErrors.d.ts.map +1 -0
  299. package/lib/typescript/module/engine/port.d.ts +171 -0
  300. package/lib/typescript/module/engine/port.d.ts.map +1 -0
  301. package/lib/typescript/module/engine/testAdUnits.d.ts +33 -0
  302. package/lib/typescript/module/engine/testAdUnits.d.ts.map +1 -0
  303. package/lib/typescript/module/index.d.ts +42 -0
  304. package/lib/typescript/module/index.d.ts.map +1 -0
  305. package/lib/typescript/module/package.json +1 -0
  306. package/lib/typescript/module/react/AdsBanner.d.ts +29 -0
  307. package/lib/typescript/module/react/AdsBanner.d.ts.map +1 -0
  308. package/lib/typescript/module/react/AdsProvider.d.ts +36 -0
  309. package/lib/typescript/module/react/AdsProvider.d.ts.map +1 -0
  310. package/lib/typescript/module/react/hooks.d.ts +27 -0
  311. package/lib/typescript/module/react/hooks.d.ts.map +1 -0
  312. package/lib/typescript/module/testing/clock.d.ts +29 -0
  313. package/lib/typescript/module/testing/clock.d.ts.map +1 -0
  314. package/lib/typescript/module/testing/conformance.d.ts +26 -0
  315. package/lib/typescript/module/testing/conformance.d.ts.map +1 -0
  316. package/lib/typescript/module/testing/index.d.ts +133 -0
  317. package/lib/typescript/module/testing/index.d.ts.map +1 -0
  318. package/package.json +48 -12
  319. package/src/testing/index.ts +17 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,93 @@
1
1
  # @chipmobilesdk/rn-ads
2
2
 
3
+ ## 0.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Every package now ships built JavaScript with declaration files, instead of asking the
8
+ app to compile its TypeScript. ([#22](https://github.com/operationd8979/chip-mobile-sdk/pull/22))
9
+
10
+ Each tarball carries `lib/commonjs`, `lib/module` and `lib/typescript` (built with
11
+ `react-native-builder-bob`), and `src/` alongside them. What that changes for a
12
+ consumer:
13
+
14
+ - **Nothing to add to `transformIgnorePatterns`.** `require` resolves to the CommonJS
15
+ build, so an app's Jest loads this package without being told to transform it. That
16
+ was the one thing every consuming app had to know about us (DEP-04).
17
+ - **Typechecking reads our `.d.ts`** rather than compiling our source under our
18
+ `tsconfig`. A consumer's stricter — or looser — settings no longer meet our code.
19
+ - **`import` resolves to ESM**, so a bundler can tree-shake what it does not use.
20
+
21
+ No exported name changed, and no subpath moved: `.`, `./testing`, `./push`,
22
+ `./advanced`, `./app-auth`, `./keychain` and rn-core's twelve subpaths resolve exactly
23
+ as before, each now with its own declarations for both module systems. publint and
24
+ `attw --profile node16` pass on all twelve packages, which they could not before.
25
+
26
+ Inside the monorepo nothing changed either, and that is deliberate: every subpath also
27
+ declares a private `chipmobilesdk-source` condition pointing at its TypeScript, and
28
+ Metro, Jest and `tsc` here ask for that condition first. The demo app bundles 371
29
+ modules straight from `packages/*/src`, so editing a package still changes the app with
30
+ no build step, and coverage is still measured on the source. The condition is named for
31
+ this organization rather than using the conventional `source` because third-party
32
+ packages declare that one too — `@dr.pogodin/react-native-fs` does — and asking for it
33
+ pulled their sources into our stricter compile.
34
+
35
+ `npm run build:packages` builds everything, `prepack` rebuilds before any `npm pack`,
36
+ and `lib/` is git-ignored: the published bytes are produced by the release, never
37
+ committed. `npm run check:manifests` now fails a package whose `main`, `module`,
38
+ `types`, `source` condition, `files`, build script or `prepack` do not match this shape.
39
+
40
+ - The fake engine's banner now renders a host view instead of nothing, so a test can find
41
+ it with the testing library. ([#24](https://github.com/operationd8979/chip-mobile-sdk/pull/24))
42
+
43
+ `createFakeAdsEngine().banner.Component` rendered `null`, which left the props the
44
+ package handed it — `adUnitId`, `personalizedAds`, `onLoaded`, `onFailed`, `onImpression`,
45
+ `onClicked` — reachable only on the component instance in the rendered tree. Nothing a
46
+ consumer writes with `@testing-library/react-native` can see that: its queries, like the
47
+ renderer underneath them, return host elements. The fake now renders a `View` carrying
48
+ those props under the testID exported as `FAKE_BANNER_TEST_ID` (`'ads-fake-banner'`):
49
+
50
+ ```ts
51
+ import { FAKE_BANNER_TEST_ID } from '@chipmobilesdk/rn-ads/testing';
52
+
53
+ const banner = screen.getByTestId(FAKE_BANNER_TEST_ID);
54
+ expect(banner.props.adUnitId).toBe(/* the test unit, not yours */);
55
+ banner.props.onLoaded();
56
+ ```
57
+
58
+ A test that searched the tree for a component instance with an `adUnitId` prop needs this
59
+ change; one driven through `engine.adUnitIds()` and the recorded call log does not. The
60
+ banner still draws nothing and measures nothing, so a layout assertion is unaffected.
61
+
62
+ ### Patch Changes
63
+
64
+ - Each package's public API and its weight are now recorded in the repository, so a change
65
+ to either is reviewed rather than discovered. ([#23](https://github.com/operationd8979/chip-mobile-sdk/pull/23))
66
+
67
+ `packages/<pkg>/etc/*.api.md` is an api-extractor report per entrypoint — twenty-seven
68
+ of them, generated from the declarations the package publishes and committed. A renamed
69
+ type, a widened union, one more optional field: all of it shows up in a pull request's
70
+ diff. `npm run check:api` fails when a report is out of date and `npm run api:update`
71
+ rewrites them.
72
+
73
+ A report that moves now needs a **minor or major** changeset for that package.
74
+ `check:changesets` enforces it, because the report is generated from what the package
75
+ publishes, and a patch release that moves the public surface is how a consumer's build
76
+ breaks on `npm update`. A report added for the first time is a baseline, not a change.
77
+ `./testing` deliberately has no report: test doubles are not a surface a release is
78
+ gated on.
79
+
80
+ `npm run check:size` holds every entrypoint to a budget in `.size-limit.json`, measured
81
+ on the ESM build with peers and rn-core treated as external — they are what an app
82
+ installs beside us, not our weight. Each budget started at today's measurement plus five
83
+ per cent, so growth becomes a decision someone makes instead of a drift nobody sees. The
84
+ current figures run from 500 B (`rn-core/lazy`) to 19 kB (rn-notification).
85
+
86
+ No behaviour or API changed in this release; the entry is here so the changelog records
87
+ when the reports and the budgets began.
88
+ - Updated dependencies ([#22](https://github.com/operationd8979/chip-mobile-sdk/pull/22), [#23](https://github.com/operationd8979/chip-mobile-sdk/pull/23)):
89
+ - @chipmobilesdk/rn-core@0.2.0
90
+
3
91
  ## 0.7.0
4
92
 
5
93
  ### Minor Changes
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.resolveAdUnit = resolveAdUnit;
7
+ exports.resolvePlacementAdUnits = resolvePlacementAdUnits;
8
+ var _testAdUnits = require("../engine/testAdUnits.js");
9
+ /**
10
+ * The production-traffic guarantee (FR-011, FR-011a).
11
+ *
12
+ * A pure function, deliberately. This is the single point where a production ad
13
+ * unit can be replaced by an official test one, which is what makes SC-002
14
+ * provable rather than merely intended: a guarantee enforced in one place can be
15
+ * asserted; one spread across three call sites is a hope.
16
+ *
17
+ * The rule, from the 2026-09-02 clarification session:
18
+ *
19
+ * production -> use what the app configured, always, no exceptions
20
+ * development / test -> if it is not one of our own official test units,
21
+ * replace it and say so, loudly, naming the key
22
+ *
23
+ * Substitution rather than rejection is a deliberate trade. Rejecting would
24
+ * block a developer whose only mistake was pulling a teammate's environment
25
+ * file, and turn a configuration smell into a broken integration at every
26
+ * startup. Substituting keeps the app working — which is what a non-production
27
+ * build is for — and reports the problem as a first-class signal. The accepted
28
+ * cost is that a warning can be ignored; it is bounded because production never
29
+ * substitutes, so the misconfiguration surfaces there as ordinary behavior
30
+ * rather than as hidden state.
31
+ */
32
+
33
+ function resolveAdUnit(placement, environment) {
34
+ const configured = placement.androidAdUnitId;
35
+
36
+ // Production is the one environment where the package must not second-guess
37
+ // the app. Substituting here would silently rewrite configuration that was
38
+ // asked for on purpose, and would cost the publisher live revenue.
39
+ if (environment === 'production') {
40
+ return {
41
+ effectiveAdUnitId: configured,
42
+ substituted: false
43
+ };
44
+ }
45
+
46
+ // Structural detection: anything that is not a known official test unit is
47
+ // treated as production-owned. Not a parse of AdMob's publisher-id format —
48
+ // see the note in engine/testAdUnits.ts on why that rule would be a liability.
49
+ if ((0, _testAdUnits.isOfficialTestAdUnit)(configured)) {
50
+ return {
51
+ effectiveAdUnitId: configured,
52
+ substituted: false
53
+ };
54
+ }
55
+ return {
56
+ effectiveAdUnitId: (0, _testAdUnits.testAdUnitFor)(placement.format),
57
+ substituted: true
58
+ };
59
+ }
60
+ /**
61
+ * Resolves a whole catalog at once, so the warning can name every affected
62
+ * placement in a single event rather than trickling one out per load — an
63
+ * integrator wants to fix the whole file, not discover it a placement at a time.
64
+ */
65
+ function resolvePlacementAdUnits(placements, environment) {
66
+ const byKey = new Map();
67
+ const substitutedKeys = [];
68
+ for (const placement of placements) {
69
+ const resolved = resolveAdUnit(placement, environment);
70
+ byKey.set(placement.key, resolved.effectiveAdUnitId);
71
+ if (resolved.substituted) {
72
+ substitutedKeys.push(placement.key);
73
+ }
74
+ }
75
+ return {
76
+ byKey,
77
+ substitutedKeys
78
+ };
79
+ }
80
+ //# sourceMappingURL=resolveAdUnit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_testAdUnits","require","resolveAdUnit","placement","environment","configured","androidAdUnitId","effectiveAdUnitId","substituted","isOfficialTestAdUnit","testAdUnitFor","format","resolvePlacementAdUnits","placements","byKey","Map","substitutedKeys","resolved","set","key","push"],"sourceRoot":"../../../src","sources":["config/resolveAdUnit.ts"],"mappings":";;;;;;;AAyBA,IAAAA,YAAA,GAAAC,OAAA;AAzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWO,SAASC,aAAaA,CAC5BC,SAA8B,EAC9BC,WAAwB,EACP;EACjB,MAAMC,UAAU,GAAGF,SAAS,CAACG,eAAe;;EAE5C;EACA;EACA;EACA,IAAIF,WAAW,KAAK,YAAY,EAAE;IACjC,OAAO;MAAEG,iBAAiB,EAAEF,UAAU;MAAEG,WAAW,EAAE;IAAM,CAAC;EAC7D;;EAEA;EACA;EACA;EACA,IAAI,IAAAC,iCAAoB,EAACJ,UAAU,CAAC,EAAE;IACrC,OAAO;MAAEE,iBAAiB,EAAEF,UAAU;MAAEG,WAAW,EAAE;IAAM,CAAC;EAC7D;EAEA,OAAO;IAAED,iBAAiB,EAAE,IAAAG,0BAAa,EAACP,SAAS,CAACQ,MAAM,CAAC;IAAEH,WAAW,EAAE;EAAK,CAAC;AACjF;AASA;AACA;AACA;AACA;AACA;AACO,SAASI,uBAAuBA,CACtCC,UAA0C,EAC1CT,WAAwB,EACN;EAClB,MAAMU,KAAK,GAAG,IAAIC,GAAG,CAAiB,CAAC;EACvC,MAAMC,eAAyB,GAAG,EAAE;EAEpC,KAAK,MAAMb,SAAS,IAAIU,UAAU,EAAE;IACnC,MAAMI,QAAQ,GAAGf,aAAa,CAACC,SAAS,EAAEC,WAAW,CAAC;IACtDU,KAAK,CAACI,GAAG,CAACf,SAAS,CAACgB,GAAG,EAAEF,QAAQ,CAACV,iBAAiB,CAAC;IACpD,IAAIU,QAAQ,CAACT,WAAW,EAAE;MACzBQ,eAAe,CAACI,IAAI,CAACjB,SAAS,CAACgB,GAAG,CAAC;IACpC;EACD;EAEA,OAAO;IAAEL,KAAK;IAAEE;EAAgB,CAAC;AAClC","ignoreList":[]}
@@ -0,0 +1,138 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isFullScreenFormat = isFullScreenFormat;
7
+ /**
8
+ * Public configuration and state types (FR-001, FR-003, FR-004).
9
+ *
10
+ * Nothing here names a platform or an ad provider. That is the whole point:
11
+ * adding an iOS adapter later contributes an optional `iosAdUnitId` and a second
12
+ * engine implementation, and changes nothing a consumer already wrote (FR-006).
13
+ *
14
+ * The package persists none of this. Every value below lives for the lifetime of
15
+ * one instance and is released by `dispose()`.
16
+ */
17
+
18
+ /**
19
+ * Supported formats. Native and rewarded-interstitial remain deferred.
20
+ *
21
+ * `app_open` joined in 0.2.0. It is a member of this union rather than a
22
+ * separate concept because FR-132 forbids a parallel vocabulary: app-open uses
23
+ * the same placement states, events, and error codes as everything else. The
24
+ * cost is that a consumer's exhaustive `switch` over this union stops compiling
25
+ * — the one required migration step, documented in the 0.2.0 release notes.
26
+ */
27
+
28
+ /**
29
+ * Formats that take over the screen, and so contend for the single-show lock.
30
+ * App-open is included deliberately: two full-screen ads at once is a broken
31
+ * app regardless of which formats produced them (FR-129).
32
+ */
33
+
34
+ function isFullScreenFormat(format) {
35
+ return format === 'interstitial' || format === 'rewarded' || format === 'app_open';
36
+ }
37
+
38
+ /**
39
+ * Declared by the app, because the package cannot depend on any particular
40
+ * configuration mechanism (FR-015). Cross-checked against the runtime dev flag
41
+ * so a debug build claiming `production` is caught rather than trusted (FR-012).
42
+ */
43
+
44
+ /**
45
+ * One logical ad slot. `key` is the app's own stable name — `home_footer`, not
46
+ * an AdMob unit. Provider identifiers appear here in configuration and nowhere
47
+ * else in consumer code (FR-003, FR-007).
48
+ */
49
+
50
+ /**
51
+ * Bounded retry for failed loads. Off unless `AdsConfig.retry` is supplied —
52
+ * upgrading from 0.1.0 without configuring this issues not one extra request
53
+ * (FR-134).
54
+ *
55
+ * Only errors already flagged `retryable` are retried. Configuration errors,
56
+ * consent errors, an unsupported platform, and a disabled or undecided instance
57
+ * never are (FR-135).
58
+ *
59
+ * Backoff is exponential with a fixed x2 multiplier and no jitter. Jitter exists
60
+ * to desynchronize a fleet hitting one server; a single device retrying its own
61
+ * load has no herd to avoid, and omitting it keeps the attempt count an exact
62
+ * assertion rather than a statistical one.
63
+ */
64
+
65
+ /**
66
+ * Whether the app wants ads, including the case where it does not know yet.
67
+ *
68
+ * The package never resolves `undecided` on the app's behalf and never learns
69
+ * why the app chose what it chose — no entitlement, no receipt, no reason
70
+ * (FR-119, FR-120).
71
+ */
72
+
73
+ /**
74
+ * Tools for exercising the consent flow from a device outside a
75
+ * consent-required region.
76
+ *
77
+ * **Stripped entirely when `environment` is `production`.** That is enforced at
78
+ * configuration validation rather than at each call site, so no path through the
79
+ * consent module can forget it, and the fact that they were ignored is
80
+ * observable through a `config_warning` event and `getIgnoredConsentTools()` —
81
+ * not merely documented (FR-113).
82
+ */
83
+
84
+ /**
85
+ * Consent status, normalized. Carries no provider type and no payload (FR-104).
86
+ *
87
+ * Shaped so an iOS adapter can later express both a consent flow and the
88
+ * platform's tracking-permission mechanism, plus the ordering between them,
89
+ * without changing shape.
90
+ */
91
+
92
+ /**
93
+ * Whether the user must be offered a way to change their consent choice
94
+ * (FR-150), added in 0.4.0.
95
+ *
96
+ * The provider's verdict, forwarded — never the package's judgement about a
97
+ * region, exactly as `not_required` in `ConsentState` is not. `required` is the
98
+ * app's cue to show its own "Privacy options" entry; where that entry lives and
99
+ * what it says stay the app's.
100
+ *
101
+ * `unknown` before the first successful `requestInfoUpdate()`, after `reset()`,
102
+ * after a failed update, and on a platform with no adapter. It is not `not_required`:
103
+ * an app that hides the entry on `unknown` is right to, but it must not conclude
104
+ * the user has no right to one.
105
+ */
106
+
107
+ /** Bounds exist because an unbounded timeout is the same defect as no timeout. */
108
+
109
+ /** Content ratings, normalized. Maps onto the provider's own rating scale. */
110
+
111
+ /**
112
+ * Supplied before initialization (FR-016). Never logged, never persisted
113
+ * (FR-021). Everything except `canRequestAds` must reach the provider before it
114
+ * initializes, which is why changing one afterwards reports
115
+ * `requires_reinitialization` rather than pretending it applied (FR-020).
116
+ */
117
+
118
+ /**
119
+ * Why the consent gate is closed.
120
+ *
121
+ * The two original members keep their exact v1 meaning — the app's own gate —
122
+ * so no existing consumer's interpretation changes. The two added in 0.2.0 name
123
+ * the package's consent flow instead. The split exists because the gate has two
124
+ * independent inputs that combine as most-restrictive-wins, and a refusal has to
125
+ * say *which* of them is blocking or the app cannot act on it (FR-105a).
126
+ */
127
+
128
+ /** FR-023. One per instance, observable without holding a provider object. */
129
+
130
+ /**
131
+ * FR-026. One per placement. Banners never reach `consumed` — they are
132
+ * continuous, not single-use.
133
+ */
134
+
135
+ /** FR-047. The provider's reward descriptor, normalized. */
136
+
137
+ /** FR-005. Returned by every subscription; safe to call more than once. */
138
+ //# 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;;AAGO,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":[]}
@@ -0,0 +1,150 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.validateConfig = validateConfig;
7
+ var _errors = require("../diagnostics/errors.js");
8
+ var _resolveAdUnit = require("./resolveAdUnit.js");
9
+ var _timers = require("../core/timers.js");
10
+ var _requestThrottle = require("../core/requestThrottle.js");
11
+ var _enablement = require("../core/enablement.js");
12
+ var _retryPolicy = require("../core/retryPolicy.js");
13
+ /**
14
+ * Catalog and configuration validation (FR-008), plus the fail-closed check
15
+ * that substitution cannot cover (FR-012).
16
+ *
17
+ * Configuration faults throw rather than returning a result. They mean the app
18
+ * is wired wrong, and no runtime status could describe a usable outcome — every
19
+ * other failure in this package is a typed result instead.
20
+ *
21
+ * Every message names the offending placement key. An error that says only
22
+ * "invalid configuration" makes the integrator hunt through a catalog by hand.
23
+ */
24
+
25
+ const FORMATS = new Set(['banner', 'interstitial', 'rewarded', 'app_open']);
26
+ function validateConfig(config, options) {
27
+ // FR-012. Substitution deliberately does not apply in production, so a debug
28
+ // build declaring `production` is the one case it cannot make safe: it would
29
+ // send real requests from a build that should never generate traffic. Fail
30
+ // closed rather than continue.
31
+ if (config.environment === 'production' && options.isDevBuild) {
32
+ throw new _errors.AdsConfigError('production_in_dev_build', {
33
+ message: 'environment is "production" but this is a development build. ' + 'Non-production builds must declare "development" or "test" so the package can ' + 'substitute official Google test ad units and keep production traffic impossible.'
34
+ });
35
+ }
36
+ if (!Array.isArray(config.placements) || config.placements.length === 0) {
37
+ throw new _errors.AdsConfigError('invalid_config', {
38
+ message: 'placements must be a non-empty array; the package can show nothing without one'
39
+ });
40
+ }
41
+ const byKey = new Map();
42
+ for (const placement of config.placements) {
43
+ const key = typeof placement?.key === 'string' ? placement.key.trim() : '';
44
+ if (!key) {
45
+ throw new _errors.AdsConfigError('invalid_config', {
46
+ message: 'every placement needs a non-empty key'
47
+ });
48
+ }
49
+ if (byKey.has(key)) {
50
+ // Rejecting the whole catalog rather than picking a winner: a repeated
51
+ // key means the app's own naming produced two placements for one slot,
52
+ // and the package has no basis to guess which was meant.
53
+ throw new _errors.AdsConfigError('duplicate_placement_key', {
54
+ message: `duplicate placement key "${key}"`,
55
+ placementKey: key
56
+ });
57
+ }
58
+ if (!FORMATS.has(placement.format)) {
59
+ throw new _errors.AdsConfigError('invalid_config', {
60
+ message: `placement "${key}" has unsupported format "${String(placement.format)}"; supported formats are banner, interstitial, rewarded, and app_open`,
61
+ placementKey: key
62
+ });
63
+ }
64
+ if (!placement.androidAdUnitId || !placement.androidAdUnitId.trim()) {
65
+ throw new _errors.AdsConfigError('missing_ad_unit_id', {
66
+ message: `placement "${key}" is missing androidAdUnitId`,
67
+ placementKey: key,
68
+ format: placement.format
69
+ });
70
+ }
71
+ byKey.set(key, {
72
+ ...placement,
73
+ key
74
+ });
75
+ }
76
+ const timeouts = (0, _timers.resolveTimeouts)({
77
+ timeouts: config.timeouts,
78
+ adValidityMs: config.adValidityMs,
79
+ appOpenValidityMs: config.appOpenValidityMs,
80
+ undecidedWarningMs: config.undecidedWarningMs
81
+ });
82
+ const catalog = (0, _resolveAdUnit.resolvePlacementAdUnits)(Array.from(byKey.values()), config.environment);
83
+
84
+ // Resolved eagerly, for every placement, so an out-of-bounds override fails
85
+ // at construction rather than on the first failed load in production — which
86
+ // is the one moment nobody is watching for a configuration error.
87
+ const retryByKey = new Map();
88
+ // Resolved in the same loop and for the same reason: an out-of-bounds floor
89
+ // must fail at construction, not silently refuse every request in production.
90
+ const minRequestIntervalByKey = new Map();
91
+ for (const [key, placement] of byKey) {
92
+ retryByKey.set(key, (0, _retryPolicy.resolveEffectiveRetry)(config.retry, placement.retry, key));
93
+ minRequestIntervalByKey.set(key, placement.minRequestIntervalMs === undefined ? (0, _requestThrottle.defaultMinRequestIntervalMs)(placement.format) :
94
+ // A request floor, not a timeout: its own code (ADS-16).
95
+ (0, _timers.checkBand)(`placements["${key}"].minRequestIntervalMs`, placement.minRequestIntervalMs, _requestThrottle.MIN_REQUEST_INTERVAL_BOUNDS, 'invalid_config'));
96
+ }
97
+ const isProduction = config.environment === 'production';
98
+ const {
99
+ consentTesting,
100
+ ignoredConsentTools
101
+ } = resolveConsentTesting(config.consentTesting, isProduction);
102
+ return {
103
+ enablement: (0, _enablement.toEnablement)(config.enabled),
104
+ environment: config.environment,
105
+ placements: byKey,
106
+ catalog,
107
+ timeouts,
108
+ // FR-014: debug and test-device settings must not be able to alter
109
+ // production behavior, so they are dropped rather than carried and
110
+ // conditionally ignored somewhere further down.
111
+ testDeviceIds: isProduction ? [] : [...(config.testDeviceIds ?? [])],
112
+ retryByKey,
113
+ minRequestIntervalByKey,
114
+ consentTesting,
115
+ ignoredConsentTools
116
+ };
117
+ }
118
+
119
+ /**
120
+ * Neutralizes the consent testing tools in production (FR-113).
121
+ *
122
+ * Dropped here, at the single validation point, rather than checked wherever
123
+ * they are used. That is what makes the guarantee provable: a rule enforced in
124
+ * one place can be asserted by a test, while one spread across the consent
125
+ * module's call sites is a hope. It is the same reasoning that makes the ad-unit
126
+ * substitution guarantee hold, and it is why both are enforced identically.
127
+ *
128
+ * The names of what was dropped are returned rather than only logged, so an
129
+ * automated test — and the demo app's diagnostics screen — can see it.
130
+ */
131
+ function resolveConsentTesting(testing, isProduction) {
132
+ if (!testing || !isProduction) {
133
+ return {
134
+ consentTesting: testing,
135
+ ignoredConsentTools: []
136
+ };
137
+ }
138
+ const ignored = [];
139
+ if (testing.debugGeography !== undefined && testing.debugGeography !== 'disabled') {
140
+ ignored.push('debugGeography');
141
+ }
142
+ if (testing.resetOnStart === true) {
143
+ ignored.push('resetOnStart');
144
+ }
145
+ return {
146
+ consentTesting: undefined,
147
+ ignoredConsentTools: ignored
148
+ };
149
+ }
150
+ //# sourceMappingURL=validate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_errors","require","_resolveAdUnit","_timers","_requestThrottle","_enablement","_retryPolicy","FORMATS","Set","validateConfig","config","options","environment","isDevBuild","AdsConfigError","message","Array","isArray","placements","length","byKey","Map","placement","key","trim","has","placementKey","format","String","androidAdUnitId","set","timeouts","resolveTimeouts","adValidityMs","appOpenValidityMs","undecidedWarningMs","catalog","resolvePlacementAdUnits","from","values","retryByKey","minRequestIntervalByKey","resolveEffectiveRetry","retry","minRequestIntervalMs","undefined","defaultMinRequestIntervalMs","checkBand","MIN_REQUEST_INTERVAL_BOUNDS","isProduction","consentTesting","ignoredConsentTools","resolveConsentTesting","enablement","toEnablement","enabled","testDeviceIds","testing","ignored","debugGeography","push","resetOnStart"],"sourceRoot":"../../../src","sources":["config/validate.ts"],"mappings":";;;;;;AAYA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiBA,MAAMM,OAA4B,GAAG,IAAIC,GAAG,CAAW,C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,OAAO,CAACE,IAAI,CAAC,cAAc,CAAC;EAC7B;EACA,OAAO;IAAEV,cAAc,EAAEL,SAAS;IAAEM,mBAAmB,EAAEO;EAAQ,CAAC;AACnE","ignoreList":[]}
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createAdOriginatedTracker = createAdOriginatedTracker;
7
+ var _timers = require("./timers.js");
8
+ /**
9
+ * Ad-originated return detection (FR-128).
10
+ *
11
+ * This is the reason app-open belongs in the package rather than in the app.
12
+ * Every other app-open rule — when to show one, how often, on which screens — is
13
+ * policy the app owns. This one is not policy; it is a fact only the package
14
+ * holds. When a user dismisses a full-screen ad, or comes back from a browser an
15
+ * ad opened, the app sees an ordinary return to the foreground and has no way to
16
+ * tell it apart from any other. Showing an app-open ad on that return means
17
+ * showing an ad immediately after an ad, which is both a poor experience and the
18
+ * kind of thing store review notices.
19
+ *
20
+ * The package knows, because it holds the full-screen lock and it sees the click
21
+ * events. So it refuses, with a reason distinct from `busy` and `not_ready` so
22
+ * the app can tell what happened.
23
+ *
24
+ * **Bounded on both sides, deliberately.** Arming has to be tied to something
25
+ * that actually happened, and it has to expire:
26
+ *
27
+ * - Armed when the provider reports a full-screen ad opened, or on a click —
28
+ * that second case is a browser the ad opened, which is the only signal the
29
+ * provider gives for it. Arming is deliberately not tied to the app
30
+ * reporting that it went to the background; see `noteFullScreenShown`.
31
+ * - Disarmed without firing if the app was away longer than
32
+ * `AD_RETURN_MAX_AWAY_MS`. Someone who left, did something else, and came
33
+ * back an hour later is not returning from an ad, and treating them as if
34
+ * they were would refuse a legitimate show.
35
+ * - Refusals last `AD_RETURN_GRACE_MS` after the return, then stop. The window
36
+ * only needs to cover the moment right after the return, where an app-open
37
+ * show would otherwise fire. A window that outlived that moment would start
38
+ * refusing shows that have nothing to do with the ad.
39
+ *
40
+ * Three limits are worth stating plainly, because they are limits rather than
41
+ * defects and the documentation must not imply otherwise:
42
+ *
43
+ * 1. It cannot survive process death. If the OS kills the app while an ad is
44
+ * on screen, the return is a cold start and nothing links it to the ad.
45
+ * 2. It depends on the app reporting `setAppActive` faithfully — an obligation
46
+ * 0.1.0 already imposes for staleness re-evaluation, not a new one.
47
+ * 3. A browser opened by an ad without a preceding click event is undetectable.
48
+ *
49
+ * Pure state. No listener, no timer — it is driven entirely by transitions the
50
+ * package already observes, which is why `dispose()` has nothing extra to
51
+ * release for it.
52
+ */
53
+
54
+ function createAdOriginatedTracker() {
55
+ let lastClickAtMs = null;
56
+ let armedAtMs = null;
57
+ let refusalUntilMs = null;
58
+ return {
59
+ /**
60
+ * Arming happens here — when the provider says an ad is on screen — and
61
+ * deliberately **not** when the app reports going to the background.
62
+ *
63
+ * That was the first design and it does not survive a real device. React
64
+ * Native delivers app-state changes over the bridge, and while the app is
65
+ * backgrounded its JS thread is throttled, so the `background` event is
66
+ * routinely processed only once the app is already returning. By then the
67
+ * ad has been dismissed and the full-screen lock released, so sampling the
68
+ * lock at that moment reports "no ad was showing" and the return is let
69
+ * through — the exact case FR-128 exists to catch. Arming on a fact the
70
+ * provider reports, rather than on the timeliness of an event, removes the
71
+ * race entirely.
72
+ */
73
+ noteFullScreenShown(nowMs) {
74
+ armedAtMs = nowMs;
75
+ },
76
+ noteClick(nowMs) {
77
+ lastClickAtMs = nowMs;
78
+ // A click is itself grounds to arm: the ad may be opening a browser,
79
+ // and if it is, no `opened` callback will follow.
80
+ armedAtMs = nowMs;
81
+ },
82
+ noteBackground(nowMs) {
83
+ // Only meaningful for the browser case, and only as a refinement: a
84
+ // background that closely follows a click is that browser opening.
85
+ if (lastClickAtMs !== null && nowMs - lastClickAtMs <= _timers.AD_CLICK_WINDOW_MS) {
86
+ armedAtMs = nowMs;
87
+ }
88
+ },
89
+ noteForeground(nowMs) {
90
+ if (armedAtMs === null) {
91
+ return;
92
+ }
93
+ const away = nowMs - armedAtMs;
94
+ armedAtMs = null;
95
+ lastClickAtMs = null;
96
+ if (away > _timers.AD_RETURN_MAX_AWAY_MS) {
97
+ // Too long to still be attributable to the ad. Not a refusal.
98
+ return;
99
+ }
100
+ refusalUntilMs = nowMs + _timers.AD_RETURN_GRACE_MS;
101
+ },
102
+ isRefusing(nowMs) {
103
+ if (refusalUntilMs === null) {
104
+ return false;
105
+ }
106
+ if (nowMs >= refusalUntilMs) {
107
+ refusalUntilMs = null;
108
+ return false;
109
+ }
110
+ return true;
111
+ },
112
+ reset() {
113
+ lastClickAtMs = null;
114
+ armedAtMs = null;
115
+ refusalUntilMs = null;
116
+ }
117
+ };
118
+ }
119
+ //# sourceMappingURL=adOriginatedReturn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_timers","require","createAdOriginatedTracker","lastClickAtMs","armedAtMs","refusalUntilMs","noteFullScreenShown","nowMs","noteClick","noteBackground","AD_CLICK_WINDOW_MS","noteForeground","away","AD_RETURN_MAX_AWAY_MS","AD_RETURN_GRACE_MS","isRefusing","reset"],"sourceRoot":"../../../src","sources":["core/adOriginatedReturn.ts"],"mappings":";;;;;;AA8CA,IAAAA,OAAA,GAAAC,OAAA;AA9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAmBO,SAASC,yBAAyBA,CAAA,EAAwB;EAChE,IAAIC,aAA4B,GAAG,IAAI;EACvC,IAAIC,SAAwB,GAAG,IAAI;EACnC,IAAIC,cAA6B,GAAG,IAAI;EAExC,OAAO;IACN;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACEC,mBAAmBA,CAACC,KAAK,EAAE;MAC1BH,SAAS,GAAGG,KAAK;IAClB,CAAC;IAEDC,SAASA,CAACD,KAAK,EAAE;MAChBJ,aA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