@adobe/alloy 2.20.0-alpha.1 → 2.20.0-beta.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 (392) hide show
  1. package/libEs5/baseCode/index.js +2 -3
  2. package/libEs5/components/ActivityCollector/attachClickActivityCollector.js +2 -3
  3. package/libEs5/components/ActivityCollector/configValidators.js +3 -5
  4. package/libEs5/components/ActivityCollector/createGetLinkDetails.js +2 -3
  5. package/libEs5/components/ActivityCollector/createLinkClick.js +2 -3
  6. package/libEs5/components/ActivityCollector/getLinkName.js +2 -3
  7. package/libEs5/components/ActivityCollector/getLinkRegion.js +2 -3
  8. package/libEs5/components/ActivityCollector/index.js +1 -2
  9. package/libEs5/components/ActivityCollector/utils.js +11 -21
  10. package/libEs5/components/Audiences/index.js +1 -2
  11. package/libEs5/components/Audiences/injectProcessDestinations.js +18 -16
  12. package/libEs5/components/Audiences/injectProcessResponse.js +2 -3
  13. package/libEs5/components/Context/createComponent.js +2 -3
  14. package/libEs5/components/Context/implementationDetails.js +2 -3
  15. package/libEs5/components/Context/index.js +17 -15
  16. package/libEs5/components/Context/injectDevice.js +2 -3
  17. package/libEs5/components/Context/injectEnvironment.js +6 -7
  18. package/libEs5/components/Context/injectHighEntropyUserAgentHints.js +15 -16
  19. package/libEs5/components/Context/injectPlaceContext.js +2 -3
  20. package/libEs5/components/Context/injectTimestamp.js +2 -3
  21. package/libEs5/components/Context/injectWeb.js +2 -3
  22. package/libEs5/components/DataCollector/index.js +1 -2
  23. package/libEs5/components/DataCollector/validateApplyResponse.js +2 -3
  24. package/libEs5/components/DataCollector/validateUserEventOptions.js +2 -3
  25. package/libEs5/components/DecisioningEngine/consequenceAdapters/inAppMessageConsequenceAdapter.js +2 -3
  26. package/libEs5/components/DecisioningEngine/consequenceAdapters/schemaTypeConsequenceAdapter.js +2 -3
  27. package/libEs5/components/DecisioningEngine/constants.js +4 -7
  28. package/libEs5/components/DecisioningEngine/createApplyResponse.js +2 -3
  29. package/libEs5/components/DecisioningEngine/createConsequenceAdapter.js +17 -16
  30. package/libEs5/components/DecisioningEngine/createContextProvider.js +18 -16
  31. package/libEs5/components/DecisioningEngine/createDecisionHistory.js +2 -3
  32. package/libEs5/components/DecisioningEngine/createDecisionProvider.js +2 -3
  33. package/libEs5/components/DecisioningEngine/createEvaluableRulesetPayload.js +18 -16
  34. package/libEs5/components/DecisioningEngine/createEvaluateRulesetsCommand.js +2 -3
  35. package/libEs5/components/DecisioningEngine/createEventRegistry.js +20 -20
  36. package/libEs5/components/DecisioningEngine/createOnResponseHandler.js +18 -16
  37. package/libEs5/components/DecisioningEngine/createSubscribeRulesetItems.js +18 -16
  38. package/libEs5/components/DecisioningEngine/index.js +19 -19
  39. package/libEs5/components/DecisioningEngine/utils.js +10 -18
  40. package/libEs5/components/EventMerge/createComponent.js +2 -3
  41. package/libEs5/components/EventMerge/createEventMergeId.js +2 -3
  42. package/libEs5/components/EventMerge/index.js +1 -2
  43. package/libEs5/components/Identity/addEcidQueryToPayload.js +2 -3
  44. package/libEs5/components/Identity/addEcidToPayload.js +2 -3
  45. package/libEs5/components/Identity/appendIdentityToUrl/appendIdentityToUrlOptionsValidator.js +2 -3
  46. package/libEs5/components/Identity/appendIdentityToUrl/injectAppendIdentityToUrl.js +4 -5
  47. package/libEs5/components/Identity/configValidators.js +1 -2
  48. package/libEs5/components/Identity/constants/authState.js +3 -6
  49. package/libEs5/components/Identity/constants/defaultIdSyncTtlMinutes.js +1 -2
  50. package/libEs5/components/Identity/createComponent.js +2 -3
  51. package/libEs5/components/Identity/createLegacyIdentity.js +8 -6
  52. package/libEs5/components/Identity/getEcidFromResponse.js +2 -3
  53. package/libEs5/components/Identity/getIdentity/createGetIdentity.js +2 -3
  54. package/libEs5/components/Identity/getIdentity/createIdentityRequest.js +2 -3
  55. package/libEs5/components/Identity/getIdentity/createIdentityRequestPayload.js +2 -3
  56. package/libEs5/components/Identity/getIdentity/getIdentityOptionsValidator.js +2 -3
  57. package/libEs5/components/Identity/index.js +3 -3
  58. package/libEs5/components/Identity/injectAddLegacyEcidToPayload.js +2 -3
  59. package/libEs5/components/Identity/injectAddQueryStringIdentityToPayload.js +18 -15
  60. package/libEs5/components/Identity/injectAwaitIdentityCookie.js +9 -14
  61. package/libEs5/components/Identity/injectEnsureSingleIdentity.js +8 -6
  62. package/libEs5/components/Identity/injectHandleResponseForIdSyncs.js +2 -3
  63. package/libEs5/components/Identity/injectProcessIdSyncs.js +2 -3
  64. package/libEs5/components/Identity/injectSetDomainForInitialIdentityPayload.js +2 -3
  65. package/libEs5/components/Identity/visitorService/awaitVisitorOptIn.js +2 -3
  66. package/libEs5/components/Identity/visitorService/getVisitor.js +2 -3
  67. package/libEs5/components/Identity/visitorService/injectGetEcidFromVisitor.js +2 -3
  68. package/libEs5/components/LegacyMediaAnalytics/{media → constants}/constants.js +15 -25
  69. package/libEs5/components/LegacyMediaAnalytics/{media → constants}/mediaKeysToXdmConverter.js +3 -5
  70. package/libEs5/components/LegacyMediaAnalytics/createGetInstance.js +246 -0
  71. package/libEs5/components/LegacyMediaAnalytics/createLegacyMediaComponent.js +87 -0
  72. package/libEs5/components/LegacyMediaAnalytics/createMediaHelper.js +7 -14
  73. package/libEs5/components/LegacyMediaAnalytics/index.js +43 -20
  74. package/libEs5/components/LibraryInfo/index.js +21 -17
  75. package/libEs5/components/MachineLearning/index.js +1 -2
  76. package/libEs5/components/MachineLearning/processResponse.js +2 -3
  77. package/libEs5/components/Personalization/constants/loggerMessage.js +2 -4
  78. package/libEs5/components/Personalization/constants/scopeType.js +3 -6
  79. package/libEs5/components/Personalization/constants/surface.js +4 -8
  80. package/libEs5/components/Personalization/createActionsProvider.js +2 -3
  81. package/libEs5/components/Personalization/createApplyPropositions.js +19 -17
  82. package/libEs5/components/Personalization/createClickStorage.js +8 -6
  83. package/libEs5/components/Personalization/createCollect.js +2 -3
  84. package/libEs5/components/Personalization/createComponent.js +7 -4
  85. package/libEs5/components/Personalization/createFetchDataHandler.js +28 -20
  86. package/libEs5/components/Personalization/createGetPageLocation.js +2 -3
  87. package/libEs5/{utils/debounce.js → components/Personalization/createHandleConsentFlicker.js} +13 -14
  88. package/libEs5/components/Personalization/createNotificationHandler.js +10 -5
  89. package/libEs5/components/Personalization/createOnClickHandler.js +2 -3
  90. package/libEs5/components/Personalization/createOnDecisionHandler.js +3 -4
  91. package/libEs5/components/Personalization/createPersonalizationDetails.js +13 -14
  92. package/libEs5/components/Personalization/createPreprocessors.js +16 -14
  93. package/libEs5/components/Personalization/createSetTargetMigration.js +2 -3
  94. package/libEs5/components/Personalization/createViewCacheManager.js +2 -3
  95. package/libEs5/components/Personalization/createViewChangeHandler.js +2 -3
  96. package/libEs5/components/Personalization/dom-actions/action.js +2 -3
  97. package/libEs5/components/Personalization/dom-actions/addNonceToInlineStyleElements.js +2 -3
  98. package/libEs5/components/Personalization/dom-actions/appendHtml.js +2 -3
  99. package/libEs5/components/Personalization/dom-actions/clicks/collectClicks.js +3 -4
  100. package/libEs5/components/Personalization/dom-actions/createPreprocess.js +2 -3
  101. package/libEs5/components/Personalization/dom-actions/createRedirect.js +2 -3
  102. package/libEs5/components/Personalization/dom-actions/dom/createFragment.js +2 -3
  103. package/libEs5/components/Personalization/dom-actions/dom/getAttribute.js +2 -3
  104. package/libEs5/components/Personalization/dom-actions/dom/getChildNodes.js +2 -3
  105. package/libEs5/components/Personalization/dom-actions/dom/getChildren.js +2 -3
  106. package/libEs5/components/Personalization/dom-actions/dom/getElementById.js +2 -3
  107. package/libEs5/components/Personalization/dom-actions/dom/getFirstChild.js +2 -3
  108. package/libEs5/components/Personalization/dom-actions/dom/getNextSibling.js +2 -3
  109. package/libEs5/components/Personalization/dom-actions/dom/getNonce.js +3 -5
  110. package/libEs5/components/Personalization/dom-actions/dom/getParent.js +2 -3
  111. package/libEs5/components/Personalization/dom-actions/dom/helperForEq.js +3 -5
  112. package/libEs5/components/Personalization/dom-actions/dom/insertAfter.js +2 -3
  113. package/libEs5/components/Personalization/dom-actions/dom/insertBefore.js +2 -3
  114. package/libEs5/components/Personalization/dom-actions/dom/matchesSelectorWithEq.js +2 -3
  115. package/libEs5/components/Personalization/dom-actions/dom/removeAttribute.js +2 -3
  116. package/libEs5/components/Personalization/dom-actions/dom/selectNodesWithEq.js +16 -19
  117. package/libEs5/components/Personalization/dom-actions/dom/setAttribute.js +2 -3
  118. package/libEs5/components/Personalization/dom-actions/dom/setStyle.js +2 -3
  119. package/libEs5/components/Personalization/dom-actions/images.js +4 -7
  120. package/libEs5/components/Personalization/dom-actions/initDomActionsModules.js +2 -3
  121. package/libEs5/components/Personalization/dom-actions/insertHtmlAfter.js +2 -3
  122. package/libEs5/components/Personalization/dom-actions/insertHtmlBefore.js +2 -3
  123. package/libEs5/components/Personalization/dom-actions/prependHtml.js +2 -3
  124. package/libEs5/components/Personalization/dom-actions/rearrangeChildren.js +2 -3
  125. package/libEs5/components/Personalization/dom-actions/remapCustomCodeOffers.js +2 -3
  126. package/libEs5/components/Personalization/dom-actions/remapHeadOffers.js +2 -3
  127. package/libEs5/components/Personalization/dom-actions/replaceHtml.js +2 -3
  128. package/libEs5/components/Personalization/dom-actions/scripts.js +22 -24
  129. package/libEs5/components/Personalization/dom-actions/setAttributes.js +2 -3
  130. package/libEs5/components/Personalization/dom-actions/setHtml.js +2 -3
  131. package/libEs5/components/Personalization/dom-actions/setStyles.js +2 -3
  132. package/libEs5/components/Personalization/dom-actions/setText.js +2 -3
  133. package/libEs5/components/Personalization/dom-actions/swapImage.js +2 -3
  134. package/libEs5/components/Personalization/event.js +19 -18
  135. package/libEs5/components/Personalization/flicker/index.js +21 -22
  136. package/libEs5/components/Personalization/handlers/createProcessDomAction.js +8 -6
  137. package/libEs5/components/Personalization/handlers/createProcessHtmlContent.js +2 -3
  138. package/libEs5/components/Personalization/handlers/createProcessInAppMessage.js +18 -16
  139. package/libEs5/components/Personalization/handlers/createProcessPropositions.js +3 -4
  140. package/libEs5/components/Personalization/handlers/createProcessRedirect.js +2 -4
  141. package/libEs5/components/Personalization/handlers/injectCreateProposition.js +24 -22
  142. package/libEs5/components/Personalization/handlers/processDefaultContent.js +2 -3
  143. package/libEs5/components/Personalization/in-app-message-actions/actions/displayIframeContent.js +25 -29
  144. package/libEs5/components/Personalization/in-app-message-actions/initInAppMessageActionsModules.js +2 -3
  145. package/libEs5/components/Personalization/in-app-message-actions/utils.js +3 -5
  146. package/libEs5/components/Personalization/index.js +31 -22
  147. package/libEs5/components/Personalization/utils/addRenderAttemptedToDecisions.js +2 -3
  148. package/libEs5/components/Personalization/utils/createAsyncArray.js +2 -3
  149. package/libEs5/components/Personalization/utils/isAuthoringModeEnabled.js +2 -3
  150. package/libEs5/components/Personalization/utils/surfaceUtils.js +4 -7
  151. package/libEs5/components/Personalization/validateApplyPropositionsOptions.js +3 -5
  152. package/libEs5/components/Privacy/computeConsentHash.js +13 -14
  153. package/libEs5/components/Privacy/createComponent.js +16 -14
  154. package/libEs5/components/Privacy/createConsentHashStore.js +2 -3
  155. package/libEs5/components/Privacy/createConsentRequest.js +2 -3
  156. package/libEs5/components/Privacy/createConsentRequestPayload.js +2 -3
  157. package/libEs5/components/Privacy/createStoredConsent.js +2 -3
  158. package/libEs5/components/Privacy/index.js +1 -2
  159. package/libEs5/components/Privacy/injectSendSetConsentRequest.js +2 -3
  160. package/libEs5/components/Privacy/parseConsentCookie.js +4 -5
  161. package/libEs5/components/Privacy/validateSetConsentOptions.js +2 -3
  162. package/libEs5/components/StreamingMedia/configValidators.js +24 -0
  163. package/libEs5/components/{MediaCollection → StreamingMedia}/constants/eventTypes.js +14 -5
  164. package/{libEs6/utils/debounce.js → libEs5/components/StreamingMedia/constants/playbackState.js} +9 -12
  165. package/libEs5/components/{MediaCollection → StreamingMedia}/createMediaEventManager.js +27 -24
  166. package/libEs5/components/{MediaCollection → StreamingMedia}/createMediaRequest.js +2 -3
  167. package/libEs5/components/StreamingMedia/createMediaResponseHandler.js +57 -0
  168. package/libEs5/components/{MediaCollection → StreamingMedia}/createMediaSessionCacheManager.js +21 -25
  169. package/libEs5/components/StreamingMedia/createStreamingMediaComponent.js +72 -0
  170. package/libEs5/components/StreamingMedia/createTrackMediaEvent.js +90 -0
  171. package/libEs5/components/StreamingMedia/createTrackMediaSession.js +52 -0
  172. package/libEs5/components/StreamingMedia/index.js +69 -0
  173. package/libEs5/components/StreamingMedia/validateMediaEventOptions.js +40 -0
  174. package/libEs5/components/{MediaCollection → StreamingMedia}/validateMediaSessionOptions.js +3 -4
  175. package/libEs5/constants/apiVersion.js +1 -2
  176. package/libEs5/constants/browser.js +7 -14
  177. package/libEs5/constants/consentPurpose.js +1 -2
  178. package/libEs5/constants/consentStatus.js +3 -6
  179. package/libEs5/constants/contentType.js +2 -4
  180. package/libEs5/constants/cookieNameKey.js +3 -6
  181. package/libEs5/constants/cookieNamePrefix.js +1 -2
  182. package/libEs5/constants/coreCommands.js +2 -4
  183. package/libEs5/constants/debugQueryParam.js +1 -2
  184. package/libEs5/constants/decisionProvider.js +1 -2
  185. package/libEs5/constants/domain.js +2 -4
  186. package/libEs5/constants/ecidNamespace.js +1 -2
  187. package/libEs5/constants/edgeBasePath.js +1 -2
  188. package/libEs5/constants/elementAttribute.js +1 -2
  189. package/libEs5/constants/eventType.js +5 -10
  190. package/libEs5/constants/handle.js +1 -2
  191. package/libEs5/constants/highEntropyUserAgentClientHints.js +1 -2
  192. package/libEs5/constants/httpHeaderNames.js +2 -4
  193. package/libEs5/constants/httpStatusCode.js +5 -10
  194. package/libEs5/constants/identityMapAuthenticatedState.js +3 -6
  195. package/libEs5/constants/legacyCookies.js +3 -6
  196. package/libEs5/constants/libraryName.js +1 -2
  197. package/libEs5/constants/libraryVersion.js +1 -2
  198. package/libEs5/constants/namespace.js +1 -2
  199. package/libEs5/constants/pageWideScope.js +1 -2
  200. package/libEs5/constants/propositionEventType.js +20 -21
  201. package/libEs5/constants/queryStringIdentityParam.js +1 -2
  202. package/libEs5/constants/schema.js +10 -20
  203. package/libEs5/constants/shadowSeparator.js +1 -2
  204. package/libEs5/constants/tagName.js +7 -14
  205. package/libEs5/core/buildAndValidateConfig.js +19 -17
  206. package/libEs5/core/componentCreators.js +9 -4
  207. package/libEs5/core/config/createConfig.js +1 -2
  208. package/libEs5/core/config/createCoreConfigs.js +2 -3
  209. package/libEs5/core/consent/createConsent.js +5 -3
  210. package/libEs5/core/consent/createConsentStateMachine.js +41 -13
  211. package/libEs5/core/createComponentRegistry.js +5 -3
  212. package/libEs5/core/createCookieTransfer.js +2 -3
  213. package/libEs5/core/createEvent.js +13 -14
  214. package/libEs5/core/createEventManager.js +8 -6
  215. package/libEs5/core/createInstanceFunction.js +2 -3
  216. package/libEs5/core/createLifecycle.js +2 -3
  217. package/libEs5/core/createLogController.js +2 -3
  218. package/libEs5/core/createLogger.js +2 -3
  219. package/libEs5/core/edgeNetwork/handleRequestFailure.js +2 -3
  220. package/libEs5/core/edgeNetwork/injectApplyResponse.js +2 -3
  221. package/libEs5/core/edgeNetwork/injectExtractEdgeInfo.js +2 -3
  222. package/libEs5/core/edgeNetwork/injectGetLocationHint.js +2 -3
  223. package/libEs5/core/edgeNetwork/injectProcessWarningsAndErrors.js +2 -3
  224. package/libEs5/core/edgeNetwork/injectSendEdgeNetworkRequest.js +2 -3
  225. package/libEs5/core/edgeNetwork/mergeLifecycleResponses.js +13 -14
  226. package/libEs5/core/index.js +3 -5
  227. package/libEs5/core/initializeComponents.js +2 -3
  228. package/libEs5/core/injectCreateResponse.js +2 -3
  229. package/libEs5/core/injectExecuteCommand.js +2 -3
  230. package/libEs5/core/injectHandleError.js +2 -3
  231. package/libEs5/core/injectShouldTransferCookie.js +2 -3
  232. package/libEs5/core/network/getRequestRetryDelay.js +2 -3
  233. package/libEs5/core/network/injectSendNetworkRequest.js +18 -16
  234. package/libEs5/core/network/isRequestRetryable.js +2 -3
  235. package/libEs5/core/network/requestMethods/injectSendBeaconRequest.js +2 -3
  236. package/libEs5/core/network/requestMethods/injectSendFetchRequest.js +2 -3
  237. package/libEs5/core/network/requestMethods/injectSendXhrRequest.js +2 -3
  238. package/libEs5/core/validateCommandOptions.js +2 -3
  239. package/libEs5/index.js +2 -3
  240. package/libEs5/utils/areThirdPartyCookiesSupportedByDefault.js +2 -3
  241. package/libEs5/utils/assign.js +1 -2
  242. package/libEs5/utils/assignConcatArrayValues.js +13 -14
  243. package/libEs5/utils/assignIf.js +2 -3
  244. package/libEs5/utils/clone.js +2 -3
  245. package/libEs5/utils/cookieJar.js +2 -3
  246. package/libEs5/utils/crc32.js +1 -2
  247. package/libEs5/utils/createCallbackAggregator.js +2 -3
  248. package/libEs5/utils/createLoggingCookieJar.js +8 -6
  249. package/libEs5/utils/createMerger.js +2 -3
  250. package/libEs5/utils/createSubscription.js +12 -13
  251. package/libEs5/utils/createTaskQueue.js +2 -3
  252. package/libEs5/utils/deduplicateArray.js +2 -3
  253. package/libEs5/utils/deepAssign.js +2 -3
  254. package/libEs5/utils/defer.js +2 -3
  255. package/libEs5/utils/dom/appendNode.js +2 -3
  256. package/libEs5/utils/dom/awaitSelector.js +7 -13
  257. package/libEs5/utils/dom/createNode.js +2 -3
  258. package/libEs5/utils/dom/isShadowSelector.js +2 -3
  259. package/libEs5/utils/dom/matchesSelector.js +2 -3
  260. package/libEs5/utils/dom/querySelectorAll.js +2 -3
  261. package/libEs5/utils/dom/removeNode.js +2 -3
  262. package/libEs5/utils/dom/selectNodes.js +2 -3
  263. package/libEs5/utils/dom/selectNodesWithShadow.js +2 -3
  264. package/libEs5/utils/endsWith.js +2 -3
  265. package/libEs5/utils/filterObject.js +17 -15
  266. package/libEs5/utils/find.js +2 -3
  267. package/libEs5/utils/fireImage.js +2 -3
  268. package/libEs5/utils/flatMap.js +2 -3
  269. package/libEs5/utils/flattenArray.js +2 -3
  270. package/libEs5/utils/flattenObject.js +4 -5
  271. package/libEs5/utils/getApexDomain.js +2 -3
  272. package/libEs5/utils/getBrowser.js +17 -16
  273. package/libEs5/utils/getLastArrayItems.js +2 -3
  274. package/libEs5/utils/getNamespacedCookieName.js +2 -3
  275. package/libEs5/utils/groupBy.js +2 -3
  276. package/libEs5/utils/includes.js +2 -3
  277. package/libEs5/utils/injectDoesIdentityCookieExist.js +2 -3
  278. package/libEs5/utils/injectFireReferrerHideableImage.js +14 -15
  279. package/libEs5/utils/injectStorage.js +2 -3
  280. package/libEs5/utils/intersection.js +2 -3
  281. package/libEs5/utils/isBlankString.js +2 -3
  282. package/libEs5/utils/isBoolean.js +2 -3
  283. package/libEs5/utils/isEmptyObject.js +2 -3
  284. package/libEs5/utils/isFunction.js +2 -3
  285. package/libEs5/utils/isInteger.js +2 -3
  286. package/libEs5/utils/isNamespacedCookieName.js +2 -3
  287. package/libEs5/utils/isNil.js +2 -3
  288. package/libEs5/utils/isNonEmptyArray.js +2 -3
  289. package/libEs5/utils/isNonEmptyString.js +2 -3
  290. package/libEs5/utils/isNumber.js +2 -3
  291. package/libEs5/utils/isObject.js +13 -14
  292. package/libEs5/utils/isString.js +2 -3
  293. package/libEs5/utils/isUnique.js +2 -3
  294. package/libEs5/utils/isValidRegExp.js +2 -3
  295. package/libEs5/utils/memoize.js +2 -3
  296. package/libEs5/utils/noop.js +1 -2
  297. package/libEs5/utils/padStart.js +2 -3
  298. package/libEs5/utils/parseUrl.js +17 -15
  299. package/libEs5/utils/prepareConfigOverridesForEdge.js +13 -14
  300. package/libEs5/utils/querystring.js +1 -2
  301. package/libEs5/utils/request/createAddIdentity.js +2 -3
  302. package/libEs5/utils/request/createDataCollectionRequest.js +2 -3
  303. package/libEs5/utils/request/createDataCollectionRequestPayload.js +2 -3
  304. package/libEs5/utils/request/createGetAssuranceValidationTokenParams.js +2 -3
  305. package/libEs5/utils/request/createHasIdentity.js +2 -3
  306. package/libEs5/utils/request/createRequest.js +2 -3
  307. package/libEs5/utils/request/createRequestParams.js +2 -3
  308. package/libEs5/utils/request/createRequestPayload.js +2 -3
  309. package/libEs5/utils/sanitizeOrgIdForCookieName.js +2 -3
  310. package/libEs5/utils/stackError.js +2 -3
  311. package/libEs5/utils/startsWith.js +2 -3
  312. package/libEs5/utils/stringToBoolean.js +2 -3
  313. package/libEs5/utils/toArray.js +2 -3
  314. package/libEs5/utils/toError.js +2 -3
  315. package/libEs5/utils/toISOStringLocal.js +2 -3
  316. package/libEs5/utils/toInteger.js +2 -3
  317. package/libEs5/utils/updateErrorMessage.js +2 -3
  318. package/libEs5/utils/uuid.js +1 -2
  319. package/libEs5/utils/validateConfigOverride.js +1 -2
  320. package/libEs5/utils/validateIdentityMap.js +2 -3
  321. package/libEs5/utils/validation/booleanValidator.js +2 -3
  322. package/libEs5/utils/validation/callbackValidator.js +2 -3
  323. package/libEs5/utils/validation/createAnyOfValidator.js +2 -3
  324. package/libEs5/utils/validation/createArrayOfValidator.js +2 -3
  325. package/libEs5/utils/validation/createDefaultValidator.js +2 -3
  326. package/libEs5/utils/validation/createDeprecatedValidator.js +18 -19
  327. package/libEs5/utils/validation/createLiteralValidator.js +2 -3
  328. package/libEs5/utils/validation/createMapOfValuesValidator.js +2 -3
  329. package/libEs5/utils/validation/createMaximumValidator.js +2 -3
  330. package/libEs5/utils/validation/createMinimumValidator.js +2 -3
  331. package/libEs5/utils/validation/createNoUnknownFieldsValidator.js +2 -3
  332. package/libEs5/utils/validation/createNonEmptyValidator.js +2 -3
  333. package/libEs5/utils/validation/createObjectOfValidator.js +2 -3
  334. package/libEs5/utils/validation/createUniqueItemsValidator.js +2 -3
  335. package/libEs5/utils/validation/createUniqueValidator.js +2 -3
  336. package/libEs5/utils/validation/domainValidator.js +2 -3
  337. package/libEs5/utils/validation/index.js +84 -92
  338. package/libEs5/utils/validation/integerValidator.js +2 -3
  339. package/libEs5/utils/validation/matchesRegexpValidator.js +2 -3
  340. package/libEs5/utils/validation/numberValidator.js +2 -3
  341. package/libEs5/utils/validation/regexpValidator.js +2 -3
  342. package/libEs5/utils/validation/requiredValidator.js +2 -3
  343. package/libEs5/utils/validation/stringValidator.js +2 -3
  344. package/libEs5/utils/validation/utils.js +5 -9
  345. package/libEs5/utils/values.js +2 -3
  346. package/libEs6/components/ActivityCollector/index.js +0 -1
  347. package/libEs6/components/Identity/index.js +2 -1
  348. package/libEs6/components/Identity/injectAddQueryStringIdentityToPayload.js +5 -1
  349. package/libEs6/components/Identity/injectAwaitIdentityCookie.js +7 -11
  350. package/libEs6/components/Identity/injectEnsureSingleIdentity.js +4 -3
  351. package/libEs6/components/LegacyMediaAnalytics/{media → constants}/constants.js +3 -2
  352. package/libEs6/components/LegacyMediaAnalytics/createGetInstance.js +240 -0
  353. package/libEs6/components/LegacyMediaAnalytics/createLegacyMediaComponent.js +85 -0
  354. package/libEs6/components/LegacyMediaAnalytics/createMediaHelper.js +5 -11
  355. package/libEs6/components/LegacyMediaAnalytics/index.js +40 -18
  356. package/libEs6/components/LibraryInfo/index.js +3 -1
  357. package/libEs6/components/Personalization/createComponent.js +5 -1
  358. package/libEs6/components/Personalization/createFetchDataHandler.js +16 -6
  359. package/libEs6/components/Personalization/createHandleConsentFlicker.js +26 -0
  360. package/libEs6/components/Personalization/createNotificationHandler.js +6 -2
  361. package/libEs6/components/Personalization/createOnDecisionHandler.js +1 -1
  362. package/libEs6/components/Personalization/handlers/createProcessRedirect.js +0 -1
  363. package/libEs6/components/Personalization/index.js +11 -3
  364. package/libEs6/components/StreamingMedia/configValidators.js +22 -0
  365. package/libEs6/components/StreamingMedia/constants/eventTypes.js +31 -0
  366. package/libEs6/components/{MediaCollection/constants/eventTypes.js → StreamingMedia/constants/playbackState.js} +4 -9
  367. package/libEs6/components/{MediaCollection → StreamingMedia}/createMediaEventManager.js +23 -16
  368. package/libEs6/components/StreamingMedia/createMediaResponseHandler.js +58 -0
  369. package/libEs6/components/{MediaCollection → StreamingMedia}/createMediaSessionCacheManager.js +15 -19
  370. package/libEs6/components/StreamingMedia/createStreamingMediaComponent.js +69 -0
  371. package/libEs6/components/StreamingMedia/createTrackMediaEvent.js +88 -0
  372. package/libEs6/components/StreamingMedia/createTrackMediaSession.js +51 -0
  373. package/libEs6/components/StreamingMedia/index.js +64 -0
  374. package/libEs6/components/{MediaCollection → StreamingMedia}/validateMediaEventOptions.js +4 -3
  375. package/libEs6/components/{MediaCollection → StreamingMedia}/validateMediaSessionOptions.js +1 -1
  376. package/libEs6/constants/libraryVersion.js +1 -1
  377. package/libEs6/core/componentCreators.js +19 -3
  378. package/libEs6/core/consent/createConsent.js +3 -0
  379. package/libEs6/core/consent/createConsentStateMachine.js +34 -0
  380. package/libEs6/core/createComponentRegistry.js +3 -0
  381. package/package.json +19 -4
  382. package/libEs5/components/LegacyMediaAnalytics/createMediaAnalyticsTracker.js +0 -272
  383. package/libEs5/components/MediaCollection/createHeartbeatEngine.js +0 -63
  384. package/libEs5/components/MediaCollection/createUpdateMediaSessionState.js +0 -31
  385. package/libEs5/components/MediaCollection/index.js +0 -165
  386. package/libEs5/components/MediaCollection/validateMediaEventOptions.js +0 -35
  387. package/libEs6/components/LegacyMediaAnalytics/createMediaAnalyticsTracker.js +0 -276
  388. package/libEs6/components/MediaCollection/createHeartbeatEngine.js +0 -64
  389. package/libEs6/components/MediaCollection/createUpdateMediaSessionState.js +0 -30
  390. package/libEs6/components/MediaCollection/index.js +0 -164
  391. /package/libEs6/components/LegacyMediaAnalytics/{media → constants}/mediaKeysToXdmConverter.js +0 -0
  392. /package/libEs6/components/{MediaCollection → StreamingMedia}/createMediaRequest.js +0 -0
@@ -0,0 +1,240 @@
1
+ /*
2
+ Copyright 2024 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+ import { EVENT, MEDIA_EVENTS_INTERNAL } from "./constants/constants";
13
+ import { includes, isEmptyObject, isNonEmptyArray, isNumber } from "../../utils";
14
+ import { adsToXdmKeys, mediaToXdmKeys } from "./constants/mediaKeysToXdmConverter";
15
+ export default (({
16
+ logger,
17
+ trackMediaSession,
18
+ trackMediaEvent,
19
+ uuid
20
+ }) => {
21
+ let trackerState = {
22
+ qoe: null,
23
+ lastPlayhead: 0,
24
+ playerId: uuid()
25
+ };
26
+ const getEventType = ({
27
+ eventType
28
+ }) => {
29
+ if (eventType === EVENT.BufferComplete || eventType === EVENT.SeekComplete) {
30
+ return MEDIA_EVENTS_INTERNAL.Play;
31
+ }
32
+ if (eventType === EVENT.StateStart || eventType === EVENT.StateEnd) {
33
+ return MEDIA_EVENTS_INTERNAL.StateUpdate;
34
+ }
35
+ if (eventType === EVENT.SeekStart) {
36
+ return MEDIA_EVENTS_INTERNAL.Pause;
37
+ }
38
+ return eventType;
39
+ };
40
+ const createXdmObject = ({
41
+ eventType,
42
+ mediaDetails = {},
43
+ contextData = []
44
+ }) => {
45
+ const action = getEventType({
46
+ eventType
47
+ });
48
+ if (eventType === EVENT.StateStart) {
49
+ const xdm = {
50
+ eventType: `media.${action}`,
51
+ mediaCollection: {
52
+ statesStart: [mediaDetails]
53
+ }
54
+ };
55
+ return xdm;
56
+ }
57
+ if (eventType === EVENT.StateEnd) {
58
+ const xdm = {
59
+ eventType: `media.${action}`,
60
+ mediaCollection: {
61
+ statesEnd: [mediaDetails]
62
+ }
63
+ };
64
+ return xdm;
65
+ }
66
+ const xdm = {
67
+ eventType: `media.${action}`,
68
+ mediaCollection: {
69
+ ...mediaDetails
70
+ }
71
+ };
72
+ const customMetadata = [];
73
+ Object.keys(contextData).forEach(key => {
74
+ if (mediaToXdmKeys[key]) {
75
+ xdm.mediaCollection.sessionDetails[mediaToXdmKeys[key]] = contextData[key];
76
+ } else if (adsToXdmKeys[key]) {
77
+ xdm.mediaCollection.advertisingDetails[adsToXdmKeys[key]] = contextData[key];
78
+ } else {
79
+ customMetadata.push({
80
+ name: key,
81
+ value: contextData[key]
82
+ });
83
+ }
84
+ });
85
+ if (isNonEmptyArray(customMetadata)) {
86
+ xdm.mediaCollection.customMetadata = customMetadata;
87
+ }
88
+ return xdm;
89
+ };
90
+ return {
91
+ trackSessionStart: (mediaObject, contextData = {}) => {
92
+ if (isEmptyObject(mediaObject)) {
93
+ logger.warn("Invalid media object");
94
+ return {};
95
+ }
96
+ if (trackerState === null) {
97
+ logger.warn("The Media Session was completed. Restarting a new session.");
98
+ trackerState = {
99
+ qoe: null,
100
+ lastPlayhead: 0,
101
+ playerId: uuid()
102
+ };
103
+ }
104
+ const xdm = createXdmObject({
105
+ eventType: MEDIA_EVENTS_INTERNAL.SessionStart,
106
+ mediaDetails: mediaObject,
107
+ contextData
108
+ });
109
+ return trackMediaSession({
110
+ playerId: trackerState.playerId,
111
+ getPlayerDetails: () => {
112
+ return {
113
+ playhead: trackerState.lastPlayhead,
114
+ qoeDataDetails: trackerState.qoe
115
+ };
116
+ },
117
+ xdm
118
+ });
119
+ },
120
+ trackPlay: () => {
121
+ if (trackerState === null) {
122
+ logger.warn("The Media Session was completed.");
123
+ return {};
124
+ }
125
+ const xdm = createXdmObject({
126
+ eventType: MEDIA_EVENTS_INTERNAL.Play
127
+ });
128
+ return trackMediaEvent({
129
+ playerId: trackerState.playerId,
130
+ xdm
131
+ });
132
+ },
133
+ trackPause: () => {
134
+ if (trackerState === null) {
135
+ logger.warn("The Media Session was completed.");
136
+ return {};
137
+ }
138
+ const xdm = createXdmObject({
139
+ eventType: MEDIA_EVENTS_INTERNAL.Pause
140
+ });
141
+ return trackMediaEvent({
142
+ playerId: trackerState.playerId,
143
+ xdm
144
+ });
145
+ },
146
+ trackSessionEnd: () => {
147
+ if (trackerState === null) {
148
+ logger.warn("The Media Session was completed.");
149
+ return {};
150
+ }
151
+ const xdm = createXdmObject({
152
+ eventType: MEDIA_EVENTS_INTERNAL.SessionEnd
153
+ });
154
+ return trackMediaEvent({
155
+ playerId: trackerState.playerId,
156
+ xdm
157
+ });
158
+ },
159
+ trackComplete: () => {
160
+ if (trackerState === null) {
161
+ logger.warn("The Media Session was completed.");
162
+ return {};
163
+ }
164
+ const xdm = createXdmObject({
165
+ eventType: MEDIA_EVENTS_INTERNAL.SessionComplete
166
+ });
167
+ return trackMediaEvent({
168
+ playerId: trackerState.playerId,
169
+ xdm
170
+ });
171
+ },
172
+ trackError: errorId => {
173
+ logger.warn(`trackError(${errorId})`);
174
+ if (trackerState === null) {
175
+ logger.warn("The Media Session was completed.");
176
+ return {};
177
+ }
178
+ const errorDetails = {
179
+ name: errorId,
180
+ source: "player"
181
+ };
182
+ const xdm = createXdmObject({
183
+ eventType: MEDIA_EVENTS_INTERNAL.Error,
184
+ mediaDetails: {
185
+ errorDetails
186
+ }
187
+ });
188
+ return trackMediaEvent({
189
+ playerId: trackerState.playerId,
190
+ xdm
191
+ });
192
+ },
193
+ trackEvent: (eventType, info, context) => {
194
+ if (isEmptyObject(info)) {
195
+ logger.warn("Invalid media object.");
196
+ return {};
197
+ }
198
+ if (trackerState === null) {
199
+ logger.warn("The Media Session was completed.");
200
+ return {};
201
+ }
202
+ if (!includes(Object.values(EVENT), eventType)) {
203
+ logger.warn("Invalid event type");
204
+ return {};
205
+ }
206
+ const xdm = createXdmObject({
207
+ eventType,
208
+ mediaDetails: info,
209
+ contextData: context
210
+ });
211
+ return trackMediaEvent({
212
+ playerId: trackerState.playerId,
213
+ xdm
214
+ });
215
+ },
216
+ updatePlayhead: time => {
217
+ if (trackerState === null) {
218
+ logger.warn("The Media Session was completed.");
219
+ return;
220
+ }
221
+ if (isNumber(time)) {
222
+ trackerState.lastPlayhead = parseInt(time, 10);
223
+ }
224
+ },
225
+ updateQoEObject: qoeObject => {
226
+ if (trackerState === null) {
227
+ logger.warn("The Media Session was completed.");
228
+ return;
229
+ }
230
+ if (!qoeObject) {
231
+ return;
232
+ }
233
+ trackerState.qoe = qoeObject;
234
+ },
235
+ destroy: () => {
236
+ logger.warn("Destroy called, destroying the tracker.");
237
+ trackerState = null;
238
+ }
239
+ };
240
+ });
@@ -0,0 +1,85 @@
1
+ /*
2
+ Copyright 2024 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+
13
+ import { noop, uuid } from "../../utils";
14
+ import { AD_METADATA_KEYS as AdMetadataKeys, AUDIO_METADATA_KEYS as AudioMetadataKeys, EVENT as Event, MEDIA_OBJECT_KEYS as MediaObjectKey, MEDIA_TYPE as MediaType, PLAYER_STATE as PlayerState, STREAM_TYPE as StreamType, VIDEO_METADATA_KEYS as VideoMetadataKeys } from "./constants/constants";
15
+ export default (({
16
+ trackMediaEvent,
17
+ trackMediaSession,
18
+ mediaResponseHandler,
19
+ logger,
20
+ createMediaHelper,
21
+ createGetInstance,
22
+ config
23
+ }) => {
24
+ return {
25
+ lifecycle: {
26
+ onBeforeEvent({
27
+ mediaOptions,
28
+ onResponse = noop
29
+ }) {
30
+ if (!mediaOptions) {
31
+ return;
32
+ }
33
+ const {
34
+ legacy,
35
+ playerId,
36
+ getPlayerDetails
37
+ } = mediaOptions;
38
+ if (!legacy) {
39
+ return;
40
+ }
41
+ onResponse(({
42
+ response
43
+ }) => {
44
+ return mediaResponseHandler({
45
+ playerId,
46
+ getPlayerDetails,
47
+ response
48
+ });
49
+ });
50
+ }
51
+ },
52
+ commands: {
53
+ getMediaAnalyticsTracker: {
54
+ run: () => {
55
+ if (!config.streamingMedia) {
56
+ return Promise.reject(new Error("Streaming media is not configured."));
57
+ }
58
+ logger.info("Streaming media is configured in legacy mode.");
59
+ const mediaAnalyticsHelper = createMediaHelper({
60
+ logger
61
+ });
62
+ return Promise.resolve({
63
+ getInstance: () => {
64
+ return createGetInstance({
65
+ logger,
66
+ trackMediaEvent,
67
+ trackMediaSession,
68
+ uuid
69
+ });
70
+ },
71
+ Event,
72
+ MediaType,
73
+ PlayerState,
74
+ StreamType,
75
+ MediaObjectKey,
76
+ VideoMetadataKeys,
77
+ AudioMetadataKeys,
78
+ AdMetadataKeys,
79
+ ...mediaAnalyticsHelper
80
+ });
81
+ }
82
+ }
83
+ }
84
+ };
85
+ });
@@ -131,15 +131,12 @@ export default (({
131
131
  }
132
132
  };
133
133
  const createStateObject = stateName => {
134
- const STATE_NAME_REGEX = "^[a-zA-Z0-9_]{1,64}$";
134
+ const STATE_NAME_REGEX = new RegExp("^[a-zA-Z0-9_]{1,64}$");
135
135
  const validator = string().matches(STATE_NAME_REGEX, "This is not a valid state name.");
136
136
  try {
137
137
  const result = validator(stateName);
138
- const stateDetails = {
139
- name: result
140
- };
141
138
  return {
142
- stateDetails
139
+ name: result
143
140
  };
144
141
  } catch (error) {
145
142
  logger.warn(`An error occurred while creating the State Object.`, error);
@@ -161,14 +158,11 @@ export default (({
161
158
  });
162
159
  try {
163
160
  const result = validator(qoeObject);
164
- const qoeDetails = {
161
+ return {
165
162
  bitrate: result.bitrate,
166
163
  droppedFrames: result.droppedFrames,
167
- fps: result.fps,
168
- startupTime: result.startupTime
169
- };
170
- return {
171
- qoeDetails
164
+ framesPerSecond: result.fps,
165
+ timeToStart: result.startupTime
172
166
  };
173
167
  } catch (error) {
174
168
  logger.warn(`An error occurred while creating the QOE Object.`, error);
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2023 Adobe. All rights reserved.
2
+ Copyright 2024 Adobe. All rights reserved.
3
3
  This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  you may not use this file except in compliance with the License. You may obtain a copy
5
5
  of the License at http://www.apache.org/licenses/LICENSE-2.0
@@ -11,8 +11,15 @@ governing permissions and limitations under the License.
11
11
  */
12
12
  /* eslint-disable import/no-restricted-paths */
13
13
 
14
- import { createMediaAnalyticsTracker } from "./createMediaAnalyticsTracker";
15
- import createMediaEventManager from "../MediaCollection/createMediaEventManager";
14
+ import createMediaEventManager from "../StreamingMedia/createMediaEventManager";
15
+ import createMediaSessionCacheManager from "../StreamingMedia/createMediaSessionCacheManager";
16
+ import createTrackMediaEvent from "../StreamingMedia/createTrackMediaEvent";
17
+ import createTrackMediaSession from "../StreamingMedia/createTrackMediaSession";
18
+ import createMediaResponseHandler from "../StreamingMedia/createMediaResponseHandler";
19
+ import createLegacyMediaComponent from "./createLegacyMediaComponent";
20
+ import createMediaHelper from "./createMediaHelper";
21
+ import createGetInstance from "./createGetInstance";
22
+ import injectTimestamp from "../Context/injectTimestamp";
16
23
  const createLegacyMediaAnalytics = ({
17
24
  eventManager,
18
25
  sendEdgeNetworkRequest,
@@ -20,26 +27,41 @@ const createLegacyMediaAnalytics = ({
20
27
  logger,
21
28
  consent
22
29
  }) => {
30
+ const mediaSessionCacheManager = createMediaSessionCacheManager({
31
+ config
32
+ });
23
33
  const mediaEventManager = createMediaEventManager({
24
34
  sendEdgeNetworkRequest,
25
35
  config,
26
- logger,
27
36
  consent,
28
- eventManager
37
+ eventManager,
38
+ setTimestamp: injectTimestamp(() => new Date())
39
+ });
40
+ const trackMediaEvent = createTrackMediaEvent({
41
+ mediaSessionCacheManager,
42
+ mediaEventManager,
43
+ config
44
+ });
45
+ const trackMediaSession = createTrackMediaSession({
46
+ config,
47
+ mediaEventManager,
48
+ mediaSessionCacheManager,
49
+ legacy: true
50
+ });
51
+ const mediaResponseHandler = createMediaResponseHandler({
52
+ mediaSessionCacheManager,
53
+ config,
54
+ trackMediaEvent
55
+ });
56
+ return createLegacyMediaComponent({
57
+ mediaResponseHandler,
58
+ trackMediaSession,
59
+ trackMediaEvent,
60
+ createMediaHelper,
61
+ createGetInstance,
62
+ logger,
63
+ config
29
64
  });
30
- return {
31
- commands: {
32
- getMediaAnalyticsTracker: {
33
- run: () => {
34
- return createMediaAnalyticsTracker({
35
- config,
36
- logger,
37
- mediaEventManager
38
- });
39
- }
40
- }
41
- }
42
- };
43
65
  };
44
66
  createLegacyMediaAnalytics.namespace = "Legacy Media Analytics";
45
67
  export default createLegacyMediaAnalytics;
@@ -27,10 +27,12 @@ const prepareLibraryInfo = ({
27
27
  }
28
28
  resultConfig[key] = value.toString();
29
29
  });
30
+ const components = componentRegistry.getComponentNames();
30
31
  return {
31
32
  version: libraryVersion,
32
33
  configs: resultConfig,
33
- commands: allCommands
34
+ commands: allCommands,
35
+ components
34
36
  };
35
37
  };
36
38
  const createLibraryInfo = ({
@@ -29,10 +29,14 @@ export default (({
29
29
  setTargetMigration,
30
30
  mergeDecisionsMeta,
31
31
  renderedPropositions,
32
- onDecisionHandler
32
+ onDecisionHandler,
33
+ handleConsentFlicker
33
34
  }) => {
34
35
  return {
35
36
  lifecycle: {
37
+ onComponentsRegistered() {
38
+ handleConsentFlicker();
39
+ },
36
40
  onDecision: onDecisionHandler,
37
41
  onBeforeRequest({
38
42
  request
@@ -18,7 +18,8 @@ export default (({
18
18
  mergeQuery,
19
19
  processPropositions,
20
20
  createProposition,
21
- notificationHandler
21
+ notificationHandler,
22
+ consent
22
23
  }) => {
23
24
  return ({
24
25
  cacheUpdate,
@@ -26,13 +27,22 @@ export default (({
26
27
  event,
27
28
  onResponse
28
29
  }) => {
29
- if (personalizationDetails.isRenderDecisions()) {
30
- hideContainers(prehidingStyle);
31
- } else {
32
- showContainers();
30
+ const {
31
+ state,
32
+ wasSet
33
+ } = consent.current();
34
+ if (!(state === "out" && wasSet)) {
35
+ if (personalizationDetails.isRenderDecisions()) {
36
+ hideContainers(prehidingStyle);
37
+ } else {
38
+ showContainers();
39
+ }
33
40
  }
34
41
  mergeQuery(event, personalizationDetails.createQueryDetails());
35
- const handleNotifications = notificationHandler(personalizationDetails.isSendDisplayEvent(), personalizationDetails.getViewName());
42
+
43
+ // This needs to be called before the response so that future sendEvent calls
44
+ // can know to wait until this request is complete for pending display notifications.
45
+ const handleNotifications = notificationHandler(personalizationDetails.isRenderDecisions(), personalizationDetails.isSendDisplayEvent(), personalizationDetails.getViewName());
36
46
  onResponse(({
37
47
  response
38
48
  }) => {
@@ -0,0 +1,26 @@
1
+ /*
2
+ Copyright 2024 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+ import { OUT } from "../../constants/consentStatus";
13
+ export default (({
14
+ showContainers,
15
+ consent
16
+ }) => () => {
17
+ const {
18
+ state,
19
+ wasSet
20
+ } = consent.current();
21
+ if (state === OUT && wasSet) {
22
+ showContainers();
23
+ } else {
24
+ consent.awaitConsent().catch(showContainers);
25
+ }
26
+ });
@@ -11,8 +11,12 @@ governing permissions and limitations under the License.
11
11
  */
12
12
  import { defer } from "../../utils";
13
13
  export default ((collect, renderedPropositions) => {
14
- return (sendDisplayEvent, viewName) => {
15
- if (!sendDisplayEvent) {
14
+ return (isRenderDecisions, isSendDisplayEvent, viewName) => {
15
+ if (!isRenderDecisions) {
16
+ // If we aren't rendering anything, then we don't need to sendDisplayEvents.
17
+ return () => undefined;
18
+ }
19
+ if (!isSendDisplayEvent) {
16
20
  const renderedPropositionsDeferred = defer();
17
21
  renderedPropositions.concat(renderedPropositionsDeferred.promise);
18
22
  return renderedPropositionsDeferred.resolve;
@@ -33,7 +33,7 @@ export default (({
33
33
  render,
34
34
  returnedPropositions
35
35
  } = processPropositions(propositionsToExecute);
36
- const handleNotifications = notificationHandler(sendDisplayEvent, viewName);
36
+ const handleNotifications = notificationHandler(renderDecisions, sendDisplayEvent, viewName);
37
37
  render().then(handleNotifications);
38
38
  return Promise.resolve({
39
39
  propositions: returnedPropositions
@@ -33,7 +33,6 @@ export default (({
33
33
  // there is a redirect.
34
34
  });
35
35
  };
36
-
37
36
  return {
38
37
  render,
39
38
  setRenderAttempted: true,
@@ -43,10 +43,12 @@ import createProcessInAppMessage from "./handlers/createProcessInAppMessage";
43
43
  import initInAppMessageActionsModules from "./in-app-message-actions/initInAppMessageActionsModules";
44
44
  import createRedirect from "./dom-actions/createRedirect";
45
45
  import createNotificationHandler from "./createNotificationHandler";
46
+ import createHandleConsentFlicker from "./createHandleConsentFlicker";
46
47
  const createPersonalization = ({
47
48
  config,
48
49
  logger,
49
- eventManager
50
+ eventManager,
51
+ consent
50
52
  }) => {
51
53
  const {
52
54
  targetMigrationEnabled,
@@ -108,7 +110,8 @@ const createPersonalization = ({
108
110
  mergeQuery,
109
111
  processPropositions,
110
112
  createProposition,
111
- notificationHandler
113
+ notificationHandler,
114
+ consent
112
115
  });
113
116
  const onClickHandler = createOnClickHandler({
114
117
  mergeDecisionsMeta,
@@ -134,6 +137,10 @@ const createPersonalization = ({
134
137
  createProposition,
135
138
  notificationHandler
136
139
  });
140
+ const handleConsentFlicker = createHandleConsentFlicker({
141
+ showContainers,
142
+ consent
143
+ });
137
144
  return createComponent({
138
145
  getPageLocation,
139
146
  logger,
@@ -148,7 +155,8 @@ const createPersonalization = ({
148
155
  setTargetMigration,
149
156
  mergeDecisionsMeta,
150
157
  renderedPropositions,
151
- onDecisionHandler
158
+ onDecisionHandler,
159
+ handleConsentFlicker
152
160
  });
153
161
  };
154
162
  createPersonalization.namespace = "Personalization";
@@ -0,0 +1,22 @@
1
+ /*
2
+ Copyright 2024 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+
13
+ import { number, objectOf, string } from "../../utils/validation";
14
+ export default objectOf({
15
+ streamingMedia: objectOf({
16
+ channel: string().nonEmpty().required(),
17
+ playerName: string().nonEmpty().required(),
18
+ appVersion: string(),
19
+ mainPingInterval: number().minimum(10).maximum(50).default(10),
20
+ adPingInterval: number().minimum(1).maximum(10).default(10)
21
+ }).noUnknownFields()
22
+ });
@@ -0,0 +1,31 @@
1
+ /*
2
+ Copyright 2023 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+ export default {
13
+ PAUSE: "media.pauseStart",
14
+ PLAY: "media.play",
15
+ BUFFER_START: "media.bufferStart",
16
+ AD_START: "media.adStart",
17
+ Ad_BREAK_START: "media.adBreakStart",
18
+ SESSION_END: "media.sessionEnd",
19
+ SESSION_START: "media.sessionStart",
20
+ SESSION_COMPLETE: "media.sessionComplete",
21
+ PING: "media.ping",
22
+ AD_BREAK_COMPLETE: "media.adBreakComplete",
23
+ AD_COMPLETE: "media.adComplete",
24
+ AD_SKIP: "media.adSkip",
25
+ BITRATE_CHANGE: "media.bitrateChange",
26
+ CHAPTER_COMPLETE: "media.chapterComplete",
27
+ CHAPTER_SKIP: "media.chapterSkip",
28
+ CHAPTER_START: "media.chapterStart",
29
+ ERROR: "media.error",
30
+ STATES_UPDATE: "media.statesUpdate"
31
+ };