@adobe/alloy 2.21.1 → 2.22.0-alpha.1
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/babel.config.cjs +0 -1
- package/libEs5/baseCode/index.js +3 -2
- package/libEs5/components/ActivityCollector/attachClickActivityCollector.js +23 -20
- package/libEs5/components/ActivityCollector/configValidators.js +2 -2
- package/libEs5/components/ActivityCollector/createClickActivityStorage.js +11 -9
- package/libEs5/components/ActivityCollector/createClickedElementProperties.js +39 -32
- package/libEs5/components/ActivityCollector/createGetClickedElementProperties.js +28 -20
- package/libEs5/components/ActivityCollector/createInjectClickedElementProperties.js +24 -21
- package/libEs5/components/ActivityCollector/createRecallAndInjectClickedElementProperties.js +10 -8
- package/libEs5/components/ActivityCollector/createStorePageViewProperties.js +6 -4
- package/libEs5/components/ActivityCollector/getLinkName.js +19 -18
- package/libEs5/components/ActivityCollector/getLinkRegion.js +10 -9
- package/libEs5/components/ActivityCollector/index.js +61 -45
- package/libEs5/components/ActivityCollector/utils/activityMapExtensionEnabled.js +3 -5
- package/libEs5/components/ActivityCollector/utils/createTransientStorage.js +7 -6
- package/libEs5/components/ActivityCollector/utils/determineLinkType.js +4 -3
- package/libEs5/components/ActivityCollector/utils/dom/elementHasClickHandler.js +3 -2
- package/libEs5/components/ActivityCollector/utils/dom/extractDomain.js +5 -4
- package/libEs5/components/ActivityCollector/utils/dom/findClickableElement.js +4 -3
- package/libEs5/components/ActivityCollector/utils/dom/getAbsoluteUrlFromAnchorElement.js +11 -8
- package/libEs5/components/ActivityCollector/utils/dom/isButtonSubmitElement.js +3 -2
- package/libEs5/components/ActivityCollector/utils/dom/isDownloadLink.js +6 -5
- package/libEs5/components/ActivityCollector/utils/dom/isExitLink.js +6 -5
- package/libEs5/components/ActivityCollector/utils/dom/isInputSubmitElement.js +4 -3
- package/libEs5/components/ActivityCollector/utils/dom/isSupportedAnchorElement.js +3 -2
- package/libEs5/components/ActivityCollector/utils/dom/isSupportedTextNode.js +4 -3
- package/libEs5/components/ActivityCollector/utils/hasPageName.js +4 -3
- package/libEs5/components/ActivityCollector/utils/isDifferentDomains.js +5 -4
- package/libEs5/components/ActivityCollector/utils/trimQueryFromUrl.js +5 -4
- package/libEs5/components/ActivityCollector/utils/truncateWhiteSpace.js +3 -2
- package/libEs5/components/ActivityCollector/utils/urlStartsWithScheme.js +3 -2
- package/libEs5/components/Audiences/index.js +13 -12
- package/libEs5/components/Audiences/injectProcessDestinations.js +32 -35
- package/libEs5/components/Audiences/injectProcessResponse.js +19 -16
- package/libEs5/components/Context/createComponent.js +10 -13
- package/libEs5/components/Context/implementationDetails.js +5 -4
- package/libEs5/components/Context/index.js +24 -28
- package/libEs5/components/Context/injectDevice.js +23 -15
- package/libEs5/components/Context/injectEnvironment.js +17 -12
- package/libEs5/components/Context/injectHighEntropyUserAgentHints.js +12 -21
- package/libEs5/components/Context/injectPlaceContext.js +8 -7
- package/libEs5/components/Context/injectTimestamp.js +6 -5
- package/libEs5/components/Context/injectWeb.js +6 -5
- package/libEs5/components/DataCollector/index.js +37 -38
- package/libEs5/components/DataCollector/validateApplyResponse.js +6 -4
- package/libEs5/components/DataCollector/validateUserEventOptions.js +6 -4
- package/libEs5/components/DecisioningEngine/consequenceAdapters/inAppMessageConsequenceAdapter.js +11 -8
- package/libEs5/components/DecisioningEngine/consequenceAdapters/schemaTypeConsequenceAdapter.js +10 -7
- package/libEs5/components/DecisioningEngine/constants.js +3 -3
- package/libEs5/components/DecisioningEngine/createApplyResponse.js +15 -15
- package/libEs5/components/DecisioningEngine/createConsequenceAdapter.js +17 -13
- package/libEs5/components/DecisioningEngine/createContextProvider.js +48 -44
- package/libEs5/components/DecisioningEngine/createDecisionHistory.js +7 -5
- package/libEs5/components/DecisioningEngine/createDecisionProvider.js +16 -21
- package/libEs5/components/DecisioningEngine/createEvaluableRulesetPayload.js +39 -37
- package/libEs5/components/DecisioningEngine/createEvaluateRulesetsCommand.js +21 -19
- package/libEs5/components/DecisioningEngine/createEventRegistry.js +63 -67
- package/libEs5/components/DecisioningEngine/createOnResponseHandler.js +23 -22
- package/libEs5/components/DecisioningEngine/createSubscribeRulesetItems.js +100 -55
- package/libEs5/components/DecisioningEngine/index.js +83 -54
- package/libEs5/components/DecisioningEngine/utils.js +43 -38
- package/libEs5/components/EventMerge/createComponent.js +5 -3
- package/libEs5/components/EventMerge/createEventMergeId.js +3 -2
- package/libEs5/components/EventMerge/index.js +1 -1
- package/libEs5/components/Identity/addEcidQueryToPayload.js +3 -2
- package/libEs5/components/Identity/addEcidToPayload.js +3 -2
- package/libEs5/components/Identity/appendIdentityToUrl/injectAppendIdentityToUrl.js +13 -23
- package/libEs5/components/Identity/configValidators.js +1 -1
- package/libEs5/components/Identity/constants/authState.js +3 -3
- package/libEs5/components/Identity/createComponent.js +39 -33
- package/libEs5/components/Identity/createLegacyIdentity.js +29 -29
- package/libEs5/components/Identity/getEcidFromResponse.js +5 -7
- package/libEs5/components/Identity/getIdentity/createGetIdentity.js +17 -15
- package/libEs5/components/Identity/getIdentity/createIdentityRequest.js +10 -8
- package/libEs5/components/Identity/getIdentity/createIdentityRequestPayload.js +5 -4
- package/libEs5/components/Identity/index.js +61 -62
- package/libEs5/components/Identity/injectAddLegacyEcidToPayload.js +8 -6
- package/libEs5/components/Identity/injectAddQueryStringIdentityToPayload.js +46 -52
- package/libEs5/components/Identity/injectAwaitIdentityCookie.js +14 -11
- package/libEs5/components/Identity/injectEnsureSingleIdentity.js +25 -24
- package/libEs5/components/Identity/injectHandleResponseForIdSyncs.js +6 -4
- package/libEs5/components/Identity/injectProcessIdSyncs.js +20 -22
- package/libEs5/components/Identity/injectSetDomainForInitialIdentityPayload.js +7 -5
- package/libEs5/components/Identity/visitorService/awaitVisitorOptIn.js +8 -6
- package/libEs5/components/Identity/visitorService/getVisitor.js +4 -3
- package/libEs5/components/Identity/visitorService/injectGetEcidFromVisitor.js +15 -13
- package/libEs5/components/LegacyMediaAnalytics/constants/constants.js +9 -9
- package/libEs5/components/LegacyMediaAnalytics/constants/mediaKeysToXdmConverter.js +2 -2
- package/libEs5/components/LegacyMediaAnalytics/createGetInstance.js +61 -63
- package/libEs5/components/LegacyMediaAnalytics/createLegacyMediaComponent.js +38 -37
- package/libEs5/components/LegacyMediaAnalytics/createMediaHelper.js +54 -52
- package/libEs5/components/LegacyMediaAnalytics/index.js +32 -33
- package/libEs5/components/LibraryInfo/index.js +23 -30
- package/libEs5/components/MachineLearning/index.js +1 -1
- package/libEs5/components/MachineLearning/processResponse.js +5 -3
- package/libEs5/components/Personalization/constants/loggerMessage.js +2 -2
- package/libEs5/components/Personalization/constants/scopeType.js +3 -3
- package/libEs5/components/Personalization/constants/surface.js +4 -4
- package/libEs5/components/Personalization/createActionsProvider.js +37 -32
- package/libEs5/components/Personalization/createApplyPropositions.js +71 -81
- package/libEs5/components/Personalization/createClickStorage.js +30 -32
- package/libEs5/components/Personalization/createComponent.js +65 -74
- package/libEs5/components/Personalization/createFetchDataHandler.js +83 -52
- package/libEs5/components/Personalization/createGetPageLocation.js +6 -6
- package/libEs5/components/Personalization/createHandleConsentFlicker.js +15 -14
- package/libEs5/components/Personalization/createInteractionStorage.js +25 -39
- package/libEs5/components/Personalization/createNotificationHandler.js +9 -10
- package/libEs5/components/Personalization/createOnClickHandler.js +29 -25
- package/libEs5/components/Personalization/createOnDecisionHandler.js +23 -21
- package/libEs5/components/Personalization/createPersonalizationDetails.js +39 -45
- package/libEs5/components/Personalization/createPreprocessors.js +7 -7
- package/libEs5/components/Personalization/createSetTargetMigration.js +6 -4
- package/libEs5/components/Personalization/createViewCacheManager.js +29 -32
- package/libEs5/components/Personalization/createViewChangeHandler.js +35 -20
- package/libEs5/components/Personalization/dom-actions/action.js +24 -25
- package/libEs5/components/Personalization/dom-actions/addNonceToInlineStyleElements.js +12 -13
- package/libEs5/components/Personalization/dom-actions/appendHtml.js +8 -7
- package/libEs5/components/Personalization/dom-actions/clicks/collectClicks.js +28 -33
- package/libEs5/components/Personalization/dom-actions/clicks/collectInteractions.js +37 -40
- package/libEs5/components/Personalization/dom-actions/collectInteractions.js +3 -2
- package/libEs5/components/Personalization/dom-actions/createPreprocess.js +10 -11
- package/libEs5/components/Personalization/dom-actions/createRedirect.js +11 -13
- package/libEs5/components/Personalization/dom-actions/dom/createFragment.js +3 -2
- package/libEs5/components/Personalization/dom-actions/dom/getAttribute.js +3 -2
- package/libEs5/components/Personalization/dom-actions/dom/getChildNodes.js +6 -3
- package/libEs5/components/Personalization/dom-actions/dom/getChildren.js +6 -3
- package/libEs5/components/Personalization/dom-actions/dom/getElementById.js +3 -3
- package/libEs5/components/Personalization/dom-actions/dom/getFirstChild.js +3 -2
- package/libEs5/components/Personalization/dom-actions/dom/getNextSibling.js +3 -2
- package/libEs5/components/Personalization/dom-actions/dom/getNonce.js +7 -6
- package/libEs5/components/Personalization/dom-actions/dom/getParent.js +3 -2
- package/libEs5/components/Personalization/dom-actions/dom/helperForEq.js +7 -7
- package/libEs5/components/Personalization/dom-actions/dom/index.js +14 -14
- package/libEs5/components/Personalization/dom-actions/dom/insertAfter.js +4 -3
- package/libEs5/components/Personalization/dom-actions/dom/insertBefore.js +4 -3
- package/libEs5/components/Personalization/dom-actions/dom/isDomElement.js +2 -3
- package/libEs5/components/Personalization/dom-actions/dom/matchesSelectorWithEq.js +6 -5
- package/libEs5/components/Personalization/dom-actions/dom/removeAttribute.js +3 -2
- package/libEs5/components/Personalization/dom-actions/dom/selectNodesWithEq.js +39 -38
- package/libEs5/components/Personalization/dom-actions/dom/setAttribute.js +3 -2
- package/libEs5/components/Personalization/dom-actions/dom/setStyle.js +4 -3
- package/libEs5/components/Personalization/dom-actions/images.js +10 -9
- package/libEs5/components/Personalization/dom-actions/index.js +1 -1
- package/libEs5/components/Personalization/dom-actions/initDomActionsModules.js +40 -25
- package/libEs5/components/Personalization/dom-actions/insertHtmlAfter.js +9 -8
- package/libEs5/components/Personalization/dom-actions/insertHtmlBefore.js +8 -7
- package/libEs5/components/Personalization/dom-actions/prependHtml.js +13 -10
- package/libEs5/components/Personalization/dom-actions/rearrangeChildren.js +9 -7
- package/libEs5/components/Personalization/dom-actions/remapCustomCodeOffers.js +14 -9
- package/libEs5/components/Personalization/dom-actions/remapHeadOffers.js +16 -14
- package/libEs5/components/Personalization/dom-actions/replaceHtml.js +4 -3
- package/libEs5/components/Personalization/dom-actions/scripts.js +58 -38
- package/libEs5/components/Personalization/dom-actions/setAttributes.js +4 -3
- package/libEs5/components/Personalization/dom-actions/setHtml.js +5 -4
- package/libEs5/components/Personalization/dom-actions/setStyles.js +8 -8
- package/libEs5/components/Personalization/dom-actions/setText.js +3 -2
- package/libEs5/components/Personalization/dom-actions/swapImage.js +3 -2
- package/libEs5/components/Personalization/flicker/index.js +66 -49
- package/libEs5/components/Personalization/handlers/createDecorateProposition.js +16 -13
- package/libEs5/components/Personalization/handlers/createProcessDomAction.js +45 -50
- package/libEs5/components/Personalization/handlers/createProcessHtmlContent.js +30 -29
- package/libEs5/components/Personalization/handlers/createProcessInAppMessage.js +35 -31
- package/libEs5/components/Personalization/handlers/createProcessPropositions.js +109 -105
- package/libEs5/components/Personalization/handlers/createProcessRedirect.js +38 -28
- package/libEs5/components/Personalization/handlers/injectCreateProposition.js +59 -67
- package/libEs5/components/Personalization/handlers/processDefaultContent.js +3 -2
- package/libEs5/components/Personalization/in-app-message-actions/actions/displayIframeContent.js +140 -121
- package/libEs5/components/Personalization/in-app-message-actions/initInAppMessageActionsModules.js +4 -5
- package/libEs5/components/Personalization/in-app-message-actions/utils.js +23 -19
- package/libEs5/components/Personalization/index.js +120 -103
- package/libEs5/components/Personalization/utils/addRenderAttemptedToDecisions.js +10 -10
- package/libEs5/components/Personalization/utils/createAsyncArray.js +10 -9
- package/libEs5/components/Personalization/utils/isAuthoringModeEnabled.js +3 -3
- package/libEs5/components/Personalization/utils/metaUtils.js +14 -19
- package/libEs5/components/Personalization/utils/surfaceUtils.js +27 -46
- package/libEs5/components/Personalization/validateApplyPropositionsOptions.js +8 -6
- package/libEs5/components/Privacy/computeConsentHash.js +9 -9
- package/libEs5/components/Privacy/createComponent.js +32 -32
- package/libEs5/components/Privacy/createConsentHashStore.js +27 -24
- package/libEs5/components/Privacy/createConsentRequest.js +10 -8
- package/libEs5/components/Privacy/createConsentRequestPayload.js +9 -8
- package/libEs5/components/Privacy/createStoredConsent.js +11 -9
- package/libEs5/components/Privacy/index.js +26 -23
- package/libEs5/components/Privacy/injectSendSetConsentRequest.js +30 -29
- package/libEs5/components/Privacy/parseConsentCookie.js +6 -14
- package/libEs5/components/StreamingMedia/createMediaEventManager.js +59 -45
- package/libEs5/components/StreamingMedia/createMediaRequest.js +8 -6
- package/libEs5/components/StreamingMedia/createMediaResponseHandler.js +22 -17
- package/libEs5/components/StreamingMedia/createMediaSessionCacheManager.js +22 -18
- package/libEs5/components/StreamingMedia/createStreamingMediaComponent.js +30 -29
- package/libEs5/components/StreamingMedia/createTrackMediaEvent.js +41 -36
- package/libEs5/components/StreamingMedia/createTrackMediaSession.js +25 -22
- package/libEs5/components/StreamingMedia/index.js +33 -34
- package/libEs5/components/StreamingMedia/validateMediaEventOptions.js +9 -12
- package/libEs5/components/StreamingMedia/validateMediaSessionOptions.js +6 -4
- package/libEs5/constants/browser.js +7 -7
- package/libEs5/constants/consentPurpose.js +1 -1
- package/libEs5/constants/consentStatus.js +3 -3
- package/libEs5/constants/contentType.js +2 -2
- package/libEs5/constants/cookieNameKey.js +3 -3
- package/libEs5/constants/coreCommands.js +2 -2
- package/libEs5/constants/decisionProvider.js +4 -3
- package/libEs5/constants/domain.js +2 -2
- package/libEs5/constants/elementAttribute.js +1 -1
- package/libEs5/constants/eventType.js +5 -5
- package/libEs5/constants/handle.js +1 -1
- package/libEs5/constants/httpHeaderNames.js +2 -2
- package/libEs5/constants/httpStatusCode.js +5 -5
- package/libEs5/constants/identityMapAuthenticatedState.js +3 -3
- package/libEs5/constants/legacyCookies.js +3 -3
- package/libEs5/constants/libraryVersion.js +1 -1
- package/libEs5/constants/propositionEventType.js +18 -12
- package/libEs5/constants/propositionInteractionType.js +4 -4
- package/libEs5/constants/schema.js +11 -11
- package/libEs5/constants/sessionDataKeys.js +1 -1
- package/libEs5/constants/tagName.js +7 -7
- package/libEs5/core/buildAndValidateConfig.js +55 -69
- package/libEs5/core/componentCreators.js +70 -41
- package/libEs5/core/config/createConfig.js +4 -3
- package/libEs5/core/config/createCoreConfigs.js +11 -12
- package/libEs5/core/consent/createConsent.js +16 -14
- package/libEs5/core/consent/createConsentStateMachine.js +27 -35
- package/libEs5/core/createComponentRegistry.js +28 -27
- package/libEs5/core/createCookieTransfer.js +18 -18
- package/libEs5/core/createEvent.js +39 -44
- package/libEs5/core/createEventManager.js +64 -69
- package/libEs5/core/createInstanceFunction.js +4 -11
- package/libEs5/core/createLifecycle.js +14 -19
- package/libEs5/core/createLogController.js +30 -29
- package/libEs5/core/createLogger.js +41 -27
- package/libEs5/core/edgeNetwork/handleRequestFailure.js +6 -5
- package/libEs5/core/edgeNetwork/injectApplyResponse.js +29 -32
- package/libEs5/core/edgeNetwork/injectExtractEdgeInfo.js +19 -25
- package/libEs5/core/edgeNetwork/injectGetLocationHint.js +11 -11
- package/libEs5/core/edgeNetwork/injectProcessWarningsAndErrors.js +20 -16
- package/libEs5/core/edgeNetwork/injectSendEdgeNetworkRequest.js +42 -38
- package/libEs5/core/edgeNetwork/mergeLifecycleResponses.js +8 -12
- package/libEs5/core/index.js +137 -133
- package/libEs5/core/initializeComponents.js +17 -15
- package/libEs5/core/injectCreateResponse.js +47 -53
- package/libEs5/core/injectExecuteCommand.js +39 -40
- package/libEs5/core/injectHandleError.js +19 -19
- package/libEs5/core/injectShouldTransferCookie.js +12 -12
- package/libEs5/core/network/getRequestRetryDelay.js +20 -18
- package/libEs5/core/network/injectSendNetworkRequest.js +46 -49
- package/libEs5/core/network/isRequestRetryable.js +9 -8
- package/libEs5/core/network/requestMethods/injectSendBeaconRequest.js +10 -8
- package/libEs5/core/network/requestMethods/injectSendFetchRequest.js +18 -19
- package/libEs5/core/requiredComponentCreators.js +23 -0
- package/libEs5/core/validateCommandOptions.js +14 -11
- package/libEs5/index.js +43 -22
- package/libEs5/standalone.js +6 -1
- package/libEs5/utils/areThirdPartyCookiesSupportedByDefault.js +3 -5
- package/libEs5/utils/assignConcatArrayValues.js +9 -18
- package/libEs5/utils/clone.js +2 -3
- package/libEs5/utils/cookieJar.js +4 -4
- package/libEs5/utils/crc32.js +8 -8
- package/libEs5/utils/createCallbackAggregator.js +7 -11
- package/libEs5/utils/createCollect.js +52 -0
- package/libEs5/utils/createLoggingCookieJar.js +14 -16
- package/libEs5/utils/createMerger.js +9 -10
- package/libEs5/utils/createSubscription.js +48 -48
- package/libEs5/utils/createTaskQueue.js +8 -7
- package/libEs5/utils/deduplicateArray.js +7 -11
- package/libEs5/utils/deepAssign.js +7 -11
- package/libEs5/utils/defer.js +5 -4
- package/libEs5/utils/dom/appendNode.js +3 -2
- package/libEs5/utils/dom/awaitSelector.js +36 -34
- package/libEs5/utils/dom/createNode.js +10 -15
- package/libEs5/utils/dom/index.js +8 -8
- package/libEs5/utils/dom/isShadowSelector.js +2 -3
- package/libEs5/utils/dom/matchesSelector.js +3 -2
- package/libEs5/utils/dom/querySelectorAll.js +5 -13
- package/libEs5/utils/dom/removeNode.js +4 -3
- package/libEs5/utils/dom/selectNodes.js +3 -3
- package/libEs5/utils/dom/selectNodesWithShadow.js +14 -23
- package/libEs5/utils/event.js +49 -0
- package/libEs5/utils/filterObject.js +14 -12
- package/libEs5/utils/fireImage.js +10 -9
- package/libEs5/utils/flattenArray.js +4 -11
- package/libEs5/utils/flattenObject.js +8 -18
- package/libEs5/utils/getApexDomain.js +7 -6
- package/libEs5/utils/getBrowser.js +45 -12
- package/libEs5/utils/getLastArrayItems.js +2 -3
- package/libEs5/utils/getNamespacedCookieName.js +2 -3
- package/libEs5/utils/groupBy.js +6 -5
- package/libEs5/utils/index.js +50 -113
- package/libEs5/utils/injectDoesIdentityCookieExist.js +7 -7
- package/libEs5/utils/injectFireReferrerHideableImage.js +28 -34
- package/libEs5/utils/injectStorage.js +13 -15
- package/libEs5/utils/intersection.js +2 -6
- 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 +4 -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 -4
- package/libEs5/utils/isObject.js +3 -4
- package/libEs5/utils/isString.js +2 -3
- package/libEs5/utils/isUnique.js +6 -5
- package/libEs5/utils/isValidRegExp.js +3 -2
- package/libEs5/utils/memoize.js +7 -6
- package/libEs5/utils/noop.js +2 -1
- package/libEs5/utils/parseUrl.js +19 -25
- package/libEs5/utils/prepareConfigOverridesForEdge.js +6 -5
- package/libEs5/utils/request/createAddIdentity.js +4 -3
- package/libEs5/utils/request/createDataCollectionRequest.js +15 -11
- package/libEs5/utils/request/createDataCollectionRequestPayload.js +9 -10
- package/libEs5/utils/request/createGetAssuranceValidationTokenParams.js +17 -15
- package/libEs5/utils/request/createHasIdentity.js +4 -5
- package/libEs5/utils/request/createRequest.js +26 -23
- package/libEs5/utils/request/createRequestParams.js +13 -13
- package/libEs5/utils/request/createRequestPayload.js +13 -12
- package/libEs5/utils/request/index.js +8 -8
- package/libEs5/utils/sanitizeOrgIdForCookieName.js +2 -3
- package/libEs5/utils/stackError.js +8 -6
- package/libEs5/utils/stringToBoolean.js +3 -2
- package/libEs5/utils/toArray.js +3 -2
- package/libEs5/utils/toError.js +3 -2
- package/libEs5/utils/toISOStringLocal.js +29 -14
- package/libEs5/utils/toInteger.js +5 -5
- package/libEs5/utils/updateErrorMessage.js +6 -4
- package/libEs5/utils/validation/booleanValidator.js +3 -2
- package/libEs5/utils/validation/callbackValidator.js +3 -2
- package/libEs5/utils/validation/createAnyOfValidator.js +14 -17
- package/libEs5/utils/validation/createArrayOfValidator.js +16 -18
- package/libEs5/utils/validation/createDefaultValidator.js +7 -8
- package/libEs5/utils/validation/createDeprecatedValidator.js +12 -14
- package/libEs5/utils/validation/createLiteralValidator.js +5 -6
- package/libEs5/utils/validation/createMapOfValuesValidator.js +20 -22
- package/libEs5/utils/validation/createMaximumValidator.js +5 -6
- package/libEs5/utils/validation/createMinimumValidator.js +5 -6
- package/libEs5/utils/validation/createNoUnknownFieldsValidator.js +13 -14
- package/libEs5/utils/validation/createNonEmptyValidator.js +9 -10
- package/libEs5/utils/validation/createObjectOfValidator.js +27 -29
- package/libEs5/utils/validation/createRenamedValidator.js +24 -27
- package/libEs5/utils/validation/createUniqueItemsValidator.js +4 -3
- package/libEs5/utils/validation/createUniqueValidator.js +5 -4
- package/libEs5/utils/validation/domainValidator.js +4 -3
- package/libEs5/utils/validation/index.js +66 -72
- package/libEs5/utils/validation/integerValidator.js +3 -2
- package/libEs5/utils/validation/matchesRegexpValidator.js +5 -6
- package/libEs5/utils/validation/numberValidator.js +3 -2
- package/libEs5/utils/validation/regexpValidator.js +3 -2
- package/libEs5/utils/validation/requiredValidator.js +3 -2
- package/libEs5/utils/validation/stringValidator.js +3 -2
- package/libEs5/utils/validation/utils.js +29 -35
- package/libEs6/components/ActivityCollector/index.js +18 -8
- package/libEs6/components/Context/createComponent.js +1 -3
- package/libEs6/components/DecisioningEngine/createApplyResponse.js +1 -1
- package/libEs6/components/DecisioningEngine/createSubscribeRulesetItems.js +78 -28
- package/libEs6/components/DecisioningEngine/index.js +22 -2
- package/libEs6/components/DecisioningEngine/utils.js +2 -9
- package/libEs6/components/Identity/createComponent.js +4 -2
- package/libEs6/components/Identity/getEcidFromResponse.js +1 -3
- package/libEs6/components/LegacyMediaAnalytics/createGetInstance.js +2 -2
- package/libEs6/components/LibraryInfo/index.js +4 -5
- package/libEs6/components/Personalization/createActionsProvider.js +4 -2
- package/libEs6/components/Personalization/createComponent.js +2 -2
- package/libEs6/components/Personalization/createFetchDataHandler.js +35 -1
- package/libEs6/components/Personalization/createPersonalizationDetails.js +6 -6
- package/libEs6/components/Personalization/createViewCacheManager.js +5 -2
- package/libEs6/components/Personalization/createViewChangeHandler.js +11 -1
- package/libEs6/components/Personalization/dom-actions/createPreprocess.js +5 -2
- package/libEs6/components/Personalization/dom-actions/dom/selectNodesWithEq.js +1 -3
- package/libEs6/components/Personalization/dom-actions/remapCustomCodeOffers.js +6 -4
- package/libEs6/components/Personalization/dom-actions/remapHeadOffers.js +3 -2
- package/libEs6/components/Personalization/dom-actions/scripts.js +18 -2
- package/libEs6/components/Personalization/flicker/index.js +44 -30
- package/libEs6/components/Personalization/handlers/createDecorateProposition.js +2 -2
- package/libEs6/components/Personalization/handlers/createProcessPropositions.js +29 -9
- package/libEs6/components/Personalization/handlers/createProcessRedirect.js +9 -0
- package/libEs6/components/Personalization/handlers/injectCreateProposition.js +0 -3
- package/libEs6/components/Personalization/in-app-message-actions/actions/displayIframeContent.js +8 -5
- package/libEs6/components/Personalization/in-app-message-actions/utils.js +2 -2
- package/libEs6/components/Personalization/index.js +9 -5
- package/libEs6/components/Personalization/utils/addRenderAttemptedToDecisions.js +4 -4
- package/libEs6/components/Personalization/utils/surfaceUtils.js +3 -3
- package/libEs6/constants/decisionProvider.js +1 -0
- package/libEs6/constants/libraryVersion.js +1 -1
- package/libEs6/constants/schema.js +1 -1
- package/libEs6/core/buildAndValidateConfig.js +8 -5
- package/libEs6/core/componentCreators.js +14 -43
- package/libEs6/core/config/createConfig.js +3 -2
- package/libEs6/core/createCookieTransfer.js +1 -3
- package/libEs6/core/createInstanceFunction.js +1 -9
- package/libEs6/core/createLogger.js +17 -2
- package/libEs6/core/edgeNetwork/injectExtractEdgeInfo.js +1 -7
- package/libEs6/core/index.js +11 -10
- package/libEs6/core/injectCreateResponse.js +1 -3
- package/libEs6/core/network/isRequestRetryable.js +1 -2
- package/libEs6/core/network/requestMethods/injectSendFetchRequest.js +1 -2
- package/libEs6/{utils/assignIf.js → core/requiredComponentCreators.js} +4 -8
- package/libEs6/index.js +26 -6
- package/libEs6/standalone.js +7 -1
- package/libEs6/utils/areThirdPartyCookiesSupportedByDefault.js +1 -2
- package/libEs6/utils/assignConcatArrayValues.js +1 -2
- package/libEs6/utils/cookieJar.js +4 -4
- package/libEs6/{components/Personalization → utils}/createCollect.js +3 -3
- package/libEs6/utils/createSubscription.js +20 -3
- package/libEs6/utils/dom/querySelectorAll.js +1 -10
- package/libEs6/utils/dom/selectNodesWithShadow.js +2 -12
- package/libEs6/{components/Personalization → utils}/event.js +1 -1
- package/libEs6/utils/index.js +1 -10
- package/libEs6/utils/injectStorage.js +1 -2
- package/libEs6/utils/intersection.js +1 -4
- package/libEs6/utils/isNumber.js +1 -2
- package/libEs6/utils/toISOStringLocal.js +14 -1
- package/libEs6/utils/toInteger.js +1 -2
- package/libEs6/utils/validation/createAnyOfValidator.js +1 -2
- package/libEs6/utils/validation/utils.js +3 -6
- package/package.json +35 -37
- package/rollup.config.js +115 -7
- package/scripts/alloyBuilder.js +89 -55
- package/scripts/helpers/entryPointGeneratorBabelPlugin.js +39 -0
- package/libEs5/components/Personalization/createCollect.js +0 -53
- package/libEs5/components/Personalization/event.js +0 -49
- package/libEs5/core/network/requestMethods/injectSendXhrRequest.js +0 -50
- package/libEs5/utils/assign.js +0 -16
- package/libEs5/utils/assignIf.js +0 -21
- package/libEs5/utils/endsWith.js +0 -23
- package/libEs5/utils/find.js +0 -30
- package/libEs5/utils/flatMap.js +0 -17
- package/libEs5/utils/includes.js +0 -23
- package/libEs5/utils/padStart.js +0 -27
- package/libEs5/utils/startsWith.js +0 -23
- package/libEs5/utils/values.js +0 -25
- package/libEs6/core/network/requestMethods/injectSendXhrRequest.js +0 -49
- package/libEs6/utils/assign.js +0 -14
- package/libEs6/utils/endsWith.js +0 -19
- package/libEs6/utils/find.js +0 -28
- package/libEs6/utils/flatMap.js +0 -14
- package/libEs6/utils/includes.js +0 -21
- package/libEs6/utils/padStart.js +0 -25
- package/libEs6/utils/startsWith.js +0 -19
- package/libEs6/utils/values.js +0 -21
- package/scripts/helpers/alloyComponents.js +0 -63
- package/scripts/helpers/conditionalBuildBabelPlugin.js +0 -57
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.hasExperienceData = exports.getExpirationDate = exports.getDecisionProvider = exports.getActivityId = exports.createSaveStorage = exports.createRestoreStorage = exports.createInMemoryStorage = exports.clearLocalStorage = void 0;
|
|
4
|
-
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); }
|
|
5
4
|
/*
|
|
6
5
|
Copyright 2023 Adobe. All rights reserved.
|
|
7
6
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -14,9 +13,9 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
14
13
|
governing permissions and limitations under the License.
|
|
15
14
|
*/
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
return
|
|
19
|
-
|
|
16
|
+
const createRestoreStorage = (storage, storageKey) => {
|
|
17
|
+
return defaultValue => {
|
|
18
|
+
const stored = storage.getItem(storageKey);
|
|
20
19
|
if (!stored) {
|
|
21
20
|
return defaultValue;
|
|
22
21
|
}
|
|
@@ -27,56 +26,62 @@ var createRestoreStorage = exports.createRestoreStorage = function createRestore
|
|
|
27
26
|
}
|
|
28
27
|
};
|
|
29
28
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
34
|
-
return function (value) {
|
|
29
|
+
exports.createRestoreStorage = createRestoreStorage;
|
|
30
|
+
const createSaveStorage = (storage, storageKey, prepareFn = value => value) => {
|
|
31
|
+
return value => {
|
|
35
32
|
storage.setItem(storageKey, JSON.stringify(prepareFn(value)));
|
|
36
33
|
};
|
|
37
34
|
};
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
exports.createSaveStorage = createSaveStorage;
|
|
36
|
+
const getExpirationDate = retentionPeriod => {
|
|
37
|
+
const expirationDate = new Date();
|
|
40
38
|
expirationDate.setDate(expirationDate.getDate() - retentionPeriod);
|
|
41
39
|
return expirationDate;
|
|
42
40
|
};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
exports.getExpirationDate = getExpirationDate;
|
|
42
|
+
const getActivityId = proposition => {
|
|
43
|
+
const {
|
|
44
|
+
scopeDetails = {}
|
|
45
|
+
} = proposition;
|
|
46
|
+
const {
|
|
47
|
+
activity = {}
|
|
48
|
+
} = scopeDetails;
|
|
49
|
+
const {
|
|
50
|
+
id
|
|
51
|
+
} = activity;
|
|
49
52
|
return id;
|
|
50
53
|
};
|
|
51
|
-
|
|
52
|
-
|
|
54
|
+
exports.getActivityId = getActivityId;
|
|
55
|
+
const createInMemoryStorage = () => {
|
|
56
|
+
const inMemoryStorage = {};
|
|
53
57
|
return {
|
|
54
|
-
getItem:
|
|
58
|
+
getItem: key => {
|
|
55
59
|
return key in inMemoryStorage ? inMemoryStorage[key] : null;
|
|
56
60
|
},
|
|
57
|
-
setItem:
|
|
61
|
+
setItem: (key, value) => {
|
|
58
62
|
inMemoryStorage[key] = value;
|
|
59
63
|
}
|
|
60
64
|
};
|
|
61
65
|
};
|
|
62
|
-
|
|
66
|
+
exports.createInMemoryStorage = createInMemoryStorage;
|
|
67
|
+
const clearLocalStorage = storage => {
|
|
63
68
|
storage.clear();
|
|
64
69
|
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
_experience
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
if (!_experience || _typeof(_experience) !== "object") {
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
75
|
-
return true;
|
|
70
|
+
exports.clearLocalStorage = clearLocalStorage;
|
|
71
|
+
const hasExperienceData = (xdm = {}) => {
|
|
72
|
+
const {
|
|
73
|
+
_experience
|
|
74
|
+
} = xdm;
|
|
75
|
+
return !(!_experience || typeof _experience !== "object");
|
|
76
76
|
};
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
exports.hasExperienceData = hasExperienceData;
|
|
78
|
+
const getDecisionProvider = proposition => {
|
|
79
|
+
const {
|
|
80
|
+
scopeDetails = {}
|
|
81
|
+
} = proposition;
|
|
82
|
+
const {
|
|
83
|
+
decisionProvider
|
|
84
|
+
} = scopeDetails;
|
|
81
85
|
return decisionProvider;
|
|
82
|
-
};
|
|
86
|
+
};
|
|
87
|
+
exports.getDecisionProvider = getDecisionProvider;
|
|
@@ -12,8 +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 =
|
|
16
|
-
|
|
15
|
+
var _default = ({
|
|
16
|
+
createEventMergeId
|
|
17
|
+
}) => {
|
|
17
18
|
return {
|
|
18
19
|
commands: {
|
|
19
20
|
createEventMergeId: {
|
|
@@ -21,4 +22,5 @@ var _default = exports.default = function _default(_ref) {
|
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
24
|
};
|
|
24
|
-
};
|
|
25
|
+
};
|
|
26
|
+
exports.default = _default;
|
|
@@ -13,8 +13,9 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
13
13
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
14
14
|
governing permissions and limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
var _default =
|
|
16
|
+
var _default = () => {
|
|
17
17
|
return {
|
|
18
18
|
eventMergeId: (0, _index.uuid)()
|
|
19
19
|
};
|
|
20
|
-
};
|
|
20
|
+
};
|
|
21
|
+
exports.default = _default;
|
|
@@ -15,7 +15,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
15
15
|
governing permissions and limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
const createEventMerge = () => {
|
|
19
19
|
return (0, _createComponent.default)({
|
|
20
20
|
createEventMergeId: _createEventMergeId.default
|
|
21
21
|
});
|
|
@@ -13,10 +13,11 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
13
13
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
14
14
|
governing permissions and limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
var _default =
|
|
16
|
+
var _default = payload => {
|
|
17
17
|
payload.mergeQuery({
|
|
18
18
|
identity: {
|
|
19
19
|
fetch: [_ecidNamespace.default]
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
-
};
|
|
22
|
+
};
|
|
23
|
+
exports.default = _default;
|
|
@@ -13,8 +13,9 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
13
13
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
14
14
|
governing permissions and limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
var _default =
|
|
16
|
+
var _default = (payload, ecid) => {
|
|
17
17
|
payload.addIdentity(_ecidNamespace.default, {
|
|
18
18
|
id: ecid
|
|
19
19
|
});
|
|
20
|
-
};
|
|
20
|
+
};
|
|
21
|
+
exports.default = _default;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.default = void 0;
|
|
4
|
-
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
5
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
7
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
8
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
9
|
-
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
10
4
|
/*
|
|
11
5
|
Copyright 2022 Adobe. All rights reserved.
|
|
12
6
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -18,8 +12,8 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
18
12
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
19
13
|
governing permissions and limitations under the License.
|
|
20
14
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
const URL_REGEX = /^([^?#]*)(\??[^#]*)(#?.*)$/;
|
|
16
|
+
const getSeparator = queryString => {
|
|
23
17
|
if (queryString === "") {
|
|
24
18
|
return "?";
|
|
25
19
|
}
|
|
@@ -28,18 +22,14 @@ var getSeparator = function getSeparator(queryString) {
|
|
|
28
22
|
}
|
|
29
23
|
return "&";
|
|
30
24
|
};
|
|
31
|
-
var _default =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
var separator = getSeparator(queryString);
|
|
43
|
-
return "" + location + queryString + separator + "adobe_mc=" + adobemc + fragment;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
25
|
+
var _default = ({
|
|
26
|
+
dateProvider,
|
|
27
|
+
orgId
|
|
28
|
+
}) => (ecid, url) => {
|
|
29
|
+
const ts = Math.round(dateProvider().getTime() / 1000);
|
|
30
|
+
const adobemc = encodeURIComponent("TS=" + ts + "|MCMID=" + ecid + "|MCORGID=" + encodeURIComponent(orgId));
|
|
31
|
+
const [, location, queryString, fragment] = url.match(URL_REGEX);
|
|
32
|
+
const separator = getSeparator(queryString);
|
|
33
|
+
return "" + location + queryString + separator + "adobe_mc=" + adobemc + fragment;
|
|
34
|
+
};
|
|
35
|
+
exports.default = _default;
|
|
@@ -14,7 +14,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
14
14
|
governing permissions and limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
const configValidators = (0, _index.objectOf)({
|
|
18
18
|
thirdPartyCookiesEnabled: (0, _index.boolean)().default(true),
|
|
19
19
|
idMigrationEnabled: (0, _index.boolean)().default(true)
|
|
20
20
|
});
|
|
@@ -13,6 +13,6 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
13
13
|
governing permissions and limitations under the License.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
const AMBIGUOUS = exports.AMBIGUOUS = "ambiguous";
|
|
17
|
+
const AUTHENTICATED = exports.AUTHENTICATED = "authenticated";
|
|
18
|
+
const LOGGED_OUT = exports.LOGGED_OUT = "loggedOut";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.default = void 0;
|
|
4
|
-
var _index = require("../../utils/index.js");
|
|
5
4
|
var _getIdentityOptionsValidator = require("./getIdentity/getIdentityOptionsValidator.js");
|
|
6
5
|
var _appendIdentityToUrlOptionsValidator = require("./appendIdentityToUrl/appendIdentityToUrlOptionsValidator.js");
|
|
7
6
|
/*
|
|
@@ -15,37 +14,40 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
15
14
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
16
15
|
governing permissions and limitations under the License.
|
|
17
16
|
*/
|
|
18
|
-
var _default =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
17
|
+
var _default = ({
|
|
18
|
+
addEcidQueryToPayload,
|
|
19
|
+
addQueryStringIdentityToPayload,
|
|
20
|
+
ensureSingleIdentity,
|
|
21
|
+
setLegacyEcid,
|
|
22
|
+
handleResponseForIdSyncs,
|
|
23
|
+
getEcidFromResponse,
|
|
24
|
+
getIdentity,
|
|
25
|
+
consent,
|
|
26
|
+
appendIdentityToUrl,
|
|
27
|
+
logger
|
|
28
|
+
}) => {
|
|
29
|
+
let ecid;
|
|
30
|
+
let edge = {};
|
|
31
31
|
return {
|
|
32
32
|
lifecycle: {
|
|
33
|
-
onBeforeRequest
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
onBeforeRequest({
|
|
34
|
+
request,
|
|
35
|
+
onResponse,
|
|
36
|
+
onRequestFailure
|
|
37
|
+
}) {
|
|
37
38
|
// Querying the ECID on every request to be able to set the legacy cookie, and make it
|
|
38
39
|
// available for the `getIdentity` command.
|
|
39
40
|
addEcidQueryToPayload(request.getPayload());
|
|
40
41
|
addQueryStringIdentityToPayload(request.getPayload());
|
|
41
42
|
return ensureSingleIdentity({
|
|
42
|
-
request
|
|
43
|
-
onResponse
|
|
44
|
-
onRequestFailure
|
|
43
|
+
request,
|
|
44
|
+
onResponse,
|
|
45
|
+
onRequestFailure
|
|
45
46
|
});
|
|
46
47
|
},
|
|
47
|
-
onResponse
|
|
48
|
-
|
|
48
|
+
onResponse({
|
|
49
|
+
response
|
|
50
|
+
}) {
|
|
49
51
|
if (!ecid) {
|
|
50
52
|
ecid = getEcidFromResponse(response);
|
|
51
53
|
|
|
@@ -57,36 +59,39 @@ var _default = exports.default = function _default(_ref) {
|
|
|
57
59
|
}
|
|
58
60
|
// For sendBeacon requests, getEdge() will return {}, so we are using assign here
|
|
59
61
|
// so that sendBeacon requests don't override the edge info from before.
|
|
60
|
-
edge =
|
|
62
|
+
edge = {
|
|
63
|
+
...edge,
|
|
64
|
+
...response.getEdge()
|
|
65
|
+
};
|
|
61
66
|
return handleResponseForIdSyncs(response);
|
|
62
67
|
}
|
|
63
68
|
},
|
|
64
69
|
commands: {
|
|
65
70
|
getIdentity: {
|
|
66
71
|
optionsValidator: _getIdentityOptionsValidator.default,
|
|
67
|
-
run:
|
|
68
|
-
return consent.awaitConsent().then(
|
|
72
|
+
run: options => {
|
|
73
|
+
return consent.awaitConsent().then(() => {
|
|
69
74
|
return ecid ? undefined : getIdentity(options);
|
|
70
|
-
}).then(
|
|
75
|
+
}).then(() => {
|
|
71
76
|
return {
|
|
72
77
|
identity: {
|
|
73
78
|
ECID: ecid
|
|
74
79
|
},
|
|
75
|
-
edge
|
|
80
|
+
edge
|
|
76
81
|
};
|
|
77
82
|
});
|
|
78
83
|
}
|
|
79
84
|
},
|
|
80
85
|
appendIdentityToUrl: {
|
|
81
86
|
optionsValidator: _appendIdentityToUrlOptionsValidator.default,
|
|
82
|
-
run:
|
|
83
|
-
return consent.withConsent().then(
|
|
87
|
+
run: options => {
|
|
88
|
+
return consent.withConsent().then(() => {
|
|
84
89
|
return ecid ? undefined : getIdentity(options);
|
|
85
|
-
}).then(
|
|
90
|
+
}).then(() => {
|
|
86
91
|
return {
|
|
87
92
|
url: appendIdentityToUrl(ecid, options.url)
|
|
88
93
|
};
|
|
89
|
-
}).catch(
|
|
94
|
+
}).catch(error => {
|
|
90
95
|
logger.warn("Unable to append identity to url. " + error.message);
|
|
91
96
|
return options;
|
|
92
97
|
});
|
|
@@ -94,4 +99,5 @@ var _default = exports.default = function _default(_ref) {
|
|
|
94
99
|
}
|
|
95
100
|
}
|
|
96
101
|
};
|
|
97
|
-
};
|
|
102
|
+
};
|
|
103
|
+
exports.default = _default;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.default = void 0;
|
|
4
|
-
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); }
|
|
5
|
-
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; }
|
|
6
|
-
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; }
|
|
7
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
8
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
9
|
-
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); }
|
|
10
4
|
/*
|
|
11
5
|
Copyright 2019 Adobe. All rights reserved.
|
|
12
6
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -21,22 +15,25 @@ governing permissions and limitations under the License.
|
|
|
21
15
|
/**
|
|
22
16
|
* Handles migration of ECID to and from Visitor.js.
|
|
23
17
|
*/
|
|
24
|
-
var _default =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
18
|
+
var _default = ({
|
|
19
|
+
config,
|
|
20
|
+
getEcidFromVisitor,
|
|
21
|
+
apexDomain,
|
|
22
|
+
isPageSsl,
|
|
23
|
+
cookieJar
|
|
24
|
+
}) => {
|
|
25
|
+
const {
|
|
26
|
+
idMigrationEnabled,
|
|
27
|
+
orgId
|
|
28
|
+
} = config;
|
|
29
|
+
const amcvCookieName = "AMCV_" + orgId;
|
|
30
|
+
const getEcidFromLegacyCookies = () => {
|
|
31
|
+
let ecid = null;
|
|
32
|
+
const secidCookieName = "s_ecid";
|
|
33
|
+
const legacyEcidCookieValue = cookieJar.get(secidCookieName) || cookieJar.get(amcvCookieName);
|
|
37
34
|
if (legacyEcidCookieValue) {
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
const reg = /(^|\|)MCMID\|(\d+)($|\|)/;
|
|
36
|
+
const matches = legacyEcidCookieValue.match(reg);
|
|
40
37
|
if (matches) {
|
|
41
38
|
// Destructuring arrays breaks in IE
|
|
42
39
|
ecid = matches[2];
|
|
@@ -45,9 +42,9 @@ var _default = exports.default = function _default(_ref) {
|
|
|
45
42
|
return ecid;
|
|
46
43
|
};
|
|
47
44
|
return {
|
|
48
|
-
getEcid
|
|
45
|
+
getEcid() {
|
|
49
46
|
if (idMigrationEnabled) {
|
|
50
|
-
|
|
47
|
+
const ecid = getEcidFromLegacyCookies();
|
|
51
48
|
if (ecid) {
|
|
52
49
|
return Promise.resolve(ecid);
|
|
53
50
|
}
|
|
@@ -55,18 +52,21 @@ var _default = exports.default = function _default(_ref) {
|
|
|
55
52
|
}
|
|
56
53
|
return Promise.resolve();
|
|
57
54
|
},
|
|
58
|
-
setEcid
|
|
55
|
+
setEcid(ecid) {
|
|
59
56
|
if (idMigrationEnabled && getEcidFromLegacyCookies() !== ecid) {
|
|
60
|
-
|
|
57
|
+
const extraOptions = isPageSsl ? {
|
|
61
58
|
sameSite: "none",
|
|
62
59
|
secure: true
|
|
63
60
|
} : {};
|
|
64
|
-
cookieJar.set(amcvCookieName, "MCMID|" + ecid,
|
|
61
|
+
cookieJar.set(amcvCookieName, "MCMID|" + ecid, {
|
|
65
62
|
domain: apexDomain,
|
|
66
63
|
// Without `expires` this will be a session cookie.
|
|
67
|
-
expires: 390
|
|
68
|
-
|
|
64
|
+
expires: 390,
|
|
65
|
+
// days, or 13 months.
|
|
66
|
+
...extraOptions
|
|
67
|
+
});
|
|
69
68
|
}
|
|
70
69
|
}
|
|
71
70
|
};
|
|
72
|
-
};
|
|
71
|
+
};
|
|
72
|
+
exports.default = _default;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.default = void 0;
|
|
4
|
-
var _index = require("../../utils/index.js");
|
|
5
4
|
var _ecidNamespace = require("../../constants/ecidNamespace.js");
|
|
6
5
|
/*
|
|
7
6
|
Copyright 2020 Adobe. All rights reserved.
|
|
@@ -14,10 +13,9 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
14
13
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
15
14
|
governing permissions and limitations under the License.
|
|
16
15
|
*/
|
|
17
|
-
var _default =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return payload.namespace && payload.namespace.code === _ecidNamespace.default;
|
|
21
|
-
});
|
|
16
|
+
var _default = response => {
|
|
17
|
+
const identityResultPayloads = response.getPayloadsByType("identity:result");
|
|
18
|
+
const ecidPayload = identityResultPayloads.find(payload => payload.namespace && payload.namespace.code === _ecidNamespace.default);
|
|
22
19
|
return ecidPayload ? ecidPayload.id : undefined;
|
|
23
|
-
};
|
|
20
|
+
};
|
|
21
|
+
exports.default = _default;
|
|
@@ -13,23 +13,25 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
13
13
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
14
14
|
governing permissions and limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
var _default =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
var _default = ({
|
|
17
|
+
sendEdgeNetworkRequest,
|
|
18
|
+
createIdentityRequestPayload,
|
|
19
|
+
createIdentityRequest,
|
|
20
|
+
globalConfigOverrides
|
|
21
|
+
}) => {
|
|
22
|
+
return ({
|
|
23
|
+
namespaces,
|
|
24
|
+
edgeConfigOverrides: localConfigOverrides
|
|
25
|
+
} = {}) => {
|
|
26
|
+
const requestParams = (0, _index.createRequestParams)({
|
|
26
27
|
payload: createIdentityRequestPayload(namespaces),
|
|
27
|
-
globalConfigOverrides
|
|
28
|
-
localConfigOverrides
|
|
28
|
+
globalConfigOverrides,
|
|
29
|
+
localConfigOverrides
|
|
29
30
|
});
|
|
30
|
-
|
|
31
|
+
const request = createIdentityRequest(requestParams);
|
|
31
32
|
return sendEdgeNetworkRequest({
|
|
32
|
-
request
|
|
33
|
+
request
|
|
33
34
|
});
|
|
34
35
|
};
|
|
35
|
-
};
|
|
36
|
+
};
|
|
37
|
+
exports.default = _default;
|
|
@@ -13,17 +13,19 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
13
13
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
14
14
|
governing permissions and limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
var _default =
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
var _default = ({
|
|
17
|
+
payload,
|
|
18
|
+
datastreamIdOverride
|
|
19
|
+
}) => {
|
|
19
20
|
return (0, _index.createRequest)({
|
|
20
|
-
payload
|
|
21
|
-
datastreamIdOverride
|
|
22
|
-
getAction
|
|
21
|
+
payload,
|
|
22
|
+
datastreamIdOverride,
|
|
23
|
+
getAction() {
|
|
23
24
|
return "identity/acquire";
|
|
24
25
|
},
|
|
25
|
-
getUseSendBeacon
|
|
26
|
+
getUseSendBeacon() {
|
|
26
27
|
return false;
|
|
27
28
|
}
|
|
28
29
|
});
|
|
29
|
-
};
|
|
30
|
+
};
|
|
31
|
+
exports.default = _default;
|
|
@@ -13,8 +13,8 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
13
13
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
14
14
|
governing permissions and limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
var _default =
|
|
17
|
-
|
|
16
|
+
var _default = namespaces => {
|
|
17
|
+
const content = {
|
|
18
18
|
query: {
|
|
19
19
|
identity: {
|
|
20
20
|
fetch: namespaces
|
|
@@ -22,8 +22,9 @@ var _default = exports.default = function _default(namespaces) {
|
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
return (0, _index.createRequestPayload)({
|
|
25
|
-
content
|
|
25
|
+
content,
|
|
26
26
|
addIdentity: (0, _index.createAddIdentity)(content),
|
|
27
27
|
hasIdentity: (0, _index.createHasIdentity)(content)
|
|
28
28
|
});
|
|
29
|
-
};
|
|
29
|
+
};
|
|
30
|
+
exports.default = _default;
|