@adobe/alloy 2.20.0-alpha.0 → 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 (395) 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 +157 -158
  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/{MediaCollection/createMediaRequestPayload.js → StreamingMedia/configValidators.js} +11 -16
  163. package/libEs5/components/StreamingMedia/constants/eventTypes.js +34 -0
  164. package/libEs5/components/StreamingMedia/constants/playbackState.js +19 -0
  165. package/libEs5/components/{MediaCollection → StreamingMedia}/createMediaEventManager.js +46 -53
  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 +23 -27
  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 +90 -93
  338. package/libEs5/utils/validation/integerValidator.js +2 -3
  339. package/{libEs6/components/MediaCollection/createMediaRequestPayload.js → libEs5/utils/validation/matchesRegexpValidator.js} +9 -14
  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 +11 -10
  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 +157 -150
  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/{MediaCollection/createUpdateMediaSessionState.js → Personalization/createHandleConsentFlicker.js} +14 -24
  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/StreamingMedia/constants/playbackState.js +16 -0
  367. package/libEs6/components/{MediaCollection → StreamingMedia}/createMediaEventManager.js +44 -44
  368. package/libEs6/components/StreamingMedia/createMediaResponseHandler.js +58 -0
  369. package/libEs6/components/{MediaCollection → StreamingMedia}/createMediaSessionCacheManager.js +17 -21
  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/libEs6/utils/validation/index.js +6 -1
  382. package/libEs6/utils/{debounce.js → validation/matchesRegexpValidator.js} +5 -10
  383. package/package.json +19 -4
  384. package/libEs5/components/LegacyMediaAnalytics/createMediaAnalyticsTracker.js +0 -272
  385. package/libEs5/components/MediaCollection/createHeartbeatEngine.js +0 -55
  386. package/libEs5/components/MediaCollection/createUpdateMediaSessionState.js +0 -35
  387. package/libEs5/components/MediaCollection/index.js +0 -159
  388. package/libEs5/components/MediaCollection/mediaConstants/mediaEvents.js +0 -13
  389. package/libEs5/components/MediaCollection/validateMediaEventOptions.js +0 -35
  390. package/libEs6/components/LegacyMediaAnalytics/createMediaAnalyticsTracker.js +0 -276
  391. package/libEs6/components/MediaCollection/createHeartbeatEngine.js +0 -57
  392. package/libEs6/components/MediaCollection/index.js +0 -158
  393. package/libEs6/components/MediaCollection/mediaConstants/mediaEvents.js +0 -9
  394. /package/libEs6/components/LegacyMediaAnalytics/{media → constants}/mediaKeysToXdmConverter.js +0 -0
  395. /package/libEs6/components/{MediaCollection → StreamingMedia}/createMediaRequest.js +0 -0
@@ -23,75 +23,79 @@ var _numberValidator = require("./numberValidator");
23
23
  var _regexpValidator = require("./regexpValidator");
24
24
  var _requiredValidator = require("./requiredValidator");
25
25
  var _stringValidator = require("./stringValidator");
26
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
27
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
28
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /*
29
- Copyright 2020 Adobe. All rights reserved.
30
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
31
- you may not use this file except in compliance with the License. You may obtain a copy
32
- of the License at http://www.apache.org/licenses/LICENSE-2.0
33
-
34
- Unless required by applicable law or agreed to in writing, software distributed under
35
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
36
- OF ANY KIND, either express or implied. See the License for the specific language
37
- governing permissions and limitations under the License.
38
- */ /**
39
- * Validators are functions of two parameters (value and path) that return the
40
- * computed value if the input is valid, or throw an exception if the input is
41
- * invalid. In most cases the returned value is the same as the input value;
42
- * however, reference createDefaultValidator.js to see an example where the
43
- * computed value is different from the input. Additionally, if we ever wanted
44
- * to coerce types (i.e. parse string values into integers) as part of the
45
- * validation process we could use the computed value to accomplish that.
46
- *
47
- * The path parameter is used to generate informative error messages. It is
48
- * created by the objectOf, and arrayOf validators so that any error message can
49
- * describe which key within the object or array is invalid.
50
- *
51
- * The validators also have methods to chain additional validation logic. For
52
- * example, when you call `string()` to start a validator chain, it returns a
53
- * validator function but it also has methods like `required` and `nonEmpty`.
54
- * Here you can see that these methods are actually calling `chain`.
55
- * Specifically in this function, the leftValidator is called first and then the
56
- * return value of that is sent to the rightValidator. For example, when calling
57
- * `string().nonEmpty().required()` the following chain is built up:
58
- * ```
59
- * *
60
- * / \
61
- * * required
62
- * / \
63
- * * nonEmpty
64
- * / \
65
- * base string
66
- * ```
67
- * Where every * is a call to chain where the two are combined. The individual
68
- * validators are called from left to right in the above tree. The base
69
- * validator is simply the identity function `value => value`, representing an
70
- * optional value.
71
- *
72
- * After combining the validators, the new validator function is then augmented
73
- * with the methods from the leftValidator and from the additionalMethods
74
- * parameter. For example, when the string() function is called it chains to the
75
- * base validator, but also adds additional methods like (`regexp`, `domain`,
76
- * `nonEmpty`, and `unique`). When `nonEmpty` is called, which calls chain
77
- * again, the additional methods are carried forward because they are already
78
- * defined on the leftValidator.
79
- *
80
- * The base validator also contains the two methods `required` and `default`, so
81
- * these can be used anywhere after any of the exposed validator functions are
82
- * called.
83
- *
84
- * For most validators, we want the validation to be optional (i.e. allow null
85
- * or undefined values). To accomplish this, the validator needs to have a check
86
- * at the begining of the function, short circuiting the validation logic and
87
- * returning value if value is null or undefined. `default` and `required` do
88
- * not want this null check though. Indeed, `default` should return the default
89
- * value if value is null, and `required` should throw an error if value is
90
- * null.
91
- *
92
- * So to keep from having to have a null check in front of most validators,
93
- * nullSafeChain allows you to chain a validator in a null-safe way.
94
- */
26
+ var _matchesRegexpValidator = require("./matchesRegexpValidator");
27
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
28
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
29
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
30
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
31
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
32
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /*
33
+ Copyright 2020 Adobe. All rights reserved.
34
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
35
+ you may not use this file except in compliance with the License. You may obtain a copy
36
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
37
+
38
+ Unless required by applicable law or agreed to in writing, software distributed under
39
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
40
+ OF ANY KIND, either express or implied. See the License for the specific language
41
+ governing permissions and limitations under the License.
42
+ */ /**
43
+ * Validators are functions of two parameters (value and path) that return the
44
+ * computed value if the input is valid, or throw an exception if the input is
45
+ * invalid. In most cases the returned value is the same as the input value;
46
+ * however, reference createDefaultValidator.js to see an example where the
47
+ * computed value is different from the input. Additionally, if we ever wanted
48
+ * to coerce types (i.e. parse string values into integers) as part of the
49
+ * validation process we could use the computed value to accomplish that.
50
+ *
51
+ * The path parameter is used to generate informative error messages. It is
52
+ * created by the objectOf, and arrayOf validators so that any error message can
53
+ * describe which key within the object or array is invalid.
54
+ *
55
+ * The validators also have methods to chain additional validation logic. For
56
+ * example, when you call `string()` to start a validator chain, it returns a
57
+ * validator function but it also has methods like `required` and `nonEmpty`.
58
+ * Here you can see that these methods are actually calling `chain`.
59
+ * Specifically in this function, the leftValidator is called first and then the
60
+ * return value of that is sent to the rightValidator. For example, when calling
61
+ * `string().nonEmpty().required()` the following chain is built up:
62
+ * ```
63
+ * *
64
+ * / \
65
+ * * required
66
+ * / \
67
+ * * nonEmpty
68
+ * / \
69
+ * base string
70
+ * ```
71
+ * Where every * is a call to chain where the two are combined. The individual
72
+ * validators are called from left to right in the above tree. The base
73
+ * validator is simply the identity function `value => value`, representing an
74
+ * optional value.
75
+ *
76
+ * After combining the validators, the new validator function is then augmented
77
+ * with the methods from the leftValidator and from the additionalMethods
78
+ * parameter. For example, when the string() function is called it chains to the
79
+ * base validator, but also adds additional methods like (`regexp`, `domain`,
80
+ * `nonEmpty`, and `unique`). When `nonEmpty` is called, which calls chain
81
+ * again, the additional methods are carried forward because they are already
82
+ * defined on the leftValidator.
83
+ *
84
+ * The base validator also contains the two methods `required` and `default`, so
85
+ * these can be used anywhere after any of the exposed validator functions are
86
+ * called.
87
+ *
88
+ * For most validators, we want the validation to be optional (i.e. allow null
89
+ * or undefined values). To accomplish this, the validator needs to have a check
90
+ * at the begining of the function, short circuiting the validation logic and
91
+ * returning value if value is null or undefined. `default` and `required` do
92
+ * not want this null check though. Indeed, `default` should return the default
93
+ * value if value is null, and `required` should throw an error if value is
94
+ * null.
95
+ *
96
+ * So to keep from having to have a null check in front of most validators,
97
+ * nullSafeChain allows you to chain a validator in a null-safe way.
98
+ */
95
99
  // The base validator does no validation and just returns the value unchanged
96
100
  var base = function base(value) {
97
101
  return value;
@@ -137,6 +141,9 @@ var nonEmptyObject = function nonEmptyObject() {
137
141
  var regexp = function regexp() {
138
142
  return (0, _utils.nullSafeChain)(this, _regexpValidator.default);
139
143
  };
144
+ var matches = function matches(regexpPattern) {
145
+ return (0, _utils.nullSafeChain)(this, (0, _matchesRegexpValidator.default)(regexpPattern));
146
+ };
140
147
  var unique = function createUnique() {
141
148
  return (0, _utils.nullSafeChain)(this, (0, _createUniqueValidator.default)());
142
149
  };
@@ -208,35 +215,25 @@ var string = function string() {
208
215
  regexp: regexp,
209
216
  domain: domain,
210
217
  nonEmpty: nonEmptyString,
211
- unique: unique
218
+ unique: unique,
219
+ matches: matches
212
220
  });
213
221
  };
214
- var boundAnyOf = anyOf.bind(base);
215
- exports.anyOf = boundAnyOf;
216
- var boundAnything = anything.bind(base);
217
- exports.anything = boundAnything;
218
- var boundArrayOf = arrayOf.bind(base);
219
- exports.arrayOf = boundArrayOf;
220
- var boundBoolean = boolean.bind(base);
221
- exports.boolean = boundBoolean;
222
- var boundCallback = callback.bind(base);
223
- exports.callback = boundCallback;
224
- var boundLiteral = literal.bind(base);
225
- exports.literal = boundLiteral;
226
- var boundNumber = number.bind(base);
227
- exports.number = boundNumber;
228
- var boundMapOfValues = mapOfValues.bind(base);
229
- exports.mapOfValues = boundMapOfValues;
230
- var boundObjectOf = objectOf.bind(base);
231
- exports.objectOf = boundObjectOf;
232
- var boundString = string.bind(base);
222
+ var boundAnyOf = exports.anyOf = anyOf.bind(base);
223
+ var boundAnything = exports.anything = anything.bind(base);
224
+ var boundArrayOf = exports.arrayOf = arrayOf.bind(base);
225
+ var boundBoolean = exports.boolean = boolean.bind(base);
226
+ var boundCallback = exports.callback = callback.bind(base);
227
+ var boundLiteral = exports.literal = literal.bind(base);
228
+ var boundNumber = exports.number = number.bind(base);
229
+ var boundMapOfValues = exports.mapOfValues = mapOfValues.bind(base);
230
+ var boundObjectOf = exports.objectOf = objectOf.bind(base);
231
+ var boundString = exports.string = string.bind(base);
233
232
 
234
233
  // compound validators
235
- exports.string = boundString;
236
- var boundEnumOf = function boundEnumOf() {
234
+ var boundEnumOf = exports.enumOf = function boundEnumOf() {
237
235
  for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) {
238
236
  values[_key] = arguments[_key];
239
237
  }
240
238
  return boundAnyOf(values.map(boundLiteral), "one of these values: [" + JSON.stringify(values) + "]");
241
- };
242
- exports.enumOf = boundEnumOf;
239
+ };
@@ -14,8 +14,7 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
14
14
  OF ANY KIND, either express or implied. See the License for the specific language
15
15
  governing permissions and limitations under the License.
16
16
  */
17
- var _default = function _default(value, path) {
17
+ var _default = exports.default = function _default(value, path) {
18
18
  (0, _utils.assertValid)((0, _isInteger.default)(value), value, path, "an integer");
19
19
  return value;
20
- };
21
- exports.default = _default;
20
+ };
@@ -1,3 +1,7 @@
1
+ "use strict";
2
+
3
+ exports.default = void 0;
4
+ var _utils = require("./utils");
1
5
  /*
2
6
  Copyright 2023 Adobe. All rights reserved.
3
7
  This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -9,18 +13,9 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
9
13
  OF ANY KIND, either express or implied. See the License for the specific language
10
14
  governing permissions and limitations under the License.
11
15
  */
12
-
13
- import { createAddIdentity, createHasIdentity, createRequestPayload } from "../../utils/request";
14
- export default (() => {
15
- const content = {};
16
- const payload = createRequestPayload({
17
- content,
18
- addIdentity: createAddIdentity(content),
19
- hasIdentity: createHasIdentity(content)
20
- });
21
- payload.addEvent = event => {
22
- content.events = content.events || [];
23
- content.events.push(event);
16
+ var _default = exports.default = function _default(regexp) {
17
+ return function (value, path) {
18
+ (0, _utils.assertValid)(regexp.test(value), value, path, "does not match the " + regexp.toString());
19
+ return value;
24
20
  };
25
- return payload;
26
- });
21
+ };
@@ -14,8 +14,7 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
14
14
  OF ANY KIND, either express or implied. See the License for the specific language
15
15
  governing permissions and limitations under the License.
16
16
  */
17
- var _default = function _default(value, path) {
17
+ var _default = exports.default = function _default(value, path) {
18
18
  (0, _utils.assertValid)((0, _isNumber.default)(value), value, path, "a number");
19
19
  return value;
20
- };
21
- exports.default = _default;
20
+ };
@@ -14,8 +14,7 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
14
14
  OF ANY KIND, either express or implied. See the License for the specific language
15
15
  governing permissions and limitations under the License.
16
16
  */
17
- var _default = function _default(value, path) {
17
+ var _default = exports.default = function _default(value, path) {
18
18
  (0, _utils.assertValid)((0, _isValidRegExp.default)(value), value, path, "a regular expression");
19
19
  return value;
20
- };
21
- exports.default = _default;
20
+ };
@@ -12,10 +12,9 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
12
12
  OF ANY KIND, either express or implied. See the License for the specific language
13
13
  governing permissions and limitations under the License.
14
14
  */
15
- var _default = function _default(value, path) {
15
+ var _default = exports.default = function _default(value, path) {
16
16
  if (value == null) {
17
17
  throw new Error("'" + path + "' is a required option");
18
18
  }
19
19
  return value;
20
- };
21
- exports.default = _default;
20
+ };
@@ -14,8 +14,7 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
14
14
  OF ANY KIND, either express or implied. See the License for the specific language
15
15
  governing permissions and limitations under the License.
16
16
  */
17
- var _default = function _default(value, path) {
17
+ var _default = exports.default = function _default(value, path) {
18
18
  (0, _utils.assertValid)((0, _isString.default)(value), value, path, "a string");
19
19
  return value;
20
- };
21
- exports.default = _default;
20
+ };
@@ -82,7 +82,7 @@ var callSequentiallyJoinErrors = function callSequentiallyJoinErrors(firstValida
82
82
  * validator.
83
83
  * @returns {function}
84
84
  */
85
- var chain = function chain(baseValidator, newValidator, additionalMethods) {
85
+ var chain = exports.chain = function chain(baseValidator, newValidator, additionalMethods) {
86
86
  return (0, _assign.default)(callSequentially(baseValidator, newValidator), baseValidator, additionalMethods);
87
87
  };
88
88
 
@@ -101,8 +101,7 @@ var chain = function chain(baseValidator, newValidator, additionalMethods) {
101
101
  * validator.
102
102
  * @returns {function}
103
103
  */
104
- exports.chain = chain;
105
- var nullSafeChain = function nullSafeChain(baseValidator, newValidator, additionalMethods) {
104
+ var nullSafeChain = exports.nullSafeChain = function nullSafeChain(baseValidator, newValidator, additionalMethods) {
106
105
  return (0, _assign.default)(callSequentially(baseValidator, skipIfNull(newValidator)), baseValidator, additionalMethods);
107
106
  };
108
107
 
@@ -117,8 +116,7 @@ var nullSafeChain = function nullSafeChain(baseValidator, newValidator, addition
117
116
  * validator.
118
117
  * @returns {function}
119
118
  */
120
- exports.nullSafeChain = nullSafeChain;
121
- var reverseNullSafeChainJoinErrors = function reverseNullSafeChainJoinErrors(baseValidator, newValidator, additionalMethods) {
119
+ var reverseNullSafeChainJoinErrors = exports.reverseNullSafeChainJoinErrors = function reverseNullSafeChainJoinErrors(baseValidator, newValidator, additionalMethods) {
122
120
  return (0, _assign.default)(callSequentiallyJoinErrors(skipIfNull(newValidator), baseValidator), baseValidator, additionalMethods);
123
121
  };
124
122
 
@@ -132,10 +130,8 @@ var reverseNullSafeChainJoinErrors = function reverseNullSafeChainJoinErrors(bas
132
130
  * @throws {Error} - Throws an error if the value is not valid.
133
131
  * @returns {void}
134
132
  */
135
- exports.reverseNullSafeChainJoinErrors = reverseNullSafeChainJoinErrors;
136
- var assertValid = function assertValid(isValid, value, path, message) {
133
+ var assertValid = exports.assertValid = function assertValid(isValid, value, path, message) {
137
134
  if (!isValid) {
138
135
  throw new Error("'" + path + "': Expected " + message + ", but got " + JSON.stringify(value) + ".");
139
136
  }
140
- };
141
- exports.assertValid = assertValid;
137
+ };
@@ -18,9 +18,8 @@ governing permissions and limitations under the License.
18
18
  * @param {Object} obj
19
19
  * @returns {Array}
20
20
  */
21
- var _default = function _default(obj) {
21
+ var _default = exports.default = function _default(obj) {
22
22
  return Object.keys(obj).map(function (key) {
23
23
  return obj[key];
24
24
  });
25
- };
26
- exports.default = _default;
25
+ };
@@ -49,7 +49,6 @@ const createActivityCollector = ({
49
49
  });
50
50
  // TODO: createScrollActivityCollector ...
51
51
  },
52
-
53
52
  onClick({
54
53
  event,
55
54
  clickedElement
@@ -84,7 +84,8 @@ const createIdentity = ({
84
84
  });
85
85
  const awaitIdentityCookie = injectAwaitIdentityCookie({
86
86
  doesIdentityCookieExist,
87
- orgId
87
+ orgId,
88
+ logger
88
89
  });
89
90
  const ensureSingleIdentity = injectEnsureSingleIdentity({
90
91
  doesIdentityCookieExist,
@@ -28,10 +28,14 @@ export default (({
28
28
  return;
29
29
  }
30
30
  const parsedQueryString = queryString.parse(locationSearch);
31
- const queryStringValue = parsedQueryString[queryStringIdentityParam];
31
+ let queryStringValue = parsedQueryString[queryStringIdentityParam];
32
32
  if (queryStringValue === undefined) {
33
33
  return;
34
34
  }
35
+ if (Array.isArray(queryStringValue)) {
36
+ logger.warn("Found multiple adobe_mc query string paramters, only using the last one.");
37
+ queryStringValue = queryStringValue[queryStringValue.length - 1];
38
+ }
35
39
  const properties = queryStringValue.split("|").reduce((memo, keyValue) => {
36
40
  const [key, value] = keyValue.split("=");
37
41
  memo[key] = value;
@@ -12,7 +12,8 @@ governing permissions and limitations under the License.
12
12
 
13
13
  export default (({
14
14
  doesIdentityCookieExist,
15
- orgId
15
+ orgId,
16
+ logger
16
17
  }) => {
17
18
  /**
18
19
  * Returns a promise that will be resolved once an identity cookie exists.
@@ -30,16 +31,11 @@ export default (({
30
31
  } else {
31
32
  // This logic assumes that the code setting the cookie is working as expected and that
32
33
  // the cookie was missing from the response.
33
- const noIdentityCookieError = new Error(`An identity was not set properly. Please verify that the org ID ${orgId} configured in Alloy matches the org ID specified in the edge configuration.`);
34
+ logger.warn(`Identity cookie not found. This could be caused by any of the following issues:\n` + `\t* The org ID ${orgId} configured in Alloy doesn't match the org ID specified in the edge configuration.\n` + `\t* Experience edge was not able to set the identity cookie due to domain or cookie restrictions.\n` + `\t* The request was canceled by the browser and not fully processed.`);
34
35
 
35
- // Rejecting the promise will reject commands that were queued
36
- // by the Identity component while waiting on the response to
37
- // the initial request.
38
- reject(noIdentityCookieError);
39
-
40
- // Throwing an error will reject the event command that initiated
41
- // the request.
42
- throw noIdentityCookieError;
36
+ // Rejecting the promise will tell queued events to still go out
37
+ // one at a time.
38
+ reject(new Error("Identity cookie not found."));
43
39
  }
44
40
  });
45
41
  onRequestFailure(() => {
@@ -48,7 +44,7 @@ export default (({
48
44
  } else {
49
45
  // The error from the request failure will be logged separately. Rejecting this here
50
46
  // will tell ensureSingleIdentity to send the next request without identity
51
- reject(new Error("No identity was set on response."));
47
+ reject(new Error("Identity cookie not found."));
52
48
  }
53
49
  });
54
50
  });
@@ -55,9 +55,8 @@ export default (({
55
55
  if (obtainedIdentityPromise) {
56
56
  // We don't have an identity cookie, but at least one request has
57
57
  // been sent to get it. Konductor may set the identity cookie in the
58
- // response. We will hold up this request until the last request
59
- // requiring identity returns and awaitIdentityCookie confirms the
60
- // identity was set.
58
+ // response. We will hold up this request until the previous request
59
+ // returns and awaitIdentityCookie confirms the identity was set.
61
60
  logger.info("Delaying request while retrieving ECID from server.");
62
61
  const previousObtainedIdentityPromise = obtainedIdentityPromise;
63
62
 
@@ -92,6 +91,8 @@ export default (({
92
91
  onResponse,
93
92
  onRequestFailure
94
93
  });
94
+ // This prevents an un-caught promise in the console when the identity isn't set.
95
+ obtainedIdentityPromise.catch(() => undefined);
95
96
  return allowRequestToGoWithoutIdentity(request);
96
97
  };
97
98
  });
@@ -10,11 +10,11 @@ OF ANY KIND, either express or implied. See the License for the specific languag
10
10
  governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- export const MediaType = {
13
+ export const MEDIA_TYPE = {
14
14
  Video: "video",
15
15
  Audio: "audio"
16
16
  };
17
- export const StreamType = {
17
+ export const STREAM_TYPE = {
18
18
  VOD: "vod",
19
19
  Live: "live",
20
20
  Linear: "linear",
@@ -22,14 +22,14 @@ export const StreamType = {
22
22
  Audiobook: "audiobook",
23
23
  AOD: "aod"
24
24
  };
25
- export const PlayerState = {
25
+ export const PLAYER_STATE = {
26
26
  FullScreen: "fullScreen",
27
27
  ClosedCaption: "closedCaptioning",
28
28
  Mute: "mute",
29
29
  PictureInPicture: "pictureInPicture",
30
30
  InFocus: "inFocus"
31
31
  };
32
- export const Event = {
32
+ export const EVENT = {
33
33
  /**
34
34
  * Constant defining event type for AdBreak start
35
35
  */
@@ -91,19 +91,20 @@ export const Event = {
91
91
  */
92
92
  StateEnd: "stateEnd"
93
93
  };
94
- export const mediaEvent = {
94
+ export const MEDIA_EVENTS_INTERNAL = {
95
95
  SessionStart: "sessionStart",
96
96
  SessionEnd: "sessionEnd",
97
97
  SessionComplete: "sessionComplete",
98
98
  Play: "play",
99
99
  Pause: "pauseStart",
100
- ...Event
100
+ Error: "error",
101
+ StateUpdate: "statesUpdate"
101
102
  };
102
- export const MediaObjectKey = {
103
+ export const MEDIA_OBJECT_KEYS = {
103
104
  MediaResumed: "media.resumed",
104
105
  GranularAdTracking: "media.granularadtracking"
105
106
  };
106
- export const VideoMetadataKeys = {
107
+ export const VIDEO_METADATA_KEYS = {
107
108
  Show: "a.media.show",
108
109
  Season: "a.media.season",
109
110
  Episode: "a.media.episode",
@@ -122,7 +123,7 @@ export const VideoMetadataKeys = {
122
123
  Feed: "a.media.feed",
123
124
  StreamFormat: "a.media.format"
124
125
  };
125
- export const AudioMetadataKeys = {
126
+ export const AUDIO_METADATA_KEYS = {
126
127
  Artist: "a.media.artist",
127
128
  Album: "a.media.album",
128
129
  Label: "a.media.label",
@@ -130,7 +131,7 @@ export const AudioMetadataKeys = {
130
131
  Station: "a.media.station",
131
132
  Publisher: "a.media.publisher"
132
133
  };
133
- export const AdMetadataKeys = {
134
+ export const AD_METADATA_KEYS = {
134
135
  Advertiser: "a.media.ad.advertiser",
135
136
  CampaignId: "a.media.ad.campaign",
136
137
  CreativeId: "a.media.ad.creative",