@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
package/scripts/alloyBuilder.js
CHANGED
|
@@ -17,48 +17,63 @@ import { rollup } from "rollup";
|
|
|
17
17
|
import { Command, Option, InvalidOptionArgumentError } from "commander";
|
|
18
18
|
import inquirer from "inquirer";
|
|
19
19
|
import { fileURLToPath } from "url";
|
|
20
|
+
import babel from "@babel/core";
|
|
20
21
|
import { buildConfig } from "../rollup.config.js";
|
|
21
|
-
import
|
|
22
|
-
import components from "./helpers/alloyComponents.js";
|
|
22
|
+
import entryPointGeneratorBabelPlugin from "./helpers/entryPointGeneratorBabelPlugin.js";
|
|
23
23
|
|
|
24
24
|
const dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
25
25
|
|
|
26
|
+
const packageJsonContent = fs.readFileSync(
|
|
27
|
+
`${dirname}/../package.json`,
|
|
28
|
+
"utf8",
|
|
29
|
+
);
|
|
30
|
+
const { version } = JSON.parse(packageJsonContent);
|
|
31
|
+
|
|
26
32
|
let sourceRootPath = `${dirname}/../src`;
|
|
27
33
|
if (!fs.existsSync(sourceRootPath)) {
|
|
28
34
|
sourceRootPath = `${dirname}/../libEs6`;
|
|
29
35
|
}
|
|
30
36
|
|
|
31
|
-
const
|
|
32
|
-
const componentCreatorsPath = `${sourceRootPath}/core/componentCreators.js`;
|
|
37
|
+
const arrayDifference = (arr1, arr2) => arr1.filter((x) => !arr2.includes(x));
|
|
33
38
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
const camelCaseToTitleCase = (str) => {
|
|
40
|
+
return str.replace(/([A-Z])/g, " $1").replace(/^./, (s) => s.toUpperCase());
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const getComponents = (() => {
|
|
44
|
+
const components = {};
|
|
45
|
+
[
|
|
46
|
+
{
|
|
47
|
+
filePath: `${sourceRootPath}/core/componentCreators.js`,
|
|
48
|
+
key: "optional",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
filePath: `${sourceRootPath}/core/requiredComponentCreators.js`,
|
|
52
|
+
key: "required",
|
|
53
|
+
},
|
|
54
|
+
].forEach(({ filePath, key }) => {
|
|
55
|
+
const code = fs.readFileSync(filePath, "utf-8");
|
|
56
|
+
const c = [];
|
|
57
|
+
|
|
58
|
+
babel.traverse(babel.parse(code), {
|
|
59
|
+
Identifier(p) {
|
|
60
|
+
if (p.node.name !== "default") {
|
|
61
|
+
c.push(p.node.name);
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
});
|
|
39
65
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
.map((line) => {
|
|
45
|
-
const match = line.match(/ENV\.alloy_([a-zA-Z0-9]+) === false/);
|
|
46
|
-
if (match) {
|
|
47
|
-
const [, componentName] = match;
|
|
48
|
-
return componentName.toLowerCase(); // Ensure this matches the expected format for exclusion
|
|
49
|
-
}
|
|
50
|
-
return null;
|
|
51
|
-
})
|
|
52
|
-
.filter(Boolean);
|
|
53
|
-
|
|
54
|
-
return () => optionalComponents;
|
|
66
|
+
components[key] = c;
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
return () => components;
|
|
55
70
|
})();
|
|
56
71
|
|
|
57
72
|
const getDefaultPath = () => {
|
|
58
73
|
return process.cwd();
|
|
59
74
|
};
|
|
60
75
|
|
|
61
|
-
const
|
|
76
|
+
const getOutputFilePath = (argv) => {
|
|
62
77
|
return `${[argv.outputDir, `alloy${argv.minify ? ".min" : ""}.js`].join(path.sep)}`;
|
|
63
78
|
};
|
|
64
79
|
|
|
@@ -68,23 +83,41 @@ const getFileSizeInKB = (filePath) => {
|
|
|
68
83
|
return `${(fileSizeInBytes / 1024).toFixed(2)} K`;
|
|
69
84
|
};
|
|
70
85
|
|
|
86
|
+
const generateInputEntryFile = ({
|
|
87
|
+
inputPath,
|
|
88
|
+
outputFile = "input.js",
|
|
89
|
+
includedModules,
|
|
90
|
+
}) => {
|
|
91
|
+
const output = babel.transformFileSync(inputPath, {
|
|
92
|
+
plugins: [entryPointGeneratorBabelPlugin(babel.types, includedModules)],
|
|
93
|
+
}).code;
|
|
94
|
+
|
|
95
|
+
const destinationDirectory = path.dirname(inputPath);
|
|
96
|
+
const outputPath = path.join(destinationDirectory, outputFile);
|
|
97
|
+
|
|
98
|
+
fs.writeFileSync(outputPath, output);
|
|
99
|
+
|
|
100
|
+
return outputPath;
|
|
101
|
+
};
|
|
102
|
+
|
|
71
103
|
const build = async (argv) => {
|
|
104
|
+
const input = generateInputEntryFile({
|
|
105
|
+
inputPath: `${sourceRootPath}/standalone.js`,
|
|
106
|
+
includedModules: argv.include,
|
|
107
|
+
});
|
|
108
|
+
|
|
72
109
|
const rollupConfig = buildConfig({
|
|
73
|
-
|
|
74
|
-
|
|
110
|
+
variant: "CUSTOM_BUILD",
|
|
111
|
+
input,
|
|
112
|
+
file: getOutputFilePath(argv),
|
|
75
113
|
minify: argv.minify,
|
|
76
|
-
babelPlugins: [
|
|
77
|
-
conditionalBuildBabelPlugin(
|
|
78
|
-
argv.exclude.reduce((acc, module) => {
|
|
79
|
-
acc[`alloy_${module}`] = "false";
|
|
80
|
-
return acc;
|
|
81
|
-
}, {}),
|
|
82
|
-
),
|
|
83
|
-
],
|
|
84
114
|
});
|
|
85
115
|
|
|
86
116
|
const bundle = await rollup(rollupConfig);
|
|
87
117
|
await bundle.write(rollupConfig.output[0]);
|
|
118
|
+
|
|
119
|
+
fs.unlinkSync(input);
|
|
120
|
+
|
|
88
121
|
console.log(
|
|
89
122
|
`🎉 Wrote ${
|
|
90
123
|
path.isAbsolute(argv.outputDir)
|
|
@@ -94,23 +127,24 @@ const build = async (argv) => {
|
|
|
94
127
|
);
|
|
95
128
|
};
|
|
96
129
|
|
|
97
|
-
const getMakeBuildCommand = () =>
|
|
98
|
-
|
|
130
|
+
const getMakeBuildCommand = () => {
|
|
131
|
+
const optionalComponentsParameters = getComponents().optional;
|
|
132
|
+
return new Command("build")
|
|
99
133
|
.description("Build a custom version of the alloy.js library.")
|
|
100
134
|
.addOption(
|
|
101
135
|
new Option(
|
|
102
136
|
"-e, --exclude <modules...>",
|
|
103
137
|
"optional components that can be excluded from the build",
|
|
104
138
|
)
|
|
105
|
-
.choices(
|
|
139
|
+
.choices(optionalComponentsParameters)
|
|
106
140
|
.default([])
|
|
107
141
|
.argParser((value) => {
|
|
108
142
|
const modules = value.split(",");
|
|
109
143
|
|
|
110
144
|
modules.forEach((module) => {
|
|
111
|
-
if (!
|
|
145
|
+
if (!optionalComponentsParameters.includes(module))
|
|
112
146
|
throw new InvalidOptionArgumentError(
|
|
113
|
-
`Module "${module}" does not exists. Allowed choices are "${
|
|
147
|
+
`Module "${module}" does not exists. Allowed choices are "${optionalComponentsParameters.join('", "')}".`,
|
|
114
148
|
);
|
|
115
149
|
});
|
|
116
150
|
|
|
@@ -145,9 +179,15 @@ const getMakeBuildCommand = () =>
|
|
|
145
179
|
return value.replace(new RegExp(`${path.sep}+$`, "g"), "");
|
|
146
180
|
}),
|
|
147
181
|
)
|
|
148
|
-
.action(
|
|
149
|
-
|
|
182
|
+
.action((opts) => {
|
|
183
|
+
const { exclude } = opts;
|
|
184
|
+
const optionalComponents = getComponents().optional;
|
|
185
|
+
delete opts.exclude;
|
|
186
|
+
|
|
187
|
+
opts.include = arrayDifference(optionalComponents, exclude);
|
|
188
|
+
return build(opts);
|
|
150
189
|
});
|
|
190
|
+
};
|
|
151
191
|
|
|
152
192
|
const getInteractiveBuildCommand = () =>
|
|
153
193
|
new Command("interactive-build")
|
|
@@ -161,7 +201,11 @@ const getInteractiveBuildCommand = () =>
|
|
|
161
201
|
type: "checkbox",
|
|
162
202
|
name: "include",
|
|
163
203
|
message: "What components should be included in your Alloy build?",
|
|
164
|
-
choices:
|
|
204
|
+
choices: getComponents().optional.map((value) => ({
|
|
205
|
+
name: camelCaseToTitleCase(value),
|
|
206
|
+
checked: true,
|
|
207
|
+
value,
|
|
208
|
+
})),
|
|
165
209
|
},
|
|
166
210
|
{
|
|
167
211
|
type: "list",
|
|
@@ -179,17 +223,7 @@ const getInteractiveBuildCommand = () =>
|
|
|
179
223
|
default: process.cwd(),
|
|
180
224
|
},
|
|
181
225
|
])
|
|
182
|
-
.then(async (opts) =>
|
|
183
|
-
const { include } = opts;
|
|
184
|
-
const exclude = components
|
|
185
|
-
.map((v) => v.value)
|
|
186
|
-
.filter((component) => !include.includes(component));
|
|
187
|
-
|
|
188
|
-
opts.exclude = exclude;
|
|
189
|
-
delete opts.include;
|
|
190
|
-
|
|
191
|
-
await build(opts);
|
|
192
|
-
})
|
|
226
|
+
.then(async (opts) => build(opts))
|
|
193
227
|
.catch((error) => {
|
|
194
228
|
if (error.isTtyError) {
|
|
195
229
|
console.error(
|
|
@@ -208,7 +242,7 @@ program
|
|
|
208
242
|
.description(
|
|
209
243
|
"Tool for generating custom Adobe Experience Platform Web SDK builds.",
|
|
210
244
|
)
|
|
211
|
-
.version(
|
|
245
|
+
.version(version);
|
|
212
246
|
|
|
213
247
|
program.addCommand(getMakeBuildCommand());
|
|
214
248
|
program.addCommand(getInteractiveBuildCommand(), { isDefault: true });
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2023 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export default (t, includedModules) => ({
|
|
14
|
+
visitor: {
|
|
15
|
+
CallExpression(path) {
|
|
16
|
+
if (path.node.callee.name === "core") {
|
|
17
|
+
path.replaceWith(
|
|
18
|
+
t.CallExpression(t.Identifier("core"), [
|
|
19
|
+
t.ObjectExpression([
|
|
20
|
+
t.ObjectProperty(
|
|
21
|
+
t.Identifier("components"),
|
|
22
|
+
t.ArrayExpression(
|
|
23
|
+
includedModules.map((module) =>
|
|
24
|
+
t.MemberExpression(
|
|
25
|
+
t.Identifier("components"),
|
|
26
|
+
t.Identifier(module),
|
|
27
|
+
),
|
|
28
|
+
),
|
|
29
|
+
),
|
|
30
|
+
),
|
|
31
|
+
]),
|
|
32
|
+
]),
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
path.stop();
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
});
|
|
@@ -1,53 +0,0 @@
|
|
|
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("../../utils/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 = exports.default = function _default(_ref) {
|
|
19
|
-
var eventManager = _ref.eventManager,
|
|
20
|
-
mergeDecisionsMeta = _ref.mergeDecisionsMeta;
|
|
21
|
-
// Called when a decision is auto-rendered for the __view__ scope or a SPA view(display and empty display notification)
|
|
22
|
-
return function (_ref2) {
|
|
23
|
-
var _ref2$decisionsMeta = _ref2.decisionsMeta,
|
|
24
|
-
decisionsMeta = _ref2$decisionsMeta === void 0 ? [] : _ref2$decisionsMeta,
|
|
25
|
-
propositionAction = _ref2.propositionAction,
|
|
26
|
-
_ref2$documentMayUnlo = _ref2.documentMayUnload,
|
|
27
|
-
documentMayUnload = _ref2$documentMayUnlo === void 0 ? false : _ref2$documentMayUnlo,
|
|
28
|
-
_ref2$eventType = _ref2.eventType,
|
|
29
|
-
eventType = _ref2$eventType === void 0 ? _eventType.DISPLAY : _ref2$eventType,
|
|
30
|
-
_ref2$propositionEven = _ref2.propositionEventTypes,
|
|
31
|
-
propositionEventTypes = _ref2$propositionEven === void 0 ? [(0, _propositionEventType.getPropositionEventType)(eventType)] : _ref2$propositionEven,
|
|
32
|
-
viewName = _ref2.viewName;
|
|
33
|
-
var event = eventManager.createEvent();
|
|
34
|
-
var data = {
|
|
35
|
-
eventType: eventType
|
|
36
|
-
};
|
|
37
|
-
if (viewName) {
|
|
38
|
-
data.web = {
|
|
39
|
-
webPageDetails: {
|
|
40
|
-
viewName: viewName
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
if ((0, _index.isNonEmptyArray)(decisionsMeta)) {
|
|
45
|
-
mergeDecisionsMeta(event, decisionsMeta, propositionEventTypes, propositionAction);
|
|
46
|
-
}
|
|
47
|
-
event.mergeXdm(data);
|
|
48
|
-
if (documentMayUnload) {
|
|
49
|
-
event.documentMayUnload();
|
|
50
|
-
}
|
|
51
|
-
return eventManager.sendEvent(event);
|
|
52
|
-
};
|
|
53
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.mergeQuery = exports.mergeDecisionsMeta = void 0;
|
|
4
|
-
var _eventType = require("../../constants/eventType.js");
|
|
5
|
-
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); }
|
|
6
|
-
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; }
|
|
7
|
-
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; }
|
|
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); } /*
|
|
11
|
-
Copyright 2019 Adobe. All rights reserved.
|
|
12
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
13
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
14
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
-
|
|
16
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
17
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
18
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
19
|
-
governing permissions and limitations under the License.
|
|
20
|
-
*/
|
|
21
|
-
/* eslint-disable no-underscore-dangle */
|
|
22
|
-
var mergeDecisionsMeta = exports.mergeDecisionsMeta = function mergeDecisionsMeta(event, decisionsMeta, propositionEventTypes, propositionAction) {
|
|
23
|
-
// Do not send a display notification with no decisions. Even empty view changes
|
|
24
|
-
// should include a proposition.
|
|
25
|
-
if (decisionsMeta.length === 0) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
var propositionEventType = {};
|
|
29
|
-
propositionEventTypes.forEach(function (type) {
|
|
30
|
-
propositionEventType[type] = _eventType.EVENT_TYPE_TRUE;
|
|
31
|
-
});
|
|
32
|
-
var xdm = {
|
|
33
|
-
_experience: {
|
|
34
|
-
decisioning: {
|
|
35
|
-
propositions: decisionsMeta,
|
|
36
|
-
propositionEventType: propositionEventType
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
if (propositionAction) {
|
|
41
|
-
xdm._experience.decisioning.propositionAction = propositionAction;
|
|
42
|
-
}
|
|
43
|
-
event.mergeXdm(xdm);
|
|
44
|
-
};
|
|
45
|
-
var mergeQuery = exports.mergeQuery = function mergeQuery(event, details) {
|
|
46
|
-
event.mergeQuery({
|
|
47
|
-
personalization: _objectSpread({}, details)
|
|
48
|
-
});
|
|
49
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.default = void 0;
|
|
4
|
-
/*
|
|
5
|
-
Copyright 2019 Adobe. All rights reserved.
|
|
6
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
8
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
11
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
|
-
governing permissions and limitations under the License.
|
|
14
|
-
*/
|
|
15
|
-
var _default = exports.default = function _default(_ref) {
|
|
16
|
-
var XMLHttpRequest = _ref.XMLHttpRequest;
|
|
17
|
-
return function (url, body) {
|
|
18
|
-
return new Promise(function (resolve, reject) {
|
|
19
|
-
var request = new XMLHttpRequest();
|
|
20
|
-
request.onreadystatechange = function () {
|
|
21
|
-
if (request.readyState === 4) {
|
|
22
|
-
if (request.status === 0) {
|
|
23
|
-
reject(new Error("Request aborted."));
|
|
24
|
-
} else {
|
|
25
|
-
resolve({
|
|
26
|
-
statusCode: request.status,
|
|
27
|
-
// We expose headers through a function instead of creating an object
|
|
28
|
-
// with all the headers up front because:
|
|
29
|
-
// 1. It avoids having to add header parsing code to get all headers.
|
|
30
|
-
// 2. The native request.getResponseHeader method is case-insensitive.
|
|
31
|
-
getHeader: function getHeader(name) {
|
|
32
|
-
return request.getResponseHeader(name);
|
|
33
|
-
},
|
|
34
|
-
body: request.responseText
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
request.onloadstart = function () {
|
|
40
|
-
request.responseType = "text";
|
|
41
|
-
};
|
|
42
|
-
request.open("POST", url, true);
|
|
43
|
-
request.setRequestHeader("Content-Type", "text/plain; charset=UTF-8");
|
|
44
|
-
request.withCredentials = true;
|
|
45
|
-
request.onerror = reject;
|
|
46
|
-
request.onabort = reject;
|
|
47
|
-
request.send(body);
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
};
|
package/libEs5/utils/assign.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.default = void 0;
|
|
4
|
-
var _reactorObjectAssign = require("@adobe/reactor-object-assign");
|
|
5
|
-
/*
|
|
6
|
-
Copyright 2019 Adobe. All rights reserved.
|
|
7
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
9
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
|
|
11
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
12
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
13
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
14
|
-
governing permissions and limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
var _default = exports.default = _reactorObjectAssign.default;
|
package/libEs5/utils/assignIf.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.default = void 0;
|
|
4
|
-
var _assign = require("./assign.js");
|
|
5
|
-
/*
|
|
6
|
-
Copyright 2019 Adobe. All rights reserved.
|
|
7
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
9
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
|
|
11
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
12
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
13
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
14
|
-
governing permissions and limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
var _default = exports.default = function _default(target, source, predicate) {
|
|
17
|
-
if (predicate()) {
|
|
18
|
-
(0, _assign.default)(target, source);
|
|
19
|
-
}
|
|
20
|
-
return target;
|
|
21
|
-
};
|
package/libEs5/utils/endsWith.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.default = void 0;
|
|
4
|
-
/*
|
|
5
|
-
Copyright 2019 Adobe. All rights reserved.
|
|
6
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
8
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
11
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
|
-
governing permissions and limitations under the License.
|
|
14
|
-
*/
|
|
15
|
-
/**
|
|
16
|
-
* Whether a string ends with the characters of a specified string
|
|
17
|
-
* @param {String} str The string to search within.
|
|
18
|
-
* @param {String} suffix The string to search for.
|
|
19
|
-
* @returns {boolean}
|
|
20
|
-
*/
|
|
21
|
-
var _default = exports.default = function _default(str, suffix) {
|
|
22
|
-
return str.substr(-suffix.length) === suffix;
|
|
23
|
-
};
|
package/libEs5/utils/find.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.default = void 0;
|
|
4
|
-
/*
|
|
5
|
-
Copyright 2019 Adobe. All rights reserved.
|
|
6
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
8
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
11
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
|
-
governing permissions and limitations under the License.
|
|
14
|
-
*/
|
|
15
|
-
/**
|
|
16
|
-
* Returns the first item in the array that satisfies the provided testing function.
|
|
17
|
-
* @param {Array} arr The array to search.
|
|
18
|
-
* @param {Function} predicate Function that will be called for each item. Arguments
|
|
19
|
-
* will be the item, the item index, then the array itself.
|
|
20
|
-
* @returns {*}
|
|
21
|
-
*/
|
|
22
|
-
var _default = exports.default = function _default(arr, predicate) {
|
|
23
|
-
for (var i = 0; i < arr.length; i += 1) {
|
|
24
|
-
var item = arr[i];
|
|
25
|
-
if (predicate(item, i, arr)) {
|
|
26
|
-
return item;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return undefined;
|
|
30
|
-
};
|
package/libEs5/utils/flatMap.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.default = void 0;
|
|
4
|
-
/*
|
|
5
|
-
Copyright 2019 Adobe. All rights reserved.
|
|
6
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
8
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
11
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
|
-
governing permissions and limitations under the License.
|
|
14
|
-
*/
|
|
15
|
-
var _default = exports.default = function _default(array, mapFunction) {
|
|
16
|
-
return Array.prototype.concat.apply([], array.map(mapFunction));
|
|
17
|
-
};
|
package/libEs5/utils/includes.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.default = void 0;
|
|
4
|
-
/*
|
|
5
|
-
Copyright 2019 Adobe. All rights reserved.
|
|
6
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
8
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
11
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
|
-
governing permissions and limitations under the License.
|
|
14
|
-
*/
|
|
15
|
-
/**
|
|
16
|
-
* Determines whether an array includes a certain value.
|
|
17
|
-
* @param {Array} arr Array to search.
|
|
18
|
-
* @param {*} item The item for which to search.
|
|
19
|
-
* @returns {boolean}
|
|
20
|
-
*/
|
|
21
|
-
var _default = exports.default = function _default(arr, item) {
|
|
22
|
-
return arr.indexOf(item) !== -1;
|
|
23
|
-
};
|
package/libEs5/utils/padStart.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.default = void 0;
|
|
4
|
-
/*
|
|
5
|
-
Copyright 2019 Adobe. All rights reserved.
|
|
6
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
8
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
11
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
|
-
governing permissions and limitations under the License.
|
|
14
|
-
*/
|
|
15
|
-
// adapted from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart
|
|
16
|
-
var _default = exports.default = function _default(string, targetLength, padString) {
|
|
17
|
-
var originalString = String(string);
|
|
18
|
-
var repeatedPadString = String(padString);
|
|
19
|
-
if (originalString.length >= targetLength || repeatedPadString.length === 0) {
|
|
20
|
-
return originalString;
|
|
21
|
-
}
|
|
22
|
-
var lengthToAdd = targetLength - originalString.length;
|
|
23
|
-
while (lengthToAdd > repeatedPadString.length) {
|
|
24
|
-
repeatedPadString += repeatedPadString;
|
|
25
|
-
}
|
|
26
|
-
return repeatedPadString.slice(0, lengthToAdd) + originalString;
|
|
27
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.default = void 0;
|
|
4
|
-
/*
|
|
5
|
-
Copyright 2021 Adobe. All rights reserved.
|
|
6
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
8
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
11
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
|
-
governing permissions and limitations under the License.
|
|
14
|
-
*/
|
|
15
|
-
/**
|
|
16
|
-
* Whether a string starts with the characters of a specified string
|
|
17
|
-
* @param {String} str The string to search within.
|
|
18
|
-
* @param {String} prefix The string to search for.
|
|
19
|
-
* @returns {boolean}
|
|
20
|
-
*/
|
|
21
|
-
var _default = exports.default = function _default(str, prefix) {
|
|
22
|
-
return str.substr(0, prefix.length) === prefix;
|
|
23
|
-
};
|
package/libEs5/utils/values.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.default = void 0;
|
|
4
|
-
/*
|
|
5
|
-
Copyright 2019 Adobe. All rights reserved.
|
|
6
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
8
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
11
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
|
-
governing permissions and limitations under the License.
|
|
14
|
-
*/
|
|
15
|
-
/**
|
|
16
|
-
* Returns an array whose items are the provided object's own enumerable
|
|
17
|
-
* property values.
|
|
18
|
-
* @param {Object} obj
|
|
19
|
-
* @returns {Array}
|
|
20
|
-
*/
|
|
21
|
-
var _default = exports.default = function _default(obj) {
|
|
22
|
-
return Object.keys(obj).map(function (key) {
|
|
23
|
-
return obj[key];
|
|
24
|
-
});
|
|
25
|
-
};
|