@adobe/alloy 2.20.0-alpha.1 → 2.20.0-beta.2
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/package.json +83 -65
- package/libEs5/baseCode/index.js +0 -62
- package/libEs5/components/ActivityCollector/attachClickActivityCollector.js +0 -54
- package/libEs5/components/ActivityCollector/configValidators.js +0 -24
- package/libEs5/components/ActivityCollector/createGetLinkDetails.js +0 -69
- package/libEs5/components/ActivityCollector/createLinkClick.js +0 -39
- package/libEs5/components/ActivityCollector/getLinkName.js +0 -140
- package/libEs5/components/ActivityCollector/getLinkRegion.js +0 -62
- package/libEs5/components/ActivityCollector/index.js +0 -79
- package/libEs5/components/ActivityCollector/utils.js +0 -114
- package/libEs5/components/Audiences/index.js +0 -50
- package/libEs5/components/Audiences/injectProcessDestinations.js +0 -65
- package/libEs5/components/Audiences/injectProcessResponse.js +0 -39
- package/libEs5/components/Context/createComponent.js +0 -40
- package/libEs5/components/Context/implementationDetails.js +0 -28
- package/libEs5/components/Context/index.js +0 -57
- package/libEs5/components/Context/injectDevice.js +0 -67
- package/libEs5/components/Context/injectEnvironment.js +0 -41
- package/libEs5/components/Context/injectHighEntropyUserAgentHints.js +0 -59
- package/libEs5/components/Context/injectPlaceContext.js +0 -33
- package/libEs5/components/Context/injectTimestamp.js +0 -24
- package/libEs5/components/Context/injectWeb.js +0 -31
- package/libEs5/components/DataCollector/index.js +0 -111
- package/libEs5/components/DataCollector/validateApplyResponse.js +0 -36
- package/libEs5/components/DataCollector/validateUserEventOptions.js +0 -51
- package/libEs5/components/DecisioningEngine/consequenceAdapters/inAppMessageConsequenceAdapter.js +0 -32
- package/libEs5/components/DecisioningEngine/consequenceAdapters/schemaTypeConsequenceAdapter.js +0 -25
- package/libEs5/components/DecisioningEngine/constants.js +0 -31
- package/libEs5/components/DecisioningEngine/createApplyResponse.js +0 -36
- package/libEs5/components/DecisioningEngine/createConsequenceAdapter.js +0 -29
- package/libEs5/components/DecisioningEngine/createContextProvider.js +0 -93
- package/libEs5/components/DecisioningEngine/createDecisionHistory.js +0 -28
- package/libEs5/components/DecisioningEngine/createDecisionProvider.js +0 -51
- package/libEs5/components/DecisioningEngine/createEvaluableRulesetPayload.js +0 -80
- package/libEs5/components/DecisioningEngine/createEvaluateRulesetsCommand.js +0 -49
- package/libEs5/components/DecisioningEngine/createEventRegistry.js +0 -130
- package/libEs5/components/DecisioningEngine/createOnResponseHandler.js +0 -46
- package/libEs5/components/DecisioningEngine/createSubscribeRulesetItems.js +0 -87
- package/libEs5/components/DecisioningEngine/index.js +0 -119
- package/libEs5/components/DecisioningEngine/utils.js +0 -90
- package/libEs5/components/EventMerge/createComponent.js +0 -25
- package/libEs5/components/EventMerge/createEventMergeId.js +0 -21
- package/libEs5/components/EventMerge/index.js +0 -25
- package/libEs5/components/Identity/addEcidQueryToPayload.js +0 -23
- package/libEs5/components/Identity/addEcidToPayload.js +0 -21
- package/libEs5/components/Identity/appendIdentityToUrl/appendIdentityToUrlOptionsValidator.js +0 -26
- package/libEs5/components/Identity/appendIdentityToUrl/injectAppendIdentityToUrl.js +0 -46
- package/libEs5/components/Identity/configValidators.js +0 -22
- package/libEs5/components/Identity/constants/authState.js +0 -21
- package/libEs5/components/Identity/constants/defaultIdSyncTtlMinutes.js +0 -16
- package/libEs5/components/Identity/createComponent.js +0 -98
- package/libEs5/components/Identity/createLegacyIdentity.js +0 -70
- package/libEs5/components/Identity/getEcidFromResponse.js +0 -24
- package/libEs5/components/Identity/getIdentity/createGetIdentity.js +0 -36
- package/libEs5/components/Identity/getIdentity/createIdentityRequest.js +0 -30
- package/libEs5/components/Identity/getIdentity/createIdentityRequestPayload.js +0 -30
- package/libEs5/components/Identity/getIdentity/getIdentityOptionsValidator.js +0 -28
- package/libEs5/components/Identity/index.js +0 -129
- package/libEs5/components/Identity/injectAddLegacyEcidToPayload.js +0 -32
- package/libEs5/components/Identity/injectAddQueryStringIdentityToPayload.js +0 -65
- package/libEs5/components/Identity/injectAwaitIdentityCookie.js +0 -57
- package/libEs5/components/Identity/injectEnsureSingleIdentity.js +0 -98
- package/libEs5/components/Identity/injectHandleResponseForIdSyncs.js +0 -21
- package/libEs5/components/Identity/injectProcessIdSyncs.js +0 -42
- package/libEs5/components/Identity/injectSetDomainForInitialIdentityPayload.js +0 -34
- package/libEs5/components/Identity/visitorService/awaitVisitorOptIn.js +0 -35
- package/libEs5/components/Identity/visitorService/getVisitor.js +0 -20
- package/libEs5/components/Identity/visitorService/injectGetEcidFromVisitor.js +0 -50
- package/libEs5/components/LegacyMediaAnalytics/createMediaAnalyticsTracker.js +0 -272
- package/libEs5/components/LegacyMediaAnalytics/createMediaHelper.js +0 -188
- package/libEs5/components/LegacyMediaAnalytics/index.js +0 -48
- package/libEs5/components/LegacyMediaAnalytics/media/constants.js +0 -154
- package/libEs5/components/LegacyMediaAnalytics/media/mediaKeysToXdmConverter.js +0 -51
- package/libEs5/components/LibraryInfo/index.js +0 -64
- package/libEs5/components/MachineLearning/index.js +0 -27
- package/libEs5/components/MachineLearning/processResponse.js +0 -20
- package/libEs5/components/MediaCollection/constants/eventTypes.js +0 -25
- package/libEs5/components/MediaCollection/createHeartbeatEngine.js +0 -63
- package/libEs5/components/MediaCollection/createMediaEventManager.js +0 -109
- package/libEs5/components/MediaCollection/createMediaRequest.js +0 -30
- package/libEs5/components/MediaCollection/createMediaSessionCacheManager.js +0 -62
- package/libEs5/components/MediaCollection/createUpdateMediaSessionState.js +0 -31
- package/libEs5/components/MediaCollection/index.js +0 -165
- package/libEs5/components/MediaCollection/validateMediaEventOptions.js +0 -35
- package/libEs5/components/MediaCollection/validateMediaSessionOptions.js +0 -36
- package/libEs5/components/Personalization/constants/loggerMessage.js +0 -18
- package/libEs5/components/Personalization/constants/scopeType.js +0 -21
- package/libEs5/components/Personalization/constants/surface.js +0 -23
- package/libEs5/components/Personalization/createActionsProvider.js +0 -72
- package/libEs5/components/Personalization/createApplyPropositions.js +0 -113
- package/libEs5/components/Personalization/createClickStorage.js +0 -62
- package/libEs5/components/Personalization/createCollect.js +0 -54
- package/libEs5/components/Personalization/createComponent.js +0 -142
- package/libEs5/components/Personalization/createFetchDataHandler.js +0 -84
- package/libEs5/components/Personalization/createGetPageLocation.js +0 -21
- package/libEs5/components/Personalization/createNotificationHandler.js +0 -33
- package/libEs5/components/Personalization/createOnClickHandler.js +0 -52
- package/libEs5/components/Personalization/createOnDecisionHandler.js +0 -44
- package/libEs5/components/Personalization/createPersonalizationDetails.js +0 -105
- package/libEs5/components/Personalization/createPreprocessors.js +0 -21
- package/libEs5/components/Personalization/createSetTargetMigration.js +0 -29
- package/libEs5/components/Personalization/createViewCacheManager.js +0 -91
- package/libEs5/components/Personalization/createViewChangeHandler.js +0 -46
- package/libEs5/components/Personalization/dom-actions/action.js +0 -121
- package/libEs5/components/Personalization/dom-actions/addNonceToInlineStyleElements.js +0 -42
- package/libEs5/components/Personalization/dom-actions/appendHtml.js +0 -33
- package/libEs5/components/Personalization/dom-actions/clicks/collectClicks.js +0 -109
- package/libEs5/components/Personalization/dom-actions/createPreprocess.js +0 -26
- package/libEs5/components/Personalization/dom-actions/createRedirect.js +0 -30
- package/libEs5/components/Personalization/dom-actions/dom/createFragment.js +0 -22
- package/libEs5/components/Personalization/dom-actions/dom/getAttribute.js +0 -18
- package/libEs5/components/Personalization/dom-actions/dom/getChildNodes.js +0 -23
- package/libEs5/components/Personalization/dom-actions/dom/getChildren.js +0 -23
- package/libEs5/components/Personalization/dom-actions/dom/getElementById.js +0 -25
- package/libEs5/components/Personalization/dom-actions/dom/getFirstChild.js +0 -18
- package/libEs5/components/Personalization/dom-actions/dom/getNextSibling.js +0 -18
- package/libEs5/components/Personalization/dom-actions/dom/getNonce.js +0 -37
- package/libEs5/components/Personalization/dom-actions/dom/getParent.js +0 -18
- package/libEs5/components/Personalization/dom-actions/dom/helperForEq.js +0 -26
- package/libEs5/components/Personalization/dom-actions/dom/index.js +0 -100
- package/libEs5/components/Personalization/dom-actions/dom/insertAfter.js +0 -26
- package/libEs5/components/Personalization/dom-actions/dom/insertBefore.js +0 -25
- package/libEs5/components/Personalization/dom-actions/dom/matchesSelectorWithEq.js +0 -38
- package/libEs5/components/Personalization/dom-actions/dom/removeAttribute.js +0 -18
- package/libEs5/components/Personalization/dom-actions/dom/selectNodesWithEq.js +0 -107
- package/libEs5/components/Personalization/dom-actions/dom/setAttribute.js +0 -18
- package/libEs5/components/Personalization/dom-actions/dom/setStyle.js +0 -24
- package/libEs5/components/Personalization/dom-actions/images.js +0 -39
- package/libEs5/components/Personalization/dom-actions/index.js +0 -9
- package/libEs5/components/Personalization/dom-actions/initDomActionsModules.js +0 -36
- package/libEs5/components/Personalization/dom-actions/insertHtmlAfter.js +0 -32
- package/libEs5/components/Personalization/dom-actions/insertHtmlBefore.js +0 -32
- package/libEs5/components/Personalization/dom-actions/prependHtml.js +0 -46
- package/libEs5/components/Personalization/dom-actions/rearrangeChildren.js +0 -33
- package/libEs5/components/Personalization/dom-actions/remapCustomCodeOffers.js +0 -37
- package/libEs5/components/Personalization/dom-actions/remapHeadOffers.js +0 -55
- package/libEs5/components/Personalization/dom-actions/replaceHtml.js +0 -21
- package/libEs5/components/Personalization/dom-actions/scripts.js +0 -92
- package/libEs5/components/Personalization/dom-actions/setAttributes.js +0 -21
- package/libEs5/components/Personalization/dom-actions/setHtml.js +0 -28
- package/libEs5/components/Personalization/dom-actions/setStyles.js +0 -26
- package/libEs5/components/Personalization/dom-actions/setText.js +0 -18
- package/libEs5/components/Personalization/dom-actions/swapImage.js +0 -32
- package/libEs5/components/Personalization/event.js +0 -48
- package/libEs5/components/Personalization/flicker/index.js +0 -87
- package/libEs5/components/Personalization/handlers/createProcessDomAction.js +0 -69
- package/libEs5/components/Personalization/handlers/createProcessHtmlContent.js +0 -44
- package/libEs5/components/Personalization/handlers/createProcessInAppMessage.js +0 -76
- package/libEs5/components/Personalization/handlers/createProcessPropositions.js +0 -195
- package/libEs5/components/Personalization/handlers/createProcessRedirect.js +0 -46
- package/libEs5/components/Personalization/handlers/injectCreateProposition.js +0 -116
- package/libEs5/components/Personalization/handlers/processDefaultContent.js +0 -21
- package/libEs5/components/Personalization/in-app-message-actions/actions/displayIframeContent.js +0 -288
- package/libEs5/components/Personalization/in-app-message-actions/initInAppMessageActionsModules.js +0 -23
- package/libEs5/components/Personalization/in-app-message-actions/utils.js +0 -53
- package/libEs5/components/Personalization/index.js +0 -153
- package/libEs5/components/Personalization/utils/addRenderAttemptedToDecisions.js +0 -25
- package/libEs5/components/Personalization/utils/createAsyncArray.js +0 -39
- package/libEs5/components/Personalization/utils/isAuthoringModeEnabled.js +0 -19
- package/libEs5/components/Personalization/utils/surfaceUtils.js +0 -102
- package/libEs5/components/Personalization/validateApplyPropositionsOptions.js +0 -36
- package/libEs5/components/Privacy/computeConsentHash.js +0 -34
- package/libEs5/components/Privacy/createComponent.js +0 -86
- package/libEs5/components/Privacy/createConsentHashStore.js +0 -60
- package/libEs5/components/Privacy/createConsentRequest.js +0 -30
- package/libEs5/components/Privacy/createConsentRequestPayload.js +0 -34
- package/libEs5/components/Privacy/createStoredConsent.js +0 -32
- package/libEs5/components/Privacy/index.js +0 -64
- package/libEs5/components/Privacy/injectSendSetConsentRequest.js +0 -48
- package/libEs5/components/Privacy/parseConsentCookie.js +0 -38
- package/libEs5/components/Privacy/validateSetConsentOptions.js +0 -22
- package/libEs5/constants/apiVersion.js +0 -16
- package/libEs5/constants/browser.js +0 -29
- package/libEs5/constants/consentPurpose.js +0 -17
- package/libEs5/constants/consentStatus.js +0 -21
- package/libEs5/constants/contentType.js +0 -18
- package/libEs5/constants/cookieNameKey.js +0 -21
- package/libEs5/constants/cookieNamePrefix.js +0 -17
- package/libEs5/constants/coreCommands.js +0 -19
- package/libEs5/constants/debugQueryParam.js +0 -16
- package/libEs5/constants/decisionProvider.js +0 -16
- package/libEs5/constants/domain.js +0 -19
- package/libEs5/constants/ecidNamespace.js +0 -16
- package/libEs5/constants/edgeBasePath.js +0 -16
- package/libEs5/constants/elementAttribute.js +0 -17
- package/libEs5/constants/eventType.js +0 -25
- package/libEs5/constants/handle.js +0 -16
- package/libEs5/constants/highEntropyUserAgentClientHints.js +0 -16
- package/libEs5/constants/httpHeaderNames.js +0 -19
- package/libEs5/constants/httpStatusCode.js +0 -25
- package/libEs5/constants/identityMapAuthenticatedState.js +0 -20
- package/libEs5/constants/legacyCookies.js +0 -21
- package/libEs5/constants/libraryName.js +0 -16
- package/libEs5/constants/libraryVersion.js +0 -18
- package/libEs5/constants/namespace.js +0 -16
- package/libEs5/constants/pageWideScope.js +0 -16
- package/libEs5/constants/propositionEventType.js +0 -33
- package/libEs5/constants/queryStringIdentityParam.js +0 -16
- package/libEs5/constants/schema.js +0 -35
- package/libEs5/constants/shadowSeparator.js +0 -16
- package/libEs5/constants/tagName.js +0 -29
- package/libEs5/core/buildAndValidateConfig.js +0 -113
- package/libEs5/core/componentCreators.js +0 -34
- package/libEs5/core/config/createConfig.js +0 -21
- package/libEs5/core/config/createCoreConfigs.js +0 -32
- package/libEs5/core/consent/createConsent.js +0 -59
- package/libEs5/core/consent/createConsentStateMachine.js +0 -109
- package/libEs5/core/createComponentRegistry.js +0 -84
- package/libEs5/core/createCookieTransfer.js +0 -81
- package/libEs5/core/createEvent.js +0 -171
- package/libEs5/core/createEventManager.js +0 -142
- package/libEs5/core/createInstanceFunction.js +0 -28
- package/libEs5/core/createLifecycle.js +0 -75
- package/libEs5/core/createLogController.js +0 -71
- package/libEs5/core/createLogger.js +0 -104
- package/libEs5/core/edgeNetwork/handleRequestFailure.js +0 -28
- package/libEs5/core/edgeNetwork/injectApplyResponse.js +0 -67
- package/libEs5/core/edgeNetwork/injectExtractEdgeInfo.js +0 -43
- package/libEs5/core/edgeNetwork/injectGetLocationHint.js +0 -36
- package/libEs5/core/edgeNetwork/injectProcessWarningsAndErrors.js +0 -43
- package/libEs5/core/edgeNetwork/injectSendEdgeNetworkRequest.js +0 -100
- package/libEs5/core/edgeNetwork/mergeLifecycleResponses.js +0 -29
- package/libEs5/core/index.js +0 -240
- package/libEs5/core/initializeComponents.js +0 -42
- package/libEs5/core/injectCreateResponse.js +0 -78
- package/libEs5/core/injectExecuteCommand.js +0 -105
- package/libEs5/core/injectHandleError.js +0 -37
- package/libEs5/core/injectShouldTransferCookie.js +0 -29
- package/libEs5/core/network/getRequestRetryDelay.js +0 -74
- package/libEs5/core/network/injectSendNetworkRequest.js +0 -100
- package/libEs5/core/network/isRequestRetryable.js +0 -28
- package/libEs5/core/network/requestMethods/injectSendBeaconRequest.js +0 -40
- package/libEs5/core/network/requestMethods/injectSendFetchRequest.js +0 -45
- package/libEs5/core/network/requestMethods/injectSendXhrRequest.js +0 -51
- package/libEs5/core/validateCommandOptions.js +0 -35
- package/libEs5/index.js +0 -60
- package/libEs5/utils/areThirdPartyCookiesSupportedByDefault.js +0 -25
- package/libEs5/utils/assign.js +0 -17
- package/libEs5/utils/assignConcatArrayValues.js +0 -49
- package/libEs5/utils/assignIf.js +0 -22
- package/libEs5/utils/clone.js +0 -23
- package/libEs5/utils/cookieJar.js +0 -22
- package/libEs5/utils/crc32.js +0 -37
- package/libEs5/utils/createCallbackAggregator.js +0 -39
- package/libEs5/utils/createLoggingCookieJar.js +0 -31
- package/libEs5/utils/createMerger.js +0 -34
- package/libEs5/utils/createSubscription.js +0 -91
- package/libEs5/utils/createTaskQueue.js +0 -51
- package/libEs5/utils/debounce.js +0 -30
- package/libEs5/utils/deduplicateArray.js +0 -32
- package/libEs5/utils/deepAssign.js +0 -49
- package/libEs5/utils/defer.js +0 -27
- package/libEs5/utils/dom/appendNode.js +0 -18
- package/libEs5/utils/dom/awaitSelector.js +0 -111
- package/libEs5/utils/dom/createNode.js +0 -48
- package/libEs5/utils/dom/index.js +0 -58
- package/libEs5/utils/dom/isShadowSelector.js +0 -19
- package/libEs5/utils/dom/matchesSelector.js +0 -29
- package/libEs5/utils/dom/querySelectorAll.js +0 -33
- package/libEs5/utils/dom/removeNode.js +0 -22
- package/libEs5/utils/dom/selectNodes.js +0 -31
- package/libEs5/utils/dom/selectNodesWithShadow.js +0 -67
- package/libEs5/utils/endsWith.js +0 -24
- package/libEs5/utils/filterObject.js +0 -53
- package/libEs5/utils/find.js +0 -31
- package/libEs5/utils/fireImage.js +0 -39
- package/libEs5/utils/flatMap.js +0 -18
- package/libEs5/utils/flattenArray.js +0 -37
- package/libEs5/utils/flattenObject.js +0 -43
- package/libEs5/utils/getApexDomain.js +0 -46
- package/libEs5/utils/getBrowser.js +0 -34
- package/libEs5/utils/getLastArrayItems.js +0 -24
- package/libEs5/utils/getNamespacedCookieName.js +0 -20
- package/libEs5/utils/groupBy.js +0 -32
- package/libEs5/utils/includes.js +0 -24
- package/libEs5/utils/index.js +0 -408
- package/libEs5/utils/injectDoesIdentityCookieExist.js +0 -28
- package/libEs5/utils/injectFireReferrerHideableImage.js +0 -76
- package/libEs5/utils/injectStorage.js +0 -75
- package/libEs5/utils/intersection.js +0 -27
- package/libEs5/utils/isBlankString.js +0 -24
- package/libEs5/utils/isBoolean.js +0 -23
- package/libEs5/utils/isEmptyObject.js +0 -24
- package/libEs5/utils/isFunction.js +0 -23
- package/libEs5/utils/isInteger.js +0 -25
- package/libEs5/utils/isNamespacedCookieName.js +0 -27
- package/libEs5/utils/isNil.js +0 -23
- package/libEs5/utils/isNonEmptyArray.js +0 -23
- package/libEs5/utils/isNonEmptyString.js +0 -24
- package/libEs5/utils/isNumber.js +0 -24
- package/libEs5/utils/isObject.js +0 -24
- package/libEs5/utils/isString.js +0 -23
- package/libEs5/utils/isUnique.js +0 -31
- package/libEs5/utils/isValidRegExp.js +0 -27
- package/libEs5/utils/memoize.js +0 -37
- package/libEs5/utils/noop.js +0 -19
- package/libEs5/utils/padStart.js +0 -28
- package/libEs5/utils/parseUrl.js +0 -70
- package/libEs5/utils/prepareConfigOverridesForEdge.js +0 -53
- package/libEs5/utils/querystring.js +0 -17
- package/libEs5/utils/request/createAddIdentity.js +0 -23
- package/libEs5/utils/request/createDataCollectionRequest.js +0 -69
- package/libEs5/utils/request/createDataCollectionRequestPayload.js +0 -36
- package/libEs5/utils/request/createGetAssuranceValidationTokenParams.js +0 -45
- package/libEs5/utils/request/createHasIdentity.js +0 -20
- package/libEs5/utils/request/createRequest.js +0 -63
- package/libEs5/utils/request/createRequestParams.js +0 -45
- package/libEs5/utils/request/createRequestPayload.js +0 -37
- package/libEs5/utils/request/index.js +0 -58
- package/libEs5/utils/sanitizeOrgIdForCookieName.js +0 -18
- package/libEs5/utils/stackError.js +0 -35
- package/libEs5/utils/startsWith.js +0 -24
- package/libEs5/utils/stringToBoolean.js +0 -19
- package/libEs5/utils/toArray.js +0 -24
- package/libEs5/utils/toError.js +0 -24
- package/libEs5/utils/toISOStringLocal.js +0 -40
- package/libEs5/utils/toInteger.js +0 -32
- package/libEs5/utils/updateErrorMessage.js +0 -25
- package/libEs5/utils/uuid.js +0 -17
- package/libEs5/utils/validateConfigOverride.js +0 -17
- package/libEs5/utils/validateIdentityMap.js +0 -26
- package/libEs5/utils/validation/booleanValidator.js +0 -21
- package/libEs5/utils/validation/callbackValidator.js +0 -21
- package/libEs5/utils/validation/createAnyOfValidator.js +0 -33
- package/libEs5/utils/validation/createArrayOfValidator.js +0 -35
- package/libEs5/utils/validation/createDefaultValidator.js +0 -23
- package/libEs5/utils/validation/createDeprecatedValidator.js +0 -45
- package/libEs5/utils/validation/createLiteralValidator.js +0 -22
- package/libEs5/utils/validation/createMapOfValuesValidator.js +0 -41
- package/libEs5/utils/validation/createMaximumValidator.js +0 -22
- package/libEs5/utils/validation/createMinimumValidator.js +0 -22
- package/libEs5/utils/validation/createNoUnknownFieldsValidator.js +0 -30
- package/libEs5/utils/validation/createNonEmptyValidator.js +0 -28
- package/libEs5/utils/validation/createObjectOfValidator.js +0 -49
- package/libEs5/utils/validation/createUniqueItemsValidator.js +0 -22
- package/libEs5/utils/validation/createUniqueValidator.js +0 -24
- package/libEs5/utils/validation/domainValidator.js +0 -22
- package/libEs5/utils/validation/index.js +0 -247
- package/libEs5/utils/validation/integerValidator.js +0 -21
- package/libEs5/utils/validation/matchesRegexpValidator.js +0 -22
- package/libEs5/utils/validation/numberValidator.js +0 -21
- package/libEs5/utils/validation/regexpValidator.js +0 -21
- package/libEs5/utils/validation/requiredValidator.js +0 -21
- package/libEs5/utils/validation/stringValidator.js +0 -21
- package/libEs5/utils/validation/utils.js +0 -141
- package/libEs5/utils/values.js +0 -26
- package/libEs6/baseCode/index.js +0 -61
- package/libEs6/components/ActivityCollector/attachClickActivityCollector.js +0 -52
- package/libEs6/components/ActivityCollector/configValidators.js +0 -19
- package/libEs6/components/ActivityCollector/createGetLinkDetails.js +0 -70
- package/libEs6/components/ActivityCollector/createLinkClick.js +0 -37
- package/libEs6/components/ActivityCollector/getLinkName.js +0 -136
- package/libEs6/components/ActivityCollector/getLinkRegion.js +0 -58
- package/libEs6/components/ActivityCollector/index.js +0 -81
- package/libEs6/components/ActivityCollector/utils.js +0 -104
- package/libEs6/components/Audiences/index.js +0 -47
- package/libEs6/components/Audiences/injectProcessDestinations.js +0 -60
- package/libEs6/components/Audiences/injectProcessResponse.js +0 -38
- package/libEs6/components/Context/createComponent.js +0 -34
- package/libEs6/components/Context/implementationDetails.js +0 -24
- package/libEs6/components/Context/index.js +0 -52
- package/libEs6/components/Context/injectDevice.js +0 -70
- package/libEs6/components/Context/injectEnvironment.js +0 -42
- package/libEs6/components/Context/injectHighEntropyUserAgentHints.js +0 -45
- package/libEs6/components/Context/injectPlaceContext.js +0 -29
- package/libEs6/components/Context/injectTimestamp.js +0 -21
- package/libEs6/components/Context/injectWeb.js +0 -28
- package/libEs6/components/DataCollector/index.js +0 -106
- package/libEs6/components/DataCollector/validateApplyResponse.js +0 -33
- package/libEs6/components/DataCollector/validateUserEventOptions.js +0 -49
- package/libEs6/components/DecisioningEngine/consequenceAdapters/inAppMessageConsequenceAdapter.js +0 -30
- package/libEs6/components/DecisioningEngine/consequenceAdapters/schemaTypeConsequenceAdapter.js +0 -24
- package/libEs6/components/DecisioningEngine/constants.js +0 -25
- package/libEs6/components/DecisioningEngine/createApplyResponse.js +0 -31
- package/libEs6/components/DecisioningEngine/createConsequenceAdapter.js +0 -29
- package/libEs6/components/DecisioningEngine/createContextProvider.js +0 -95
- package/libEs6/components/DecisioningEngine/createDecisionHistory.js +0 -25
- package/libEs6/components/DecisioningEngine/createDecisionProvider.js +0 -41
- package/libEs6/components/DecisioningEngine/createEvaluableRulesetPayload.js +0 -79
- package/libEs6/components/DecisioningEngine/createEvaluateRulesetsCommand.js +0 -45
- package/libEs6/components/DecisioningEngine/createEventRegistry.js +0 -120
- package/libEs6/components/DecisioningEngine/createOnResponseHandler.js +0 -45
- package/libEs6/components/DecisioningEngine/createSubscribeRulesetItems.js +0 -79
- package/libEs6/components/DecisioningEngine/index.js +0 -124
- package/libEs6/components/DecisioningEngine/utils.js +0 -83
- package/libEs6/components/EventMerge/createComponent.js +0 -23
- package/libEs6/components/EventMerge/createEventMergeId.js +0 -18
- package/libEs6/components/EventMerge/index.js +0 -21
- package/libEs6/components/Identity/addEcidQueryToPayload.js +0 -20
- package/libEs6/components/Identity/addEcidToPayload.js +0 -18
- package/libEs6/components/Identity/appendIdentityToUrl/appendIdentityToUrlOptionsValidator.js +0 -23
- package/libEs6/components/Identity/appendIdentityToUrl/injectAppendIdentityToUrl.js +0 -31
- package/libEs6/components/Identity/configValidators.js +0 -18
- package/libEs6/components/Identity/constants/authState.js +0 -15
- package/libEs6/components/Identity/constants/defaultIdSyncTtlMinutes.js +0 -13
- package/libEs6/components/Identity/createComponent.js +0 -97
- package/libEs6/components/Identity/createLegacyIdentity.js +0 -69
- package/libEs6/components/Identity/getEcidFromResponse.js +0 -19
- package/libEs6/components/Identity/getIdentity/createGetIdentity.js +0 -34
- package/libEs6/components/Identity/getIdentity/createIdentityRequest.js +0 -28
- package/libEs6/components/Identity/getIdentity/createIdentityRequestPayload.js +0 -27
- package/libEs6/components/Identity/getIdentity/getIdentityOptionsValidator.js +0 -25
- package/libEs6/components/Identity/index.js +0 -124
- package/libEs6/components/Identity/injectAddLegacyEcidToPayload.js +0 -30
- package/libEs6/components/Identity/injectAddQueryStringIdentityToPayload.js +0 -55
- package/libEs6/components/Identity/injectAwaitIdentityCookie.js +0 -56
- package/libEs6/components/Identity/injectEnsureSingleIdentity.js +0 -97
- package/libEs6/components/Identity/injectHandleResponseForIdSyncs.js +0 -19
- package/libEs6/components/Identity/injectProcessIdSyncs.js +0 -34
- package/libEs6/components/Identity/injectSetDomainForInitialIdentityPayload.js +0 -32
- package/libEs6/components/Identity/visitorService/awaitVisitorOptIn.js +0 -33
- package/libEs6/components/Identity/visitorService/getVisitor.js +0 -17
- package/libEs6/components/Identity/visitorService/injectGetEcidFromVisitor.js +0 -48
- package/libEs6/components/LegacyMediaAnalytics/createMediaAnalyticsTracker.js +0 -276
- package/libEs6/components/LegacyMediaAnalytics/createMediaHelper.js +0 -186
- package/libEs6/components/LegacyMediaAnalytics/index.js +0 -45
- package/libEs6/components/LegacyMediaAnalytics/media/constants.js +0 -140
- package/libEs6/components/LegacyMediaAnalytics/media/mediaKeysToXdmConverter.js +0 -46
- package/libEs6/components/LibraryInfo/index.js +0 -57
- package/libEs6/components/MachineLearning/index.js +0 -23
- package/libEs6/components/MachineLearning/processResponse.js +0 -18
- package/libEs6/components/MediaCollection/constants/eventTypes.js +0 -21
- package/libEs6/components/MediaCollection/createHeartbeatEngine.js +0 -64
- package/libEs6/components/MediaCollection/createMediaEventManager.js +0 -115
- package/libEs6/components/MediaCollection/createMediaRequest.js +0 -28
- package/libEs6/components/MediaCollection/createMediaSessionCacheManager.js +0 -63
- package/libEs6/components/MediaCollection/createUpdateMediaSessionState.js +0 -30
- package/libEs6/components/MediaCollection/index.js +0 -164
- package/libEs6/components/MediaCollection/validateMediaEventOptions.js +0 -32
- package/libEs6/components/MediaCollection/validateMediaSessionOptions.js +0 -34
- package/libEs6/components/Personalization/constants/loggerMessage.js +0 -13
- package/libEs6/components/Personalization/constants/scopeType.js +0 -15
- package/libEs6/components/Personalization/constants/surface.js +0 -16
- package/libEs6/components/Personalization/createActionsProvider.js +0 -70
- package/libEs6/components/Personalization/createApplyPropositions.js +0 -103
- package/libEs6/components/Personalization/createClickStorage.js +0 -58
- package/libEs6/components/Personalization/createCollect.js +0 -48
- package/libEs6/components/Personalization/createComponent.js +0 -129
- package/libEs6/components/Personalization/createFetchDataHandler.js +0 -74
- package/libEs6/components/Personalization/createGetPageLocation.js +0 -17
- package/libEs6/components/Personalization/createNotificationHandler.js +0 -29
- package/libEs6/components/Personalization/createOnClickHandler.js +0 -52
- package/libEs6/components/Personalization/createOnDecisionHandler.js +0 -42
- package/libEs6/components/Personalization/createPersonalizationDetails.js +0 -94
- package/libEs6/components/Personalization/createPreprocessors.js +0 -19
- package/libEs6/components/Personalization/createSetTargetMigration.js +0 -27
- package/libEs6/components/Personalization/createViewCacheManager.js +0 -81
- package/libEs6/components/Personalization/createViewChangeHandler.js +0 -47
- package/libEs6/components/Personalization/dom-actions/action.js +0 -49
- package/libEs6/components/Personalization/dom-actions/addNonceToInlineStyleElements.js +0 -36
- package/libEs6/components/Personalization/dom-actions/appendHtml.js +0 -30
- package/libEs6/components/Personalization/dom-actions/clicks/collectClicks.js +0 -91
- package/libEs6/components/Personalization/dom-actions/createPreprocess.js +0 -18
- package/libEs6/components/Personalization/dom-actions/createRedirect.js +0 -22
- package/libEs6/components/Personalization/dom-actions/dom/createFragment.js +0 -19
- package/libEs6/components/Personalization/dom-actions/dom/getAttribute.js +0 -15
- package/libEs6/components/Personalization/dom-actions/dom/getChildNodes.js +0 -22
- package/libEs6/components/Personalization/dom-actions/dom/getChildren.js +0 -22
- package/libEs6/components/Personalization/dom-actions/dom/getElementById.js +0 -21
- package/libEs6/components/Personalization/dom-actions/dom/getFirstChild.js +0 -15
- package/libEs6/components/Personalization/dom-actions/dom/getNextSibling.js +0 -15
- package/libEs6/components/Personalization/dom-actions/dom/getNonce.js +0 -33
- package/libEs6/components/Personalization/dom-actions/dom/getParent.js +0 -15
- package/libEs6/components/Personalization/dom-actions/dom/helperForEq.js +0 -19
- package/libEs6/components/Personalization/dom-actions/dom/index.js +0 -26
- package/libEs6/components/Personalization/dom-actions/dom/insertAfter.js +0 -23
- package/libEs6/components/Personalization/dom-actions/dom/insertBefore.js +0 -22
- package/libEs6/components/Personalization/dom-actions/dom/matchesSelectorWithEq.js +0 -35
- package/libEs6/components/Personalization/dom-actions/dom/removeAttribute.js +0 -15
- package/libEs6/components/Personalization/dom-actions/dom/selectNodesWithEq.js +0 -102
- package/libEs6/components/Personalization/dom-actions/dom/setAttribute.js +0 -15
- package/libEs6/components/Personalization/dom-actions/dom/setStyle.js +0 -21
- package/libEs6/components/Personalization/dom-actions/images.js +0 -31
- package/libEs6/components/Personalization/dom-actions/index.js +0 -13
- package/libEs6/components/Personalization/dom-actions/initDomActionsModules.js +0 -33
- package/libEs6/components/Personalization/dom-actions/insertHtmlAfter.js +0 -29
- package/libEs6/components/Personalization/dom-actions/insertHtmlBefore.js +0 -29
- package/libEs6/components/Personalization/dom-actions/prependHtml.js +0 -45
- package/libEs6/components/Personalization/dom-actions/rearrangeChildren.js +0 -31
- package/libEs6/components/Personalization/dom-actions/remapCustomCodeOffers.js +0 -34
- package/libEs6/components/Personalization/dom-actions/remapHeadOffers.js +0 -51
- package/libEs6/components/Personalization/dom-actions/replaceHtml.js +0 -18
- package/libEs6/components/Personalization/dom-actions/scripts.js +0 -85
- package/libEs6/components/Personalization/dom-actions/setAttributes.js +0 -18
- package/libEs6/components/Personalization/dom-actions/setHtml.js +0 -24
- package/libEs6/components/Personalization/dom-actions/setStyles.js +0 -22
- package/libEs6/components/Personalization/dom-actions/setText.js +0 -15
- package/libEs6/components/Personalization/dom-actions/swapImage.js +0 -29
- package/libEs6/components/Personalization/event.js +0 -45
- package/libEs6/components/Personalization/flicker/index.js +0 -82
- package/libEs6/components/Personalization/handlers/createProcessDomAction.js +0 -61
- package/libEs6/components/Personalization/handlers/createProcessHtmlContent.js +0 -40
- package/libEs6/components/Personalization/handlers/createProcessInAppMessage.js +0 -77
- package/libEs6/components/Personalization/handlers/createProcessPropositions.js +0 -175
- package/libEs6/components/Personalization/handlers/createProcessRedirect.js +0 -42
- package/libEs6/components/Personalization/handlers/injectCreateProposition.js +0 -110
- package/libEs6/components/Personalization/handlers/processDefaultContent.js +0 -17
- package/libEs6/components/Personalization/in-app-message-actions/actions/displayIframeContent.js +0 -291
- package/libEs6/components/Personalization/in-app-message-actions/initInAppMessageActionsModules.js +0 -17
- package/libEs6/components/Personalization/in-app-message-actions/utils.js +0 -49
- package/libEs6/components/Personalization/index.js +0 -159
- package/libEs6/components/Personalization/utils/addRenderAttemptedToDecisions.js +0 -21
- package/libEs6/components/Personalization/utils/createAsyncArray.js +0 -35
- package/libEs6/components/Personalization/utils/isAuthoringModeEnabled.js +0 -15
- package/libEs6/components/Personalization/utils/surfaceUtils.js +0 -74
- package/libEs6/components/Personalization/validateApplyPropositionsOptions.js +0 -31
- package/libEs6/components/Privacy/computeConsentHash.js +0 -30
- package/libEs6/components/Privacy/createComponent.js +0 -85
- package/libEs6/components/Privacy/createConsentHashStore.js +0 -57
- package/libEs6/components/Privacy/createConsentRequest.js +0 -28
- package/libEs6/components/Privacy/createConsentRequestPayload.js +0 -31
- package/libEs6/components/Privacy/createStoredConsent.js +0 -30
- package/libEs6/components/Privacy/index.js +0 -63
- package/libEs6/components/Privacy/injectSendSetConsentRequest.js +0 -45
- package/libEs6/components/Privacy/parseConsentCookie.js +0 -26
- package/libEs6/components/Privacy/validateSetConsentOptions.js +0 -18
- package/libEs6/constants/apiVersion.js +0 -12
- package/libEs6/constants/browser.js +0 -19
- package/libEs6/constants/consentPurpose.js +0 -13
- package/libEs6/constants/consentStatus.js +0 -15
- package/libEs6/constants/contentType.js +0 -13
- package/libEs6/constants/cookieNameKey.js +0 -15
- package/libEs6/constants/cookieNamePrefix.js +0 -14
- package/libEs6/constants/coreCommands.js +0 -14
- package/libEs6/constants/debugQueryParam.js +0 -13
- package/libEs6/constants/decisionProvider.js +0 -12
- package/libEs6/constants/domain.js +0 -14
- package/libEs6/constants/ecidNamespace.js +0 -13
- package/libEs6/constants/edgeBasePath.js +0 -12
- package/libEs6/constants/elementAttribute.js +0 -13
- package/libEs6/constants/eventType.js +0 -17
- package/libEs6/constants/handle.js +0 -12
- package/libEs6/constants/highEntropyUserAgentClientHints.js +0 -13
- package/libEs6/constants/httpHeaderNames.js +0 -14
- package/libEs6/constants/httpStatusCode.js +0 -17
- package/libEs6/constants/identityMapAuthenticatedState.js +0 -14
- package/libEs6/constants/legacyCookies.js +0 -15
- package/libEs6/constants/libraryName.js +0 -13
- package/libEs6/constants/libraryVersion.js +0 -16
- package/libEs6/constants/namespace.js +0 -13
- package/libEs6/constants/pageWideScope.js +0 -13
- package/libEs6/constants/propositionEventType.js +0 -33
- package/libEs6/constants/queryStringIdentityParam.js +0 -13
- package/libEs6/constants/schema.js +0 -22
- package/libEs6/constants/shadowSeparator.js +0 -13
- package/libEs6/constants/tagName.js +0 -19
- package/libEs6/core/buildAndValidateConfig.js +0 -94
- package/libEs6/core/componentCreators.js +0 -31
- package/libEs6/core/config/createConfig.js +0 -17
- package/libEs6/core/config/createCoreConfigs.js +0 -27
- package/libEs6/core/consent/createConsent.js +0 -57
- package/libEs6/core/consent/createConsentStateMachine.js +0 -91
- package/libEs6/core/createComponentRegistry.js +0 -80
- package/libEs6/core/createCookieTransfer.js +0 -78
- package/libEs6/core/createEvent.js +0 -161
- package/libEs6/core/createEventManager.js +0 -135
- package/libEs6/core/createInstanceFunction.js +0 -25
- package/libEs6/core/createLifecycle.js +0 -65
- package/libEs6/core/createLogController.js +0 -68
- package/libEs6/core/createLogger.js +0 -99
- package/libEs6/core/edgeNetwork/handleRequestFailure.js +0 -24
- package/libEs6/core/edgeNetwork/injectApplyResponse.js +0 -58
- package/libEs6/core/edgeNetwork/injectExtractEdgeInfo.js +0 -39
- package/libEs6/core/edgeNetwork/injectGetLocationHint.js +0 -32
- package/libEs6/core/edgeNetwork/injectProcessWarningsAndErrors.js +0 -42
- package/libEs6/core/edgeNetwork/injectSendEdgeNetworkRequest.js +0 -100
- package/libEs6/core/edgeNetwork/mergeLifecycleResponses.js +0 -21
- package/libEs6/core/index.js +0 -236
- package/libEs6/core/initializeComponents.js +0 -40
- package/libEs6/core/injectCreateResponse.js +0 -70
- package/libEs6/core/injectExecuteCommand.js +0 -100
- package/libEs6/core/injectHandleError.js +0 -33
- package/libEs6/core/injectShouldTransferCookie.js +0 -25
- package/libEs6/core/network/getRequestRetryDelay.js +0 -72
- package/libEs6/core/network/injectSendNetworkRequest.js +0 -96
- package/libEs6/core/network/isRequestRetryable.js +0 -25
- package/libEs6/core/network/requestMethods/injectSendBeaconRequest.js +0 -38
- package/libEs6/core/network/requestMethods/injectSendFetchRequest.js +0 -41
- package/libEs6/core/network/requestMethods/injectSendXhrRequest.js +0 -49
- package/libEs6/core/validateCommandOptions.js +0 -33
- package/libEs6/index.js +0 -55
- package/libEs6/utils/areThirdPartyCookiesSupportedByDefault.js +0 -20
- package/libEs6/utils/assign.js +0 -14
- package/libEs6/utils/assignConcatArrayValues.js +0 -36
- package/libEs6/utils/assignIf.js +0 -19
- package/libEs6/utils/clone.js +0 -18
- package/libEs6/utils/cookieJar.js +0 -19
- package/libEs6/utils/crc32.js +0 -33
- package/libEs6/utils/createCallbackAggregator.js +0 -31
- package/libEs6/utils/createLoggingCookieJar.js +0 -28
- package/libEs6/utils/createMerger.js +0 -30
- package/libEs6/utils/createSubscription.js +0 -70
- package/libEs6/utils/createTaskQueue.js +0 -48
- package/libEs6/utils/debounce.js +0 -22
- package/libEs6/utils/deduplicateArray.js +0 -23
- package/libEs6/utils/deepAssign.js +0 -40
- package/libEs6/utils/defer.js +0 -24
- package/libEs6/utils/dom/appendNode.js +0 -15
- package/libEs6/utils/dom/awaitSelector.js +0 -98
- package/libEs6/utils/dom/createNode.js +0 -38
- package/libEs6/utils/dom/index.js +0 -20
- package/libEs6/utils/dom/isShadowSelector.js +0 -14
- package/libEs6/utils/dom/matchesSelector.js +0 -26
- package/libEs6/utils/dom/querySelectorAll.js +0 -29
- package/libEs6/utils/dom/removeNode.js +0 -19
- package/libEs6/utils/dom/selectNodes.js +0 -28
- package/libEs6/utils/dom/selectNodesWithShadow.js +0 -63
- package/libEs6/utils/endsWith.js +0 -19
- package/libEs6/utils/filterObject.js +0 -55
- package/libEs6/utils/find.js +0 -28
- package/libEs6/utils/fireImage.js +0 -37
- package/libEs6/utils/flatMap.js +0 -14
- package/libEs6/utils/flattenArray.js +0 -26
- package/libEs6/utils/flattenObject.js +0 -28
- package/libEs6/utils/getApexDomain.js +0 -42
- package/libEs6/utils/getBrowser.js +0 -65
- package/libEs6/utils/getLastArrayItems.js +0 -19
- package/libEs6/utils/getNamespacedCookieName.js +0 -15
- package/libEs6/utils/groupBy.js +0 -29
- package/libEs6/utils/includes.js +0 -21
- package/libEs6/utils/index.js +0 -71
- package/libEs6/utils/injectDoesIdentityCookieExist.js +0 -24
- package/libEs6/utils/injectFireReferrerHideableImage.js +0 -65
- package/libEs6/utils/injectStorage.js +0 -69
- package/libEs6/utils/intersection.js +0 -21
- package/libEs6/utils/isBlankString.js +0 -20
- package/libEs6/utils/isBoolean.js +0 -18
- package/libEs6/utils/isEmptyObject.js +0 -20
- package/libEs6/utils/isFunction.js +0 -18
- package/libEs6/utils/isInteger.js +0 -23
- package/libEs6/utils/isNamespacedCookieName.js +0 -23
- package/libEs6/utils/isNil.js +0 -18
- package/libEs6/utils/isNonEmptyArray.js +0 -18
- package/libEs6/utils/isNonEmptyString.js +0 -20
- package/libEs6/utils/isNumber.js +0 -19
- package/libEs6/utils/isObject.js +0 -20
- package/libEs6/utils/isString.js +0 -18
- package/libEs6/utils/isUnique.js +0 -27
- package/libEs6/utils/isValidRegExp.js +0 -24
- package/libEs6/utils/memoize.js +0 -34
- package/libEs6/utils/noop.js +0 -16
- package/libEs6/utils/padStart.js +0 -25
- package/libEs6/utils/parseUrl.js +0 -62
- package/libEs6/utils/prepareConfigOverridesForEdge.js +0 -50
- package/libEs6/utils/querystring.js +0 -14
- package/libEs6/utils/request/createAddIdentity.js +0 -19
- package/libEs6/utils/request/createDataCollectionRequest.js +0 -69
- package/libEs6/utils/request/createDataCollectionRequestPayload.js +0 -30
- package/libEs6/utils/request/createGetAssuranceValidationTokenParams.js +0 -42
- package/libEs6/utils/request/createHasIdentity.js +0 -15
- package/libEs6/utils/request/createRequest.js +0 -63
- package/libEs6/utils/request/createRequestParams.js +0 -40
- package/libEs6/utils/request/createRequestPayload.js +0 -35
- package/libEs6/utils/request/index.js +0 -20
- package/libEs6/utils/sanitizeOrgIdForCookieName.js +0 -13
- package/libEs6/utils/stackError.js +0 -34
- package/libEs6/utils/startsWith.js +0 -19
- package/libEs6/utils/stringToBoolean.js +0 -15
- package/libEs6/utils/toArray.js +0 -21
- package/libEs6/utils/toError.js +0 -21
- package/libEs6/utils/toISOStringLocal.js +0 -37
- package/libEs6/utils/toInteger.js +0 -30
- package/libEs6/utils/updateErrorMessage.js +0 -23
- package/libEs6/utils/uuid.js +0 -14
- package/libEs6/utils/validateConfigOverride.js +0 -14
- package/libEs6/utils/validateIdentityMap.js +0 -23
- package/libEs6/utils/validation/booleanValidator.js +0 -18
- package/libEs6/utils/validation/callbackValidator.js +0 -17
- package/libEs6/utils/validation/createAnyOfValidator.js +0 -26
- package/libEs6/utils/validation/createArrayOfValidator.js +0 -28
- package/libEs6/utils/validation/createDefaultValidator.js +0 -18
- package/libEs6/utils/validation/createDeprecatedValidator.js +0 -37
- package/libEs6/utils/validation/createLiteralValidator.js +0 -16
- package/libEs6/utils/validation/createMapOfValuesValidator.js +0 -35
- package/libEs6/utils/validation/createMaximumValidator.js +0 -16
- package/libEs6/utils/validation/createMinimumValidator.js +0 -16
- package/libEs6/utils/validation/createNoUnknownFieldsValidator.js +0 -25
- package/libEs6/utils/validation/createNonEmptyValidator.js +0 -23
- package/libEs6/utils/validation/createObjectOfValidator.js +0 -43
- package/libEs6/utils/validation/createUniqueItemsValidator.js +0 -18
- package/libEs6/utils/validation/createUniqueValidator.js +0 -21
- package/libEs6/utils/validation/domainValidator.js +0 -17
- package/libEs6/utils/validation/index.js +0 -232
- package/libEs6/utils/validation/integerValidator.js +0 -18
- package/libEs6/utils/validation/matchesRegexpValidator.js +0 -17
- package/libEs6/utils/validation/numberValidator.js +0 -18
- package/libEs6/utils/validation/regexpValidator.js +0 -18
- package/libEs6/utils/validation/requiredValidator.js +0 -18
- package/libEs6/utils/validation/stringValidator.js +0 -17
- package/libEs6/utils/validation/utils.js +0 -127
- package/libEs6/utils/values.js +0 -21
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020 Adobe. All rights reserved.
|
|
3
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import { IN, OUT, PENDING } from "../../constants/consentStatus";
|
|
14
|
-
import { GENERAL } from "../../constants/consentPurpose";
|
|
15
|
-
import { CONSENT_SOURCE_DEFAULT, CONSENT_SOURCE_INITIAL, CONSENT_SOURCE_NEW } from "./createConsentStateMachine";
|
|
16
|
-
export default (({
|
|
17
|
-
generalConsentState,
|
|
18
|
-
logger
|
|
19
|
-
}) => {
|
|
20
|
-
const setConsent = (consentByPurpose, source) => {
|
|
21
|
-
switch (consentByPurpose[GENERAL]) {
|
|
22
|
-
case IN:
|
|
23
|
-
generalConsentState.in(source);
|
|
24
|
-
break;
|
|
25
|
-
case OUT:
|
|
26
|
-
generalConsentState.out(source);
|
|
27
|
-
break;
|
|
28
|
-
case PENDING:
|
|
29
|
-
generalConsentState.pending(source);
|
|
30
|
-
break;
|
|
31
|
-
default:
|
|
32
|
-
logger.warn(`Unknown consent value: ${consentByPurpose[GENERAL]}`);
|
|
33
|
-
break;
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
return {
|
|
37
|
-
initializeConsent(defaultConsentByPurpose, storedConsentByPurpose) {
|
|
38
|
-
if (storedConsentByPurpose[GENERAL]) {
|
|
39
|
-
setConsent(storedConsentByPurpose, CONSENT_SOURCE_INITIAL);
|
|
40
|
-
} else {
|
|
41
|
-
setConsent(defaultConsentByPurpose, CONSENT_SOURCE_DEFAULT);
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
setConsent(consentByPurpose) {
|
|
45
|
-
setConsent(consentByPurpose, CONSENT_SOURCE_NEW);
|
|
46
|
-
},
|
|
47
|
-
suspend() {
|
|
48
|
-
generalConsentState.pending();
|
|
49
|
-
},
|
|
50
|
-
awaitConsent() {
|
|
51
|
-
return generalConsentState.awaitConsent();
|
|
52
|
-
},
|
|
53
|
-
withConsent() {
|
|
54
|
-
return generalConsentState.withConsent();
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
});
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020 Adobe. All rights reserved.
|
|
3
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import { defer } from "../../utils";
|
|
14
|
-
export const DECLINED_CONSENT = "The user declined consent.";
|
|
15
|
-
export const DECLINED_CONSENT_ERROR_CODE = "declinedConsent";
|
|
16
|
-
export const CONSENT_SOURCE_DEFAULT = "default";
|
|
17
|
-
export const CONSENT_SOURCE_INITIAL = "initial";
|
|
18
|
-
export const CONSENT_SOURCE_NEW = "new";
|
|
19
|
-
const createDeclinedConsentError = errorMessage => {
|
|
20
|
-
const error = new Error(errorMessage);
|
|
21
|
-
error.code = DECLINED_CONSENT_ERROR_CODE;
|
|
22
|
-
error.message = errorMessage;
|
|
23
|
-
return error;
|
|
24
|
-
};
|
|
25
|
-
export default (({
|
|
26
|
-
logger
|
|
27
|
-
}) => {
|
|
28
|
-
const deferreds = [];
|
|
29
|
-
const runAll = () => {
|
|
30
|
-
while (deferreds.length) {
|
|
31
|
-
deferreds.shift().resolve();
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
const discardAll = () => {
|
|
35
|
-
while (deferreds.length) {
|
|
36
|
-
deferreds.shift().reject(createDeclinedConsentError("The user declined consent."));
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
const awaitInitial = () => Promise.reject(new Error("Consent has not been initialized."));
|
|
40
|
-
const awaitInDefault = () => Promise.resolve();
|
|
41
|
-
const awaitIn = () => Promise.resolve();
|
|
42
|
-
const awaitOutDefault = () => Promise.reject(createDeclinedConsentError("No consent preferences have been set."));
|
|
43
|
-
const awaitOut = () => Promise.reject(createDeclinedConsentError("The user declined consent."));
|
|
44
|
-
const awaitPending = returnImmediately => {
|
|
45
|
-
if (returnImmediately) {
|
|
46
|
-
return Promise.reject(new Error("Consent is pending."));
|
|
47
|
-
}
|
|
48
|
-
const deferred = defer();
|
|
49
|
-
deferreds.push(deferred);
|
|
50
|
-
return deferred.promise;
|
|
51
|
-
};
|
|
52
|
-
return {
|
|
53
|
-
in(source) {
|
|
54
|
-
if (source === CONSENT_SOURCE_DEFAULT) {
|
|
55
|
-
this.awaitConsent = awaitInDefault;
|
|
56
|
-
} else {
|
|
57
|
-
if (source === CONSENT_SOURCE_INITIAL) {
|
|
58
|
-
logger.info("Loaded user consent preferences. The user previously consented.");
|
|
59
|
-
} else if (source === CONSENT_SOURCE_NEW && this.awaitConsent !== awaitIn) {
|
|
60
|
-
logger.info("User consented.");
|
|
61
|
-
}
|
|
62
|
-
runAll();
|
|
63
|
-
this.awaitConsent = awaitIn;
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
out(source) {
|
|
67
|
-
if (source === CONSENT_SOURCE_DEFAULT) {
|
|
68
|
-
logger.warn("User consent preferences not found. Default consent of out will be used.");
|
|
69
|
-
this.awaitConsent = awaitOutDefault;
|
|
70
|
-
} else {
|
|
71
|
-
if (source === CONSENT_SOURCE_INITIAL) {
|
|
72
|
-
logger.warn("Loaded user consent preferences. The user previously declined consent.");
|
|
73
|
-
} else if (source === CONSENT_SOURCE_NEW && this.awaitConsent !== awaitOut) {
|
|
74
|
-
logger.warn("User declined consent.");
|
|
75
|
-
}
|
|
76
|
-
discardAll();
|
|
77
|
-
this.awaitConsent = awaitOut;
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
pending(source) {
|
|
81
|
-
if (source === CONSENT_SOURCE_DEFAULT) {
|
|
82
|
-
logger.info("User consent preferences not found. Default consent of pending will be used. Some commands may be delayed.");
|
|
83
|
-
}
|
|
84
|
-
this.awaitConsent = awaitPending;
|
|
85
|
-
},
|
|
86
|
-
awaitConsent: awaitInitial,
|
|
87
|
-
withConsent() {
|
|
88
|
-
return this.awaitConsent(true);
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
});
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2019 Adobe. All rights reserved.
|
|
3
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import { intersection, stackError } from "../utils";
|
|
14
|
-
const wrapForErrorHandling = (fn, stackMessage) => {
|
|
15
|
-
return (...args) => {
|
|
16
|
-
let result;
|
|
17
|
-
try {
|
|
18
|
-
result = fn(...args);
|
|
19
|
-
} catch (error) {
|
|
20
|
-
throw stackError({
|
|
21
|
-
error,
|
|
22
|
-
message: stackMessage
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
if (result instanceof Promise) {
|
|
26
|
-
result = result.catch(error => {
|
|
27
|
-
throw stackError({
|
|
28
|
-
error,
|
|
29
|
-
message: stackMessage
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
return result;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
// TO-DOCUMENT: All public commands and their signatures.
|
|
38
|
-
export default (() => {
|
|
39
|
-
const componentsByNamespace = {};
|
|
40
|
-
const commandsByName = {};
|
|
41
|
-
const lifecycleCallbacksByName = {};
|
|
42
|
-
const registerComponentCommands = (namespace, componentCommandsByName = {}) => {
|
|
43
|
-
const conflictingCommandNames = intersection(Object.keys(commandsByName), Object.keys(componentCommandsByName));
|
|
44
|
-
if (conflictingCommandNames.length) {
|
|
45
|
-
throw new Error(`[ComponentRegistry] Could not register ${namespace} ` + `because it has existing command(s): ${conflictingCommandNames.join(",")}`);
|
|
46
|
-
}
|
|
47
|
-
Object.keys(componentCommandsByName).forEach(commandName => {
|
|
48
|
-
const command = componentCommandsByName[commandName];
|
|
49
|
-
command.commandName = commandName;
|
|
50
|
-
command.run = wrapForErrorHandling(command.run, `[${namespace}] An error occurred while executing the ${commandName} command.`);
|
|
51
|
-
commandsByName[commandName] = command;
|
|
52
|
-
});
|
|
53
|
-
};
|
|
54
|
-
const registerLifecycleCallbacks = (namespace, componentLifecycleCallbacksByName = {}) => {
|
|
55
|
-
Object.keys(componentLifecycleCallbacksByName).forEach(hookName => {
|
|
56
|
-
lifecycleCallbacksByName[hookName] = lifecycleCallbacksByName[hookName] || [];
|
|
57
|
-
lifecycleCallbacksByName[hookName].push(wrapForErrorHandling(componentLifecycleCallbacksByName[hookName], `[${namespace}] An error occurred while executing the ${hookName} lifecycle hook.`));
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
|
-
return {
|
|
61
|
-
register(namespace, component) {
|
|
62
|
-
const {
|
|
63
|
-
commands,
|
|
64
|
-
lifecycle
|
|
65
|
-
} = component;
|
|
66
|
-
registerComponentCommands(namespace, commands);
|
|
67
|
-
registerLifecycleCallbacks(namespace, lifecycle);
|
|
68
|
-
componentsByNamespace[namespace] = component;
|
|
69
|
-
},
|
|
70
|
-
getCommand(commandName) {
|
|
71
|
-
return commandsByName[commandName];
|
|
72
|
-
},
|
|
73
|
-
getCommandNames() {
|
|
74
|
-
return Object.keys(commandsByName);
|
|
75
|
-
},
|
|
76
|
-
getLifecycleCallbacks(hookName) {
|
|
77
|
-
return lifecycleCallbacksByName[hookName] || [];
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
});
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2019 Adobe. All rights reserved.
|
|
3
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import { endsWith } from "../utils";
|
|
14
|
-
const STATE_STORE_HANDLE_TYPE = "state:store";
|
|
15
|
-
export default (({
|
|
16
|
-
cookieJar,
|
|
17
|
-
shouldTransferCookie,
|
|
18
|
-
apexDomain,
|
|
19
|
-
dateProvider
|
|
20
|
-
}) => {
|
|
21
|
-
return {
|
|
22
|
-
/**
|
|
23
|
-
* When sending to a third-party endpoint, the endpoint won't be able to
|
|
24
|
-
* access first-party cookies, therefore we transfer cookies into
|
|
25
|
-
* the request body so they can be read by the server.
|
|
26
|
-
*/
|
|
27
|
-
cookiesToPayload(payload, endpointDomain) {
|
|
28
|
-
const isEndpointFirstParty = endsWith(endpointDomain, apexDomain);
|
|
29
|
-
const state = {
|
|
30
|
-
domain: apexDomain,
|
|
31
|
-
cookiesEnabled: true
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
// If the endpoint is first-party, there's no need to transfer cookies
|
|
35
|
-
// to the payload since they'll be automatically passed through cookie
|
|
36
|
-
// headers.
|
|
37
|
-
if (!isEndpointFirstParty) {
|
|
38
|
-
const cookies = cookieJar.get();
|
|
39
|
-
const entries = Object.keys(cookies).filter(shouldTransferCookie).map(qualifyingCookieName => {
|
|
40
|
-
return {
|
|
41
|
-
key: qualifyingCookieName,
|
|
42
|
-
value: cookies[qualifyingCookieName]
|
|
43
|
-
};
|
|
44
|
-
});
|
|
45
|
-
if (entries.length) {
|
|
46
|
-
state.entries = entries;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
payload.mergeState(state);
|
|
50
|
-
},
|
|
51
|
-
/**
|
|
52
|
-
* When receiving from a third-party endpoint, the endpoint won't be able to
|
|
53
|
-
* write first-party cookies, therefore we write first-party cookies
|
|
54
|
-
* as directed in the response body.
|
|
55
|
-
*/
|
|
56
|
-
responseToCookies(response) {
|
|
57
|
-
response.getPayloadsByType(STATE_STORE_HANDLE_TYPE).forEach(stateItem => {
|
|
58
|
-
const options = {
|
|
59
|
-
domain: apexDomain
|
|
60
|
-
};
|
|
61
|
-
const sameSite = stateItem.attrs && stateItem.attrs.SameSite && stateItem.attrs.SameSite.toLowerCase();
|
|
62
|
-
if (stateItem.maxAge !== undefined) {
|
|
63
|
-
// cookieJar expects "expires" as a date object
|
|
64
|
-
options.expires = new Date(dateProvider().getTime() + stateItem.maxAge * 1000);
|
|
65
|
-
}
|
|
66
|
-
if (sameSite !== undefined) {
|
|
67
|
-
options.sameSite = sameSite;
|
|
68
|
-
}
|
|
69
|
-
// When sameSite is set to none, the secure flag must be set.
|
|
70
|
-
// Experience edge will not set the secure flag in these cases.
|
|
71
|
-
if (sameSite === "none") {
|
|
72
|
-
options.secure = true;
|
|
73
|
-
}
|
|
74
|
-
cookieJar.set(stateItem.key, stateItem.value, options);
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
});
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2019 Adobe. All rights reserved.
|
|
3
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import { isEmptyObject, deepAssign, isNonEmptyArray, deduplicateArray } from "../utils";
|
|
14
|
-
const getXdmPropositions = xdm => {
|
|
15
|
-
return xdm &&
|
|
16
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
17
|
-
xdm._experience &&
|
|
18
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
19
|
-
xdm._experience.decisioning &&
|
|
20
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
21
|
-
isNonEmptyArray(xdm._experience.decisioning.propositions) ?
|
|
22
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
23
|
-
xdm._experience.decisioning.propositions : [];
|
|
24
|
-
};
|
|
25
|
-
export default (() => {
|
|
26
|
-
const content = {};
|
|
27
|
-
let userXdm;
|
|
28
|
-
let userData;
|
|
29
|
-
let documentMayUnload = false;
|
|
30
|
-
let isFinalized = false;
|
|
31
|
-
let shouldSendEvent = true;
|
|
32
|
-
const throwIfEventFinalized = methodName => {
|
|
33
|
-
if (isFinalized) {
|
|
34
|
-
throw new Error(`${methodName} cannot be called after event is finalized.`);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
const event = {
|
|
38
|
-
hasQuery() {
|
|
39
|
-
return Object.prototype.hasOwnProperty.call(this.getContent(), "query");
|
|
40
|
-
},
|
|
41
|
-
getContent() {
|
|
42
|
-
const currentContent = JSON.parse(JSON.stringify(content));
|
|
43
|
-
if (userXdm) {
|
|
44
|
-
deepAssign(currentContent, {
|
|
45
|
-
xdm: userXdm
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
if (userData) {
|
|
49
|
-
deepAssign(currentContent, {
|
|
50
|
-
data: userData
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
return currentContent;
|
|
54
|
-
},
|
|
55
|
-
setUserXdm(value) {
|
|
56
|
-
throwIfEventFinalized("setUserXdm");
|
|
57
|
-
userXdm = value;
|
|
58
|
-
},
|
|
59
|
-
setUserData(value) {
|
|
60
|
-
throwIfEventFinalized("setUserData");
|
|
61
|
-
userData = value;
|
|
62
|
-
},
|
|
63
|
-
mergeXdm(xdm) {
|
|
64
|
-
throwIfEventFinalized("mergeXdm");
|
|
65
|
-
if (xdm) {
|
|
66
|
-
deepAssign(content, {
|
|
67
|
-
xdm
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
mergeData(data) {
|
|
72
|
-
throwIfEventFinalized("mergeData");
|
|
73
|
-
if (data) {
|
|
74
|
-
deepAssign(content, {
|
|
75
|
-
data
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
mergeMeta(meta) {
|
|
80
|
-
throwIfEventFinalized("mergeMeta");
|
|
81
|
-
if (meta) {
|
|
82
|
-
deepAssign(content, {
|
|
83
|
-
meta
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
mergeQuery(query) {
|
|
88
|
-
throwIfEventFinalized("mergeQuery");
|
|
89
|
-
if (query) {
|
|
90
|
-
deepAssign(content, {
|
|
91
|
-
query
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
documentMayUnload() {
|
|
96
|
-
documentMayUnload = true;
|
|
97
|
-
},
|
|
98
|
-
finalize(onBeforeEventSend) {
|
|
99
|
-
if (isFinalized) {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
const newPropositions = deduplicateArray([...getXdmPropositions(userXdm), ...getXdmPropositions(content.xdm)], (a, b) => a === b || a.id && b.id && a.id === b.id && a.scope && b.scope && a.scope === b.scope);
|
|
103
|
-
if (userXdm) {
|
|
104
|
-
this.mergeXdm(userXdm);
|
|
105
|
-
}
|
|
106
|
-
if (newPropositions.length > 0) {
|
|
107
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
108
|
-
content.xdm._experience.decisioning.propositions = newPropositions;
|
|
109
|
-
}
|
|
110
|
-
if (userData) {
|
|
111
|
-
event.mergeData(userData);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// the event should already be considered finalized in case onBeforeEventSend throws an error
|
|
115
|
-
isFinalized = true;
|
|
116
|
-
if (onBeforeEventSend) {
|
|
117
|
-
// assume that the onBeforeEventSend callback will fail (in-case of an error)
|
|
118
|
-
shouldSendEvent = false;
|
|
119
|
-
|
|
120
|
-
// this allows the user to replace the xdm and data properties
|
|
121
|
-
// on the object passed to the callback
|
|
122
|
-
const tempContent = {
|
|
123
|
-
xdm: content.xdm || {},
|
|
124
|
-
data: content.data || {}
|
|
125
|
-
};
|
|
126
|
-
const result = onBeforeEventSend(tempContent);
|
|
127
|
-
shouldSendEvent = result !== false;
|
|
128
|
-
content.xdm = tempContent.xdm || {};
|
|
129
|
-
content.data = tempContent.data || {};
|
|
130
|
-
if (isEmptyObject(content.xdm)) {
|
|
131
|
-
delete content.xdm;
|
|
132
|
-
}
|
|
133
|
-
if (isEmptyObject(content.data)) {
|
|
134
|
-
delete content.data;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
getDocumentMayUnload() {
|
|
139
|
-
return documentMayUnload;
|
|
140
|
-
},
|
|
141
|
-
isEmpty() {
|
|
142
|
-
return isEmptyObject(content) && (!userXdm || isEmptyObject(userXdm)) && (!userData || isEmptyObject(userData));
|
|
143
|
-
},
|
|
144
|
-
shouldSend() {
|
|
145
|
-
return shouldSendEvent;
|
|
146
|
-
},
|
|
147
|
-
getViewName() {
|
|
148
|
-
if (!userXdm || !userXdm.web || !userXdm.web.webPageDetails) {
|
|
149
|
-
return undefined;
|
|
150
|
-
}
|
|
151
|
-
return userXdm.web.webPageDetails.viewName;
|
|
152
|
-
},
|
|
153
|
-
toJSON() {
|
|
154
|
-
if (!isFinalized) {
|
|
155
|
-
throw new Error("toJSON called before finalize");
|
|
156
|
-
}
|
|
157
|
-
return content;
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
return event;
|
|
161
|
-
});
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2019 Adobe. All rights reserved.
|
|
3
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import PAGE_WIDE_SCOPE from "../constants/pageWideScope";
|
|
14
|
-
import { createCallbackAggregator, noop } from "../utils";
|
|
15
|
-
import { createRequestParams } from "../utils/request";
|
|
16
|
-
const EVENT_CANCELLATION_MESSAGE = "Event was canceled because the onBeforeEventSend callback returned false.";
|
|
17
|
-
export default (({
|
|
18
|
-
config,
|
|
19
|
-
logger,
|
|
20
|
-
lifecycle,
|
|
21
|
-
consent,
|
|
22
|
-
createEvent,
|
|
23
|
-
createDataCollectionRequestPayload,
|
|
24
|
-
createDataCollectionRequest,
|
|
25
|
-
sendEdgeNetworkRequest,
|
|
26
|
-
applyResponse
|
|
27
|
-
}) => {
|
|
28
|
-
const {
|
|
29
|
-
onBeforeEventSend,
|
|
30
|
-
edgeConfigOverrides: globalConfigOverrides
|
|
31
|
-
} = config;
|
|
32
|
-
return {
|
|
33
|
-
createEvent,
|
|
34
|
-
/**
|
|
35
|
-
* Sends an event. This includes running the event and payload through the
|
|
36
|
-
* appropriate lifecycle hooks, sending the request to the server, and
|
|
37
|
-
* handling the response.
|
|
38
|
-
* @param {Object} event This will be JSON stringified and used inside the
|
|
39
|
-
* request payload.
|
|
40
|
-
* @param {Object} [options] Options to pass on to the onBeforeEvent
|
|
41
|
-
* lifecycle method
|
|
42
|
-
* @param {Object} [options.edgeConfigOverrides] Settings that take
|
|
43
|
-
* precedence over the global datastream configuration, including which
|
|
44
|
-
* datastream to use.
|
|
45
|
-
* @returns {*}
|
|
46
|
-
*/
|
|
47
|
-
sendEvent(event, options = {}) {
|
|
48
|
-
const {
|
|
49
|
-
edgeConfigOverrides: localConfigOverrides,
|
|
50
|
-
...otherOptions
|
|
51
|
-
} = options;
|
|
52
|
-
const requestParams = createRequestParams({
|
|
53
|
-
payload: createDataCollectionRequestPayload(),
|
|
54
|
-
localConfigOverrides,
|
|
55
|
-
globalConfigOverrides
|
|
56
|
-
});
|
|
57
|
-
const request = createDataCollectionRequest(requestParams);
|
|
58
|
-
const onResponseCallbackAggregator = createCallbackAggregator();
|
|
59
|
-
const onRequestFailureCallbackAggregator = createCallbackAggregator();
|
|
60
|
-
return lifecycle.onBeforeEvent({
|
|
61
|
-
...otherOptions,
|
|
62
|
-
event,
|
|
63
|
-
onResponse: onResponseCallbackAggregator.add,
|
|
64
|
-
onRequestFailure: onRequestFailureCallbackAggregator.add
|
|
65
|
-
}).then(() => {
|
|
66
|
-
requestParams.payload.addEvent(event);
|
|
67
|
-
return consent.awaitConsent();
|
|
68
|
-
}).then(() => {
|
|
69
|
-
try {
|
|
70
|
-
// NOTE: this calls onBeforeEventSend callback (if configured)
|
|
71
|
-
event.finalize(onBeforeEventSend);
|
|
72
|
-
} catch (error) {
|
|
73
|
-
const throwError = () => {
|
|
74
|
-
throw error;
|
|
75
|
-
};
|
|
76
|
-
onRequestFailureCallbackAggregator.add(lifecycle.onRequestFailure);
|
|
77
|
-
return onRequestFailureCallbackAggregator.call({
|
|
78
|
-
error
|
|
79
|
-
}).then(throwError, throwError);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// if the callback returns false, the event should not be sent
|
|
83
|
-
if (!event.shouldSend()) {
|
|
84
|
-
onRequestFailureCallbackAggregator.add(lifecycle.onRequestFailure);
|
|
85
|
-
logger.info(EVENT_CANCELLATION_MESSAGE);
|
|
86
|
-
const error = new Error(EVENT_CANCELLATION_MESSAGE);
|
|
87
|
-
return onRequestFailureCallbackAggregator.call({
|
|
88
|
-
error
|
|
89
|
-
}).then(() => {
|
|
90
|
-
// Ensure the promise gets resolved with undefined instead
|
|
91
|
-
// of an array of return values from the callbacks.
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
return sendEdgeNetworkRequest({
|
|
95
|
-
request,
|
|
96
|
-
runOnResponseCallbacks: onResponseCallbackAggregator.call,
|
|
97
|
-
runOnRequestFailureCallbacks: onRequestFailureCallbackAggregator.call
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
},
|
|
101
|
-
applyResponse(event, options = {}) {
|
|
102
|
-
const {
|
|
103
|
-
renderDecisions = false,
|
|
104
|
-
decisionContext = {},
|
|
105
|
-
responseHeaders = {},
|
|
106
|
-
responseBody = {
|
|
107
|
-
handle: []
|
|
108
|
-
},
|
|
109
|
-
personalization
|
|
110
|
-
} = options;
|
|
111
|
-
const payload = createDataCollectionRequestPayload();
|
|
112
|
-
const request = createDataCollectionRequest({
|
|
113
|
-
payload
|
|
114
|
-
});
|
|
115
|
-
const onResponseCallbackAggregator = createCallbackAggregator();
|
|
116
|
-
return lifecycle.onBeforeEvent({
|
|
117
|
-
event,
|
|
118
|
-
renderDecisions,
|
|
119
|
-
decisionContext,
|
|
120
|
-
decisionScopes: [PAGE_WIDE_SCOPE],
|
|
121
|
-
personalization,
|
|
122
|
-
onResponse: onResponseCallbackAggregator.add,
|
|
123
|
-
onRequestFailure: noop
|
|
124
|
-
}).then(() => {
|
|
125
|
-
payload.addEvent(event);
|
|
126
|
-
return applyResponse({
|
|
127
|
-
request,
|
|
128
|
-
responseHeaders,
|
|
129
|
-
responseBody,
|
|
130
|
-
runOnResponseCallbacks: onResponseCallbackAggregator.call
|
|
131
|
-
});
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
});
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2019 Adobe. All rights reserved.
|
|
3
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
export default (executeCommand => {
|
|
14
|
-
return args => {
|
|
15
|
-
// Would use destructuring, but destructuring doesn't work on IE
|
|
16
|
-
// without polyfilling Symbol.
|
|
17
|
-
// https://github.com/babel/babel/issues/7597
|
|
18
|
-
const resolve = args[0];
|
|
19
|
-
const reject = args[1];
|
|
20
|
-
const userProvidedArgs = args[2];
|
|
21
|
-
const commandName = userProvidedArgs[0];
|
|
22
|
-
const options = userProvidedArgs[1];
|
|
23
|
-
executeCommand(commandName, options).then(resolve, reject);
|
|
24
|
-
};
|
|
25
|
-
});
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2019 Adobe. All rights reserved.
|
|
3
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
// TO-DOCUMENT: Lifecycle hooks and their params.
|
|
14
|
-
const hookNames = [
|
|
15
|
-
// Called after all components have been registered.
|
|
16
|
-
"onComponentsRegistered",
|
|
17
|
-
// Called before an event is sent on a data collection request
|
|
18
|
-
"onBeforeEvent",
|
|
19
|
-
// Called before each request is made to the edge.
|
|
20
|
-
"onBeforeRequest",
|
|
21
|
-
// Called after each response is returned from the edge with a successful
|
|
22
|
-
// status code
|
|
23
|
-
"onResponse",
|
|
24
|
-
// Called after a network request to the edge fails. Either the request
|
|
25
|
-
// didn't make it to the edge, didn't make it to Konductor, or Konductor
|
|
26
|
-
// failed to return a regularly-structured response. (In this case { error }
|
|
27
|
-
// is passed as the parameter)
|
|
28
|
-
// Also called when the respone returns a 400 or 500 error. (In this case
|
|
29
|
-
// { response } is passed as the parameter)
|
|
30
|
-
"onRequestFailure",
|
|
31
|
-
// A user clicked on an element.
|
|
32
|
-
"onClick",
|
|
33
|
-
// Called by DecisioningEngine when a ruleset is satisfied with a list of
|
|
34
|
-
// propositions
|
|
35
|
-
"onDecision"];
|
|
36
|
-
const createHook = (componentRegistry, hookName) => {
|
|
37
|
-
return (...args) => {
|
|
38
|
-
return Promise.all(componentRegistry.getLifecycleCallbacks(hookName).map(callback => {
|
|
39
|
-
return new Promise(resolve => {
|
|
40
|
-
resolve(callback(...args));
|
|
41
|
-
});
|
|
42
|
-
}));
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* This ensures that if a component's lifecycle method X
|
|
48
|
-
* attempts to execute lifecycle method Y, that all X methods on all components
|
|
49
|
-
* will have been called before any of their Y methods are called. It does
|
|
50
|
-
* this by kicking the call to the Y method to the next JavaScript tick.
|
|
51
|
-
* @returns {function}
|
|
52
|
-
*/
|
|
53
|
-
const guardHook = fn => {
|
|
54
|
-
return (...args) => {
|
|
55
|
-
return Promise.resolve().then(() => {
|
|
56
|
-
return fn(...args);
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
export default (componentRegistry => {
|
|
61
|
-
return hookNames.reduce((memo, hookName) => {
|
|
62
|
-
memo[hookName] = guardHook(createHook(componentRegistry, hookName));
|
|
63
|
-
return memo;
|
|
64
|
-
}, {});
|
|
65
|
-
});
|