@adobe/alloy 2.20.0-beta.2 → 2.20.0-beta.4
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 +61 -0
- package/libEs5/components/ActivityCollector/attachClickActivityCollector.js +53 -0
- package/libEs5/components/ActivityCollector/configValidators.js +22 -0
- package/libEs5/components/ActivityCollector/createGetLinkDetails.js +68 -0
- package/libEs5/components/ActivityCollector/createLinkClick.js +38 -0
- package/libEs5/components/ActivityCollector/getLinkName.js +139 -0
- package/libEs5/components/ActivityCollector/getLinkRegion.js +61 -0
- package/libEs5/components/ActivityCollector/index.js +78 -0
- package/libEs5/components/ActivityCollector/utils.js +104 -0
- package/libEs5/components/Audiences/index.js +49 -0
- package/libEs5/components/Audiences/injectProcessDestinations.js +67 -0
- package/libEs5/components/Audiences/injectProcessResponse.js +38 -0
- package/libEs5/components/Context/createComponent.js +39 -0
- package/libEs5/components/Context/implementationDetails.js +27 -0
- package/libEs5/components/Context/index.js +59 -0
- package/libEs5/components/Context/injectDevice.js +66 -0
- package/libEs5/components/Context/injectEnvironment.js +40 -0
- package/libEs5/components/Context/injectHighEntropyUserAgentHints.js +58 -0
- package/libEs5/components/Context/injectPlaceContext.js +32 -0
- package/libEs5/components/Context/injectTimestamp.js +23 -0
- package/libEs5/components/Context/injectWeb.js +30 -0
- package/libEs5/components/DataCollector/index.js +110 -0
- package/libEs5/components/DataCollector/validateApplyResponse.js +35 -0
- package/libEs5/components/DataCollector/validateUserEventOptions.js +50 -0
- package/libEs5/components/DecisioningEngine/consequenceAdapters/inAppMessageConsequenceAdapter.js +31 -0
- package/libEs5/components/DecisioningEngine/consequenceAdapters/schemaTypeConsequenceAdapter.js +24 -0
- package/libEs5/components/DecisioningEngine/constants.js +28 -0
- package/libEs5/components/DecisioningEngine/createApplyResponse.js +35 -0
- package/libEs5/components/DecisioningEngine/createConsequenceAdapter.js +30 -0
- package/libEs5/components/DecisioningEngine/createContextProvider.js +95 -0
- package/libEs5/components/DecisioningEngine/createDecisionHistory.js +27 -0
- package/libEs5/components/DecisioningEngine/createDecisionProvider.js +50 -0
- package/libEs5/components/DecisioningEngine/createEvaluableRulesetPayload.js +82 -0
- package/libEs5/components/DecisioningEngine/createEvaluateRulesetsCommand.js +48 -0
- package/libEs5/components/DecisioningEngine/createEventRegistry.js +130 -0
- package/libEs5/components/DecisioningEngine/createOnResponseHandler.js +48 -0
- package/libEs5/components/DecisioningEngine/createSubscribeRulesetItems.js +89 -0
- package/libEs5/components/DecisioningEngine/index.js +119 -0
- package/libEs5/components/DecisioningEngine/utils.js +82 -0
- package/libEs5/components/EventMerge/createComponent.js +24 -0
- package/libEs5/components/EventMerge/createEventMergeId.js +20 -0
- package/libEs5/components/EventMerge/index.js +24 -0
- package/libEs5/components/Identity/addEcidQueryToPayload.js +22 -0
- package/libEs5/components/Identity/addEcidToPayload.js +20 -0
- package/libEs5/components/Identity/appendIdentityToUrl/appendIdentityToUrlOptionsValidator.js +25 -0
- package/libEs5/components/Identity/appendIdentityToUrl/injectAppendIdentityToUrl.js +45 -0
- package/libEs5/components/Identity/configValidators.js +21 -0
- package/libEs5/components/Identity/constants/authState.js +18 -0
- package/libEs5/components/Identity/constants/defaultIdSyncTtlMinutes.js +15 -0
- package/libEs5/components/Identity/createComponent.js +97 -0
- package/libEs5/components/Identity/createLegacyIdentity.js +72 -0
- package/libEs5/components/Identity/getEcidFromResponse.js +23 -0
- package/libEs5/components/Identity/getIdentity/createGetIdentity.js +35 -0
- package/libEs5/components/Identity/getIdentity/createIdentityRequest.js +29 -0
- package/libEs5/components/Identity/getIdentity/createIdentityRequestPayload.js +29 -0
- package/libEs5/components/Identity/getIdentity/getIdentityOptionsValidator.js +27 -0
- package/libEs5/components/Identity/index.js +129 -0
- package/libEs5/components/Identity/injectAddLegacyEcidToPayload.js +31 -0
- package/libEs5/components/Identity/injectAddQueryStringIdentityToPayload.js +68 -0
- package/libEs5/components/Identity/injectAwaitIdentityCookie.js +52 -0
- package/libEs5/components/Identity/injectEnsureSingleIdentity.js +100 -0
- package/libEs5/components/Identity/injectHandleResponseForIdSyncs.js +20 -0
- package/libEs5/components/Identity/injectProcessIdSyncs.js +41 -0
- package/libEs5/components/Identity/injectSetDomainForInitialIdentityPayload.js +33 -0
- package/libEs5/components/Identity/visitorService/awaitVisitorOptIn.js +34 -0
- package/libEs5/components/Identity/visitorService/getVisitor.js +19 -0
- package/libEs5/components/Identity/visitorService/injectGetEcidFromVisitor.js +49 -0
- package/libEs5/components/LegacyMediaAnalytics/constants/constants.js +144 -0
- package/libEs5/components/LegacyMediaAnalytics/constants/mediaKeysToXdmConverter.js +49 -0
- package/libEs5/components/LegacyMediaAnalytics/createGetInstance.js +245 -0
- package/libEs5/components/LegacyMediaAnalytics/createLegacyMediaComponent.js +87 -0
- package/libEs5/components/LegacyMediaAnalytics/createMediaHelper.js +181 -0
- package/libEs5/components/LegacyMediaAnalytics/index.js +71 -0
- package/libEs5/components/LibraryInfo/index.js +68 -0
- package/libEs5/components/MachineLearning/index.js +26 -0
- package/libEs5/components/MachineLearning/processResponse.js +19 -0
- package/libEs5/components/Personalization/constants/loggerMessage.js +16 -0
- package/libEs5/components/Personalization/constants/scopeType.js +18 -0
- package/libEs5/components/Personalization/constants/surface.js +19 -0
- package/libEs5/components/Personalization/createActionsProvider.js +71 -0
- package/libEs5/components/Personalization/createApplyPropositions.js +115 -0
- package/libEs5/components/Personalization/createClickStorage.js +64 -0
- package/libEs5/components/Personalization/createCollect.js +53 -0
- package/libEs5/components/Personalization/createComponent.js +145 -0
- package/libEs5/components/Personalization/createFetchDataHandler.js +92 -0
- package/libEs5/components/Personalization/createGetPageLocation.js +20 -0
- package/libEs5/components/Personalization/createHandleConsentFlicker.js +29 -0
- package/libEs5/components/Personalization/createNotificationHandler.js +38 -0
- package/libEs5/components/Personalization/createOnClickHandler.js +51 -0
- package/libEs5/components/Personalization/createOnDecisionHandler.js +43 -0
- package/libEs5/components/Personalization/createPersonalizationDetails.js +104 -0
- package/libEs5/components/Personalization/createPreprocessors.js +23 -0
- package/libEs5/components/Personalization/createSetTargetMigration.js +28 -0
- package/libEs5/components/Personalization/createViewCacheManager.js +90 -0
- package/libEs5/components/Personalization/createViewChangeHandler.js +45 -0
- package/libEs5/components/Personalization/dom-actions/action.js +120 -0
- package/libEs5/components/Personalization/dom-actions/addNonceToInlineStyleElements.js +41 -0
- package/libEs5/components/Personalization/dom-actions/appendHtml.js +32 -0
- package/libEs5/components/Personalization/dom-actions/clicks/collectClicks.js +108 -0
- package/libEs5/components/Personalization/dom-actions/createPreprocess.js +25 -0
- package/libEs5/components/Personalization/dom-actions/createRedirect.js +27 -0
- package/libEs5/components/Personalization/dom-actions/dom/createFragment.js +21 -0
- package/libEs5/components/Personalization/dom-actions/dom/getAttribute.js +17 -0
- package/libEs5/components/Personalization/dom-actions/dom/getChildNodes.js +22 -0
- package/libEs5/components/Personalization/dom-actions/dom/getChildren.js +22 -0
- package/libEs5/components/Personalization/dom-actions/dom/getElementById.js +24 -0
- package/libEs5/components/Personalization/dom-actions/dom/getFirstChild.js +17 -0
- package/libEs5/components/Personalization/dom-actions/dom/getNextSibling.js +17 -0
- package/libEs5/components/Personalization/dom-actions/dom/getNonce.js +35 -0
- package/libEs5/components/Personalization/dom-actions/dom/getParent.js +17 -0
- package/libEs5/components/Personalization/dom-actions/dom/helperForEq.js +24 -0
- package/libEs5/components/Personalization/dom-actions/dom/index.js +100 -0
- package/libEs5/components/Personalization/dom-actions/dom/insertAfter.js +25 -0
- package/libEs5/components/Personalization/dom-actions/dom/insertBefore.js +24 -0
- package/libEs5/components/Personalization/dom-actions/dom/matchesSelectorWithEq.js +37 -0
- package/libEs5/components/Personalization/dom-actions/dom/removeAttribute.js +17 -0
- package/libEs5/components/Personalization/dom-actions/dom/selectNodesWithEq.js +104 -0
- package/libEs5/components/Personalization/dom-actions/dom/setAttribute.js +17 -0
- package/libEs5/components/Personalization/dom-actions/dom/setStyle.js +23 -0
- package/libEs5/components/Personalization/dom-actions/images.js +36 -0
- package/libEs5/components/Personalization/dom-actions/index.js +9 -0
- package/libEs5/components/Personalization/dom-actions/initDomActionsModules.js +35 -0
- package/libEs5/components/Personalization/dom-actions/insertHtmlAfter.js +31 -0
- package/libEs5/components/Personalization/dom-actions/insertHtmlBefore.js +31 -0
- package/libEs5/components/Personalization/dom-actions/prependHtml.js +45 -0
- package/libEs5/components/Personalization/dom-actions/rearrangeChildren.js +32 -0
- package/libEs5/components/Personalization/dom-actions/remapCustomCodeOffers.js +36 -0
- package/libEs5/components/Personalization/dom-actions/remapHeadOffers.js +54 -0
- package/libEs5/components/Personalization/dom-actions/replaceHtml.js +20 -0
- package/libEs5/components/Personalization/dom-actions/scripts.js +90 -0
- package/libEs5/components/Personalization/dom-actions/setAttributes.js +20 -0
- package/libEs5/components/Personalization/dom-actions/setHtml.js +27 -0
- package/libEs5/components/Personalization/dom-actions/setStyles.js +25 -0
- package/libEs5/components/Personalization/dom-actions/setText.js +17 -0
- package/libEs5/components/Personalization/dom-actions/swapImage.js +31 -0
- package/libEs5/components/Personalization/event.js +49 -0
- package/libEs5/components/Personalization/flicker/index.js +86 -0
- package/libEs5/components/Personalization/handlers/createProcessDomAction.js +71 -0
- package/libEs5/components/Personalization/handlers/createProcessHtmlContent.js +43 -0
- package/libEs5/components/Personalization/handlers/createProcessInAppMessage.js +78 -0
- package/libEs5/components/Personalization/handlers/createProcessPropositions.js +194 -0
- package/libEs5/components/Personalization/handlers/createProcessRedirect.js +44 -0
- package/libEs5/components/Personalization/handlers/injectCreateProposition.js +118 -0
- package/libEs5/components/Personalization/handlers/processDefaultContent.js +20 -0
- package/libEs5/components/Personalization/in-app-message-actions/actions/displayIframeContent.js +286 -0
- package/libEs5/components/Personalization/in-app-message-actions/initInAppMessageActionsModules.js +22 -0
- package/libEs5/components/Personalization/in-app-message-actions/utils.js +51 -0
- package/libEs5/components/Personalization/index.js +162 -0
- package/libEs5/components/Personalization/utils/addRenderAttemptedToDecisions.js +24 -0
- package/libEs5/components/Personalization/utils/createAsyncArray.js +38 -0
- package/libEs5/components/Personalization/utils/isAuthoringModeEnabled.js +18 -0
- package/libEs5/components/Personalization/utils/surfaceUtils.js +101 -0
- package/libEs5/components/Personalization/validateApplyPropositionsOptions.js +34 -0
- package/libEs5/components/Privacy/computeConsentHash.js +33 -0
- package/libEs5/components/Privacy/createComponent.js +88 -0
- package/libEs5/components/Privacy/createConsentHashStore.js +59 -0
- package/libEs5/components/Privacy/createConsentRequest.js +29 -0
- package/libEs5/components/Privacy/createConsentRequestPayload.js +33 -0
- package/libEs5/components/Privacy/createStoredConsent.js +31 -0
- package/libEs5/components/Privacy/index.js +63 -0
- package/libEs5/components/Privacy/injectSendSetConsentRequest.js +47 -0
- package/libEs5/components/Privacy/parseConsentCookie.js +37 -0
- package/libEs5/components/Privacy/validateSetConsentOptions.js +21 -0
- package/libEs5/components/StreamingMedia/configValidators.js +24 -0
- package/libEs5/components/StreamingMedia/constants/eventTypes.js +34 -0
- package/libEs5/components/StreamingMedia/constants/playbackState.js +19 -0
- package/libEs5/components/StreamingMedia/createMediaEventManager.js +112 -0
- package/libEs5/components/StreamingMedia/createMediaRequest.js +29 -0
- package/libEs5/components/StreamingMedia/createMediaResponseHandler.js +57 -0
- package/libEs5/components/StreamingMedia/createMediaSessionCacheManager.js +58 -0
- 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/StreamingMedia/validateMediaSessionOptions.js +35 -0
- package/libEs5/constants/apiVersion.js +15 -0
- package/libEs5/constants/browser.js +22 -0
- package/libEs5/constants/consentPurpose.js +16 -0
- package/libEs5/constants/consentStatus.js +18 -0
- package/libEs5/constants/contentType.js +16 -0
- package/libEs5/constants/cookieNameKey.js +18 -0
- package/libEs5/constants/cookieNamePrefix.js +16 -0
- package/libEs5/constants/coreCommands.js +17 -0
- package/libEs5/constants/debugQueryParam.js +15 -0
- package/libEs5/constants/decisionProvider.js +15 -0
- package/libEs5/constants/domain.js +17 -0
- package/libEs5/constants/ecidNamespace.js +15 -0
- package/libEs5/constants/edgeBasePath.js +15 -0
- package/libEs5/constants/elementAttribute.js +16 -0
- package/libEs5/constants/eventType.js +20 -0
- package/libEs5/constants/handle.js +15 -0
- package/libEs5/constants/highEntropyUserAgentClientHints.js +15 -0
- package/libEs5/constants/httpHeaderNames.js +17 -0
- package/libEs5/constants/httpStatusCode.js +20 -0
- package/libEs5/constants/identityMapAuthenticatedState.js +17 -0
- package/libEs5/constants/legacyCookies.js +18 -0
- package/libEs5/constants/libraryName.js +15 -0
- package/libEs5/constants/libraryVersion.js +17 -0
- package/libEs5/constants/namespace.js +15 -0
- package/libEs5/constants/pageWideScope.js +15 -0
- package/libEs5/constants/propositionEventType.js +32 -0
- package/libEs5/constants/queryStringIdentityParam.js +15 -0
- package/libEs5/constants/schema.js +25 -0
- package/libEs5/constants/shadowSeparator.js +15 -0
- package/libEs5/constants/tagName.js +22 -0
- package/libEs5/core/buildAndValidateConfig.js +115 -0
- package/libEs5/core/componentCreators.js +39 -0
- package/libEs5/core/config/createConfig.js +20 -0
- package/libEs5/core/config/createCoreConfigs.js +31 -0
- package/libEs5/core/consent/createConsent.js +61 -0
- package/libEs5/core/consent/createConsentStateMachine.js +137 -0
- package/libEs5/core/createComponentRegistry.js +86 -0
- package/libEs5/core/createCookieTransfer.js +80 -0
- package/libEs5/core/createEvent.js +170 -0
- package/libEs5/core/createEventManager.js +144 -0
- package/libEs5/core/createInstanceFunction.js +27 -0
- package/libEs5/core/createLifecycle.js +74 -0
- package/libEs5/core/createLogController.js +70 -0
- package/libEs5/core/createLogger.js +103 -0
- package/libEs5/core/edgeNetwork/handleRequestFailure.js +27 -0
- package/libEs5/core/edgeNetwork/injectApplyResponse.js +66 -0
- package/libEs5/core/edgeNetwork/injectExtractEdgeInfo.js +42 -0
- package/libEs5/core/edgeNetwork/injectGetLocationHint.js +35 -0
- package/libEs5/core/edgeNetwork/injectProcessWarningsAndErrors.js +42 -0
- package/libEs5/core/edgeNetwork/injectSendEdgeNetworkRequest.js +99 -0
- package/libEs5/core/edgeNetwork/mergeLifecycleResponses.js +28 -0
- package/libEs5/core/index.js +238 -0
- package/libEs5/core/initializeComponents.js +41 -0
- package/libEs5/core/injectCreateResponse.js +77 -0
- package/libEs5/core/injectExecuteCommand.js +104 -0
- package/libEs5/core/injectHandleError.js +36 -0
- package/libEs5/core/injectShouldTransferCookie.js +28 -0
- package/libEs5/core/network/getRequestRetryDelay.js +73 -0
- package/libEs5/core/network/injectSendNetworkRequest.js +102 -0
- package/libEs5/core/network/isRequestRetryable.js +27 -0
- package/libEs5/core/network/requestMethods/injectSendBeaconRequest.js +39 -0
- package/libEs5/core/network/requestMethods/injectSendFetchRequest.js +44 -0
- package/libEs5/core/network/requestMethods/injectSendXhrRequest.js +50 -0
- package/libEs5/core/validateCommandOptions.js +34 -0
- package/libEs5/index.js +59 -0
- package/libEs5/utils/areThirdPartyCookiesSupportedByDefault.js +24 -0
- package/libEs5/utils/assign.js +16 -0
- package/libEs5/utils/assignConcatArrayValues.js +48 -0
- package/libEs5/utils/assignIf.js +21 -0
- package/libEs5/utils/clone.js +22 -0
- package/libEs5/utils/cookieJar.js +21 -0
- package/libEs5/utils/crc32.js +36 -0
- package/libEs5/utils/createCallbackAggregator.js +38 -0
- package/libEs5/utils/createLoggingCookieJar.js +33 -0
- package/libEs5/utils/createMerger.js +33 -0
- package/libEs5/utils/createSubscription.js +90 -0
- package/libEs5/utils/createTaskQueue.js +50 -0
- package/libEs5/utils/deduplicateArray.js +31 -0
- package/libEs5/utils/deepAssign.js +48 -0
- package/libEs5/utils/defer.js +26 -0
- package/libEs5/utils/dom/appendNode.js +17 -0
- package/libEs5/utils/dom/awaitSelector.js +105 -0
- package/libEs5/utils/dom/createNode.js +47 -0
- package/libEs5/utils/dom/index.js +58 -0
- package/libEs5/utils/dom/isShadowSelector.js +18 -0
- package/libEs5/utils/dom/matchesSelector.js +28 -0
- package/libEs5/utils/dom/querySelectorAll.js +32 -0
- package/libEs5/utils/dom/removeNode.js +21 -0
- package/libEs5/utils/dom/selectNodes.js +30 -0
- package/libEs5/utils/dom/selectNodesWithShadow.js +66 -0
- package/libEs5/utils/endsWith.js +23 -0
- package/libEs5/utils/filterObject.js +55 -0
- package/libEs5/utils/find.js +30 -0
- package/libEs5/utils/fireImage.js +38 -0
- package/libEs5/utils/flatMap.js +17 -0
- package/libEs5/utils/flattenArray.js +36 -0
- package/libEs5/utils/flattenObject.js +42 -0
- package/libEs5/utils/getApexDomain.js +45 -0
- package/libEs5/utils/getBrowser.js +35 -0
- package/libEs5/utils/getLastArrayItems.js +23 -0
- package/libEs5/utils/getNamespacedCookieName.js +19 -0
- package/libEs5/utils/groupBy.js +31 -0
- package/libEs5/utils/includes.js +23 -0
- package/libEs5/utils/index.js +408 -0
- package/libEs5/utils/injectDoesIdentityCookieExist.js +27 -0
- package/libEs5/utils/injectFireReferrerHideableImage.js +75 -0
- package/libEs5/utils/injectStorage.js +74 -0
- package/libEs5/utils/intersection.js +26 -0
- package/libEs5/utils/isBlankString.js +23 -0
- package/libEs5/utils/isBoolean.js +22 -0
- package/libEs5/utils/isEmptyObject.js +23 -0
- package/libEs5/utils/isFunction.js +22 -0
- package/libEs5/utils/isInteger.js +24 -0
- package/libEs5/utils/isNamespacedCookieName.js +26 -0
- package/libEs5/utils/isNil.js +22 -0
- package/libEs5/utils/isNonEmptyArray.js +22 -0
- package/libEs5/utils/isNonEmptyString.js +23 -0
- package/libEs5/utils/isNumber.js +23 -0
- package/libEs5/utils/isObject.js +23 -0
- package/libEs5/utils/isString.js +22 -0
- package/libEs5/utils/isUnique.js +30 -0
- package/libEs5/utils/isValidRegExp.js +26 -0
- package/libEs5/utils/memoize.js +36 -0
- package/libEs5/utils/noop.js +18 -0
- package/libEs5/utils/padStart.js +27 -0
- package/libEs5/utils/parseUrl.js +72 -0
- package/libEs5/utils/prepareConfigOverridesForEdge.js +52 -0
- package/libEs5/utils/querystring.js +16 -0
- package/libEs5/utils/request/createAddIdentity.js +22 -0
- package/libEs5/utils/request/createDataCollectionRequest.js +68 -0
- package/libEs5/utils/request/createDataCollectionRequestPayload.js +35 -0
- package/libEs5/utils/request/createGetAssuranceValidationTokenParams.js +44 -0
- package/libEs5/utils/request/createHasIdentity.js +19 -0
- package/libEs5/utils/request/createRequest.js +62 -0
- package/libEs5/utils/request/createRequestParams.js +44 -0
- package/libEs5/utils/request/createRequestPayload.js +36 -0
- package/libEs5/utils/request/index.js +58 -0
- package/libEs5/utils/sanitizeOrgIdForCookieName.js +17 -0
- package/libEs5/utils/stackError.js +34 -0
- package/libEs5/utils/startsWith.js +23 -0
- package/libEs5/utils/stringToBoolean.js +18 -0
- package/libEs5/utils/toArray.js +23 -0
- package/libEs5/utils/toError.js +23 -0
- package/libEs5/utils/toISOStringLocal.js +39 -0
- package/libEs5/utils/toInteger.js +31 -0
- package/libEs5/utils/updateErrorMessage.js +24 -0
- package/libEs5/utils/uuid.js +16 -0
- package/libEs5/utils/validateConfigOverride.js +16 -0
- package/libEs5/utils/validateIdentityMap.js +25 -0
- package/libEs5/utils/validation/booleanValidator.js +20 -0
- package/libEs5/utils/validation/callbackValidator.js +20 -0
- package/libEs5/utils/validation/createAnyOfValidator.js +32 -0
- package/libEs5/utils/validation/createArrayOfValidator.js +34 -0
- package/libEs5/utils/validation/createDefaultValidator.js +22 -0
- package/libEs5/utils/validation/createDeprecatedValidator.js +44 -0
- package/libEs5/utils/validation/createLiteralValidator.js +21 -0
- package/libEs5/utils/validation/createMapOfValuesValidator.js +40 -0
- package/libEs5/utils/validation/createMaximumValidator.js +21 -0
- package/libEs5/utils/validation/createMinimumValidator.js +21 -0
- package/libEs5/utils/validation/createNoUnknownFieldsValidator.js +29 -0
- package/libEs5/utils/validation/createNonEmptyValidator.js +27 -0
- package/libEs5/utils/validation/createObjectOfValidator.js +48 -0
- package/libEs5/utils/validation/createUniqueItemsValidator.js +21 -0
- package/libEs5/utils/validation/createUniqueValidator.js +23 -0
- package/libEs5/utils/validation/domainValidator.js +21 -0
- package/libEs5/utils/validation/index.js +239 -0
- package/libEs5/utils/validation/integerValidator.js +20 -0
- package/libEs5/utils/validation/matchesRegexpValidator.js +21 -0
- package/libEs5/utils/validation/numberValidator.js +20 -0
- package/libEs5/utils/validation/regexpValidator.js +20 -0
- package/libEs5/utils/validation/requiredValidator.js +20 -0
- package/libEs5/utils/validation/stringValidator.js +20 -0
- package/libEs5/utils/validation/utils.js +137 -0
- package/libEs5/utils/values.js +25 -0
- package/libEs6/baseCode/index.js +61 -0
- package/libEs6/components/ActivityCollector/attachClickActivityCollector.js +52 -0
- package/libEs6/components/ActivityCollector/configValidators.js +19 -0
- package/libEs6/components/ActivityCollector/createGetLinkDetails.js +70 -0
- package/libEs6/components/ActivityCollector/createLinkClick.js +37 -0
- package/libEs6/components/ActivityCollector/getLinkName.js +136 -0
- package/libEs6/components/ActivityCollector/getLinkRegion.js +58 -0
- package/libEs6/components/ActivityCollector/index.js +80 -0
- package/libEs6/components/ActivityCollector/utils.js +104 -0
- package/libEs6/components/Audiences/index.js +47 -0
- package/libEs6/components/Audiences/injectProcessDestinations.js +60 -0
- package/libEs6/components/Audiences/injectProcessResponse.js +38 -0
- package/libEs6/components/Context/createComponent.js +34 -0
- package/libEs6/components/Context/implementationDetails.js +24 -0
- package/libEs6/components/Context/index.js +52 -0
- package/libEs6/components/Context/injectDevice.js +70 -0
- package/libEs6/components/Context/injectEnvironment.js +42 -0
- package/libEs6/components/Context/injectHighEntropyUserAgentHints.js +45 -0
- package/libEs6/components/Context/injectPlaceContext.js +29 -0
- package/libEs6/components/Context/injectTimestamp.js +21 -0
- package/libEs6/components/Context/injectWeb.js +28 -0
- package/libEs6/components/DataCollector/index.js +106 -0
- package/libEs6/components/DataCollector/validateApplyResponse.js +33 -0
- package/libEs6/components/DataCollector/validateUserEventOptions.js +49 -0
- package/libEs6/components/DecisioningEngine/consequenceAdapters/inAppMessageConsequenceAdapter.js +30 -0
- package/libEs6/components/DecisioningEngine/consequenceAdapters/schemaTypeConsequenceAdapter.js +24 -0
- package/libEs6/components/DecisioningEngine/constants.js +25 -0
- package/libEs6/components/DecisioningEngine/createApplyResponse.js +31 -0
- package/libEs6/components/DecisioningEngine/createConsequenceAdapter.js +29 -0
- package/libEs6/components/DecisioningEngine/createContextProvider.js +95 -0
- package/libEs6/components/DecisioningEngine/createDecisionHistory.js +25 -0
- package/libEs6/components/DecisioningEngine/createDecisionProvider.js +41 -0
- package/libEs6/components/DecisioningEngine/createEvaluableRulesetPayload.js +79 -0
- package/libEs6/components/DecisioningEngine/createEvaluateRulesetsCommand.js +45 -0
- package/libEs6/components/DecisioningEngine/createEventRegistry.js +120 -0
- package/libEs6/components/DecisioningEngine/createOnResponseHandler.js +45 -0
- package/libEs6/components/DecisioningEngine/createSubscribeRulesetItems.js +79 -0
- package/libEs6/components/DecisioningEngine/index.js +124 -0
- package/libEs6/components/DecisioningEngine/utils.js +83 -0
- package/libEs6/components/EventMerge/createComponent.js +23 -0
- package/libEs6/components/EventMerge/createEventMergeId.js +18 -0
- package/libEs6/components/EventMerge/index.js +21 -0
- package/libEs6/components/Identity/addEcidQueryToPayload.js +20 -0
- package/libEs6/components/Identity/addEcidToPayload.js +18 -0
- package/libEs6/components/Identity/appendIdentityToUrl/appendIdentityToUrlOptionsValidator.js +23 -0
- package/libEs6/components/Identity/appendIdentityToUrl/injectAppendIdentityToUrl.js +31 -0
- package/libEs6/components/Identity/configValidators.js +18 -0
- package/libEs6/components/Identity/constants/authState.js +15 -0
- package/libEs6/components/Identity/constants/defaultIdSyncTtlMinutes.js +13 -0
- package/libEs6/components/Identity/createComponent.js +97 -0
- package/libEs6/components/Identity/createLegacyIdentity.js +69 -0
- package/libEs6/components/Identity/getEcidFromResponse.js +19 -0
- package/libEs6/components/Identity/getIdentity/createGetIdentity.js +34 -0
- package/libEs6/components/Identity/getIdentity/createIdentityRequest.js +28 -0
- package/libEs6/components/Identity/getIdentity/createIdentityRequestPayload.js +27 -0
- package/libEs6/components/Identity/getIdentity/getIdentityOptionsValidator.js +25 -0
- package/libEs6/components/Identity/index.js +125 -0
- package/libEs6/components/Identity/injectAddLegacyEcidToPayload.js +30 -0
- package/libEs6/components/Identity/injectAddQueryStringIdentityToPayload.js +59 -0
- package/libEs6/components/Identity/injectAwaitIdentityCookie.js +52 -0
- package/libEs6/components/Identity/injectEnsureSingleIdentity.js +98 -0
- package/libEs6/components/Identity/injectHandleResponseForIdSyncs.js +19 -0
- package/libEs6/components/Identity/injectProcessIdSyncs.js +34 -0
- package/libEs6/components/Identity/injectSetDomainForInitialIdentityPayload.js +32 -0
- package/libEs6/components/Identity/visitorService/awaitVisitorOptIn.js +33 -0
- package/libEs6/components/Identity/visitorService/getVisitor.js +17 -0
- package/libEs6/components/Identity/visitorService/injectGetEcidFromVisitor.js +48 -0
- package/libEs6/components/LegacyMediaAnalytics/constants/constants.js +141 -0
- package/libEs6/components/LegacyMediaAnalytics/constants/mediaKeysToXdmConverter.js +46 -0
- package/libEs6/components/LegacyMediaAnalytics/createGetInstance.js +239 -0
- package/libEs6/components/LegacyMediaAnalytics/createLegacyMediaComponent.js +85 -0
- package/libEs6/components/LegacyMediaAnalytics/createMediaHelper.js +180 -0
- package/libEs6/components/LegacyMediaAnalytics/index.js +67 -0
- package/libEs6/components/LibraryInfo/index.js +59 -0
- package/libEs6/components/MachineLearning/index.js +23 -0
- package/libEs6/components/MachineLearning/processResponse.js +18 -0
- package/libEs6/components/Personalization/constants/loggerMessage.js +13 -0
- package/libEs6/components/Personalization/constants/scopeType.js +15 -0
- package/libEs6/components/Personalization/constants/surface.js +16 -0
- package/libEs6/components/Personalization/createActionsProvider.js +70 -0
- package/libEs6/components/Personalization/createApplyPropositions.js +103 -0
- package/libEs6/components/Personalization/createClickStorage.js +58 -0
- package/libEs6/components/Personalization/createCollect.js +48 -0
- package/libEs6/components/Personalization/createComponent.js +133 -0
- package/libEs6/components/Personalization/createFetchDataHandler.js +84 -0
- package/libEs6/components/Personalization/createGetPageLocation.js +17 -0
- package/libEs6/components/Personalization/createHandleConsentFlicker.js +26 -0
- package/libEs6/components/Personalization/createNotificationHandler.js +33 -0
- package/libEs6/components/Personalization/createOnClickHandler.js +52 -0
- package/libEs6/components/Personalization/createOnDecisionHandler.js +42 -0
- package/libEs6/components/Personalization/createPersonalizationDetails.js +94 -0
- package/libEs6/components/Personalization/createPreprocessors.js +19 -0
- package/libEs6/components/Personalization/createSetTargetMigration.js +27 -0
- package/libEs6/components/Personalization/createViewCacheManager.js +81 -0
- package/libEs6/components/Personalization/createViewChangeHandler.js +47 -0
- package/libEs6/components/Personalization/dom-actions/action.js +49 -0
- package/libEs6/components/Personalization/dom-actions/addNonceToInlineStyleElements.js +36 -0
- package/libEs6/components/Personalization/dom-actions/appendHtml.js +30 -0
- package/libEs6/components/Personalization/dom-actions/clicks/collectClicks.js +91 -0
- package/libEs6/components/Personalization/dom-actions/createPreprocess.js +18 -0
- package/libEs6/components/Personalization/dom-actions/createRedirect.js +22 -0
- package/libEs6/components/Personalization/dom-actions/dom/createFragment.js +19 -0
- package/libEs6/components/Personalization/dom-actions/dom/getAttribute.js +15 -0
- package/libEs6/components/Personalization/dom-actions/dom/getChildNodes.js +22 -0
- package/libEs6/components/Personalization/dom-actions/dom/getChildren.js +22 -0
- package/libEs6/components/Personalization/dom-actions/dom/getElementById.js +21 -0
- package/libEs6/components/Personalization/dom-actions/dom/getFirstChild.js +15 -0
- package/libEs6/components/Personalization/dom-actions/dom/getNextSibling.js +15 -0
- package/libEs6/components/Personalization/dom-actions/dom/getNonce.js +33 -0
- package/libEs6/components/Personalization/dom-actions/dom/getParent.js +15 -0
- package/libEs6/components/Personalization/dom-actions/dom/helperForEq.js +19 -0
- package/libEs6/components/Personalization/dom-actions/dom/index.js +26 -0
- package/libEs6/components/Personalization/dom-actions/dom/insertAfter.js +23 -0
- package/libEs6/components/Personalization/dom-actions/dom/insertBefore.js +22 -0
- package/libEs6/components/Personalization/dom-actions/dom/matchesSelectorWithEq.js +35 -0
- package/libEs6/components/Personalization/dom-actions/dom/removeAttribute.js +15 -0
- package/libEs6/components/Personalization/dom-actions/dom/selectNodesWithEq.js +102 -0
- package/libEs6/components/Personalization/dom-actions/dom/setAttribute.js +15 -0
- package/libEs6/components/Personalization/dom-actions/dom/setStyle.js +21 -0
- package/libEs6/components/Personalization/dom-actions/images.js +31 -0
- package/libEs6/components/Personalization/dom-actions/index.js +13 -0
- package/libEs6/components/Personalization/dom-actions/initDomActionsModules.js +33 -0
- package/libEs6/components/Personalization/dom-actions/insertHtmlAfter.js +29 -0
- package/libEs6/components/Personalization/dom-actions/insertHtmlBefore.js +29 -0
- package/libEs6/components/Personalization/dom-actions/prependHtml.js +45 -0
- package/libEs6/components/Personalization/dom-actions/rearrangeChildren.js +31 -0
- package/libEs6/components/Personalization/dom-actions/remapCustomCodeOffers.js +34 -0
- package/libEs6/components/Personalization/dom-actions/remapHeadOffers.js +51 -0
- package/libEs6/components/Personalization/dom-actions/replaceHtml.js +18 -0
- package/libEs6/components/Personalization/dom-actions/scripts.js +85 -0
- package/libEs6/components/Personalization/dom-actions/setAttributes.js +18 -0
- package/libEs6/components/Personalization/dom-actions/setHtml.js +24 -0
- package/libEs6/components/Personalization/dom-actions/setStyles.js +22 -0
- package/libEs6/components/Personalization/dom-actions/setText.js +15 -0
- package/libEs6/components/Personalization/dom-actions/swapImage.js +29 -0
- package/libEs6/components/Personalization/event.js +45 -0
- package/libEs6/components/Personalization/flicker/index.js +82 -0
- package/libEs6/components/Personalization/handlers/createProcessDomAction.js +61 -0
- package/libEs6/components/Personalization/handlers/createProcessHtmlContent.js +40 -0
- package/libEs6/components/Personalization/handlers/createProcessInAppMessage.js +77 -0
- package/libEs6/components/Personalization/handlers/createProcessPropositions.js +175 -0
- package/libEs6/components/Personalization/handlers/createProcessRedirect.js +41 -0
- package/libEs6/components/Personalization/handlers/injectCreateProposition.js +110 -0
- package/libEs6/components/Personalization/handlers/processDefaultContent.js +17 -0
- package/libEs6/components/Personalization/in-app-message-actions/actions/displayIframeContent.js +293 -0
- package/libEs6/components/Personalization/in-app-message-actions/initInAppMessageActionsModules.js +17 -0
- package/libEs6/components/Personalization/in-app-message-actions/utils.js +49 -0
- package/libEs6/components/Personalization/index.js +167 -0
- package/libEs6/components/Personalization/utils/addRenderAttemptedToDecisions.js +21 -0
- package/libEs6/components/Personalization/utils/createAsyncArray.js +35 -0
- package/libEs6/components/Personalization/utils/isAuthoringModeEnabled.js +15 -0
- package/libEs6/components/Personalization/utils/surfaceUtils.js +76 -0
- package/libEs6/components/Personalization/validateApplyPropositionsOptions.js +31 -0
- package/libEs6/components/Privacy/computeConsentHash.js +30 -0
- package/libEs6/components/Privacy/createComponent.js +85 -0
- package/libEs6/components/Privacy/createConsentHashStore.js +57 -0
- package/libEs6/components/Privacy/createConsentRequest.js +28 -0
- package/libEs6/components/Privacy/createConsentRequestPayload.js +31 -0
- package/libEs6/components/Privacy/createStoredConsent.js +30 -0
- package/libEs6/components/Privacy/index.js +63 -0
- package/libEs6/components/Privacy/injectSendSetConsentRequest.js +45 -0
- package/libEs6/components/Privacy/parseConsentCookie.js +26 -0
- package/libEs6/components/Privacy/validateSetConsentOptions.js +18 -0
- 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/StreamingMedia/createMediaEventManager.js +122 -0
- package/libEs6/components/StreamingMedia/createMediaRequest.js +28 -0
- package/libEs6/components/StreamingMedia/createMediaResponseHandler.js +58 -0
- package/libEs6/components/StreamingMedia/createMediaSessionCacheManager.js +59 -0
- 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/StreamingMedia/validateMediaEventOptions.js +33 -0
- package/libEs6/components/StreamingMedia/validateMediaSessionOptions.js +34 -0
- package/libEs6/constants/apiVersion.js +12 -0
- package/libEs6/constants/browser.js +19 -0
- package/libEs6/constants/consentPurpose.js +13 -0
- package/libEs6/constants/consentStatus.js +15 -0
- package/libEs6/constants/contentType.js +13 -0
- package/libEs6/constants/cookieNameKey.js +15 -0
- package/libEs6/constants/cookieNamePrefix.js +14 -0
- package/libEs6/constants/coreCommands.js +14 -0
- package/libEs6/constants/debugQueryParam.js +13 -0
- package/libEs6/constants/decisionProvider.js +12 -0
- package/libEs6/constants/domain.js +14 -0
- package/libEs6/constants/ecidNamespace.js +13 -0
- package/libEs6/constants/edgeBasePath.js +12 -0
- package/libEs6/constants/elementAttribute.js +13 -0
- package/libEs6/constants/eventType.js +17 -0
- package/libEs6/constants/handle.js +12 -0
- package/libEs6/constants/highEntropyUserAgentClientHints.js +13 -0
- package/libEs6/constants/httpHeaderNames.js +14 -0
- package/libEs6/constants/httpStatusCode.js +17 -0
- package/libEs6/constants/identityMapAuthenticatedState.js +14 -0
- package/libEs6/constants/legacyCookies.js +15 -0
- package/libEs6/constants/libraryName.js +13 -0
- package/libEs6/constants/libraryVersion.js +16 -0
- package/libEs6/constants/namespace.js +13 -0
- package/libEs6/constants/pageWideScope.js +13 -0
- package/libEs6/constants/propositionEventType.js +33 -0
- package/libEs6/constants/queryStringIdentityParam.js +13 -0
- package/libEs6/constants/schema.js +22 -0
- package/libEs6/constants/shadowSeparator.js +13 -0
- package/libEs6/constants/tagName.js +19 -0
- package/libEs6/core/buildAndValidateConfig.js +94 -0
- package/libEs6/core/componentCreators.js +47 -0
- package/libEs6/core/config/createConfig.js +17 -0
- package/libEs6/core/config/createCoreConfigs.js +27 -0
- package/libEs6/core/consent/createConsent.js +60 -0
- package/libEs6/core/consent/createConsentStateMachine.js +125 -0
- package/libEs6/core/createComponentRegistry.js +83 -0
- package/libEs6/core/createCookieTransfer.js +78 -0
- package/libEs6/core/createEvent.js +161 -0
- package/libEs6/core/createEventManager.js +135 -0
- package/libEs6/core/createInstanceFunction.js +25 -0
- package/libEs6/core/createLifecycle.js +65 -0
- package/libEs6/core/createLogController.js +68 -0
- package/libEs6/core/createLogger.js +99 -0
- package/libEs6/core/edgeNetwork/handleRequestFailure.js +24 -0
- package/libEs6/core/edgeNetwork/injectApplyResponse.js +58 -0
- package/libEs6/core/edgeNetwork/injectExtractEdgeInfo.js +39 -0
- package/libEs6/core/edgeNetwork/injectGetLocationHint.js +32 -0
- package/libEs6/core/edgeNetwork/injectProcessWarningsAndErrors.js +42 -0
- package/libEs6/core/edgeNetwork/injectSendEdgeNetworkRequest.js +100 -0
- package/libEs6/core/edgeNetwork/mergeLifecycleResponses.js +21 -0
- package/libEs6/core/index.js +236 -0
- package/libEs6/core/initializeComponents.js +40 -0
- package/libEs6/core/injectCreateResponse.js +70 -0
- package/libEs6/core/injectExecuteCommand.js +100 -0
- package/libEs6/core/injectHandleError.js +33 -0
- package/libEs6/core/injectShouldTransferCookie.js +25 -0
- package/libEs6/core/network/getRequestRetryDelay.js +72 -0
- package/libEs6/core/network/injectSendNetworkRequest.js +96 -0
- package/libEs6/core/network/isRequestRetryable.js +25 -0
- package/libEs6/core/network/requestMethods/injectSendBeaconRequest.js +38 -0
- package/libEs6/core/network/requestMethods/injectSendFetchRequest.js +41 -0
- package/libEs6/core/network/requestMethods/injectSendXhrRequest.js +49 -0
- package/libEs6/core/validateCommandOptions.js +33 -0
- package/libEs6/index.js +55 -0
- package/libEs6/utils/areThirdPartyCookiesSupportedByDefault.js +20 -0
- package/libEs6/utils/assign.js +14 -0
- package/libEs6/utils/assignConcatArrayValues.js +36 -0
- package/libEs6/utils/assignIf.js +19 -0
- package/libEs6/utils/clone.js +18 -0
- package/libEs6/utils/cookieJar.js +19 -0
- package/libEs6/utils/crc32.js +33 -0
- package/libEs6/utils/createCallbackAggregator.js +31 -0
- package/libEs6/utils/createLoggingCookieJar.js +28 -0
- package/libEs6/utils/createMerger.js +30 -0
- package/libEs6/utils/createSubscription.js +70 -0
- package/libEs6/utils/createTaskQueue.js +48 -0
- package/libEs6/utils/deduplicateArray.js +23 -0
- package/libEs6/utils/deepAssign.js +40 -0
- package/libEs6/utils/defer.js +24 -0
- package/libEs6/utils/dom/appendNode.js +15 -0
- package/libEs6/utils/dom/awaitSelector.js +98 -0
- package/libEs6/utils/dom/createNode.js +38 -0
- package/libEs6/utils/dom/index.js +20 -0
- package/libEs6/utils/dom/isShadowSelector.js +14 -0
- package/libEs6/utils/dom/matchesSelector.js +26 -0
- package/libEs6/utils/dom/querySelectorAll.js +29 -0
- package/libEs6/utils/dom/removeNode.js +19 -0
- package/libEs6/utils/dom/selectNodes.js +28 -0
- package/libEs6/utils/dom/selectNodesWithShadow.js +63 -0
- package/libEs6/utils/endsWith.js +19 -0
- package/libEs6/utils/filterObject.js +55 -0
- package/libEs6/utils/find.js +28 -0
- package/libEs6/utils/fireImage.js +37 -0
- package/libEs6/utils/flatMap.js +14 -0
- package/libEs6/utils/flattenArray.js +26 -0
- package/libEs6/utils/flattenObject.js +28 -0
- package/libEs6/utils/getApexDomain.js +42 -0
- package/libEs6/utils/getBrowser.js +65 -0
- package/libEs6/utils/getLastArrayItems.js +19 -0
- package/libEs6/utils/getNamespacedCookieName.js +15 -0
- package/libEs6/utils/groupBy.js +29 -0
- package/libEs6/utils/includes.js +21 -0
- package/libEs6/utils/index.js +71 -0
- package/libEs6/utils/injectDoesIdentityCookieExist.js +24 -0
- package/libEs6/utils/injectFireReferrerHideableImage.js +65 -0
- package/libEs6/utils/injectStorage.js +69 -0
- package/libEs6/utils/intersection.js +21 -0
- package/libEs6/utils/isBlankString.js +20 -0
- package/libEs6/utils/isBoolean.js +18 -0
- package/libEs6/utils/isEmptyObject.js +20 -0
- package/libEs6/utils/isFunction.js +18 -0
- package/libEs6/utils/isInteger.js +23 -0
- package/libEs6/utils/isNamespacedCookieName.js +23 -0
- package/libEs6/utils/isNil.js +18 -0
- package/libEs6/utils/isNonEmptyArray.js +18 -0
- package/libEs6/utils/isNonEmptyString.js +20 -0
- package/libEs6/utils/isNumber.js +19 -0
- package/libEs6/utils/isObject.js +20 -0
- package/libEs6/utils/isString.js +18 -0
- package/libEs6/utils/isUnique.js +27 -0
- package/libEs6/utils/isValidRegExp.js +24 -0
- package/libEs6/utils/memoize.js +34 -0
- package/libEs6/utils/noop.js +16 -0
- package/libEs6/utils/padStart.js +25 -0
- package/libEs6/utils/parseUrl.js +62 -0
- package/libEs6/utils/prepareConfigOverridesForEdge.js +50 -0
- package/libEs6/utils/querystring.js +14 -0
- package/libEs6/utils/request/createAddIdentity.js +19 -0
- package/libEs6/utils/request/createDataCollectionRequest.js +69 -0
- package/libEs6/utils/request/createDataCollectionRequestPayload.js +30 -0
- package/libEs6/utils/request/createGetAssuranceValidationTokenParams.js +42 -0
- package/libEs6/utils/request/createHasIdentity.js +15 -0
- package/libEs6/utils/request/createRequest.js +63 -0
- package/libEs6/utils/request/createRequestParams.js +40 -0
- package/libEs6/utils/request/createRequestPayload.js +35 -0
- package/libEs6/utils/request/index.js +20 -0
- package/libEs6/utils/sanitizeOrgIdForCookieName.js +13 -0
- package/libEs6/utils/stackError.js +34 -0
- package/libEs6/utils/startsWith.js +19 -0
- package/libEs6/utils/stringToBoolean.js +15 -0
- package/libEs6/utils/toArray.js +21 -0
- package/libEs6/utils/toError.js +21 -0
- package/libEs6/utils/toISOStringLocal.js +37 -0
- package/libEs6/utils/toInteger.js +30 -0
- package/libEs6/utils/updateErrorMessage.js +23 -0
- package/libEs6/utils/uuid.js +14 -0
- package/libEs6/utils/validateConfigOverride.js +14 -0
- package/libEs6/utils/validateIdentityMap.js +23 -0
- package/libEs6/utils/validation/booleanValidator.js +18 -0
- package/libEs6/utils/validation/callbackValidator.js +17 -0
- package/libEs6/utils/validation/createAnyOfValidator.js +26 -0
- package/libEs6/utils/validation/createArrayOfValidator.js +28 -0
- package/libEs6/utils/validation/createDefaultValidator.js +18 -0
- package/libEs6/utils/validation/createDeprecatedValidator.js +37 -0
- package/libEs6/utils/validation/createLiteralValidator.js +16 -0
- package/libEs6/utils/validation/createMapOfValuesValidator.js +35 -0
- package/libEs6/utils/validation/createMaximumValidator.js +16 -0
- package/libEs6/utils/validation/createMinimumValidator.js +16 -0
- package/libEs6/utils/validation/createNoUnknownFieldsValidator.js +25 -0
- package/libEs6/utils/validation/createNonEmptyValidator.js +23 -0
- package/libEs6/utils/validation/createObjectOfValidator.js +43 -0
- package/libEs6/utils/validation/createUniqueItemsValidator.js +18 -0
- package/libEs6/utils/validation/createUniqueValidator.js +21 -0
- package/libEs6/utils/validation/domainValidator.js +17 -0
- package/libEs6/utils/validation/index.js +232 -0
- package/libEs6/utils/validation/integerValidator.js +18 -0
- package/libEs6/utils/validation/matchesRegexpValidator.js +17 -0
- package/libEs6/utils/validation/numberValidator.js +18 -0
- package/libEs6/utils/validation/regexpValidator.js +18 -0
- package/libEs6/utils/validation/requiredValidator.js +18 -0
- package/libEs6/utils/validation/stringValidator.js +17 -0
- package/libEs6/utils/validation/utils.js +127 -0
- package/libEs6/utils/values.js +21 -0
- package/package.json +1 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2022 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export default (({
|
|
14
|
+
window,
|
|
15
|
+
getLinkName,
|
|
16
|
+
getLinkRegion,
|
|
17
|
+
getAbsoluteUrlFromAnchorElement,
|
|
18
|
+
findSupportedAnchorElement,
|
|
19
|
+
determineLinkType
|
|
20
|
+
}) => {
|
|
21
|
+
return ({
|
|
22
|
+
targetElement,
|
|
23
|
+
config,
|
|
24
|
+
logger
|
|
25
|
+
}) => {
|
|
26
|
+
const anchorElement = findSupportedAnchorElement(targetElement);
|
|
27
|
+
if (!anchorElement) {
|
|
28
|
+
logger.info("This link click event is not triggered because the HTML element is not an anchor.");
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
const linkUrl = getAbsoluteUrlFromAnchorElement(window, anchorElement);
|
|
32
|
+
if (!linkUrl) {
|
|
33
|
+
logger.info("This link click event is not triggered because the HTML element doesn't have an URL.");
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
const linkType = determineLinkType(window, config, linkUrl, anchorElement);
|
|
37
|
+
const linkRegion = getLinkRegion(anchorElement);
|
|
38
|
+
const linkName = getLinkName(anchorElement);
|
|
39
|
+
const {
|
|
40
|
+
onBeforeLinkClickSend
|
|
41
|
+
} = config;
|
|
42
|
+
const options = {
|
|
43
|
+
xdm: {
|
|
44
|
+
eventType: "web.webinteraction.linkClicks",
|
|
45
|
+
web: {
|
|
46
|
+
webInteraction: {
|
|
47
|
+
name: linkName,
|
|
48
|
+
region: linkRegion,
|
|
49
|
+
type: linkType,
|
|
50
|
+
URL: linkUrl,
|
|
51
|
+
linkClicks: {
|
|
52
|
+
value: 1
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
data: {},
|
|
58
|
+
clickedElement: targetElement
|
|
59
|
+
};
|
|
60
|
+
if (!onBeforeLinkClickSend) {
|
|
61
|
+
return options;
|
|
62
|
+
}
|
|
63
|
+
const shouldEventBeTracked = onBeforeLinkClickSend(options);
|
|
64
|
+
if (shouldEventBeTracked !== false) {
|
|
65
|
+
return options;
|
|
66
|
+
}
|
|
67
|
+
logger.info("This link click event is not triggered because it was canceled in onBeforeLinkClickSend.");
|
|
68
|
+
return undefined;
|
|
69
|
+
};
|
|
70
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2022 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
export default (({
|
|
13
|
+
getLinkDetails,
|
|
14
|
+
config,
|
|
15
|
+
logger
|
|
16
|
+
}) => {
|
|
17
|
+
const {
|
|
18
|
+
clickCollectionEnabled
|
|
19
|
+
} = config;
|
|
20
|
+
if (!clickCollectionEnabled) {
|
|
21
|
+
return () => undefined;
|
|
22
|
+
}
|
|
23
|
+
return ({
|
|
24
|
+
targetElement,
|
|
25
|
+
event
|
|
26
|
+
}) => {
|
|
27
|
+
const linkDetails = getLinkDetails({
|
|
28
|
+
targetElement,
|
|
29
|
+
config,
|
|
30
|
+
logger
|
|
31
|
+
});
|
|
32
|
+
if (linkDetails) {
|
|
33
|
+
event.mergeXdm(linkDetails.xdm);
|
|
34
|
+
event.setUserData(linkDetails.data);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
});
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2022 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { truncateWhiteSpace } from "./utils.js";
|
|
14
|
+
const unsupportedNodeNames = /^(SCRIPT|STYLE|LINK|CANVAS|NOSCRIPT|#COMMENT)$/i;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Determines if a node qualifies as a supported link text node.
|
|
18
|
+
* @param {*} node Node to determine support for.
|
|
19
|
+
* @returns {boolean}
|
|
20
|
+
*/
|
|
21
|
+
const isSupportedTextNode = node => {
|
|
22
|
+
if (node && node.nodeName) {
|
|
23
|
+
if (node.nodeName.match(unsupportedNodeNames)) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return true;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Orders and returns specified node and its child nodes in arrays of supported
|
|
32
|
+
* and unsupported nodes.
|
|
33
|
+
* @param {*} node The node to extract supported and unsupported nodes from.
|
|
34
|
+
* @returns {{supportedNodes: Array, includesUnsupportedNodes: boolean}} Node support object.
|
|
35
|
+
*/
|
|
36
|
+
const extractSupportedNodes = node => {
|
|
37
|
+
let supportedNodes = [];
|
|
38
|
+
let includesUnsupportedNodes = false;
|
|
39
|
+
if (isSupportedTextNode(node)) {
|
|
40
|
+
supportedNodes.push(node);
|
|
41
|
+
if (node.childNodes) {
|
|
42
|
+
const childNodes = Array.prototype.slice.call(node.childNodes);
|
|
43
|
+
childNodes.forEach(childNode => {
|
|
44
|
+
const nodes = extractSupportedNodes(childNode);
|
|
45
|
+
supportedNodes = supportedNodes.concat(nodes.supportedNodes);
|
|
46
|
+
includesUnsupportedNodes = includesUnsupportedNodes || nodes.includesUnsupportedNodes;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
} else {
|
|
50
|
+
includesUnsupportedNodes = true;
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
supportedNodes,
|
|
54
|
+
includesUnsupportedNodes
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Returns the value of a node attribute.
|
|
60
|
+
* @param {*} node The node holding the attribute.
|
|
61
|
+
* @param {string} attributeName The name of the attribute.
|
|
62
|
+
* @param {string} nodeName Optional node name constraint.
|
|
63
|
+
* @returns {string} Attribute value or undefined.
|
|
64
|
+
*/
|
|
65
|
+
const getNodeAttributeValue = (node, attributeName, nodeName) => {
|
|
66
|
+
let attributeValue;
|
|
67
|
+
if (!nodeName || nodeName === node.nodeName.toUpperCase()) {
|
|
68
|
+
attributeValue = node.getAttribute(attributeName);
|
|
69
|
+
}
|
|
70
|
+
return attributeValue;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Extracts the children supported nodes attributes map
|
|
75
|
+
* @param {*} nodes The nodes array holding the children nodes.
|
|
76
|
+
* The returned map contains the supported not empty children attributes values.
|
|
77
|
+
* */
|
|
78
|
+
const getChildrenAttributes = nodes => {
|
|
79
|
+
const attributes = {
|
|
80
|
+
texts: []
|
|
81
|
+
};
|
|
82
|
+
nodes.supportedNodes.forEach(supportedNode => {
|
|
83
|
+
if (supportedNode.getAttribute) {
|
|
84
|
+
if (!attributes.alt) {
|
|
85
|
+
attributes.alt = truncateWhiteSpace(supportedNode.getAttribute("alt"));
|
|
86
|
+
}
|
|
87
|
+
if (!attributes.title) {
|
|
88
|
+
attributes.title = truncateWhiteSpace(supportedNode.getAttribute("title"));
|
|
89
|
+
}
|
|
90
|
+
if (!attributes.inputValue) {
|
|
91
|
+
attributes.inputValue = truncateWhiteSpace(getNodeAttributeValue(supportedNode, "value", "INPUT"));
|
|
92
|
+
}
|
|
93
|
+
if (!attributes.imgSrc) {
|
|
94
|
+
attributes.imgSrc = truncateWhiteSpace(getNodeAttributeValue(supportedNode, "src", "IMG"));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (supportedNode.nodeValue) {
|
|
98
|
+
attributes.texts.push(supportedNode.nodeValue);
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
return attributes;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Extracts a link-name from a given node.
|
|
106
|
+
*
|
|
107
|
+
* The returned link-name is set to one of the following (in order of priority):
|
|
108
|
+
*
|
|
109
|
+
* 1. Clicked node innerText
|
|
110
|
+
* 2. Clicked node textContent
|
|
111
|
+
* 3. Clicked node and its child nodes nodeValue appended together.
|
|
112
|
+
* 4. Clicked node alt attribute or node descendant alt attribute.
|
|
113
|
+
* Whichever is found first.
|
|
114
|
+
* 5. Clicked node text attribute or node descendant text attribute.
|
|
115
|
+
* Whichever is found first.
|
|
116
|
+
* 6. Clicked node INPUT descendant value attribute.
|
|
117
|
+
* Whichever is found first.
|
|
118
|
+
* 7. Clicked node IMG descendant src attribute.
|
|
119
|
+
* Whichever is found first.
|
|
120
|
+
*
|
|
121
|
+
* @param {*} node The node to find link text for.
|
|
122
|
+
* @returns {string} link-name or an empty string if not link-name is found.
|
|
123
|
+
*/
|
|
124
|
+
export default (node => {
|
|
125
|
+
let nodeText = truncateWhiteSpace(node.innerText || node.textContent);
|
|
126
|
+
const nodes = extractSupportedNodes(node);
|
|
127
|
+
// if contains unsupported nodes we want children node attributes
|
|
128
|
+
if (!nodeText || nodes.includesUnsupportedNodes) {
|
|
129
|
+
const attributesMap = getChildrenAttributes(nodes);
|
|
130
|
+
nodeText = truncateWhiteSpace(attributesMap.texts.join(""));
|
|
131
|
+
if (!nodeText) {
|
|
132
|
+
nodeText = attributesMap.alt || attributesMap.title || attributesMap.inputValue || attributesMap.imgSrc;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return nodeText || "";
|
|
136
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2022 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { truncateWhiteSpace } from "./utils.js";
|
|
14
|
+
import { isNonEmptyString } from "../../utils/index.js";
|
|
15
|
+
const semanticElements = /^(HEADER|MAIN|FOOTER|NAV)$/i;
|
|
16
|
+
const getAriaRegionLabel = node => {
|
|
17
|
+
let regionLabel;
|
|
18
|
+
if (node.role === "region" && isNonEmptyString(node["aria-label"])) {
|
|
19
|
+
regionLabel = node["aria-label"];
|
|
20
|
+
}
|
|
21
|
+
return regionLabel;
|
|
22
|
+
};
|
|
23
|
+
const getSectionNodeName = node => {
|
|
24
|
+
let nodeName;
|
|
25
|
+
if (node && node.nodeName) {
|
|
26
|
+
if (node.nodeName.match(semanticElements)) {
|
|
27
|
+
nodeName = node.nodeName;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return nodeName;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Extracts a node link-region.
|
|
35
|
+
*
|
|
36
|
+
* The link-region is determined by traversing up the DOM
|
|
37
|
+
* looking for a region that is determined in order of priority:
|
|
38
|
+
*
|
|
39
|
+
* 1. element.id
|
|
40
|
+
* 2. Aria region label
|
|
41
|
+
* 3. Semantic element name
|
|
42
|
+
* 4. BODY (if no other link-region is found).
|
|
43
|
+
*
|
|
44
|
+
* @param {*} node The node to find link region for.
|
|
45
|
+
* @returns {string} link-region.
|
|
46
|
+
*/
|
|
47
|
+
export default (node => {
|
|
48
|
+
let linkParentNode = node.parentNode;
|
|
49
|
+
let regionName;
|
|
50
|
+
while (linkParentNode) {
|
|
51
|
+
regionName = truncateWhiteSpace(linkParentNode.id || getAriaRegionLabel(linkParentNode) || getSectionNodeName(linkParentNode));
|
|
52
|
+
if (regionName) {
|
|
53
|
+
return regionName;
|
|
54
|
+
}
|
|
55
|
+
linkParentNode = linkParentNode.parentNode;
|
|
56
|
+
}
|
|
57
|
+
return "BODY";
|
|
58
|
+
});
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2019 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import attachClickActivityCollector from "./attachClickActivityCollector.js";
|
|
14
|
+
import configValidators from "./configValidators.js";
|
|
15
|
+
import createLinkClick from "./createLinkClick.js";
|
|
16
|
+
import createGetLinkDetails from "./createGetLinkDetails.js";
|
|
17
|
+
import getLinkName from "./getLinkName.js";
|
|
18
|
+
import getLinkRegion from "./getLinkRegion.js";
|
|
19
|
+
import { determineLinkType, findSupportedAnchorElement, getAbsoluteUrlFromAnchorElement } from "./utils.js";
|
|
20
|
+
const getLinkDetails = createGetLinkDetails({
|
|
21
|
+
window,
|
|
22
|
+
getLinkName,
|
|
23
|
+
getLinkRegion,
|
|
24
|
+
getAbsoluteUrlFromAnchorElement,
|
|
25
|
+
findSupportedAnchorElement,
|
|
26
|
+
determineLinkType
|
|
27
|
+
});
|
|
28
|
+
const createActivityCollector = ({
|
|
29
|
+
config,
|
|
30
|
+
eventManager,
|
|
31
|
+
handleError,
|
|
32
|
+
logger
|
|
33
|
+
}) => {
|
|
34
|
+
const linkClick = createLinkClick({
|
|
35
|
+
getLinkDetails,
|
|
36
|
+
config,
|
|
37
|
+
logger
|
|
38
|
+
});
|
|
39
|
+
return {
|
|
40
|
+
lifecycle: {
|
|
41
|
+
onComponentsRegistered(tools) {
|
|
42
|
+
const {
|
|
43
|
+
lifecycle
|
|
44
|
+
} = tools;
|
|
45
|
+
attachClickActivityCollector({
|
|
46
|
+
eventManager,
|
|
47
|
+
lifecycle,
|
|
48
|
+
handleError
|
|
49
|
+
});
|
|
50
|
+
// TODO: createScrollActivityCollector ...
|
|
51
|
+
},
|
|
52
|
+
onClick({
|
|
53
|
+
event,
|
|
54
|
+
clickedElement
|
|
55
|
+
}) {
|
|
56
|
+
linkClick({
|
|
57
|
+
targetElement: clickedElement,
|
|
58
|
+
event
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
createActivityCollector.namespace = "ActivityCollector";
|
|
65
|
+
createActivityCollector.configValidators = configValidators;
|
|
66
|
+
createActivityCollector.buildOnInstanceConfiguredExtraParams = ({
|
|
67
|
+
config,
|
|
68
|
+
logger
|
|
69
|
+
}) => {
|
|
70
|
+
return {
|
|
71
|
+
getLinkDetails: targetElement => {
|
|
72
|
+
return getLinkDetails({
|
|
73
|
+
targetElement,
|
|
74
|
+
config,
|
|
75
|
+
logger
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
export default createActivityCollector;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2019 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const urlStartsWithScheme = url => {
|
|
14
|
+
return url && /^[a-z0-9]+:\/\//i.test(url);
|
|
15
|
+
};
|
|
16
|
+
const getAbsoluteUrlFromAnchorElement = (window, element) => {
|
|
17
|
+
const loc = window.location;
|
|
18
|
+
let url = element.href ? element.href : "";
|
|
19
|
+
let {
|
|
20
|
+
protocol,
|
|
21
|
+
host
|
|
22
|
+
} = element;
|
|
23
|
+
if (!urlStartsWithScheme(url)) {
|
|
24
|
+
if (!protocol) {
|
|
25
|
+
protocol = loc.protocol ? loc.protocol : "";
|
|
26
|
+
}
|
|
27
|
+
protocol = protocol ? `${protocol}//` : "";
|
|
28
|
+
if (!host) {
|
|
29
|
+
host = loc.host ? loc.host : "";
|
|
30
|
+
}
|
|
31
|
+
let path = "";
|
|
32
|
+
if (url.substring(0, 1) !== "/") {
|
|
33
|
+
let indx = loc.pathname.lastIndexOf("/");
|
|
34
|
+
indx = indx < 0 ? 0 : indx;
|
|
35
|
+
path = loc.pathname.substring(0, indx);
|
|
36
|
+
}
|
|
37
|
+
url = `${protocol}${host}${path}/${url}`;
|
|
38
|
+
}
|
|
39
|
+
return url;
|
|
40
|
+
};
|
|
41
|
+
const isSupportedAnchorElement = element => {
|
|
42
|
+
if (element.href && (element.tagName === "A" || element.tagName === "AREA") && (!element.onclick || !element.protocol || element.protocol.toLowerCase().indexOf("javascript") < 0)) {
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
return false;
|
|
46
|
+
};
|
|
47
|
+
const trimQueryFromUrl = url => {
|
|
48
|
+
const questionMarkIndex = url.indexOf("?");
|
|
49
|
+
const hashIndex = url.indexOf("#");
|
|
50
|
+
if (questionMarkIndex >= 0 && (questionMarkIndex < hashIndex || hashIndex < 0)) {
|
|
51
|
+
return url.substring(0, questionMarkIndex);
|
|
52
|
+
}
|
|
53
|
+
if (hashIndex >= 0) {
|
|
54
|
+
return url.substring(0, hashIndex);
|
|
55
|
+
}
|
|
56
|
+
return url;
|
|
57
|
+
};
|
|
58
|
+
const isDownloadLink = (downloadLinkQualifier, linkUrl, clickedObj) => {
|
|
59
|
+
const re = new RegExp(downloadLinkQualifier);
|
|
60
|
+
const trimmedLinkUrl = trimQueryFromUrl(linkUrl).toLowerCase();
|
|
61
|
+
return clickedObj.download ? true : re.test(trimmedLinkUrl);
|
|
62
|
+
};
|
|
63
|
+
const isExitLink = (window, linkUrl) => {
|
|
64
|
+
const currentHostname = window.location.hostname.toLowerCase();
|
|
65
|
+
const trimmedLinkUrl = trimQueryFromUrl(linkUrl).toLowerCase();
|
|
66
|
+
if (trimmedLinkUrl.indexOf(currentHostname) >= 0) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
return true;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Reduces repeated whitespace within a string. Whitespace surrounding the string
|
|
74
|
+
* is trimmed and any occurrence of whitespace within the string is replaced with
|
|
75
|
+
* a single space.
|
|
76
|
+
* @param {string} str String to be formatted.
|
|
77
|
+
* @returns {string} Formatted string.
|
|
78
|
+
*/
|
|
79
|
+
const truncateWhiteSpace = str => {
|
|
80
|
+
return str && str.replace(/\s+/g, " ").trim();
|
|
81
|
+
};
|
|
82
|
+
const isEmptyString = str => {
|
|
83
|
+
return !str || str.length === 0;
|
|
84
|
+
};
|
|
85
|
+
const determineLinkType = (window, config, linkUrl, clickedObj) => {
|
|
86
|
+
let linkType = "other";
|
|
87
|
+
if (isDownloadLink(config.downloadLinkQualifier, linkUrl, clickedObj)) {
|
|
88
|
+
linkType = "download";
|
|
89
|
+
} else if (isExitLink(window, linkUrl)) {
|
|
90
|
+
linkType = "exit";
|
|
91
|
+
}
|
|
92
|
+
return linkType;
|
|
93
|
+
};
|
|
94
|
+
const findSupportedAnchorElement = targetElement => {
|
|
95
|
+
let node = targetElement;
|
|
96
|
+
while (node) {
|
|
97
|
+
if (isSupportedAnchorElement(node)) {
|
|
98
|
+
return node;
|
|
99
|
+
}
|
|
100
|
+
node = node.parentNode;
|
|
101
|
+
}
|
|
102
|
+
return null;
|
|
103
|
+
};
|
|
104
|
+
export { urlStartsWithScheme, getAbsoluteUrlFromAnchorElement, isSupportedAnchorElement, isDownloadLink, isEmptyString, isExitLink, trimQueryFromUrl, truncateWhiteSpace, findSupportedAnchorElement, determineLinkType };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2019 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { createLoggingCookieJar, cookieJar } from "../../utils/index.js";
|
|
14
|
+
import injectProcessDestinations from "./injectProcessDestinations.js";
|
|
15
|
+
import injectProcessResponse from "./injectProcessResponse.js";
|
|
16
|
+
const createAudiences = ({
|
|
17
|
+
logger,
|
|
18
|
+
fireReferrerHideableImage
|
|
19
|
+
}) => {
|
|
20
|
+
// we override the js-cookie converter to encode the cookie value similar on how it is in DIL (PDCL-10238)
|
|
21
|
+
const cookieJarWithEncoding = cookieJar.withConverter({
|
|
22
|
+
write: value => {
|
|
23
|
+
return encodeURIComponent(value);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
const loggingCookieJar = createLoggingCookieJar({
|
|
27
|
+
logger,
|
|
28
|
+
cookieJar: cookieJarWithEncoding
|
|
29
|
+
});
|
|
30
|
+
const processDestinations = injectProcessDestinations({
|
|
31
|
+
fireReferrerHideableImage,
|
|
32
|
+
logger,
|
|
33
|
+
cookieJar: loggingCookieJar,
|
|
34
|
+
isPageSsl: window.location.protocol === "https:"
|
|
35
|
+
});
|
|
36
|
+
const processResponse = injectProcessResponse({
|
|
37
|
+
processDestinations
|
|
38
|
+
});
|
|
39
|
+
return {
|
|
40
|
+
lifecycle: {
|
|
41
|
+
onResponse: processResponse
|
|
42
|
+
},
|
|
43
|
+
commands: {}
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
createAudiences.namespace = "Audiences";
|
|
47
|
+
export default createAudiences;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2019 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { noop } from "../../utils/index.js";
|
|
14
|
+
const createResultLogMessage = (urlDestination, success) => {
|
|
15
|
+
return `URL destination ${success ? "succeeded" : "failed"}: ${urlDestination.spec.url}`;
|
|
16
|
+
};
|
|
17
|
+
export default (({
|
|
18
|
+
fireReferrerHideableImage,
|
|
19
|
+
logger,
|
|
20
|
+
cookieJar,
|
|
21
|
+
isPageSsl
|
|
22
|
+
}) => {
|
|
23
|
+
const extraCookieOptions = isPageSsl ? {
|
|
24
|
+
sameSite: "none",
|
|
25
|
+
secure: true
|
|
26
|
+
} : {};
|
|
27
|
+
const processCookies = destinations => {
|
|
28
|
+
const cookieDestinations = destinations.filter(dest => dest.type === "cookie");
|
|
29
|
+
cookieDestinations.forEach(dest => {
|
|
30
|
+
const {
|
|
31
|
+
name,
|
|
32
|
+
value,
|
|
33
|
+
domain,
|
|
34
|
+
ttlDays
|
|
35
|
+
} = dest.spec;
|
|
36
|
+
cookieJar.set(name, value || "", {
|
|
37
|
+
domain: domain || "",
|
|
38
|
+
expires: ttlDays || 10,
|
|
39
|
+
// days
|
|
40
|
+
...extraCookieOptions
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
const processUrls = destinations => {
|
|
45
|
+
const urlDestinations = destinations.filter(dest => dest.type === "url");
|
|
46
|
+
return Promise.all(urlDestinations.map(urlDestination => {
|
|
47
|
+
return fireReferrerHideableImage(urlDestination.spec).then(() => {
|
|
48
|
+
logger.info(createResultLogMessage(urlDestination, true));
|
|
49
|
+
}).catch(() => {
|
|
50
|
+
// We intentionally do not throw an error if destinations fail. We
|
|
51
|
+
// consider it a non-critical failure and therefore do not want it to
|
|
52
|
+
// reject the promise handed back to the customer.
|
|
53
|
+
});
|
|
54
|
+
})).then(noop);
|
|
55
|
+
};
|
|
56
|
+
return destinations => {
|
|
57
|
+
processCookies(destinations);
|
|
58
|
+
return processUrls(destinations);
|
|
59
|
+
};
|
|
60
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2021 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export default (({
|
|
14
|
+
processDestinations
|
|
15
|
+
}) => {
|
|
16
|
+
const processPushDestinations = ({
|
|
17
|
+
response
|
|
18
|
+
}) => {
|
|
19
|
+
const destinations = response.getPayloadsByType("activation:push");
|
|
20
|
+
return processDestinations(destinations);
|
|
21
|
+
};
|
|
22
|
+
const retrievePullDestinations = ({
|
|
23
|
+
response
|
|
24
|
+
}) => {
|
|
25
|
+
return {
|
|
26
|
+
destinations: response.getPayloadsByType("activation:pull")
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
return ({
|
|
30
|
+
response
|
|
31
|
+
}) => {
|
|
32
|
+
return processPushDestinations({
|
|
33
|
+
response
|
|
34
|
+
}).then(() => retrievePullDestinations({
|
|
35
|
+
response
|
|
36
|
+
}));
|
|
37
|
+
};
|
|
38
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2019 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { flatMap } from "../../utils/index.js";
|
|
14
|
+
export default ((config, logger, optionalContexts, requiredContexts) => {
|
|
15
|
+
const configuredContexts = config.context;
|
|
16
|
+
const contexts = flatMap(configuredContexts, (context, i) => {
|
|
17
|
+
if (optionalContexts[context]) {
|
|
18
|
+
return [optionalContexts[context]];
|
|
19
|
+
}
|
|
20
|
+
logger.warn(`Invalid context[${i}]: '${context}' is not available.`);
|
|
21
|
+
return [];
|
|
22
|
+
}).concat(requiredContexts);
|
|
23
|
+
return {
|
|
24
|
+
namespace: "Context",
|
|
25
|
+
lifecycle: {
|
|
26
|
+
onBeforeEvent({
|
|
27
|
+
event
|
|
28
|
+
}) {
|
|
29
|
+
const xdm = {};
|
|
30
|
+
return Promise.all(contexts.map(context => Promise.resolve(context(xdm, logger)))).then(() => event.mergeXdm(xdm));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
});
|