@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
package/libEs6/core/index.js
DELETED
|
@@ -1,236 +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 createInstanceFunction from "./createInstanceFunction";
|
|
14
|
-
import { getApexDomain, injectStorage, cookieJar, isFunction, createLoggingCookieJar, injectFireReferrerHideableImage } from "../utils";
|
|
15
|
-
import createLogController from "./createLogController";
|
|
16
|
-
import createLifecycle from "./createLifecycle";
|
|
17
|
-
import createComponentRegistry from "./createComponentRegistry";
|
|
18
|
-
import injectSendNetworkRequest from "./network/injectSendNetworkRequest";
|
|
19
|
-
import injectExtractEdgeInfo from "./edgeNetwork/injectExtractEdgeInfo";
|
|
20
|
-
import createConsent from "./consent/createConsent";
|
|
21
|
-
import createConsentStateMachine from "./consent/createConsentStateMachine";
|
|
22
|
-
import createEvent from "./createEvent";
|
|
23
|
-
import injectCreateResponse from "./injectCreateResponse";
|
|
24
|
-
import injectExecuteCommand from "./injectExecuteCommand";
|
|
25
|
-
import validateCommandOptions from "./validateCommandOptions";
|
|
26
|
-
import componentCreators from "./componentCreators";
|
|
27
|
-
import buildAndValidateConfig from "./buildAndValidateConfig";
|
|
28
|
-
import initializeComponents from "./initializeComponents";
|
|
29
|
-
import createConfig from "./config/createConfig";
|
|
30
|
-
import createCoreConfigs from "./config/createCoreConfigs";
|
|
31
|
-
import injectHandleError from "./injectHandleError";
|
|
32
|
-
import injectSendFetchRequest from "./network/requestMethods/injectSendFetchRequest";
|
|
33
|
-
import injectSendXhrRequest from "./network/requestMethods/injectSendXhrRequest";
|
|
34
|
-
import injectSendBeaconRequest from "./network/requestMethods/injectSendBeaconRequest";
|
|
35
|
-
import createLogger from "./createLogger";
|
|
36
|
-
import createEventManager from "./createEventManager";
|
|
37
|
-
import createCookieTransfer from "./createCookieTransfer";
|
|
38
|
-
import injectShouldTransferCookie from "./injectShouldTransferCookie";
|
|
39
|
-
import { createDataCollectionRequest, createDataCollectionRequestPayload, createGetAssuranceValidationTokenParams } from "../utils/request";
|
|
40
|
-
import injectSendEdgeNetworkRequest from "./edgeNetwork/injectSendEdgeNetworkRequest";
|
|
41
|
-
import injectProcessWarningsAndErrors from "./edgeNetwork/injectProcessWarningsAndErrors";
|
|
42
|
-
import injectGetLocationHint from "./edgeNetwork/injectGetLocationHint";
|
|
43
|
-
import isRequestRetryable from "./network/isRequestRetryable";
|
|
44
|
-
import getRequestRetryDelay from "./network/getRequestRetryDelay";
|
|
45
|
-
import injectApplyResponse from "./edgeNetwork/injectApplyResponse";
|
|
46
|
-
const createNamespacedStorage = injectStorage(window);
|
|
47
|
-
const {
|
|
48
|
-
console,
|
|
49
|
-
fetch,
|
|
50
|
-
navigator,
|
|
51
|
-
XMLHttpRequest
|
|
52
|
-
} = window;
|
|
53
|
-
|
|
54
|
-
// set this up as a function so that monitors can be added at anytime
|
|
55
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
56
|
-
const getMonitors = () => window.__alloyMonitors || [];
|
|
57
|
-
const coreConfigValidators = createCoreConfigs();
|
|
58
|
-
const apexDomain = getApexDomain(window, cookieJar);
|
|
59
|
-
const sendFetchRequest = isFunction(fetch) ? injectSendFetchRequest({
|
|
60
|
-
fetch
|
|
61
|
-
}) : injectSendXhrRequest({
|
|
62
|
-
XMLHttpRequest
|
|
63
|
-
});
|
|
64
|
-
const fireReferrerHideableImage = injectFireReferrerHideableImage();
|
|
65
|
-
const getAssuranceValidationTokenParams = createGetAssuranceValidationTokenParams({
|
|
66
|
-
window,
|
|
67
|
-
createNamespacedStorage
|
|
68
|
-
});
|
|
69
|
-
export const createExecuteCommand = ({
|
|
70
|
-
instanceName,
|
|
71
|
-
logController: {
|
|
72
|
-
setDebugEnabled,
|
|
73
|
-
logger,
|
|
74
|
-
createComponentLogger
|
|
75
|
-
}
|
|
76
|
-
}) => {
|
|
77
|
-
const componentRegistry = createComponentRegistry();
|
|
78
|
-
const lifecycle = createLifecycle(componentRegistry);
|
|
79
|
-
const setDebugCommand = options => {
|
|
80
|
-
setDebugEnabled(options.enabled, {
|
|
81
|
-
fromConfig: false
|
|
82
|
-
});
|
|
83
|
-
};
|
|
84
|
-
const loggingCookieJar = createLoggingCookieJar({
|
|
85
|
-
logger,
|
|
86
|
-
cookieJar
|
|
87
|
-
});
|
|
88
|
-
const configureCommand = options => {
|
|
89
|
-
const config = buildAndValidateConfig({
|
|
90
|
-
options,
|
|
91
|
-
componentCreators,
|
|
92
|
-
coreConfigValidators,
|
|
93
|
-
createConfig,
|
|
94
|
-
logger,
|
|
95
|
-
setDebugEnabled
|
|
96
|
-
});
|
|
97
|
-
const {
|
|
98
|
-
orgId,
|
|
99
|
-
targetMigrationEnabled
|
|
100
|
-
} = config;
|
|
101
|
-
const shouldTransferCookie = injectShouldTransferCookie({
|
|
102
|
-
orgId,
|
|
103
|
-
targetMigrationEnabled
|
|
104
|
-
});
|
|
105
|
-
const cookieTransfer = createCookieTransfer({
|
|
106
|
-
cookieJar: loggingCookieJar,
|
|
107
|
-
shouldTransferCookie,
|
|
108
|
-
apexDomain,
|
|
109
|
-
dateProvider: () => new Date()
|
|
110
|
-
});
|
|
111
|
-
const sendBeaconRequest = isFunction(navigator.sendBeacon) ? injectSendBeaconRequest({
|
|
112
|
-
// Without the bind(), the browser will complain about an
|
|
113
|
-
// illegal invocation.
|
|
114
|
-
sendBeacon: navigator.sendBeacon.bind(navigator),
|
|
115
|
-
sendFetchRequest,
|
|
116
|
-
logger
|
|
117
|
-
}) : sendFetchRequest;
|
|
118
|
-
const sendNetworkRequest = injectSendNetworkRequest({
|
|
119
|
-
logger,
|
|
120
|
-
sendFetchRequest,
|
|
121
|
-
sendBeaconRequest,
|
|
122
|
-
isRequestRetryable,
|
|
123
|
-
getRequestRetryDelay
|
|
124
|
-
});
|
|
125
|
-
const processWarningsAndErrors = injectProcessWarningsAndErrors({
|
|
126
|
-
logger
|
|
127
|
-
});
|
|
128
|
-
const extractEdgeInfo = injectExtractEdgeInfo({
|
|
129
|
-
logger
|
|
130
|
-
});
|
|
131
|
-
const createResponse = injectCreateResponse({
|
|
132
|
-
extractEdgeInfo
|
|
133
|
-
});
|
|
134
|
-
const getLocationHint = injectGetLocationHint({
|
|
135
|
-
orgId,
|
|
136
|
-
cookieJar
|
|
137
|
-
});
|
|
138
|
-
const sendEdgeNetworkRequest = injectSendEdgeNetworkRequest({
|
|
139
|
-
config,
|
|
140
|
-
lifecycle,
|
|
141
|
-
cookieTransfer,
|
|
142
|
-
sendNetworkRequest,
|
|
143
|
-
createResponse,
|
|
144
|
-
processWarningsAndErrors,
|
|
145
|
-
getLocationHint,
|
|
146
|
-
getAssuranceValidationTokenParams
|
|
147
|
-
});
|
|
148
|
-
const applyResponse = injectApplyResponse({
|
|
149
|
-
lifecycle,
|
|
150
|
-
cookieTransfer,
|
|
151
|
-
createResponse,
|
|
152
|
-
processWarningsAndErrors
|
|
153
|
-
});
|
|
154
|
-
const generalConsentState = createConsentStateMachine({
|
|
155
|
-
logger
|
|
156
|
-
});
|
|
157
|
-
const consent = createConsent({
|
|
158
|
-
generalConsentState,
|
|
159
|
-
logger
|
|
160
|
-
});
|
|
161
|
-
const eventManager = createEventManager({
|
|
162
|
-
config,
|
|
163
|
-
logger,
|
|
164
|
-
lifecycle,
|
|
165
|
-
consent,
|
|
166
|
-
createEvent,
|
|
167
|
-
createDataCollectionRequestPayload,
|
|
168
|
-
createDataCollectionRequest,
|
|
169
|
-
sendEdgeNetworkRequest,
|
|
170
|
-
applyResponse
|
|
171
|
-
});
|
|
172
|
-
return initializeComponents({
|
|
173
|
-
componentCreators,
|
|
174
|
-
lifecycle,
|
|
175
|
-
componentRegistry,
|
|
176
|
-
getImmediatelyAvailableTools(componentName) {
|
|
177
|
-
const componentLogger = createComponentLogger(componentName);
|
|
178
|
-
return {
|
|
179
|
-
config,
|
|
180
|
-
componentRegistry,
|
|
181
|
-
consent,
|
|
182
|
-
eventManager,
|
|
183
|
-
fireReferrerHideableImage,
|
|
184
|
-
logger: componentLogger,
|
|
185
|
-
lifecycle,
|
|
186
|
-
sendEdgeNetworkRequest,
|
|
187
|
-
handleError: injectHandleError({
|
|
188
|
-
errorPrefix: `[${instanceName}] [${componentName}]`,
|
|
189
|
-
logger: componentLogger
|
|
190
|
-
}),
|
|
191
|
-
createNamespacedStorage,
|
|
192
|
-
apexDomain
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
};
|
|
197
|
-
const handleError = injectHandleError({
|
|
198
|
-
errorPrefix: `[${instanceName}]`,
|
|
199
|
-
logger
|
|
200
|
-
});
|
|
201
|
-
const executeCommand = injectExecuteCommand({
|
|
202
|
-
logger,
|
|
203
|
-
configureCommand,
|
|
204
|
-
setDebugCommand,
|
|
205
|
-
handleError,
|
|
206
|
-
validateCommandOptions
|
|
207
|
-
});
|
|
208
|
-
return executeCommand;
|
|
209
|
-
};
|
|
210
|
-
export default (() => {
|
|
211
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
212
|
-
const instanceNames = window.__alloyNS;
|
|
213
|
-
if (instanceNames) {
|
|
214
|
-
instanceNames.forEach(instanceName => {
|
|
215
|
-
const logController = createLogController({
|
|
216
|
-
console,
|
|
217
|
-
locationSearch: window.location.search,
|
|
218
|
-
createLogger,
|
|
219
|
-
instanceName,
|
|
220
|
-
createNamespacedStorage,
|
|
221
|
-
getMonitors
|
|
222
|
-
});
|
|
223
|
-
const executeCommand = createExecuteCommand({
|
|
224
|
-
instanceName,
|
|
225
|
-
logController
|
|
226
|
-
});
|
|
227
|
-
const instance = createInstanceFunction(executeCommand);
|
|
228
|
-
const queue = window[instanceName].q;
|
|
229
|
-
queue.push = instance;
|
|
230
|
-
logController.logger.logOnInstanceCreated({
|
|
231
|
-
instance
|
|
232
|
-
});
|
|
233
|
-
queue.forEach(instance);
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
});
|
|
@@ -1,40 +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 { stackError } from "../utils";
|
|
14
|
-
export default (({
|
|
15
|
-
componentCreators,
|
|
16
|
-
lifecycle,
|
|
17
|
-
componentRegistry,
|
|
18
|
-
getImmediatelyAvailableTools
|
|
19
|
-
}) => {
|
|
20
|
-
componentCreators.forEach(createComponent => {
|
|
21
|
-
const {
|
|
22
|
-
namespace
|
|
23
|
-
} = createComponent;
|
|
24
|
-
// TO-DOCUMENT: Helpers that we inject into factories.
|
|
25
|
-
const tools = getImmediatelyAvailableTools(namespace);
|
|
26
|
-
let component;
|
|
27
|
-
try {
|
|
28
|
-
component = createComponent(tools);
|
|
29
|
-
} catch (error) {
|
|
30
|
-
throw stackError({
|
|
31
|
-
error,
|
|
32
|
-
message: `[${namespace}] An error occurred during component creation.`
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
componentRegistry.register(namespace, component);
|
|
36
|
-
});
|
|
37
|
-
return lifecycle.onComponentsRegistered({
|
|
38
|
-
lifecycle
|
|
39
|
-
}).then(() => componentRegistry);
|
|
40
|
-
});
|
|
@@ -1,70 +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 { flatMap } from "../utils";
|
|
14
|
-
import { ADOBE_EDGE } from "../constants/httpHeaderNames";
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Creates a representation of a gateway response with the addition of
|
|
18
|
-
* helper methods.
|
|
19
|
-
* @returns Response
|
|
20
|
-
*/
|
|
21
|
-
export default (({
|
|
22
|
-
extractEdgeInfo
|
|
23
|
-
}) => ({
|
|
24
|
-
content = {},
|
|
25
|
-
getHeader
|
|
26
|
-
}) => {
|
|
27
|
-
const {
|
|
28
|
-
handle = [],
|
|
29
|
-
errors = [],
|
|
30
|
-
warnings = []
|
|
31
|
-
} = content;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Response object.
|
|
35
|
-
* @typedef {Object} Response
|
|
36
|
-
*/
|
|
37
|
-
return {
|
|
38
|
-
/**
|
|
39
|
-
* Returns matching fragments of the response by type.
|
|
40
|
-
* @param {String} type A string with the current format: <namespace:action>
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* getPayloadsByType("identity:persist")
|
|
44
|
-
*/
|
|
45
|
-
getPayloadsByType(type) {
|
|
46
|
-
return flatMap(handle.filter(fragment => fragment.type === type), fragment => fragment.payload);
|
|
47
|
-
},
|
|
48
|
-
/**
|
|
49
|
-
* Returns all errors.
|
|
50
|
-
*/
|
|
51
|
-
getErrors() {
|
|
52
|
-
return errors;
|
|
53
|
-
},
|
|
54
|
-
/**
|
|
55
|
-
* Returns all warnings.
|
|
56
|
-
*/
|
|
57
|
-
getWarnings() {
|
|
58
|
-
return warnings;
|
|
59
|
-
},
|
|
60
|
-
/**
|
|
61
|
-
* Returns an object containing the regionId from the x-adobe-edge header
|
|
62
|
-
*/
|
|
63
|
-
getEdge() {
|
|
64
|
-
return extractEdgeInfo(getHeader(ADOBE_EDGE));
|
|
65
|
-
},
|
|
66
|
-
toJSON() {
|
|
67
|
-
return content;
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
});
|
|
@@ -1,100 +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 { isFunction, isObject } from "../utils";
|
|
14
|
-
import { CONFIGURE, SET_DEBUG } from "../constants/coreCommands";
|
|
15
|
-
export default (({
|
|
16
|
-
logger,
|
|
17
|
-
configureCommand,
|
|
18
|
-
setDebugCommand,
|
|
19
|
-
handleError,
|
|
20
|
-
validateCommandOptions
|
|
21
|
-
}) => {
|
|
22
|
-
let configurePromise;
|
|
23
|
-
const getExecutor = (commandName, options) => {
|
|
24
|
-
let executor;
|
|
25
|
-
if (commandName === CONFIGURE) {
|
|
26
|
-
if (configurePromise) {
|
|
27
|
-
throw new Error("The library has already been configured and may only be configured once.");
|
|
28
|
-
}
|
|
29
|
-
executor = () => {
|
|
30
|
-
configurePromise = configureCommand(options);
|
|
31
|
-
return configurePromise.then(() => {
|
|
32
|
-
// Don't expose internals to the user.
|
|
33
|
-
});
|
|
34
|
-
};
|
|
35
|
-
} else {
|
|
36
|
-
if (!configurePromise) {
|
|
37
|
-
throw new Error(`The library must be configured first. Please do so by executing the configure command.`);
|
|
38
|
-
}
|
|
39
|
-
if (commandName === SET_DEBUG) {
|
|
40
|
-
executor = () => setDebugCommand(options);
|
|
41
|
-
} else {
|
|
42
|
-
executor = () => {
|
|
43
|
-
return configurePromise.then(componentRegistry => {
|
|
44
|
-
const command = componentRegistry.getCommand(commandName);
|
|
45
|
-
if (!command || !isFunction(command.run)) {
|
|
46
|
-
const commandNames = [CONFIGURE, SET_DEBUG].concat(componentRegistry.getCommandNames()).join(", ");
|
|
47
|
-
throw new Error(`The ${commandName} command does not exist. List of available commands: ${commandNames}.`);
|
|
48
|
-
}
|
|
49
|
-
const validatedOptions = validateCommandOptions({
|
|
50
|
-
command,
|
|
51
|
-
options
|
|
52
|
-
});
|
|
53
|
-
return command.run(validatedOptions);
|
|
54
|
-
}, () => {
|
|
55
|
-
logger.warn(`An error during configuration is preventing the ${commandName} command from executing.`);
|
|
56
|
-
// If configuration failed, we prevent the configuration
|
|
57
|
-
// error from bubbling here because we don't want the
|
|
58
|
-
// configuration error to be reported in the console every
|
|
59
|
-
// time any command is executed. Only having it bubble
|
|
60
|
-
// once when the configure command runs is sufficient.
|
|
61
|
-
// Instead, for this command, we'll just return a promise
|
|
62
|
-
// that never gets resolved.
|
|
63
|
-
return new Promise(() => {});
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return executor;
|
|
69
|
-
};
|
|
70
|
-
return (commandName, options = {}) => {
|
|
71
|
-
return new Promise(resolve => {
|
|
72
|
-
// We have to wrap the getExecutor() call in the promise so the promise
|
|
73
|
-
// will be rejected if getExecutor() throws errors.
|
|
74
|
-
const executor = getExecutor(commandName, options);
|
|
75
|
-
logger.logOnBeforeCommand({
|
|
76
|
-
commandName,
|
|
77
|
-
options
|
|
78
|
-
});
|
|
79
|
-
resolve(executor());
|
|
80
|
-
}).catch(error => {
|
|
81
|
-
return handleError(error, `${commandName} command`);
|
|
82
|
-
}).catch(error => {
|
|
83
|
-
logger.logOnCommandRejected({
|
|
84
|
-
commandName,
|
|
85
|
-
options,
|
|
86
|
-
error
|
|
87
|
-
});
|
|
88
|
-
throw error;
|
|
89
|
-
}).then(rawResult => {
|
|
90
|
-
// We should always be returning an object from every command.
|
|
91
|
-
const result = isObject(rawResult) ? rawResult : {};
|
|
92
|
-
logger.logOnCommandResolved({
|
|
93
|
-
commandName,
|
|
94
|
-
options,
|
|
95
|
-
result
|
|
96
|
-
});
|
|
97
|
-
return result;
|
|
98
|
-
});
|
|
99
|
-
};
|
|
100
|
-
});
|
|
@@ -1,33 +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 { toError, updateErrorMessage } from "../utils";
|
|
14
|
-
import { DECLINED_CONSENT_ERROR_CODE } from "./consent/createConsentStateMachine";
|
|
15
|
-
export default (({
|
|
16
|
-
errorPrefix,
|
|
17
|
-
logger
|
|
18
|
-
}) => (error, operation) => {
|
|
19
|
-
const err = toError(error);
|
|
20
|
-
|
|
21
|
-
// In the case of declined consent, we've opted to not reject the promise
|
|
22
|
-
// returned to the customer, but instead resolve the promise with an
|
|
23
|
-
// empty result object.
|
|
24
|
-
if (err.code === DECLINED_CONSENT_ERROR_CODE) {
|
|
25
|
-
logger.warn(`The ${operation} could not fully complete. ${err.message}`);
|
|
26
|
-
return {};
|
|
27
|
-
}
|
|
28
|
-
updateErrorMessage({
|
|
29
|
-
error: err,
|
|
30
|
-
message: `${errorPrefix} ${err.message}`
|
|
31
|
-
});
|
|
32
|
-
throw err;
|
|
33
|
-
});
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2022 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 { isNamespacedCookieName } from "../utils";
|
|
14
|
-
import { AT_QA_MODE, MBOX } from "../constants/legacyCookies";
|
|
15
|
-
export default (({
|
|
16
|
-
orgId,
|
|
17
|
-
targetMigrationEnabled
|
|
18
|
-
}) => name => {
|
|
19
|
-
// We have a contract with the server that we will pass
|
|
20
|
-
// all cookies whose names are namespaced according to the
|
|
21
|
-
// logic in isNamespacedCookieName as well as any legacy
|
|
22
|
-
// cookie names (so that the server can handle migrating
|
|
23
|
-
// identities on websites previously using Visitor.js)
|
|
24
|
-
return isNamespacedCookieName(orgId, name) || name === AT_QA_MODE || targetMigrationEnabled && name === MBOX;
|
|
25
|
-
});
|
|
@@ -1,72 +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 { RETRY_AFTER } from "../../constants/httpHeaderNames";
|
|
14
|
-
import { isInteger } from "../../utils";
|
|
15
|
-
|
|
16
|
-
// The retry gets incrementally (but not exponentially) longer for each retry.
|
|
17
|
-
const FIRST_DELAY_MILLIS = 1000;
|
|
18
|
-
const INCREMENTAL_DELAY_MILLIS = 1000;
|
|
19
|
-
|
|
20
|
-
// When the target delay is randomized, make it within the range of this percentage above or below the target delay.
|
|
21
|
-
const MAX_RANDOM_VARIANCE_PERCENTAGE = 0.3;
|
|
22
|
-
const calculateRetryDelay = retriesAttempted => {
|
|
23
|
-
const targetDelay = FIRST_DELAY_MILLIS + retriesAttempted * INCREMENTAL_DELAY_MILLIS;
|
|
24
|
-
const maxVariance = targetDelay * MAX_RANDOM_VARIANCE_PERCENTAGE;
|
|
25
|
-
const minDelay = targetDelay - maxVariance;
|
|
26
|
-
const maxDelay = targetDelay + maxVariance;
|
|
27
|
-
const randomizedDelayWithinRange = Math.round(minDelay + Math.random() * (maxDelay - minDelay));
|
|
28
|
-
return randomizedDelayWithinRange;
|
|
29
|
-
};
|
|
30
|
-
const getDelayFromHeader = response => {
|
|
31
|
-
// According to the HTTP spec, if the header is defined, its value will be a string that
|
|
32
|
-
// represents either:
|
|
33
|
-
// * An integer indicating the number of seconds to delay.
|
|
34
|
-
// * A date after which a retry may occur. The date would be in HTTP-date
|
|
35
|
-
// format (https://tools.ietf.org/html/rfc7231#section-7.1.1.1). When debugging, it can
|
|
36
|
-
// be helpful to know that this is the same format that a JavaScript date's
|
|
37
|
-
// toGMTString() returns.
|
|
38
|
-
const headerValue = response.getHeader(RETRY_AFTER);
|
|
39
|
-
let delayInMillis;
|
|
40
|
-
if (headerValue) {
|
|
41
|
-
const headerValueInt = parseInt(headerValue, 10);
|
|
42
|
-
if (isInteger(headerValueInt)) {
|
|
43
|
-
delayInMillis = headerValueInt * 1000;
|
|
44
|
-
} else {
|
|
45
|
-
delayInMillis = Math.max(0, new Date(headerValue).getTime() - new Date().getTime());
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return delayInMillis;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
// These rules are in accordance with
|
|
52
|
-
// https://git.corp.adobe.com/pages/experience-edge/konductor/#/apis/errors?id=handling-4xx-and-5xx-responses
|
|
53
|
-
// For retry delays that don't come from a Retry-After response header, we try to stick with the following best
|
|
54
|
-
// practices outlined in https://docs.microsoft.com/en-us/azure/architecture/best-practices/transient-faults:
|
|
55
|
-
// * Incremental retry
|
|
56
|
-
// * Random interval
|
|
57
|
-
export default (({
|
|
58
|
-
response,
|
|
59
|
-
retriesAttempted
|
|
60
|
-
}) => {
|
|
61
|
-
// Technically, only 429 or 503 responses should have a Retry-After header, but we'll respect the
|
|
62
|
-
// header if we find it on any response.
|
|
63
|
-
let delayInMillis = getDelayFromHeader(response);
|
|
64
|
-
|
|
65
|
-
// Note that the value of delay may be 0 at this point, which would be a valid delay we want to use
|
|
66
|
-
// and not override, which is why we don't do:
|
|
67
|
-
// if (!delay) { ... }
|
|
68
|
-
if (delayInMillis === undefined) {
|
|
69
|
-
delayInMillis = calculateRetryDelay(retriesAttempted);
|
|
70
|
-
}
|
|
71
|
-
return delayInMillis;
|
|
72
|
-
});
|
|
@@ -1,96 +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 { stackError } from "../../utils";
|
|
14
|
-
export default (({
|
|
15
|
-
logger,
|
|
16
|
-
sendFetchRequest,
|
|
17
|
-
sendBeaconRequest,
|
|
18
|
-
isRequestRetryable,
|
|
19
|
-
getRequestRetryDelay
|
|
20
|
-
}) => {
|
|
21
|
-
/**
|
|
22
|
-
* Send a network request and returns details about the response.
|
|
23
|
-
*/
|
|
24
|
-
return ({
|
|
25
|
-
requestId,
|
|
26
|
-
url,
|
|
27
|
-
payload,
|
|
28
|
-
useSendBeacon
|
|
29
|
-
}) => {
|
|
30
|
-
// We want to log raw payload and event data rather than
|
|
31
|
-
// our fancy wrapper objects. Calling payload.toJSON() is
|
|
32
|
-
// insufficient to get all the nested raw data, because it's
|
|
33
|
-
// not recursive (it doesn't call toJSON() on the event objects).
|
|
34
|
-
// Parsing the result of JSON.stringify(), however, gives the
|
|
35
|
-
// fully recursive raw data.
|
|
36
|
-
const stringifiedPayload = JSON.stringify(payload);
|
|
37
|
-
const parsedPayload = JSON.parse(stringifiedPayload);
|
|
38
|
-
logger.logOnBeforeNetworkRequest({
|
|
39
|
-
url,
|
|
40
|
-
requestId,
|
|
41
|
-
payload: parsedPayload
|
|
42
|
-
});
|
|
43
|
-
const executeRequest = (retriesAttempted = 0) => {
|
|
44
|
-
const requestMethod = useSendBeacon ? sendBeaconRequest : sendFetchRequest;
|
|
45
|
-
return requestMethod(url, stringifiedPayload).then(response => {
|
|
46
|
-
const requestIsRetryable = isRequestRetryable({
|
|
47
|
-
response,
|
|
48
|
-
retriesAttempted
|
|
49
|
-
});
|
|
50
|
-
if (requestIsRetryable) {
|
|
51
|
-
const requestRetryDelay = getRequestRetryDelay({
|
|
52
|
-
response,
|
|
53
|
-
retriesAttempted
|
|
54
|
-
});
|
|
55
|
-
return new Promise(resolve => {
|
|
56
|
-
setTimeout(() => {
|
|
57
|
-
resolve(executeRequest(retriesAttempted + 1));
|
|
58
|
-
}, requestRetryDelay);
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
let parsedBody;
|
|
62
|
-
try {
|
|
63
|
-
parsedBody = JSON.parse(response.body);
|
|
64
|
-
} catch (e) {
|
|
65
|
-
// Non-JSON. Something went wrong.
|
|
66
|
-
}
|
|
67
|
-
logger.logOnNetworkResponse({
|
|
68
|
-
requestId,
|
|
69
|
-
url,
|
|
70
|
-
payload: parsedPayload,
|
|
71
|
-
...response,
|
|
72
|
-
parsedBody,
|
|
73
|
-
retriesAttempted
|
|
74
|
-
});
|
|
75
|
-
return {
|
|
76
|
-
statusCode: response.statusCode,
|
|
77
|
-
body: response.body,
|
|
78
|
-
parsedBody,
|
|
79
|
-
getHeader: response.getHeader
|
|
80
|
-
};
|
|
81
|
-
});
|
|
82
|
-
};
|
|
83
|
-
return executeRequest().catch(error => {
|
|
84
|
-
logger.logOnNetworkError({
|
|
85
|
-
requestId,
|
|
86
|
-
url,
|
|
87
|
-
payload: parsedPayload,
|
|
88
|
-
error
|
|
89
|
-
});
|
|
90
|
-
throw stackError({
|
|
91
|
-
error,
|
|
92
|
-
message: "Network request failed."
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
};
|
|
96
|
-
});
|