@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.
- package/libEs5/baseCode/index.js +2 -3
- package/libEs5/components/ActivityCollector/attachClickActivityCollector.js +2 -3
- package/libEs5/components/ActivityCollector/configValidators.js +3 -5
- package/libEs5/components/ActivityCollector/createGetLinkDetails.js +2 -3
- package/libEs5/components/ActivityCollector/createLinkClick.js +2 -3
- package/libEs5/components/ActivityCollector/getLinkName.js +2 -3
- package/libEs5/components/ActivityCollector/getLinkRegion.js +2 -3
- package/libEs5/components/ActivityCollector/index.js +1 -2
- package/libEs5/components/ActivityCollector/utils.js +11 -21
- package/libEs5/components/Audiences/index.js +1 -2
- package/libEs5/components/Audiences/injectProcessDestinations.js +18 -16
- package/libEs5/components/Audiences/injectProcessResponse.js +2 -3
- package/libEs5/components/Context/createComponent.js +2 -3
- package/libEs5/components/Context/implementationDetails.js +2 -3
- package/libEs5/components/Context/index.js +17 -15
- package/libEs5/components/Context/injectDevice.js +2 -3
- package/libEs5/components/Context/injectEnvironment.js +6 -7
- package/libEs5/components/Context/injectHighEntropyUserAgentHints.js +15 -16
- package/libEs5/components/Context/injectPlaceContext.js +2 -3
- package/libEs5/components/Context/injectTimestamp.js +2 -3
- package/libEs5/components/Context/injectWeb.js +2 -3
- package/libEs5/components/DataCollector/index.js +1 -2
- package/libEs5/components/DataCollector/validateApplyResponse.js +2 -3
- package/libEs5/components/DataCollector/validateUserEventOptions.js +2 -3
- package/libEs5/components/DecisioningEngine/consequenceAdapters/inAppMessageConsequenceAdapter.js +2 -3
- package/libEs5/components/DecisioningEngine/consequenceAdapters/schemaTypeConsequenceAdapter.js +2 -3
- package/libEs5/components/DecisioningEngine/constants.js +4 -7
- package/libEs5/components/DecisioningEngine/createApplyResponse.js +2 -3
- package/libEs5/components/DecisioningEngine/createConsequenceAdapter.js +17 -16
- package/libEs5/components/DecisioningEngine/createContextProvider.js +18 -16
- package/libEs5/components/DecisioningEngine/createDecisionHistory.js +2 -3
- package/libEs5/components/DecisioningEngine/createDecisionProvider.js +2 -3
- package/libEs5/components/DecisioningEngine/createEvaluableRulesetPayload.js +18 -16
- package/libEs5/components/DecisioningEngine/createEvaluateRulesetsCommand.js +2 -3
- package/libEs5/components/DecisioningEngine/createEventRegistry.js +20 -20
- package/libEs5/components/DecisioningEngine/createOnResponseHandler.js +18 -16
- package/libEs5/components/DecisioningEngine/createSubscribeRulesetItems.js +18 -16
- package/libEs5/components/DecisioningEngine/index.js +19 -19
- package/libEs5/components/DecisioningEngine/utils.js +10 -18
- package/libEs5/components/EventMerge/createComponent.js +2 -3
- package/libEs5/components/EventMerge/createEventMergeId.js +2 -3
- package/libEs5/components/EventMerge/index.js +1 -2
- package/libEs5/components/Identity/addEcidQueryToPayload.js +2 -3
- package/libEs5/components/Identity/addEcidToPayload.js +2 -3
- package/libEs5/components/Identity/appendIdentityToUrl/appendIdentityToUrlOptionsValidator.js +2 -3
- package/libEs5/components/Identity/appendIdentityToUrl/injectAppendIdentityToUrl.js +4 -5
- package/libEs5/components/Identity/configValidators.js +1 -2
- package/libEs5/components/Identity/constants/authState.js +3 -6
- package/libEs5/components/Identity/constants/defaultIdSyncTtlMinutes.js +1 -2
- package/libEs5/components/Identity/createComponent.js +2 -3
- package/libEs5/components/Identity/createLegacyIdentity.js +8 -6
- package/libEs5/components/Identity/getEcidFromResponse.js +2 -3
- package/libEs5/components/Identity/getIdentity/createGetIdentity.js +2 -3
- package/libEs5/components/Identity/getIdentity/createIdentityRequest.js +2 -3
- package/libEs5/components/Identity/getIdentity/createIdentityRequestPayload.js +2 -3
- package/libEs5/components/Identity/getIdentity/getIdentityOptionsValidator.js +2 -3
- package/libEs5/components/Identity/index.js +3 -3
- package/libEs5/components/Identity/injectAddLegacyEcidToPayload.js +2 -3
- package/libEs5/components/Identity/injectAddQueryStringIdentityToPayload.js +18 -15
- package/libEs5/components/Identity/injectAwaitIdentityCookie.js +9 -14
- package/libEs5/components/Identity/injectEnsureSingleIdentity.js +8 -6
- package/libEs5/components/Identity/injectHandleResponseForIdSyncs.js +2 -3
- package/libEs5/components/Identity/injectProcessIdSyncs.js +2 -3
- package/libEs5/components/Identity/injectSetDomainForInitialIdentityPayload.js +2 -3
- package/libEs5/components/Identity/visitorService/awaitVisitorOptIn.js +2 -3
- package/libEs5/components/Identity/visitorService/getVisitor.js +2 -3
- package/libEs5/components/Identity/visitorService/injectGetEcidFromVisitor.js +2 -3
- package/libEs5/components/LegacyMediaAnalytics/{media → constants}/constants.js +15 -25
- package/libEs5/components/LegacyMediaAnalytics/{media → constants}/mediaKeysToXdmConverter.js +3 -5
- package/libEs5/components/LegacyMediaAnalytics/createGetInstance.js +246 -0
- package/libEs5/components/LegacyMediaAnalytics/createLegacyMediaComponent.js +87 -0
- package/libEs5/components/LegacyMediaAnalytics/createMediaHelper.js +157 -158
- package/libEs5/components/LegacyMediaAnalytics/index.js +43 -20
- package/libEs5/components/LibraryInfo/index.js +21 -17
- package/libEs5/components/MachineLearning/index.js +1 -2
- package/libEs5/components/MachineLearning/processResponse.js +2 -3
- package/libEs5/components/Personalization/constants/loggerMessage.js +2 -4
- package/libEs5/components/Personalization/constants/scopeType.js +3 -6
- package/libEs5/components/Personalization/constants/surface.js +4 -8
- package/libEs5/components/Personalization/createActionsProvider.js +2 -3
- package/libEs5/components/Personalization/createApplyPropositions.js +19 -17
- package/libEs5/components/Personalization/createClickStorage.js +8 -6
- package/libEs5/components/Personalization/createCollect.js +2 -3
- package/libEs5/components/Personalization/createComponent.js +7 -4
- package/libEs5/components/Personalization/createFetchDataHandler.js +28 -20
- package/libEs5/components/Personalization/createGetPageLocation.js +2 -3
- package/libEs5/{utils/debounce.js → components/Personalization/createHandleConsentFlicker.js} +13 -14
- package/libEs5/components/Personalization/createNotificationHandler.js +10 -5
- package/libEs5/components/Personalization/createOnClickHandler.js +2 -3
- package/libEs5/components/Personalization/createOnDecisionHandler.js +3 -4
- package/libEs5/components/Personalization/createPersonalizationDetails.js +13 -14
- package/libEs5/components/Personalization/createPreprocessors.js +16 -14
- package/libEs5/components/Personalization/createSetTargetMigration.js +2 -3
- package/libEs5/components/Personalization/createViewCacheManager.js +2 -3
- package/libEs5/components/Personalization/createViewChangeHandler.js +2 -3
- package/libEs5/components/Personalization/dom-actions/action.js +2 -3
- package/libEs5/components/Personalization/dom-actions/addNonceToInlineStyleElements.js +2 -3
- package/libEs5/components/Personalization/dom-actions/appendHtml.js +2 -3
- package/libEs5/components/Personalization/dom-actions/clicks/collectClicks.js +3 -4
- package/libEs5/components/Personalization/dom-actions/createPreprocess.js +2 -3
- package/libEs5/components/Personalization/dom-actions/createRedirect.js +2 -3
- package/libEs5/components/Personalization/dom-actions/dom/createFragment.js +2 -3
- package/libEs5/components/Personalization/dom-actions/dom/getAttribute.js +2 -3
- package/libEs5/components/Personalization/dom-actions/dom/getChildNodes.js +2 -3
- package/libEs5/components/Personalization/dom-actions/dom/getChildren.js +2 -3
- package/libEs5/components/Personalization/dom-actions/dom/getElementById.js +2 -3
- package/libEs5/components/Personalization/dom-actions/dom/getFirstChild.js +2 -3
- package/libEs5/components/Personalization/dom-actions/dom/getNextSibling.js +2 -3
- package/libEs5/components/Personalization/dom-actions/dom/getNonce.js +3 -5
- package/libEs5/components/Personalization/dom-actions/dom/getParent.js +2 -3
- package/libEs5/components/Personalization/dom-actions/dom/helperForEq.js +3 -5
- package/libEs5/components/Personalization/dom-actions/dom/insertAfter.js +2 -3
- package/libEs5/components/Personalization/dom-actions/dom/insertBefore.js +2 -3
- package/libEs5/components/Personalization/dom-actions/dom/matchesSelectorWithEq.js +2 -3
- package/libEs5/components/Personalization/dom-actions/dom/removeAttribute.js +2 -3
- package/libEs5/components/Personalization/dom-actions/dom/selectNodesWithEq.js +16 -19
- package/libEs5/components/Personalization/dom-actions/dom/setAttribute.js +2 -3
- package/libEs5/components/Personalization/dom-actions/dom/setStyle.js +2 -3
- package/libEs5/components/Personalization/dom-actions/images.js +4 -7
- package/libEs5/components/Personalization/dom-actions/initDomActionsModules.js +2 -3
- package/libEs5/components/Personalization/dom-actions/insertHtmlAfter.js +2 -3
- package/libEs5/components/Personalization/dom-actions/insertHtmlBefore.js +2 -3
- package/libEs5/components/Personalization/dom-actions/prependHtml.js +2 -3
- package/libEs5/components/Personalization/dom-actions/rearrangeChildren.js +2 -3
- package/libEs5/components/Personalization/dom-actions/remapCustomCodeOffers.js +2 -3
- package/libEs5/components/Personalization/dom-actions/remapHeadOffers.js +2 -3
- package/libEs5/components/Personalization/dom-actions/replaceHtml.js +2 -3
- package/libEs5/components/Personalization/dom-actions/scripts.js +22 -24
- package/libEs5/components/Personalization/dom-actions/setAttributes.js +2 -3
- package/libEs5/components/Personalization/dom-actions/setHtml.js +2 -3
- package/libEs5/components/Personalization/dom-actions/setStyles.js +2 -3
- package/libEs5/components/Personalization/dom-actions/setText.js +2 -3
- package/libEs5/components/Personalization/dom-actions/swapImage.js +2 -3
- package/libEs5/components/Personalization/event.js +19 -18
- package/libEs5/components/Personalization/flicker/index.js +21 -22
- package/libEs5/components/Personalization/handlers/createProcessDomAction.js +8 -6
- package/libEs5/components/Personalization/handlers/createProcessHtmlContent.js +2 -3
- package/libEs5/components/Personalization/handlers/createProcessInAppMessage.js +18 -16
- package/libEs5/components/Personalization/handlers/createProcessPropositions.js +3 -4
- package/libEs5/components/Personalization/handlers/createProcessRedirect.js +2 -4
- package/libEs5/components/Personalization/handlers/injectCreateProposition.js +24 -22
- package/libEs5/components/Personalization/handlers/processDefaultContent.js +2 -3
- package/libEs5/components/Personalization/in-app-message-actions/actions/displayIframeContent.js +25 -29
- package/libEs5/components/Personalization/in-app-message-actions/initInAppMessageActionsModules.js +2 -3
- package/libEs5/components/Personalization/in-app-message-actions/utils.js +3 -5
- package/libEs5/components/Personalization/index.js +31 -22
- package/libEs5/components/Personalization/utils/addRenderAttemptedToDecisions.js +2 -3
- package/libEs5/components/Personalization/utils/createAsyncArray.js +2 -3
- package/libEs5/components/Personalization/utils/isAuthoringModeEnabled.js +2 -3
- package/libEs5/components/Personalization/utils/surfaceUtils.js +4 -7
- package/libEs5/components/Personalization/validateApplyPropositionsOptions.js +3 -5
- package/libEs5/components/Privacy/computeConsentHash.js +13 -14
- package/libEs5/components/Privacy/createComponent.js +16 -14
- package/libEs5/components/Privacy/createConsentHashStore.js +2 -3
- package/libEs5/components/Privacy/createConsentRequest.js +2 -3
- package/libEs5/components/Privacy/createConsentRequestPayload.js +2 -3
- package/libEs5/components/Privacy/createStoredConsent.js +2 -3
- package/libEs5/components/Privacy/index.js +1 -2
- package/libEs5/components/Privacy/injectSendSetConsentRequest.js +2 -3
- package/libEs5/components/Privacy/parseConsentCookie.js +4 -5
- package/libEs5/components/Privacy/validateSetConsentOptions.js +2 -3
- package/libEs5/components/{MediaCollection/createMediaRequestPayload.js → StreamingMedia/configValidators.js} +11 -16
- package/libEs5/components/StreamingMedia/constants/eventTypes.js +34 -0
- package/libEs5/components/StreamingMedia/constants/playbackState.js +19 -0
- package/libEs5/components/{MediaCollection → StreamingMedia}/createMediaEventManager.js +46 -53
- package/libEs5/components/{MediaCollection → StreamingMedia}/createMediaRequest.js +2 -3
- package/libEs5/components/StreamingMedia/createMediaResponseHandler.js +57 -0
- package/libEs5/components/{MediaCollection → StreamingMedia}/createMediaSessionCacheManager.js +23 -27
- package/libEs5/components/StreamingMedia/createStreamingMediaComponent.js +72 -0
- package/libEs5/components/StreamingMedia/createTrackMediaEvent.js +90 -0
- package/libEs5/components/StreamingMedia/createTrackMediaSession.js +52 -0
- package/libEs5/components/StreamingMedia/index.js +69 -0
- package/libEs5/components/StreamingMedia/validateMediaEventOptions.js +40 -0
- package/libEs5/components/{MediaCollection → StreamingMedia}/validateMediaSessionOptions.js +3 -4
- package/libEs5/constants/apiVersion.js +1 -2
- package/libEs5/constants/browser.js +7 -14
- package/libEs5/constants/consentPurpose.js +1 -2
- package/libEs5/constants/consentStatus.js +3 -6
- package/libEs5/constants/contentType.js +2 -4
- package/libEs5/constants/cookieNameKey.js +3 -6
- package/libEs5/constants/cookieNamePrefix.js +1 -2
- package/libEs5/constants/coreCommands.js +2 -4
- package/libEs5/constants/debugQueryParam.js +1 -2
- package/libEs5/constants/decisionProvider.js +1 -2
- package/libEs5/constants/domain.js +2 -4
- package/libEs5/constants/ecidNamespace.js +1 -2
- package/libEs5/constants/edgeBasePath.js +1 -2
- package/libEs5/constants/elementAttribute.js +1 -2
- package/libEs5/constants/eventType.js +5 -10
- package/libEs5/constants/handle.js +1 -2
- package/libEs5/constants/highEntropyUserAgentClientHints.js +1 -2
- package/libEs5/constants/httpHeaderNames.js +2 -4
- package/libEs5/constants/httpStatusCode.js +5 -10
- package/libEs5/constants/identityMapAuthenticatedState.js +3 -6
- package/libEs5/constants/legacyCookies.js +3 -6
- package/libEs5/constants/libraryName.js +1 -2
- package/libEs5/constants/libraryVersion.js +1 -2
- package/libEs5/constants/namespace.js +1 -2
- package/libEs5/constants/pageWideScope.js +1 -2
- package/libEs5/constants/propositionEventType.js +20 -21
- package/libEs5/constants/queryStringIdentityParam.js +1 -2
- package/libEs5/constants/schema.js +10 -20
- package/libEs5/constants/shadowSeparator.js +1 -2
- package/libEs5/constants/tagName.js +7 -14
- package/libEs5/core/buildAndValidateConfig.js +19 -17
- package/libEs5/core/componentCreators.js +9 -4
- package/libEs5/core/config/createConfig.js +1 -2
- package/libEs5/core/config/createCoreConfigs.js +2 -3
- package/libEs5/core/consent/createConsent.js +5 -3
- package/libEs5/core/consent/createConsentStateMachine.js +41 -13
- package/libEs5/core/createComponentRegistry.js +5 -3
- package/libEs5/core/createCookieTransfer.js +2 -3
- package/libEs5/core/createEvent.js +13 -14
- package/libEs5/core/createEventManager.js +8 -6
- package/libEs5/core/createInstanceFunction.js +2 -3
- package/libEs5/core/createLifecycle.js +2 -3
- package/libEs5/core/createLogController.js +2 -3
- package/libEs5/core/createLogger.js +2 -3
- package/libEs5/core/edgeNetwork/handleRequestFailure.js +2 -3
- package/libEs5/core/edgeNetwork/injectApplyResponse.js +2 -3
- package/libEs5/core/edgeNetwork/injectExtractEdgeInfo.js +2 -3
- package/libEs5/core/edgeNetwork/injectGetLocationHint.js +2 -3
- package/libEs5/core/edgeNetwork/injectProcessWarningsAndErrors.js +2 -3
- package/libEs5/core/edgeNetwork/injectSendEdgeNetworkRequest.js +2 -3
- package/libEs5/core/edgeNetwork/mergeLifecycleResponses.js +13 -14
- package/libEs5/core/index.js +3 -5
- package/libEs5/core/initializeComponents.js +2 -3
- package/libEs5/core/injectCreateResponse.js +2 -3
- package/libEs5/core/injectExecuteCommand.js +2 -3
- package/libEs5/core/injectHandleError.js +2 -3
- package/libEs5/core/injectShouldTransferCookie.js +2 -3
- package/libEs5/core/network/getRequestRetryDelay.js +2 -3
- package/libEs5/core/network/injectSendNetworkRequest.js +18 -16
- package/libEs5/core/network/isRequestRetryable.js +2 -3
- package/libEs5/core/network/requestMethods/injectSendBeaconRequest.js +2 -3
- package/libEs5/core/network/requestMethods/injectSendFetchRequest.js +2 -3
- package/libEs5/core/network/requestMethods/injectSendXhrRequest.js +2 -3
- package/libEs5/core/validateCommandOptions.js +2 -3
- package/libEs5/index.js +2 -3
- package/libEs5/utils/areThirdPartyCookiesSupportedByDefault.js +2 -3
- package/libEs5/utils/assign.js +1 -2
- package/libEs5/utils/assignConcatArrayValues.js +13 -14
- package/libEs5/utils/assignIf.js +2 -3
- package/libEs5/utils/clone.js +2 -3
- package/libEs5/utils/cookieJar.js +2 -3
- package/libEs5/utils/crc32.js +1 -2
- package/libEs5/utils/createCallbackAggregator.js +2 -3
- package/libEs5/utils/createLoggingCookieJar.js +8 -6
- package/libEs5/utils/createMerger.js +2 -3
- package/libEs5/utils/createSubscription.js +12 -13
- package/libEs5/utils/createTaskQueue.js +2 -3
- package/libEs5/utils/deduplicateArray.js +2 -3
- package/libEs5/utils/deepAssign.js +2 -3
- package/libEs5/utils/defer.js +2 -3
- package/libEs5/utils/dom/appendNode.js +2 -3
- package/libEs5/utils/dom/awaitSelector.js +7 -13
- package/libEs5/utils/dom/createNode.js +2 -3
- package/libEs5/utils/dom/isShadowSelector.js +2 -3
- package/libEs5/utils/dom/matchesSelector.js +2 -3
- package/libEs5/utils/dom/querySelectorAll.js +2 -3
- package/libEs5/utils/dom/removeNode.js +2 -3
- package/libEs5/utils/dom/selectNodes.js +2 -3
- package/libEs5/utils/dom/selectNodesWithShadow.js +2 -3
- package/libEs5/utils/endsWith.js +2 -3
- package/libEs5/utils/filterObject.js +17 -15
- package/libEs5/utils/find.js +2 -3
- package/libEs5/utils/fireImage.js +2 -3
- package/libEs5/utils/flatMap.js +2 -3
- package/libEs5/utils/flattenArray.js +2 -3
- package/libEs5/utils/flattenObject.js +4 -5
- package/libEs5/utils/getApexDomain.js +2 -3
- package/libEs5/utils/getBrowser.js +17 -16
- package/libEs5/utils/getLastArrayItems.js +2 -3
- package/libEs5/utils/getNamespacedCookieName.js +2 -3
- package/libEs5/utils/groupBy.js +2 -3
- package/libEs5/utils/includes.js +2 -3
- package/libEs5/utils/injectDoesIdentityCookieExist.js +2 -3
- package/libEs5/utils/injectFireReferrerHideableImage.js +14 -15
- package/libEs5/utils/injectStorage.js +2 -3
- package/libEs5/utils/intersection.js +2 -3
- package/libEs5/utils/isBlankString.js +2 -3
- package/libEs5/utils/isBoolean.js +2 -3
- package/libEs5/utils/isEmptyObject.js +2 -3
- package/libEs5/utils/isFunction.js +2 -3
- package/libEs5/utils/isInteger.js +2 -3
- package/libEs5/utils/isNamespacedCookieName.js +2 -3
- package/libEs5/utils/isNil.js +2 -3
- package/libEs5/utils/isNonEmptyArray.js +2 -3
- package/libEs5/utils/isNonEmptyString.js +2 -3
- package/libEs5/utils/isNumber.js +2 -3
- package/libEs5/utils/isObject.js +13 -14
- package/libEs5/utils/isString.js +2 -3
- package/libEs5/utils/isUnique.js +2 -3
- package/libEs5/utils/isValidRegExp.js +2 -3
- package/libEs5/utils/memoize.js +2 -3
- package/libEs5/utils/noop.js +1 -2
- package/libEs5/utils/padStart.js +2 -3
- package/libEs5/utils/parseUrl.js +17 -15
- package/libEs5/utils/prepareConfigOverridesForEdge.js +13 -14
- package/libEs5/utils/querystring.js +1 -2
- package/libEs5/utils/request/createAddIdentity.js +2 -3
- package/libEs5/utils/request/createDataCollectionRequest.js +2 -3
- package/libEs5/utils/request/createDataCollectionRequestPayload.js +2 -3
- package/libEs5/utils/request/createGetAssuranceValidationTokenParams.js +2 -3
- package/libEs5/utils/request/createHasIdentity.js +2 -3
- package/libEs5/utils/request/createRequest.js +2 -3
- package/libEs5/utils/request/createRequestParams.js +2 -3
- package/libEs5/utils/request/createRequestPayload.js +2 -3
- package/libEs5/utils/sanitizeOrgIdForCookieName.js +2 -3
- package/libEs5/utils/stackError.js +2 -3
- package/libEs5/utils/startsWith.js +2 -3
- package/libEs5/utils/stringToBoolean.js +2 -3
- package/libEs5/utils/toArray.js +2 -3
- package/libEs5/utils/toError.js +2 -3
- package/libEs5/utils/toISOStringLocal.js +2 -3
- package/libEs5/utils/toInteger.js +2 -3
- package/libEs5/utils/updateErrorMessage.js +2 -3
- package/libEs5/utils/uuid.js +1 -2
- package/libEs5/utils/validateConfigOverride.js +1 -2
- package/libEs5/utils/validateIdentityMap.js +2 -3
- package/libEs5/utils/validation/booleanValidator.js +2 -3
- package/libEs5/utils/validation/callbackValidator.js +2 -3
- package/libEs5/utils/validation/createAnyOfValidator.js +2 -3
- package/libEs5/utils/validation/createArrayOfValidator.js +2 -3
- package/libEs5/utils/validation/createDefaultValidator.js +2 -3
- package/libEs5/utils/validation/createDeprecatedValidator.js +18 -19
- package/libEs5/utils/validation/createLiteralValidator.js +2 -3
- package/libEs5/utils/validation/createMapOfValuesValidator.js +2 -3
- package/libEs5/utils/validation/createMaximumValidator.js +2 -3
- package/libEs5/utils/validation/createMinimumValidator.js +2 -3
- package/libEs5/utils/validation/createNoUnknownFieldsValidator.js +2 -3
- package/libEs5/utils/validation/createNonEmptyValidator.js +2 -3
- package/libEs5/utils/validation/createObjectOfValidator.js +2 -3
- package/libEs5/utils/validation/createUniqueItemsValidator.js +2 -3
- package/libEs5/utils/validation/createUniqueValidator.js +2 -3
- package/libEs5/utils/validation/domainValidator.js +2 -3
- package/libEs5/utils/validation/index.js +90 -93
- package/libEs5/utils/validation/integerValidator.js +2 -3
- package/{libEs6/components/MediaCollection/createMediaRequestPayload.js → libEs5/utils/validation/matchesRegexpValidator.js} +9 -14
- package/libEs5/utils/validation/numberValidator.js +2 -3
- package/libEs5/utils/validation/regexpValidator.js +2 -3
- package/libEs5/utils/validation/requiredValidator.js +2 -3
- package/libEs5/utils/validation/stringValidator.js +2 -3
- package/libEs5/utils/validation/utils.js +5 -9
- package/libEs5/utils/values.js +2 -3
- package/libEs6/components/ActivityCollector/index.js +0 -1
- package/libEs6/components/Identity/index.js +2 -1
- package/libEs6/components/Identity/injectAddQueryStringIdentityToPayload.js +5 -1
- package/libEs6/components/Identity/injectAwaitIdentityCookie.js +7 -11
- package/libEs6/components/Identity/injectEnsureSingleIdentity.js +4 -3
- package/libEs6/components/LegacyMediaAnalytics/{media → constants}/constants.js +11 -10
- package/libEs6/components/LegacyMediaAnalytics/createGetInstance.js +240 -0
- package/libEs6/components/LegacyMediaAnalytics/createLegacyMediaComponent.js +85 -0
- package/libEs6/components/LegacyMediaAnalytics/createMediaHelper.js +157 -150
- package/libEs6/components/LegacyMediaAnalytics/index.js +40 -18
- package/libEs6/components/LibraryInfo/index.js +3 -1
- package/libEs6/components/Personalization/createComponent.js +5 -1
- package/libEs6/components/Personalization/createFetchDataHandler.js +16 -6
- package/libEs6/components/{MediaCollection/createUpdateMediaSessionState.js → Personalization/createHandleConsentFlicker.js} +14 -24
- package/libEs6/components/Personalization/createNotificationHandler.js +6 -2
- package/libEs6/components/Personalization/createOnDecisionHandler.js +1 -1
- package/libEs6/components/Personalization/handlers/createProcessRedirect.js +0 -1
- package/libEs6/components/Personalization/index.js +11 -3
- package/libEs6/components/StreamingMedia/configValidators.js +22 -0
- package/libEs6/components/StreamingMedia/constants/eventTypes.js +31 -0
- package/libEs6/components/StreamingMedia/constants/playbackState.js +16 -0
- package/libEs6/components/{MediaCollection → StreamingMedia}/createMediaEventManager.js +44 -44
- package/libEs6/components/StreamingMedia/createMediaResponseHandler.js +58 -0
- package/libEs6/components/{MediaCollection → StreamingMedia}/createMediaSessionCacheManager.js +17 -21
- package/libEs6/components/StreamingMedia/createStreamingMediaComponent.js +69 -0
- package/libEs6/components/StreamingMedia/createTrackMediaEvent.js +88 -0
- package/libEs6/components/StreamingMedia/createTrackMediaSession.js +51 -0
- package/libEs6/components/StreamingMedia/index.js +64 -0
- package/libEs6/components/{MediaCollection → StreamingMedia}/validateMediaEventOptions.js +4 -3
- package/libEs6/components/{MediaCollection → StreamingMedia}/validateMediaSessionOptions.js +1 -1
- package/libEs6/constants/libraryVersion.js +1 -1
- package/libEs6/core/componentCreators.js +19 -3
- package/libEs6/core/consent/createConsent.js +3 -0
- package/libEs6/core/consent/createConsentStateMachine.js +34 -0
- package/libEs6/core/createComponentRegistry.js +3 -0
- package/libEs6/utils/validation/index.js +6 -1
- package/libEs6/utils/{debounce.js → validation/matchesRegexpValidator.js} +5 -10
- package/package.json +19 -4
- package/libEs5/components/LegacyMediaAnalytics/createMediaAnalyticsTracker.js +0 -272
- package/libEs5/components/MediaCollection/createHeartbeatEngine.js +0 -55
- package/libEs5/components/MediaCollection/createUpdateMediaSessionState.js +0 -35
- package/libEs5/components/MediaCollection/index.js +0 -159
- package/libEs5/components/MediaCollection/mediaConstants/mediaEvents.js +0 -13
- package/libEs5/components/MediaCollection/validateMediaEventOptions.js +0 -35
- package/libEs6/components/LegacyMediaAnalytics/createMediaAnalyticsTracker.js +0 -276
- package/libEs6/components/MediaCollection/createHeartbeatEngine.js +0 -57
- package/libEs6/components/MediaCollection/index.js +0 -158
- package/libEs6/components/MediaCollection/mediaConstants/mediaEvents.js +0 -9
- /package/libEs6/components/LegacyMediaAnalytics/{media → constants}/mediaKeysToXdmConverter.js +0 -0
- /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
|
-
|
|
27
|
-
function
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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.
|
|
216
|
-
var
|
|
217
|
-
exports.
|
|
218
|
-
var
|
|
219
|
-
exports.
|
|
220
|
-
var
|
|
221
|
-
exports.
|
|
222
|
-
var
|
|
223
|
-
exports.
|
|
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.
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
+
};
|
package/libEs5/utils/values.js
CHANGED
|
@@ -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
|
+
};
|
|
@@ -28,10 +28,14 @@ export default (({
|
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
30
|
const parsedQueryString = queryString.parse(locationSearch);
|
|
31
|
-
|
|
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
|
-
|
|
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
|
|
36
|
-
//
|
|
37
|
-
|
|
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("
|
|
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
|
|
59
|
-
//
|
|
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
|
|
13
|
+
export const MEDIA_TYPE = {
|
|
14
14
|
Video: "video",
|
|
15
15
|
Audio: "audio"
|
|
16
16
|
};
|
|
17
|
-
export const
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
100
|
+
Error: "error",
|
|
101
|
+
StateUpdate: "statesUpdate"
|
|
101
102
|
};
|
|
102
|
-
export const
|
|
103
|
+
export const MEDIA_OBJECT_KEYS = {
|
|
103
104
|
MediaResumed: "media.resumed",
|
|
104
105
|
GranularAdTracking: "media.granularadtracking"
|
|
105
106
|
};
|
|
106
|
-
export const
|
|
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
|
|
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
|
|
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",
|