@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
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "dataCollector", {
|
|
4
|
+
enumerable: true,
|
|
5
|
+
get: function () {
|
|
6
|
+
return _index.default;
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
Object.defineProperty(exports, "identity", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () {
|
|
12
|
+
return _index2.default;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(exports, "libraryInfo", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () {
|
|
18
|
+
return _index3.default;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
var _index = require("../components/DataCollector/index.js");
|
|
22
|
+
var _index2 = require("../components/Identity/index.js");
|
|
23
|
+
var _index3 = require("../components/LibraryInfo/index.js");
|
|
@@ -13,22 +13,25 @@ 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
|
-
var _default =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
const COMMAND_DOC_URI = "https://adobe.ly/3sHgQHb";
|
|
17
|
+
var _default = ({
|
|
18
|
+
command,
|
|
19
|
+
options
|
|
20
|
+
}) => {
|
|
21
|
+
const {
|
|
22
|
+
commandName,
|
|
23
|
+
documentationUri = COMMAND_DOC_URI,
|
|
24
|
+
optionsValidator
|
|
25
|
+
} = command;
|
|
26
|
+
let validatedOptions = options;
|
|
25
27
|
if (optionsValidator) {
|
|
26
28
|
try {
|
|
27
29
|
validatedOptions = optionsValidator(options);
|
|
28
30
|
} catch (validationError) {
|
|
29
|
-
|
|
31
|
+
const invalidOptionsMessage = "Invalid " + commandName + " command options:\n\t - " + validationError + " For command documentation see: " + documentationUri;
|
|
30
32
|
throw new Error(invalidOptionsMessage);
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
35
|
return validatedOptions;
|
|
34
|
-
};
|
|
36
|
+
};
|
|
37
|
+
exports.default = _default;
|
package/libEs5/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
exports.createInstance = void 0;
|
|
3
|
+
exports.createInstance = exports.createCustomInstance = exports.components = void 0;
|
|
4
4
|
var _index = require("./core/index.js");
|
|
5
5
|
var _createLogger = require("./core/createLogger.js");
|
|
6
6
|
var _createLogController = require("./core/createLogController.js");
|
|
7
7
|
var _index2 = require("./utils/index.js");
|
|
8
8
|
var _index3 = require("./utils/validation/index.js");
|
|
9
|
+
var optionalComponents = require("./core/componentCreators.js");
|
|
10
|
+
exports.components = optionalComponents;
|
|
9
11
|
/*
|
|
10
12
|
Copyright 2020 Adobe. All rights reserved.
|
|
11
13
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -22,38 +24,57 @@ governing permissions and limitations under the License.
|
|
|
22
24
|
// like the launch extension. Everything that is exported here can be used independently by other
|
|
23
25
|
// npm projects.
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
console
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
const {
|
|
28
|
+
console
|
|
29
|
+
} = window;
|
|
30
|
+
const createNamespacedStorage = (0, _index2.injectStorage)(window);
|
|
31
|
+
const createCustomInstance = (options = {}) => {
|
|
32
|
+
const eventOptionsValidator = (0, _index3.objectOf)({
|
|
31
33
|
name: (0, _index3.string)().default("alloy"),
|
|
32
|
-
monitors: (0, _index3.arrayOf)((0, _index3.objectOf)({})).default([])
|
|
34
|
+
monitors: (0, _index3.arrayOf)((0, _index3.objectOf)({})).default([]),
|
|
35
|
+
components: (0, _index3.arrayOf)((0, _index3.callback)())
|
|
33
36
|
}).noUnknownFields();
|
|
34
|
-
|
|
35
|
-
name
|
|
36
|
-
monitors
|
|
37
|
+
const {
|
|
38
|
+
name,
|
|
39
|
+
monitors,
|
|
40
|
+
components
|
|
41
|
+
} = eventOptionsValidator(options);
|
|
37
42
|
|
|
38
43
|
// this is a function so that window.__alloyMonitors can be set or added to at any time
|
|
39
44
|
// eslint-disable-next-line no-underscore-dangle
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
var logController = (0, _createLogController.default)({
|
|
44
|
-
console: console,
|
|
45
|
+
const getMonitors = () => (window.__alloyMonitors || []).concat(monitors);
|
|
46
|
+
const logController = (0, _createLogController.default)({
|
|
47
|
+
console,
|
|
45
48
|
locationSearch: window.location.search,
|
|
46
49
|
createLogger: _createLogger.default,
|
|
47
50
|
instanceName: name,
|
|
48
|
-
createNamespacedStorage
|
|
49
|
-
getMonitors
|
|
51
|
+
createNamespacedStorage,
|
|
52
|
+
getMonitors
|
|
50
53
|
});
|
|
51
|
-
|
|
54
|
+
const instance = (0, _index.createExecuteCommand)({
|
|
52
55
|
instanceName: name,
|
|
53
|
-
logController
|
|
56
|
+
logController,
|
|
57
|
+
components
|
|
54
58
|
});
|
|
55
59
|
logController.logger.logOnInstanceCreated({
|
|
56
|
-
instance
|
|
60
|
+
instance
|
|
57
61
|
});
|
|
58
62
|
return instance;
|
|
59
|
-
};
|
|
63
|
+
};
|
|
64
|
+
exports.createCustomInstance = createCustomInstance;
|
|
65
|
+
const createInstance = (options = {}) => {
|
|
66
|
+
const eventOptionsValidator = (0, _index3.objectOf)({
|
|
67
|
+
name: (0, _index3.string)().default("alloy"),
|
|
68
|
+
monitors: (0, _index3.arrayOf)((0, _index3.objectOf)({})).default([])
|
|
69
|
+
}).noUnknownFields();
|
|
70
|
+
const {
|
|
71
|
+
name,
|
|
72
|
+
monitors
|
|
73
|
+
} = eventOptionsValidator(options);
|
|
74
|
+
return createCustomInstance({
|
|
75
|
+
name,
|
|
76
|
+
monitors,
|
|
77
|
+
components: Object.values(optionalComponents)
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
exports.createInstance = createInstance;
|
package/libEs5/standalone.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _index = require("./core/index.js");
|
|
4
|
+
var components = require("./core/componentCreators.js");
|
|
4
5
|
/*
|
|
5
6
|
Copyright 2020 Adobe. All rights reserved.
|
|
6
7
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -15,4 +16,8 @@ governing permissions and limitations under the License.
|
|
|
15
16
|
|
|
16
17
|
// This file is used by rollup to create the browser version that is uploaded to cdn
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
// If you change this line, check if the custom build script is still working.
|
|
20
|
+
// You might need to change the babel plugin in scripts/helpers/entryPointGeneratorBabelPlugin.js.
|
|
21
|
+
(0, _index.default)({
|
|
22
|
+
components: Object.values(components)
|
|
23
|
+
});
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
exports.default = void 0;
|
|
4
4
|
var _browser = require("../constants/browser.js");
|
|
5
|
-
var _includes = require("./includes.js");
|
|
6
5
|
/*
|
|
7
6
|
Copyright 2019 Adobe. All rights reserved.
|
|
8
7
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -18,7 +17,6 @@ governing permissions and limitations under the License.
|
|
|
18
17
|
// Users could have also disabled third-party cookies within these browsers, but
|
|
19
18
|
// we don't know. We also assume "unknown" browsers support third-party cookies,
|
|
20
19
|
// though we don't really know that either. We're making best guesses.
|
|
21
|
-
|
|
22
|
-
var _default =
|
|
23
|
-
|
|
24
|
-
};
|
|
20
|
+
const browsersSupportingThirdPartyCookie = [_browser.CHROME, _browser.EDGE, _browser.EDGE_CHROMIUM, _browser.IE, _browser.UNKNOWN];
|
|
21
|
+
var _default = browser => browsersSupportingThirdPartyCookie.includes(browser);
|
|
22
|
+
exports.default = _default;
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.default = void 0;
|
|
4
|
-
var _assign = require("./assign.js");
|
|
5
4
|
var _isObject = require("./isObject.js");
|
|
6
|
-
|
|
7
|
-
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."); }
|
|
8
|
-
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; } }
|
|
9
|
-
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
10
|
-
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
11
|
-
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; } /*
|
|
5
|
+
/*
|
|
12
6
|
Copyright 2023 Adobe. All rights reserved.
|
|
13
7
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
14
8
|
you may not use this file except in compliance with the License. You may obtain a copy
|
|
@@ -19,24 +13,20 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
19
13
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
20
14
|
governing permissions and limitations under the License.
|
|
21
15
|
*/
|
|
22
|
-
var _default =
|
|
23
|
-
for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
24
|
-
values[_key] = arguments[_key];
|
|
25
|
-
}
|
|
16
|
+
var _default = (...values) => {
|
|
26
17
|
if (values.length < 2) {
|
|
27
18
|
// if the number of args is 0 or 1, just use the default behavior from Object.assign
|
|
28
|
-
return
|
|
19
|
+
return Object.assign(...values);
|
|
29
20
|
}
|
|
30
|
-
return values.reduce(
|
|
21
|
+
return values.reduce((accumulator, currentValue) => {
|
|
31
22
|
if ((0, _isObject.default)(currentValue)) {
|
|
32
|
-
Object.keys(currentValue).forEach(
|
|
23
|
+
Object.keys(currentValue).forEach(key => {
|
|
33
24
|
if (Array.isArray(currentValue[key])) {
|
|
34
25
|
if (Array.isArray(accumulator[key])) {
|
|
35
|
-
|
|
36
|
-
(_accumulator$key = accumulator[key]).push.apply(_accumulator$key, _toConsumableArray(currentValue[key]));
|
|
26
|
+
accumulator[key].push(...currentValue[key]);
|
|
37
27
|
} else {
|
|
38
28
|
// clone the array so the original isn't modified.
|
|
39
|
-
accumulator[key] =
|
|
29
|
+
accumulator[key] = [...currentValue[key]];
|
|
40
30
|
}
|
|
41
31
|
} else {
|
|
42
32
|
accumulator[key] = currentValue[key];
|
|
@@ -45,4 +35,5 @@ var _default = exports.default = function _default() {
|
|
|
45
35
|
}
|
|
46
36
|
return accumulator;
|
|
47
37
|
}); // no default value to pass into reduce because we want to skip the first value
|
|
48
|
-
};
|
|
38
|
+
};
|
|
39
|
+
exports.default = _default;
|
package/libEs5/utils/clone.js
CHANGED
|
@@ -17,6 +17,5 @@ governing permissions and limitations under the License.
|
|
|
17
17
|
* @param {*} value
|
|
18
18
|
* @returns {any}
|
|
19
19
|
*/
|
|
20
|
-
var _default =
|
|
21
|
-
|
|
22
|
-
};
|
|
20
|
+
var _default = value => JSON.parse(JSON.stringify(value));
|
|
21
|
+
exports.default = _default;
|
|
@@ -14,8 +14,8 @@ 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
|
var _default = exports.default = {
|
|
17
|
-
get: _jsCookie.default.get,
|
|
18
|
-
set: _jsCookie.default.set,
|
|
19
|
-
remove: _jsCookie.default.remove,
|
|
20
|
-
withConverter: _jsCookie.default.withConverter
|
|
17
|
+
get: _jsCookie.default.get.bind(_jsCookie.default),
|
|
18
|
+
set: _jsCookie.default.set.bind(_jsCookie.default),
|
|
19
|
+
remove: _jsCookie.default.remove.bind(_jsCookie.default),
|
|
20
|
+
withConverter: _jsCookie.default.withConverter.bind(_jsCookie.default)
|
|
21
21
|
};
|
package/libEs5/utils/crc32.js
CHANGED
|
@@ -12,11 +12,11 @@ Description
|
|
|
12
12
|
The polynomial used in calculation is 0xedb88320.
|
|
13
13
|
This polynomial is used in Ethernet, Gzip, PNG, SATA and many other technologies.
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
for (
|
|
18
|
-
|
|
19
|
-
for (
|
|
15
|
+
const crc32 = (() => {
|
|
16
|
+
const table = [];
|
|
17
|
+
for (let i = 0; i < 256; i++) {
|
|
18
|
+
let c = i;
|
|
19
|
+
for (let j = 0; j < 8; j++) {
|
|
20
20
|
c = c & 1 ? 0xedb88320 ^ c >>> 1 : c >>> 1;
|
|
21
21
|
}
|
|
22
22
|
table.push(c);
|
|
@@ -25,12 +25,12 @@ var crc32 = function () {
|
|
|
25
25
|
str = unescape(encodeURIComponent(str));
|
|
26
26
|
if (!crc) crc = 0;
|
|
27
27
|
crc = crc ^ -1;
|
|
28
|
-
for (
|
|
29
|
-
|
|
28
|
+
for (let i = 0; i < str.length; i++) {
|
|
29
|
+
const y = (crc ^ str.charCodeAt(i)) & 0xff;
|
|
30
30
|
crc = crc >>> 8 ^ table[y];
|
|
31
31
|
}
|
|
32
32
|
crc = crc ^ -1;
|
|
33
33
|
return crc >>> 0;
|
|
34
34
|
};
|
|
35
|
-
}();
|
|
35
|
+
})();
|
|
36
36
|
var _default = exports.default = crc32;
|
|
@@ -16,23 +16,19 @@ governing permissions and limitations under the License.
|
|
|
16
16
|
* Allows callbacks to be registered and then later called. When the
|
|
17
17
|
* callbacks are called, their responses are combined into a single promise.
|
|
18
18
|
*/
|
|
19
|
-
var _default =
|
|
20
|
-
|
|
19
|
+
var _default = () => {
|
|
20
|
+
const callbacks = [];
|
|
21
21
|
return {
|
|
22
|
-
add
|
|
22
|
+
add(callback) {
|
|
23
23
|
callbacks.push(callback);
|
|
24
24
|
},
|
|
25
|
-
call
|
|
26
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
27
|
-
args[_key] = arguments[_key];
|
|
28
|
-
}
|
|
25
|
+
call(...args) {
|
|
29
26
|
// While this utility doesn't necessarily need to be doing the
|
|
30
27
|
// Promise.all, it's currently useful everywhere this is used and
|
|
31
28
|
// reduces repetitive code. We can factor it out later if we want
|
|
32
29
|
// to make this utility more "pure".
|
|
33
|
-
return Promise.all(callbacks.map(
|
|
34
|
-
return callback.apply(void 0, args);
|
|
35
|
-
}));
|
|
30
|
+
return Promise.all(callbacks.map(callback => callback(...args)));
|
|
36
31
|
}
|
|
37
32
|
};
|
|
38
|
-
};
|
|
33
|
+
};
|
|
34
|
+
exports.default = _default;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
var _eventType = require("../constants/eventType.js");
|
|
5
|
+
var _propositionEventType = require("../constants/propositionEventType.js");
|
|
6
|
+
var _index = require("./index.js");
|
|
7
|
+
/*
|
|
8
|
+
Copyright 2020 Adobe. All rights reserved.
|
|
9
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
10
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
11
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
14
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
15
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
16
|
+
governing permissions and limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
var _default = ({
|
|
19
|
+
eventManager,
|
|
20
|
+
mergeDecisionsMeta
|
|
21
|
+
}) => {
|
|
22
|
+
// Called when a decision is auto-rendered for the __view__ scope or a SPA view(display and empty display notification)
|
|
23
|
+
return ({
|
|
24
|
+
decisionsMeta = [],
|
|
25
|
+
propositionAction,
|
|
26
|
+
documentMayUnload = false,
|
|
27
|
+
eventType = _eventType.DISPLAY,
|
|
28
|
+
propositionEventTypes = [(0, _propositionEventType.getPropositionEventType)(eventType)],
|
|
29
|
+
viewName
|
|
30
|
+
}) => {
|
|
31
|
+
const event = eventManager.createEvent();
|
|
32
|
+
const data = {
|
|
33
|
+
eventType
|
|
34
|
+
};
|
|
35
|
+
if (viewName) {
|
|
36
|
+
data.web = {
|
|
37
|
+
webPageDetails: {
|
|
38
|
+
viewName
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
if ((0, _index.isNonEmptyArray)(decisionsMeta)) {
|
|
43
|
+
mergeDecisionsMeta(event, decisionsMeta, propositionEventTypes, propositionAction);
|
|
44
|
+
}
|
|
45
|
+
event.mergeXdm(data);
|
|
46
|
+
if (documentMayUnload) {
|
|
47
|
+
event.documentMayUnload();
|
|
48
|
+
}
|
|
49
|
+
return eventManager.sendEvent(event);
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
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 2022 Adobe. All rights reserved.
|
|
12
6
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -18,16 +12,20 @@ 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
|
-
var _default =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
var _default = ({
|
|
16
|
+
logger,
|
|
17
|
+
cookieJar
|
|
18
|
+
}) => {
|
|
19
|
+
return {
|
|
20
|
+
...cookieJar,
|
|
21
|
+
set(key, value, options) {
|
|
22
|
+
logger.info("Setting cookie", {
|
|
27
23
|
name: key,
|
|
28
|
-
value
|
|
29
|
-
|
|
24
|
+
value,
|
|
25
|
+
...options
|
|
26
|
+
});
|
|
30
27
|
cookieJar.set(key, value, options);
|
|
31
28
|
}
|
|
32
|
-
}
|
|
33
|
-
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
exports.default = _default;
|
|
@@ -21,13 +21,12 @@ governing permissions and limitations under the License.
|
|
|
21
21
|
* can be a dot-notation property path.
|
|
22
22
|
* @returns {Function}
|
|
23
23
|
*/
|
|
24
|
-
var _default =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
24
|
+
var _default = (content, key) => updates => {
|
|
25
|
+
const propertyPath = key.split(".");
|
|
26
|
+
const hostObjectForUpdates = propertyPath.reduce((obj, propertyName) => {
|
|
27
|
+
obj[propertyName] = obj[propertyName] || {};
|
|
28
|
+
return obj[propertyName];
|
|
29
|
+
}, content);
|
|
30
|
+
(0, _deepAssign.default)(hostObjectForUpdates, updates);
|
|
31
|
+
};
|
|
32
|
+
exports.default = _default;
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.default = void 0;
|
|
4
|
-
|
|
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; } /*
|
|
4
|
+
/*
|
|
11
5
|
Copyright 2023 Adobe. All rights reserved.
|
|
12
6
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
13
7
|
you may not use this file except in compliance with the License. You may obtain a copy
|
|
@@ -18,73 +12,79 @@ 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
|
-
|
|
23
|
-
args[_key - 1] = arguments[_key];
|
|
24
|
-
}
|
|
15
|
+
|
|
16
|
+
const defaultPreprocessor = (params, ...args) => {
|
|
25
17
|
return args;
|
|
26
18
|
};
|
|
27
19
|
|
|
28
20
|
// eslint-disable-next-line no-unused-vars
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
var createUnsubscribe = function createUnsubscribe(id) {
|
|
38
|
-
return function () {
|
|
21
|
+
const defaultEmissionCondition = (params, ...args) => true;
|
|
22
|
+
const createSubscription = () => {
|
|
23
|
+
let preprocessor = defaultPreprocessor;
|
|
24
|
+
let emissionCondition = defaultEmissionCondition;
|
|
25
|
+
let counter = 0;
|
|
26
|
+
const subscriptions = {};
|
|
27
|
+
const createUnsubscribe = id => {
|
|
28
|
+
return () => {
|
|
39
29
|
delete subscriptions[id];
|
|
40
30
|
};
|
|
41
31
|
};
|
|
42
|
-
|
|
43
|
-
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
|
|
32
|
+
const add = (callback, params = undefined) => {
|
|
44
33
|
if (typeof callback !== "function") {
|
|
45
|
-
return
|
|
46
|
-
return undefined;
|
|
47
|
-
};
|
|
34
|
+
return () => undefined;
|
|
48
35
|
}
|
|
49
36
|
counter += 1;
|
|
50
37
|
subscriptions[counter] = {
|
|
51
|
-
callback
|
|
52
|
-
params
|
|
38
|
+
callback,
|
|
39
|
+
params
|
|
40
|
+
};
|
|
41
|
+
return {
|
|
42
|
+
id: counter,
|
|
43
|
+
unsubscribe: createUnsubscribe(counter)
|
|
53
44
|
};
|
|
54
|
-
return createUnsubscribe(counter);
|
|
55
45
|
};
|
|
56
|
-
|
|
46
|
+
const setEmissionPreprocessor = value => {
|
|
57
47
|
if (typeof value === "function") {
|
|
58
48
|
preprocessor = value;
|
|
59
49
|
}
|
|
60
50
|
};
|
|
61
|
-
|
|
51
|
+
const setEmissionCondition = value => {
|
|
62
52
|
if (typeof value === "function") {
|
|
63
53
|
emissionCondition = value;
|
|
64
54
|
}
|
|
65
55
|
};
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
if (emissionCondition.apply(void 0, [params].concat(_toConsumableArray(result)))) {
|
|
75
|
-
callback.apply(void 0, _toConsumableArray(result));
|
|
56
|
+
const emit = (...args) => {
|
|
57
|
+
Object.values(subscriptions).forEach(({
|
|
58
|
+
callback,
|
|
59
|
+
params
|
|
60
|
+
}) => {
|
|
61
|
+
const result = preprocessor(params, ...args);
|
|
62
|
+
if (emissionCondition(params, ...result)) {
|
|
63
|
+
callback(...result);
|
|
76
64
|
}
|
|
77
65
|
});
|
|
78
66
|
};
|
|
79
|
-
|
|
80
|
-
|
|
67
|
+
const emitOne = (subscriptionId, ...args) => {
|
|
68
|
+
if (!subscriptionId || !subscriptions[subscriptionId]) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const {
|
|
72
|
+
callback,
|
|
73
|
+
params
|
|
74
|
+
} = subscriptions[subscriptionId];
|
|
75
|
+
const result = preprocessor(params, ...args);
|
|
76
|
+
if (emissionCondition(params, ...result)) {
|
|
77
|
+
callback(...result);
|
|
78
|
+
}
|
|
81
79
|
};
|
|
80
|
+
const hasSubscriptions = () => Object.keys(subscriptions).length > 0;
|
|
82
81
|
return {
|
|
83
|
-
add
|
|
84
|
-
emit
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
82
|
+
add,
|
|
83
|
+
emit,
|
|
84
|
+
emitOne,
|
|
85
|
+
hasSubscriptions,
|
|
86
|
+
setEmissionPreprocessor,
|
|
87
|
+
setEmissionCondition
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
90
|
var _default = exports.default = createSubscription;
|
|
@@ -15,9 +15,9 @@ governing permissions and limitations under the License.
|
|
|
15
15
|
/**
|
|
16
16
|
* Sequences tasks.
|
|
17
17
|
*/
|
|
18
|
-
var _default =
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
var _default = () => {
|
|
19
|
+
let queueLength = 0;
|
|
20
|
+
let lastPromiseInQueue = Promise.resolve();
|
|
21
21
|
return {
|
|
22
22
|
/**
|
|
23
23
|
* Add a task to the queue. If no task is currenty running,
|
|
@@ -28,10 +28,10 @@ var _default = exports.default = function _default() {
|
|
|
28
28
|
* @returns {Promise} A promise that will be resolved or rejected
|
|
29
29
|
* with whatever value the task resolved or rejects its promise.
|
|
30
30
|
*/
|
|
31
|
-
addTask
|
|
31
|
+
addTask(task) {
|
|
32
32
|
queueLength += 1;
|
|
33
|
-
|
|
34
|
-
return task().finally(
|
|
33
|
+
const lastPromiseFulfilledHandler = () => {
|
|
34
|
+
return task().finally(() => {
|
|
35
35
|
queueLength -= 1;
|
|
36
36
|
});
|
|
37
37
|
};
|
|
@@ -47,4 +47,5 @@ var _default = exports.default = function _default() {
|
|
|
47
47
|
return queueLength;
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
|
-
};
|
|
50
|
+
};
|
|
51
|
+
exports.default = _default;
|