@adobe/alloy 2.21.1 → 2.22.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +49 -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 +25 -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 +34 -31
- 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 +91 -107
- package/libEs5/components/Personalization/handlers/createProcessRedirect.js +30 -29
- package/libEs5/components/Personalization/handlers/injectCreateProposition.js +59 -64
- 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 +112 -99
- 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 +28 -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/createPersonalizationDetails.js +6 -6
- package/libEs6/components/Personalization/createViewCacheManager.js +5 -2
- 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/handlers/createDecorateProposition.js +2 -2
- 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 +2 -2
- 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 +4 -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
|
@@ -13,17 +13,18 @@ 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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
};
|
|
16
|
+
var _default = ({
|
|
17
|
+
showContainers,
|
|
18
|
+
consent
|
|
19
|
+
}) => () => {
|
|
20
|
+
const {
|
|
21
|
+
state,
|
|
22
|
+
wasSet
|
|
23
|
+
} = consent.current();
|
|
24
|
+
if (state === _consentStatus.OUT && wasSet) {
|
|
25
|
+
showContainers();
|
|
26
|
+
} else {
|
|
27
|
+
consent.awaitConsent().catch(showContainers);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
exports.default = _default;
|
|
@@ -1,18 +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 _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
6
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
-
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; } }
|
|
8
|
-
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
9
|
-
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
10
|
-
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; }
|
|
11
|
-
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; }
|
|
12
|
-
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; }
|
|
13
|
-
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; }
|
|
14
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
15
|
-
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); }
|
|
16
4
|
/*
|
|
17
5
|
Copyright 2020 Adobe. All rights reserved.
|
|
18
6
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -24,8 +12,8 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
24
12
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
25
13
|
governing permissions and limitations under the License.
|
|
26
14
|
*/
|
|
27
|
-
var _default =
|
|
28
|
-
|
|
15
|
+
var _default = () => {
|
|
16
|
+
const clickMetaStorage = {};
|
|
29
17
|
/*
|
|
30
18
|
clickMetaStorage example.
|
|
31
19
|
`abc' and 'def' are proposition IDs. 1 is an interact id. The object with an id, scope and scopeDetails
|
|
@@ -38,7 +26,7 @@ var _default = exports.default = function _default() {
|
|
|
38
26
|
}
|
|
39
27
|
*/
|
|
40
28
|
|
|
41
|
-
|
|
29
|
+
const clickItemStorage = {};
|
|
42
30
|
/*
|
|
43
31
|
clickItemStorage example.
|
|
44
32
|
`abc' and 'def' are proposition IDs. 1 is an interact id. The sets contain proposition-item IDs which
|
|
@@ -51,7 +39,7 @@ var _default = exports.default = function _default() {
|
|
|
51
39
|
}
|
|
52
40
|
*/
|
|
53
41
|
|
|
54
|
-
|
|
42
|
+
const storeInteractionMeta = (propositionId, itemId, scopeType, notification, interactId) => {
|
|
55
43
|
// eslint-disable-next-line no-param-reassign
|
|
56
44
|
interactId = parseInt(interactId, 10);
|
|
57
45
|
if (!clickMetaStorage[interactId]) {
|
|
@@ -62,41 +50,39 @@ var _default = exports.default = function _default() {
|
|
|
62
50
|
clickItemStorage[interactId][propositionId] = new Set();
|
|
63
51
|
}
|
|
64
52
|
clickItemStorage[interactId][propositionId].add(itemId);
|
|
65
|
-
clickMetaStorage[interactId][propositionId] =
|
|
66
|
-
|
|
67
|
-
|
|
53
|
+
clickMetaStorage[interactId][propositionId] = {
|
|
54
|
+
...notification,
|
|
55
|
+
scopeType
|
|
56
|
+
};
|
|
68
57
|
};
|
|
69
|
-
|
|
58
|
+
const getInteractionMetas = interactIds => {
|
|
70
59
|
if (!Array.isArray(interactIds) || interactIds.length === 0) {
|
|
71
60
|
return [];
|
|
72
61
|
}
|
|
73
|
-
return Object.values(interactIds.map(
|
|
74
|
-
|
|
75
|
-
}).reduce(function (metaMap, interactId) {
|
|
76
|
-
Object.keys(clickMetaStorage[interactId] || {}).forEach(function (propositionId) {
|
|
62
|
+
return Object.values(interactIds.map(value => parseInt(value, 10)).reduce((metaMap, interactId) => {
|
|
63
|
+
Object.keys(clickMetaStorage[interactId] || {}).forEach(propositionId => {
|
|
77
64
|
if (!metaMap[propositionId]) {
|
|
78
65
|
metaMap[propositionId] = {
|
|
79
66
|
proposition: clickMetaStorage[interactId][propositionId],
|
|
80
67
|
items: new Set()
|
|
81
68
|
};
|
|
82
69
|
}
|
|
83
|
-
metaMap[propositionId].items = new Set([
|
|
70
|
+
metaMap[propositionId].items = new Set([...metaMap[propositionId].items, ...clickItemStorage[interactId][propositionId]]);
|
|
84
71
|
});
|
|
85
72
|
return metaMap;
|
|
86
|
-
}, {})).map(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
});
|
|
96
|
-
});
|
|
73
|
+
}, {})).map(({
|
|
74
|
+
proposition,
|
|
75
|
+
items
|
|
76
|
+
}) => ({
|
|
77
|
+
...proposition,
|
|
78
|
+
items: Array.from(items).map(id => ({
|
|
79
|
+
id
|
|
80
|
+
}))
|
|
81
|
+
}));
|
|
97
82
|
};
|
|
98
83
|
return {
|
|
99
|
-
storeInteractionMeta
|
|
100
|
-
getInteractionMetas
|
|
84
|
+
storeInteractionMeta,
|
|
85
|
+
getInteractionMetas
|
|
101
86
|
};
|
|
102
|
-
};
|
|
87
|
+
};
|
|
88
|
+
exports.default = _default;
|
|
@@ -13,26 +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
|
-
return
|
|
16
|
+
var _default = (collect, renderedPropositions) => {
|
|
17
|
+
return (isRenderDecisions, isSendDisplayEvent, viewName) => {
|
|
18
18
|
if (!isRenderDecisions) {
|
|
19
19
|
// If we aren't rendering anything, then we don't need to sendDisplayEvents.
|
|
20
|
-
return
|
|
21
|
-
return undefined;
|
|
22
|
-
};
|
|
20
|
+
return () => undefined;
|
|
23
21
|
}
|
|
24
22
|
if (!isSendDisplayEvent) {
|
|
25
|
-
|
|
23
|
+
const renderedPropositionsDeferred = (0, _index.defer)();
|
|
26
24
|
renderedPropositions.concat(renderedPropositionsDeferred.promise);
|
|
27
25
|
return renderedPropositionsDeferred.resolve;
|
|
28
26
|
}
|
|
29
|
-
return
|
|
27
|
+
return decisionsMeta => {
|
|
30
28
|
if (decisionsMeta.length > 0) {
|
|
31
29
|
collect({
|
|
32
|
-
decisionsMeta
|
|
33
|
-
viewName
|
|
30
|
+
decisionsMeta,
|
|
31
|
+
viewName
|
|
34
32
|
});
|
|
35
33
|
}
|
|
36
34
|
};
|
|
37
35
|
};
|
|
38
|
-
};
|
|
36
|
+
};
|
|
37
|
+
exports.default = _default;
|
|
@@ -16,11 +16,11 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
16
16
|
governing permissions and limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
const createPropositionAction = (clickLabel, clickToken) => {
|
|
20
20
|
if (!clickToken && !clickLabel) {
|
|
21
21
|
return undefined;
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
const propositionAction = {};
|
|
24
24
|
if (clickLabel) {
|
|
25
25
|
propositionAction.label = clickLabel;
|
|
26
26
|
}
|
|
@@ -29,27 +29,30 @@ var createPropositionAction = function createPropositionAction(clickLabel, click
|
|
|
29
29
|
}
|
|
30
30
|
return propositionAction;
|
|
31
31
|
};
|
|
32
|
-
var _default =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
var _default = ({
|
|
33
|
+
mergeDecisionsMeta,
|
|
34
|
+
collectInteractions,
|
|
35
|
+
collectClicks,
|
|
36
|
+
getInteractionMetas,
|
|
37
|
+
getClickMetas,
|
|
38
|
+
getClickSelectors,
|
|
39
|
+
autoCollectPropositionInteractions
|
|
40
|
+
}) => {
|
|
40
41
|
// Called when an element qualifying for conversion within an offer is clicked.
|
|
41
|
-
return
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
42
|
+
return ({
|
|
43
|
+
event,
|
|
44
|
+
clickedElement
|
|
45
|
+
}) => {
|
|
46
|
+
const decisionsMeta = [];
|
|
47
|
+
let propositionActionLabel;
|
|
48
|
+
let propositionActionToken;
|
|
49
|
+
let viewName;
|
|
50
|
+
[collectInteractions(clickedElement, getInteractionMetas, autoCollectPropositionInteractions), collectClicks(clickedElement, getClickSelectors(), getClickMetas)].forEach(({
|
|
51
|
+
decisionsMeta: curDecisionsMeta,
|
|
52
|
+
propositionActionLabel: curPropositionActionLabel,
|
|
53
|
+
propositionActionToken: curPropositionActionToken,
|
|
54
|
+
viewName: curViewName
|
|
55
|
+
}) => {
|
|
53
56
|
Array.prototype.push.apply(decisionsMeta, curDecisionsMeta);
|
|
54
57
|
if (!propositionActionLabel && curPropositionActionLabel) {
|
|
55
58
|
propositionActionLabel = curPropositionActionLabel;
|
|
@@ -62,13 +65,13 @@ var _default = exports.default = function _default(_ref) {
|
|
|
62
65
|
}
|
|
63
66
|
});
|
|
64
67
|
if ((0, _index.isNonEmptyArray)(decisionsMeta)) {
|
|
65
|
-
|
|
68
|
+
const xdm = {
|
|
66
69
|
eventType: _eventType.INTERACT
|
|
67
70
|
};
|
|
68
71
|
if (viewName) {
|
|
69
72
|
xdm.web = {
|
|
70
73
|
webPageDetails: {
|
|
71
|
-
viewName
|
|
74
|
+
viewName
|
|
72
75
|
}
|
|
73
76
|
};
|
|
74
77
|
}
|
|
@@ -76,4 +79,5 @@ var _default = exports.default = function _default(_ref) {
|
|
|
76
79
|
mergeDecisionsMeta(event, decisionsMeta, [_propositionEventType.PropositionEventType.INTERACT], createPropositionAction(propositionActionLabel, propositionActionToken));
|
|
77
80
|
}
|
|
78
81
|
};
|
|
79
|
-
};
|
|
82
|
+
};
|
|
83
|
+
exports.default = _default;
|
|
@@ -12,32 +12,34 @@ 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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
var _default = ({
|
|
16
|
+
processPropositions,
|
|
17
|
+
createProposition,
|
|
18
|
+
notificationHandler
|
|
19
|
+
}) => {
|
|
20
|
+
return ({
|
|
21
|
+
renderDecisions,
|
|
22
|
+
propositions,
|
|
23
|
+
event,
|
|
24
|
+
personalization = {}
|
|
25
|
+
}) => {
|
|
25
26
|
if (!renderDecisions) {
|
|
26
27
|
return Promise.resolve();
|
|
27
28
|
}
|
|
28
|
-
|
|
29
|
-
sendDisplayEvent =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
const {
|
|
30
|
+
sendDisplayEvent = true
|
|
31
|
+
} = personalization;
|
|
32
|
+
const viewName = event ? event.getViewName() : undefined;
|
|
33
|
+
const propositionsToExecute = propositions.map(proposition => createProposition(proposition, true));
|
|
34
|
+
const {
|
|
35
|
+
render,
|
|
36
|
+
returnedPropositions
|
|
37
|
+
} = processPropositions(propositionsToExecute);
|
|
38
|
+
const handleNotifications = notificationHandler(renderDecisions, sendDisplayEvent, viewName);
|
|
38
39
|
render().then(handleNotifications);
|
|
39
40
|
return Promise.resolve({
|
|
40
41
|
propositions: returnedPropositions
|
|
41
42
|
});
|
|
42
43
|
};
|
|
43
|
-
};
|
|
44
|
+
};
|
|
45
|
+
exports.default = _default;
|
|
@@ -5,12 +5,7 @@ var _index = require("../../utils/index.js");
|
|
|
5
5
|
var _surfaceUtils = require("./utils/surfaceUtils.js");
|
|
6
6
|
var _pageWideScope = require("../../constants/pageWideScope.js");
|
|
7
7
|
var _schema = require("../../constants/schema.js");
|
|
8
|
-
|
|
9
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
-
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; } }
|
|
11
|
-
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
12
|
-
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
13
|
-
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
|
+
/*
|
|
14
9
|
Copyright 2020 Adobe. All rights reserved.
|
|
15
10
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
16
11
|
you may not use this file except in compliance with the License. You may obtain a copy
|
|
@@ -21,84 +16,83 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
21
16
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
22
17
|
governing permissions and limitations under the License.
|
|
23
18
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
|
|
20
|
+
const addPageWideScope = scopes => {
|
|
21
|
+
if (!scopes.includes(_pageWideScope.default)) {
|
|
26
22
|
scopes.push(_pageWideScope.default);
|
|
27
23
|
}
|
|
28
24
|
};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if (!
|
|
25
|
+
const addPageSurface = (surfaces, getPageLocation) => {
|
|
26
|
+
const pageSurface = (0, _surfaceUtils.buildPageSurface)(getPageLocation);
|
|
27
|
+
if (!surfaces.includes(pageSurface)) {
|
|
32
28
|
surfaces.push(pageSurface);
|
|
33
29
|
}
|
|
34
30
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
_isCacheInitialized = _ref.isCacheInitialized,
|
|
47
|
-
logger = _ref.logger;
|
|
48
|
-
var viewName = event.getViewName();
|
|
31
|
+
const dedupe = array => array.filter((item, pos) => array.indexOf(item) === pos);
|
|
32
|
+
var _default = ({
|
|
33
|
+
getPageLocation,
|
|
34
|
+
renderDecisions,
|
|
35
|
+
decisionScopes,
|
|
36
|
+
personalization,
|
|
37
|
+
event,
|
|
38
|
+
isCacheInitialized,
|
|
39
|
+
logger
|
|
40
|
+
}) => {
|
|
41
|
+
const viewName = event.getViewName();
|
|
49
42
|
return {
|
|
50
|
-
isRenderDecisions
|
|
43
|
+
isRenderDecisions() {
|
|
51
44
|
return renderDecisions;
|
|
52
45
|
},
|
|
53
|
-
isSendDisplayEvent
|
|
46
|
+
isSendDisplayEvent() {
|
|
54
47
|
return !!personalization.sendDisplayEvent;
|
|
55
48
|
},
|
|
56
|
-
shouldIncludeRenderedPropositions
|
|
49
|
+
shouldIncludeRenderedPropositions() {
|
|
57
50
|
return !!personalization.includeRenderedPropositions;
|
|
58
51
|
},
|
|
59
|
-
getViewName
|
|
52
|
+
getViewName() {
|
|
60
53
|
return viewName;
|
|
61
54
|
},
|
|
62
|
-
hasScopes
|
|
55
|
+
hasScopes() {
|
|
63
56
|
return decisionScopes.length > 0 || (0, _index.isNonEmptyArray)(personalization.decisionScopes);
|
|
64
57
|
},
|
|
65
|
-
hasSurfaces
|
|
58
|
+
hasSurfaces() {
|
|
66
59
|
return (0, _index.isNonEmptyArray)(personalization.surfaces);
|
|
67
60
|
},
|
|
68
|
-
hasViewName
|
|
61
|
+
hasViewName() {
|
|
69
62
|
return (0, _index.isNonEmptyString)(viewName);
|
|
70
63
|
},
|
|
71
|
-
createQueryDetails
|
|
72
|
-
|
|
64
|
+
createQueryDetails() {
|
|
65
|
+
const scopes = [...decisionScopes];
|
|
73
66
|
if ((0, _index.isNonEmptyArray)(personalization.decisionScopes)) {
|
|
74
|
-
scopes.push
|
|
67
|
+
scopes.push(...personalization.decisionScopes);
|
|
75
68
|
}
|
|
76
|
-
|
|
69
|
+
const eventSurfaces = (0, _surfaceUtils.normalizeSurfaces)(personalization.surfaces, getPageLocation, logger);
|
|
77
70
|
if (this.shouldRequestDefaultPersonalization()) {
|
|
78
71
|
addPageWideScope(scopes);
|
|
79
72
|
addPageSurface(eventSurfaces, getPageLocation);
|
|
80
73
|
}
|
|
81
|
-
|
|
82
|
-
if (
|
|
74
|
+
const schemas = [_schema.DEFAULT_CONTENT_ITEM, _schema.HTML_CONTENT_ITEM, _schema.JSON_CONTENT_ITEM, _schema.REDIRECT_ITEM, _schema.RULESET_ITEM, _schema.MESSAGE_IN_APP, _schema.MESSAGE_CONTENT_CARD];
|
|
75
|
+
if (scopes.includes(_pageWideScope.default)) {
|
|
83
76
|
schemas.push(_schema.DOM_ACTION);
|
|
84
77
|
}
|
|
85
78
|
return {
|
|
86
|
-
schemas
|
|
79
|
+
schemas,
|
|
87
80
|
decisionScopes: dedupe(scopes),
|
|
88
81
|
surfaces: dedupe(eventSurfaces)
|
|
89
82
|
};
|
|
90
83
|
},
|
|
91
|
-
isCacheInitialized
|
|
92
|
-
return
|
|
84
|
+
isCacheInitialized() {
|
|
85
|
+
return isCacheInitialized;
|
|
93
86
|
},
|
|
94
|
-
shouldFetchData
|
|
87
|
+
shouldFetchData() {
|
|
95
88
|
return this.hasScopes() || this.hasSurfaces() || this.shouldRequestDefaultPersonalization();
|
|
96
89
|
},
|
|
97
|
-
shouldUseCachedData
|
|
90
|
+
shouldUseCachedData() {
|
|
98
91
|
return this.hasViewName() && !this.shouldFetchData();
|
|
99
92
|
},
|
|
100
|
-
shouldRequestDefaultPersonalization
|
|
93
|
+
shouldRequestDefaultPersonalization() {
|
|
101
94
|
return personalization.defaultPersonalizationEnabled || !this.isCacheInitialized() && personalization.defaultPersonalizationEnabled !== false;
|
|
102
95
|
}
|
|
103
96
|
};
|
|
104
|
-
};
|
|
97
|
+
};
|
|
98
|
+
exports.default = _default;
|
|
@@ -4,10 +4,7 @@ exports.default = void 0;
|
|
|
4
4
|
var _schema = require("../../constants/schema.js");
|
|
5
5
|
var _remapHeadOffers = require("./dom-actions/remapHeadOffers.js");
|
|
6
6
|
var _remapCustomCodeOffers = require("./dom-actions/remapCustomCodeOffers.js");
|
|
7
|
-
|
|
8
|
-
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; }
|
|
9
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
10
|
-
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); } /*
|
|
7
|
+
/*
|
|
11
8
|
Copyright 2023 Adobe. All rights reserved.
|
|
12
9
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
13
10
|
you may not use this file except in compliance with the License. You may obtain a copy
|
|
@@ -18,6 +15,9 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
18
15
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
19
16
|
governing permissions and limitations under the License.
|
|
20
17
|
*/
|
|
21
|
-
var _default =
|
|
22
|
-
return
|
|
23
|
-
|
|
18
|
+
var _default = () => {
|
|
19
|
+
return {
|
|
20
|
+
[_schema.DOM_ACTION]: [_remapHeadOffers.default, _remapCustomCodeOffers.default]
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
exports.default = _default;
|
|
@@ -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 =
|
|
17
|
-
|
|
16
|
+
var _default = ({
|
|
17
|
+
targetMigrationEnabled
|
|
18
|
+
}) => {
|
|
18
19
|
if (targetMigrationEnabled) {
|
|
19
|
-
return
|
|
20
|
+
return request => {
|
|
20
21
|
request.getPayload().mergeMeta({
|
|
21
22
|
target: {
|
|
22
23
|
migration: true
|
|
@@ -25,4 +26,5 @@ var _default = exports.default = function _default(_ref) {
|
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
28
|
return _index.noop;
|
|
28
|
-
};
|
|
29
|
+
};
|
|
30
|
+
exports.default = _default;
|
|
@@ -16,16 +16,17 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
16
16
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
17
17
|
governing permissions and limitations under the License.
|
|
18
18
|
*/
|
|
19
|
-
var _default =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
var _default = ({
|
|
20
|
+
createProposition
|
|
21
|
+
}) => {
|
|
22
|
+
let cacheUpdateCreatedAtLeastOnce = false;
|
|
23
|
+
let viewStoragePromise = Promise.resolve({});
|
|
24
|
+
const getViewPropositions = (viewStorage, viewName) => {
|
|
25
|
+
const viewPropositions = viewStorage[viewName.toLowerCase()];
|
|
25
26
|
if (viewPropositions && viewPropositions.length > 0) {
|
|
26
27
|
return viewPropositions;
|
|
27
28
|
}
|
|
28
|
-
|
|
29
|
+
const emptyViewProposition = createProposition({
|
|
29
30
|
scope: viewName,
|
|
30
31
|
scopeDetails: {
|
|
31
32
|
characteristics: {
|
|
@@ -40,51 +41,47 @@ var _default = exports.default = function _default(_ref) {
|
|
|
40
41
|
};
|
|
41
42
|
|
|
42
43
|
// This should be called before making the request to experience edge.
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
const createCacheUpdate = viewName => {
|
|
45
|
+
const updateCacheDeferred = (0, _defer.default)();
|
|
45
46
|
cacheUpdateCreatedAtLeastOnce = true;
|
|
46
47
|
|
|
47
48
|
// Additional updates will merge the new view propositions with the old.
|
|
48
49
|
// i.e. if there are new "cart" view propositions they will overwrite the
|
|
49
50
|
// old "cart" view propositions, but if there are no new "cart" view
|
|
50
51
|
// propositions the old "cart" view propositions will remain.
|
|
51
|
-
viewStoragePromise = viewStoragePromise.then(
|
|
52
|
-
return updateCacheDeferred.promise.then(
|
|
53
|
-
return
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
viewStoragePromise = viewStoragePromise.then(oldViewStorage => {
|
|
53
|
+
return updateCacheDeferred.promise.then(newViewStorage => {
|
|
54
|
+
return {
|
|
55
|
+
...oldViewStorage,
|
|
56
|
+
...newViewStorage
|
|
57
|
+
};
|
|
58
|
+
}).catch(() => oldViewStorage);
|
|
57
59
|
});
|
|
58
60
|
return {
|
|
59
|
-
update
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
});
|
|
63
|
-
var newViewStorage = (0, _index.groupBy)(viewPropositionsWithScope, function (proposition) {
|
|
64
|
-
return proposition.getScope().toLowerCase();
|
|
65
|
-
});
|
|
61
|
+
update(viewPropositions) {
|
|
62
|
+
const viewPropositionsWithScope = viewPropositions.filter(proposition => proposition.getScope());
|
|
63
|
+
const newViewStorage = (0, _index.groupBy)(viewPropositionsWithScope, proposition => proposition.getScope().toLowerCase());
|
|
66
64
|
updateCacheDeferred.resolve(newViewStorage);
|
|
67
65
|
if (viewName) {
|
|
68
66
|
return getViewPropositions(newViewStorage, viewName);
|
|
69
67
|
}
|
|
70
68
|
return [];
|
|
71
69
|
},
|
|
72
|
-
cancel
|
|
70
|
+
cancel() {
|
|
73
71
|
updateCacheDeferred.reject();
|
|
74
72
|
}
|
|
75
73
|
};
|
|
76
74
|
};
|
|
77
|
-
|
|
78
|
-
return viewStoragePromise.then(
|
|
79
|
-
return getViewPropositions(viewStorage, viewName);
|
|
80
|
-
});
|
|
75
|
+
const getView = viewName => {
|
|
76
|
+
return viewStoragePromise.then(viewStorage => getViewPropositions(viewStorage, viewName));
|
|
81
77
|
};
|
|
82
|
-
|
|
78
|
+
const isInitialized = () => {
|
|
83
79
|
return cacheUpdateCreatedAtLeastOnce;
|
|
84
80
|
};
|
|
85
81
|
return {
|
|
86
|
-
createCacheUpdate
|
|
87
|
-
getView
|
|
88
|
-
isInitialized
|
|
82
|
+
createCacheUpdate,
|
|
83
|
+
getView,
|
|
84
|
+
isInitialized
|
|
89
85
|
};
|
|
90
|
-
};
|
|
86
|
+
};
|
|
87
|
+
exports.default = _default;
|